Переглянути джерело

同一个收货单,不同物品清单,选择不同的仓库,提交以后应该对不同仓库生成不同的待办

mlchen 2 днів тому
батько
коміт
38fd59390b

+ 13 - 0
src/api/bpm/components/purchasingManage/purchaseorderreceive.js

@@ -22,6 +22,19 @@ export async function getReceiveSaleOrderrecordDetail(id) {
   return Promise.reject(new Error(res.data.message));
 }
 
+/**
+ * 获取当前仓管审批任务可访问的收货明细
+ */
+export async function getReceiveTaskDetail(id, taskId) {
+  const res = await request.get(`/eom/purchaseorderreceive/task-detail/${id}`, {
+    params: { taskId }
+  });
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}
+
 /**
  * 更新信息
  */

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

@@ -138,6 +138,23 @@ export default {
     }
     return Promise.reject(new Error(res.data.message));
   },
+  // 获取同一来源单下指定仓库的入库单
+  getInfoBySourceBizNoAndWarehouse: async (id, warehouseId) => {
+    const res = await request.get(
+      `/wms/outintwo/getInfoBySourceBizNoAll/${id}`
+    );
+    if (res.data.code == 0) {
+      const list = Array.isArray(res.data.data) ? res.data.data : [];
+      return (
+        list.find((item) =>
+          (item.outInDetailList || []).some(
+            (detail) => `${detail.warehouseId}` === `${warehouseId}`
+          )
+        ) || {}
+      );
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
   // 质检保存
   qualityInspection: async (data) => {
     const res = await request.post(`/wms/outintwo/qualityInspection`, data);

+ 7 - 0
src/views/bpm/done/index.vue

@@ -184,6 +184,13 @@
             showOverflowTooltip: true,
             minWidth: 120
           },
+          {
+            prop: 'businessScope.warehouseName',
+            label: '审批仓库',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
           {
             prop: 'businessType',
             label: '单据类型',

+ 12 - 3
src/views/bpm/handleTask/components/purchaseOrder/invoice/detailDialog.vue

@@ -61,7 +61,10 @@
 <script>
   import dictMixins from '@/mixins/dictMixins';
 
-  import { getReceiveSaleOrderrecordDetail } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
+  import {
+    getReceiveSaleOrderrecordDetail,
+    getReceiveTaskDetail
+  } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
 
   import detailDialog from '@/views/bpm/stockManagement/details.vue';
 
@@ -122,7 +125,10 @@
       await this.getDetailData(this.businessId);
       // getOutInBySourceBizNoOrError(this.form.receiveNo)
       await storageApi
-        .getInfoBySourceBizNo(this.form.receiveNo)
+        .getInfoBySourceBizNoAndWarehouse(
+          this.form.receiveNo,
+          this.form.productList[0]?.warehouseId
+        )
         .then((res) => {
           if (JSON.stringify(res) == '{}') {
             // 未查询到相关信息(未入库)
@@ -237,7 +243,10 @@
       },
       async getDetailData(id) {
         this.loading = true;
-        const data = await getReceiveSaleOrderrecordDetail(id);
+        const data =
+          this.taskDefinitionKey == 'storeManagerApprove'
+            ? await getReceiveTaskDetail(id, this.taskId)
+            : await getReceiveSaleOrderrecordDetail(id);
         this.loading = false;
         if (data) {
           console.log(data, '1111111111111111111111');

+ 5 - 3
src/views/bpm/handleTask/components/purchaseOrder/invoice/submit.vue

@@ -131,6 +131,7 @@
   import {
     UpdateReceiveInformation,
     getReceiveSaleOrderrecordDetail,
+    getReceiveTaskDetail,
     cancel
   } from '@/api/bpm/components/purchasingManage/purchaseorderreceive';
   import { approveTaskWithVariables, rejectTask,cancelTask } from '@/api/bpm/task';
@@ -187,10 +188,11 @@
         this.userOptions.push(...data);
       });
       if (this.taskDefinitionKey == 'storeManagerApprove') {
-        let data = await getReceiveSaleOrderrecordDetail(this.businessId);
+        let data = await getReceiveTaskDetail(this.businessId, this.taskId);
         try {
-          this.outInData = await storageApi.getInfoBySourceBizNo(
-            data.receiveNo
+          this.outInData = await storageApi.getInfoBySourceBizNoAndWarehouse(
+            data.receiveNo,
+            data.productList[0]?.warehouseId
           );
           console.log('outInData----------', this.outInData);
         } catch (error) {}

+ 7 - 0
src/views/bpm/todo/index.vue

@@ -224,6 +224,13 @@
             showOverflowTooltip: true,
             minWidth: 120
           },
+          {
+            prop: 'businessScope.warehouseName',
+            label: '审批仓库',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120
+          },
           {
             prop: 'businessType',
             label: '单据类型',

+ 2 - 2
vue.config.js

@@ -38,11 +38,11 @@ module.exports = {
         // target: 'http://124.71.68.31:50001', // 测试环境
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.105:18086',
-        // target: 'http://localhost:18086',
+        target: 'http://localhost:18086',
         // target: 'http://192.168.1.116:18086',
         // target: 'http://192.168.1.3:18086',
         // target: 'http://192.168.1.251:18186',
-        target: 'http://192.168.1.251:18086',
+        // target: 'http://192.168.1.251:18086',
         // target: 'http://192.168.1.3:18086',
         // target: 'http://aiot.zoomwin.com.cn:51001/api',
         // target: 'http://192.168.1.3:18086',