huang_an 2 lat temu
rodzic
commit
eb4083e9dd

+ 7 - 0
src/api/warehouseManagement/outin.js

@@ -22,6 +22,13 @@ export default {
       return res.data;
     }
   },
+  //新保存
+  saveNew: async (data) => {
+    const res = await request.post('/wms/outin/saveNew', data);
+    if (res.data.code == 0) {
+      return res.data;
+    }
+  },
   //删除
   delete: async (data) => {
     const res = await request.delete('/wms/outin/delete', data);

+ 64 - 60
src/views/warehouseManagement/components/AssetsDialog.vue

@@ -147,7 +147,7 @@
           ></el-table-column>
           <el-table-column
             v-if="dimension == 4"
-            prop="code"
+            prop="no"
             label="物料编码"
             min-width="120"
           ></el-table-column>
@@ -311,16 +311,13 @@
     },
     created() {},
     methods: {
-      // rowKey() {
-      //   if (this.dimension == 1 || this.dimension == 3) {
-      //     return 'id';
-      //   } else if (this.dimension == 2) {
-      //     return 'stockBatchId';
-      //   } else {
-      //     return 'meterielId';
-      //   }
-      // },
-      async changeDimension(e) {
+      async changeDimension(e, is) {
+        // await this.$refs.multipleTable.clearSelection();
+        // this.selectionList = [];
+        console.log('===1', this.warehousingMaterialList);
+        // if (is != 'page') {
+        //   this.$refs.multipleTable.clearSelection();
+        // }
         this.dimension = e;
         let res = {};
         const params = {
@@ -355,15 +352,16 @@
           });
         } else if (e == 4) {
           res = await outin.getMaterielDetails(params);
-          this.tableData = res.list.map((item) => {
+          this.tableData = res.list.map((item, index) => {
             return {
               ...item,
               availableCountBase: 1,
               packingCountBase: 1,
               minUnit: item.packingUnit,
-              oid: item.meterielId
+              oid: item.id + this.pages.pageNum + (index + 1)
             };
           });
+          console.log('===', this.tableData);
         } else {
           res = await outin.getRealTimeInventory(params);
           this.tableData = res.list.map((item) => {
@@ -382,7 +380,7 @@
                   ? item.id == i.id
                   : this.dimension == 2
                   ? item.stockBatchId == i.stockBatchId
-                  : item.meterielId == i.meterielId
+                  : item.oid == i.oid
               );
               if (index > -1) {
                 // 删除还给 multipleSelection
@@ -408,17 +406,18 @@
       },
       async handleExit(arr) {
         let ids = null;
-        if (this.dimension == 1 || this.dimension == 3) {
+        if (this.dimension == 3) {
           ids = arr.map((item) => {
             return item.id;
           });
-        } else if (this.dimension == 2) {
+        } else if (this.dimension == 2 || this.dimension == 1) {
           ids = arr.map((item) => {
             return item.recordId;
           });
+          // this.dimension = 2;
         } else {
           ids = arr.map((item) => {
-            return item.meterielId;
+            return item.recordId;
           });
         }
         const parmas = {
@@ -435,11 +434,13 @@
           return;
         }
         const data = await this.handleExit(this.selectionList);
-        this.$emit(
-          'detailData',
-          { ...data, wlList: this.selectionList },
-          this.dimension
-        );
+        let arr = [];
+        if (this.dimension == 4) {
+          arr = this.selectionList.map((item) => {
+            return { ...item, assetName: item.name };
+          });
+        }
+        this.$emit('detailData', { ...data, wlList: arr }, this.dimension);
 
         // this.$emit('selectTableData', this.selectionList);
         this.cancel();
@@ -461,7 +462,7 @@
       },
       handleCurrentChange() {
         // this.getList();
-        this.changeDimension(this.dimension);
+        this.changeDimension(this.dimension, 'page');
       },
       reset() {
         this.searchForm.code = '';
@@ -476,46 +477,49 @@
       handleSizeChange() {
         this.pages.pageNum = 1;
         // this.getList();
-        this.changeDimension(this.dimension);
-      },
-      async getList() {
-        const params = {
-          ...this.pages,
-          ...this.searchForm,
-          dimension: this.dimension
-          // code: 5
-        };
-
-        if (this.materialType) {
-          params.categoryLevelId = this.materialType;
-        }
+        this.changeDimension(this.dimension, 'page');
+      }
+      // async getList() {
+      //   const params = {
+      //     ...this.pages,
+      //     ...this.searchForm,
+      //     dimension: this.dimension
+      //     // code: 5
+      //   };
 
-        const res = await outin.getMaterielDetails(params);
+      //   if (this.materialType) {
+      //     params.categoryLevelId = this.materialType;
+      //   }
 
-        if (res) {
-          this.tableData = res.list.map((item) => {
-            return { ...item, oid: item.id };
-          });
-          this.total = res.count;
-          // this.selectionList = deepClone(this.warehousingMaterialList);
+      //   const res = await outin.getMaterielDetails(params);
 
-          this.$nextTick(() => {
-            this.tableData.forEach((item) => {
-              const index = this.warehousingMaterialList.findIndex((i) =>
-                this.dimension == 1 || this.dimension == 3
-                  ? item.id == i.id
-                  : this.dimension == 2
-                  ? item.stockBatchId == i.stockBatchId
-                  : item.meterielId == i.meterielId
-              );
-              if (index > -1) {
-                // 删除还给 multipleSelection
-                this.$refs.multipleTable.toggleRowSelection(item, true);
-              }
-            });
-          });
-        }
-      }
+      //   if (res) {
+      //     this.tableData = res.list.map((item, index) => {
+      //       return {
+      //         ...item,
+      //         oid: index + 1 + (this.pages.pageNum - 1) * this.pages.size
+      //       };
+      //     });
+      //     this.total = res.count;
+      //     // this.selectionList = deepClone(this.warehousingMaterialList);
+      //     console.log(' this.tableData==', this.tableData);
+      //     this.$nextTick(() => {
+      //       this.tableData.forEach((item) => {
+      //         const index = this.warehousingMaterialList.findIndex((i) =>
+      //           this.dimension == 1 || this.dimension == 3
+      //             ? item.id == i.id
+      //             : this.dimension == 2
+      //             ? item.stockBatchId == i.stockBatchId
+      //             : item.meterielId == i.meterielId
+      //         );
+      //         if (index > -1) {
+      //           // 删除还给 multipleSelection
+      //           this.$refs.multipleTable.toggleRowSelection(item, true);
+      //         }
+      //       });
+      //     });
+      //   }
+      // }
     }
   };
 </script>

+ 68 - 11
src/views/warehouseManagement/outgoingManagement/add.vue

@@ -480,7 +480,7 @@
                   v-if="dimension == 4"
                   label="包装编码"
                   min-width="100"
-                  prop="assetCode"
+                  prop="onlyCode"
                 ></el-table-column>
                 <el-table-column
                   v-for="(item, index) in tableHeader"
@@ -500,7 +500,7 @@
                 <el-table-column
                   label="物料编码"
                   width="250"
-                  prop="code"
+                  prop="no"
                 ></el-table-column>
 
                 <!-- <el-table-column label="生产日期" width="200">
@@ -553,7 +553,7 @@
         </div>
       </div>
       <div class="center mt20">
-        <el-button type="primary" @click="handleSave" :loading="saveLoading"
+        <el-button type="primary" @click="handleNewSave" :loading="saveLoading"
           >保存</el-button
         >
         <el-button @click="$router.go(-1)">返回</el-button>
@@ -695,8 +695,10 @@
         onSelectTableDataVal: [],
         batchDetailsVOList: [],
         materialCodeReqList: [],
-        selectionList: []
-        // shouldTriggerPickorder: true
+        selectionList: [],
+        // shouldTriggerPickorder: true,
+        materialObj: {},
+        wlParams: {}
       };
     },
     computed: {
@@ -739,18 +741,39 @@
         if (dimension == 4) {
           this.materialCodeReqList = data.wlList;
           this.selectionList = data.wlList;
-          const obj = {
-            outInDetailAddPOList: data.realTimeInventoryVOList
+          console.log('====', data);
+
+          let params = {
+            realTimeInventoryNewPOList: data.realTimeInventoryVOList
           };
-          // this.batchDetailsVOList = data.batchDetailsVOList;
-          // this.selectionList = data.wlList;
+
+          for (const item of params.realTimeInventoryNewPOList) {
+            item.inventoryDetailsNewPOList = item.inventoryDetailsVOList;
+
+            for (const detail of item.inventoryDetailsNewPOList) {
+              detail.outInMaterialDetailsAddPOList = [];
+
+              for (const wlItem of data.wlList) {
+                if (detail.id === wlItem.recordId) {
+                  detail.outInMaterialDetailsAddPOList.push({ ...wlItem });
+                }
+              }
+            }
+          }
+          this.wlParams = params;
+
+          this.materialObj = data;
         } else if (dimension == 3) {
-          // this.selectionList = data.wlList;
           this.batchDetailsVOList = data.wlList.map((item) => {
-            return { ...item, packingCountBase: 1 };
+            return {
+              ...item,
+              packingCountBase: dimension == 4 ? 1 : item.packingCountBase
+            };
           });
+          this.selectionList = data.wlList;
         } else if (dimension == 2) {
           this.batchDetailsVOList = data.wlList;
+          this.selectionList = data.wlList;
         }
       },
 
@@ -1016,6 +1039,40 @@
         }
         return arr;
       },
+      handleNewSave() {
+        this.$refs.formName.validate(async (valid) => {
+          if (valid) {
+            if (!this.warehousingMaterialList?.length) {
+              return this.$message.error('请添加出库明细!');
+            }
+            let obj = { ...this.formData, type: 2 };
+
+            obj.extInfo.sourceBizNo = obj.sourceBizNo;
+            obj.fromType = obj.type;
+            this.saveLoading = true;
+            obj.num = this.materialObj.wlList.length;
+            if (this.dimension == 4) {
+              obj = { ...obj, ...this.wlParams };
+            }
+            console.log('2222', obj);
+
+            try {
+              const res = await outin.saveNew(obj);
+              if (res.code == 0) {
+                this.$message.success('保存成功!');
+              }
+              this.$router.push('/warehouseManagement/outgoingManagement');
+              if (res?.success) {
+                this.$message.success('保存成功!');
+                this.$router.go(-1);
+              }
+              this.saveLoading = false;
+            } catch (error) {
+              this.saveLoading = false;
+            }
+          }
+        });
+      },
 
       handleSave() {
         this.$refs.formName.validate(async (valid) => {

+ 1 - 1
src/views/warehouseManagement/outgoingManagement/components/batchDetail.vue

@@ -13,7 +13,7 @@
       <el-table-column label="名称" prop="name"></el-table-column>
       <el-table-column label="批次号" prop="batchNo"></el-table-column>
       <el-table-column label="包装编码" prop="batchNo"></el-table-column>
-      <el-table-column label="包装数量" prop="packingCountBase" width="120">
+      <el-table-column label="包装数量" prop="packageNo" width="120">
       </el-table-column>
       <el-table-column label="包装单位" prop="packingUnit"></el-table-column>
       <el-table-column

+ 160 - 72
src/views/warehouseManagement/outgoingManagement/details.vue

@@ -108,7 +108,7 @@
           </div>
         </div>
         <div class="content-detail mt20">
-          <header-title title="出库明细" size="16px"></header-title>
+          <header-title title="出库物品明细" size="16px"></header-title>
 
           <div class="mt20">
             <div class="mt10">
@@ -123,10 +123,10 @@
                 <el-table-column label="序号" type="index" width="50">
                 </el-table-column>
                 <el-table-column
-                  label="物品编码"
+                  label="编码"
                   prop="categoryCode"
                 ></el-table-column>
-                <el-table-column label="物品名称" prop="name"></el-table-column>
+                <el-table-column label="名称" prop="name"></el-table-column>
 
                 <el-table-column
                   v-for="(item, index) in tableHeader"
@@ -142,55 +142,59 @@
                     <template v-else>{{ row[item.prop] }}</template>
                   </template>
                 </el-table-column>
-                <el-table-column label="出库数量" align="center" width="320">
+                <el-table-column
+                  label="批次号"
+                  prop="batchNo"
+                ></el-table-column>
+                <el-table-column label="最小包装单元" width="120">
+                  <template slot-scope="{ row }">
+                    {{ row.minPackingCount }}{{ row.measuringUnit }}/{{
+                      row.packingUnit
+                    }}
+                  </template>
+                </el-table-column>
+                <el-table-column label="包装数量" prop="availableCountBase">
                   <template slot-scope="{ row }">
-                    <el-row :gutter="4">
-                      <el-col :span="9" v-if="!row.isUnpack" :offset="7">
-                        <el-input type="text" disabled :value="row.count">
-                          <template slot="append">
-                            {{ row.measuringUnit }}
-                          </template>
-                        </el-input>
-                      </el-col>
-                      <!-- <el-col :span="9">
-                        <el-input
-                          type="text"
-                          :value="row.minPackingCount"
-                          disabled
-                        >
-                          <template slot="append">
-                            {{ row.measuringUnit }}
-                          </template>
-                        </el-input></el-col
-                      >
-                      <el-col :span="9" v-if="!row.isUnpack">
-                        <el-input
-                          type="text"
-                          disabled
-                          :value="row.packingCount"
-                        >
-                          <template slot="append">
-                            {{ row.packingUnit }}
-                          </template>
-                        </el-input>
-                      </el-col> -->
-                    </el-row>
+                    {{ row.packingCount }}{{ row.packingUnit }}
                   </template>
                 </el-table-column>
+                <el-table-column
+                  label="计量数量"
+                  prop="count"
+                ></el-table-column>
+                <el-table-column
+                  label="计量单位"
+                  prop="measuringUnit"
+                ></el-table-column>
+                <el-table-column label="重量" prop="weight"></el-table-column>
+                <el-table-column
+                  label="重量单位"
+                  prop="weightUnit"
+                ></el-table-column>
+                <el-table-column label="单价">
+                  <template slot-scope="{ row }">
+                    {{ row.price ? row.price : '-' }}元/{{ row.weightUnit }}
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="金额"
+                  prop="totalMoney"
+                ></el-table-column>
+                <el-table-column
+                  label="领料部门"
+                  prop="position"
+                ></el-table-column>
               </el-table>
             </div>
           </div>
         </div>
-
-        <div class="mt20">
-          <header-title
-            :title="`${
+        <!-- ${
               infoData.bizType == 3
                 ? '物品'
                 : getDictValue('类型用途', infoData.assetType)
-            }明细`"
-            size="16px"
-          ></header-title>
+            }明细 -->
+        <div class="mt20">
+          <header-title :title="`出库包装明细`" size="16px"></header-title>
           <el-table
             ref="multipleTable"
             :data="materialCodeReqList"
@@ -201,59 +205,127 @@
           >
             <el-table-column label="序号" type="index" width="50">
             </el-table-column>
-            <el-table-column
-              :label="`${
+            <!-- ${
                 infoData.bizType == 3
                   ? '物品'
                   : getDictValue('类型用途', infoData.assetType)
-              }编码`"
-              prop="code"
+              } -->
+            <el-table-column
+              :label="`编码`"
+              prop="categoryCode"
             ></el-table-column>
+            <el-table-column :label="`名称`" prop="name"></el-table-column>
             <el-table-column label="批次号" prop="batchNo"></el-table-column>
-            <el-table-column label="生产日期" width="200">
+            <el-table-column
+              label="包装编码"
+              prop="code"
+              width="80"
+            ></el-table-column>
+            <el-table-column label="包装数量" prop="packingCount" width="80">
               <template slot-scope="{ row }">
-                <span v-if="row.dateType == 2">
-                  {{ row.produceTime }}
-                </span>
+                {{ row.packingCount == 0 ? '0' : row.packingCount }}
               </template>
             </el-table-column>
-            <el-table-column label="采购日期" width="200">
+            <el-table-column
+              label="包装单位"
+              prop="packingUnit"
+            ></el-table-column>
+            <el-table-column
+              label="计量数量"
+              prop="totalCount"
+            ></el-table-column>
+            <el-table-column
+              label="计量单位"
+              prop="measuringUnit"
+            ></el-table-column>
+            <!-- <el-table-column label="领料部门" prop=""></el-table-column> -->
+            <el-table-column
+              v-if="infoData.bizType == 2 || infoData.bizType == 1"
+              label="物料代号"
+              prop="materielCode"
+            >
               <template slot-scope="{ row }">
-                <span v-if="row.dateType == 1">
-                  {{ row.procureTime }}
-                </span>
+                {{ row.materielCode }}
               </template>
             </el-table-column>
-            <el-table-column align="center" label="最小包装单元">
-              <template slot-scope="{ row, $index }">
-                <template v-if="!row.isUnpack">
-                  <!-- {{ row.measurementUnit }}{{ row.measuringUnit }}/{{
-                    row.packingUnit
-                  }} -->
-                  <span>{{ row.measuringUnit }}/{{ row.packingUnit }}</span>
-                </template>
+            <el-table-column
+              v-if="infoData.bizType == 2 || infoData.bizType == 1"
+              label="客户代号"
+              prop="clientCode"
+            >
+              <template slot-scope="{ row }">
+                {{ row.clientCode }}
               </template>
             </el-table-column>
-            <el-table-column
-              label="包装编码"
-              prop="packageNo"
-            ></el-table-column>
-            <el-table-column label="领料部门" prop=""></el-table-column>
-            <el-table-column label="货位" prop="">
+            <!-- v-if="infoData.bizType == 1" -->
+            <el-table-column label="刻码" prop="engrave">
+              <template slot-scope="{ row }">
+                {{ row.engrave }}
+              </template>
+            </el-table-column>
+            <el-table-column label="重量" prop="weight">
+              <template slot-scope="{ row }">
+                {{ row.weight }}
+              </template>
+            </el-table-column>
+            <el-table-column label="重量单位" prop="weightUtil">
+              <template slot-scope="{ row }">
+                {{ row.weightUtil }}
+              </template>
+            </el-table-column>
+
+            <el-table-column label="日期" prop="createTime" width="200">
+              <template slot="header" slot-scope="scope">
+                <!-- {{ dateTypes != 1 ? '采购日期' : '生产日期' }} -->
+                采购日期
+              </template>
+              <template slot-scope="{ row }">
+                {{ row.createTime }}
+              </template>
+            </el-table-column>
+            <el-table-column label="领料部门" prop="">
               <template slot-scope="{ row }">
-                <!-- {{ row.warehouseName }}-{{ row.areaName }}-{{
-                  row.shelfCode
-                }}-{{ row.cargoSpaceCode }} -->
                 {{ row.position }}
               </template>
             </el-table-column>
-            <el-table-column label="转消耗" prop="">
+            <!-- <el-table-column label="转消耗" prop="">
               <template slot-scope="{ row }">
                 <el-checkbox
                   disabled
                   v-model="row.isTransferAsset"
                 ></el-checkbox>
               </template>
+            </el-table-column> -->
+          </el-table>
+        </div>
+        <div class="mt20">
+          <header-title :title="`出库物料明细`" size="16px"></header-title>
+          <el-table
+            ref="multipleTable1"
+            :data="metaList"
+            tooltip-effect="dark"
+            style="width: 100%"
+            stripe
+            :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
+          >
+            <el-table-column label="序号" type="index" width="50">
+            </el-table-column>
+            <el-table-column label="编码" prop="assetCode"> </el-table-column>
+            <el-table-column label="名称" prop="assetName"> </el-table-column>
+            <el-table-column label="批次号" prop="batchNo"> </el-table-column>
+            <el-table-column label="物料编码" prop="no"> </el-table-column>
+            <el-table-column label="计量数量" prop="">
+              <template slot-scope="{ row }">1</template>
+            </el-table-column>
+            <el-table-column label="计量单位" prop="measuringUnit">
+            </el-table-column>
+            <el-table-column label="物料代号" prop="meterielCode">
+            </el-table-column>
+            <el-table-column label="客户代号" prop="clientCode">
+            </el-table-column>
+            <el-table-column label="刻码" prop="engrave"> </el-table-column>
+            <el-table-column label="重量" prop="weight"> </el-table-column>
+            <el-table-column label="重量单位" prop="weightUnit">
             </el-table-column>
           </el-table>
         </div>
@@ -285,6 +357,7 @@
     components: { StatusStep },
     data() {
       return {
+        metaList: [],
         infoData: {},
         warehousingMaterialList: [],
         materialCodeReqList: [],
@@ -413,6 +486,21 @@
             }
           }
           this.materialCodeReqList = arr;
+          let arrs = [];
+          for (const key in res.outInDetailVOList) {
+            for (const j in res.outInDetailVOList[key]
+              .outInDetailRecordVOList) {
+              for (const k in res.outInDetailVOList[key]
+                .outInDetailRecordVOList[j]
+                .outInDetailRecordMaterialDetailVOList) {
+                arrs.push({
+                  ...res.outInDetailVOList[key].outInDetailRecordVOList[j]
+                    .outInDetailRecordMaterialDetailVOList[k]
+                });
+              }
+            }
+          }
+          this.metaList = arrs;
           // console.log('qwqwqw', arr);
           // res.warehouseLedgerInfos.ledgers;
           // .map((i) =>

+ 1 - 1
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -9,7 +9,7 @@
       :initLoad="false"
       :columns="columns"
       :datasource="datasource"
-      height="calc(100vh - 265px)"
+      height="calc(100vh - 355px)"
       full-height="calc(100vh - 116px)"
       tool-class="ele-toolbar-form"
       cache-key="systemOrgUserTable"