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

+ 6 - 5
src/views/warehouseManagement/warehouseDefinition/add.vue

@@ -976,9 +976,9 @@
         let hwArr = [];
         let hwArr = [];
         for (const key in allocationReqList) {
         for (const key in allocationReqList) {
           hwArr.push({
           hwArr.push({
-            goodsShelvesCode: allocationReqList[key].goodsAllocationCode,
             reservoirAreaCode: allocationReqList[key].warehouseAreaCode,
             reservoirAreaCode: allocationReqList[key].warehouseAreaCode,
-            code: allocationReqList[key].goodsAllocationCode,
+            goodsShelvesCode: allocationReqList[key].goodsAllocationCode,
+            code: allocationReqList[key].warehouseAreaCode,
             extInfo: [
             extInfo: [
               {
               {
                 goodsAllocationLength:
                 goodsAllocationLength:
@@ -998,7 +998,7 @@
         const res = await warehouseDefinition.warehouseDetail(id);
         const res = await warehouseDefinition.warehouseDetail(id);
         this.warehouseVO = res.warehouseVO; //仓库基本信息
         this.warehouseVO = res.warehouseVO; //仓库基本信息
         const { kq, hj, hw } = this.handleHouse(res);
         const { kq, hj, hw } = this.handleHouse(res);
-        console.log(this.handleHouse(res));
+        // console.log(this.handleHouse(res));
         this.areaForm = {
         this.areaForm = {
           warehouseAreasSaveList: kq || [], //库区
           warehouseAreasSaveList: kq || [], //库区
           areaGoodsshelvesList: hj || [], //货架
           areaGoodsshelvesList: hj || [], //货架
@@ -1454,7 +1454,6 @@
           this.areaForm.areaGoodsshelvesList.filter(
           this.areaForm.areaGoodsshelvesList.filter(
             (item) => item.reservoirAreaCode !== code
             (item) => item.reservoirAreaCode !== code
           );
           );
-
         this.areaForm.allocationReqList =
         this.areaForm.allocationReqList =
           this.areaForm.allocationReqList.filter(
           this.areaForm.allocationReqList.filter(
             (item) =>
             (item) =>
@@ -1615,6 +1614,8 @@
         const obj = this.areaForm.areaGoodsshelvesList.find((item) => {
         const obj = this.areaForm.areaGoodsshelvesList.find((item) => {
           item.id === pid;
           item.id === pid;
         });
         });
+        console.log('1', obj && obj.reservoirAreaCode + '-' + goodsShelvesCode);
+        console.log('2', this.areaForm.areaGoodsshelvesList);
         return obj && obj.reservoirAreaCode + '-' + goodsShelvesCode;
         return obj && obj.reservoirAreaCode + '-' + goodsShelvesCode;
       },
       },
       //重新处理数据,之前代码不敢动
       //重新处理数据,之前代码不敢动
@@ -1655,7 +1656,7 @@
         );
         );
         let allocationListArr = this.objExit(allocationList).map((item) => {
         let allocationListArr = this.objExit(allocationList).map((item) => {
           return {
           return {
-            warehouseAreaGoodsCode: item.code,
+            warehouseAreaCode: item.reservoirAreaCode,
             goodsAllocationCode: item.goodsShelvesCode,
             goodsAllocationCode: item.goodsShelvesCode,
             goodsAllocationLength: item.goodsAllocationLength,
             goodsAllocationLength: item.goodsAllocationLength,
             goodsAllocationWide: item.goodsAllocationWide,
             goodsAllocationWide: item.goodsAllocationWide,

+ 81 - 10
src/views/warehouseManagement/warehouseDefinition/details.vue

@@ -176,13 +176,19 @@
                           :key="p.id"
                           :key="p.id"
                           class="box"
                           class="box"
                           :style="{
                           :style="{
+                            'background-color': getStatus(p.allocationStatus)
+                              .color,
+                            color: p.allocationStatus === 3 ? '#fff' : '#000'
+                          }"
+                        >
+                          {{ '货位' + p.code }}
+                          <!-- :style="{
                             'background-color': getStatus(
                             'background-color': getStatus(
-                              p.warehouseStatVO.type
+                              p.allocationStatus
                             ).color,
                             ).color,
                             color:
                             color:
-                              p.warehouseStatVO.type === 3 ? '#fff' : '#000'
-                          }"
-                          >{{ '货位' + p.code }}
+                              p.allocationStatus === 3 ? '#fff' : '#000'
+                          }" -->
                           <div class="mask">
                           <div class="mask">
                             {{ p.code }}
                             {{ p.code }}
                             <div>
                             <div>
@@ -378,6 +384,70 @@
           return '';
           return '';
         }
         }
       },
       },
+      handleHouse(obj) {
+        const {
+          warehouseAreasSaveList,
+          areaGoodsshelvesList,
+          allocationReqList
+        } = obj;
+        let kqArr = [];
+        for (const key in warehouseAreasSaveList) {
+          kqArr.push({
+            name: warehouseAreasSaveList[key].name,
+            code: warehouseAreasSaveList[key].code,
+            extInfo: [
+              {
+                areaType: warehouseAreasSaveList[key].type,
+                attribute: warehouseAreasSaveList[key].attribute,
+                address: warehouseAreasSaveList[key].address,
+                areaLength: warehouseAreasSaveList[key].areaLength,
+                areaWidth: warehouseAreasSaveList[key].areaWide,
+                areaHigh: warehouseAreasSaveList[key].areaHigh
+              }
+            ],
+            subCount: warehouseAreasSaveList[key].num,
+            remark: warehouseAreasSaveList[key].areaRemark
+          });
+        }
+        let hjArr = [];
+        for (const key in areaGoodsshelvesList) {
+          hjArr.push({
+            reservoirAreaCode: areaGoodsshelvesList[key].warehouseAreaCode,
+            code: areaGoodsshelvesList[key].goodsshelvesCode,
+            extInfo: [
+              {
+                line: areaGoodsshelvesList[key].goodsshelvesLine,
+                column: areaGoodsshelvesList[key].goodsshelvesColumn,
+                areaLength: areaGoodsshelvesList[key].goodsshelvesLength,
+                areaWidth: areaGoodsshelvesList[key].goodsshelvesWide,
+                areaHigh: areaGoodsshelvesList[key].goodsshelvesHigh,
+                isRegular: areaGoodsshelvesList[key].isRegular
+              }
+            ],
+            remark: areaGoodsshelvesList[key].goodsshelvesRemark
+          });
+        }
+        let hwArr = [];
+        for (const key in allocationReqList) {
+          hwArr.push({
+            reservoirAreaCode: allocationReqList[key].warehouseAreaCode,
+            goodsShelvesCode: allocationReqList[key].goodsAllocationCode,
+            code: allocationReqList[key].warehouseAreaCode,
+            allocationStatus: allocationReqList[key].allocationStatus,
+            extInfo: [
+              {
+                goodsAllocationLength:
+                  allocationReqList[key].goodsAllocationLength,
+                goodsAllocationWide: allocationReqList[key].goodsAllocationWide,
+                goodsAllocationHigh: allocationReqList[key].goodsAllocationHigh,
+                weightLimit: allocationReqList[key].weightLimit,
+                volumeUnit: allocationReqList[key].volumeUnit
+              }
+            ]
+          });
+        }
+        return { kq: kqArr, hj: hjArr, hw: hwArr };
+      },
       async getInfo() {
       async getInfo() {
         // 获取工厂车间列表
         // 获取工厂车间列表
         const res1 = await warehouseDefinition.getFactoryarea({
         const res1 = await warehouseDefinition.getFactoryarea({
@@ -387,11 +457,12 @@
         });
         });
         this.factoryList = res1.list;
         this.factoryList = res1.list;
 
 
-        const { warehouseVO } = await warehouseDefinition.warehouseDetail(
+        const res = await warehouseDefinition.warehouseDetail(
           this.$route.query.id
           this.$route.query.id
         );
         );
-        console.log(warehouseVO);
-        this.warehouseInfo = warehouseVO || {};
+        const { kq, hj, hw } = this.handleHouse(res);
+        console.log('=++', kq);
+        this.warehouseInfo = res.warehouseVO || {};
         //  warehouseAreasSaveList: res.reservoirAreaList || [], //库区
         //  warehouseAreasSaveList: res.reservoirAreaList || [], //库区
         // areaGoodsshelvesList: res.goodsShelvesList || [], //货架
         // areaGoodsshelvesList: res.goodsShelvesList || [], //货架
         // allocationReqList: res.goodsAllocationList || [] //货位
         // allocationReqList: res.goodsAllocationList || [] //货位
@@ -400,9 +471,9 @@
         //   areaGoodsshelvesList = [],
         //   areaGoodsshelvesList = [],
         //   allocationReqList = []
         //   allocationReqList = []
         // } = res;
         // } = res;
-        const warehouseAreasSaveList = res.reservoirAreaList || [];
-        const areaGoodsshelvesList = res.goodsShelvesList || [];
-        const allocationReqList = res.goodsAllocationList || [];
+        const warehouseAreasSaveList = kq || [];
+        const areaGoodsshelvesList = hj || [];
+        const allocationReqList = hw || [];
 
 
         warehouseAreasSaveList.forEach((item) => {
         warehouseAreasSaveList.forEach((item) => {
           item.children = areaGoodsshelvesList
           item.children = areaGoodsshelvesList