瀏覽代碼

fix:5152【流程列表】我流程(彩页申领单)配置的规则是多级审批,指定的是直接部门负责人审批;罗黄发起应该黄佳靖审批,但是现在变成自己审批了

mlchen 6 天之前
父節點
當前提交
3245f115e4

+ 1 - 0
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/detailDialog.vue

@@ -171,6 +171,7 @@
     <detailDialog
       type="sourceBizNo"
       :businessId="form.returnNo"
+      :purchaseReturn="true"
       ref="outgoingDetai"
       v-if="taskDefinitionKey == 'purchaserUploadReceipt' || !taskDefinitionKey"
     ></detailDialog>

+ 13 - 3
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/submit.vue

@@ -9,6 +9,7 @@
         />
       </el-form-item>
     </el-form>
+    <el-alert v-if="outInQueryError" :title="outInQueryError" type="error" :closable="false" />
     <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
       <el-button
         icon="el-icon-edit-outline"
@@ -18,6 +19,7 @@
         v-if="
           taskDefinitionKey != 'storemanApprove' ||
           (taskDefinitionKey == 'storemanApprove' &&
+            !outInQueryLoading && !outInQueryError &&
             outInData.verifyStatus == 2)
         "
         @click="handleAudit(1)"
@@ -32,6 +34,7 @@
         @click="storemanApprove"
         v-if="
           ['storemanApprove'].includes(taskDefinitionKey) &&
+          !outInQueryLoading && !outInQueryError &&
           ([0, 3].includes(outInData.verifyStatus) || !outInData.verifyStatus)
         "
         >申请出库
@@ -129,6 +132,8 @@
         outInData: {
           verifyStatus: ''
         },
+        outInQueryError: '',
+        outInQueryLoading: true,
         rules: {
           reason: [
             { required: true, message: '请输入审批建议', trigger: 'blur' }
@@ -138,16 +143,21 @@
     },
     async created() {
       if (this.taskDefinitionKey == 'storemanApprove') {
-        let data = await getReturnSaleOrderrecordDetail(this.businessId);
         try {
-          this.outInData = await getOutInBySourceBizNo(data.returnNo);
+          let data = await getReturnSaleOrderrecordDetail(this.businessId);
+          this.outInData = (await getOutInBySourceBizNo(data.returnNo)) || { verifyStatus: 0 };
         } catch (error) {
-          this.outInData.verifyStatus = 0;
+          this.outInQueryError = '退货出库单查询失败,请核对单据后重试';
+        } finally {
+          this.outInQueryLoading = false;
         }
       }
     },
     methods: {
       async storemanApprove() {
+        if (this.outInQueryLoading || this.outInQueryError) {
+          return this.$message.error(this.outInQueryError || '退货出库单查询中,请稍后重试');
+        }
         this.$refs.formRef.validate(async (valid) => {
           if (valid) {
             let res = await this.getTableValue();

+ 17 - 5
src/views/bpm/outgoingManagement/components/AssetsDialog.vue

@@ -654,19 +654,31 @@
         } else {
           // 包装维度
           const packageSources = this.returnPackages();
+          const receiveProductIds = this.returnProductList.map((product) => product.receiveProductId).filter(Boolean);
+          if (this.bizType === 10 && receiveProductIds.length !== this.returnProductList.length) {
+            this.tableData = [];
+            this.total = 0;
+            this.$message.error('退货产品缺少采购收货明细,无法查询不良包装');
+            return;
+          }
           const params = this.bizType === 10
             ? { ...this.searchForm,
+                sourceReceiveProductIds: [...new Set(receiveProductIds)].join(','),
                 ...(packageSources.length ? {
-                  packageNos: [...new Set(packageSources.map((source) => source.packageNo))].join(','),
-                  sourceReceiveProductIds: [...new Set(packageSources.map((source) => source.product.receiveProductId))].join(',')
+                  packageNos: [...new Set(packageSources.map((source) => source.packageNo))].join(',')
                 } : {}),
                 result: 2 }
             : this.searchForm;
           const data = await storageApi.getPackingList(params);
-          for (let i = 0; i < data.list.length; i++) {
-            data.list[i].outboundNum = data.list[i].measureQuantity;
+          const rows = this.bizType === 10
+            ? data.list.filter((row) => packageSources.length
+              ? packageSources.some((source) => this.matchesReturnPackage(source, row))
+              : this.returnProductList.some((product) => this.matchesReturnProduct(product, row)))
+            : data.list;
+          for (let i = 0; i < rows.length; i++) {
+            rows[i].outboundNum = rows[i].measureQuantity;
           }
-          this.tableData = data.list;
+          this.tableData = rows;
           this.total = data.count;
         }
         this.updateProductOutboundNums(this.tableData);

+ 20 - 3
src/views/bpm/outgoingManagement/details.vue

@@ -374,6 +374,11 @@
         type: Boolean,
         default: false
       },
+      /** 采购退货详情按来源单号汇总全部有效出库单。 */
+      purchaseReturn: {
+        type: Boolean,
+        default: false
+      },
       XTBG: {
         //协同办公进来的
         type: Boolean,
@@ -783,14 +788,26 @@
         } else if (this.isIds) {
           resAll = await storageApi.getInboundDetailsByIds(id);
         } else {
-          res = await storageApi.getInfoBySourceBizNoAll(id);
-          res = res[0] || {};
+          const sourceOrders = await storageApi.getInfoBySourceBizNoAll(id) || [];
+          if (this.purchaseReturn) {
+            resAll = sourceOrders.filter((item) =>
+              Number(item.type) === 2 &&
+              Number(item.bizType) === 10 &&
+              Number(item.verifyStatus) !== 3
+            );
+          } else {
+            res = sourceOrders[0] || {};
+          }
+        }
+        if (this.purchaseReturn && !resAll.length) {
+          this.$message.error('未找到采购退货出库单');
+          return;
         }
         console.log(
           '===============================================================',
           res
         );
-        if (this.isIds) {
+        if (this.isIds || this.purchaseReturn) {
           res = JSON.parse(JSON.stringify(resAll[0]));
           this.extInfo = resAll[0].extInfo;
           res['outInDetailList'] = [];