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

传值登录人id;销售退货审批不显示是否质检;

yijing 1 год назад
Родитель
Сommit
94ce957c02
2 измененных файлов с 19 добавлено и 29 удалено
  1. 17 28
      src/views/bpm/outgoingManagement/outbound.vue
  2. 2 1
      src/views/bpm/stockManagement/storage.vue

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

@@ -63,7 +63,7 @@
           <el-col :span="6">
           <el-col :span="6">
             <el-form-item :label="this.bizType == 10 ? '申请人部门' : '领料人部门'" prop="extInfo.verifyDeptCode">
             <el-form-item :label="this.bizType == 10 ? '申请人部门' : '领料人部门'" prop="extInfo.verifyDeptCode">
               <selectTree ref="tree" class="form-ipt" size="medium" style="width: 100%" clearable
               <selectTree ref="tree" class="form-ipt" size="medium" style="width: 100%" clearable
-                v-model="formData.extInfo.verifyDeptCode" :options="treeList" :props="{
+                :value="formData.extInfo.verifyDeptCode" :options="treeList" :props="{
                   value: 'id',
                   value: 'id',
                   label: 'name',
                   label: 'name',
                   children: 'children'
                   children: 'children'
@@ -344,10 +344,10 @@ export default {
           message: '请选择出库场景',
           message: '请选择出库场景',
           trigger: 'change'
           trigger: 'change'
         },
         },
-        'extInfo.verifyDeptCode': {
+        'extInfo[verifyDeptCode]': {
           required: true,
           required: true,
-          message: '请选择部门',
-          trigger: 'change'
+          message: '请选择领料人部门',
+          trigger: ['change', 'blur']
         },
         },
         fromId: {
         fromId: {
           required: true,
           required: true,
@@ -364,7 +364,8 @@ export default {
       return this.$store.state.user.info.clientEnvironmentId;
       return this.$store.state.user.info.clientEnvironmentId;
     }
     }
   },
   },
-  created() {
+  async created() {
+
     this.getFieldModel();
     this.getFieldModel();
     this.getListItems();
     this.getListItems();
     this.initDeptData().then(() => {
     this.initDeptData().then(() => {
@@ -627,32 +628,20 @@ export default {
       // 将出库状态改成出库状态 2出库 1入库
       // 将出库状态改成出库状态 2出库 1入库
       this.formData.type = 2;
       this.formData.type = 2;
       // 入库登记人
       // 入库登记人
+      this.formData.extInfo.createUserId = this.$store.state.user.info.userId;
       this.formData.extInfo.createUserName = this.$store.state.user.info.name;
       this.formData.extInfo.createUserName = this.$store.state.user.info.name;
       this.formData.createUserId = this.$store.state.user.info.userId;
       this.formData.createUserId = this.$store.state.user.info.userId;
 
 
-      await this.initDeptData();
-
-      // 获取部门信息
-      warehouseDefinition.getGroupById(this.form.makerId).then((res) => {
-        if (res && res.groupId) {
-          this.formData.extInfo.verifyDeptCode = res.groupId;
-          this.formData.extInfo.verifyDeptName = res.groupName;
-          // 手动触发 selectTree 更新
-          this.$nextTick(() => {
-            if (this.$refs.tree) {
-              this.$refs.tree.initHandle();
-            }
-          });
-          // 手动触发验证更新
-          this.$nextTick(() => {
-            this.$refs.formName.validateField('extInfo.verifyDeptCode');
-          });
-        } else {
-          console.error('部门信息获取失败:', res);
-        }
-      }).catch(err => {
-        console.error('获取部门信息出错:', err);
-      });
+      await this.initDeptData(); // 确保部门树加载
+      if (this.form.makerId) {
+        warehouseDefinition.getGroupById(this.form.makerId).then((res) => {
+          console.log(res, 'res.groupId')
+          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')

+ 2 - 1
src/views/bpm/stockManagement/storage.vue

@@ -411,7 +411,7 @@
             </template>
             </template>
           </el-table-column>
           </el-table-column>
           <el-table-column label="是否质检" align="center" width="80" prop="qualityControl" :show-overflow-tooltip="true"
           <el-table-column label="是否质检" align="center" width="80" prop="qualityControl" :show-overflow-tooltip="true"
-            v-if="this.bizType != 1">
+            v-if="this.bizType != 1 || this.bizType != 6">
             <template slot-scope="{ row, $index }">
             <template slot-scope="{ row, $index }">
               {{ row.qualityControl == 1 ? '是' : row.qualityControl == 0 ? '否' : '' }}
               {{ row.qualityControl == 1 ? '是' : row.qualityControl == 0 ? '否' : '' }}
             </template>
             </template>
@@ -829,6 +829,7 @@ export default {
       }
       }
 
 
       // 入库登记人
       // 入库登记人
+      this.formData.extInfo.createUserId = this.$store.state.user.info.userId;
       this.formData.extInfo.createUserName = this.$store.state.user.info.name;
       this.formData.extInfo.createUserName = this.$store.state.user.info.name;
       this.formData.extInfo.deliveryPhone = this.$store.state.user.info.phone;
       this.formData.extInfo.deliveryPhone = this.$store.state.user.info.phone;
       this.formData.createUserId = this.$store.state.user.info.userId;
       this.formData.createUserId = this.$store.state.user.info.userId;