项目关键人员新增资格证书下拉选功能优化
This commit is contained in:
parent
47ebe7c7af
commit
d42c728470
|
|
@ -165,6 +165,7 @@
|
||||||
v-model="item.diploma"
|
v-model="item.diploma"
|
||||||
placeholder="请选择资格证书"
|
placeholder="请选择资格证书"
|
||||||
@change="onDiplomaChange($event, index)"
|
@change="onDiplomaChange($event, index)"
|
||||||
|
@blur="onDiplomaBlur($event, index)"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="j in item.diplomaList"
|
v-for="j in item.diplomaList"
|
||||||
|
|
@ -663,10 +664,7 @@ export default {
|
||||||
diplomaNum: '',
|
diplomaNum: '',
|
||||||
level: '',
|
level: '',
|
||||||
diplomaImg: [],
|
diplomaImg: [],
|
||||||
diplomaList: [
|
diplomaList: this.diplomaList,
|
||||||
{ name: '注册建造师', value: '注册建造师' },
|
|
||||||
{ name: '项目经理B证', value: '项目经理B证' },
|
|
||||||
],
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 删除资格证书
|
// 删除资格证书
|
||||||
|
|
@ -685,6 +683,19 @@ export default {
|
||||||
this.addAndEditForm.certificateList[index].diplomaList.push({ name: value })
|
this.addAndEditForm.certificateList[index].diplomaList.push({ name: value })
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 资格证书失去焦点
|
||||||
|
onDiplomaBlur(event, index) {
|
||||||
|
console.log(event, index)
|
||||||
|
if (!event.target.value) return
|
||||||
|
const isRepeat = this.addAndEditForm.certificateList[index].diplomaList.some(
|
||||||
|
(item) => item.name === event.target.value,
|
||||||
|
)
|
||||||
|
if (!isRepeat) {
|
||||||
|
this.addAndEditForm.certificateList[index].diplomaList.push({ name: event.target.value })
|
||||||
|
this.addAndEditForm.certificateList[index].diploma = event.target.value
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
editRow: {
|
editRow: {
|
||||||
|
|
@ -694,12 +705,9 @@ export default {
|
||||||
|
|
||||||
if (this.addAndEditForm.certificateList.length > 0) {
|
if (this.addAndEditForm.certificateList.length > 0) {
|
||||||
this.addAndEditForm.certificateList.forEach((item, index) => {
|
this.addAndEditForm.certificateList.forEach((item, index) => {
|
||||||
this.$set(this.addAndEditForm.certificateList[index], 'diplomaList', [
|
this.$set(this.addAndEditForm.certificateList[index], 'diplomaList', this.diplomaList)
|
||||||
{ name: '注册建造师', value: '注册建造师' },
|
|
||||||
{ name: '项目经理B证', value: '项目经理B证' },
|
|
||||||
])
|
|
||||||
|
|
||||||
if (!['注册建造师', '项目经理B证'].includes(item.diploma)) {
|
if (!this.diplomaList.includes(item.diploma)) {
|
||||||
this.addAndEditForm.certificateList[index].diplomaList.push({
|
this.addAndEditForm.certificateList[index].diplomaList.push({
|
||||||
name: item.diploma,
|
name: item.diploma,
|
||||||
value: item.diploma,
|
value: item.diploma,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue