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"
|
||||
@blur="onBlur"
|
||||
@change="onChange"
|
||||
@click.native="onClick"
|
||||
@visible-change="reverseArrow"
|
||||
|
||||
>
|
||||
@ -60,6 +61,7 @@
|
||||
data() {
|
||||
return {
|
||||
optionItems: [],
|
||||
defaultItems:null,
|
||||
svalue: this.value,
|
||||
filterMap:new Map(),
|
||||
queryParams: {
|
||||
@ -76,12 +78,15 @@
|
||||
value(newVal) {
|
||||
this.svalue = newVal;
|
||||
this.queryParams.lineCode=this.svalue ;
|
||||
this.queryData(null,this.svalue);
|
||||
},
|
||||
countryCode(newVal) {
|
||||
this.defaultItems=null;
|
||||
this.queryParams.country=this.countryCode;
|
||||
this.queryData();
|
||||
},
|
||||
fromCountry(newVal) {
|
||||
this.defaultItems=null;
|
||||
this.queryParams.fromCountry=this.fromCountry;
|
||||
this.queryData();
|
||||
},
|
||||
@ -97,6 +102,14 @@
|
||||
rulesDom.classList.add("el-icon-arrow-up"); // 对dom新增class
|
||||
},
|
||||
methods: {
|
||||
onClick(){
|
||||
// 第一次点击时需要初始化
|
||||
if(!this.defaultItems){
|
||||
this.queryData(null,null);
|
||||
}else{
|
||||
this.optionItems = [...this.defaultItems];
|
||||
}
|
||||
},
|
||||
onFocus(val){
|
||||
this.optionItems=[];
|
||||
this.queryData();
|
||||
@ -110,13 +123,21 @@
|
||||
this.$emit("onChange",this.filterMap[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;
|
||||
listSimpleAllEmisTransLine( this.queryParams).then(response => {
|
||||
this.optionItems = response.rows;
|
||||
this.optionItems.forEach(item => {
|
||||
this.filterMap[item.lineCode]=item;
|
||||
});
|
||||
//初始值存储
|
||||
if(key==null && val==null){
|
||||
this.defaultItems=[...this.optionItems];
|
||||
}else{
|
||||
this.onChange();
|
||||
}
|
||||
});
|
||||
},
|
||||
reverseArrow(flag) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user