Browse Source

责任者回显

duy 2 years ago
parent
commit
3323288c2e
1 changed files with 43 additions and 9 deletions
  1. 43 9
      src/views/file/collection.vue

+ 43 - 9
src/views/file/collection.vue

@@ -412,7 +412,7 @@ const setdutyUser=async()=>{
     if (!error && code === 200) {
             if(data?.contractType===1){  
             dutyUser.value=data?.constructionUnitName||''
-            }else if(data?.ontractType===2){
+            }else if(data?.contractType===2){
                     dutyUser.value=data?.supervisionUnitName||''
             }else if(data?.contractType===3){
                     dutyUser.value=data?.contractorUnitName||''
@@ -652,7 +652,23 @@ const tableIsInput = (val, row, key) => {
 //         sortingActiveKey.value = `item-${index}`;
 //     }
 // }
-
+const checkList=ref([])
+const getcheckList=()=>{
+    console.log( sortingItemData.value,' sortingItemData.value.');
+    let arrList=[]
+    sortingItemData.value.forEach((item)=>{
+        if(item&&item?.list){
+            item?.list.forEach((item1)=>{
+                if(item1?.checked){
+                    arrList.push(item1)
+                }
+        })
+        }
+      
+    })
+   
+    checkList.value=arrList
+}
 const sortingActiveKey = ref([])
 const sortingSelectFile = (row, index) => {
     const key = `item-${index}`;
@@ -689,6 +705,8 @@ const getSortingTableData = async(row, index) => {
     if (!error && code === 200) {
         row.list = getArrValue(data['records'])
         setTableCheck(row, index)
+     
+       
     } else {
         row.list = []
     }
@@ -714,13 +732,28 @@ const setTableCheck = async(row, index) => {
 //多选
 const sortingTableKeys = ref([]);
 const sortingTableSelection = (rows,list,event) => {
-    //console.log(event)
-    list.forEach(element => {
-        element.checked = false;
-    });
-    rows.forEach((element)=>{
-        element.checked = true;
-    })
+  
+    getcheckList()
+   if(checkList.value.length<1){
+        list.forEach(element => {
+            element.checked = false;
+        });
+        rows.forEach((element)=>{
+            element.checked = true;
+        })
+   }else{
+    console.log(  checkList.value,'  checkList.value');
+    checkList.value.forEach((item)=>{
+        rows.forEach((ele)=>{
+            if(ele.id===item.id){
+                // ele.checked=false
+                console.log(1111122222);
+            }
+        })
+  })
+   }
+
+ 
 }
 
 //删除
@@ -746,6 +779,7 @@ const sortingDelData = (row,index) => {
 
 //添加分盒
 const addSortingModalClick = () => {
+    console.log('添加分盒');
     sortingItemData.value.push({
         boxName: ''
     })