diff --git a/src/components/XdTable/index.vue b/src/components/XdTable/index.vue index 074b86c8..257ed8b7 100644 --- a/src/components/XdTable/index.vue +++ b/src/components/XdTable/index.vue @@ -41,15 +41,16 @@
重置
-
+ ghostClass="drag-ghost" + chosenClass="drag-chosen" + :animation="500" + handle=".el-icon-s-operation" + @end="updateTable" + > +
- {{ clo.label }} + {{ col.label }} +
- + i18n.t(triggerTrans(key,i18n.locale), value) +// Vue.prototype._ = _ + // vue 页面捕获 // const __patch__ = Vue.prototype.__patch__; // Vue.prototype.__patch__ = function() { diff --git a/src/views/emis/EmisBaseTools/CityPicker.vue b/src/views/emis/EmisBaseTools/CityPicker.vue index b14d8e97..6a6aeaac 100644 --- a/src/views/emis/EmisBaseTools/CityPicker.vue +++ b/src/views/emis/EmisBaseTools/CityPicker.vue @@ -5,7 +5,9 @@ clearable v-model="svalue" :placeholder="placeholder" - @change="onChange"> + @change="onChange" + @click.native="onClick" + > @@ -16,7 +18,7 @@ name: "CityPicker", props: { value: { - type: [String, Number], + type: String, required: false }, parentCode: { @@ -27,50 +29,66 @@ type: String, required: false }, - isInitiated:{ - type: [Boolean,String], - required: false, - default:false - } }, data() { return { - optionItems: [], svalue: this.value, + optionItems: [], + // 缺省值 + defaultItems: null, }; }, watch: { - value(newVal) { - this.svalue = newVal; + value(newVal,oldVal) { + if(this.value!=null){ + this.svalue=this.value; + // 判断默认值中是否存在,若存在则不继续查询 + if(this.optionItems){ + let selItem = this.optionItems.find(item => item.regionCode == this.svalue); + if(selItem){ + return; + } + } + this.queryData(null,this.svalue); + } }, - svalue(newVal, oldVal) { - // this.$emit("input", this.svalue); - }, - parentCode(newVal) { - this.queryData(); + parentCode(newVal,oldVal) { + if(newVal!=oldVal){ + this.defaultItems=null; + } } }, created() { - if(this.isInitiated || this.svalue!=null){ - this.queryData(); + if(this.svalue!=null){ + this.queryData(null,this.svalue); } }, methods: { + onClick(){ + // 第一次点击时需要初始化 + if(!this.defaultItems){ + this.queryData(null,null); + }else{ + this.optionItems = [...this.defaultItems]; + } + }, onChange() { this.$emit("input", this.svalue); this.$emit("onChange"); }, - queryData() { - + queryData(val,key) { this.optionItems =[]; - - if(this.parentCode==null){ - return; - } - - let queryParams = {parentCode:this.parentCode,regionType:2}; + let queryParams = { + parentCode:this.parentCode, + regionCode:key, + regionType:2 + }; listSimpleEmisRegion(queryParams).then(response => { this.optionItems = response.rows; + // 初始值存储 + if(key==null && val==null){ + this.defaultItems=[...this.optionItems] + } }); }, diff --git a/src/views/emis/EmisBaseTools/CountryPicker.vue b/src/views/emis/EmisBaseTools/CountryPicker.vue index 8d41e706..d1630659 100644 --- a/src/views/emis/EmisBaseTools/CountryPicker.vue +++ b/src/views/emis/EmisBaseTools/CountryPicker.vue @@ -8,9 +8,12 @@ :remote-method="queryData" v-model="svalue" :placeholder="placeholder" + + no-data-text="" + @blur="onBlur" @change="onChange" - @focus="onFocus" + @click.native="onClick" @visible-change="reverseArrow" > @@ -35,57 +38,66 @@ }, data() { return { - optionItems: [], svalue: this.value, - countryCode:null, - countryMap:new Map(), + optionItems: [], + + // 缺省值 + defaultItems: null, + countryMap:new Map() }; }, watch: { - value(newVal) { - this.svalue = newVal; - if(this.svalue!=null) { - this.countryCode=this.svalue; + value(newVal,oldVal) { + // 逻辑 有初始值先查询初值 + if(this.value!=null){ + this.svalue=this.value; + this.queryData(null,this.svalue); } }, }, created() { - this.queryData(); + if(this.svalue!=null){ + this.queryData(null,this.svalue); + } }, mounted(){ let rulesDom = this.$refs["selectRef"].$el.querySelector(".el-input .el-input__suffix .el-input__suffix-inner .el-input__icon"); // 找到dom     rulesDom.classList.add("el-icon-arrow-up"); // 对dom新增class }, methods: { - onFocus(){ - this.countryCode=null; - this.queryData(); + onClick(){ + // 第一次点击时需要初始化 + if(!this.defaultItems){ + this.queryData(null,null); + }else{ + this.optionItems = [...this.defaultItems]; + } }, onBlur(val){ this.$emit("input", this.svalue); this.dispatch('ElFormItem', 'el.form.blur'); }, onChange() { - if(this.svalue!=null){ this.$emit("input", this.svalue); - let itemData ={}; - this.optionItems.forEach(item=>{ - if(item.code === this.svalue){ - itemData = item; - } - }); + let itemData = this.optionItems.find(item => item.code == this.svalue); this.$emit("change",itemData); this.$emit("onChange",itemData); this.dispatch('ElFormItem', 'el.form.change', [this.svalue]); - } }, - queryData(val) { + queryData(val,key) { + this.optionItems=[]; let queryParams = { - code:this.countryCode, + pageNum:1, + pageSize:10, + code:key, name:val }; listSimpleEmisCountry(queryParams).then(response => { this.optionItems =response.rows; + // 初始值存储 + if(key==null && val==null){ + this.defaultItems=[...this.optionItems] + } }); }, reverseArrow(flag) { diff --git a/src/views/emis/EmisBaseTools/CustomerAddressSimplePicker.vue b/src/views/emis/EmisBaseTools/CustomerAddressSimplePicker.vue index 10ab5f85..64a2df06 100644 --- a/src/views/emis/EmisBaseTools/CustomerAddressSimplePicker.vue +++ b/src/views/emis/EmisBaseTools/CustomerAddressSimplePicker.vue @@ -6,23 +6,17 @@ effect="light" :show-arrow="false" > - - - - - -
+
@@ -43,6 +37,24 @@ />
+ + + + +
@@ -86,30 +98,41 @@ export default { return { createdId: '0', loading:false, - visible:false, - dataList: [], + total:0, + optionItems: [], + + // 缺省值 + defaultTotal:0, + defaultItems:null, + + sId: null, svalue: this.value, - slable: null, - isEdit:false, - splaceholder:this.placeholder, - firstFlag:true, + + isInputing: false, + queryParams:{ pageNum:1, pageSize:5, + searchValue:null, addressType: this.addressType, country:this.countryCode, - searchValue:null, } }; }, watch: { - value(newVal) { - this.svalue = newVal; - this.slable = this.svalue; + value(newVal,oldVal) { + if(this.value!=null){ + this.svalue=this.value; + } }, - countryCode(){ - this.getList(); + countryCode(newVal){ + this.queryParams.country=newVal; + this.defaultItems=null; + }, + addressType(newVal){ + this.queryParams.addressType=newVal; + this.defaultItems=null; } }, @@ -117,92 +140,79 @@ export default { this.createdId = String(new Date().getTime()) // 给个随机id 判断是否clickoutside }, created() { + if(this.svalue!=null){ + this.svalue = this.value; + } }, methods: { - showItem(item){ - this.svalue=item.name; - this.slable=item.name; + onFocus(){ + // 第一次点击时需要初始化 + if(!this.defaultItems){ + this.queryParams.pageNum=1; + this.queryData(null,null); + }else{ + this.total = this.defaultTotal; + this.optionItems = [...this.defaultItems]; + } + // this.$refs.popoverRef.doShow(); }, - changeValue(val) { - if(this.queryParams.searchValue === val ) return; - this.slable = val; - this.isEdit = true; - - this.queryParams.searchValue = val + handleInput(val) { + if(val == null ) return; + this.isInputing = true; + this.svalue = val; this.queryParams.pageNum = 1 + this.queryData(val,null) - this.getList() }, onRowClick(row, column, event) { - this.showItem(row) - this.queryParams.searchValue=row.name; + this.svalue=row.name; + + this.isInputing = false; + + this.sId=row.id; this.$emit("input", this.svalue); - this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); - this.dispatch('ElFormItem', 'el.form.change', [this.svalue]); - this.$emit("onChange",row); this.$refs.popoverRef.doClose(); }, + isRed({ row }) { + if (row.id == this.sId) { + return { + "color": "red", + "font-weight": "bold", + }; + } + }, changePage(cur) { this.queryParams.pageNum = cur - this.getList() - - this.visible = true - this.$refs.popoverRef.doShow(); + this.queryData() }, - onfocus(el) { - if(this.slable) { - this.splaceholder= this.slable - } - this.visible = true - this.slable = null; - - this.queryParams.searchValue = null; - this.queryParams.pageNum = 1 - this.getList(); - }, - onclear(el){ - - this.splaceholder = this.placeholder; - // this.slable = null; - // this.svalue = null; - - // this.queryParams.searchValue = null; - this.queryParams.pageNum = 1; + onClear(el){ + this.svalue = null; this.$emit("input", this.svalue); this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); - this.dispatch('ElFormItem', 'el.form.change', [this.svalue]) - - if(this.visible){ - this.getList(); - } }, - onblur(el) { - if(this.slable=='' || this.slable=='' || !this.isEdit) { - this.slable = this.splaceholder; - } + onBlur(el) { + this.$emit("input", this.svalue); + this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]); }, - getList() { + queryData(val,key) { this.loading = true; - - // 首次执行 - // this.queryParams.empCode = this.firstFlag?this.value:null; - console.log(this.queryParams); + this.loading = true; + this.queryParams.searchValue = val; listSimpleEmisCustomerAddress(this.queryParams).then(response => { this.loading = false; this.total = response.total; - this.dataList = response.rows; - // if(this.firstFlag){ - // const selItem = this.dataList.find(item => item.empCode>this.svalue) - // if(selItem){ - // this.showItem(selItem); - // } - // // 首次执行结束 - // this.firstFlag = false; - // } + this.optionItems = response.rows; + + // 初始值存储 + if(key==null && val==null){ + this.defaultTotal = this.total+0; + this.defaultItems=[...this.optionItems] + } + }); }, diff --git a/src/views/emis/EmisBaseTools/DistrictPicker.vue b/src/views/emis/EmisBaseTools/DistrictPicker.vue index d40cba38..b2d0d293 100644 --- a/src/views/emis/EmisBaseTools/DistrictPicker.vue +++ b/src/views/emis/EmisBaseTools/DistrictPicker.vue @@ -5,7 +5,9 @@ clearable v-model="svalue" :placeholder="placeholder" - @change="onChange"> + @change="onChange" + @click.native="onClick" + > @@ -16,7 +18,7 @@ name: "DistrictPicker", props: { value: { - type: [String, Number], + type: String, required: false }, parentCode: { @@ -26,51 +28,68 @@ placeholder: { type: String, required: false - }, - isInitiated:{ - type: [Boolean,String], - required: false, - default:false } }, data() { return { - optionItems: [], svalue: this.value, + optionItems: [], + // 缺省值 + defaultItems: null, }; }, watch: { - value(newVal) { - this.svalue = newVal; + value(newVal,oldVal) { + if(this.value!=null){ + this.svalue=this.value; + // 判断默认值中是否存在,若存在则不继续查询 + if(this.optionItems){ + let selItem = this.optionItems.find(item => item.regionCode == this.svalue); + if(selItem){ + return; + } + } + this.queryData(null,this.svalue); + } }, - svalue(newVal, oldVal) { - this.$emit("input", this.svalue); - }, - parentCode(newVal) { - this.queryData(); + parentCode(newVal,oldVal) { + if(newVal!=oldVal){ + this.defaultItems=null; + } } }, created() { - if(this.isInitiated || this.svalue!=null){ - this.queryData(); + if(this.svalue!=null){ + this.queryData(null,this.svalue); } }, methods: { + onClick(){ + // 第一次点击时需要初始化 + if(!this.defaultItems){ + this.queryData(null,null); + }else{ + this.optionItems = [...this.defaultItems]; + } + }, onChange() { this.$emit("input", this.svalue); this.$emit("onChange"); }, - queryData() { - + queryData(val,key) { this.optionItems =[]; - if(this.parentCode==null){ - return; - } - - let queryParams = {parentCode:this.parentCode,regionType:3}; + let queryParams = { + parentCode:this.parentCode, + regionCode:key, + regionType:3 + }; listSimpleEmisRegion(queryParams).then(response => { this.optionItems = response.rows; + // 初始值存储 + if(key==null && val==null){ + this.defaultItems=[...this.optionItems] + } }); }, diff --git a/src/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue b/src/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue index fa899501..a6f009a5 100644 --- a/src/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue +++ b/src/views/emis/EmisBaseTools/EmisSiteSimplePicker.vue @@ -1,6 +1,25 @@ - - - diff --git a/src/views/emis/emisWaybill/emisWaybillRecord.vue b/src/views/emis/emisWaybill/emisWaybillRecord.vue deleted file mode 100644 index 15e54a82..00000000 --- a/src/views/emis/emisWaybill/emisWaybillRecord.vue +++ /dev/null @@ -1,1830 +0,0 @@ - - - - - - diff --git a/src/views/emis/emisWaybill/sendWaybillList.vue b/src/views/emis/emisWaybill/sendWaybillList.vue index 8323c979..753a2dc1 100644 --- a/src/views/emis/emisWaybill/sendWaybillList.vue +++ b/src/views/emis/emisWaybill/sendWaybillList.vue @@ -484,7 +484,7 @@ import ProblemTypePicker from '@/views/emis/EmisBaseTools/ProblemTypePicker.vue' import {dateToStr} from '@/utils/custom' export default { - name: "WaybillIsPrinted", + name: "SendWaybillList", components: { elDateAdvPicker,emisWaybillForm, CountryPicker1,