刘洋 1 rok temu
rodzic
commit
7063da3d64

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

@@ -258,6 +258,9 @@ const columns = [
     type: 'multiple',
     width: 50,
     fixed: 'left',
+    disabled: ({ rowIndex }) => {
+      return tableData.value[rowIndex].crmStatus !== 'UN_PUBLISH';
+    },
   },
   { colKey: 'serviceUnitName', title: '服务单元', width: 160 },
   { colKey: 'crmNo', title: '项目单号', width: 200, cell: 'crmno' },

+ 21 - 2
src/views/resource-guard/person-guard/person-allocate/person-deploy-dialog.vue

@@ -146,6 +146,7 @@ import {
   personAllocateRoleDetailApi,
 } from '@/api/resource-guard';
 import { customerTypeFilter } from '@/utils/filter';
+import { cloneDeep } from 'lodash';
 
 const emit = defineEmits(['update:visible', 'success']);
 const props = defineProps({
@@ -209,7 +210,6 @@ const getDetail = async () => {
     EFFECT_ENGINEER: props.curRow.effectQuota,
     ASSISTANT_ENGINEER: props.curRow.assistantQuota,
   };
-
   if (res.length) {
     let roleConfigMap = {};
 
@@ -223,7 +223,26 @@ const getDetail = async () => {
       }
       roleConfigMap[item.roleResult.roleId].userIdList.push(item.userId);
     });
-    formData.roleConfigInfo = Object.values(roleConfigMap);
+    const validRoleTypes = Object.keys(roleQuota).filter(
+      (item) => roleQuota[item]
+    );
+    let singleList = cloneDeep(roleList.value)
+      .filter(
+        (item) =>
+          validRoleTypes.includes(item.type) &&
+          item.type === 'REGION_COORDINATOR'
+      )
+      .map((item) => {
+        return {
+          quota: roleQuota[item.type],
+          userIdList: [],
+          roleId: item.id,
+          roleName: item.name,
+          roleType: item.type,
+        };
+      });
+
+    formData.roleConfigInfo = [...singleList, ...Object.values(roleConfigMap)];
   } else {
     const validRoleTypes = Object.keys(roleQuota).filter(
       (item) => roleQuota[item]