Просмотр исходного кода

客户退货产品处理 出入库流程

Z 2 лет назад
Родитель
Сommit
f6c316d885

+ 77 - 44
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/customerReturnOrderDialog.vue

@@ -16,18 +16,10 @@
         </div>
       </div>
     </el-card>
-    <template v-if="this.activeComp=='zzz'">
-      <repair-tabs-page
-        :isShowReturnOrder="isShowReturnOrder"
-        :taskDefinitionKey="taskDefinitionKey"
-        :activeComp="activeComp"
-        :businessId="businessId"
-        :permissionType="permissionType"></repair-tabs-page>
-    </template>
     <component
-      v-else
       :is="pageName"
       :key="key"
+      :innerOuterBoth="innerOuterBoth"
       ref="componentRef"
       :isShowReturnOrder="isShowReturnOrder"
       :taskDefinitionKey="taskDefinitionKey"
@@ -40,6 +32,8 @@
 
 <script>
 import {EventBus} from './eventBus.js';
+import {getOutInByIdAPI, saleReturnGetByIdAPI} from "@/api/bpm/components/saleManage/saleorder";
+import {deepClone} from "@/utils";
 
 export default {
   name: 'customerReturnOrderDialog',
@@ -54,7 +48,7 @@ export default {
     }
   },
   components: {
-    RepairTabsPage: () => import('./repair-tabs-page'),
+    repairTabsPage: () => import('./repair-tabs-page'),
     customerReturnOrder: () => import('./customerReturnOrder')
   },
 
@@ -62,93 +56,127 @@ export default {
     //innerOuterBoth 1 只有内部  2 只有外部 9 都有
     return {
       dialogType: 'add',
-      pageName: 'customerReturnOrder',
-      tabOptions: [
+      pageName: '',
+      repairTabsOptions: [
+        {key: 'outerStoremanOut', isOutOrIn: 'outerStore', name: '物品出库给外协'},
+        {key: 'outerStoremanIn', isOutOrIn: 'outerStore', name: '外协返修物品入库'},
+        {key: 'outerInQC', isOutOrIn: 'outerStore', name: '外协返修入库质检'},
+        {key: 'innerStoremanIn', isOutOrIn: 'innerStore', name: '内部生产物品入库'},
+        {key: 'innerInQC', isOutOrIn: 'innerStore', name: '内部生产入库质检'}
+      ],
+      activeComp: '',
+      permissionType: '',
+      isShowReturnOrder: '',
+      warehousingMaterialList: [],
+      materialCodeReqList: [],
+      metaList: [],
+      form: {},
+      innerOuterBoth: '',
+      loading: false,
+      key: 1
+    };
+  },
+  computed: {
+    tabOptions() {
+      let list = [
         {
           key: 'stater',
           permissionType: 'update',
           isShowReturnOrder: false,
-          name: '发起人申请'
+          name: '发起人申请',
+          isShow: true
         },
         {
           key: 'deptLeader',
           permissionType: 'view',
           isShowReturnOrder: false,
-          name: '销售主管审批'
+          name: '销售主管审批',
+          isShow: true
         },
         {
           key: 'storeman',
           permissionType: 'update',
           isShowReturnOrder: true,
-          name: '仓管入库'
+          name: '仓管入库',
+          isShow: true
         },
         {
           key: 'QCLeader',
           permissionType: 'view',
           isShowReturnOrder: false,
-          name: '质量部主管指派'
+          name: '质量部主管指派',
+          isShow: true
         },
         {
           key: 'QCApprove',
           permissionType: 'update',
           isShowReturnOrder: false,
-          name: '质检员审核'
+          name: '质检员审核',
+          isShow: true
         },
         {
           key: 'techLeader',
           permissionType: 'view',
           isShowReturnOrder: false,
-          name: '技术部主管指派'
+          name: '技术部主管指派',
+          isShow: true
         },
         {
           key: 'techApprove',
           permissionType: 'update',
           isShowReturnOrder: false,
-          name: '技术员审核'
+          name: '技术员审核',
+          isShow: true
         },
         {
           key: 'produceLeader',
           permissionType: 'view',
           isShowReturnOrder: false,
-          name: '生产部主管指派'
+          name: '生产部主管指派',
+          isShow: true
         },
         {
           key: 'produceApprove',
           permissionType: 'update',
           isShowReturnOrder: false,
-          name: '生产员审核'
+          name: '生产员审核',
+          isShow: true
+        },
+        {
+          key: 'outerStore',
+          permissionType: 'update',
+          isShowReturnOrder: false,
+          name: '外部处理',
+          isShow: [2, 9].includes(this.innerOuterBoth)
+        },
+        {
+          key: 'innerStore',
+          permissionType: 'update',
+          isShowReturnOrder: false,
+          name: '内部处理',
+          isShow: [1, 9].includes(this.innerOuterBoth)
         },
-        {key: 'zzz', permissionType: 'view', name: '返修'},
         {
           key: 'QCApprove2',
           permissionType: 'update',
           isShowReturnOrder: false,
-          name: '质检员反馈'
+          name: '质检员反馈',
+          isShow: true
         }
-      ],
-      repairTabsOptions: [
-        {key: 'outerStoremanOut', isOutOrIn: 'out', name: '物品出库给外协'},
-        {key: 'outerStoremanIn', isOutOrIn: 'out', name: '外协返修物品入库'},
-        {key: 'outerInQC', isOutOrIn: 'out', name: '外协返修入库质检'},
-        {key: 'innerStoremanIn', isOutOrIn: 'view', name: '内部生产物品入库'},
-        {key: 'innerInQC', isOutOrIn: 'update', name: '内部生产入库质检'}
-      ],
-      activeComp: '',
-      permissionType: '',
-      isShowReturnOrder: '',
-      loading: false,
-      key: 1
-    };
+      ]
+      return list.filter(item => item.isShow)
+    }
   },
-  computed: {},
-  created() {
+  async created() {
     //返修节点中有可能多流程
-    let find = this.repairTabsOptions.find(item => item.key == this.taskDefinitionKey)?.key || '';
-    let optionKey = find ? 'zzz' : this.taskDefinitionKey
+    let find = this.repairTabsOptions.find(item => item.key == this.taskDefinitionKey)?.isOutOrIn || '';
+    let optionKey = find || this.taskDefinitionKey
     this.activeComp = optionKey || 'stater';
     this.permissionType = this.tabOptions.find(
       (item) => item.key == this.activeComp
     )?.permissionType;
+    find && await this.getReturnInfo(this.businessId)
+    this.pageName = ['outerStore', 'innerStore'].includes(this.activeComp) ? 'repairTabsPage' : 'customerReturnOrder';
   },
   mounted() {
     setTimeout(() => {
@@ -164,7 +192,7 @@ export default {
     },
     handleCard(val) {
       this.activeComp = val.key
-      this.pageName = this.activeComp == 'zzz' ? 'RepairTabsPage' : 'customerReturnOrder';
+      this.pageName = ['outerStore', 'innerStore'].includes(this.activeComp) ? 'repairTabsPage' : 'customerReturnOrder';
       this.permissionType = val.permissionType;
       this.isShowReturnOrder = val.isShowReturnOrder;
       this.key++;
@@ -176,8 +204,13 @@ export default {
         permissionType: this.permissionType
       });
     },
-    async getInfo() {
-    }
+    async getReturnInfo(businessId) {
+      this.form = await saleReturnGetByIdAPI(businessId);
+      this.innerOuterBoth = this.form.innerOuterBoth
+      // this.$nextTick(() => {
+      //   this.$refs.table.reRenderTable();
+      // });
+    },
   }
 };
 </script>

+ 58 - 210
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/repair-tabs-page.vue

@@ -2,29 +2,25 @@
   <div>
     <el-tabs v-model="activeName" @tab-click="handleClick">
       <el-tab-pane v-for="item in tabOption" :label="item.label" :name="item.name">
-        <el-tabs v-if="childrenActiveName" v-model="childrenActiveName" @tab-click="handleChildrenClick">
-          <el-tab-pane v-for="i in item.children" :label="i.label" :name="i.name">
-          </el-tab-pane>
-        </el-tabs>
       </el-tab-pane>
     </el-tabs>
-
     <component
-      :is="childrenActiveName"
-      :form="form"
+      v-if="activeName && isValidComponent(activeName)"
+      :is="activeName"
+      :key="cKey"
       ref="componentRef"
       :taskDefinitionKey="taskDefinitionKey"
-      :activeComp="activeName"
+      :activeComp="activeComp"
       :businessId="businessId"
-      :permissionType="childrenActiveName"
+      :permissionType="permissionType"
     />
   </div>
 </template>
 
 
 <script>
-import {getOutInByIdAPI, saleReturnGetByIdAPI} from "@/api/bpm/components/saleManage/saleorder";
-import {deepClone} from "@/utils";
+
+import {EventBus} from "@/views/bpm/handleTask/components/saleOrder/customerReturnGoods/eventBus";
 
 export default {
   name: 'repairTabsPage',
@@ -51,222 +47,74 @@ export default {
     businessId: {
       type: String,
       default: ''
-    }
+    },
+    innerOuterBoth: {
+      type: Number,
+      default: ''
+    },
   },
   data() {
     return {
       activeName: '',
-      childrenActiveName: '',
-      warehousingMaterialList: [],
-      materialCodeReqList: [],
-      metaList: [],
-      form: {
-        detailList: []
-      },
+      cKey: 1,
     }
   },
   computed: {
     tabOption() {
-      let list = []
-      let params = {
-        '1': [
-          {
-            label: '内部',
-            name: '1',
-            childrenActiveName: ['innerStoremanIn', 'innerInQC'],
-            children: [
-              {
-                label: '内部生产物品入库',
-                name: 'innerStoremanIn',
-              },
-              {
-                label: '内部生产入库质检',
-                name: 'innerInQC',
-              },
-            ]
-          }
-        ],
-        '2': [
-          {
-            label: '外部',
-            name: '2',
-            childrenActiveName: ['outerStoremanOut', 'outerStoremanIn', 'outerInQC'],
-            children: [
-              {
-                label: '物品出库给外协',
-                name: 'outerStoremanOut',
-              },
-              {
-                label: '外协返修物品入库',
-                name: 'outerStoremanIn',
-              },
-              {
-                label: '外协返修入库质检',
-                name: 'outerInQC',
-              },
-            ],
-          }
-        ],
-
-        '9': [
-          {
-            label: '内部',
-            name: '1',
-            childrenActiveName: ['innerStoremanIn', 'innerInQC'],
-            children: [
-              {
-                label: '内部生产物品入库',
-                name: 'innerStoremanIn',
-              },
-              {
-                label: '内部生产入库质检',
-                name: 'innerInQC',
-              },
-            ]
-          },
-          {
-            label: '外部',
-            name: '2',
-            childrenActiveName: ['outerStoremanOut', 'outerStoremanIn', 'outerInQC'],
-            children: [
-              {
-                label: '物品出库给外协',
-                name: 'outerStoremanOut',
-              },
-              {
-                label: '外协返修物品入库',
-                name: 'outerStoremanIn',
-              },
-              {
-                label: '外协返修入库质检',
-                name: 'outerInQC',
-              },
-            ],
-          },
-
-        ],
-      }
-      this.form.innerOuterBoth && params[this.form.innerOuterBoth] && list.push(...params[this.form.innerOuterBoth])
-      let find = list.find(item => item.childrenActiveName.includes(this.taskDefinitionKey))?.name
-      this.activeName = find ? find + '' : ''
-      return list
+      let list = [
+        {
+          label: '内部生产物品入库',
+          name: 'innerStoremanIn',
+          parentType: '1'
+        },
+        {
+          label: '内部生产入库质检',
+          name: 'innerInQC',
+          parentType: '1'
+        },
+        {
+          label: '物品出库给外协',
+          name: 'outerStoremanOut',
+          parentType: '2'
+        },
+        {
+          label: '外协返修物品入库',
+          name: 'outerStoremanIn',
+          parentType: '2'
+        },
+        {
+          label: '外协返修入库质检',
+          name: 'outerInQC',
+          parentType: '2'
+        },
+      ]
+      return list.filter(item => item.parentType == this.innerOuterBoth)
     }
   },
   async created() {
-    await this.getReturnInfo(this.businessId)
-    this.childrenActiveName = this.taskDefinitionKey
+    this.activeName = this.taskDefinitionKey
+  },
+  mounted() {
+    setTimeout(() => {
+      this.getActiveCompValue();
+    }, 400);
   },
   methods: {
-    async getReturnInfo(businessId) {
-      this.form = await saleReturnGetByIdAPI(businessId);
-      let outInIds = [
-        ...new Set(this.form?.detailList?.map((item) => item.outInId))
-      ];
-      for (const outInId of outInIds) {
-        //拼接信息
-        const data = await getOutInByIdAPI(outInId);
-        this.infoData = deepClone(data);
-        //出库物料明细
-        this.warehousingMaterialList = this.infoData?.outInDetailVOList || [];
-        //出库包装明细
-        if (this.warehousingMaterialList.length) {
-          this.materialCodeReqList = [];
-          this.warehousingMaterialList.forEach((item) => {
-            if (item.outInDetailRecordVOList?.length) {
-              item.outInDetailRecordVOList = item.outInDetailRecordVOList.map(
-                (i) => {
-                  return {
-                    ...i,
-                    outInCode: this.infoData.bizNo,
-                    outInId: item.outInId,
-                    measurementCount: i.totalCount,
-                    outboundDetailId: i.id,
-                    outboundType: 1,
-                    packageCount: i.packingCount,
-                    packingUnit: i.packingUnit,
-                    weight: i.weight,
-                    specification: item.specification,
-                    name: i.name,
-                    categoryCode: i.categoryCode,
-                    id: ''
-                  };
-                }
-              );
-              this.materialCodeReqList.push(...item.outInDetailRecordVOList);
-            }
-          });
-          //出库物料明细
-          if (this.materialCodeReqList.length) {
-            this.metaList = [];
-            this.materialCodeReqList.forEach((item) => {
-              if (item.outInDetailRecordMaterialDetailVOList?.length) {
-                item.outInDetailRecordMaterialDetailVOList =
-                  item.outInDetailRecordMaterialDetailVOList.map((i) => {
-                    return {
-                      ...i,
-                      outInId: item.outInId,
-                      outInCode: item.outInCode,
-                      measurementCount: 1,
-                      outboundDetailId: i.id,
-                      outboundType: 2,
-                      packageCount: i.packingCount,
-                      packingUnit: i.packingUnit,
-                      weight: i.weight,
-                      weightUtil: i.weightUnit,
-                      specification: item.specification,
-                      categoryCode: i.assetCode,
-                      name: i.assetName,
-                      id: ''
-                    };
-                  });
-                this.metaList.push(
-                  ...item.outInDetailRecordMaterialDetailVOList
-                );
-              }
-            });
-          }
-        }
-        this.form.detailList.forEach((item) => {
-          if (item.outboundType == 1) {
-            let find =
-              this.materialCodeReqList.find(
-                (i) => i.outboundDetailId == item.outboundDetailId
-              ) || {};
-            item.name = find.name;
-            item.categoryCode = find.categoryCode;
-            item.specification = find.specification;
-            item.weightUtil = find.weightUtil;
-            item.packingUnit = find.packingUnit;
-            item.measuringUnit = find.measuringUnit;
-          } else {
-            let find =
-              this.metaList.find(
-                (i) => i.outboundDetailId == item.outboundDetailId
-              ) || {};
-            item.name = find.name;
-            item.categoryCode = find.categoryCode;
-            item.specification = find.specification;
-            item.weightUtil = find.weightUtil;
-            item.packingUnit = find.packingUnit;
-            item.measuringUnit = find.measuringUnit;
-          }
-          item.unqualifiedTypeList = item.unqualifiedType
-            ? item.unqualifiedType?.split(',')
-            : [];
-        });
-      }
-      // console.log(this.form);
-      // this.$nextTick(() => {
-      //   this.$refs.table.reRenderTable();
-      // });
+    isValidComponent(componentName) {
+      const validComponents = ['outerStoremanOut', 'outerStoremanIn', 'outerInQC', 'innerStoremanIn', 'innerInQC'];
+      return validComponents.includes(componentName);
     },
     handleClick(val) {
       this.activeName = val.name
-      this.childrenActiveName = this.tabOption.find(item => item.name == val.name).children[0].name
+      this.getActiveCompValue()
+    },
+    getActiveCompValue() {
+      EventBus.$emit('getActiveCompValue', {
+        activeComp: this.activeComp,
+        childActiveComp: this.activeName,
+        permissionType: this.permissionType
+      });
     },
-    handleChildrenClick(val) {
-
-    }
   }
 }
 </script>

+ 163 - 160
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/submit.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-col :span="16" :offset="6" v-if="activeComp == taskDefinitionKey">
+  <el-col :span="16" :offset="6" v-if="activeComp == taskDefinitionKey || childActiveComp ==taskDefinitionKey">
     <el-form label-width="100px" ref="formRef" :rules="rules" :model="form">
       <el-form-item
         v-if="
@@ -44,7 +44,7 @@
         type="success"
         size="mini"
         @click="handleAudit(1)"
-        >通过
+      >通过
       </el-button>
 
       <el-button
@@ -53,90 +53,164 @@
         size="mini"
         v-if="taskDefinitionKey !== 'stater'"
         @click="handleAudit(0)"
-        >驳回
+      >驳回
       </el-button>
     </div>
   </el-col>
 </template>
 
 <script>
-  import {
-    approveTaskWithVariablesAPI,
-    saleReturnUpdateAPI
-  } from '@/api/bpm/components/saleManage/saleorder';
-  import { listAllUserBind } from '@/api/system/organization';
-  import { EventBus } from './eventBus.js';
-  import outin from '@/api/warehouseManagement/outin';
-  // 流程实例的详情页,可用于审批
-  //qcId techId produceId
-  export default {
-    name: '',
-    components: {
-      //   Parser
+import {
+  approveTaskWithVariablesAPI,
+  saleReturnUpdateAPI
+} from '@/api/bpm/components/saleManage/saleorder';
+import {listAllUserBind} from '@/api/system/organization';
+import {EventBus} from './eventBus.js';
+import outin from '@/api/warehouseManagement/outin';
+// 流程实例的详情页,可用于审批
+//qcId techId produceId
+export default {
+  name: '',
+  components: {
+    //   Parser
+  },
+  props: {
+    businessId: {
+      default: ''
     },
-    props: {
-      businessId: {
-        default: ''
+    taskId: {
+      default: ''
+    },
+    id: {
+      default: ''
+    },
+    taskDefinitionKey: {
+      default: ''
+    }
+  },
+  data() {
+    return {
+      form: {
+        userId: '',
+        reason: ''
       },
-      taskId: {
-        default: ''
+      submitParams: {
+        QCLeader: 'qcId',
+        techLeader: 'techId',
+        produceLeader: 'produceId'
       },
-      id: {
-        default: ''
+      rules: {
+        reason: {
+          required: true,
+          message: '请输入审批建议',
+          trigger: 'blur'
+        },
+        userId: {required: true, message: '请选择指派人', trigger: 'change'}
       },
-      taskDefinitionKey: {
-        default: ''
+      userOptions: [],
+      activeComp: '',
+      permissionType: '',
+      childActiveComp: '',
+    };
+  },
+  async created() {
+    this.userOptions = [];
+    listAllUserBind().then((data) => {
+      this.userOptions.push(...data);
+    });
+    this.activeComp = this.taskDefinitionKey;
+    EventBus.$on('getActiveCompValue', (row) => {
+      this.activeComp = row.activeComp;
+      this.childActiveComp = row.childActiveComp;
+      this.permissionType = row.permissionType;
+    });
+  },
+  mounted() {
+  },
+  methods: {
+    // 销售退货入库
+    async salesReturnsInStorage(data, pass) {
+      // 获取销售退货入库信息
+      let storageData = await this.getReturnStorage();
+      // 是否已经入库
+      if (storageData.isStorage) {
+        approveTaskWithVariablesAPI({
+          id: this.taskId,
+          reason: this.form.reason,
+          variables: {
+            pass: !!pass
+          }
+        }).then((res) => {
+          if (res.code != '-1') {
+            this.$emit('handleAudit', {
+              status: pass,
+              title: !pass ? '驳回' : ''
+            });
+          }
+        });
+      } else {
+        // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
+        storageData.storageSource = 1;
+        // 获取货位信息(判断货位信息是否填写)
+        let houseListLength = storageData.outInDetailAddPOList.map((item) => {
+          return item.houseList.length;
+        });
+        let boolen = houseListLength.every((item) => item > 0);
+        if (boolen) {
+          try {
+            const res = await outin.save(storageData);
+            console.log('res------------------', res);
+            data.returnInReceiptId = res.data;
+            const updateRes = await saleReturnUpdateAPI(data);
+            if (updateRes.code == 0) {
+              approveTaskWithVariablesAPI({
+                id: this.taskId,
+                reason: this.form.reason,
+                variables: {
+                  pass: !!pass
+                }
+              }).then((res) => {
+                if (res.code != '-1') {
+                  this.$emit('handleAudit', {
+                    status: pass,
+                    title: !pass ? '驳回' : ''
+                  });
+                }
+              });
+            }
+          } catch (error) {
+            console.error('保存失败:', error);
+          }
+        } else {
+          this.$message.error('请选择物品货位信息');
+        }
       }
     },
-    data() {
-      return {
-        form: {
-          userId: '',
-          reason: ''
-        },
-        submitParams: {
-          QCLeader: 'qcId',
-          techLeader: 'techId',
-          produceLeader: 'produceId'
-        },
-        rules: {
-          reason: {
-            required: true,
-            message: '请输入审批建议',
-            trigger: 'blur'
-          },
-          userId: { required: true, message: '请选择指派人', trigger: 'change' }
-        },
-        userOptions: [],
-        activeComp: '',
-        permissionType: ''
-      };
-    },
-    async created() {
-      this.userOptions = [];
-      listAllUserBind().then((data) => {
-        this.userOptions.push(...data);
-      });
-      this.activeComp = this.taskDefinitionKey;
-      EventBus.$on('getActiveCompValue', (row) => {
-        this.activeComp = row.activeComp;
-        this.permissionType = row.permissionType;
-      });
-    },
-    mounted() {},
-    methods: {
-      // 销售退货入库
-      async salesReturnsInStorage(data, pass) {
-        // 获取销售退货入库信息
-        let storageData = await this.getReturnStorage();
-        // 是否已经入库
-        if (storageData.isStorage) {
+    //保存表格数据
+    async handleAudit(pass) {
+      let data = await this.getTableValue();
+      let updateCode = '1'; //判断saleReturnUpdateAPI方法是否执行成功
+      this.$refs.formRef.validate(async (validate) => {
+        if ((!validate || !data) && !!pass)
+          return this.$message.warning('有必填项未填,请检查');
+        // 销售退货入库节点
+        if (this.taskDefinitionKey === 'storeman' && !!pass) {
+          this.salesReturnsInStorage(data, pass);
+        } else {
+          if (this.permissionType == 'update' && !!pass)
+            updateCode = await saleReturnUpdateAPI(data);
+          if (typeof updateCode !== 'string') return;
+          let variables = {
+            pass: !!pass
+          };
+          if (this.submitParams[this.taskDefinitionKey]) {
+            variables[this.submitParams[this.taskDefinitionKey]] =
+              this.form.userId;
+          }
           approveTaskWithVariablesAPI({
             id: this.taskId,
             reason: this.form.reason,
-            variables: {
-              pass: !!pass
-            }
+            variables
           }).then((res) => {
             if (res.code != '-1') {
               this.$emit('handleAudit', {
@@ -145,99 +219,28 @@
               });
             }
           });
-        } else {
-          // 入库来源storageSource 0-正常  1-外部(外部跳过内部审核流程)
-          storageData.storageSource = 1;
-          // 获取货位信息(判断货位信息是否填写)
-          let houseListLength = storageData.outInDetailAddPOList.map((item) => {
-            return item.houseList.length;
-          });
-          let boolen = houseListLength.every((item) => item > 0);
-          if (boolen) {
-            try {
-              const res = await outin.save(storageData);
-              console.log('res------------------', res);
-              data.returnInReceiptId = res.data;
-              const updateRes = await saleReturnUpdateAPI(data);
-              if (updateRes.code == 0) {
-                approveTaskWithVariablesAPI({
-                  id: this.taskId,
-                  reason: this.form.reason,
-                  variables: {
-                    pass: !!pass
-                  }
-                }).then((res) => {
-                  if (res.code != '-1') {
-                    this.$emit('handleAudit', {
-                      status: pass,
-                      title: !pass ? '驳回' : ''
-                    });
-                  }
-                });
-              }
-            } catch (error) {
-              console.error('保存失败:', error);
-            }
-          } else {
-            this.$message.error('请选择物品货位信息');
-          }
         }
-      },
-      //保存表格数据
-      async handleAudit(pass) {
-        let data = await this.getTableValue();
-        let updateCode = '1'; //判断saleReturnUpdateAPI方法是否执行成功
-        this.$refs.formRef.validate(async (validate) => {
-          if ((!validate || !data) && !!pass)
-            return this.$message.warning('有必填项未填,请检查');
-          // 销售退货入库节点
-          if (this.taskDefinitionKey === 'storeman' && !!pass) {
-            this.salesReturnsInStorage(data, pass);
-          } else {
-            if (this.permissionType == 'update' && !!pass)
-              updateCode = await saleReturnUpdateAPI(data);
-            if (typeof updateCode !== 'string') return;
-            let variables = {
-              pass: !!pass
-            };
-            if (this.submitParams[this.taskDefinitionKey]) {
-              variables[this.submitParams[this.taskDefinitionKey]] =
-                this.form.userId;
-            }
-            approveTaskWithVariablesAPI({
-              id: this.taskId,
-              reason: this.form.reason,
-              variables
-            }).then((res) => {
-              if (res.code != '-1') {
-                this.$emit('handleAudit', {
-                  status: pass,
-                  title: !pass ? '驳回' : ''
-                });
-              }
-            });
-          }
-        });
-      },
-      getTableValue() {
-        return new Promise((resolve, reject) => {
-          this.$emit('getTableValue', async (data) => {
-            resolve(await data);
-          });
-        });
-      },
-      getReturnStorage() {
-        return new Promise((resolve, reject) => {
-          this.$emit('getReturnStorage', async (data) => {
-            resolve(await data);
-          });
+      });
+    },
+    getTableValue() {
+      return new Promise((resolve, reject) => {
+        this.$emit('getTableValue', async (data) => {
+          resolve(await data);
         });
-      }
+      });
     },
-    beforeDestroy() {
-      EventBus.$off('getActiveCompValue');
+    getReturnStorage() {
+      return new Promise((resolve, reject) => {
+        this.$emit('getReturnStorage', async (data) => {
+          resolve(await data);
+        });
+      });
     }
-  };
+  },
+  beforeDestroy() {
+    EventBus.$off('getActiveCompValue');
+  }
+};
 </script>
 
 <style lang="scss"></style>