md
This commit is contained in:
parent
2079a00e2b
commit
8a9f078eb7
@ -41,15 +41,16 @@
|
||||
<div style="text-align: right;width: 50%;"><el-button type="text" size="mini" plain @click="delAllStorage" >重置</el-button></div>
|
||||
</div>
|
||||
<draggable v-model="storageList"
|
||||
ghostClass="drag-ghost"
|
||||
chosenClass="drag-chosen"
|
||||
:animation="500"
|
||||
handle=".el-icon-s-operation"
|
||||
@end="updateTable">
|
||||
<div v-for="clo in storageList" :key="clo.label" class="setting-row">
|
||||
ghostClass="drag-ghost"
|
||||
chosenClass="drag-chosen"
|
||||
:animation="500"
|
||||
handle=".el-icon-s-operation"
|
||||
@end="updateTable"
|
||||
>
|
||||
<div v-for="col in storageList" :key="col.label" class="setting-row">
|
||||
<!-- <i class="el-icon-s-operation" /> -->
|
||||
<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
|
||||
class="btn"
|
||||
size="mini"
|
||||
@ -68,16 +69,16 @@
|
||||
<el-button style="margin-left: 10px;" slot="reference" size="mini" circle icon="el-icon-menu" />
|
||||
</el-popover>
|
||||
</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-tooltip> -->
|
||||
</el-tooltip>
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
<div>
|
||||
<orig-table ref="table" :config="config" />
|
||||
<orig-table ref="table" :config="config" />
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
|
||||
@ -6,6 +6,7 @@ import dialogDragHeight from './dialog/dragHeight'
|
||||
import dialogFullScreen from './dialog/fullScreen'
|
||||
import clipboard from './module/clipboard'
|
||||
import elSelectLoadmore from './ext/elSelectLoadmore'
|
||||
import elTableResizeHeight from './table/resizeHeight'
|
||||
|
||||
const install = function(Vue) {
|
||||
Vue.directive('hasRole', hasRole)
|
||||
@ -15,6 +16,8 @@ const install = function(Vue) {
|
||||
Vue.directive('dialogDragWidth', dialogDragWidth)
|
||||
Vue.directive('dialogDragHeight', dialogDragHeight)
|
||||
Vue.directive('dialogFullScreen', dialogFullScreen)
|
||||
Vue.directive('elTableResizeHeight', elTableResizeHeight)
|
||||
// v-elTableResizeHeight="{bottomOffset: 85}"
|
||||
|
||||
Vue.directive('el-select-loadmore', elSelectLoadmore);
|
||||
}
|
||||
|
||||
@ -21,6 +21,8 @@ import { download } from '@/utils/request'
|
||||
import { triggerTrans } from '@/utils/custom'
|
||||
import TanexPrinterSdk from '@/utils/TanexPrinterSdk'
|
||||
|
||||
// import _ from 'lodash'
|
||||
|
||||
import './assets/icons' // icon
|
||||
import './permission' // permission control
|
||||
import { getDicts } from "@/api/system/dict/data";
|
||||
@ -95,6 +97,8 @@ const tanexPrinter = TanexPrinterSdk.getInstance();
|
||||
Vue.prototype.$tanexPrinter = tanexPrinter;
|
||||
Vue.prototype.$t = (key, value) => i18n.t(triggerTrans(key,i18n.locale), value)
|
||||
|
||||
// Vue.prototype._ = _
|
||||
|
||||
// vue 页面捕获
|
||||
// const __patch__ = Vue.prototype.__patch__;
|
||||
// Vue.prototype.__patch__ = function() {
|
||||
|
||||
@ -5,7 +5,9 @@
|
||||
clearable
|
||||
v-model="svalue"
|
||||
: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-select>
|
||||
</template>
|
||||
@ -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]
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -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"
|
||||
>
|
||||
<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() {
|
||||
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) {
|
||||
|
||||
@ -6,23 +6,17 @@
|
||||
effect="light"
|
||||
: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
|
||||
v-loading="loading"
|
||||
style="width: 100%;"
|
||||
:data="dataList"
|
||||
@row-click="onRowClick"
|
||||
stripe size="mini"
|
||||
element-loading-text="Loading"
|
||||
v-loading="loading"
|
||||
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="phone" width="100" />
|
||||
@ -43,6 +37,24 @@
|
||||
/>
|
||||
</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>
|
||||
|
||||
</div>
|
||||
@ -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]
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -5,7 +5,9 @@
|
||||
clearable
|
||||
v-model="svalue"
|
||||
: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-select>
|
||||
</template>
|
||||
@ -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]
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -1,6 +1,25 @@
|
||||
<template>
|
||||
<el-select
|
||||
style="width:100%"
|
||||
ref="selectRef"
|
||||
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
|
||||
autocomplete="false"
|
||||
ref="selectRef"
|
||||
@ -13,23 +32,21 @@
|
||||
class="remote-select"
|
||||
@change="onChange"
|
||||
@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>
|
||||
<script>
|
||||
import emitter from 'element-ui/src/mixins/emitter';
|
||||
import { listSimpleEmisSite } from "@/api/emis/emisSite";
|
||||
|
||||
export default {
|
||||
name: "EmisSiteSimplePicker",
|
||||
components: {
|
||||
|
||||
},
|
||||
dicts: [],
|
||||
mixins: [emitter],
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
@ -47,11 +64,6 @@
|
||||
type: [String,Number],
|
||||
required: false
|
||||
},
|
||||
isInitiated:{
|
||||
type: [Boolean,String],
|
||||
required: false,
|
||||
default:false
|
||||
},
|
||||
disabled:{
|
||||
type: [Boolean,String],
|
||||
required: false
|
||||
@ -60,30 +72,42 @@
|
||||
data() {
|
||||
return {
|
||||
loading:false,
|
||||
visible:false,
|
||||
optionItems: [],
|
||||
|
||||
svalue: this.value,
|
||||
firstFlag:true,
|
||||
filterMap:new Map(),
|
||||
optionItems: [],
|
||||
// 缺省值
|
||||
defaultItems: null,
|
||||
itemMap:new Map(),
|
||||
|
||||
queryParams:{
|
||||
pageNum:1,
|
||||
pageSize:10,
|
||||
siteType:this.siteType,
|
||||
countryCode:this.countryCode,
|
||||
siteCode:this.value
|
||||
siteCode:null,
|
||||
siteName:null
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newVal) {
|
||||
this.svalue = newVal;
|
||||
this.queryData();
|
||||
value(newVal,oldVal) {
|
||||
// 逻辑 有初始值先查询初值
|
||||
if(this.value!=null){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
siteType(newVal, oldVal) {
|
||||
this.queryData();
|
||||
if(newVal!=oldVal){
|
||||
this.queryParams.siteType=newVal
|
||||
this.defaultItems=null;
|
||||
}
|
||||
},
|
||||
countryCode(newVal, oldVal) {
|
||||
this.queryData();
|
||||
if(newVal!=oldVal){
|
||||
this.queryParams.countryCode=newVal
|
||||
this.defaultItems=null;
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
@ -91,58 +115,46 @@
|
||||
rulesDom.classList.add("el-icon-arrow-up"); // 对dom新增class
|
||||
},
|
||||
created() {
|
||||
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);
|
||||
let itemData=this.filterMap[this.svalue];
|
||||
let itemData = this.optionItems.find(item => item.siteCode == this.svalue);
|
||||
this.$emit("onChange",itemData);
|
||||
},
|
||||
onClear(){
|
||||
this.$emit("input", this.svalue);
|
||||
this.$emit("onClear");
|
||||
this.queryParams.siteName=null;
|
||||
this.queryData();
|
||||
this.$emit("onChange",null);
|
||||
},
|
||||
onFocus(){
|
||||
this.firstFlag = false;
|
||||
this.queryParams.siteCode=null;
|
||||
this.queryData();
|
||||
onBlur(val){
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur');
|
||||
},
|
||||
queryData(val){
|
||||
queryData(val,key) {
|
||||
this.optionItems=[];
|
||||
|
||||
this.queryParams.siteCode=key;
|
||||
this.queryParams.siteName=val;
|
||||
|
||||
listSimpleEmisSite(this.queryParams).then(response => {
|
||||
this.optionItems=response.rows;
|
||||
response.rows.forEach(item => {
|
||||
if(!this.filterMap.hasOwnProperty(item.siteCode)){
|
||||
this.filterMap[item.siteCode]=item;
|
||||
}
|
||||
});
|
||||
// 初始值存储
|
||||
if(key==null && val==null){
|
||||
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) {
|
||||
let rulesDom = this.$refs["selectRef"].$el.querySelector(
|
||||
".el-input .el-input__suffix .el-input__suffix-inner .el-input__icon"
|
||||
|
||||
@ -4,43 +4,49 @@
|
||||
placement="bottom"
|
||||
trigger="click"
|
||||
ref="popoverRef"
|
||||
effect="light"
|
||||
:show-arrow="false"
|
||||
:popper-options="{ boundariesElement: '.el-form', removeOnDestroy: true }"
|
||||
>
|
||||
<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 >
|
||||
<!-- class="el-table--scrollable-y" border max-height="300px" -->
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
style="width: 100%;"
|
||||
:data="dataList"
|
||||
@row-click="onRowClick"
|
||||
stripe
|
||||
size="mini"
|
||||
element-loading-text="Loading" ref="comboGridTable" fit highlight-current-row>
|
||||
<!-- <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="center" prop="empName" width="100" :show-overflow-tooltip="true" />
|
||||
<el-table-column label="所属网点" align="center" prop="ownerSiteName" width="100" :show-overflow-tooltip="true" />
|
||||
<div >
|
||||
<el-table
|
||||
ref="comboGridTable"
|
||||
v-loading="loading"
|
||||
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="员工编号" 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="ownerSiteName" width="100" :show-overflow-tooltip="true" />
|
||||
|
||||
</el-table>
|
||||
<el-pagination v-show="pagination" small
|
||||
:total="total"
|
||||
:page-size="5"
|
||||
layout="prev, pager, next, total"
|
||||
@current-change="changePage"
|
||||
/>
|
||||
</div>
|
||||
</el-table>
|
||||
<el-pagination v-show="pagination" small
|
||||
:total="total"
|
||||
:page-size="5"
|
||||
layout="prev, pager, next, total"
|
||||
@current-change="changePage"
|
||||
/>
|
||||
</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>
|
||||
|
||||
@ -56,7 +62,7 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
||||
mixins: [emitter],
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number],
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
sideCode: {
|
||||
@ -67,65 +73,59 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
isInitiated:{
|
||||
type: [Boolean,String],
|
||||
required: false,
|
||||
default:false
|
||||
},
|
||||
placeholder:{
|
||||
placeholder:{
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
disabled:{
|
||||
disabled:{
|
||||
type: [Boolean,String],
|
||||
required: false
|
||||
},
|
||||
pagination: {
|
||||
type: Boolean, default: true
|
||||
},
|
||||
},
|
||||
pagination: {
|
||||
type: Boolean, default: true
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
createdId: '0',
|
||||
loading:false,
|
||||
visible:false,
|
||||
dataList: [],
|
||||
|
||||
total:0,
|
||||
optionItems: [],
|
||||
|
||||
// 缺省值
|
||||
defaultTotal:0,
|
||||
defaultItems:null,
|
||||
|
||||
svalue: this.value,
|
||||
slable: null,
|
||||
isEdit:false,
|
||||
splaceholder:this.placeholder,
|
||||
firstFlag:true,
|
||||
|
||||
isInputing: false,
|
||||
|
||||
queryParams:{
|
||||
pageNum:1,
|
||||
pageSize:5,
|
||||
empCode:this.value,
|
||||
empCode:null,
|
||||
searchValue:null,
|
||||
ownerSiteCode:null,
|
||||
postCode:null
|
||||
ownerSiteCode:this.sideCode,
|
||||
postCode:this.postCode
|
||||
}
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value(newVal,oldVal) {
|
||||
this.svalue = newVal;
|
||||
console.log("empCode1==>"+newVal);
|
||||
console.log("this.svalue1==>"+this.svalue);
|
||||
console.log("this.svalue1==>"+this.firstFlag);
|
||||
if(this.svalue!=null&&this.firstFlag){
|
||||
this.queryParams.empCode=this.svalue;
|
||||
this.queryData();
|
||||
if(this.value!=null){
|
||||
this.svalue=this.value;
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
siteCode(newVal){
|
||||
console.log("siteCode==>"+newVal);
|
||||
this.queryParams.ownerSiteCode=newVal;
|
||||
this.queryData();
|
||||
this.defaultItems=null;
|
||||
},
|
||||
postCode(newVal){
|
||||
console.log("postCode==>"+newVal);
|
||||
this.queryParams.postCode=newVal;
|
||||
this.queryData();
|
||||
this.defaultItems=null;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@ -133,107 +133,95 @@ import { getStaffList } from "@/api/emis/emisStaff";
|
||||
this.createdId = String(new Date().getTime())
|
||||
},
|
||||
created() {
|
||||
this.queryData();
|
||||
if(this.svalue!=null){
|
||||
this.queryData(null,this.svalue);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
changeValue(val) {
|
||||
if(this.queryParams.searchValue === val ) return;
|
||||
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();
|
||||
},
|
||||
handleInput(val) {
|
||||
if(val == null ) return;
|
||||
|
||||
this.isInputing = true;
|
||||
this.slable = val;
|
||||
this.isEdit = true;
|
||||
this.queryParams.searchValue = val
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryData(val,null)
|
||||
|
||||
this.queryData()
|
||||
},
|
||||
onRowClick(row, column, event) {
|
||||
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("onChange",row);
|
||||
this.$refs.popoverRef.doClose();
|
||||
},
|
||||
isRed({ row }) {
|
||||
if (row.empCode == this.svalue) {
|
||||
return {
|
||||
"color": "red",
|
||||
"font-weight": "bold",
|
||||
};
|
||||
}
|
||||
},
|
||||
changePage(cur) {
|
||||
this.queryParams.pageNum = cur
|
||||
this.queryData()
|
||||
|
||||
this.visible = true
|
||||
this.$refs.popoverRef.doShow();
|
||||
},
|
||||
onfocus(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;
|
||||
onClear(el){
|
||||
this.slable = null;
|
||||
this.svalue = null;
|
||||
|
||||
this.queryParams.searchValue = null;
|
||||
this.queryParams.pageNum = 1;
|
||||
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||
|
||||
if(this.visible){
|
||||
this.queryData();
|
||||
}
|
||||
},
|
||||
onblur(el) {
|
||||
if(this.slable=='' || this.slable=='' || !this.isEdit) {
|
||||
this.slable = this.splaceholder;
|
||||
onBlur(el) {
|
||||
// 如果编辑没有选择则清关历史记录
|
||||
if( this.isInputing ){
|
||||
this.svalue = null;
|
||||
this.slable = null;
|
||||
}
|
||||
this.$emit("input", this.svalue);
|
||||
this.dispatch('ElFormItem', 'el.form.blur', [this.svalue]);
|
||||
},
|
||||
queryData() {
|
||||
|
||||
queryData(val,key) {
|
||||
this.loading = true;
|
||||
|
||||
this.queryParams.searchValue = val;
|
||||
this.queryParams.empCode = key;
|
||||
|
||||
getStaffList(this.queryParams).then(response => {
|
||||
this.loading = false;
|
||||
this.total = response.total;
|
||||
this.dataList = response.rows;
|
||||
this.firstFlag = false;
|
||||
this.optionItems = response.rows;
|
||||
|
||||
if(response.rows.length > 0) {
|
||||
const curItem = response.rows.find(item => item.empCode === this.svalue);
|
||||
this.showItem(curItem);
|
||||
}else{
|
||||
const curItem ={
|
||||
empCode:this.svalue,
|
||||
empName:''
|
||||
};
|
||||
this.showItem(curItem);
|
||||
// 初始值存储
|
||||
if(key==null && val==null){
|
||||
this.defaultTotal = this.total+0;
|
||||
this.defaultItems=[...this.optionItems]
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
showItem(item){
|
||||
console.log(item);
|
||||
if(!this.isInputing ){
|
||||
let selectItem = response.rows.find(item => item.empCode == this.svalue);
|
||||
if(selectItem){
|
||||
this.slable = selectItem.empName;
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + $index + 1
|
||||
|
||||
@ -4,8 +4,13 @@
|
||||
filterable
|
||||
clearable
|
||||
v-model="svalue"
|
||||
|
||||
no-data-text=""
|
||||
|
||||
: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-select>
|
||||
|
||||
@ -18,7 +23,7 @@
|
||||
name: "ProvincePicker",
|
||||
props: {
|
||||
value: {
|
||||
type: [String, Number],
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
countryCode: {
|
||||
@ -29,42 +34,71 @@
|
||||
type: String,
|
||||
required: false
|
||||
},
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
optionItems: [],
|
||||
svalue: this.value,
|
||||
optionItems: [],
|
||||
// 缺省值
|
||||
defaultItems: null,
|
||||
};
|
||||
},
|
||||
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) {
|
||||
this.queryData();
|
||||
if(newVal!=oldVal){
|
||||
this.defaultItems=null;
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
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",this.svalue);
|
||||
this.$emit("onChange");
|
||||
},
|
||||
|
||||
queryData() {
|
||||
queryData(val,key) {
|
||||
this.optionItems =[];
|
||||
|
||||
let queryParams = {
|
||||
pageNum:1,
|
||||
pageSize:50,
|
||||
countryCode:this.countryCode,
|
||||
regionCode:this.svalue,
|
||||
regionCode:key,
|
||||
regionType:1
|
||||
};
|
||||
console.log(queryParams);
|
||||
|
||||
listSimpleEmisRegion(queryParams).then(response => {
|
||||
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];
|
||||
}
|
||||
},
|
||||
svalue(newVal, oldVal) {
|
||||
},
|
||||
countryCode(newVal) {
|
||||
this.queryData(0,0);
|
||||
this.resetCascader++
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.queryData(0,0);
|
||||
if(this.lineCode == null || this.prodCode != null || this.countryCode!= null){
|
||||
this.queryData(0,0);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onFocus(){
|
||||
@ -114,7 +114,6 @@ export default {
|
||||
this.queryData(0,0);
|
||||
},
|
||||
async queryData(level,parentCode) {
|
||||
|
||||
// 第1级是线路
|
||||
if(level == 0){
|
||||
let queryParams={
|
||||
|
||||
@ -58,7 +58,6 @@
|
||||
border
|
||||
stripe
|
||||
size="mini"
|
||||
:header-cell-style="{background:'#f7f7f7',color:'#606266'}"
|
||||
:data="emisDestinationList"
|
||||
:showSearch.sync="showSearch"
|
||||
: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'
|
||||
|
||||
export default {
|
||||
name: "WaybillIsPrinted",
|
||||
name: "SendWaybillList",
|
||||
components: {
|
||||
elDateAdvPicker,emisWaybillForm,
|
||||
CountryPicker1,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user