Browse Source

feat(supplier): 添加planner字段验证和文档清单模板默认选中功能

- 为planner字段添加必填验证规则
- 在供应商表单中新增planner字段的prop绑定
- 实现新增弹窗时供应商文档清单模板默认选中第一条的功能
- 优化供应商文档清单模板的数据加载逻辑
master
qiankanghui 2 weeks ago
parent
commit
0095389caf
  1. 9
      src/views/modules/srmSupplier/supplierList.vue

9
src/views/modules/srmSupplier/supplierList.vue

@ -234,7 +234,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item>
<el-form-item prop="planner">
<span style="cursor: pointer" slot="label" @click="getBaseList(530, 'planner')"><a href="#">Planner</a></span> <span style="cursor: pointer" slot="label" @click="getBaseList(530, 'planner')"><a href="#">Planner</a></span>
<el-input v-model="currentSupplier.planner" readonly style="width: 130px"></el-input> <el-input v-model="currentSupplier.planner" readonly style="width: 130px"></el-input>
</el-form-item> </el-form-item>
@ -1320,6 +1320,9 @@ export default {
], ],
supplierDocType: [ supplierDocType: [
{ required: true, message: '请选择供应商文档清单模板', trigger: ['blur', 'change'] } { required: true, message: '请选择供应商文档清单模板', trigger: ['blur', 'change'] }
],
planner: [
{ required: true, message: '请选择Planner', trigger: ['blur', 'change'] }
] ]
} }
} }
@ -1501,6 +1504,10 @@ export default {
if (currentType && this.supplierDocTypeOptions.indexOf(currentType) === -1) { if (currentType && this.supplierDocTypeOptions.indexOf(currentType) === -1) {
this.supplierDocTypeOptions.unshift(currentType) this.supplierDocTypeOptions.unshift(currentType)
} }
// 新增弹窗打开时,供应商文档清单模板默认选中第一条
if (this.isAdd && !this.currentSupplier.supplierDocType && this.supplierDocTypeOptions.length > 0) {
this.currentSupplier.supplierDocType = this.supplierDocTypeOptions[0]
}
} else { } else {
this.supplierDocTypeOptions = [] this.supplierDocTypeOptions = []
this.$message.error((data && data.msg) || '加载供应商文档清单失败') this.$message.error((data && data.msg) || '加载供应商文档清单失败')

Loading…
Cancel
Save