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> <script>
import Breadcrumb from '@/components/Breadcrumb/index2' import Breadcrumb from '@/components/Breadcrumb/index2'
import {checkRole} from '@/utils/permission' import {checkRole} from '@/utils/permission'
import { checkToken } from '@/api/login'
import RightPanel from '@/components/RightPanel' import RightPanel from '@/components/RightPanel'
import { AppMain,TopHeader, Navbar, Settings, Sidebar, TagsView } from './components' import { AppMain,TopHeader, Navbar, Settings, Sidebar, TagsView } from './components'
import ResizeMixin from './mixin/ResizeHandler' import ResizeMixin from './mixin/ResizeHandler'
@ -80,12 +82,21 @@ export default {
return variables; return variables;
} }
}, },
mounted() { mounted() {
this.startCheckToken();
}, },
methods: { methods: {
handleClickOutside() { handleClickOutside() {
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false }) 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> <template>
<el-select <el-select
style="width: 100%;"
ref="selectRef"
:loading="loading" :loading="loading"
filterable filterable
clearable clearable
v-model="svalue"
:placeholder="placeholder" remote
:filter-method="dataFilter" :remote-method="remoteDebounce"
style="width: 100%;" v-model="svalue"
:placeholder="placeholder"
auto-complete="new-password"
:disabled="disabled" :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-option v-for="item in optionItems" :key="item.custNo" :label="item.custName" :value="item.custNo" ></el-option>
</el-select> </el-select>
</template> </template>
<script> <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 { export default {
name: "AllMonthpayAccountPicker", name: "AllMonthpayAccountPicker",
mixins: [emitter],
props: { props: {
value: { value: {
type: [String, Number], type: [String, Number],
required: false required: false
}, },
sideCode: {
type: String,
required: false
},
payee: {
type: String,
required: false
},
salesmen: {
type: String,
required: false
},
postCode:{
type: String,
required: false
},
isInitiated:{ isInitiated:{
type: [Boolean,String], type: [Boolean,String],
required: false, required: false,
@ -63,63 +61,75 @@
}; };
}, },
watch: { watch: {
value(newVal) { value(newVal,oldVal) {
this.svalue = newVal; // 逻辑 有初始值先查询初值
}, // if(this.value!=null){
svalue(newVal, oldVal) { this.svalue=this.value;
// this.$emit("input", this.svalue); this.queryData(null,this.svalue);
}, // }
postCode(newVal){ },
},
}
},
created() { 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: { methods: {
onChange() { onClick(){
this.$emit("input", this.svalue); // 第一次点击时需要初始化
let itemData =null; if(!this.defaultItems){
this.optionItems.forEach(item=>{ this.queryData(null,null);
if(item.custNo === this.svalue){ }else{
itemData = item; this.optionItems = [...this.defaultItems];
} }
}); },
this.$emit("onChange",itemData); onBlur(val){
this.optionItems = this.bakOptionItems; 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;
}); reverseArrow(flag) {
}, let rulesDom = this.$refs["selectRef"].$el.querySelector(
dataFilter(val) { ".el-input .el-input__suffix .el-input__suffix-inner .el-input__icon"
this.optionDefault = val ); // 找到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> </script>

View File

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