yijing пре 1 година
родитељ
комит
a50d9aff31
1 измењених фајлова са 18 додато и 17 уклоњено
  1. 18 17
      src/views/bpm/outgoingManagement/outbound.vue

+ 18 - 17
src/views/bpm/outgoingManagement/outbound.vue

@@ -641,16 +641,6 @@ export default {
 
 
         });
         });
       }
       }
-      if (this.form.createUserId) {
-        this.formData.fromId = this.form.createUserId;
-        warehouseDefinition.getGroupById(this.form.createUserId).then((res) => {
-          console.log(res, 'createUserId')
-          this.$set(this.formData, 'fromUser', res.name);
-          this.$set(this.formData.extInfo, 'verifyDeptCode', res.groupId);
-          this.$set(this.formData.extInfo, 'verifyDeptName', res.groupName);
-        });
-      }
-
 
 
       // 生产相关逻辑
       // 生产相关逻辑
       console.log(this.detailList, 'this.detailList')
       console.log(this.detailList, 'this.detailList')
@@ -660,13 +650,24 @@ export default {
 
 
       if (this.detailList?.length > 0) {
       if (this.detailList?.length > 0) {
         // 获取领料人列表
         // 获取领料人列表
-        this.getStaffList({ id: this.form.executorDeptId }).then(() => {
-          // 获取领料人和领料部门
-          this.formData.fromId = this.form.executorId;
-          this.formData.fromUser = this.form.executorName;
-          this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
-          this.formData.extInfo.verifyDeptName = this.form.executorDeptName;
-        });
+        
+        if (this.form.executorDeptId) {
+          this.getStaffList({ id: this.form.executorDeptId }).then(() => {
+            // 获取领料人和领料部门
+            this.formData.fromId = this.form.executorId;
+            this.formData.fromUser = this.form.executorName;
+            this.formData.extInfo.verifyDeptCode = this.form.executorDeptId;
+            this.formData.extInfo.verifyDeptName = this.form.executorDeptName;
+          });
+        } else {
+          this.formData.fromId = this.form.createUserId;
+          warehouseDefinition.getGroupById(this.form.createUserId).then((res) => {
+            console.log(res, 'form没有executorDeptId有createUserId')
+            this.$set(this.formData, 'fromUser', res.name);
+            this.$set(this.formData.extInfo, 'verifyDeptCode', res.groupId);
+            this.$set(this.formData.extInfo, 'verifyDeptName', res.groupName);
+          });
+        }
         let pData = {
         let pData = {
           type: '1',
           type: '1',
           builders: this.detailList.map((item) => {
           builders: this.detailList.map((item) => {