فهرست منبع

fix:拆合批-2

mlchen 2 روز پیش
والد
کامیت
ba8771f438

+ 57 - 9
src/views/bpm/handleTask/components/stockBatchChange/detailDialog.vue

@@ -12,6 +12,9 @@
           {{ statusText(formData.verifyStatus) }}
           {{ statusText(formData.verifyStatus) }}
         </el-tag>
         </el-tag>
       </el-descriptions-item>
       </el-descriptions-item>
+      <el-descriptions-item label="当前审批人">
+        {{ formData.currentApproverName || '-' }}
+      </el-descriptions-item>
       <el-descriptions-item label="仓库">
       <el-descriptions-item label="仓库">
         {{ formData.warehouseName || '-' }}
         {{ formData.warehouseName || '-' }}
       </el-descriptions-item>
       </el-descriptions-item>
@@ -36,25 +39,67 @@
       <el-table-column type="index" label="序号" width="55" align="center" />
       <el-table-column type="index" label="序号" width="55" align="center" />
       <el-table-column
       <el-table-column
         prop="systemBatchNo"
         prop="systemBatchNo"
-        label="来源系统批次"
+        label="来源系统批次"
         min-width="145"
         min-width="145"
         show-overflow-tooltip
         show-overflow-tooltip
-      />
+      >
+        <template slot-scope="{ row }">{{ displayValue(row.systemBatchNo) }}</template>
+      </el-table-column>
       <el-table-column
       <el-table-column
         prop="batchNo"
         prop="batchNo"
-        label="业务批次"
+        label="业务批次"
         min-width="120"
         min-width="120"
         show-overflow-tooltip
         show-overflow-tooltip
-      />
+      >
+        <template slot-scope="{ row }">{{ displayValue(row.batchNo) }}</template>
+      </el-table-column>
+      <el-table-column prop="warehouseName" label="仓库名称" min-width="120" show-overflow-tooltip>
+        <template slot-scope="{ row }">{{ displayValue(row.warehouseName || formData.warehouseName) }}</template>
+      </el-table-column>
+      <el-table-column prop="categoryCode" label="物品编码" min-width="120" show-overflow-tooltip>
+        <template slot-scope="{ row }">{{ displayValue(row.categoryCode) }}</template>
+      </el-table-column>
+      <el-table-column prop="categoryName" label="物品名称" min-width="120" show-overflow-tooltip>
+        <template slot-scope="{ row }">{{ displayValue(row.categoryName) }}</template>
+      </el-table-column>
+      <el-table-column prop="specification" label="规格" min-width="100" show-overflow-tooltip>
+        <template slot-scope="{ row }">{{ displayValue(row.specification) }}</template>
+      </el-table-column>
+      <el-table-column prop="categoryModel" label="型号" min-width="100" show-overflow-tooltip>
+        <template slot-scope="{ row }">{{ displayValue(row.categoryModel) }}</template>
+      </el-table-column>
+      <el-table-column prop="brandNum" label="牌号" min-width="100" show-overflow-tooltip>
+        <template slot-scope="{ row }">{{ displayValue(row.brandNum) }}</template>
+      </el-table-column>
+      <el-table-column prop="colorKey" label="颜色" min-width="100" show-overflow-tooltip>
+        <template slot-scope="{ row }">{{ displayValue(row.colorKey) }}</template>
+      </el-table-column>
+      <el-table-column prop="unitPrice" label="单价" min-width="100">
+        <template slot-scope="{ row }">{{ displayValue(row.unitPrice) }}</template>
+      </el-table-column>
+      <el-table-column prop="supplierName" label="供应商名称" min-width="130" show-overflow-tooltip>
+        <template slot-scope="{ row }">{{ displayValue(row.supplierName) }}</template>
+      </el-table-column>
+      <el-table-column prop="supplierCode" label="供应商代号" min-width="120" show-overflow-tooltip>
+        <template slot-scope="{ row }">{{ displayValue(row.supplierCode) }}</template>
+      </el-table-column>
       <el-table-column label="目标批次" min-width="145" show-overflow-tooltip>
       <el-table-column label="目标批次" min-width="145" show-overflow-tooltip>
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
-          {{ row.targetSystemBatchNo || targetText(row) }}
+          {{ displayValue(row.targetSystemBatchNo || targetText(row)) }}
         </template>
         </template>
       </el-table-column>
       </el-table-column>
-      <el-table-column prop="measureQuantity" label="计量数量" width="105" />
-      <el-table-column prop="packageQuantity" label="包装数量" width="105" />
-      <el-table-column prop="weight" label="重量" width="95" />
-      <el-table-column prop="lockQuantity" label="锁库数量" width="105" />
+      <el-table-column prop="measureQuantity" label="计量数量" width="105">
+        <template slot-scope="{ row }">{{ displayValue(row.measureQuantity) }}</template>
+      </el-table-column>
+      <el-table-column prop="packageQuantity" label="包装数量" width="105">
+        <template slot-scope="{ row }">{{ displayValue(row.packageQuantity) }}</template>
+      </el-table-column>
+      <el-table-column prop="weight" label="重量" width="95">
+        <template slot-scope="{ row }">{{ displayValue(row.weight) }}</template>
+      </el-table-column>
+      <el-table-column prop="lockQuantity" label="锁库数量" width="105">
+        <template slot-scope="{ row }">{{ displayValue(row.lockQuantity) }}</template>
+      </el-table-column>
       <el-table-column label="整包装分配" min-width="150" show-overflow-tooltip>
       <el-table-column label="整包装分配" min-width="150" show-overflow-tooltip>
         <template slot-scope="{ row }">
         <template slot-scope="{ row }">
           {{ formatPackingIds(row.packingStockIds) }}
           {{ formatPackingIds(row.packingStockIds) }}
@@ -127,6 +172,9 @@
           ? `目标 ${row.targetDetailId}(审批通过后生成)`
           ? `目标 ${row.targetDetailId}(审批通过后生成)`
           : '审批通过后生成';
           : '审批通过后生成';
       },
       },
+      displayValue(value) {
+        return value == null || value === '' ? '-' : value;
+      },
       formatPackingIds(value) {
       formatPackingIds(value) {
         const ids = this.parseArray(value);
         const ids = this.parseArray(value);
         return ids.length ? ids.join('、') : '-';
         return ids.length ? ids.join('、') : '-';

+ 9 - 7
src/views/bpm/handleTask/components/stockBatchChange/submit.vue

@@ -87,14 +87,16 @@
         const API = status ? approveTaskWithVariables : rejectTask;
         const API = status ? approveTaskWithVariables : rejectTask;
         this.loading = true;
         this.loading = true;
         try {
         try {
-          const res = await API({
+          const payload = {
             id: this.taskId,
             id: this.taskId,
-            reason: this.form.reason,
-            variables: {
-              pass: !!status
-            }
-          });
-          if (res.data.code != '-1') {
+            reason: this.form.reason
+          };
+          if (status) {
+            payload.variables = { pass: true };
+          }
+          const res = await API(payload);
+          // 仅接口明确返回成功码时关闭处理弹窗并刷新待办。
+          if (res && res.data && (res.data.code === 0 || res.data.code === '0')) {
             this.$emit('handleAudit', {
             this.$emit('handleAudit', {
               status,
               status,
               title: status === 0 ? '驳回' : ''
               title: status === 0 ? '驳回' : ''

+ 30 - 5
src/views/bpm/handleTask/index.vue

@@ -438,6 +438,32 @@
       });
       });
     },
     },
     methods: {
     methods: {
+      isStockBatchChange() {
+        return (
+          String(this.listData.businessCode || '').startsWith('PCBG') ||
+          String(this.listData.pcViewRouter || '').includes('stockBatchChange') ||
+          String(this.listData.pcViewRouter || '').includes(
+            'warehouseManagement/stockLedger'
+          )
+        );
+      },
+      getBusinessComponentRouter(type) {
+        const router =
+          type === 'view'
+            ? this.listData.pcViewRouter
+            : this.listData.pcHandleRouter;
+        if (this.isStockBatchChange()) {
+          const invalidViewRouter =
+            type === 'view' &&
+            String(router || '').includes('warehouseManagement/stockLedger');
+          if (!router || invalidViewRouter) {
+            return `/bpm/handleTask/components/stockBatchChange/${
+              type === 'view' ? 'detailDialog' : 'submit'
+            }.vue`;
+          }
+        }
+        return router;
+      },
       submit(data) {
       submit(data) {
         this.$refs.bziRef.save(data);
         this.$refs.bziRef.save(data);
       },
       },
@@ -472,13 +498,12 @@
           // const subpath = formCustomCreatePath.pcHandle;
           // const subpath = formCustomCreatePath.pcHandle;
 
 
           Vue.component('async-biz-form-component', (resolve) => {
           Vue.component('async-biz-form-component', (resolve) => {
-            console.log(this.listData.pcViewRouter, '111111');
-            require([`@/views${this.listData.pcViewRouter}`], resolve);
+            const router = this.getBusinessComponentRouter('view');
+            require([`@/views${router}`], resolve);
           });
           });
           Vue.component('async-sub-form-component', (resolve) => {
           Vue.component('async-sub-form-component', (resolve) => {
-            console.log(this.listData.pcHandleRouter, '22222');
-
-            require([`@/views${this.listData.pcHandleRouter}`], resolve);
+            const router = this.getBusinessComponentRouter('handle');
+            require([`@/views${router}`], resolve);
           });
           });
           //   // 设置表单信息
           //   // 设置表单信息
           //   if (this.processInstance.processDefinition.formType === 10) {
           //   if (this.processInstance.processDefinition.formType === 10) {