huang_an 2 лет назад
Родитель
Сommit
21fd532709
2 измененных файлов с 47 добавлено и 2 удалено
  1. 46 1
      src/views/warehouseManagement/stockManagement/add.vue
  2. 1 1
      vue.config.js

+ 46 - 1
src/views/warehouseManagement/stockManagement/add.vue

@@ -790,7 +790,15 @@
               >
             </div>
           </header-title>
-
+          <el-button
+            v-if="materialCodeReqList.length != 0"
+            type="success"
+            plain
+            style="margin-bottom: 20px; float: right; margin-right: 20px"
+            size="mini"
+            @click="wrapListSave"
+            >批量保存</el-button
+          >
           <el-table
             v-if="showMaterialTable"
             ref="materialCodeReqListTable"
@@ -997,6 +1005,15 @@
         </div>
         <div class="mt20" v-if="isDetail">
           <header-title :title="`物料明细`"> </header-title>
+          <el-button
+            v-if="resultArray.length != 0"
+            type="success"
+            plain
+            style="margin-bottom: 20px; float: right; margin-right: 20px"
+            size="mini"
+            @click="materialListSave"
+            >批量保存</el-button
+          >
           <el-table
             ref="resultArrayTable"
             :data="resultArray"
@@ -1326,6 +1343,23 @@
             break;
         }
       },
+      // 包装批量保存
+      wrapListSave() {
+        // 批量修改包装明细
+        this.isWeight = false;
+        this.bulkEditingWrap();
+        this.$nextTick(() => {
+          this.isWeight = true;
+        });
+      },
+      // 物料批量保存
+      materialListSave() {
+        this.resultArray.forEach((item) => {
+          if (!item.isPack) {
+            this.materialBtn(item);
+          }
+        });
+      },
       weightInput(value, row) {
         const newValue = value.replace(/[^\d.]/g, ''); // 保留数字和小数点
         const decimalCount = (newValue.match(/\./g) || []).length; // 计算小数点的个数
@@ -1791,6 +1825,9 @@
         this.$set(row, 'isSave', false);
         row.selfWarehouseLedgerDetails = row.warehouseLedgerDetails;
         row.warehouseLedgerDetails = [];
+        // 清空物料明细防止数据错乱
+        this.resultArray = [];
+        this.isDetail = false;
       },
       listSave(row, index) {
         const fileds = [
@@ -2177,6 +2214,14 @@
             ) {
               return this.$message.error('请保存入库明细!');
             }
+            // 默认全部保存
+            if (this.resultArray?.length > 0) {
+              // 物料批量保存
+              this.materialListSave();
+            } else {
+              // 包装批量保存
+              this.wrapListSave();
+            }
             this.formatWarehouseMaterialList();
 
             let arr = this.warehousingMaterialList.map((item) => {

+ 1 - 1
vue.config.js

@@ -34,7 +34,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001', // 测试环境
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.132:18086',
-        target: 'http://192.168.1.108:18086',
+        target: 'http://192.168.1.147:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''