刘洋 9 ay önce
ebeveyn
işleme
082b181987

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

@@ -108,3 +108,10 @@ export const workStatisticsPassApi = (id) =>
     url: '/api/admin/tb/ding/submit/agree_withdraw',
     params: { dingSubmitId: id },
   });
+export const exportWorkApi = (data) =>
+  request({
+    url: '/api/admin/tb/ding/statistic/export',
+    params: data,
+    loading: true,
+    download: true,
+  });

+ 1 - 1
src/components/common/select-service-unit/index.vue

@@ -16,7 +16,7 @@
   <t-select
     v-model="selected"
     filterable
-    clearable
+    :clearable="attrs.clearable === undefined ? true : attrs.clearable"
     v-bind="attrs"
     @change="onChange"
   >

+ 8 - 9
src/views/resource-guard/person-guard/person-files/add-person-file-dialog.vue

@@ -239,16 +239,15 @@ const { formData, isEdit } = useClearDialog(
   formRef,
   () => {
     for (let key in formData) {
-      if (
-        key === 'projectExperience' &&
-        typeof props.curRow[key] === 'string'
-      ) {
-        let originArr = ['', '', '', '', '', ''];
-        let arr = JSON.parse(props.curRow[key]);
-        for (let i = 0; i < arr.length; i++) {
-          originArr[i] = arr[i];
+      if (key === 'projectExperience') {
+        if (props.curRow.projectExperience) {
+          let originArr = ['', '', '', '', '', ''];
+          let arr = JSON.parse(props.curRow[key]);
+          for (let i = 0; i < arr.length; i++) {
+            originArr[i] = arr[i];
+          }
+          formData['projectExperience'] = originArr;
         }
-        formData['projectExperience'] = originArr;
       } else {
         formData[key] = props.curRow[key];
       }

+ 43 - 10
src/views/sop/sop-manage/project-monitor/index.vue

@@ -35,7 +35,15 @@
             hover="color"
             @click="showCard(row.regionCoordinator?.userId)"
           >
-            {{ row.regionCoordinator?.userName }}
+            {{
+              row.regionCoordinator
+                ? row.regionCoordinator?.supplierName +
+                  '_' +
+                  row.regionCoordinator?.userName +
+                  '_' +
+                  row.regionCoordinator?.mobileNumber
+                : ''
+            }}
           </t-link>
         </template>
         <template #projectManager="{ col, row }">
@@ -44,16 +52,41 @@
             hover="color"
             @click="showCard(row.projectManager?.userId)"
           >
-            {{ row.projectManager?.userName }}
+            {{
+              row.projectManager?.supplierName +
+              '_' +
+              row.projectManager?.userName +
+              '_' +
+              row.projectManager?.mobileNumber
+            }}
           </t-link>
         </template>
         <template #engineerList="{ col, row }">
-          <t-link theme="primary" hover="color" @click="showCard(row)">
+          <t-link
+            theme="primary"
+            hover="color"
+            v-for="(item, index) in row.engineerList || []"
+            @click="showCard(item.userId)"
+          >
             {{
-              (row.engineerList || []).map((item) => item.userName).join('、')
+              item?.supplierName +
+              '_' +
+              item?.userName +
+              '_' +
+              item?.mobileNumber
             }}
+            <span
+              v-if="
+                row.engineerList?.length &&
+                index !== row.engineerList.length - 1
+              "
+              >、</span
+            >
           </t-link>
         </template>
+        <template #process="{ col, row }">
+          {{ PROJECT_PROCESS[row.process] }}
+        </template>
       </t-table>
     </div>
     <WorkCard
@@ -121,14 +154,14 @@ const params = reactive({
 });
 
 const columns = [
-  { colKey: 'customName', title: '客户名称', width: 200 },
+  { colKey: 'customName', title: '客户名称', minWidth: 100, fixed: 'left' },
   { colKey: 'crmName', title: '项目名称', width: 140 },
   { colKey: 'courseName', title: '科目名称', width: 120 },
-  { colKey: 'process', title: '当前进度', width: 140 },
-  { colKey: 'leadName', title: '大区经理', width: 200 },
-  { colKey: 'regionCoordinator', title: '区域协调人', width: 200 },
-  { colKey: 'projectManager', title: '项目经理', width: 200 },
-  { colKey: 'engineerList', title: '工程师', width: 200 },
+  { colKey: 'process', title: '当前进度', width: 100 },
+  { colKey: 'leadName', title: '大区经理', width: 120 },
+  { colKey: 'regionCoordinator', title: '区域协调人', width: 300 },
+  { colKey: 'projectManager', title: '项目经理', width: 300 },
+  { colKey: 'engineerList', title: '工程师', width: 300 },
 ];
 
 const {

+ 1 - 1
src/views/sop/sop-manage/student-sop/index.vue

@@ -187,7 +187,7 @@
                 编辑
               </t-link>
             </template>
-            <template v-if="checkPrivilegeByUrl('deviceDeliveryManage')">
+            <template v-if="perm.LINK_DeviceManage">
               <t-link theme="primary" hover="color" @click="toDeviceManage(row)"
                 >设备管理</t-link
               >

+ 126 - 94
src/views/work-hours/work-hours-manage/work-statistics/index.vue

@@ -11,14 +11,10 @@
         <select-service-unit
           v-model="params[item.prop]"
           :filterParams="{ statusList: ['PUBLISH'] }"
+          defaultSelect
+          :clearable="false"
         ></select-service-unit>
       </template>
-      <template #supplier="{ item, params }">
-        <select-supplier v-model="params[item.prop]"> </select-supplier>
-      </template>
-      <template #creator="{ item, params }">
-        <select-filter-user v-model="params[item.prop]"> </select-filter-user>
-      </template>
     </SearchForm>
     <div class="flex-1 page-wrap">
       <t-table
@@ -37,52 +33,13 @@
           current: pagination.pageNumber,
         }"
       >
-        <template #user="{ row }">
-          {{ row.userName }}({{ row.userNo }})
-        </template>
-        <template #scanStartTime="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template>
-        <template #scanEndTime="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template>
-        <template #markPaperStartTime="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template>
-        <template #markPaperEndTime="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template>
-        <!-- <template #start-time="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template>
-        <template #end-time="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template> -->
-        <template #submit-time="{ col, row }">
-          {{ timestampFilter(row[col.colKey]) }}
-        </template>
-        <template #status="{ col, row }">
-          {{ attendanceStatisticsSubmitStatusFilter(row[col.colKey]) }}
-        </template>
-        <template #operate="{ row }">
-          <div v-if="perm.LINK_Reject" class="table-operations">
-            <t-link
-              :disabled="row.status !== 'APPLY_WITHDRAW'"
-              theme="primary"
-              hover="color"
-              @click="handlePass(row)"
-            >
-              同意撤回
-            </t-link>
-          </div>
-        </template>
       </t-table>
     </div>
   </div>
 </template>
 
 <script setup name="WorkStatistics">
-import { ref, reactive, onMounted } from 'vue';
+import { ref, reactive, onMounted, computed } from 'vue';
 import { DialogPlugin, MessagePlugin } from 'tdesign-vue-next';
 import { ErrorCircleFilledIcon } from 'tdesign-icons-vue-next';
 import useFetchTable from '@/hooks/useFetchTable';
@@ -91,6 +48,7 @@ import {
   workStatisticsInfoApi,
   workStatisticsExportApi,
   workStatisticsPassApi,
+  exportWorkApi,
 } from '@/api/work-hours';
 import {
   timestampFilter,
@@ -121,7 +79,9 @@ const fields = ref([
     colSpan: 6,
     options: dictToOptionList(STATISTICAL_DIMENSION),
     attrs: {
-      clearable: true,
+      onChange: () => {
+        search();
+      },
     },
   },
   {
@@ -135,6 +95,16 @@ const fields = ref([
           search();
         },
       },
+      {
+        type: 'button',
+        text: '导出统计结果',
+        attrs: {
+          theme: 'success',
+        },
+        onClick: () => {
+          exportFile();
+        },
+      },
     ],
   },
 ]);
@@ -143,55 +113,117 @@ const mixinSearch = () => {
 };
 const params = reactive({
   serviceId: '',
-  type: '',
+  type: 'BY_PERSON',
 });
 
-const columns = [
-  { colKey: 'service', title: '服务单元', width: 160 },
-  { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
-  { colKey: 'custom', title: '客户名称', width: 120 },
-  { colKey: 'province', title: '省份', width: 120 },
-  { colKey: 'city', title: '城市', width: 120 },
-  // {
-  //   colKey: 'examStartTime',
-  //   title: '项目开始时间',
-  //   width: 180,
-  //   cell: 'start-time',
-  // },
-  // {
-  //   colKey: 'examEndTime',
-  //   title: '项目结束时间',
-  //   width: 180,
-  //   cell: 'end-time',
-  // },
-  { colKey: 'scanStartTime', title: '扫描开始时间', width: 180 },
-  { colKey: 'scanEndTime', title: '扫描结束时间', width: 180 },
-  { colKey: 'markPaperStartTime', title: '阅卷开始时间', width: 180 },
-  { colKey: 'markPaperEndTime', title: '阅卷结束时间', width: 180 },
-  { colKey: 'userName', title: '姓名(人员档案号)', cell: 'user', width: 170 },
-  { colKey: 'roleName', title: '项目角色', width: 120 },
-  { colKey: 'supplier', title: '供应商' },
-  { colKey: 'attendance', title: '实际出勤(天)', width: 140 },
-  { colKey: 'weekdays', title: '工作日(天)', width: 130 },
-  { colKey: 'weekends', title: '周末(天)', width: 120 },
-  { colKey: 'holidays', title: '法定节假日(天)', width: 160 },
-  { colKey: 'workHours', title: '累计工时(小时)', width: 140 },
-  // { colKey: 'violationDays', title: '违规工时(天)', width: 140 },
-  { colKey: 'submitter', title: '提交人', width: 120 },
-  {
-    colKey: 'submissionTime',
-    title: '提交时间',
-    cell: 'submit-time',
-    width: 180,
-  },
-  { colKey: 'status', title: '提交状态', cell: 'status', width: 100 },
-  {
-    title: '管理',
-    colKey: 'operate',
-    fixed: 'right',
-    width: 100,
-  },
-];
+const exportFile = () => {
+  exportWorkApi(params).then(() => {
+    MessagePlugin.success('导出成功');
+  });
+};
+
+const columns = computed(() => {
+  const type = params.type;
+  if (!type) {
+    return [];
+  }
+  let map = {
+    BY_PERSON: [
+      { colKey: 'serviceName', title: '服务单元', width: 160, fixed: 'left' },
+      { colKey: 'userInfo', title: '姓名(人员档案号)', width: 200 },
+      { colKey: 'supplierName', title: '供应商', width: 160 },
+      { colKey: 'actualDays', title: '实际出勤(天)', width: 138 },
+      { colKey: 'weekdays', title: '工作日(天)', width: 120 },
+      { colKey: 'weekends', title: '周末(天)', width: 110 },
+      { colKey: 'legalHolidays', title: '法定节假日(天)', width: 150 },
+      { colKey: 'workHours', title: '累计工时(小时)', width: 160 },
+      { colKey: 'violationDays', title: '违规工时(天)', width: 160 },
+    ],
+    BY_SOP: [
+      { colKey: 'serviceName', title: '服务单元', width: 160, fixed: 'left' },
+      { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
+      { colKey: 'courseName', title: '科目名称', width: 200 },
+      { colKey: 'actualDays', title: '实际出勤(天)', width: 138 },
+      { colKey: 'weekdays', title: '工作日(天)', width: 120 },
+      { colKey: 'weekends', title: '周末(天)', width: 110 },
+      { colKey: 'legalHolidays', title: '法定节假日(天)', width: 150 },
+      { colKey: 'scanPeriod', title: '扫描周期(天)', width: 160 },
+      { colKey: 'markPaperPeriod', title: '阅卷周期(天)', width: 160 },
+      { colKey: 'workHours', title: '累计工时(小时)', width: 160 },
+      { colKey: 'violationDays', title: '违规工时(天)', width: 160 },
+    ],
+    BY_CRM: [
+      { colKey: 'serviceName', title: '服务单元', width: 160, fixed: 'left' },
+      { colKey: 'crmNo', title: '派单号', width: 200 },
+      { colKey: 'crmName', title: '项目名称', width: 200 },
+      { colKey: 'actualDays', title: '实际出勤(天)', width: 138 },
+      { colKey: 'weekdays', title: '工作日(天)', width: 120 },
+      { colKey: 'weekends', title: '周末(天)', width: 110 },
+      { colKey: 'legalHolidays', title: '法定节假日(天)', width: 150 },
+      { colKey: 'scanPeriod', title: '扫描周期(天)', width: 160 },
+      { colKey: 'markPaperPeriod', title: '阅卷周期(天)', width: 160 },
+      { colKey: 'workHours', title: '累计工时(小时)', width: 160 },
+      { colKey: 'violationDays', title: '违规工时(天)', width: 160 },
+    ],
+    BY_CUSTOM: [
+      { colKey: 'serviceName', title: '服务单元', width: 160, fixed: 'left' },
+      { colKey: 'customName', title: '客户名称', width: 200 },
+      { colKey: 'actualDays', title: '实际出勤(天)', width: 138 },
+      { colKey: 'weekdays', title: '工作日(天)', width: 120 },
+      { colKey: 'weekends', title: '周末(天)', width: 110 },
+      { colKey: 'legalHolidays', title: '法定节假日(天)', width: 150 },
+      { colKey: 'scanPeriod', title: '扫描周期(天)', width: 160 },
+      { colKey: 'markPaperPeriod', title: '阅卷周期(天)', width: 160 },
+      { colKey: 'workHours', title: '累计工时(小时)', width: 160 },
+      { colKey: 'violationDays', title: '违规工时(天)', width: 160 },
+    ],
+    BY_SUPPLIER: [
+      { colKey: 'serviceName', title: '服务单元', width: 160, fixed: 'left' },
+      { colKey: 'supplierName', title: '供应商', width: 200 },
+      { colKey: 'actualDays', title: '实际出勤(天)', width: 138 },
+      { colKey: 'weekdays', title: '工作日(天)', width: 120 },
+      { colKey: 'weekends', title: '周末(天)', width: 110 },
+      { colKey: 'legalHolidays', title: '法定节假日(天)', width: 150 },
+      { colKey: 'workHours', title: '累计工时(小时)', width: 160 },
+      { colKey: 'violationDays', title: '违规工时(天)', width: 160 },
+    ],
+  };
+  return map[type];
+});
+
+// const columns = [
+//   { colKey: 'service', title: '服务单元', width: 160 },
+//   { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
+//   { colKey: 'custom', title: '客户名称', width: 120 },
+//   { colKey: 'province', title: '省份', width: 120 },
+//   { colKey: 'city', title: '城市', width: 120 },
+//   { colKey: 'scanStartTime', title: '扫描开始时间', width: 180 },
+//   { colKey: 'scanEndTime', title: '扫描结束时间', width: 180 },
+//   { colKey: 'markPaperStartTime', title: '阅卷开始时间', width: 180 },
+//   { colKey: 'markPaperEndTime', title: '阅卷结束时间', width: 180 },
+//   { colKey: 'userName', title: '姓名(人员档案号)', cell: 'user', width: 170 },
+//   { colKey: 'roleName', title: '项目角色', width: 120 },
+//   { colKey: 'supplier', title: '供应商' },
+//   { colKey: 'attendance', title: '实际出勤(天)', width: 140 },
+//   { colKey: 'weekdays', title: '工作日(天)', width: 130 },
+//   { colKey: 'weekends', title: '周末(天)', width: 120 },
+//   { colKey: 'holidays', title: '法定节假日(天)', width: 160 },
+//   { colKey: 'workHours', title: '累计工时(小时)', width: 140 },
+//   { colKey: 'submitter', title: '提交人', width: 120 },
+//   {
+//     colKey: 'submissionTime',
+//     title: '提交时间',
+//     cell: 'submit-time',
+//     width: 180,
+//   },
+//   { colKey: 'status', title: '提交状态', cell: 'status', width: 100 },
+//   {
+//     title: '管理',
+//     colKey: 'operate',
+//     fixed: 'right',
+//     width: 100,
+//   },
+// ];
 const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
   workStatisticsListApi,
   { params }