md
This commit is contained in:
parent
2079a00e2b
commit
8a9f078eb7
@ -45,11 +45,12 @@
|
|||||||
chosenClass="drag-chosen"
|
chosenClass="drag-chosen"
|
||||||
:animation="500"
|
:animation="500"
|
||||||
handle=".el-icon-s-operation"
|
handle=".el-icon-s-operation"
|
||||||
@end="updateTable">
|
@end="updateTable"
|
||||||
<div v-for="clo in storageList" :key="clo.label" class="setting-row">
|
>
|
||||||
|
<div v-for="col in storageList" :key="col.label" class="setting-row">
|
||||||
<!-- <i class="el-icon-s-operation" /> -->
|
<!-- <i class="el-icon-s-operation" /> -->
|
||||||
<i class="el-icon-s-operation icon iconfont icon-ui_drag_horizontally" />
|
<i class="el-icon-s-operation icon iconfont icon-ui_drag_horizontally" />
|
||||||
<el-checkbox v-model="clo.show" class="label" @change="showOrHidden($event,clo)">{{ clo.label }}</el-checkbox>
|
<el-checkbox v-model="col.show" class="label" @change="showOrHidden($event,col)">{{ col.label }}</el-checkbox>
|
||||||
<!-- <el-button
|
<!-- <el-button
|
||||||
class="btn"
|
class="btn"
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -68,9 +69,9 @@
|
|||||||
<el-button style="margin-left: 10px;" slot="reference" size="mini" circle icon="el-icon-menu" />
|
<el-button style="margin-left: 10px;" slot="reference" size="mini" circle icon="el-icon-menu" />
|
||||||
</el-popover>
|
</el-popover>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<!-- <el-tooltip class="item" effect="dark" content="导出" placement="top" v-if="download!=null">
|
<el-tooltip style="margin-left: 10px;" class="item" effect="dark" content="导出" placement="top" v-if="download!=null">
|
||||||
<el-button size="mini" circle icon="el-icon-download" @click="download()" />
|
<el-button size="mini" circle icon="el-icon-download" @click="download()" />
|
||||||
</el-tooltip> -->
|
</el-tooltip>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import dialogDragHeight from './dialog/dragHeight'
|
|||||||
import dialogFullScreen from './dialog/fullScreen'
|
import dialogFullScreen from './dialog/fullScreen'
|
||||||
import clipboard from './module/clipboard'
|
import clipboard from './module/clipboard'
|
||||||
import elSelectLoadmore from './ext/elSelectLoadmore'
|
import elSelectLoadmore from './ext/elSelectLoadmore'
|
||||||
|
import elTableResizeHeight from './table/resizeHeight'
|
||||||
|
|
||||||
const install = function(Vue) {
|
const install = function(Vue) {
|
||||||
Vue.directive('hasRole', hasRole)
|
Vue.directive('hasRole', hasRole)
|
||||||
@ -15,6 +16,8 @@ const install = function(Vue) {
|
|||||||
Vue.directive('dialogDragWidth', dialogDragWidth)
|
Vue.directive('dialogDragWidth', dialogDragWidth)
|
||||||
Vue.directive('dialogDragHeight', dialogDragHeight)
|
Vue.directive('dialogDragHeight', dialogDragHeight)
|
||||||
Vue.directive('dialogFullScreen', dialogFullScreen)
|
Vue.directive('dialogFullScreen', dialogFullScreen)
|
||||||
|
Vue.directive('elTableResizeHeight', elTableResizeHeight)
|
||||||
|
// v-elTableResizeHeight="{bottomOffset: 85}"
|
||||||
|
|
||||||
Vue.directive('el-select-loadmore', elSelectLoadmore);
|
Vue.directive('el-select-loadmore', elSelectLoadmore);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,8 @@ import { download } from '@/utils/request'
|
|||||||
import { triggerTrans } from '@/utils/custom'
|
import { triggerTrans } from '@/utils/custom'
|
||||||
import TanexPrinterSdk from '@/utils/TanexPrinterSdk'
|
import TanexPrinterSdk from '@/utils/TanexPrinterSdk'
|
||||||
|
|
||||||
|
// import _ from 'lodash'
|
||||||
|
|
||||||
import './assets/icons' // icon
|
import './assets/icons' // icon
|
||||||
import './permission' // permission control
|
import './permission' // permission control
|
||||||
import { getDicts } from "@/api/system/dict/data";
|
import { getDicts } from "@/api/system/dict/data";
|
||||||
@ -95,6 +97,8 @@ const tanexPrinter = TanexPrinterSdk.getInstance();
|
|||||||
Vue.prototype.$tanexPrinter = tanexPrinter;
|
Vue.prototype.$tanexPrinter = tanexPrinter;
|
||||||
Vue.prototype.$t = (key, value) => i18n.t(triggerTrans(key,i18n.locale), value)
|
Vue.prototype.$t = (key, value) => i18n.t(triggerTrans(key,i18n.locale), value)
|
||||||
|
|
||||||
|
// Vue.prototype._ = _
|
||||||
|
|
||||||
// vue 页面捕获
|
// vue 页面捕获
|
||||||
// const __patch__ = Vue.prototype.__patch__;
|
// const __patch__ = Vue.prototype.__patch__;
|
||||||
// Vue.prototype.__patch__ = function() {
|
// Vue.prototype.__patch__ = function() {
|
||||||
|
|||||||
@ -5,7 +5,9 @@
|
|||||||
clearable
|
clearable
|
||||||
v-model="svalue"
|
v-model="svalue"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
@change="onChange">
|
@change="onChange"
|
||||||
|
@click.native="onClick"
|
||||||
|
>
|
||||||
<el-option v-for="item in optionItems" :key="item.regionCode" :label="item.regionName" :value="item.regionCode" />
|
<el-option v-for="item in optionItems" :key="item.regionCode" :label="item.regionName" :value="item.regionCode" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
@ -16,7 +18,7 @@
|
|||||||
name: "CityPicker",
|
name: "CityPicker",
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: [String, Number],
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
parentCode: {
|
parentCode: {
|
||||||
@ -27,50 +29,66 @@
|
|||||||
type: String,
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
isInitiated:{
|
|
||||||
type: [Boolean,String],
|
|
||||||
required: false,
|
|
||||||
default:false
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
optionItems: [],
|
|
||||||
svalue: this.value,
|
svalue: this.value,
|
||||||
|
optionItems: [],
|
||||||
|
// 缺省值
|
||||||
|
defaultItems: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(newVal) {
|
value(newVal,oldVal) {
|
||||||
this.svalue = newVal;
|
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) {
|
parentCode(newVal,oldVal) {
|
||||||
// this.$emit("input", this.svalue);
|
if(newVal!=oldVal){
|
||||||
},
|
this.defaultItems=null;
|
||||||
parentCode(newVal) {
|
}
|
||||||
this.queryData();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if(this.isInitiated || this.svalue!=null){
|
if(this.svalue!=null){
|
||||||
this.queryData();
|
this.queryData(null,this.svalue);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onClick(){
|
||||||
|
// 第一次点击时需要初始化
|
||||||
|
if(!this.defaultItems){
|
||||||
|
this.queryData(null,null);
|
||||||
|
}else{
|
||||||
|
this.optionItems = [...this.defaultItems];
|
||||||
|
}
|
||||||
|
},
|
||||||
onChange() {
|
onChange() {
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
this.$emit("onChange");
|
this.$emit("onChange");
|
||||||
},
|
},
|
||||||
queryData() {
|
queryData(val,key) {
|
||||||
|
|
||||||
this.optionItems =[];
|
this.optionItems =[];
|
||||||
|
let queryParams = {
|
||||||
if(this.parentCode==null){
|
parentCode:this.parentCode,
|
||||||
return;
|
regionCode:key,
|
||||||
}
|
regionType:2
|
||||||
|
};
|
||||||
let queryParams = {parentCode:this.parentCode,regionType:2};
|
|
||||||
listSimpleEmisRegion(queryParams).then(response => {
|
listSimpleEmisRegion(queryParams).then(response => {
|
||||||
this.optionItems = response.rows;
|
this.optionItems = response.rows;
|
||||||
|
// 初始值存储
|
||||||
|
if(key==null && val==null){
|
||||||
|
this.defaultItems=[...this.optionItems]
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -8,9 +8,12 @@
|
|||||||
:remote-method="queryData"
|
:remote-method="queryData"
|
||||||
v-model="svalue"
|
v-model="svalue"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
|
||||||
|
no-data-text=""
|
||||||
|
|
||||||
@blur="onBlur"
|
@blur="onBlur"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
@focus="onFocus"
|
@click.native="onClick"
|
||||||
@visible-change="reverseArrow"
|
@visible-change="reverseArrow"
|
||||||
>
|
>
|
||||||
<el-option v-for="item in optionItems" :key="item.code" :label="item.name+'('+item.nameEn+')'" :value="item.code" ></el-option>
|
<el-option v-for="item in optionItems" :key="item.code" :label="item.name+'('+item.nameEn+')'" :value="item.code" ></el-option>
|
||||||
@ -35,57 +38,66 @@
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
optionItems: [],
|
|
||||||
svalue: this.value,
|
svalue: this.value,
|
||||||
countryCode:null,
|
optionItems: [],
|
||||||
countryMap:new Map(),
|
|
||||||
|
// 缺省值
|
||||||
|
defaultItems: null,
|
||||||
|
countryMap:new Map()
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(newVal) {
|
value(newVal,oldVal) {
|
||||||
this.svalue = newVal;
|
// 逻辑 有初始值先查询初值
|
||||||
if(this.svalue!=null) {
|
if(this.value!=null){
|
||||||
this.countryCode=this.svalue;
|
this.svalue=this.value;
|
||||||
|
this.queryData(null,this.svalue);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.queryData();
|
if(this.svalue!=null){
|
||||||
|
this.queryData(null,this.svalue);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
let rulesDom = this.$refs["selectRef"].$el.querySelector(".el-input .el-input__suffix .el-input__suffix-inner .el-input__icon"); // 找到dom
|
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
|
rulesDom.classList.add("el-icon-arrow-up"); // 对dom新增class
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onFocus(){
|
onClick(){
|
||||||
this.countryCode=null;
|
// 第一次点击时需要初始化
|
||||||
this.queryData();
|
if(!this.defaultItems){
|
||||||
|
this.queryData(null,null);
|
||||||
|
}else{
|
||||||
|
this.optionItems = [...this.defaultItems];
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onBlur(val){
|
onBlur(val){
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
this.dispatch('ElFormItem', 'el.form.blur');
|
this.dispatch('ElFormItem', 'el.form.blur');
|
||||||
},
|
},
|
||||||
onChange() {
|
onChange() {
|
||||||
if(this.svalue!=null){
|
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
let itemData ={};
|
let itemData = this.optionItems.find(item => item.code == this.svalue);
|
||||||
this.optionItems.forEach(item=>{
|
|
||||||
if(item.code === this.svalue){
|
|
||||||
itemData = item;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.$emit("change",itemData);
|
this.$emit("change",itemData);
|
||||||
this.$emit("onChange",itemData);
|
this.$emit("onChange",itemData);
|
||||||
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]);
|
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
queryData(val) {
|
queryData(val,key) {
|
||||||
|
this.optionItems=[];
|
||||||
let queryParams = {
|
let queryParams = {
|
||||||
code:this.countryCode,
|
pageNum:1,
|
||||||
|
pageSize:10,
|
||||||
|
code:key,
|
||||||
name:val
|
name:val
|
||||||
};
|
};
|
||||||
listSimpleEmisCountry(queryParams).then(response => {
|
listSimpleEmisCountry(queryParams).then(response => {
|
||||||
this.optionItems =response.rows;
|
this.optionItems =response.rows;
|
||||||
|
// 初始值存储
|
||||||
|
if(key==null && val==null){
|
||||||
|
this.defaultItems=[...this.optionItems]
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
reverseArrow(flag) {
|
reverseArrow(flag) {
|
||||||
|
|||||||
@ -6,23 +6,17 @@
|
|||||||
effect="light"
|
effect="light"
|
||||||
:show-arrow="false"
|
:show-arrow="false"
|
||||||
>
|
>
|
||||||
<span slot="reference">
|
|
||||||
<el-input ref="inputValue" :value="slable" :placeholder="splaceholder" @input="changeValue" @focus="onfocus" @blur="onblur" @clear="onclear" clearable >
|
|
||||||
<template slot="suffix">
|
|
||||||
<i class="el-icon-arrow-down select-down" :class="visible&&'rotate180'"></i>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</span>
|
|
||||||
<div >
|
<div >
|
||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
style="width: 100%;"
|
|
||||||
:data="dataList"
|
|
||||||
@row-click="onRowClick"
|
|
||||||
stripe size="mini"
|
|
||||||
element-loading-text="Loading"
|
|
||||||
ref="comboGridTable"
|
ref="comboGridTable"
|
||||||
fit highlight-current-row
|
style="width: 100%;"
|
||||||
|
:data="optionItems"
|
||||||
|
@row-click="onRowClick"
|
||||||
|
:row-key="row => row.empCode"
|
||||||
|
stripe
|
||||||
|
:row-style="isRed"
|
||||||
|
element-loading-text="Loading"
|
||||||
>
|
>
|
||||||
<el-table-column :label="$t('名称')" align="left" prop="name" width="100" />
|
<el-table-column :label="$t('名称')" align="left" prop="name" width="100" />
|
||||||
<el-table-column :label="$t('电话')" align="left" prop="phone" width="100" />
|
<el-table-column :label="$t('电话')" align="left" prop="phone" width="100" />
|
||||||
@ -43,6 +37,24 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-input
|
||||||
|
slot="reference"
|
||||||
|
ref="inputValue"
|
||||||
|
:value="svalue"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
@input="handleInput"
|
||||||
|
@focus="onFocus"
|
||||||
|
@blur="onBlur"
|
||||||
|
@clear="onClear"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<template slot="suffix">
|
||||||
|
<!-- <i class="el-icon-arrow-down select-down" :class="visible&&'rotate180'"></i> -->
|
||||||
|
<i slot="suffix" class="el-icon-search"></i>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
|
||||||
|
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -86,30 +98,41 @@ export default {
|
|||||||
return {
|
return {
|
||||||
createdId: '0',
|
createdId: '0',
|
||||||
loading:false,
|
loading:false,
|
||||||
visible:false,
|
|
||||||
dataList: [],
|
|
||||||
total:0,
|
total:0,
|
||||||
|
optionItems: [],
|
||||||
|
|
||||||
|
// 缺省值
|
||||||
|
defaultTotal:0,
|
||||||
|
defaultItems:null,
|
||||||
|
|
||||||
|
sId: null,
|
||||||
svalue: this.value,
|
svalue: this.value,
|
||||||
slable: null,
|
|
||||||
isEdit:false,
|
isInputing: false,
|
||||||
splaceholder:this.placeholder,
|
|
||||||
firstFlag:true,
|
|
||||||
queryParams:{
|
queryParams:{
|
||||||
pageNum:1,
|
pageNum:1,
|
||||||
pageSize:5,
|
pageSize:5,
|
||||||
|
searchValue:null,
|
||||||
addressType: this.addressType,
|
addressType: this.addressType,
|
||||||
country:this.countryCode,
|
country:this.countryCode,
|
||||||
searchValue:null,
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(newVal) {
|
value(newVal,oldVal) {
|
||||||
this.svalue = newVal;
|
if(this.value!=null){
|
||||||
this.slable = this.svalue;
|
this.svalue=this.value;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
countryCode(){
|
countryCode(newVal){
|
||||||
this.getList();
|
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
|
this.createdId = String(new Date().getTime()) // 给个随机id 判断是否clickoutside
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
if(this.svalue!=null){
|
||||||
|
this.svalue = this.value;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showItem(item){
|
onFocus(){
|
||||||
this.svalue=item.name;
|
// 第一次点击时需要初始化
|
||||||
this.slable=item.name;
|
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) {
|
handleInput(val) {
|
||||||
if(this.queryParams.searchValue === val ) return;
|
if(val == null ) return;
|
||||||
this.slable = val;
|
this.isInputing = true;
|
||||||
this.isEdit = true;
|
this.svalue = val;
|
||||||
|
|
||||||
this.queryParams.searchValue = val
|
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1
|
||||||
|
this.queryData(val,null)
|
||||||
|
|
||||||
this.getList()
|
|
||||||
},
|
},
|
||||||
onRowClick(row, column, event) {
|
onRowClick(row, column, event) {
|
||||||
this.showItem(row)
|
this.svalue=row.name;
|
||||||
this.queryParams.searchValue=row.name;
|
|
||||||
|
this.isInputing = false;
|
||||||
|
|
||||||
|
this.sId=row.id;
|
||||||
|
|
||||||
this.$emit("input", this.svalue);
|
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.$emit("onChange",row);
|
||||||
this.$refs.popoverRef.doClose();
|
this.$refs.popoverRef.doClose();
|
||||||
},
|
},
|
||||||
|
isRed({ row }) {
|
||||||
|
if (row.id == this.sId) {
|
||||||
|
return {
|
||||||
|
"color": "red",
|
||||||
|
"font-weight": "bold",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
changePage(cur) {
|
changePage(cur) {
|
||||||
this.queryParams.pageNum = cur
|
this.queryParams.pageNum = cur
|
||||||
this.getList()
|
this.queryData()
|
||||||
|
|
||||||
this.visible = true
|
|
||||||
this.$refs.popoverRef.doShow();
|
|
||||||
},
|
},
|
||||||
onfocus(el) {
|
onClear(el){
|
||||||
if(this.slable) {
|
this.svalue = null;
|
||||||
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;
|
|
||||||
|
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
this.dispatch('ElFormItem', 'el.form.blur', [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) {
|
onBlur(el) {
|
||||||
if(this.slable=='' || this.slable=='' || !this.isEdit) {
|
this.$emit("input", this.svalue);
|
||||||
this.slable = this.splaceholder;
|
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||||
}
|
|
||||||
},
|
},
|
||||||
getList() {
|
queryData(val,key) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
this.loading = true;
|
||||||
// 首次执行
|
this.queryParams.searchValue = val;
|
||||||
// this.queryParams.empCode = this.firstFlag?this.value:null;
|
|
||||||
console.log(this.queryParams);
|
|
||||||
|
|
||||||
listSimpleEmisCustomerAddress(this.queryParams).then(response => {
|
listSimpleEmisCustomerAddress(this.queryParams).then(response => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.dataList = response.rows;
|
this.optionItems = response.rows;
|
||||||
// if(this.firstFlag){
|
|
||||||
// const selItem = this.dataList.find(item => item.empCode>this.svalue)
|
// 初始值存储
|
||||||
// if(selItem){
|
if(key==null && val==null){
|
||||||
// this.showItem(selItem);
|
this.defaultTotal = this.total+0;
|
||||||
// }
|
this.defaultItems=[...this.optionItems]
|
||||||
// // 首次执行结束
|
}
|
||||||
// this.firstFlag = false;
|
|
||||||
// }
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,9 @@
|
|||||||
clearable
|
clearable
|
||||||
v-model="svalue"
|
v-model="svalue"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
@change="onChange">
|
@change="onChange"
|
||||||
|
@click.native="onClick"
|
||||||
|
>
|
||||||
<el-option v-for="item in optionItems" :key="item.regionCode" :label="item.regionName" :value="item.regionCode" />
|
<el-option v-for="item in optionItems" :key="item.regionCode" :label="item.regionName" :value="item.regionCode" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</template>
|
</template>
|
||||||
@ -16,7 +18,7 @@
|
|||||||
name: "DistrictPicker",
|
name: "DistrictPicker",
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: [String, Number],
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
parentCode: {
|
parentCode: {
|
||||||
@ -26,51 +28,68 @@
|
|||||||
placeholder: {
|
placeholder: {
|
||||||
type: String,
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
},
|
|
||||||
isInitiated:{
|
|
||||||
type: [Boolean,String],
|
|
||||||
required: false,
|
|
||||||
default:false
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
optionItems: [],
|
|
||||||
svalue: this.value,
|
svalue: this.value,
|
||||||
|
optionItems: [],
|
||||||
|
// 缺省值
|
||||||
|
defaultItems: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(newVal) {
|
value(newVal,oldVal) {
|
||||||
this.svalue = newVal;
|
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) {
|
parentCode(newVal,oldVal) {
|
||||||
this.$emit("input", this.svalue);
|
if(newVal!=oldVal){
|
||||||
},
|
this.defaultItems=null;
|
||||||
parentCode(newVal) {
|
}
|
||||||
this.queryData();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
if(this.isInitiated || this.svalue!=null){
|
if(this.svalue!=null){
|
||||||
this.queryData();
|
this.queryData(null,this.svalue);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onClick(){
|
||||||
|
// 第一次点击时需要初始化
|
||||||
|
if(!this.defaultItems){
|
||||||
|
this.queryData(null,null);
|
||||||
|
}else{
|
||||||
|
this.optionItems = [...this.defaultItems];
|
||||||
|
}
|
||||||
|
},
|
||||||
onChange() {
|
onChange() {
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
this.$emit("onChange");
|
this.$emit("onChange");
|
||||||
},
|
},
|
||||||
queryData() {
|
queryData(val,key) {
|
||||||
|
|
||||||
this.optionItems =[];
|
this.optionItems =[];
|
||||||
|
|
||||||
if(this.parentCode==null){
|
let queryParams = {
|
||||||
return;
|
parentCode:this.parentCode,
|
||||||
}
|
regionCode:key,
|
||||||
|
regionType:3
|
||||||
let queryParams = {parentCode:this.parentCode,regionType:3};
|
};
|
||||||
listSimpleEmisRegion(queryParams).then(response => {
|
listSimpleEmisRegion(queryParams).then(response => {
|
||||||
this.optionItems = response.rows;
|
this.optionItems = response.rows;
|
||||||
|
// 初始值存储
|
||||||
|
if(key==null && val==null){
|
||||||
|
this.defaultItems=[...this.optionItems]
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,25 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-select
|
<el-select
|
||||||
|
style="width:100%"
|
||||||
|
ref="selectRef"
|
||||||
filterable
|
filterable
|
||||||
|
clearable
|
||||||
|
remote
|
||||||
|
:remote-method="queryData"
|
||||||
|
v-model="svalue"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
|
||||||
|
no-data-text=""
|
||||||
|
|
||||||
|
@blur="onBlur"
|
||||||
|
@change="onChange"
|
||||||
|
@click.native="onClick"
|
||||||
|
@visible-change="reverseArrow"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in optionItems" :key="item.siteCode" :label="item.siteName" :value="item.siteCode" ></el-option>
|
||||||
|
</el-select>
|
||||||
|
|
||||||
|
<!-- filterable
|
||||||
clearable
|
clearable
|
||||||
autocomplete="false"
|
autocomplete="false"
|
||||||
ref="selectRef"
|
ref="selectRef"
|
||||||
@ -13,23 +32,21 @@
|
|||||||
class="remote-select"
|
class="remote-select"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
@clear="onClear"
|
@clear="onClear"
|
||||||
@visible-change="reverseArrow"
|
|
||||||
@mouseleave.native="onMouseleave"
|
|
||||||
>
|
|
||||||
<el-option v-for="item in optionItems" :key="item.siteCode" :label="item.siteName" :value="item.siteCode" ></el-option>
|
|
||||||
</el-select>
|
|
||||||
|
|
||||||
|
no-data-text=""
|
||||||
|
|
||||||
|
|
||||||
|
@visible-change="reverseArrow"
|
||||||
|
@mouseleave.native="onMouseleave" -->
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import emitter from 'element-ui/src/mixins/emitter';
|
||||||
import { listSimpleEmisSite } from "@/api/emis/emisSite";
|
import { listSimpleEmisSite } from "@/api/emis/emisSite";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "EmisSiteSimplePicker",
|
name: "EmisSiteSimplePicker",
|
||||||
components: {
|
mixins: [emitter],
|
||||||
|
|
||||||
},
|
|
||||||
dicts: [],
|
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: String,
|
type: String,
|
||||||
@ -47,11 +64,6 @@
|
|||||||
type: [String,Number],
|
type: [String,Number],
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
isInitiated:{
|
|
||||||
type: [Boolean,String],
|
|
||||||
required: false,
|
|
||||||
default:false
|
|
||||||
},
|
|
||||||
disabled:{
|
disabled:{
|
||||||
type: [Boolean,String],
|
type: [Boolean,String],
|
||||||
required: false
|
required: false
|
||||||
@ -60,30 +72,42 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading:false,
|
loading:false,
|
||||||
visible:false,
|
|
||||||
optionItems: [],
|
|
||||||
svalue: this.value,
|
svalue: this.value,
|
||||||
firstFlag:true,
|
optionItems: [],
|
||||||
filterMap:new Map(),
|
// 缺省值
|
||||||
|
defaultItems: null,
|
||||||
|
itemMap:new Map(),
|
||||||
|
|
||||||
queryParams:{
|
queryParams:{
|
||||||
pageNum:1,
|
pageNum:1,
|
||||||
pageSize:10,
|
pageSize:10,
|
||||||
siteType:this.siteType,
|
siteType:this.siteType,
|
||||||
countryCode:this.countryCode,
|
countryCode:this.countryCode,
|
||||||
siteCode:this.value
|
siteCode:null,
|
||||||
|
siteName:null
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(newVal) {
|
value(newVal,oldVal) {
|
||||||
this.svalue = newVal;
|
// 逻辑 有初始值先查询初值
|
||||||
this.queryData();
|
if(this.value!=null){
|
||||||
|
this.svalue=this.value;
|
||||||
|
this.queryData(null,this.svalue);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
siteType(newVal, oldVal) {
|
siteType(newVal, oldVal) {
|
||||||
this.queryData();
|
if(newVal!=oldVal){
|
||||||
|
this.queryParams.siteType=newVal
|
||||||
|
this.defaultItems=null;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
countryCode(newVal, oldVal) {
|
countryCode(newVal, oldVal) {
|
||||||
this.queryData();
|
if(newVal!=oldVal){
|
||||||
|
this.queryParams.countryCode=newVal
|
||||||
|
this.defaultItems=null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
@ -91,58 +115,46 @@
|
|||||||
rulesDom.classList.add("el-icon-arrow-up"); // 对dom新增class
|
rulesDom.classList.add("el-icon-arrow-up"); // 对dom新增class
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.queryData();
|
if(this.svalue!=null){
|
||||||
|
this.queryData(null,this.svalue);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onClick(){
|
||||||
|
// 第一次点击时需要初始化
|
||||||
|
if(!this.defaultItems){
|
||||||
|
this.queryData(null,null);
|
||||||
|
}else{
|
||||||
|
this.optionItems = [...this.defaultItems];
|
||||||
|
}
|
||||||
|
},
|
||||||
onChange() {
|
onChange() {
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
let itemData=this.filterMap[this.svalue];
|
let itemData = this.optionItems.find(item => item.siteCode == this.svalue);
|
||||||
this.$emit("onChange",itemData);
|
this.$emit("onChange",itemData);
|
||||||
},
|
},
|
||||||
onClear(){
|
onClear(){
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
this.$emit("onClear");
|
this.$emit("onChange",null);
|
||||||
this.queryParams.siteName=null;
|
|
||||||
this.queryData();
|
|
||||||
},
|
},
|
||||||
onFocus(){
|
onBlur(val){
|
||||||
this.firstFlag = false;
|
this.$emit("input", this.svalue);
|
||||||
this.queryParams.siteCode=null;
|
this.dispatch('ElFormItem', 'el.form.blur');
|
||||||
this.queryData();
|
|
||||||
},
|
},
|
||||||
queryData(val){
|
queryData(val,key) {
|
||||||
this.optionItems=[];
|
this.optionItems=[];
|
||||||
|
|
||||||
|
this.queryParams.siteCode=key;
|
||||||
this.queryParams.siteName=val;
|
this.queryParams.siteName=val;
|
||||||
|
|
||||||
listSimpleEmisSite(this.queryParams).then(response => {
|
listSimpleEmisSite(this.queryParams).then(response => {
|
||||||
this.optionItems=response.rows;
|
this.optionItems=response.rows;
|
||||||
response.rows.forEach(item => {
|
// 初始值存储
|
||||||
if(!this.filterMap.hasOwnProperty(item.siteCode)){
|
if(key==null && val==null){
|
||||||
this.filterMap[item.siteCode]=item;
|
this.defaultItems=[...this.optionItems]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
onMouseleave(e, i) {
|
|
||||||
setTimeout(() => {
|
|
||||||
var currTargetEl = e.relatedTarget || e.toElement
|
|
||||||
if (currTargetEl) {
|
|
||||||
const elTagName = currTargetEl.tagName
|
|
||||||
const targetClassName = currTargetEl.className
|
|
||||||
// ul 同时包含className==el-select-dropdown__list
|
|
||||||
if (elTagName === 'UL' && targetClassName.indexOf('el-select-dropdown__list') !== -1) {
|
|
||||||
return false
|
|
||||||
} else if (elTagName === 'LI' && targetClassName.indexOf('el-select-dropdown__item') !== -1) {
|
|
||||||
return false
|
|
||||||
} else if (!e.target.children[1]) {
|
|
||||||
return false
|
|
||||||
} else {
|
|
||||||
e.target.children[1].style.display = 'none'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}, 0)
|
|
||||||
},
|
|
||||||
|
|
||||||
reverseArrow(flag) {
|
reverseArrow(flag) {
|
||||||
let rulesDom = this.$refs["selectRef"].$el.querySelector(
|
let rulesDom = this.$refs["selectRef"].$el.querySelector(
|
||||||
".el-input .el-input__suffix .el-input__suffix-inner .el-input__icon"
|
".el-input .el-input__suffix .el-input__suffix-inner .el-input__icon"
|
||||||
|
|||||||
@ -4,31 +4,20 @@
|
|||||||
placement="bottom"
|
placement="bottom"
|
||||||
trigger="click"
|
trigger="click"
|
||||||
ref="popoverRef"
|
ref="popoverRef"
|
||||||
effect="light"
|
:popper-options="{ boundariesElement: '.el-form', removeOnDestroy: true }"
|
||||||
:show-arrow="false"
|
|
||||||
>
|
>
|
||||||
<span slot="reference">
|
|
||||||
<el-input ref="inputValue" :value="slable" :placeholder="splaceholder" @input="changeValue" @focus="onfocus" @blur="onblur" @clear="onclear" clearable >
|
|
||||||
<template slot="suffix">
|
|
||||||
<i class="el-icon-arrow-down select-down" :class="visible&&'rotate180'"></i>
|
|
||||||
</template>
|
|
||||||
</el-input>
|
|
||||||
</span>
|
|
||||||
<div >
|
<div >
|
||||||
<!-- class="el-table--scrollable-y" border max-height="300px" -->
|
|
||||||
<el-table
|
<el-table
|
||||||
|
ref="comboGridTable"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
style="width: 100%;"
|
style="width: 100%;"
|
||||||
:data="dataList"
|
:data="optionItems"
|
||||||
@row-click="onRowClick"
|
@row-click="onRowClick"
|
||||||
|
:row-key="row => row.empCode"
|
||||||
stripe
|
stripe
|
||||||
size="mini"
|
:row-style="isRed"
|
||||||
element-loading-text="Loading" ref="comboGridTable" fit highlight-current-row>
|
element-loading-text="Loading"
|
||||||
<!-- <el-table-column label="序号" align="center" min-width="50">
|
>
|
||||||
<template slot-scope="scope">
|
|
||||||
<span v-text="getIndex(scope.$index)"> </span>
|
|
||||||
</template>
|
|
||||||
</el-table-column> -->
|
|
||||||
<el-table-column label="员工编号" align="left" prop="empCode" width="100" />
|
<el-table-column label="员工编号" align="left" prop="empCode" width="100" />
|
||||||
<el-table-column label="员工名称" align="center" prop="empName" width="100" :show-overflow-tooltip="true" />
|
<el-table-column label="员工名称" align="center" prop="empName" width="100" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="所属网点" align="center" prop="ownerSiteName" width="100" :show-overflow-tooltip="true" />
|
<el-table-column label="所属网点" align="center" prop="ownerSiteName" width="100" :show-overflow-tooltip="true" />
|
||||||
@ -42,6 +31,23 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-input
|
||||||
|
slot="reference"
|
||||||
|
ref="inputValue"
|
||||||
|
:value="slable"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
@input="handleInput"
|
||||||
|
@focus="onFocus"
|
||||||
|
@blur="onBlur"
|
||||||
|
@clear="onClear"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<template slot="suffix">
|
||||||
|
<!-- <i class="el-icon-arrow-down select-down" :class="visible&&'rotate180'"></i> -->
|
||||||
|
<i slot="suffix" class="el-icon-search"></i>
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
|
||||||
</el-popover>
|
</el-popover>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -56,7 +62,7 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
|||||||
mixins: [emitter],
|
mixins: [emitter],
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: [String, Number],
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
sideCode: {
|
sideCode: {
|
||||||
@ -67,11 +73,6 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
|||||||
type: String,
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
isInitiated:{
|
|
||||||
type: [Boolean,String],
|
|
||||||
required: false,
|
|
||||||
default:false
|
|
||||||
},
|
|
||||||
placeholder:{
|
placeholder:{
|
||||||
type: String,
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
@ -88,44 +89,43 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
|||||||
return {
|
return {
|
||||||
createdId: '0',
|
createdId: '0',
|
||||||
loading:false,
|
loading:false,
|
||||||
visible:false,
|
|
||||||
dataList: [],
|
|
||||||
total:0,
|
total:0,
|
||||||
|
optionItems: [],
|
||||||
|
|
||||||
|
// 缺省值
|
||||||
|
defaultTotal:0,
|
||||||
|
defaultItems:null,
|
||||||
|
|
||||||
svalue: this.value,
|
svalue: this.value,
|
||||||
slable: null,
|
slable: null,
|
||||||
isEdit:false,
|
|
||||||
splaceholder:this.placeholder,
|
isInputing: false,
|
||||||
firstFlag:true,
|
|
||||||
queryParams:{
|
queryParams:{
|
||||||
pageNum:1,
|
pageNum:1,
|
||||||
pageSize:5,
|
pageSize:5,
|
||||||
empCode:this.value,
|
empCode:null,
|
||||||
searchValue:null,
|
searchValue:null,
|
||||||
ownerSiteCode:null,
|
ownerSiteCode:this.sideCode,
|
||||||
postCode:null
|
postCode:this.postCode
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
value(newVal,oldVal) {
|
value(newVal,oldVal) {
|
||||||
this.svalue = newVal;
|
if(this.value!=null){
|
||||||
console.log("empCode1==>"+newVal);
|
this.svalue=this.value;
|
||||||
console.log("this.svalue1==>"+this.svalue);
|
this.queryData(null,this.svalue);
|
||||||
console.log("this.svalue1==>"+this.firstFlag);
|
|
||||||
if(this.svalue!=null&&this.firstFlag){
|
|
||||||
this.queryParams.empCode=this.svalue;
|
|
||||||
this.queryData();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
siteCode(newVal){
|
siteCode(newVal){
|
||||||
console.log("siteCode==>"+newVal);
|
|
||||||
this.queryParams.ownerSiteCode=newVal;
|
this.queryParams.ownerSiteCode=newVal;
|
||||||
this.queryData();
|
this.defaultItems=null;
|
||||||
},
|
},
|
||||||
postCode(newVal){
|
postCode(newVal){
|
||||||
console.log("postCode==>"+newVal);
|
|
||||||
this.queryParams.postCode=newVal;
|
this.queryParams.postCode=newVal;
|
||||||
this.queryData();
|
this.defaultItems=null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@ -133,108 +133,96 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
|||||||
this.createdId = String(new Date().getTime())
|
this.createdId = String(new Date().getTime())
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.queryData();
|
if(this.svalue!=null){
|
||||||
|
this.queryData(null,this.svalue);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
changeValue(val) {
|
onFocus(){
|
||||||
if(this.queryParams.searchValue === val ) return;
|
// 第一次点击时需要初始化
|
||||||
|
if(!this.defaultItems){
|
||||||
|
this.queryParams.pageNum=1;
|
||||||
|
this.queryData(null,null);
|
||||||
|
}else{
|
||||||
|
this.total = this.defaultTotal;
|
||||||
|
this.optionItems = [...this.defaultItems];
|
||||||
|
}
|
||||||
|
// this.$refs.popoverRef.doShow();
|
||||||
|
},
|
||||||
|
handleInput(val) {
|
||||||
|
if(val == null ) return;
|
||||||
|
|
||||||
|
this.isInputing = true;
|
||||||
this.slable = val;
|
this.slable = val;
|
||||||
this.isEdit = true;
|
|
||||||
this.queryParams.searchValue = val
|
|
||||||
this.queryParams.pageNum = 1
|
this.queryParams.pageNum = 1
|
||||||
|
this.queryData(val,null)
|
||||||
|
|
||||||
this.queryData()
|
|
||||||
},
|
},
|
||||||
onRowClick(row, column, event) {
|
onRowClick(row, column, event) {
|
||||||
this.svalue=row.empCode;
|
this.svalue=row.empCode;
|
||||||
this.showItem(row)
|
this.slable=row.empName;
|
||||||
|
|
||||||
this.queryParams.searchValue=row.empName;
|
this.isInputing = false;
|
||||||
|
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
this.$emit("onChange",row);
|
this.$emit("onChange",row);
|
||||||
this.$refs.popoverRef.doClose();
|
this.$refs.popoverRef.doClose();
|
||||||
},
|
},
|
||||||
|
isRed({ row }) {
|
||||||
|
if (row.empCode == this.svalue) {
|
||||||
|
return {
|
||||||
|
"color": "red",
|
||||||
|
"font-weight": "bold",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
changePage(cur) {
|
changePage(cur) {
|
||||||
this.queryParams.pageNum = cur
|
this.queryParams.pageNum = cur
|
||||||
this.queryData()
|
this.queryData()
|
||||||
|
|
||||||
this.visible = true
|
|
||||||
this.$refs.popoverRef.doShow();
|
|
||||||
},
|
},
|
||||||
onfocus(el) {
|
onClear(el){
|
||||||
this.firstFlag = false;
|
|
||||||
this.queryParams.empCode=null;
|
|
||||||
|
|
||||||
if(this.slable) {
|
|
||||||
this.splaceholder= this.slable
|
|
||||||
}
|
|
||||||
this.visible = true
|
|
||||||
this.slable = null;
|
|
||||||
this.queryParams.searchValue = null;
|
|
||||||
this.queryParams.pageNum = 1
|
|
||||||
this.queryData();
|
|
||||||
},
|
|
||||||
onclear(el){
|
|
||||||
this.firstFlag = false;
|
|
||||||
this.queryParams.empCode=null;
|
|
||||||
|
|
||||||
this.splaceholder = this.placeholder;
|
|
||||||
this.slable = null;
|
this.slable = null;
|
||||||
this.svalue = null;
|
this.svalue = null;
|
||||||
|
|
||||||
this.queryParams.searchValue = null;
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
|
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||||
|
|
||||||
if(this.visible){
|
|
||||||
this.queryData();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onblur(el) {
|
onBlur(el) {
|
||||||
if(this.slable=='' || this.slable=='' || !this.isEdit) {
|
// 如果编辑没有选择则清关历史记录
|
||||||
this.slable = this.splaceholder;
|
if( this.isInputing ){
|
||||||
|
this.svalue = null;
|
||||||
|
this.slable = null;
|
||||||
}
|
}
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||||
},
|
},
|
||||||
queryData() {
|
queryData(val,key) {
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
|
this.queryParams.searchValue = val;
|
||||||
|
this.queryParams.empCode = key;
|
||||||
|
|
||||||
getStaffList(this.queryParams).then(response => {
|
getStaffList(this.queryParams).then(response => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.dataList = response.rows;
|
this.optionItems = response.rows;
|
||||||
this.firstFlag = false;
|
|
||||||
|
|
||||||
if(response.rows.length > 0) {
|
// 初始值存储
|
||||||
const curItem = response.rows.find(item => item.empCode === this.svalue);
|
if(key==null && val==null){
|
||||||
this.showItem(curItem);
|
this.defaultTotal = this.total+0;
|
||||||
}else{
|
this.defaultItems=[...this.optionItems]
|
||||||
const curItem ={
|
|
||||||
empCode:this.svalue,
|
|
||||||
empName:''
|
|
||||||
};
|
|
||||||
this.showItem(curItem);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!this.isInputing ){
|
||||||
|
let selectItem = response.rows.find(item => item.empCode == this.svalue);
|
||||||
|
if(selectItem){
|
||||||
|
this.slable = selectItem.empName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showItem(item){
|
|
||||||
console.log(item);
|
|
||||||
|
|
||||||
// this.slable=item.empCode+'-'+item.empName;
|
|
||||||
if(item!=null){
|
|
||||||
this.slable=item.empName;
|
|
||||||
this.$emit("input", this.svalue);
|
|
||||||
this.$emit("onChange",item);
|
|
||||||
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getIndex($index) {
|
getIndex($index) {
|
||||||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||||
},
|
},
|
||||||
|
|||||||
@ -4,8 +4,13 @@
|
|||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
v-model="svalue"
|
v-model="svalue"
|
||||||
|
|
||||||
|
no-data-text=""
|
||||||
|
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
@change="onChange">
|
@change="onChange"
|
||||||
|
@click.native="onClick"
|
||||||
|
>
|
||||||
<el-option v-for="item in optionItems" :key="item.regionCode" :label="item.regionName" :value="item.regionCode" />
|
<el-option v-for="item in optionItems" :key="item.regionCode" :label="item.regionName" :value="item.regionCode" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
@ -18,7 +23,7 @@
|
|||||||
name: "ProvincePicker",
|
name: "ProvincePicker",
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: [String, Number],
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
countryCode: {
|
countryCode: {
|
||||||
@ -29,42 +34,71 @@
|
|||||||
type: String,
|
type: String,
|
||||||
required: false
|
required: false
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
optionItems: [],
|
|
||||||
svalue: this.value,
|
svalue: this.value,
|
||||||
|
optionItems: [],
|
||||||
|
// 缺省值
|
||||||
|
defaultItems: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
},
|
||||||
countryCode(newVal, oldVal) {
|
countryCode(newVal, oldVal) {
|
||||||
this.queryData();
|
if(newVal!=oldVal){
|
||||||
|
this.defaultItems=null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.queryData();
|
if(this.svalue!=null){
|
||||||
|
this.queryData(null,this.svalue);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
onClick(){
|
||||||
|
// 第一次点击时需要初始化
|
||||||
|
if(!this.defaultItems){
|
||||||
|
this.queryData(null,null);
|
||||||
|
}else{
|
||||||
|
this.optionItems = [...this.defaultItems];
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
onChange() {
|
onChange() {
|
||||||
this.$emit("input", this.svalue);
|
this.$emit("input", this.svalue);
|
||||||
this.$emit("onChange",this.svalue);
|
this.$emit("onChange");
|
||||||
},
|
},
|
||||||
|
queryData(val,key) {
|
||||||
queryData() {
|
|
||||||
this.optionItems =[];
|
this.optionItems =[];
|
||||||
|
|
||||||
let queryParams = {
|
let queryParams = {
|
||||||
pageNum:1,
|
pageNum:1,
|
||||||
pageSize:50,
|
pageSize:50,
|
||||||
countryCode:this.countryCode,
|
countryCode:this.countryCode,
|
||||||
regionCode:this.svalue,
|
regionCode:key,
|
||||||
regionType:1
|
regionType:1
|
||||||
};
|
};
|
||||||
console.log(queryParams);
|
|
||||||
listSimpleEmisRegion(queryParams).then(response => {
|
listSimpleEmisRegion(queryParams).then(response => {
|
||||||
this.optionItems = response.rows;
|
this.optionItems = response.rows;
|
||||||
console.log(response);
|
// 初始值存储
|
||||||
|
if(key==null && val==null){
|
||||||
|
this.defaultItems=[...this.optionItems]
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@ -97,15 +97,15 @@ export default {
|
|||||||
this.prodCode=this.svalue[1];
|
this.prodCode=this.svalue[1];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
svalue(newVal, oldVal) {
|
|
||||||
},
|
|
||||||
countryCode(newVal) {
|
countryCode(newVal) {
|
||||||
this.queryData(0,0);
|
this.queryData(0,0);
|
||||||
this.resetCascader++
|
this.resetCascader++
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
if(this.lineCode == null || this.prodCode != null || this.countryCode!= null){
|
||||||
this.queryData(0,0);
|
this.queryData(0,0);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onFocus(){
|
onFocus(){
|
||||||
@ -114,7 +114,6 @@ export default {
|
|||||||
this.queryData(0,0);
|
this.queryData(0,0);
|
||||||
},
|
},
|
||||||
async queryData(level,parentCode) {
|
async queryData(level,parentCode) {
|
||||||
|
|
||||||
// 第1级是线路
|
// 第1级是线路
|
||||||
if(level == 0){
|
if(level == 0){
|
||||||
let queryParams={
|
let queryParams={
|
||||||
|
|||||||
@ -58,7 +58,6 @@
|
|||||||
border
|
border
|
||||||
stripe
|
stripe
|
||||||
size="mini"
|
size="mini"
|
||||||
:header-cell-style="{background:'#f7f7f7',color:'#606266'}"
|
|
||||||
:data="emisDestinationList"
|
:data="emisDestinationList"
|
||||||
:showSearch.sync="showSearch"
|
:showSearch.sync="showSearch"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -484,7 +484,7 @@ import ProblemTypePicker from '@/views/emis/EmisBaseTools/ProblemTypePicker.vue'
|
|||||||
import {dateToStr} from '@/utils/custom'
|
import {dateToStr} from '@/utils/custom'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "WaybillIsPrinted",
|
name: "SendWaybillList",
|
||||||
components: {
|
components: {
|
||||||
elDateAdvPicker,emisWaybillForm,
|
elDateAdvPicker,emisWaybillForm,
|
||||||
CountryPicker1,
|
CountryPicker1,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user