|
@@ -224,17 +224,25 @@ export default {
|
|
|
//此方法是同步选择
|
|
|
this.$set(this.info, type, val);
|
|
|
},
|
|
|
- listChange({ val, type }) {
|
|
|
+ async listChange({ val, type }) {
|
|
|
//此方法是更换子列表的
|
|
|
- if (val === '220000') {
|
|
|
- this.$set(this, `cityList`, this.secondList);
|
|
|
- } else if (val === '210000') {
|
|
|
- this.$set(this, `cityList`, this.secondList1);
|
|
|
+ if (type === 'city') {
|
|
|
+ this.getCityList(val);
|
|
|
} else if (type === 'zy_req') {
|
|
|
//专业查询模拟
|
|
|
this.$set(this, `subjectSubList`, val === '1' ? this.subjectSub : this.subjectSub2);
|
|
|
}
|
|
|
},
|
|
|
+ async getCityList(parent) {
|
|
|
+ let result = await this.dicOperation({ level: 2, parent: parent });
|
|
|
+ if (`${result.errcode}` === `0`) {
|
|
|
+ let res = result.data.map(item => {
|
|
|
+ let object = { label: item.name, value: item.code };
|
|
|
+ return object;
|
|
|
+ });
|
|
|
+ this.$set(this, `cityList`, res);
|
|
|
+ }
|
|
|
+ },
|
|
|
async toSubmit() {
|
|
|
let result;
|
|
|
let infos = JSON.parse(JSON.stringify(this.info));
|
|
@@ -355,7 +363,6 @@ export default {
|
|
|
if (`${result.errcode}` === '0') {
|
|
|
var enticeNew = result.data.map(item => ({ value: item.code, label: item.name }));
|
|
|
this.$set(this, `entice_list`, enticeNew);
|
|
|
- console.log(enticeNew);
|
|
|
} else {
|
|
|
this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
}
|
|
@@ -365,6 +372,14 @@ export default {
|
|
|
} else {
|
|
|
this.$message.error(result.errmsg ? result.errmsg : 'error');
|
|
|
}
|
|
|
+ result = await this.dicOperation({ level: 1 });
|
|
|
+ if (`${result.errcode}` === `0`) {
|
|
|
+ let res = result.data.map(item => {
|
|
|
+ let object = { label: item.name, value: item.code };
|
|
|
+ return object;
|
|
|
+ });
|
|
|
+ this.$set(this, `provinceList`, res);
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|