Explorar o código

货位批量删除

695593266@qq.com hai 10 meses
pai
achega
3c99c04f20
Modificáronse 2 ficheiros con 26 adicións e 4 borrados
  1. 24 2
      src/views/material/product/components/goodsAllocation.vue
  2. 2 2
      vue.config.js

+ 24 - 2
src/views/material/product/components/goodsAllocation.vue

@@ -265,7 +265,8 @@
             trigger: 'blur'
           }
         },
-        
+
+        selectionList: []
       };
     },
     created() {},
@@ -306,7 +307,28 @@
       },
 
       batchDelete() {
+        if (this.selectionList.length == 0) {
+          return this.$message.warning('请选择需要删除的数据!');
+        }
 
+        this.$confirm('此操作将删除该数据, 是否继续?', '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        })
+          .then(() => {
+            this.selectionList.forEach((item) => {
+              const index = this.form.positionList.findIndex(
+                (it) => it.id == item.id
+              );
+
+              if (index || index == 0) {
+                this.form.positionList.splice(index, 1);
+                this.form['removeIds'].push(this.form.positionList[index].id);
+              }
+            });
+          })
+          .catch(() => {});
       },
 
       handleHjCode() {
@@ -466,7 +488,7 @@
       },
 
       handleSelectionChange(list) {
-        console.log(list);
+        this.selectionList = list;
       },
 
       save() {

+ 2 - 2
vue.config.js

@@ -36,10 +36,10 @@ module.exports = {
         // target: 'http://192.168.1.158:18086',
         // target: 'http://192.168.1.176:18086',
         // target: 'http://192.168.1.251:18086',
-        target: 'http://192.168.1.125:18086',
+        // target: 'http://192.168.1.125:18086',
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.251:18186',
-        // target: 'http://192.168.1.251:18087',
+        target: 'http://192.168.1.251:18087',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''