zhangjie преди 1 година
родител
ревизия
d604292cda

+ 3 - 2
src/components/common/select-area/index.vue

@@ -57,8 +57,9 @@ const onChange = (val) => {
 const parseCode = (val) => {
   let value = val;
   if (props.valueType !== 'single') {
-    if (val.some((item) => !item)) {
-      return val;
+    const validVals = Object.values(areaCodeMap);
+    if (val.some((item) => !validVals.includes(item))) {
+      return val.map((item) => '');
     }
     value = val.join('_');
   }

+ 2 - 2
src/views/resource-guard/person-guard/person-allocate/index.vue

@@ -326,9 +326,9 @@ const initData = () => {
 };
 
 const areaChange = (data) => {
-  params.provice = data[0];
+  params.province = data[0];
   params.city = data[1];
-  params.are = data[2];
+  params.area = data[2];
 };
 
 const handleBatchDeploy = () => {

+ 55 - 5
src/views/resource-guard/person-guard/person-allocate/person-deploy-dialog.vue

@@ -42,6 +42,13 @@
         <t-col :span="12">
           <t-form-item label="人员调配" labelAlign="top">
             <div>
+              <div style="text-align: right">
+                <t-checkbox
+                  v-model="regionUseManage"
+                  @change="regionUseManageChange"
+                  >区域协调人由大区经理兼仕</t-checkbox
+                >
+              </div>
               <t-table
                 size="small"
                 row-key="roleId"
@@ -89,7 +96,7 @@
                     :key="item.id"
                     :value="item.id"
                     :label="item.name"
-                    :disabled="configRoleIds.includes(item.id)"
+                    :disabled="checkRoleDisabled(item)"
                   ></t-option>
                 </t-select>
                 <t-button
@@ -130,11 +137,27 @@ const props = defineProps({
   visible: Boolean,
   curRow: Object,
 });
+const regionUseManage = ref(false);
+
+const regionUseManageChange = () => {
+  if (regionUseManage.value) {
+    formData.roleConfigInfo = formData.roleConfigInfo.filter(
+      (item) => item.roleType !== 'REGION_COORDINATOR'
+    );
+  }
+  selectedRoleId.value = null;
+  selectedRole.value = null;
+};
 
 const configRoleIds = computed(() => {
   return formData.roleConfigInfo.map((item) => item.roleId);
 });
 
+const checkRoleDisabled = (item) => {
+  if (item.type === 'REGION_COORDINATOR' && regionUseManage.value) return true;
+  return configRoleIds.value.includes(item.id);
+};
+
 const formRef = ref(null);
 let selectedRole = ref(null);
 let selectedRoleId = ref(null);
@@ -188,6 +211,16 @@ const getDetail = async () => {
         };
       });
   }
+  const regionUserInfo = formData.roleConfigInfo.find(
+    (item) => item.roleType === 'REGION_COORDINATOR'
+  );
+  if (
+    regionUserInfo &&
+    regionUserInfo.userIdList[0] === props.curRow.regionManagerId
+  ) {
+    regionUseManage.value = true;
+    regionUseManageChange();
+  }
 };
 
 const { formData } = useClearDialog(
@@ -226,6 +259,17 @@ const roleChange = () => {
     (item) => item.id === selectedRoleId.value
   );
 };
+const sortRole = () => {
+  const roleIndexs = {
+    REGION_COORDINATOR: 1,
+    EFFECT_ENGINEER: 2,
+    ASSISTANT_ENGINEER: 3,
+  };
+  formData.roleConfigInfo.sort(
+    (a, b) => roleIndexs[a.roleType] - roleIndexs[b.roleType]
+  );
+};
+
 const toAddRole = () => {
   if (
     formData.roleConfigInfo.some(
@@ -243,6 +287,7 @@ const toAddRole = () => {
     roleName: selectedRole.value.name,
     roleType: selectedRole.value.type,
   });
+  sortRole();
 
   selectedRole.value = null;
   selectedRoleId.value = null;
@@ -282,10 +327,15 @@ const save = async () => {
         };
       }),
   };
-  const regionUserInfo = formData.roleConfigInfo.find(
-    (item) => item.roleType === 'REGION_COORDINATOR'
-  );
-  if (regionUserInfo) data.regionUserId = regionUserInfo.userIdList[0];
+
+  if (regionUseManage.value) {
+    data.regionUserId = props.curRow.regionManagerId;
+  } else {
+    const regionUserInfo = formData.roleConfigInfo.find(
+      (item) => item.roleType === 'REGION_COORDINATOR'
+    );
+    if (regionUserInfo) data.regionUserId = regionUserInfo.userIdList[0];
+  }
 
   const res = await personAllocateDeployApi(data).catch(() => {});
   if (!res) return;

+ 1 - 1
src/views/resource-guard/person-guard/person-files/index.vue

@@ -352,7 +352,7 @@ const { pagination, tableData, fetchData, search, onChange } = useFetchTable(
 
 let statisticsInfo = ref({});
 const getStatisticsInfo = async () => {
-  const res = await personFilesStatisticsApi(params);
+  const res = await personFilesStatisticsApi(computedParams.value);
   statisticsInfo.value = res || {};
 };
 

+ 4 - 4
src/views/service-unit/dispatch/dispatch-manage/index.vue

@@ -67,10 +67,10 @@
           {{ timestampFilter(row[col.colKey], 'mm') }}
         </template>
         <template #start-time="{ col, row }">
-          {{ timestampFilter(row[col.colKey], 'dd') }}
+          {{ timestampFilter(row[col.colKey], 'mm') }}
         </template>
         <template #end-time="{ col, row }">
-          {{ timestampFilter(row[col.colKey], 'dd') }}
+          {{ timestampFilter(row[col.colKey], 'mm') }}
         </template>
         <template #create-time="{ col, row }">
           {{ timestampFilter(row[col.colKey]) }}
@@ -155,12 +155,12 @@
             </t-col>
             <t-col :span="6">
               <t-form-item label="考试开始时间">
-                {{ timestampFilter(curRow.examStartTime, 'dd') }}
+                {{ timestampFilter(curRow.examStartTime, 'mm') }}
               </t-form-item>
             </t-col>
             <t-col :span="6">
               <t-form-item label="考试结束时间">
-                {{ timestampFilter(curRow.examEndTime, 'dd') }}
+                {{ timestampFilter(curRow.examEndTime, 'mm') }}
               </t-form-item>
             </t-col>
             <t-col :span="6">

+ 5 - 1
src/views/sop/sop-manage/quality-issue/index.vue

@@ -87,6 +87,7 @@
             <t-button theme="primary" @click="submitHandle('START')"
               >提交</t-button
             >
+            <t-button theme="default" @click="cancelHandle">取消</t-button>
           </template>
         </t-space>
       </t-tab-panel>
@@ -116,7 +117,7 @@ const props = defineProps({
     default: 'new',
   },
 });
-const emit = defineEmits(['confirm']);
+const emit = defineEmits(['confirm', 'cancel']);
 
 const IS_NEW_MODE = computed(() => {
   return props.type === 'new';
@@ -341,4 +342,7 @@ const submitHandle = async (flowApprove = 'START') => {
   MessagePlugin.success('保存成功');
   emit('confirm');
 };
+const cancelHandle = () => {
+  emit('cancel');
+};
 </script>

+ 1 - 0
src/views/sop/sop-manage/quality-issue/quality-issue-dialog.vue

@@ -15,6 +15,7 @@
       :sop="sop"
       :type="type"
       @confirm="stepConfirm"
+      @cancel="emit('update:visible', false)"
     ></quality-issue>
   </my-drawer>
 </template>