huang_an 2 лет назад
Родитель
Сommit
57a70b1dd3

+ 72 - 37
src/views/warehouseManagement/components/WareHouseDailog.vue

@@ -157,12 +157,12 @@
         }
         this.tableList.splice(index, 1);
       },
-      handlCur(row) {
+      handlCur(row, num) {
         if (![1, 2].includes(row.allocationStatus)) {
           return;
         }
         this.cur = { ...row };
-
+        console.log('==this.formData', this.formData);
         // let shelfId=
         const { area, shelves, warehouse } = this.formData;
         let warehouseId = warehouse.id;
@@ -194,7 +194,7 @@
             shelfCode,
             cargoSpaceId,
             cargoSpaceCode,
-            num: null
+            num: num ? num : this.row.outInNum
           });
         }
       },
@@ -223,47 +223,82 @@
           return item.goodsshelvesCode == id;
         })[0].id;
         const res = await warehouseDefinition.getListByGoodId(goodsId);
-        // console.log(res);
         this.locationList = res;
       },
       getStatus: useDict(warehouseDefinition_locationStatus),
       async open(row, idx) {
-        this.row = row;
-        this.idx = idx;
-        this.visible = true;
-        await this._getWarehouseChildren();
-        if (this.row?.warehouseId) {
-          this.warehouse = this.row.warehouseId;
-          this.formData.warehouse = this.warehouseList.find(
-            (w) => w.id == this.row.warehouseId
-          );
-          const res = await warehouseDefinition.getById({
-            id: this.row.warehouseId
-          });
-
-          this.areaList = res.reservoirAreaList || [];
+        this.locationList = [];
+        this.tableList = [];
+        if (row.houseList.length != 0) {
+          this.row = row;
+          this.idx = idx;
+          this.visible = true;
+          await this._getWarehouseChildren();
+          if (this.row?.warehouseId) {
+            this.warehouse = this.row.warehouseId;
+            this.formData.warehouse = this.warehouseList.find(
+              (w) => w.id == this.row.warehouseId
+            );
+            const res = await warehouseDefinition.getById({
+              id: this.row.warehouseId
+            });
 
-          this.formData.area = this.areaList.find(
-            (w) => w.id == this.row.areaId
-          ); // this.row.areaId
-          this.area = this.row.areaCode;
+            // this.areaList = res.reservoirAreaList || [];
+            const rep = await warehouseDefinition.getListByWarehouseId(
+              this.row.warehouseId
+            );
+            this.areaList = rep || [];
+            console.log('===', rep);
+            //
 
-          this.areaGoodsshelvesList = res.goodsShelvesList || [];
-          this.shelvesList = this.areaGoodsshelvesList.filter(
-            (i) => i.reservoirAreaCode === this.area
-          );
-          this.formData.shelves = this.areaGoodsshelvesList.find(
-            (w) => w.code == this.row.shelfCode
-          );
-          this.shelves = this.row.shelfCode;
+            this.formData.area = this.areaList.find(
+              (w) => w.id == this.row.houseList[0].areaId
+            ); // this.row.areaId
+            this.area = this.row.houseList[0].areaId;
 
-          this.allocationReqList = res.goodsAllocationList || [];
-          this.locationList = this.allocationReqList.filter(
-            (i) => i.goodsAllocationCode === this.shelves
-          );
-          this.cur = this.allocationReqList.find(
-            (w) => w.code === this.row.cargoSpaceCode
-          );
+            // ===============================
+            const result = await await warehouseDefinition.getListByAreaId(
+              this.row.houseList[0].areaId
+            );
+            this.areaGoodsshelvesList = result || [];
+            this.shelvesList = this.areaGoodsshelvesList.filter(
+              (i) => i.id === this.row.houseList[0].shelfId
+            );
+            this.formData.shelves = this.areaGoodsshelvesList.find(
+              (w) => w.id == this.row.houseList[0].shelfId
+            );
+            this.shelves = this.row.houseList[0].shelfCode;
+            // =========================
+            const loca = await warehouseDefinition.getListByGoodId(
+              this.row.houseList[0].shelfId
+            );
+            this.locationList = loca;
+            const items = loca.filter(
+              (item) => item.id == this.row.houseList[0].cargoSpaceId
+            );
+            this.handlCur(items[0], this.row.houseList[0].num);
+            console.log('items111', items);
+            // this.allocationReqList = res.goodsAllocationList || [];
+            // this.locationList = this.allocationReqList.filter(
+            //   (i) => i.goodsAllocationCode === this.shelves
+            // );
+            // this.cur = this.allocationReqList.find(
+            //   (w) => w.code === this.row.cargoSpaceCode
+            // );
+          }
+        } else {
+          this.row = row;
+          this.idx = idx;
+          this.visible = true;
+          await this._getWarehouseChildren();
+          this.formData = {
+            warehouse: {},
+            area: {},
+            shelves: {}
+          };
+          this.warehouse = '';
+          this.area = '';
+          this.shelves = '';
         }
       },
       async changeWarehouse(val) {

+ 12 - 2
src/views/warehouseManagement/outgoingManagement/add.vue

@@ -628,6 +628,15 @@
             });
           }
         }
+        const uniqueItems = [];
+        const uniqueIds = new Set();
+        row.tableData.forEach((item) => {
+          if (!uniqueIds.has(item.code)) {
+            uniqueIds.add(item.code);
+            uniqueItems.push(item);
+          }
+        });
+        row.tableData = uniqueItems;
         console.log(row);
         this.onSelectTableData(row.tableData, 1);
         this.$forceUpdate();
@@ -837,6 +846,7 @@
                 batchNo: item.batchNo,
                 categoryId: item.id,
                 count: item.outInNum,
+                num: item.outInNum,
                 minPackingCount: item.selfSum,
                 packingCount: item.outInNum,
                 outInDetailRecordAddPOList: item.warehouseLedgerDetails,
@@ -867,8 +877,8 @@
                     name: it.name,
                     pathIds: it.pathIds,
                     unit: it.unit,
-                    packageNo: it.num,
-                    num: it.minPackingCount
+                    packageNo: it.num
+                    // num: it.minPackingCount
                   };
                 });
                 item.outInDetailRecordAddPOList = list;

+ 15 - 7
src/views/warehouseManagement/outgoingManagement/components/detailSelect.vue

@@ -45,8 +45,8 @@
               placeholder=""
               @change="$forceUpdate()"
             >
-              <el-option label="生产日期" :value="1"> </el-option>
-              <el-option label="采购日期" :value="2"> </el-option>
+              <el-option label="生产日期" :value="2"> </el-option>
+              <el-option label="采购日期" :value="1"> </el-option>
             </el-select>
           </el-form-item>
         </el-col>
@@ -132,16 +132,24 @@
         prop="sourceBizNo"
       ></el-table-column>
       <el-table-column label="批次号" prop="batchNum"> </el-table-column>
-      <el-table-column label="生产日期" width="180">
+      <el-table-column
+        label="生产日期"
+        width="180"
+        v-if="formData.dateType == 2"
+      >
         <template slot-scope="{ row }">
-          <span v-if="row.dateType === 2">
+          <span>
             {{ row.produceTime }}
           </span>
         </template>
       </el-table-column>
-      <el-table-column label="采购日期" width="180">
+      <el-table-column
+        label="采购日期"
+        width="180"
+        v-if="formData.dateType == 1"
+      >
         <template slot-scope="{ row }">
-          <span v-if="row.dateType === 1">
+          <span>
             {{ row.procureTime }}
           </span>
         </template>
@@ -279,7 +287,7 @@
         this.infoData = infoData;
         this.tableData = [];
         this.formData = {};
-        this.formData.dateType = 1;
+        this.formData.dateType = 2;
 
         this.memo1 = memo || [];
         this.multipleNum = this.memo.length;

+ 7 - 7
src/views/warehouseManagement/stockLedger/batchDetails.vue

@@ -128,13 +128,13 @@
           this.$refs.baseInfoRef.getDetailInfoAugr(res.category); //基本信息
           this.$refs.warehouseConfigRef.getDetailInfoAugr(res.categoryWms);
         });
-        const rep = await outin.getInventoryDetails({
-          pageNum: 1,
-          size: -1,
-          categoryId: row.id
-        });
-        console.log('===', rep);
-        this.stockList = rep.list;
+        // const rep = await outin.getInventoryDetails({
+        //   pageNum: 1,
+        //   size: 10,
+        //   categoryId: row.id
+        // });
+        // console.log('===', rep);
+        // this.stockList = rep.list;
       },
       handleCellClick(row) {
         this.$refs.batchDetailRef.open(this.activeName, {

+ 1 - 1
src/views/warehouseManagement/stockLedger/components/details/BatchDetail.vue

@@ -221,7 +221,7 @@
           ...item
         }));
 
-        this.total = res.count;
+        // this.total = res.count;
       }
     }
   };

+ 30 - 18
src/views/warehouseManagement/stockLedger/components/details/WarehouseDetail.vue

@@ -61,11 +61,11 @@
       baseParams: {
         type: Object,
         default: () => ({})
-      },
-      stockList: {
-        type: Array,
-        default: () => []
       }
+      // stockList: {
+      //   type: Array,
+      //   default: () => []
+      // }
     },
     data() {
       return {
@@ -78,10 +78,11 @@
         },
         priceList: { yuan: '元', wanyuan: '万元' },
         tableData: [],
-        size: 15,
+        size: 10,
         page: 1,
         total: 0,
-        vuexUser: []
+        vuexUser: [],
+        stockList: []
       };
     },
     computed: {
@@ -104,7 +105,9 @@
         this.page = 1;
         this.getList();
       },
-      handlePageChange() {
+      handlePageChange(v) {
+        this.page = v.current;
+        this.size = v.size;
         this.getList();
       },
       reset() {
@@ -112,19 +115,28 @@
         this.search();
       },
       async getList() {
-        const res = await ouint.getInventoryDetails({
+        const rep = await ouint.getInventoryDetails({
+          pageNum: this.page,
           size: this.size,
-          page: this.page,
-          ...this.searchForm,
-          ...this.baseParams,
-          batchNum: this.baseParams.batchNum || this.searchForm.batchNum
+          categoryId: this.$parent.$route.query.id
         });
-        if (res) {
-          const list = this.$store.state.userPage.userList;
-          this.vuexUser = list;
-          this.tableData = res.list;
-          this.total = res.count;
-        }
+        console.log('===123', rep);
+        this.stockList = rep.list;
+        this.total = rep.count;
+        // this.stockList = rep.list;
+        // const res = await ouint.getInventoryDetails({
+        //   size: this.size,
+        //   page: this.page,
+        //   ...this.searchForm,
+        //   ...this.baseParams,
+        //   batchNum: this.baseParams.batchNum || this.searchForm.batchNum
+        // });
+        // if (res) {
+        //   const list = this.$store.state.userPage.userList;
+        //   this.vuexUser = list;
+        //   this.tableData = res.list;
+        //   this.total = res.count;
+        // }
       }
     }
   };

+ 10 - 9
src/views/warehouseManagement/stockManagement/add.vue

@@ -1108,6 +1108,7 @@
       },
       // 仓库编辑
       handleWareHouse(row, idx) {
+        console.log('row===', row);
         this.$refs.wareHouseDailogRef.open(row, idx);
       },
       // 入库操作
@@ -1478,15 +1479,15 @@
 
             console.log('====>>', obj);
 
-            this.saveLoading = true;
-            try {
-              const res = await outin.save(obj);
-              if (res.code == 0) {
-                this.$message.success('保存成功!');
-              }
-            } catch (error) {}
-            this.saveLoading = false;
-            this.$router.push('/warehouseManagement/stockManagement');
+            // this.saveLoading = true;
+            // try {
+            //   const res = await outin.save(obj);
+            //   if (res.code == 0) {
+            //     this.$message.success('保存成功!');
+            //   }
+            // } catch (error) {}
+            // this.saveLoading = false;
+            // this.$router.push('/warehouseManagement/stockManagement');
           }
         });
       },

+ 3 - 3
vue.config.js

@@ -31,10 +31,10 @@ module.exports = {
     proxy: {
       // 当我们的本地的请求 有/api的时候,就会代理我们的请求地址向另外一个服务器发出请求
       '/api': {
-        // target: 'http://192.168.3.51:18086', // 测试环境
+        // 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.132:18086',
+        target: 'http://192.168.1.114:18086',
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''