|
|
@@ -183,12 +183,13 @@
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="标签:" >
|
|
|
- <el-select v-model="form.tag" style="width: 100%" placeholder="请选择标签" size="small" multiple class="inline-16">
|
|
|
+ <el-select v-model="tags" style="width: 100%" placeholder="请选择标签" size="small" multiple class="inline-16" @remove-tag="onClear">
|
|
|
<el-option
|
|
|
v-for="item in tagList"
|
|
|
:key="item.index"
|
|
|
:label="item.tag"
|
|
|
- :value="item.tag">
|
|
|
+ :value="item.tag"
|
|
|
+ :disabled="hasDisabledTag(item)">
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
@@ -403,6 +404,7 @@ export default {
|
|
|
this.getTag()
|
|
|
this.form = Object.assign({},this.form,this.data)
|
|
|
this.form.ownerid = this.$route.query.id
|
|
|
+ this.tags = this.form.tag
|
|
|
if ((this.form.phonenumber.indexOf('-')) != '-1'){
|
|
|
this.form.isTelephone = '1'
|
|
|
this.form.areaCode = this.data.phonenumber.substring(0,this.form.phonenumber.indexOf('-'))
|
|
|
@@ -418,6 +420,7 @@ export default {
|
|
|
if (this.form.isTelephone == '1'){
|
|
|
this.form.phonenumber = this.form.areaCode + "-" + this.form.telephone
|
|
|
}
|
|
|
+ this.form.tag = this.tags
|
|
|
const res = await this.$api.requested({
|
|
|
"id": "20221018141802",
|
|
|
"content": this.form
|
|
|
@@ -516,7 +519,27 @@ export default {
|
|
|
this.paramTag.content.ownertable = 'plm_unit'
|
|
|
const res = await this.$api.requested(this.paramTag)
|
|
|
this.tagList = res.data.option
|
|
|
- console.log(this.tagList,'111标签')
|
|
|
+ },
|
|
|
+ hasDisabledTag (item) {
|
|
|
+ let arr = []
|
|
|
+ let arr2 = []
|
|
|
+ arr = this.tagList.filter(item=>{
|
|
|
+ return this.tags.includes(item.tag)
|
|
|
+ })
|
|
|
+ arr.forEach(e=>{
|
|
|
+ arr2 = arr2.concat(e.mutextag)
|
|
|
+ })
|
|
|
+ arr2 = this.tags.length === 0?[]:arr2
|
|
|
+ let _isSame = arr2.some(tag=>item.tag === tag)
|
|
|
+ return _isSame
|
|
|
+ },
|
|
|
+ onClear(row){
|
|
|
+ for(var i=0;i<this.tags.length;i++){
|
|
|
+ if (this.tags[i] === row){
|
|
|
+ this.tags.splice(i,1)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|