wxy 4 years ago
parent
commit
d0050b46be
2 changed files with 8 additions and 2 deletions
  1. 6 0
      src/views/order/transport/index.vue
  2. 2 2
      src/views/order/transport/sign.vue

+ 6 - 0
src/views/order/transport/index.vue

@@ -486,10 +486,13 @@ export default {
     handleSelectionChange(val, index) {
     handleSelectionChange(val, index) {
       let obj = this.newObj;
       let obj = this.newObj;
       let numberIndex;
       let numberIndex;
+      console.log(this.num);
+      //如果返回来的数组为空,那么就是这个list全部取消
       if (val.length === 0) {
       if (val.length === 0) {
         let newArray = _.differenceWith(this.selected, this.list[index].split, _.isEqual);
         let newArray = _.differenceWith(this.selected, this.list[index].split, _.isEqual);
         this.$set(this, `selected`, newArray);
         this.$set(this, `selected`, newArray);
       } else {
       } else {
+        //正常取消,除了全部取消的情况
         if (this.num === false) {
         if (this.num === false) {
           numberIndex = _.findIndex(this.selected, function(o) {
           numberIndex = _.findIndex(this.selected, function(o) {
             return o._id == obj._id;
             return o._id == obj._id;
@@ -503,8 +506,11 @@ export default {
           this.$set(this, `selected`, newData);
           this.$set(this, `selected`, newData);
         }
         }
       }
       }
+      console.log(this.selected);
     },
     },
     onTableSelect(selection, row) {
     onTableSelect(selection, row) {
+      //判断是选中还是取消商品,num为true是选中,为false的时候是取消
+      //取消没了的时候selection.length为0,num也就是0
       this.num = selection.length && selection.indexOf(row) !== -1;
       this.num = selection.length && selection.indexOf(row) !== -1;
       this.newObj = row;
       this.newObj = row;
     },
     },

+ 2 - 2
src/views/order/transport/sign.vue

@@ -127,7 +127,7 @@ export default {
     },
     },
     //保存
     //保存
     async turnSave(data) {
     async turnSave(data) {
-      console.log(data);
+      // console.log(data);
       if (data.id) {
       if (data.id) {
         data.status = '1';
         data.status = '1';
         const res = await this.transportSign(data);
         const res = await this.transportSign(data);
@@ -137,7 +137,7 @@ export default {
       }
       }
     },
     },
     sign(data) {
     sign(data) {
-      console.log(data);
+      // console.log(data);
       this.$set(this, `form`, data);
       this.$set(this, `form`, data);
       this.dialog = true;
       this.dialog = true;
     },
     },