Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

Z vor 2 Jahren
Ursprung
Commit
7996527b64

+ 10 - 6
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/detailDialog.vue

@@ -182,7 +182,11 @@
       type="sourceBizNo"
       @success="success"
     ></add>
-    <detailDialog type="sourceBizNo" :businessId="form.returnNo" v-if="activeComp == 'outBoundView'"></detailDialog>
+    <detailDialog
+      type="sourceBizNo"
+      :businessId="form.returnNo"
+      v-if="activeComp == 'outBoundView'"
+    ></detailDialog>
   </div>
 </template>
 
@@ -193,14 +197,15 @@
   import dictMixins from '@/mixins/dictMixins';
   import fileUpload from '@/components/upload/fileUpload';
   import add from '@/views/bpm/outgoingManagement/add.vue';
-  import detailDialog from '@/views/bpm/handleTask/components/outBound/detailDialog.vue'
+  import detailDialog from '@/views/bpm/handleTask/components/outBound/detailDialog.vue';
 
   import { reviewStatusEnum } from '@/enum/dict';
   import { getOutInBySourceBizNo } from '@/api/classifyManage';
   export default {
     components: {
       fileUpload,
-      add,detailDialog
+      add,
+      detailDialog
     },
     mixins: [dictMixins],
     data() {
@@ -370,7 +375,6 @@
       if (this.taskDefinitionKey == 'purchaserUploadReceipt') {
         this.tabOptions.push({ key: 'outBoundView', name: '出库单详情' });
       }
-      
     },
     methods: {
       changeActive(item) {
@@ -417,8 +421,8 @@
           this.form = data;
         }
       },
-      save() {
-        this.$refs.add.handleNewSave();
+      save(data) {
+        this.$refs.add.handleNewSave(data);
       },
       success() {
         this.$emit('handleClose');

+ 16 - 6
src/views/bpm/handleTask/components/purchaseOrder/returnGoods/submit.vue

@@ -19,13 +19,16 @@
       </el-form-item>
     </el-form>
     <div style="margin-left: 10%; margin-bottom: 20px; font-size: 14px">
-    <el-button
+      <el-button
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
-        v-if="taskDefinitionKey != 'storemanApprove'||(taskDefinitionKey == 'storemanApprove'&&outInData.verifyStatus==2)"
+        v-if="
+          taskDefinitionKey != 'storemanApprove' ||
+          (taskDefinitionKey == 'storemanApprove' &&
+            outInData.verifyStatus == 2)
+        "
         @click="handleAudit(1)"
-        
         >通过
       </el-button>
       <el-button
@@ -35,7 +38,8 @@
         @click="storemanApprove"
         v-if="
           ['storemanApprove'].includes(taskDefinitionKey) &&
-          activeComp == 'outBound'&&[0,3].includes(outInData.verifyStatus)
+          activeComp == 'outBound' &&
+          [0, 3].includes(outInData.verifyStatus)
         "
         >申请出库
       </el-button>
@@ -121,7 +125,7 @@
     },
     async created() {
       if (this.taskDefinitionKey == 'storemanApprove') {
-        let data = await getReturnSaleOrderrecordDetail(this.businessId); 
+        let data = await getReturnSaleOrderrecordDetail(this.businessId);
         try {
           this.outInData = await getOutInBySourceBizNo(data.returnNo);
         } catch (error) {
@@ -131,7 +135,13 @@
     },
     methods: {
       async storemanApprove() {
-        this.$emit('submit');
+        this.$emit('submit', {
+          id: this.taskId,
+          reason: this.form.reason,
+          variables: {
+            pass: true
+          }
+        });
       },
       /** 处理转办审批人 */
       handleUpdateAssignee() {

+ 170 - 35
src/views/bpm/handleTask/components/saleOrder/customerReturnGoods/inboundDetails.vue

@@ -249,19 +249,19 @@
       >
         <el-table-column label="序号" type="index" width="50">
         </el-table-column>
-        <!-- <el-table-column :label="`编码`" prop="categoryCode"></el-table-column> -->
-        <el-table-column :label="`编码`" prop="assetCode"></el-table-column>
-        <!-- <el-table-column :label="`名称`" prop="name"></el-table-column> -->
-        <el-table-column :label="`名称`" prop="assetName"></el-table-column>
+        <!-- <el-table-column :label="`编码`" prop="assetCode"></el-table-column> -->
+        <el-table-column :label="`编码`" prop="categoryCode"></el-table-column>
+        <!-- <el-table-column :label="`名称`" prop="assetName"></el-table-column> -->
+        <el-table-column :label="`名称`" prop="name"></el-table-column>
         <el-table-column label="批次号" prop="batchNo"></el-table-column>
         <!-- <el-table-column
           label="包装编码"
-          prop="code"
+          prop="onlyCode"
           width="80"
         ></el-table-column> -->
         <el-table-column
           label="包装编码"
-          prop="onlyCode"
+          prop="code"
           width="80"
         ></el-table-column>
         <el-table-column label="包装数量" prop="packingCount" width="80">
@@ -626,40 +626,42 @@
       calcSumTotal(packingCount, outInNum, univalence) {
         //最小包装单元,包装数量,单价
         const total = {
-          PackingCount: Number(packingCount),
-          outInNum: Number(outInNum),
-          univalence: Number(univalence == undefined ? 0 : univalence)
+          PackingCount: Number(packingCount > 0? packingCount : 0),
+          outInNum: Number(outInNum > 0 ? outInNum : 0),
+          univalence: Number(univalence > 0 ? univalence : 0)
         };
         return total.PackingCount * total.outInNum * total.univalence;
       },
       // 获取出库单详情
-      initialize() {
-        // returnHandleNo 有单据来源说明已入库(被驳回状态)
-				getOutInBySourceBizNoOrError(this.returnDetailsForm.returnHandleNo).then((data) => {
-          console.log(data)
-          console.log('有订单来源')
-          this.isEdit = false
-					this.infoData = deepClone(data)
-					// 增加是否已经入库字段
-					this.infoData.isStorage = true
-					// 填充遍历数据
-					if (this.infoData.outInDetailVOList?.length > 0) {
-            this.warehousingMaterialList = []; // 物品列表
-            this.materialCodeReqList = []; // 包装列表
-            this.metaList = []; // 物料列表
-            this.infoData.outInDetailVOList.forEach((goodsiItem) => {
-              this.warehousingMaterialList.push(goodsiItem);
-              goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
-                wrapItem.count =
-                  wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
-                this.materialCodeReqList.push(wrapItem);
-                wrapItem.outInDetailRecordMaterialDetailVOList.forEach((materialItem) => {
-                  this.metaList.push(materialItem);
+      async initialize() {
+        // returnInReceiptId退货入库单id(有说明已入库)
+        if (this.returnDetailsForm.returnInReceiptId) {
+          getOutInByIdAPI(this.returnDetailsForm.returnInReceiptId).then((data) => {
+            console.log(data)
+            console.log('有订单来源')
+            this.isEdit = false
+            this.infoData = deepClone(data)
+            // 增加是否已经入库字段
+            this.infoData.isStorage = true
+            // 填充遍历数据
+            if (this.infoData.outInDetailVOList?.length > 0) {
+              this.warehousingMaterialList = []; // 物品列表
+              this.materialCodeReqList = []; // 包装列表
+              this.metaList = []; // 物料列表
+              this.infoData.outInDetailVOList.forEach((goodsiItem) => {
+                this.warehousingMaterialList.push(goodsiItem);
+                goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
+                  wrapItem.count =
+                    wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
+                  this.materialCodeReqList.push(wrapItem);
+                  wrapItem.outInDetailRecordMaterialDetailVOList.forEach((materialItem) => {
+                    this.metaList.push(materialItem);
+                  });
                 });
               });
-            });
-          }
-        }).catch(async() => {
+            }
+          })
+        } else {
           console.log('没有订单来源')
           this.isEdit = true
 					// outboundType 1包装 2物料
@@ -700,6 +702,7 @@
 											(item) => item.outboundDetailId === materialItem.id
 										);
 										if (hasMaterialItem) {
+                      console.log(materialItem)
 											return materialItem;
 										}
 									}
@@ -740,8 +743,138 @@
 							}
 						}
 					);
+          // 处理过滤map为空的数组
+          this.infoData.outInDetailVOList = this.infoData.outInDetailVOList.filter((item) => !!item)
+          this.infoData.outInDetailVOList.forEach((goodsItem) => {
+            goodsItem.outInDetailRecordVOList = goodsItem.outInDetailRecordVOList.filter((wrapItem) => !!wrapItem)
+					});
+          this.infoData.outInDetailVOList.forEach((goodsItem) => {
+            goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
+              wrapItem.outInDetailRecordMaterialDetailVOList = wrapItem.outInDetailRecordMaterialDetailVOList.filter((metail) => !!metail)
+            })
+          })
 					this.initData();
-        })
+        }
+        // returnHandleNo 有单据来源说明已入库(被驳回状态)
+				// getOutInBySourceBizNoOrError(this.returnDetailsForm.returnHandleNo).then((data) => {
+        //   console.log(data)
+        //   console.log('有订单来源')
+        //   this.isEdit = false
+				// 	this.infoData = deepClone(data)
+				// 	// 增加是否已经入库字段
+				// 	this.infoData.isStorage = true
+				// 	// 填充遍历数据
+				// 	if (this.infoData.outInDetailVOList?.length > 0) {
+        //     this.warehousingMaterialList = []; // 物品列表
+        //     this.materialCodeReqList = []; // 包装列表
+        //     this.metaList = []; // 物料列表
+        //     this.infoData.outInDetailVOList.forEach((goodsiItem) => {
+        //       this.warehousingMaterialList.push(goodsiItem);
+        //       goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
+        //         wrapItem.count =
+        //           wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
+        //         this.materialCodeReqList.push(wrapItem);
+        //         wrapItem.outInDetailRecordMaterialDetailVOList.forEach((materialItem) => {
+        //           this.metaList.push(materialItem);
+        //         });
+        //       });
+        //     });
+        //   }
+        // }).catch(async() => {
+        //   console.log('没有订单来源')
+        //   this.isEdit = true
+				// 	// outboundType 1包装 2物料
+				// 	let sendNo = this.returnDetailsForm.detailList[0]?.outInId;
+				// 	// 将退货物品明细划分为包装和物料(从物料往上反推形成tree)
+				// 	// 包装清单
+				// 	let wrapList =
+				// 		this.returnDetailsForm.detailList?.length > 0
+				// 			? this.returnDetailsForm.detailList.filter(
+				// 					(item) => item.outboundType === 1
+				// 				)
+				// 			: [];
+				// 	// 物料清单
+				// 	let material =
+				// 		this.returnDetailsForm.detailList?.length > 0
+				// 			? this.returnDetailsForm.detailList.filter(
+				// 					(item) => item.outboundType === 2
+				// 				)
+				// 			: [];
+				// 	// 获取出库单详情
+				// 	const data = await getOutInByIdAPI(sendNo);
+				// 	// 复制出库单详情
+				// 	this.infoData = deepClone(data);
+				// 	// 添加单据来源
+				// 	this.infoData.sourceBizNo = this.returnDetailsForm.returnHandleNo
+				// 	// 增加是否已经入库字段
+				// 	this.infoData.isStorage = false
+				// 	// 将出库状态改成入库状态 2出库 1入库
+				// 	this.infoData.type = 1;
+				// 	// 通过物料过滤出库单详情树
+				// 	this.infoData.outInDetailVOList.forEach((goodsItem) => {
+				// 		// 过滤物料维度
+				// 		goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
+				// 			wrapItem.outInDetailRecordMaterialDetailVOList =
+				// 				wrapItem.outInDetailRecordMaterialDetailVOList.map(
+				// 					(materialItem) => {
+				// 						let hasMaterialItem = material.some(
+				// 							(item) => item.outboundDetailId === materialItem.id
+				// 						);
+				// 						if (hasMaterialItem) {
+        //               console.log(materialItem)
+				// 							return materialItem;
+				// 						}
+				// 					}
+				// 				);
+				// 		});
+				// 	});
+				// 	// 通过包装过滤出库单详情树
+				// 	this.infoData.outInDetailVOList.forEach((goodsItem) => {
+				// 		// 过滤包装维度
+				// 		goodsItem.outInDetailRecordVOList =
+				// 			goodsItem.outInDetailRecordVOList.map((wrapItem) => {
+				// 				// 过滤在包装清单内或者存在过滤物料的包装
+				// 				if (wrapList.length > 0) {
+				// 					let hasWrapItem = wrapList.some((item) => {
+				// 						return (
+				// 							item.outboundDetailId === wrapItem.id ||
+				// 							wrapItem.outInDetailRecordMaterialDetailVOList?.length > 0
+				// 						);
+				// 					});
+				// 					if (hasWrapItem) {
+				// 						return wrapItem;
+				// 					}
+				// 				} else {
+				// 					// 返回存在物料维度的包装维度
+				// 					if (
+				// 						wrapItem.outInDetailRecordMaterialDetailVOList?.length > 0
+				// 					) {
+				// 						return wrapItem;
+				// 					}
+				// 				}
+				// 			});
+				// 	});
+				// 	// 过滤没有包装的物品维度
+				// 	this.infoData.outInDetailVOList = this.infoData.outInDetailVOList.map(
+				// 		(goodsItem) => {
+				// 			if (goodsItem.outInDetailRecordVOList?.length > 0) {
+				// 				return goodsItem;
+				// 			}
+				// 		}
+				// 	);
+        //   // 处理过滤map为空的数组
+        //   this.infoData.outInDetailVOList = this.infoData.outInDetailVOList.filter((item) => !!item)
+        //   this.infoData.outInDetailVOList.forEach((goodsItem) => {
+        //     goodsItem.outInDetailRecordVOList = goodsItem.outInDetailRecordVOList.filter((wrapItem) => !!wrapItem)
+				// 	});
+        //   this.infoData.outInDetailVOList.forEach((goodsItem) => {
+        //     goodsItem.outInDetailRecordVOList.forEach((wrapItem) => {
+        //       wrapItem.outInDetailRecordMaterialDetailVOList = wrapItem.outInDetailRecordMaterialDetailVOList.filter((metail) => !!metail)
+        //     })
+        //   })
+        //   console.log(this.infoData)
+				// 	this.initData();
+        // })
       },
       // 初始化显示数据
       async initData() {
@@ -754,10 +887,12 @@
           this.metaList = []; // 物料列表
           this.infoData.outInDetailAddPOList.forEach((goodsiItem) => {
 						goodsiItem.houseList = []
+            goodsiItem.count = goodsiItem.outInDetailRecordVOList.length
             goodsiItem.outInDetailRecordAddPOList =
               goodsiItem.outInDetailRecordVOList;
             delete goodsiItem.outInDetailRecordVOList;
             console.log(goodsiItem);
+            
             this.warehousingMaterialList.push(goodsiItem);
             goodsiItem.outInDetailRecordAddPOList.forEach((wrapItem) => {
               wrapItem.minUnit = wrapItem.minPackingCount;

+ 2 - 2
src/views/bpm/handleTask/components/saleOrder/invoice/detailDialog.vue

@@ -396,8 +396,8 @@
           });
         }
       },
-      save() {
-        this.$refs.add.handleNewSave();
+      save(data) {
+        this.$refs.add.handleNewSave(data);
       },
       success() {
         this.$emit('handleClose');

+ 29 - 15
src/views/bpm/handleTask/components/saleOrder/invoice/submit.vue

@@ -23,9 +23,12 @@
         icon="el-icon-edit-outline"
         type="success"
         size="mini"
-        v-if="taskDefinitionKey != 'storemanApprove'||(taskDefinitionKey == 'storemanApprove'&&outInData.verifyStatus==2)"
+        v-if="
+          taskDefinitionKey != 'storemanApprove' ||
+          (taskDefinitionKey == 'storemanApprove' &&
+            outInData.verifyStatus == 2)
+        "
         @click="handleAudit(1)"
-
         >通过
       </el-button>
       <el-button
@@ -35,7 +38,8 @@
         @click="storemanApprove"
         v-if="
           ['storemanApprove'].includes(taskDefinitionKey) &&
-          activeComp == 'outBound'&&[0,3].includes(outInData.verifyStatus)
+          activeComp == 'outBound' &&
+          [0, 3].includes(outInData.verifyStatus)
         "
         >申请出库
       </el-button>
@@ -45,7 +49,9 @@
         size="mini"
         @click="handleAudit(0)"
         v-if="
-          ['deptLeaderApprove', 'storemanApprove'].includes(taskDefinitionKey)&&outInData.verifyStatus!=1
+          ['deptLeaderApprove', 'storemanApprove'].includes(
+            taskDefinitionKey
+          ) && outInData.verifyStatus != 1
         "
         >驳回
       </el-button>
@@ -80,10 +86,12 @@
 <script>
   import {
     UpdateSendInformation,
-    getSendSaleOrderrecordDetail,getWarehouseListByIds
+    getSendSaleOrderrecordDetail,
+    getWarehouseListByIds
   } from '@/api/bpm/components/saleManage/saleorder';
   import { approveTaskWithVariables } from '@/api/bpm/task';
   import { getOutInBySourceBizNo } from '@/api/classifyManage';
+  import { data } from 'ele-admin/lib/ele-pro-table';
 
   // 流程实例的详情页,可用于审批
   export default {
@@ -114,28 +122,34 @@
           technicianId: '',
           reason: ''
         },
-        outInData:{verifyStatus:''},
-        activeComp: '',
+        outInData: { verifyStatus: '' },
+        activeComp: ''
       };
     },
     async created() {
       if (this.taskDefinitionKey == 'storemanApprove') {
         let data = await getSendSaleOrderrecordDetail(this.businessId);
         try {
-          console.log(1111,'1111111111');
-          this.outInData = await getOutInBySourceBizNo(data.docNo)
-          console.log(this.outInData,'============');
+          console.log(1111, '1111111111');
+          this.outInData = await getOutInBySourceBizNo(data.docNo);
+          console.log(this.outInData, '============');
         } catch (error) {
-          console.log(22222222,'22222222222');
-          this.outInData.verifyStatus=0
+          console.log(22222222, '22222222222');
+          this.outInData.verifyStatus = 0;
         }
       }
-      console.log('taskDefinitionKey',this.taskDefinitionKey)
-      console.log('outInData',this.outInData)
+      console.log('taskDefinitionKey', this.taskDefinitionKey);
+      console.log('outInData', this.outInData);
     },
     methods: {
       async storemanApprove() {
-        this.$emit('submit');
+        this.$emit('submit', {
+          id: this.taskId,
+          reason: this.form.reason,
+          variables: {
+            pass: true
+          }
+        });
       },
       activeCompChange(activeComp) {
         this.activeComp = activeComp;

+ 67 - 18
src/views/bpm/outgoingManagement/add.vue

@@ -324,7 +324,7 @@
           </el-col>
         </el-row>
       </el-form>
-      <div>
+      <div v-if="!isStorage">
         <el-button type="primary" @click="addStock">添加</el-button>
       </div>
       <div class="material">
@@ -599,7 +599,12 @@
 <script>
   import outin from '@/api/warehouseManagement/outin';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
-  import { getTreeByPid, getTreeByGroup } from '@/api/classifyManage';
+  import { deepClone } from '@/components/FormGenerator/utils/index';
+  import {
+    getTreeByPid,
+    getTreeByGroup,
+    getOutInBySourceBizNoOrError
+  } from '@/api/classifyManage';
   import selectUpload from '@/components/selectUpload';
   import upload from '@/components/uploadImg';
   import pickOrder from './components/pickOrder.vue';
@@ -620,6 +625,7 @@
   // import user from '@/api/main/user';
   import { tableHeader } from '../handleTask/components/inoutBound/common';
   import detailSelect from './components/detailSelect';
+  import { approveTaskWithVariables } from '@/api/bpm/task';
   import eom from './components/eom.vue';
 
   import BatchDetail from './components/batchDetail.vue';
@@ -640,6 +646,7 @@
     },
     data() {
       return {
+        isStorage: false,
         infoData: {},
         isTask: false,
         dimension: '3',
@@ -871,7 +878,7 @@
           });
         }
       },
-      handleNewSave(type) {
+      handleNewSave(data) {
         this.$refs.formName.validate(async (valid) => {
           if (valid) {
             if (!this.warehousingMaterialList?.length) {
@@ -894,10 +901,17 @@
             obj.storageSource = 1;
             try {
               const res = await outin.saveNew(obj);
+
               if (res.code == 0) {
-                await outin.outApprove({ outInId: res.data });
-                this.$message.success('保存成功!');
-                this.$emit('success');
+                // await outin.outApprove({ outInId: res.data });
+                // this.$message.success('保存成功!');
+                // this.$emit('success');
+                approveTaskWithVariables(data).then((res) => {
+                  if (res.data.code == 0) {
+                    this.$message.success('保存成功!');
+                    this.$emit('success');
+                  }
+                });
               }
               // this.$router.push('/warehouseManagement/outgoingManagement');
               if (res?.success) {
@@ -925,22 +939,57 @@
       eomSuccess(row) {
         console.log('row--------------------');
         console.log(row);
-        this.formData.extInfo.assetType = row.categoryLevelTopId || '9';
-        this.formData.bizType = '3';
-        this.isTask = true;
-        this.$refs.trees.valueTitle = '产品';
-        this.title = '产品';
-        this.formData.sourceBizNo = row.docNo || row.returnNo;
-        this.formData.sid = row.id;
-        this.formData.fromId = row.id;
-        this.formData.clientName = row.contactName;
-        this.formData.clientUser = row.linkName;
-        this.formData.clientPhone = row.linkPhone;
+        getOutInBySourceBizNoOrError(row.docNo || row.returnNo)
+          .then((data) => {
+            this.isStorage = true; // 已经入库
+            this.formData = deepClone(data);
+            // 填充遍历数据
+            console.log('this.formData-----', this.formData);
+            if (this.formData.outInDetailVOList?.length > 0) {
+              this.warehousingMaterialList = []; // 物品列表
+              this.batchDetailsVOList = []; // 包装列表
+              this.materialCodeReqList = []; // 物料列表
+              this.formData.outInDetailVOList.forEach((goodsiItem) => {
+                goodsiItem.assetName = goodsiItem.name;
+                goodsiItem.assetCode = goodsiItem.categoryCode;
+                goodsiItem.outInNum = goodsiItem.packingCount;
+                this.warehousingMaterialList.push(goodsiItem);
+                goodsiItem.outInDetailRecordVOList.forEach((wrapItem) => {
+                  wrapItem.assetName = goodsiItem.name;
+                  wrapItem.assetCode = goodsiItem.categoryCode;
+                  // wrapItem.count =
+                  //   wrapItem.outInDetailRecordMaterialDetailVOList.length; // 增加包装计量数量
+                  this.batchDetailsVOList.push(wrapItem);
+                  wrapItem.outInDetailRecordMaterialDetailVOList.forEach(
+                    (materialItem) => {
+                      materialItem.isPack = true;
+                      this.materialCodeReqList.push(materialItem);
+                    }
+                  );
+                });
+              });
+            }
+          })
+          .catch(() => {
+            // 未出库
+            this.isStorage = false;
+            this.formData.extInfo.assetType = row.categoryLevelTopId || '9';
+            this.formData.bizType = '3';
+            this.isTask = true;
+            this.$refs.trees.valueTitle = '产品';
+            this.title = '产品';
+            this.formData.sourceBizNo = row.docNo || row.returnNo;
+            this.formData.sid = row.id;
+            this.formData.fromId = row.id;
+            this.formData.clientName = row.contactName;
+            this.formData.clientUser = row.linkName;
+            this.formData.clientPhone = row.linkPhone;
+            this.$forceUpdate();
+          });
         // this.onSelectTableData(row.tableData || row.productList, 1);
         // if (row.productList.length > 0) {
         //   this.$refs.assetsDialogRef.confirm(row.productList, '3');
         // }
-        this.$forceUpdate();
       },
       pickOrderRow(row) {
         this.formData.sid = row.id;

+ 12 - 12
src/views/bpm/stockManagement/add.vue

@@ -2238,18 +2238,18 @@
             obj.storageSource = 1;
             try {
               const res = await outin.save(obj);
-              // if (res.code == 0) {
-              approveTaskWithVariables(data).then((res) => {
-                console.log(res);
-                if (res.data.code == 0) {
-                  this.$message.success('保存成功!');
-                  this.$emit('success');
-                }
-              });
-              //   await outin.outApproves({ outInId: res.data });
-              //   this.$message.success('保存成功!');
-              //   this.$emit('success');
-              // }
+              if (res.code == 0) {
+                approveTaskWithVariables(data).then((res) => {
+                  console.log(res);
+                  if (res.data.code == 0) {
+                    this.$message.success('保存成功!');
+                    this.$emit('success');
+                  }
+                });
+                //   await outin.outApproves({ outInId: res.data });
+                //   this.$message.success('保存成功!');
+                //   this.$emit('success');
+              }
             } catch (error) {
               console.error('保存失败:', error);
             }