Jelajahi Sumber

bug修复,优化项处理

黄梓星 1 tahun lalu
induk
melakukan
358a63e77b

+ 3 - 0
src/views/material/basicFile/index.vue

@@ -320,6 +320,9 @@
       },
       //查询
       handleQuery() {
+        // 重新查询后需要清空列表选中的数据
+        this.checkedList = [];
+        this.$refs.materialTable.clearSelection();
         this.getMaterialList('material');
       },
       // 重置查询条件

+ 17 - 0
src/views/purchase/PurchaseDemandList/add.vue

@@ -999,6 +999,22 @@ export default {
                 Object.values(data).forEach(errList => {
                     console.log('data',data)
                     console.log(errList)
+                    // 将子表下标加入进入标识字段
+                    this.basicForm.puDemandItemList.forEach((item,index) => {
+                      item.rightIndex = index
+                    })
+                    console.log('所有列表', this.basicForm.puDemandItemList)
+                    // 将校验未通过的项与整个表格数据进行过滤对比,得出校验通过的数据
+                    let rightList = this.basicForm.puDemandItemList.filter((item, index) => {
+                      return errList.find(item2 => {
+                        return item2.rowIndex !== item.rightIndex
+                      })
+                    })
+                    console.log('xxx',rightList)
+                    rightList.forEach(items => {
+                      this.$refs.table.$el.querySelector(`.elx-body--row:nth-of-type(${items.rightIndex+1})`).style.background = ''
+                    })
+
                     errList.forEach(params => {
                         let { rowIndex, column, rules } = params
                         rules.forEach(rule => {
@@ -1033,6 +1049,7 @@ export default {
           this.back()
         }
       }).catch(err => {
+        console.log(err)
         this.$modal.closeLoading();
       })
     },

+ 3 - 0
src/views/purchase/apply/edit/index.vue

@@ -97,6 +97,7 @@ export default {
   methods: {
     //
     async changeMaterialName(prop) {
+      console.log('prop',prop);
       const { selectData } = prop;
       const {
         puOrg,
@@ -106,11 +107,13 @@ export default {
         currencyCode,
         currencyName,
       } = this.params;
+      console.log('selectData', selectData)
       const { nickName: createByName } = this.$store.state.user;
       if (selectData.length) {
         this.params[this.tabName].splice(-1);
       }
       for (const item of selectData) {
+        console.log('item', item)
         this.loading = true;
         const { tax: taxName, unitName, code: materialCode } = item;
         // task 1