|
@@ -11,10 +11,11 @@
|
|
|
label="选择归属:"
|
|
|
prop="region1"
|
|
|
>
|
|
|
+ <span class="changeTips">改变归属后,标签明细将会恢复到默认状态</span>
|
|
|
<el-select
|
|
|
v-model="form.region1"
|
|
|
placeholder="请选择归属"
|
|
|
- @change="sendData"
|
|
|
+ @change="(e)=>readyChangeSelect(e,1)"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in Adscriptions"
|
|
@@ -28,10 +29,11 @@
|
|
|
label="选择填写单类型:"
|
|
|
prop="region2"
|
|
|
>
|
|
|
+ <span class="changeTips">改变类型后,标签明细将会恢复到默认状态</span>
|
|
|
<el-select
|
|
|
v-model="form.region2"
|
|
|
placeholder="请选择填写单类型"
|
|
|
- @change="changeType"
|
|
|
+ @change="(e)=>readyChangeSelect(e,2)"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in labelTypes"
|
|
@@ -96,9 +98,10 @@
|
|
|
label="性别:"
|
|
|
prop="region7"
|
|
|
>
|
|
|
+ <span class="changeTips">改变性别后,标签明细将会恢复到默认状态</span>
|
|
|
<el-select
|
|
|
v-model="form.region7"
|
|
|
- @change="readyChangeSex"
|
|
|
+ @change="(e)=>readyChangeSelect(e,3)"
|
|
|
>
|
|
|
<el-option
|
|
|
label="通用"
|
|
@@ -213,6 +216,8 @@ export default {
|
|
|
],
|
|
|
},
|
|
|
tmpSex: '通用',
|
|
|
+ tmpOwn: '',
|
|
|
+ tmpType: '',
|
|
|
Adscriptions: [],
|
|
|
labelTypes: [],
|
|
|
labelTypesList: [],
|
|
@@ -242,11 +247,13 @@ export default {
|
|
|
this.tmpSex = prevVal;
|
|
|
},
|
|
|
newType(nextVal, prevVal) {
|
|
|
+ this.tmpOwn = prevVal;
|
|
|
if (nextVal != prevVal) {
|
|
|
this.searchTagList()
|
|
|
}
|
|
|
},
|
|
|
newSign(nextVal, prevVal) {
|
|
|
+ this.tmpType = prevVal;
|
|
|
if (nextVal != prevVal && JSON.stringify(this.form.tagPool) != '[]' ) {
|
|
|
this.searchTagList()
|
|
|
}
|
|
@@ -264,11 +271,12 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
searchTagList() {
|
|
|
- let region1 = this.form.region1,region2 = this.form.region2;
|
|
|
+ let region1 = this.form.region1, region2 = this.form.region2;
|
|
|
let param = {
|
|
|
"type": region1,
|
|
|
- // "tagType": region2 == 2?[1]:[],
|
|
|
+ "tagType": region2 == 2?[1]:(region2 == 6?[1,2,3,4,10]:[]),
|
|
|
"controlType":region2 == 2?[1,2]:[],
|
|
|
+ "sexType": this.form.region7,
|
|
|
}
|
|
|
api.searchTagList(param).then((res) => {
|
|
|
if (res.data.code === '0') {
|
|
@@ -299,36 +307,51 @@ export default {
|
|
|
this.$emit('changeVal', this.form, false)
|
|
|
this.$emit('changeType', type, false)
|
|
|
},
|
|
|
- changeSex(sex) { //改变性别清空数据
|
|
|
- this.form = {
|
|
|
- region1: '',
|
|
|
- region2: '',
|
|
|
- region3: '',
|
|
|
- region4: '',
|
|
|
- region5: '',
|
|
|
- region6: '1',
|
|
|
- region7: sex,
|
|
|
- region8: '0',
|
|
|
- region9: '200',
|
|
|
- region10: '0',
|
|
|
- region11: '1',
|
|
|
- tagPool:[]
|
|
|
- }
|
|
|
+ changeSex(data) { //改变性别清空数据
|
|
|
this.$emit('changeVal', this.form, false)
|
|
|
- this.$emit('changeSex', sex, false)
|
|
|
+ this.$emit('changeSex', data, false)
|
|
|
+ this.searchTagList()
|
|
|
},
|
|
|
- readyChangeSex(data) {
|
|
|
- let sex = data;
|
|
|
- this.$confirm('改变性别后,所填信息将会回复到默认状态?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- cancelButtonClass: 'cancelColor',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.changeSex(sex);
|
|
|
- }).catch(() => {
|
|
|
- this.form.region7 = this.tmpSex;
|
|
|
- });
|
|
|
+ readyChangeSelect(tmpData,type) {
|
|
|
+ console.log(tmpData)
|
|
|
+ this.changeSex(tmpData);
|
|
|
+ // if(type == 3){
|
|
|
+ // this.form.region7 = this.tmpSex;
|
|
|
+ // this.$alert('改变性别后,标签明细将会恢复到默认状态?', '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonClass: 'cancelColor',
|
|
|
+ // type: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // this.form.region7 = tmpData
|
|
|
+ // this.changeSex(tmpData);
|
|
|
+ // }).catch(() => {
|
|
|
+ // // this.form.region7 = this.tmpSex;
|
|
|
+ // });
|
|
|
+ // }else if(type == 2){
|
|
|
+ // this.form.region2 = this.tmpType
|
|
|
+ // this.$alert('改变类型后,标签明细将会恢复到默认状态?', '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonClass: 'cancelColor',
|
|
|
+ // type: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // this.form.region2 = tmpData;
|
|
|
+ // this.changeSex(tmpData);
|
|
|
+ // }).catch(() => {
|
|
|
+ // // this.form.region2 = this.tmpType;
|
|
|
+ // });
|
|
|
+ // }else if(type == 1){
|
|
|
+ // this.form.region1 = this.tmpOwn;
|
|
|
+ // this.$alert('改变归属后,标签明细将会恢复到默认状态?', '提示', {
|
|
|
+ // confirmButtonText: '确定',
|
|
|
+ // cancelButtonClass: 'cancelColor',
|
|
|
+ // type: 'warning'
|
|
|
+ // }).then(() => {
|
|
|
+ // this.form.region1 = tmpData;
|
|
|
+ // this.changeSex(tmpData);
|
|
|
+ // }).catch(() => {
|
|
|
+ // // this.form.region1 = this.tmpOwn;
|
|
|
+ // });
|
|
|
+ // }
|
|
|
},
|
|
|
submitForm(formName) {
|
|
|
this.$refs[formName].validate((valid) => {
|
|
@@ -339,7 +362,14 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
- }
|
|
|
+ },
|
|
|
+ warning(msg, type) {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: msg,
|
|
|
+ type: type || 'warning'
|
|
|
+ })
|
|
|
+ },
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -393,6 +423,13 @@ export default {
|
|
|
.cancelColor {
|
|
|
color: #22ccc8 !important;
|
|
|
}
|
|
|
+ .changeTips {
|
|
|
+ position: absolute;
|
|
|
+ left: 220px;
|
|
|
+ min-width: 300px;
|
|
|
+ color: #ea7777;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|
|
|
|