|
@@ -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')
|