This commit is contained in:
linfso 2025-02-17 18:05:26 +08:00
parent d5d1c8e36f
commit 8af4307f32
4 changed files with 104 additions and 77 deletions

View File

@ -28,6 +28,8 @@
<script>
import Breadcrumb from '@/components/Breadcrumb/index2'
import {checkRole} from '@/utils/permission'
import { checkToken } from '@/api/login'
import RightPanel from '@/components/RightPanel'
import { AppMain,TopHeader, Navbar, Settings, Sidebar, TagsView } from './components'
import ResizeMixin from './mixin/ResizeHandler'
@ -80,12 +82,21 @@ export default {
return variables;
}
},
mounted() {
this.startCheckToken();
},
methods: {
handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
},
startCheckToken(){
setTimeout(() => {
checkToken().then(res => {
// console.log(res);
}).catch((err) => {
})
}, 60000)
}
}
}

View File

@ -96,7 +96,7 @@ export default {
// })
// })
})
}, 2000)
}, 300000)
}
}
}

View File

@ -1,43 +1,41 @@
<template>
<el-select
style="width: 100%;"
ref="selectRef"
:loading="loading"
filterable
clearable
v-model="svalue"
:placeholder="placeholder"
:filter-method="dataFilter"
style="width: 100%;"
remote
:remote-method="remoteDebounce"
v-model="svalue"
:placeholder="placeholder"
auto-complete="new-password"
:disabled="disabled"
@change="onChange">
@blur="onBlur"
@change="onChange"
@click.native="onClick"
@visible-change="reverseArrow"
>
<el-option v-for="item in optionItems" :key="item.custNo" :label="item.custName" :value="item.custNo" ></el-option>
</el-select>
</template>
<script>
import { listAllSimple } from "@/api/emis/emisMonthpayAccount";
import emitter from 'element-ui/src/mixins/emitter';
import { listAllSimple } from "@/api/emis/emisMonthpayAccount";
import { debounce} from "@/utils/custom";
export default {
name: "AllMonthpayAccountPicker",
mixins: [emitter],
props: {
value: {
type: [String, Number],
required: false
},
sideCode: {
type: String,
required: false
},
payee: {
type: String,
required: false
},
salesmen: {
type: String,
required: false
},
postCode:{
type: String,
required: false
},
isInitiated:{
type: [Boolean,String],
required: false,
@ -63,63 +61,75 @@
};
},
watch: {
value(newVal) {
this.svalue = newVal;
},
svalue(newVal, oldVal) {
// this.$emit("input", this.svalue);
},
postCode(newVal){
}
},
value(newVal,oldVal) {
// 逻辑 有初始值先查询初值
// if(this.value!=null){
this.svalue=this.value;
this.queryData(null,this.svalue);
// }
},
},
created() {
this.initData();
},
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: {
onChange() {
this.$emit("input", this.svalue);
let itemData =null;
this.optionItems.forEach(item=>{
if(item.custNo === this.svalue){
itemData = item;
}
});
this.$emit("onChange",itemData);
this.optionItems = this.bakOptionItems;
},
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() {
this.$emit("input", this.svalue);
let itemData = this.optionItems.find(item => item.monthlyPayCode == this.svalue);
this.$emit("change",itemData);
this.$emit("onChange",itemData);
this.dispatch('ElFormItem', 'el.form.change', [this.svalue]);
},
remoteDebounce(val,key){
debounce(this.queryData(val,key),1000);
},
queryData(val,key) {
this.optionItems=[];
let queryParams = {
pageNum:1,
pageSize:10,
custName:val,
monthlyPayCode:key
};
listAllSimple(queryParams).then(response => {
this.optionItems =response.rows;
// 初始值存储
if(key==null && val==null){
this.defaultItems=[...this.optionItems]
}
});
},
initData() {
this.loading = true;
let queryParams = {
pageNumber:1,
pageSize:1300,
payee:this.payee,
salesmen:this.salesmen
};
this.bakOptionItems=[];
this.optionItems=[];
listAllSimple(queryParams).then(response => {
this.loading = false;
this.bakOptionItems = response.rows;
this.optionItems =this.bakOptionItems;
});
},
dataFilter(val) {
this.optionDefault = val
reverseArrow(flag) {
let rulesDom = this.$refs["selectRef"].$el.querySelector(
".el-input .el-input__suffix .el-input__suffix-inner .el-input__icon"
); // 找到dom
if (flag) {
rulesDom.classList.add("is-reverse"); // 对dom新增class
} else {
rulesDom.classList.remove("is-reverse"); // 对dom新增class
}
},
if (val) {
let searchVal = val.toLowerCase();
this.optionItems = this.bakOptionItems.filter(item => {
if (item.custNo.indexOf(searchVal) != -1 || item.custName.toLowerCase().indexOf(searchVal) != -1 ) {
return true
}
})
} else {
this.optionItems = this.bakOptionItems;
}
},
}
};
</script>

View File

@ -478,7 +478,8 @@ export default {
this.loading = true;
getInfoBySettleBillNo(this.settleBillNo).then(response => {
this.settleBillItem = response.data;
this.form.payManCode = this.settleBillItem.custCode;
this.form.payManCode = this.settleBillItem.custNo;
this.form.payMan=this.settleBillItem.custName;
console.log("===>settleBillItem3333===>",this.settleBillItem)
this.loading = false;
});
@ -598,6 +599,11 @@ export default {
this.form.payMan=item;
},
onMonthpayAccountSelect(item){
console.log("onMonthpayAccountSelect==>",item);
if(item==null){
this.form.payMan=null;
return;
}
this.form.payMan=item.custName;
},
// 取消按钮