diff --git a/src/views/oms/EmisBaseTools/GoodsInput.vue b/src/views/oms/EmisBaseTools/GoodsInput.vue index b474982..dbde1ab 100644 --- a/src/views/oms/EmisBaseTools/GoodsInput.vue +++ b/src/views/oms/EmisBaseTools/GoodsInput.vue @@ -24,7 +24,7 @@ - + - - - + + + @@ -59,6 +58,7 @@ import emitter from 'element-ui/src/mixins/emitter'; import { listSimpleEmisGoods} from "@/api/oms/emisGoods"; +import { debounce } from 'throttle-debounce' export default { name: "GoodsInput", @@ -68,14 +68,6 @@ import { listSimpleEmisGoods} from "@/api/oms/emisGoods"; type: String, required: false }, - sideCode: { - type: String, - required: false - }, - postCode:{ - type: String, - required: false - }, placeholder:{ type: String, required: false @@ -96,16 +88,7 @@ import { listSimpleEmisGoods} from "@/api/oms/emisGoods"; total:0, optionItems: [], - // 缺省值 - defaultTotal:0, - defaultItems:null, - svalue: this.value, - slable: null, - - isInputing: false, - - isInit:true, queryParams:{ pageNum:1, @@ -117,10 +100,7 @@ import { listSimpleEmisGoods} from "@/api/oms/emisGoods"; }, watch: { value(newVal,oldVal) { - if(this.value!=null && this.isInit){ - this.svalue=this.value; - this.queryData(null,this.svalue); - } + this.svalue=this.value; }, }, @@ -129,38 +109,17 @@ import { listSimpleEmisGoods} from "@/api/oms/emisGoods"; this.createdId = String(new Date().getTime()) }, created() { - if(this.value!=null && this.isInit){ - this.svalue=this.value; - this.queryData(null,this.svalue); - } + this.svalue=this.value; }, methods: { - onClick(){ - this.isInit=false; - // 第一次点击时需要初始化 - if(!this.defaultItems){ - this.queryParams.pageNum=1; - this.queryData(null,null); - }else{ - this.total = this.defaultTotal; - this.optionItems = [...this.defaultItems]; - } - // this.$refs.popoverRef.doShow(); - }, onInput(val) { - if(val == null ) return; - - this.isInputing = true; - this.slable = val; + this.svalue = val; this.queryParams.pageNum = 1 - this.queryData(val,null) - + this.queryParams.goodsName=val; + debounce(250, this.queryData() ); }, onRowClick(row, column, event) { this.svalue=row.goodsName; - this.slable=row.goodsName; - - this.isInputing = false; this.$emit("input", this.svalue); this.$emit("onChange",row); @@ -175,18 +134,12 @@ import { listSimpleEmisGoods} from "@/api/oms/emisGoods"; } }, onClear(el){ - this.slable = null; this.svalue = null; this.$emit("input", this.svalue); this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); }, onBlur(el) { - // 如果编辑没有选择则清关历史记录 - if( this.isInputing ){ - this.svalue = null; - this.slable = null; - } this.$emit("input", this.svalue); this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); }, @@ -194,9 +147,8 @@ import { listSimpleEmisGoods} from "@/api/oms/emisGoods"; this.queryParams.pageNum = cur this.queryData() }, - queryData(val,key) { + queryData() { this.loading = true; - this.queryParams.goodsName = val; listSimpleEmisGoods(this.queryParams).then(response => { this.loading = false; diff --git a/src/views/oms/dashboard.vue b/src/views/oms/dashboard.vue index b0c84bc..fbf80b4 100644 --- a/src/views/oms/dashboard.vue +++ b/src/views/oms/dashboard.vue @@ -127,10 +127,25 @@