Merge pull request '组批次规则维护,复制弹窗路线显示代码问题' (#21) from master-模板替换 into master
Reviewed-on: http://git.xdadan.loc/tanex/emis-frontend/pulls/21
This commit is contained in:
commit
420710eaf1
@ -14,6 +14,7 @@
|
|||||||
@focus="onFocus"
|
@focus="onFocus"
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
|
@click.native="onClick"
|
||||||
@visible-change="reverseArrow"
|
@visible-change="reverseArrow"
|
||||||
|
|
||||||
>
|
>
|
||||||
@ -60,6 +61,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
optionItems: [],
|
optionItems: [],
|
||||||
|
defaultItems:null,
|
||||||
svalue: this.value,
|
svalue: this.value,
|
||||||
filterMap:new Map(),
|
filterMap:new Map(),
|
||||||
queryParams: {
|
queryParams: {
|
||||||
@ -76,12 +78,15 @@
|
|||||||
value(newVal) {
|
value(newVal) {
|
||||||
this.svalue = newVal;
|
this.svalue = newVal;
|
||||||
this.queryParams.lineCode=this.svalue ;
|
this.queryParams.lineCode=this.svalue ;
|
||||||
|
this.queryData(null,this.svalue);
|
||||||
},
|
},
|
||||||
countryCode(newVal) {
|
countryCode(newVal) {
|
||||||
|
this.defaultItems=null;
|
||||||
this.queryParams.country=this.countryCode;
|
this.queryParams.country=this.countryCode;
|
||||||
this.queryData();
|
this.queryData();
|
||||||
},
|
},
|
||||||
fromCountry(newVal) {
|
fromCountry(newVal) {
|
||||||
|
this.defaultItems=null;
|
||||||
this.queryParams.fromCountry=this.fromCountry;
|
this.queryParams.fromCountry=this.fromCountry;
|
||||||
this.queryData();
|
this.queryData();
|
||||||
},
|
},
|
||||||
@ -97,6 +102,14 @@
|
|||||||
rulesDom.classList.add("el-icon-arrow-up"); // 对dom新增class
|
rulesDom.classList.add("el-icon-arrow-up"); // 对dom新增class
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onClick(){
|
||||||
|
// 第一次点击时需要初始化
|
||||||
|
if(!this.defaultItems){
|
||||||
|
this.queryData(null,null);
|
||||||
|
}else{
|
||||||
|
this.optionItems = [...this.defaultItems];
|
||||||
|
}
|
||||||
|
},
|
||||||
onFocus(val){
|
onFocus(val){
|
||||||
this.optionItems=[];
|
this.optionItems=[];
|
||||||
this.queryData();
|
this.queryData();
|
||||||
@ -110,13 +123,21 @@
|
|||||||
this.$emit("onChange",this.filterMap[this.svalue]);
|
this.$emit("onChange",this.filterMap[this.svalue]);
|
||||||
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]);
|
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]);
|
||||||
},
|
},
|
||||||
queryData(val) {
|
queryData(val,key) {
|
||||||
|
this.optionItems=[];
|
||||||
|
this.queryParams.lineCode=key;
|
||||||
this.queryParams.lineName=val;
|
this.queryParams.lineName=val;
|
||||||
listSimpleAllEmisTransLine( this.queryParams).then(response => {
|
listSimpleAllEmisTransLine( this.queryParams).then(response => {
|
||||||
this.optionItems = response.rows;
|
this.optionItems = response.rows;
|
||||||
this.optionItems.forEach(item => {
|
this.optionItems.forEach(item => {
|
||||||
this.filterMap[item.lineCode]=item;
|
this.filterMap[item.lineCode]=item;
|
||||||
});
|
});
|
||||||
|
//初始值存储
|
||||||
|
if(key==null && val==null){
|
||||||
|
this.defaultItems=[...this.optionItems];
|
||||||
|
}else{
|
||||||
|
this.onChange();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reverseArrow(flag) {
|
reverseArrow(flag) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user