소스 검색

库存调拨新增列表维度筛选功能并优化相关表格显示逻辑

yusheng 9 달 전
부모
커밋
ee0600b152
1개의 변경된 파일51개의 추가작업 그리고 3개의 파일을 삭제
  1. 51 3
      src/views/warehouseManagement/inventoryAllocation/add.vue

+ 51 - 3
src/views/warehouseManagement/inventoryAllocation/add.vue

@@ -177,7 +177,26 @@
               </el-col>
               </el-col>
             </el-row>
             </el-row>
             <el-row :gutter="15">
             <el-row :gutter="15">
-              <el-col :span="18">
+              <el-col :span="9">
+                <el-form-item
+                  label="列表维度:"
+                  label-width="65px"
+                  prop="dimension"
+                >
+                  <template>
+                    <el-select
+                      clearable
+                      @change="handledime"
+                      v-model="dimension"
+                      placeholder="请选择"
+                    >
+                      <el-option label="批次维度" value="2"> </el-option>
+                      <el-option label="包装维度" value="3"> </el-option>
+                    </el-select>
+                  </template>
+                </el-form-item>
+              </el-col>
+              <el-col :span="10">
                 <el-input
                 <el-input
                   placeholder="请输入名称/编码/批次号/型号/规格/客户代号/刻码"
                   placeholder="请输入名称/编码/批次号/型号/规格/客户代号/刻码"
                   v-model="query.keyWord"
                   v-model="query.keyWord"
@@ -192,7 +211,7 @@
                   >
                   >
                 </el-input>
                 </el-input>
               </el-col>
               </el-col>
-              <el-col :span="6">
+              <el-col :span="5">
                 <div
                 <div
                   style="
                   style="
                     display: flex;
                     display: flex;
@@ -288,15 +307,18 @@
             <el-table-column
             <el-table-column
               label="包装编码"
               label="包装编码"
               prop="packageNo"
               prop="packageNo"
+              v-if="dimension == 3"
               :show-overflow-tooltip="true"
               :show-overflow-tooltip="true"
             ></el-table-column>
             ></el-table-column>
             <el-table-column
             <el-table-column
+              v-if="dimension == 3"
               label="包装数量"
               label="包装数量"
               prop="packingQuantity"
               prop="packingQuantity"
               :show-overflow-tooltip="true"
               :show-overflow-tooltip="true"
             ></el-table-column>
             ></el-table-column>
             <el-table-column
             <el-table-column
               label="包装单位"
               label="包装单位"
+              v-if="dimension == 3"
               prop="packingUnit"
               prop="packingUnit"
               :show-overflow-tooltip="true"
               :show-overflow-tooltip="true"
             ></el-table-column>
             ></el-table-column>
@@ -529,18 +551,26 @@
               prop="specification"
               prop="specification"
               :show-overflow-tooltip="true"
               :show-overflow-tooltip="true"
             ></el-table-column>
             ></el-table-column>
+            <el-table-column
+              label="批次号"
+              prop="batchNo"
+              :show-overflow-tooltip="true"
+            ></el-table-column>
             <el-table-column
             <el-table-column
               label="包装编码"
               label="包装编码"
+              v-if="dimension == 3"
               prop="packageNo"
               prop="packageNo"
               :show-overflow-tooltip="true"
               :show-overflow-tooltip="true"
             ></el-table-column>
             ></el-table-column>
             <el-table-column
             <el-table-column
               label="包装数量"
               label="包装数量"
+              v-if="dimension == 3"
               prop="packingQuantity"
               prop="packingQuantity"
               :show-overflow-tooltip="true"
               :show-overflow-tooltip="true"
             ></el-table-column>
             ></el-table-column>
             <el-table-column
             <el-table-column
               label="包装单位"
               label="包装单位"
+              v-if="dimension == 3"
               prop="packingUnit"
               prop="packingUnit"
               :show-overflow-tooltip="true"
               :show-overflow-tooltip="true"
             ></el-table-column>
             ></el-table-column>
@@ -613,6 +643,7 @@
         tuneLibrary: [], // 调入库
         tuneLibrary: [], // 调入库
         outWarehouseList: [],
         outWarehouseList: [],
         inWarehouseList: [],
         inWarehouseList: [],
+        dimension: '3',
         params: {
         params: {
           code: '',
           code: '',
           name: '',
           name: '',
@@ -704,6 +735,14 @@
           inFreightId: '', // 调入货位
           inFreightId: '', // 调入货位
           inFreightName: ''
           inFreightName: ''
         };
         };
+        if (dataList?.length) {
+          if (dataList[0].packageNo) {
+            this.dimension = '3';
+          }else{
+            this.dimension = '2';
+
+          }
+        }
         if (this.allocateId == 1) {
         if (this.allocateId == 1) {
           // 库内调拨
           // 库内调拨
           await this.outWarehouseChange(baseInfo.sourceWarehouseId); // 加载调出库区
           await this.outWarehouseChange(baseInfo.sourceWarehouseId); // 加载调出库区
@@ -712,6 +751,7 @@
           await this.outWarehouseChange(baseInfo.sourceWarehouseId); // 加载调出库区
           await this.outWarehouseChange(baseInfo.sourceWarehouseId); // 加载调出库区
           this.inWarehouseChange(baseInfo.targetWarehouseId); // 加载调入库区
           this.inWarehouseChange(baseInfo.targetWarehouseId); // 加载调入库区
         }
         }
+
         // 处理右边显示数据
         // 处理右边显示数据
         this.selectionIds = dataList.map((item) => item.outInDetailRecordId);
         this.selectionIds = dataList.map((item) => item.outInDetailRecordId);
         this.selection = this.productList.filter((item) => {
         this.selection = this.productList.filter((item) => {
@@ -1048,6 +1088,12 @@
       inChange(val) {
       inChange(val) {
         let obj = this.$refs.outTree.getNodeByValue(val);
         let obj = this.$refs.outTree.getNodeByValue(val);
       },
       },
+      handledime() {
+        this.getProductList();
+        this.selection=[]
+        this.$refs.table.clearSelection()
+        this.tableData=[]
+      },
       async getProductList() {
       async getProductList() {
         let params = {
         let params = {
           ...this.query,
           ...this.query,
@@ -1056,7 +1102,9 @@
           warehouseAreaGoodsId: this.params.outShelvesId,
           warehouseAreaGoodsId: this.params.outShelvesId,
           warehouseAreaGoodsShelvesId: this.params.outFreightId
           warehouseAreaGoodsShelvesId: this.params.outFreightId
         };
         };
-        const data = await storageApi.getPackingList({
+        const data = await storageApi[
+          this.dimension == 2 ? 'getBatchList' : 'getPackingList'
+        ]({
           ...params,
           ...params,
           pageNum: this.page,
           pageNum: this.page,
           size: this.size
           size: this.size