刘洋 9 bulan lalu
induk
melakukan
fcf22d5a76
2 mengubah file dengan 25 tambahan dan 0 penghapusan
  1. 5 0
      src/api/sop.js
  2. 20 0
      src/views/sop/components/dynamic-form-item/SELECT.vue

+ 5 - 0
src/api/sop.js

@@ -327,3 +327,8 @@ export const getWorkCardInfo = (params) =>
     params,
     loading: true,
   });
+export const getPersonInfoByUserId = (userId) =>
+  request({
+    url: '/api/admin/common/get_archives_info',
+    params: { userId },
+  });

+ 20 - 0
src/views/sop/components/dynamic-form-item/SELECT.vue

@@ -11,6 +11,7 @@
 <script setup name="SELECT">
 import { ref, onMounted, computed, watch } from 'vue';
 import { request } from '@/utils/request.js';
+import { getPersonInfoByUserId } from '@/api/sop.js';
 
 const API_TYPE1_IDS = [
   'region_coordinator_id_1',
@@ -62,6 +63,25 @@ const getOptions = async () => {
         value: item.userId,
       };
     });
+    let chooseValueArr = isMultiple.value
+      ? [...valueData.value]
+      : [valueData.value];
+    for (let i = 0; i < chooseValueArr.length; i++) {
+      let value = chooseValueArr[i];
+      if (!options.value.find((item) => item.userId === value)) {
+        let personInfo = await getPersonInfoByUserId(value);
+        if (
+          personInfo &&
+          !options.value.find((item) => item.value == personInfo.userId)
+        ) {
+          options.value.push({
+            label: `${personInfo.name}(${personInfo.archivesRoleName})_${personInfo.supplierName}_${personInfo.mobileNumber}`,
+            value: personInfo.userId,
+            disabled: true,
+          });
+        }
+      }
+    }
   }
 };