zhuliu пре 1 година
родитељ
комит
0db3d40bfc

+ 18 - 1
src/views/report/InvalidResponse/components/reasonsAndEvidence/common.js

@@ -469,9 +469,9 @@ export default {
               ...obj,
               ...obj,
               proofGroupId:response.data,
               proofGroupId:response.data,
             }
             }
+            this.updateSort(obj.featureSort,invalidStatueId,'add')
             if(type == 'up'){
             if(type == 'up'){
               this.tableData.splice(index,0,data)
               this.tableData.splice(index,0,data)
-              row.featureSort = Number(featureSort) + 1
             }else{
             }else{
               this.tableData.splice(index+1,0,data)
               this.tableData.splice(index+1,0,data)
             }
             }
@@ -481,6 +481,23 @@ export default {
           this.loading = false
           this.loading = false
         })
         })
       },
       },
+      //更新序号
+      updateSort(sort,invalidStatueId,type){
+        var arr = this.tableData.filter(item=>{
+          return item.invalidReasonDTO.invalidStatueId == invalidStatueId
+        })
+        for(var i = 1;i<arr.length+1;i++){
+          var featureSort = Number(arr[i].featureSort)
+          if(featureSort>= sort){
+            if(type == 'add'){
+              arr[i].featureSort = featureSort+1
+            }else if(type == 'del'){
+              arr[i].featureSort = featureSort-1
+            }
+            
+          }
+        }
+      },
       //删除无效理由
       //删除无效理由
       delInvalidStatue(scope){
       delInvalidStatue(scope){
         this.$confirm('确认删除本条数据吗?', '提示', {
         this.$confirm('确认删除本条数据吗?', '提示', {

+ 3 - 1
src/views/report/InvalidResponse/components/reasonsAndEvidence/details_2.vue

@@ -237,11 +237,13 @@ export default {
             var params = {
             var params = {
                 proofGroupId:row.proofGroupId
                 proofGroupId:row.proofGroupId
             }
             }
-           
+            var featureSort = row.featureSort
+            var invalidStatueId = row.invalidStatueId
             this.$api.delFeature(params).then(response=>{
             this.$api.delFeature(params).then(response=>{
                 if(response.code == 200){
                 if(response.code == 200){
                     this.$message.success('删除成功')
                     this.$message.success('删除成功')
                     this.loading = false
                     this.loading = false
+                    this.updateSort(featureSort,invalidStatueId,'del')
                     this.tableData.splice(index,1)
                     this.tableData.splice(index,1)
                     this.getSpanArr(this.tableData)
                     this.getSpanArr(this.tableData)
                 }
                 }