Răsfoiți Sursa

feat: 采购入库审批查产品修改

liujt 1 lună în urmă
părinte
comite
ab5ca67345

+ 21 - 0
src/api/warehouseManagement/index.js

@@ -302,5 +302,26 @@ export default {
       return res.data.data;
       return res.data.data;
     }
     }
     return Promise.reject(new Error(res.data.message));
     return Promise.reject(new Error(res.data.message));
+  },
+
+  //释放锁库数量
+  lockOrderRelease: async (orderNo) => {
+    const res = await request.get(
+      `/wms/lockOrder/v1/release/${orderNo}`,
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  //释放锁库数量
+  isLocked: async (orderNo) => {
+    const res = await request.get(
+      `/wms/lockOrder/v1/isLocked/${orderNo}`,
+    );
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
   }
   }
 };
 };

+ 2 - 2
src/views/bpm/handleTask/components/productionWarehousing/storage.vue

@@ -1585,7 +1585,7 @@
           let codeList = this.saleProductList.map((item) => {
           let codeList = this.saleProductList.map((item) => {
             return item.productCode || item.categoryCode;
             return item.productCode || item.categoryCode;
           });
           });
-          storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
+          storageApi.getListByNameOrModeType({ codeList, queryConditions: this.queryConditions }).then(async (res) => {
             if (res.length <= 0) {
             if (res.length <= 0) {
               this.$message.warning('未获取到物品信息!');
               this.$message.warning('未获取到物品信息!');
               return;
               return;
@@ -1809,7 +1809,7 @@
           let codeList = this.detailList.map((item) => {
           let codeList = this.detailList.map((item) => {
             return item.productCode || item.categoryCode;
             return item.productCode || item.categoryCode;
           });
           });
-          storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
+          storageApi.getListByNameOrModeType({ codeList, queryConditions: this.queryConditions }).then(async (res) => {
             console.log(res, 'detailList-res');
             console.log(res, 'detailList-res');
             console.log(this.form, 'this.form.warehouseId');
             console.log(this.form, 'this.form.warehouseId');
             console.log(this.bizType, 'this.bizType~~~');
             console.log(this.bizType, 'this.bizType~~~');

+ 32 - 1
src/views/bpm/outgoingManagement/outbound.vue

@@ -170,6 +170,18 @@
           v-if="isEdit"
           v-if="isEdit"
           >添加</el-button
           >添加</el-button
         >
         >
+
+        <el-popconfirm
+          v-if="showLocked"
+          style="margin-bottom: 20px; float: right; margin-right: 20px"
+          class="ele-action"
+          title="该单已锁库存,释放后无法还原?"
+          @confirm="lockRelease"
+        >
+          <template v-slot:reference>
+            <el-button type="primary" plain>释放锁库</el-button>
+          </template>
+        </el-popconfirm>
       </div>
       </div>
       <div class="material">
       <div class="material">
         <div>
         <div>
@@ -484,7 +496,8 @@
           }
           }
         },
         },
         llrLsit: [],
         llrLsit: [],
-        isPrice: 1
+        isPrice: 1,
+        showLocked: false
       };
       };
     },
     },
     computed: {
     computed: {
@@ -719,6 +732,23 @@
       });
       });
     },
     },
     methods: {
     methods: {
+      checkLock() {
+        storageApi.isLocked(this.formData.sourceBizNo).then((res) => {
+          console.log(res, 'isLocked-res');
+          this.showLocked = res;
+        });
+      },  
+      lockRelease() {
+        storageApi.lockOrderRelease(this.formData.sourceBizNo).then((res) => {
+          console.log(res, 'lockOrderRelease-res');
+            this.$message({
+              message: '释放成功',
+              type: 'success'
+            });
+        }).catch(() => {
+
+        });
+      },
       // 获取当前时间函数
       // 获取当前时间函数
       getNowDate() {
       getNowDate() {
         let date = new Date(),
         let date = new Date(),
@@ -1092,6 +1122,7 @@
         this.formData.bizType = this.bizType;
         this.formData.bizType = this.bizType;
         // 添加单据来源
         // 添加单据来源
         this.formData.sourceBizNo = this.sourceBizNo || this.form?.code;
         this.formData.sourceBizNo = this.sourceBizNo || this.form?.code;
+        this.checkLock();
         // 将出库状态改成出库状态 2出库 1入库
         // 将出库状态改成出库状态 2出库 1入库
         this.formData.type = 2;
         this.formData.type = 2;
         // 入库登记人
         // 入库登记人

+ 4 - 4
src/views/bpm/stockManagement/storage.vue

@@ -1464,7 +1464,7 @@
           let codeList = this.saleProductList.map((item) => {
           let codeList = this.saleProductList.map((item) => {
             return item.productCode || item.categoryCode;
             return item.productCode || item.categoryCode;
           });
           });
-          storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
+          storageApi.getListByNameOrModeType({ codeList, queryConditions: this.saleProductList }).then(async (res) => {
             if (res.length <= 0) {
             if (res.length <= 0) {
               this.$message.warning('未获取到物品信息!');
               this.$message.warning('未获取到物品信息!');
               return;
               return;
@@ -1497,8 +1497,8 @@
             this.productList = res.map((item, index) => {
             this.productList = res.map((item, index) => {
               let filtersItem = this.saleProductList.find(
               let filtersItem = this.saleProductList.find(
                 (detailItem) =>
                 (detailItem) =>
-                  item.code == detailItem.productCode ||
-                  item.code == detailItem.categoryCode
+                  (item.code == detailItem.productCode ||
+                  item.code == detailItem.categoryCode) && item.colorKey == detailItem.colorKey && item.modelType == detailItem.modelType && item.batchNo == detailItem.batchNo
               );
               );
               // let filtersItem = this.saleProductList.filter(
               // let filtersItem = this.saleProductList.filter(
               //   (detailItem) =>
               //   (detailItem) =>
@@ -1688,7 +1688,7 @@
           let codeList = this.detailList.map((item) => {
           let codeList = this.detailList.map((item) => {
             return item.productCode || item.categoryCode;
             return item.productCode || item.categoryCode;
           });
           });
-          storageApi.getListByNameOrModeType({ codeList }).then(async (res) => {
+          storageApi.getListByNameOrModeType({ codeList, queryConditions: this.detailList }).then(async (res) => {
             console.log(res, 'detailList-res');
             console.log(res, 'detailList-res');
             console.log(this.form, 'this.form.warehouseId');
             console.log(this.form, 'this.form.warehouseId');
             console.log(this.bizType, 'this.bizType~~~');
             console.log(this.bizType, 'this.bizType~~~');