Pārlūkot izejas kodu

责任者回显

duy 2 gadi atpakaļ
vecāks
revīzija
efa2cbb9e3

+ 9 - 1
src/api/modules/archiveFile/archiveFile.js

@@ -82,11 +82,19 @@ export default {
         }, msg);
     },
       //分盒整理删除接口
-      async removeAllocation(form, msg = true) {
+    async removeAllocation(form, msg = true) {
         return httpApi({
             url: '/api/blade-archive/archiveFile/removeAllocation',
             method: 'post',
             params: form
         }, msg);
     },
+    //获取责任者
+    async getDutyUser(form, msg = true) {
+        return httpApi({
+            url: '/api/blade-archive/archiveFile/getDutyUser',
+            method: 'get',
+            params: form
+        }, msg)
+      },
 }

+ 16 - 8
src/views/file/collection.vue

@@ -408,14 +408,20 @@ onMounted(() => {
 const {contractType} = contractInfo.value;
 const dutyUser=ref('')
 //设置责任者
-const setdutyUser=()=>{
-    if(contractType===1){
-        dutyUser.value=contractInfo?.contractorUnitName||''
-    }else if(contractType===2){
-        dutyUser.value=contractInfo?.constructionUnitName||''
-    }else if(ontractType===3){
-        dutyUser.value=contractInfo?.supervisionUnitName||''
-    }
+const setdutyUser=async()=>{
+    const { error, code, data,msg } = await archiveFileApi.getDutyUser({
+        contractId: treecontractId.value,
+    })
+    if (!error && code === 200) {
+            if(contractType===1){  
+            dutyUser.value=data?.contractorUnitName||''
+            }else if(contractType===2){
+                    dutyUser.value=data?.constructionUnitName||''
+            }else if(contractType===3){
+                    dutyUser.value=data?.supervisionUnitName||''
+            }
+    } 
+   
 }
 //打开文件选择框
 const uploadFileClick = () => {
@@ -476,9 +482,11 @@ const primaryKeyId = ref('')
 const isBuiltDrawing = ref(0)
 const isStorageNode = ref(0)
 const nodeIds = ref('')
+const treecontractId=ref('')
 const projectTreeClick = ({node, data, keys, key}) => {
     nodeIds.value = data.id || '';
     isStorageNode.value = data['isStorageNode'] || 0;
+    treecontractId.value=data?.contractId||''
 
     //设置搜索数据
     searchForm.value.current = 1;