wxy 4 年之前
父节点
当前提交
d0050b46be
共有 2 个文件被更改,包括 8 次插入2 次删除
  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) {
       let obj = this.newObj;
       let numberIndex;
+      console.log(this.num);
+      //如果返回来的数组为空,那么就是这个list全部取消
       if (val.length === 0) {
         let newArray = _.differenceWith(this.selected, this.list[index].split, _.isEqual);
         this.$set(this, `selected`, newArray);
       } else {
+        //正常取消,除了全部取消的情况
         if (this.num === false) {
           numberIndex = _.findIndex(this.selected, function(o) {
             return o._id == obj._id;
@@ -503,8 +506,11 @@ export default {
           this.$set(this, `selected`, newData);
         }
       }
+      console.log(this.selected);
     },
     onTableSelect(selection, row) {
+      //判断是选中还是取消商品,num为true是选中,为false的时候是取消
+      //取消没了的时候selection.length为0,num也就是0
       this.num = selection.length && selection.indexOf(row) !== -1;
       this.newObj = row;
     },

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

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