刘洋 9 months ago
parent
commit
d478f7d648

+ 6 - 0
src/api/work-hours.js

@@ -115,3 +115,9 @@ export const exportWorkApi = (data) =>
     loading: true,
     download: true,
   });
+export const dingStatisticsApi = (data) =>
+  request({
+    url: '/api/admin/tb/ding/statistic/calculate',
+    params: data,
+    loading: true,
+  });

+ 24 - 0
src/views/service-unit/dispatch/dispatch-manage/allocation-dialog.vue

@@ -200,12 +200,36 @@ const getOptions = () => {
         return item;
       }
     );
+    let arr1 = res.regionCoordinatorInfo.allocatedList || [];
+    for (let i = 0; i < arr1.length; i++) {
+      let item = arr1[i];
+      let id = item.userId;
+      if (!options1.value.find((v) => v.userId == id)) {
+        options1.value.push({
+          str: `${item.supplierName}_${item.name}_${item.mobileNumber || ''}`,
+          ...item,
+          disabled: true,
+        });
+      }
+    }
     options2.value = [...(res.projectManagerInfo.canChooseList || [])].map(
       (item) => {
         item.str = `${item.supplierName}_${item.name}_${item.mobileNumber}`;
         return item;
       }
     );
+    let arr2 = res.projectManagerInfo.allocatedList || [];
+    for (let i = 0; i < arr2.length; i++) {
+      let item = arr2[i];
+      let id = item.userId;
+      if (!options2.value.find((v) => v.userId == id)) {
+        options2.value.push({
+          str: `${item.supplierName}_${item.name}_${item.mobileNumber || ''}`,
+          ...item,
+          disabled: true,
+        });
+      }
+    }
     options3.value = [...(res.engineerInfo.canChooseList || [])].map((item) => {
       item.str = `${item.supplierName}_${item.name}_${item.mobileNumber}`;
       return item;

+ 10 - 1
src/views/work-hours/work-hours-manage/work-statistics/index.vue

@@ -1,6 +1,10 @@
 <template>
   <div class="work-statistics flex flex-col h-full">
     <div v-if="perm.BUTTON_Export" class="page-action">
+      <t-button theme="primary" @click="statisticsHandle">
+        <template #icon><svg-icon name="working-hours" color="#fff" /></template
+        >统计计算
+      </t-button>
       <t-button theme="primary" @click="exportFile">
         <template #icon><svg-icon name="export" color="#fff" /></template
         >导出统计结果
@@ -51,6 +55,7 @@ import {
   workStatisticsExportApi,
   workStatisticsPassApi,
   exportWorkApi,
+  dingStatisticsApi,
 } from '@/api/work-hours';
 import {
   timestampFilter,
@@ -125,7 +130,11 @@ const exportFile = () => {
     MessagePlugin.success('导出成功');
   });
 };
-
+const statisticsHandle = () => {
+  dingStatisticsApi().then(() => {
+    MessagePlugin.success('操作成功');
+  });
+};
 const columns = computed(() => {
   const type = params.type;
   if (!type) {