Răsfoiți Sursa

新增销售受托入库

huang_an 2 ani în urmă
părinte
comite
929f874ad1

+ 2 - 1
src/utils/dict/warehouse.js

@@ -37,7 +37,8 @@ export const sceneState = [
   { code: 3, label: '归还入库', documentsName: '出库单' },
   { code: 4, label: '领料退货入库' },
   { code: 5, label: '其他入库' },
-  { code: 6, label: '销售退货入库', documentsName: '销售订单' }
+  { code: 6, label: '销售退货入库', documentsName: '销售订单' },
+  { code: 7, label: '销售受托入库', documentsName: '受托收货单' }
 ];
 export const outputSceneState = [
   { code: 1, label: '退供出库' },

+ 2 - 0
src/views/bpm/handleTask/components/inoutBound/detailDialog.vue

@@ -409,6 +409,7 @@
             tooltip-effect="dark"
             :header-cell-style="rowClass"
             style="width: 100%"
+            height="300px"
             stripe
           >
             <el-table-column label="序号" type="index" width="50">
@@ -532,6 +533,7 @@
             tooltip-effect="dark"
             :header-cell-style="rowClass"
             style="width: 100%"
+            height="300px"
             stripe
           >
             <el-table-column label="序号" type="index" width="50">

+ 2 - 0
src/views/bpm/handleTask/components/outBound/detailDialog.vue

@@ -199,6 +199,7 @@
             :data="materialCodeReqList"
             tooltip-effect="dark"
             style="width: 100%"
+            height="300px"
             stripe
             :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
           >
@@ -309,6 +310,7 @@
             :data="metaList"
             tooltip-effect="dark"
             style="width: 100%"
+            height="300px"
             stripe
             :header-cell-style="{ background: '#EEEEEE', border: 'none' }"
           >

+ 24 - 16
src/views/bpm/handleTask/components/purchaseOrder/invoice/submit.vue

@@ -82,8 +82,13 @@
         >驳回
       </el-button>
 
-      <el-dropdown @command="(command) => handleCommand(command)" style="margin-left: 30px;">
-        <span class="el-dropdown-link">更多<i class="el-icon-arrow-down el-icon--right"></i></span>
+      <el-dropdown
+        @command="(command) => handleCommand(command)"
+        style="margin-left: 30px"
+      >
+        <span class="el-dropdown-link"
+          >更多<i class="el-icon-arrow-down el-icon--right"></i
+        ></span>
         <el-dropdown-menu slot="dropdown">
           <el-dropdown-item command="cancel">作废</el-dropdown-item>
         </el-dropdown-menu>
@@ -321,24 +326,27 @@
       //更多
       handleCommand(command) {
         if (command === 'cancel') {
-          this.$confirm("是否确认作废?", {
+          this.$confirm('是否确认作废?', {
             type: 'warning',
             cancelButtonText: '取消',
             confirmButtonText: '确定'
-          }).then(() => {
-            cancel({
-              id: this.taskId,
-              reason: this.form.reason,
-              businessId: this.businessId,
-            }).then(() => {
-              this.$emit('handleClose');
-            }).catch(() => {
-              this.$message.error("流程作废失败");
-            });
-          }).catch(() => {});
+          })
+            .then(() => {
+              cancel({
+                id: this.taskId,
+                reason: this.form.reason,
+                businessId: this.businessId
+              })
+                .then(() => {
+                  this.$emit('handleClose');
+                })
+                .catch(() => {
+                  this.$message.error('流程作废失败');
+                });
+            })
+            .catch(() => {});
         }
-      },
-
+      }
     }
   };
 </script>

+ 64 - 17
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/boxTabPage.vue

@@ -12,22 +12,26 @@
       v-if="activeName && isValidComponent(activeName)"
       :is="activeName"
       :key="cKey"
+      type="sourceBizNo"
       ref="componentRef"
       :taskDefinitionKey="taskDefinitionKey"
       :activeComp="activeComp"
-      :businessId="businessId"
-      :infoData="{}"
+      :businessId="activeName === 'tab4' ? form.code : businessId"
+      :infoData="{ ...form }"
       :permissionType="permissionType"
     />
   </div>
 </template>
 
 <script>
+  import { getPSaleEntrustedReceiveDetailAPI } from '@/api/bpm/components/saleManage/entrustedReceive';
   export default {
     name: 'boxTabPage',
     components: {
       tab1: () => import('./detailDialog.vue'),
-      tab2: () => import('./outsourcingOutbound.vue')
+      tab2: () => import('./entrustedStorage.vue'),
+      tab3: () => import('./procurementWarehousing.vue'),
+      tab4: () => import('../../inoutBound/detailDialog.vue')
     },
     props: {
       taskDefinitionKey: {
@@ -51,34 +55,63 @@
       return {
         form: {},
         activeName: 'tab1',
-        cKey: 1
-      };
-    },
-    computed: {
-      tabOption() {
-        let list = [
+        cKey: 1,
+        tabOption: [
           {
             label: '发货单详情',
             name: 'tab1',
             isShow: true
-          },
-          {
+          }
+        ]
+      };
+    },
+    async created() {
+      await this.getSendSaleOrderDetail(this.businessId);
+      switch (this.taskDefinitionKey) {
+        case 'storeManagerApprove':
+          this.tabOption.push({
             label: '入库',
             name: 'tab2',
             isShow: true
-          }
-        ];
-        return list.filter((item) => item.isShow);
+          });
+          break;
+        case 'qualityInspection':
+          this.tabOption.push({
+            label: '入库质检',
+            name: 'tab3',
+            isShow: true
+          });
+          break;
+        case 'QCLeaderApprove':
+          this.tabOption.push({
+            label: '入库详情',
+            name: 'tab4',
+            isShow: true
+          });
+          break;
+        case 'qualityInspectionFeedback':
+          this.tabOption.push({
+            label: '质检详情',
+            name: 'tab3',
+            isShow: true
+          });
+          break;
       }
     },
-    async created() {},
     methods: {
       isValidComponent(componentName) {
-        const validComponents = ['tab1', 'tab2'];
+        const validComponents = ['tab1', 'tab2', 'tab3', 'tab4'];
         return validComponents.includes(componentName);
       },
       handleClick(val) {
+        console.log(val.name);
         this.activeName = val.name;
+        if (val.name == 'tab2') {
+          setTimeout(() => {
+            console.log(this.$refs.componentRef);
+            this.$refs.componentRef.pickerSuccess(this.form);
+          }, 500);
+        }
       },
       async getTableValue() {
         console.log(this.$refs.componentRef);
@@ -86,8 +119,22 @@
           form: this.$refs.componentRef.form,
           returnStorageData: this.$refs.componentRef.getReturnStorage
             ? await this.$refs.componentRef.getReturnStorage()
-            : ''
+            : '',
+          isAllChecked:
+            this.$refs.componentRef.getStatus &&
+            this.$refs.componentRef.getStatus(),
+          qualityInspector:
+            (this.$refs.componentRef.getQualityFile &&
+              this.$refs.componentRef.getQualityFile()) ||
+            {}
         };
+      },
+      //发货单详情
+      async getSendSaleOrderDetail(id) {
+        const data = await getPSaleEntrustedReceiveDetailAPI(id);
+        if (data) {
+          this.form = data;
+        }
       }
     }
   };

+ 1 - 1
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/outsourcingOutbound.vue

@@ -10,7 +10,7 @@
       >
         <el-row :gutter="20">
           <el-col :span="8">
-            <el-form-item label="出库场景" prop="bizType">
+            <el-form-item label="出库场景123" prop="bizType">
               <span>{{ outboundTypeMapping[formData.bizType] }}</span>
             </el-form-item></el-col
           >

+ 103 - 32
src/views/bpm/handleTask/components/saleOrder/entrustedReceive/submit.vue

@@ -1,6 +1,31 @@
 <template>
   <el-col :span="16" :offset="6">
     <el-form label-width="100px" ref="formRef" :model="form">
+      <el-form-item
+        label="质检员"
+        prop="qualityInspector"
+        style="margin-bottom: 20px"
+        :rules="{
+          required: true,
+          message: '请选择',
+          trigger: 'change'
+        }"
+        v-if="taskDefinitionKey == 'QCLeaderApprove'"
+      >
+        <el-select
+          v-model="form.qualityInspector"
+          clearable
+          style="width: 100%"
+          :filterable="true"
+        >
+          <el-option
+            v-for="item in userOptions"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
       <el-form-item
         label="审批建议"
         prop="reason"
@@ -23,7 +48,7 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
-        :loading="isLoading"
+        :loading="isSaveLoading"
         @click="handleAudit(1)"
         >通过
       </el-button>
@@ -76,6 +101,8 @@
 </template>
 
 <script>
+  import { uploadQualityFile } from '@/api/classifyManage';
+  import { listAllUserBind } from '@/api/system/organization';
   import outin from '@/api/warehouseManagement/outin';
   import { cancel } from '@/api/bpm/components/saleManage/entrustedReceive';
   import { approveTaskWithVariables } from '@/api/bpm/task';
@@ -103,22 +130,43 @@
     },
     data() {
       return {
-        isLoading: false,
+        userOptions: [],
+        isSaveLoading: false,
         form: {
           reason: ''
         },
         tabOptions: [
           { key: 'starter', permissionType: 'update', name: '发起人申请' },
           {
-            key: 'deptLeaderApprove', permissionType: 'view', name: '部门主管审批'},
-          { key: 'storeManagerApprove', permissionType: 'view', name: '仓管出库' },
+            key: 'deptLeaderApprove',
+            permissionType: 'view',
+            name: '部门主管审批'
+          },
+          {
+            key: 'storeManagerApprove',
+            permissionType: 'view',
+            name: '仓管出库'
+          },
           { key: 'QCLeaderApprove', permissionType: 'view', name: '质检主管' },
-          { key: 'qualityInspection', permissionType: 'view', name: '质检员质检' },
-          { key: 'qualityInspectionFeedback', permissionType: 'view', name: '质检员反馈' }
+          {
+            key: 'qualityInspection',
+            permissionType: 'view',
+            name: '质检员质检'
+          },
+          {
+            key: 'qualityInspectionFeedback',
+            permissionType: 'view',
+            name: '质检员反馈'
+          }
         ]
       };
     },
-    created() {},
+    created() {
+      this.userOptions = [];
+      listAllUserBind().then((data) => {
+        this.userOptions.push(...data);
+      });
+    },
     methods: {
       /** 处理转办审批人 */
       handleUpdateAssignee() {
@@ -137,6 +185,12 @@
         if (permissionType === 'update') {
           await this.getTableValue();
         }
+        if (this.taskDefinitionKey === 'QCLeaderApprove' && status) {
+          if (!this.form.qualityInspector) {
+            return this.$message.error('请选择质检员!');
+          }
+        }
+
         if (this.taskDefinitionKey === 'deptLeaderApprove') {
           let arr = await this.getTableValue();
           let ids = arr.productList.map((item) => item.warehouseId);
@@ -145,35 +199,49 @@
             ','
           );
         }
-        if (this.taskDefinitionKey === 'storeman') {
-          let data = await this.getTableValue();
-          let storageData = data.returnStorageData;
+
+        if (this.taskDefinitionKey === 'qualityInspection' && status) {
+          let arr = await this.getTableValue(); // 是否全部已检
+          if (!arr.isAllChecked) {
+            return this.$message.error('请完成质检!');
+          }
+        }
+
+        if (this.taskDefinitionKey === 'qualityInspectionFeedback' && status) {
+          let arr = await this.getTableValue();
+          if (arr.qualityInspector.qualityFile.length == 0) {
+            return this.$message.error('请上传回执附件!');
+          }
+          await uploadQualityFile(arr.qualityInspector);
+        }
+
+        if (this.taskDefinitionKey === 'storeManagerApprove' && status) {
+          let res = await this.getTableValue();
+          let storageData = res.returnStorageData;
+          console.log(storageData);
           // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
           storageData.storageSource = 1;
-          console.log(storageData);
           try {
-            this.isLoading = true;
-            const res = await outin.saveNew(storageData);
-            if (res.code == 0) {
-              approveTaskWithVariables({
-                id: this.taskId,
-                reason: this.form.reason,
-                variables: {
-                  pass: !!status
-                }
-              }).then((res) => {
-                if (res.code != '-1') {
-                  this.$emit('handleAudit', {
-                    status: status,
-                    title: !status ? '驳回' : ''
-                  });
-                }
-                this.isLoading = false;
-              });
-            }
+            this.isSaveLoading = true;
+            await outin.save(storageData);
+            approveTaskWithVariables({
+              id: this.taskId,
+              reason: this.form.reason,
+              variables: {
+                pass: true
+              }
+            }).then((res) => {
+              if (res.code != '-1') {
+                this.$emit('handleAudit', {
+                  status: 1,
+                  title: '入库'
+                });
+              }
+              this.isSaveLoading = false;
+            });
           } catch (error) {
-            this.isLoading = false;
-            console.error('保存失败:', error);
+            this.isSaveLoading = false;
+            this.$message.error('保存失败');
           }
         } else {
           await this._approveTaskWithVariables(status, storemanIds);
@@ -184,6 +252,9 @@
           pass: !!status,
           storemanIds
         };
+        if (this.form.qualityInspector) {
+          variables['qualityInspector'] = this.form.qualityInspector;
+        }
         approveTaskWithVariables({
           id: this.taskId,
           reason: this.form.reason,