刘洋 1 gadu atpakaļ
vecāks
revīzija
bdc9a1483f

+ 5 - 8
src/views/report/dispatch-analysis/index.vue

@@ -131,14 +131,11 @@
                     <div class="label">状态:</div>
                     <div
                       class="status"
-                      :class="{ finished: item.rate  === '100%' }"
-                      >{{ item.rate  === '100%' ? '已完成' : '未完成' }}</div
+                      :class="{ finished: item.rate === '100%' }"
+                      >{{ item.rate === '100%' ? '已完成' : '未完成' }}</div
                     >
                     <div class="process-box">
-                      <div
-                        class="process"
-                        :style="{ width: item.rate }"
-                      ></div>
+                      <div class="process" :style="{ width: item.rate }"></div>
                     </div>
                   </div>
                 </div>
@@ -239,8 +236,8 @@ const dispatchStatisticsDrillData = ref({ serviceId: '', serviceName: '' });
 const curTimeRange = ref([]);
 const timeParams = computed(() => {
   return {
-    startTime: new Date(curTimeRange.value[0]).getTime(),
-    endTime: new Date(curTimeRange.value[1]).getTime(),
+    startTime: new Date(curTimeRange.value[0] + ' 00:00:00').getTime(),
+    endTime: new Date(curTimeRange.value[1] + ' 23:59:59').getTime(),
   };
 });
 const {

+ 2 - 2
src/views/report/project-analysis/index.vue

@@ -107,8 +107,8 @@ const sopDetailDrillData = ref({
 const curTimeRange = ref([]);
 const timeParams = computed(() => {
   return {
-    startTime: new Date(curTimeRange.value[0]).getTime(),
-    endTime: new Date(curTimeRange.value[1]).getTime(),
+    startTime: new Date(curTimeRange.value[0] + ' 00:00:00').getTime(),
+    endTime: new Date(curTimeRange.value[1] + ' 23:59:59').getTime(),
   };
 });
 const serviceOptions = ref([]);

+ 2 - 2
src/views/report/quality-analysis/index.vue

@@ -159,8 +159,8 @@ const chart22 = ref();
 const curTimeRange = ref([]);
 const timeParams = computed(() => {
   return {
-    startTime: new Date(curTimeRange.value[0]).getTime(),
-    endTime: new Date(curTimeRange.value[1]).getTime(),
+    startTime: new Date(curTimeRange.value[0] + ' 00:00:00').getTime(),
+    endTime: new Date(curTimeRange.value[1] + ' 23:59:59').getTime(),
   };
 });
 const groupOptions = ref([

+ 34 - 24
src/views/report/service-analysis/index.vue

@@ -251,8 +251,8 @@ const curTimeRange = ref([]);
 const serviceOptions = ref([]);
 const timeParams = computed(() => {
   return {
-    startTime: new Date(curTimeRange.value[0]).getTime(),
-    endTime: new Date(curTimeRange.value[1]).getTime(),
+    startTime: new Date(curTimeRange.value[0] + ' 00:00:00').getTime(),
+    endTime: new Date(curTimeRange.value[1] + ' 23:59:59').getTime(),
   };
 });
 const serviceId = ref('');
@@ -316,6 +316,12 @@ const timeChange = (time) => {
 
 watch(serviceId, (serviceUnitId) => {
   run1({ serviceUnitId });
+  supplierId.value = '';
+  regionId.value = '';
+  result4.value = '';
+  ssgcsNum.value = '';
+  qyxtrNum.value = '';
+  regionList.value = [];
   run2({ serviceUnitId }).then((res) => {
     if (!supplierId.value) {
       if (res.supplierDistribution?.length) {
@@ -348,30 +354,34 @@ const regionOptions = computed(() => {
   });
 });
 watch(supplierId, (supplierId) => {
-  run3({ serviceUnitId: serviceId.value, supplierId }).then((res) => {
-    let obj1 = res.find(
-      (item) => item.NAME === '实施工程师' || item.name === '实施工程师'
-    );
-    let obj2 = res.find(
-      (item) => item.NAME === '区域协调人' || item.name === '区域协调人'
-    );
-    obj1 && (ssgcsNum.value = obj1.count);
-    obj2 && (qyxtrNum.value = obj2.count);
-  });
-  runGetRegionList({ serviceUnitId: serviceId.value, supplierId }).then(
-    (res) => {
-      if (res && res.length) {
-        regionId.value = res[0].region_id;
+  if (supplierId) {
+    run3({ serviceUnitId: serviceId.value, supplierId }).then((res) => {
+      let obj1 = res.find(
+        (item) => item.NAME === '实施工程师' || item.name === '实施工程师'
+      );
+      let obj2 = res.find(
+        (item) => item.NAME === '区域协调人' || item.name === '区域协调人'
+      );
+      obj1 && (ssgcsNum.value = obj1.count);
+      obj2 && (qyxtrNum.value = obj2.count);
+    });
+    runGetRegionList({ serviceUnitId: serviceId.value, supplierId }).then(
+      (res) => {
+        if (res && res.length) {
+          regionId.value = res[0].region_id;
+        }
       }
-    }
-  );
+    );
+  }
 });
 watch(regionId, (regionId) => {
-  run4({
-    serviceUnitId: serviceId.value,
-    supplierId: supplierId.value,
-    regionId,
-  });
+  if (regionId) {
+    run4({
+      serviceUnitId: serviceId.value,
+      supplierId: supplierId.value,
+      regionId,
+    });
+  }
 });
 
 const options1 = computed(() => {
@@ -590,7 +600,7 @@ const options8 = computed(() => {
           display: flex;
           flex-direction: column;
           .charts-box {
-            height: 100%;
+            height: calc(100% - 68px);
             display: flex;
             justify-content: space-around;
             .chart-item {

+ 2 - 2
src/views/report/sop-analysis/index.vue

@@ -261,8 +261,8 @@ const serviceOptions = ref([]);
 
 const timeParams = computed(() => {
   return {
-    startTime: new Date(curTimeRange.value[0]).getTime(),
-    endTime: new Date(curTimeRange.value[1]).getTime(),
+    startTime: new Date(curTimeRange.value[0] + ' 00:00:00').getTime(),
+    endTime: new Date(curTimeRange.value[1] + ' 23:59:59').getTime(),
   };
 });
 const serviceId = ref('');

+ 5 - 1
src/views/sop/components/select-metadata.vue

@@ -41,14 +41,16 @@
 
 <script setup name="SelectMetadata">
 import { onMounted, ref, useAttrs, watch, computed } from 'vue';
-
+import { cloneDeep } from 'lodash';
 import { metadataListApi } from '@/api/sop';
 
 const emit = defineEmits(['update:modelValue', 'change']);
 const props = defineProps({
   modelValue: { type: Array },
   type: { type: String, default: 'OFFICE_SOP_FLOW' },
+  originColumns: { type: Array, default: [] },
 });
+
 const attrs = useAttrs();
 
 let all = ref(false);
@@ -61,6 +63,8 @@ const search = async () => {
   const noneedCodes = ['FILE', 'TABLE', 'DEVICE_OUT_TABLE', 'DEVICE_IN_TABLE'];
   optionList.value = res.filter((item) => !noneedCodes.includes(item.code));
   // console.log(new Set(optionList.value.map((item) => item.code)));
+
+  optionList.value.unshift(...cloneDeep(props.originColumns));
 };
 onMounted(() => {
   search();

+ 65 - 21
src/views/sop/sop-manage/office-sop/index.vue

@@ -13,6 +13,7 @@
       <select-metadata
         v-model="params.formWidgetMetadataViewList"
         type="OFFICE_SOP_FLOW"
+        :originColumns="originColumns"
         @change="metadataChange"
       ></select-metadata>
       <t-button variant="outline" @click="handleRefresh">
@@ -87,7 +88,7 @@
             @action="editSopFlowHandle(row, 'view')"
           ></more-content>
         </template>
-        <template #beginTime="{ col, row }">
+        <!-- <template #beginTime="{ col, row }">
           {{ timestampFilter(row[col.colKey]) }}
         </template>
         <template #examStartTime="{ col, row }">
@@ -101,7 +102,7 @@
         </template>
         <template #flowUpdateTime="{ col, row }">
           {{ timestampFilter(row[col.colKey]) }}
-        </template>
+        </template> -->
         <template
           v-for="field in formWidgetMetadataViewList"
           #[field.fieldId]="{ col, row }"
@@ -229,6 +230,7 @@ import AddViolationDialog from '../../sop-monitor/violation-registration/add-vio
 import MetadataContent from '../../components/metadata-content.vue';
 import { useAppStore } from '@/store';
 import usePermission from '@/hooks/usePermission';
+import { cloneDeep } from 'lodash';
 const { perm } = usePermission();
 
 const appStore = useAppStore();
@@ -238,6 +240,44 @@ const selectChange = (value) => {
   selectedRowKeys.value = value;
 };
 
+const originColumns = [
+  { fieldId: 'crmNo', fieldTitle: '项目单号', width: 200 },
+  { fieldId: 'beginTime', fieldTitle: '派单时间', width: 180, code: 'DATE' },
+  { fieldId: 'customManagerName', fieldTitle: '客户经理', width: 140 },
+  { fieldId: 'customManagerTypeStr', fieldTitle: '客户类型', width: 120 },
+  { fieldId: 'customName', fieldTitle: '客户名称', width: 140 },
+  { fieldId: 'crmName', fieldTitle: '项目名称', minWidth: 160 },
+  { fieldId: 'productName', fieldTitle: '实施产品', width: 120 },
+  {
+    fieldId: 'examStartTime',
+    fieldTitle: '考试开始时间',
+    width: 180,
+    code: 'DATE',
+  },
+  {
+    fieldId: 'examEndTime',
+    fieldTitle: '考试结束时间',
+    width: 180,
+    code: 'DATE',
+  },
+  { fieldId: 'flowCreateName', fieldTitle: '提交人', width: 140 },
+  {
+    fieldId: 'flowCreateTime',
+    fieldTitle: '提交时间',
+    width: 180,
+    code: 'DATE',
+  },
+  {
+    fieldId: 'flowUpdateTime',
+    fieldTitle: '更新时间',
+    width: 180,
+    code: 'DATE',
+  },
+  { fieldId: 'statusStr', fieldTitle: '流程状态', width: 120 },
+  { fieldId: 'taskName', fieldTitle: '流程节点', width: 160 },
+  { fieldId: 'pendApproveName', fieldTitle: '当前节点负责人', width: 140 },
+];
+const originFieldIds = originColumns.map((item) => item.fieldId);
 const columns = computed(() => {
   const defaultColumns = [
     {
@@ -248,21 +288,21 @@ const columns = computed(() => {
     },
     { colKey: 'serviceName', title: '服务单元', width: 160 },
     { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
-    { colKey: 'crmNo', title: '项目单号', width: 200 },
-    { colKey: 'beginTime', title: '派单时间', width: 180 },
-    { colKey: 'customManagerName', title: '客户经理', width: 140 },
-    { colKey: 'customManagerTypeStr', title: '客户类型', width: 120 },
-    { colKey: 'customName', title: '客户名称', width: 140 },
-    { colKey: 'crmName', title: '项目名称', minWidth: 160 },
-    { colKey: 'productName', title: '实施产品', width: 120 },
-    { colKey: 'examStartTime', title: '考试开始时间', width: 180 },
-    { colKey: 'examEndTime', title: '考试结束时间', width: 180 },
-    { colKey: 'flowCreateName', title: '提交人', width: 140 },
-    { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
-    { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
-    { colKey: 'statusStr', title: '流程状态', width: 120 },
-    { colKey: 'taskName', title: '流程节点', width: 160 },
-    { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
+    // { colKey: 'crmNo', title: '项目单号', width: 200 },
+    // { colKey: 'beginTime', title: '派单时间', width: 180 },
+    // { colKey: 'customManagerName', title: '客户经理', width: 140 },
+    // { colKey: 'customManagerTypeStr', title: '客户类型', width: 120 },
+    // { colKey: 'customName', title: '客户名称', width: 140 },
+    // { colKey: 'crmName', title: '项目名称', minWidth: 160 },
+    // { colKey: 'productName', title: '实施产品', width: 120 },
+    // { colKey: 'examStartTime', title: '考试开始时间', width: 180 },
+    // { colKey: 'examEndTime', title: '考试结束时间', width: 180 },
+    // { colKey: 'flowCreateName', title: '提交人', width: 140 },
+    // { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
+    // { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
+    // { colKey: 'statusStr', title: '流程状态', width: 120 },
+    // { colKey: 'taskName', title: '流程节点', width: 160 },
+    // { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
     {
       title: '管理',
       colKey: 'operate',
@@ -278,7 +318,8 @@ const columns = computed(() => {
         title: item.fieldTitle,
         colOptions: item.options,
         colKeyCode: item.code,
-        minWidth: 170,
+        width: item.width,
+        minWidth: item.minWidth || 170,
       };
     });
     return [
@@ -308,13 +349,16 @@ const fields = ref([
 ]);
 const params = reactive({
   serviceId: '',
-  formWidgetMetadataViewList: [],
+  formWidgetMetadataViewList: cloneDeep(originColumns),
   formWidgetMetadataConditionList: [],
   formWidgetMetadataOrderList: [],
   formWidgetMetadataOperation: 'AND',
 });
 const transParams = computed(() => {
-  return { ...params, type: 'OFFICE_SOP_FLOW' };
+  let formWidgetMetadataViewList = params.formWidgetMetadataViewList.filter(
+    (item) => !originFieldIds.includes(item.fieldId)
+  );
+  return { ...params, formWidgetMetadataViewList, type: 'OFFICE_SOP_FLOW' };
 });
 const {
   loading: tableLoading,
@@ -330,7 +374,7 @@ const {
   },
 });
 
-const formWidgetMetadataViewList = ref([]);
+const formWidgetMetadataViewList = ref(cloneDeep(originColumns));
 const metadataChange = (vals) => {
   formWidgetMetadataViewList.value = vals;
 };

+ 66 - 21
src/views/sop/sop-manage/student-sop/index.vue

@@ -14,6 +14,7 @@
         v-model="params.formWidgetMetadataViewList"
         type="CLOUD_MARK_SOP_FLOW"
         @change="metadataChange"
+        :originColumns="originColumns"
       ></select-metadata>
       <t-button variant="outline" @click="handleRefresh">
         <template #icon><svg-icon name="refresh" color="#262626" /></template>
@@ -87,7 +88,7 @@
             @action="editSopFlowHandle(row, 'view')"
           ></more-content>
         </template>
-        <template #beginTime="{ col, row }">
+        <!-- <template #beginTime="{ col, row }">
           {{ timestampFilter(row[col.colKey]) }}
         </template>
         <template #examStartTime="{ col, row }">
@@ -101,7 +102,7 @@
         </template>
         <template #flowUpdateTime="{ col, row }">
           {{ timestampFilter(row[col.colKey]) }}
-        </template>
+        </template> -->
         <template
           v-for="field in formWidgetMetadataViewList"
           #[field.fieldId]="{ col, row }"
@@ -228,6 +229,7 @@ import MetadataContent from '../../components/metadata-content.vue';
 import { useAppStore } from '@/store';
 import usePermission from '@/hooks/usePermission';
 import SopSortPanel from '../../components/sop-sort-panel/index.vue';
+import { cloneDeep } from 'lodash';
 const { perm } = usePermission();
 
 const appStore = useAppStore();
@@ -236,6 +238,45 @@ const selectedRowKeys = ref([]);
 const selectChange = (value) => {
   selectedRowKeys.value = value;
 };
+const originColumns = [
+  { fieldId: 'crmNo', fieldTitle: '项目单号', width: 200 },
+  { fieldId: 'beginTime', fieldTitle: '派单时间', width: 180, code: 'DATE' },
+  { fieldId: 'customManagerName', fieldTitle: '客户经理', width: 140 },
+  { fieldId: 'customManagerTypeStr', fieldTitle: '客户类型', width: 120 },
+  { fieldId: 'customName', fieldTitle: '客户名称', width: 140 },
+  { fieldId: 'crmName', fieldTitle: '项目名称', minWidth: 160 },
+  { fieldId: 'productName', fieldTitle: '实施产品', width: 120 },
+  {
+    fieldId: 'examStartTime',
+    fieldTitle: '考试开始时间',
+    width: 180,
+    code: 'DATE',
+  },
+  {
+    fieldId: 'examEndTime',
+    fieldTitle: '考试结束时间',
+    width: 180,
+    code: 'DATE',
+  },
+  { fieldId: 'flowCreateName', fieldTitle: '提交人', width: 140 },
+  {
+    fieldId: 'flowCreateTime',
+    fieldTitle: '提交时间',
+    width: 180,
+    code: 'DATE',
+  },
+  {
+    fieldId: 'flowUpdateTime',
+    fieldTitle: '更新时间',
+    width: 180,
+    code: 'DATE',
+  },
+  { fieldId: 'statusStr', fieldTitle: '流程状态', width: 120 },
+  { fieldId: 'taskName', fieldTitle: '流程节点', width: 160 },
+  { fieldId: 'pendApproveName', fieldTitle: '当前节点负责人', width: 140 },
+];
+const originFieldIds = originColumns.map((item) => item.fieldId);
+
 const columns = computed(() => {
   const defaultColumns = [
     {
@@ -246,21 +287,21 @@ const columns = computed(() => {
     },
     { colKey: 'serviceName', title: '服务单元', width: 160 },
     { colKey: 'sopNo', title: 'SOP流水号', width: 200 },
-    { colKey: 'crmNo', title: '项目单号', width: 200 },
-    { colKey: 'beginTime', title: '派单时间', width: 180 },
-    { colKey: 'customManagerName', title: '客户经理', width: 140 },
-    { colKey: 'customManagerTypeStr', title: '客户类型', width: 120 },
-    { colKey: 'customName', title: '客户名称', width: 140 },
-    { colKey: 'crmName', title: '项目名称', minWidth: 160 },
-    { colKey: 'productName', title: '实施产品', width: 120 },
-    { colKey: 'examStartTime', title: '考试开始时间', width: 180 },
-    { colKey: 'examEndTime', title: '考试结束时间', width: 180 },
-    { colKey: 'flowCreateName', title: '提交人', width: 140 },
-    { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
-    { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
-    { colKey: 'statusStr', title: '流程状态', width: 120 },
-    { colKey: 'taskName', title: '流程节点', width: 160 },
-    { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
+    // { colKey: 'crmNo', title: '项目单号', width: 200 },
+    // { colKey: 'beginTime', title: '派单时间', width: 180 },
+    // { colKey: 'customManagerName', title: '客户经理', width: 140 },
+    // { colKey: 'customManagerTypeStr', title: '客户类型', width: 120 },
+    // { colKey: 'customName', title: '客户名称', width: 140 },
+    // { colKey: 'crmName', title: '项目名称', minWidth: 160 },
+    // { colKey: 'productName', title: '实施产品', width: 120 },
+    // { colKey: 'examStartTime', title: '考试开始时间', width: 180 },
+    // { colKey: 'examEndTime', title: '考试结束时间', width: 180 },
+    // { colKey: 'flowCreateName', title: '提交人', width: 140 },
+    // { colKey: 'flowCreateTime', title: '提交时间', width: 180 },
+    // { colKey: 'flowUpdateTime', title: '更新时间', width: 180 },
+    // { colKey: 'statusStr', title: '流程状态', width: 120 },
+    // { colKey: 'taskName', title: '流程节点', width: 160 },
+    // { colKey: 'pendApproveName', title: '当前节点负责人', width: 140 },
     {
       title: '管理',
       colKey: 'operate',
@@ -276,7 +317,8 @@ const columns = computed(() => {
         title: item.fieldTitle,
         colOptions: item.options,
         colKeyCode: item.code,
-        minWidth: 170,
+        width: item.width,
+        minWidth: item.minWidth || 170,
       };
     });
     return [
@@ -306,13 +348,16 @@ const fields = ref([
 ]);
 const params = reactive({
   serviceId: '',
-  formWidgetMetadataViewList: [],
+  formWidgetMetadataViewList: cloneDeep(originColumns),
   formWidgetMetadataConditionList: [],
   formWidgetMetadataOrderList: [],
   formWidgetMetadataOperation: 'AND',
 });
 const transParams = computed(() => {
-  return { ...params, type: 'CLOUD_MARK_SOP_FLOW' };
+  let formWidgetMetadataViewList = params.formWidgetMetadataViewList.filter(
+    (item) => !originFieldIds.includes(item.fieldId)
+  );
+  return { ...params, formWidgetMetadataViewList, type: 'CLOUD_MARK_SOP_FLOW' };
 });
 const {
   loading: tableLoading,
@@ -328,7 +373,7 @@ const {
   },
 });
 
-const formWidgetMetadataViewList = ref([]);
+const formWidgetMetadataViewList = ref(cloneDeep(originColumns));
 const metadataChange = (vals) => {
   formWidgetMetadataViewList.value = vals;
 };