优化报表中会员、供应商和客户的加载逻辑

This commit is contained in:
jishenghua
2025-09-27 15:41:19 +08:00
parent 289123df80
commit 7bc55dd9fa
6 changed files with 163 additions and 25 deletions

View File

@@ -10,8 +10,13 @@
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="客户" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择客户" v-model="queryParam.organId" <a-select placeholder="请选择客户" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children"> :dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children" @search="handleSearchCustomer">
<a-select-option v-for="(item,index) in supList" :key="index" :value="item.id"> <div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div class="dropdown-btn" @mousedown="e => e.preventDefault()" @click="initCustomer"><a-icon type="reload" /> 刷新列表</div>
</div>
<a-select-option v-for="(item,index) in cusList" :key="index" :value="item.id">
{{ item.supplier }} {{ item.supplier }}
</a-select-option> </a-select-option>
</a-select> </a-select>
@@ -148,7 +153,11 @@
mixins:[JeecgListMixin], mixins:[JeecgListMixin],
components: { components: {
DebtAccountList, DebtAccountList,
JEllipsis JEllipsis,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
}, },
data () { data () {
return { return {
@@ -172,9 +181,10 @@
pageSize: 11, pageSize: 11,
pageSizeOptions: ['11', '21', '31', '101', '201'] pageSizeOptions: ['11', '21', '31', '101', '201']
}, },
supList: [], cusList: [],
firstTotal: '', firstTotal: '',
lastTotal: '', lastTotal: '',
setTimeFlag: null,
tabKey: "1", tabKey: "1",
pageName: 'customerAccount', pageName: 'customerAccount',
// 默认索引 // 默认索引
@@ -208,7 +218,7 @@
} }
}, },
created () { created () {
this.initSupplier() this.initCustomer()
this.initColumnsSetting() this.initColumnsSetting()
}, },
methods: { methods: {
@@ -219,14 +229,27 @@
param.pageSize = this.ipagination.pageSize-1; param.pageSize = this.ipagination.pageSize-1;
return param; return param;
}, },
initSupplier() { initCustomer() {
let that = this; let that = this;
findBySelectCus({}).then((res)=>{ findBySelectCus({}).then((res)=>{
if(res) { if(res) {
that.supList = res; that.cusList = res;
} }
}); });
}, },
handleSearchCustomer(value) {
let that = this
if(this.setTimeFlag != null){
clearTimeout(this.setTimeFlag);
}
this.setTimeFlag = setTimeout(()=>{
findBySelectCus({key: value}).then((res) => {
if(res) {
that.cusList = res;
}
})
},500)
},
onDateChange: function (value, dateString) { onDateChange: function (value, dateString) {
this.queryParam.beginTime=dateString[0] this.queryParam.beginTime=dateString[0]
this.queryParam.endTime=dateString[1] this.queryParam.endTime=dateString[1]

View File

@@ -50,7 +50,12 @@
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择往来单位" v-model="queryParam.organId" <a-select placeholder="请选择往来单位" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children"> :dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children" @search="handleSearchOrgan">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div class="dropdown-btn" @mousedown="e => e.preventDefault()" @click="initOrgan"><a-icon type="reload" /> 刷新列表</div>
</div>
<a-select-option v-for="(item,index) in organList" :key="index" :value="item.id"> <a-select-option v-for="(item,index) in organList" :key="index" :value="item.id">
{{ item.supplier }} {{ item.supplier }}
</a-select-option> </a-select-option>
@@ -186,7 +191,11 @@
mixins:[JeecgListMixin], mixins:[JeecgListMixin],
components: { components: {
BillDetail, BillDetail,
JEllipsis JEllipsis,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
}, },
data () { data () {
return { return {
@@ -222,6 +231,7 @@
categoryTree:[], categoryTree:[],
operNumberTotalStr: '0', operNumberTotalStr: '0',
allPriceTotalStr: '0', allPriceTotalStr: '0',
setTimeFlag: null,
tabKey: "1", tabKey: "1",
pageName: 'inDetail', pageName: 'inDetail',
// 默认索引 // 默认索引
@@ -265,7 +275,7 @@
}, },
created () { created () {
this.getDepotData() this.getDepotData()
this.initSupplier() this.initOrgan()
this.initUser() this.initUser()
this.loadAllOrgaData() this.loadAllOrgaData()
this.loadCategoryTreeData() this.loadCategoryTreeData()
@@ -308,7 +318,7 @@
this.loading = false; this.loading = false;
}) })
}, },
initSupplier() { initOrgan() {
let that = this; let that = this;
findBySelectOrgan({}).then((res)=>{ findBySelectOrgan({}).then((res)=>{
if(res) { if(res) {
@@ -316,6 +326,19 @@
} }
}); });
}, },
handleSearchOrgan(value) {
let that = this
if(this.setTimeFlag != null){
clearTimeout(this.setTimeFlag);
}
this.setTimeFlag = setTimeout(()=>{
findBySelectOrgan({key: value}).then((res) => {
if(res) {
that.organList = res;
}
})
},500)
},
getDepotData() { getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{ getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){ if(res.code === 200){

View File

@@ -45,7 +45,12 @@
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择往来单位" v-model="queryParam.organId" <a-select placeholder="请选择往来单位" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children"> :dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children" @search="handleSearchOrgan">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div class="dropdown-btn" @mousedown="e => e.preventDefault()" @click="initOrgan"><a-icon type="reload" /> 刷新列表</div>
</div>
<a-select-option v-for="(item,index) in organList" :key="index" :value="item.id"> <a-select-option v-for="(item,index) in organList" :key="index" :value="item.id">
{{ item.supplier }} {{ item.supplier }}
</a-select-option> </a-select-option>
@@ -159,7 +164,11 @@
name: "InMaterialCount", name: "InMaterialCount",
mixins:[JeecgListMixin], mixins:[JeecgListMixin],
components: { components: {
JEllipsis JEllipsis,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
}, },
data () { data () {
return { return {
@@ -191,6 +200,7 @@
categoryTree:[], categoryTree:[],
numSumTotalStr: '0', numSumTotalStr: '0',
priceSumTotalStr: '0', priceSumTotalStr: '0',
setTimeFlag: null,
tabKey: "1", tabKey: "1",
pageName: 'inMaterialCount', pageName: 'inMaterialCount',
// 默认索引 // 默认索引
@@ -222,7 +232,7 @@
}, },
created () { created () {
this.getDepotData() this.getDepotData()
this.initSupplier() this.initOrgan()
this.loadAllOrgaData() this.loadAllOrgaData()
this.loadCategoryTreeData() this.loadCategoryTreeData()
this.initColumnsSetting() this.initColumnsSetting()
@@ -264,7 +274,7 @@
this.loading = false; this.loading = false;
}) })
}, },
initSupplier() { initOrgan() {
let that = this; let that = this;
findBySelectOrgan({}).then((res)=>{ findBySelectOrgan({}).then((res)=>{
if(res) { if(res) {
@@ -272,6 +282,19 @@
} }
}); });
}, },
handleSearchOrgan(value) {
let that = this
if(this.setTimeFlag != null){
clearTimeout(this.setTimeFlag);
}
this.setTimeFlag = setTimeout(()=>{
findBySelectOrgan({key: value}).then((res) => {
if(res) {
that.organList = res;
}
})
},500)
},
getDepotData() { getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{ getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){ if(res.code === 200){

View File

@@ -50,7 +50,12 @@
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择往来单位" v-model="queryParam.organId" <a-select placeholder="请选择往来单位" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children"> :dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children" @search="handleSearchOrgan">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div class="dropdown-btn" @mousedown="e => e.preventDefault()" @click="initOrgan"><a-icon type="reload" /> 刷新列表</div>
</div>
<a-select-option v-for="(item,index) in organList" :key="index" :value="item.id"> <a-select-option v-for="(item,index) in organList" :key="index" :value="item.id">
{{ item.supplier }} {{ item.supplier }}
</a-select-option> </a-select-option>
@@ -186,7 +191,11 @@
mixins:[JeecgListMixin], mixins:[JeecgListMixin],
components: { components: {
BillDetail, BillDetail,
JEllipsis JEllipsis,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
}, },
data () { data () {
return { return {
@@ -222,6 +231,7 @@
categoryTree:[], categoryTree:[],
operNumberTotalStr: '0', operNumberTotalStr: '0',
allPriceTotalStr: '0', allPriceTotalStr: '0',
setTimeFlag: null,
tabKey: "1", tabKey: "1",
pageName: 'outDetail', pageName: 'outDetail',
// 默认索引 // 默认索引
@@ -265,7 +275,7 @@
}, },
created () { created () {
this.getDepotData() this.getDepotData()
this.initSupplier() this.initOrgan()
this.initUser() this.initUser()
this.loadAllOrgaData() this.loadAllOrgaData()
this.loadCategoryTreeData() this.loadCategoryTreeData()
@@ -308,7 +318,7 @@
this.loading = false; this.loading = false;
}) })
}, },
initSupplier() { initOrgan() {
let that = this; let that = this;
findBySelectOrgan({}).then((res)=>{ findBySelectOrgan({}).then((res)=>{
if(res) { if(res) {
@@ -316,6 +326,19 @@
} }
}); });
}, },
handleSearchOrgan(value) {
let that = this
if(this.setTimeFlag != null){
clearTimeout(this.setTimeFlag);
}
this.setTimeFlag = setTimeout(()=>{
findBySelectOrgan({key: value}).then((res) => {
if(res) {
that.organList = res;
}
})
},500)
},
getDepotData() { getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{ getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){ if(res.code === 200){

View File

@@ -45,7 +45,12 @@
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="往来单位" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择往来单位" v-model="queryParam.organId" <a-select placeholder="请选择往来单位" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children"> :dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children" @search="handleSearchOrgan">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div class="dropdown-btn" @mousedown="e => e.preventDefault()" @click="initOrgan"><a-icon type="reload" /> 刷新列表</div>
</div>
<a-select-option v-for="(item,index) in organList" :key="index" :value="item.id"> <a-select-option v-for="(item,index) in organList" :key="index" :value="item.id">
{{ item.supplier }} {{ item.supplier }}
</a-select-option> </a-select-option>
@@ -159,7 +164,11 @@
name: "OutMaterialCount", name: "OutMaterialCount",
mixins:[JeecgListMixin], mixins:[JeecgListMixin],
components: { components: {
JEllipsis JEllipsis,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
}, },
data () { data () {
return { return {
@@ -191,6 +200,7 @@
categoryTree:[], categoryTree:[],
numSumTotalStr: '0', numSumTotalStr: '0',
priceSumTotalStr: '0', priceSumTotalStr: '0',
setTimeFlag: null,
tabKey: "1", tabKey: "1",
pageName: 'outMaterialCount', pageName: 'outMaterialCount',
// 默认索引 // 默认索引
@@ -222,7 +232,7 @@
}, },
created () { created () {
this.getDepotData() this.getDepotData()
this.initSupplier() this.initOrgan()
this.loadAllOrgaData() this.loadAllOrgaData()
this.loadCategoryTreeData() this.loadCategoryTreeData()
this.initColumnsSetting() this.initColumnsSetting()
@@ -264,7 +274,7 @@
this.loading = false; this.loading = false;
}) })
}, },
initSupplier() { initOrgan() {
let that = this; let that = this;
findBySelectOrgan({}).then((res)=>{ findBySelectOrgan({}).then((res)=>{
if(res) { if(res) {
@@ -272,6 +282,19 @@
} }
}); });
}, },
handleSearchOrgan(value) {
let that = this
if(this.setTimeFlag != null){
clearTimeout(this.setTimeFlag);
}
this.setTimeFlag = setTimeout(()=>{
findBySelectOrgan({key: value}).then((res) => {
if(res) {
that.organList = res;
}
})
},500)
},
getDepotData() { getDepotData() {
getAction('/depot/findDepotByCurrentUser').then((res)=>{ getAction('/depot/findDepotByCurrentUser').then((res)=>{
if(res.code === 200){ if(res.code === 200){

View File

@@ -10,7 +10,12 @@
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="供应商" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select placeholder="请选择供应商" v-model="queryParam.organId" <a-select placeholder="请选择供应商" v-model="queryParam.organId"
:dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children"> :dropdownMatchSelectWidth="false" showSearch allow-clear optionFilterProp="children" @search="handleSearchSupplier">
<div slot="dropdownRender" slot-scope="menu">
<v-nodes :vnodes="menu" />
<a-divider style="margin: 4px 0;" />
<div class="dropdown-btn" @mousedown="e => e.preventDefault()" @click="initSupplier"><a-icon type="reload" /> 刷新列表</div>
</div>
<a-select-option v-for="(item,index) in supList" :key="index" :value="item.id"> <a-select-option v-for="(item,index) in supList" :key="index" :value="item.id">
{{ item.supplier }} {{ item.supplier }}
</a-select-option> </a-select-option>
@@ -148,7 +153,11 @@
mixins:[JeecgListMixin], mixins:[JeecgListMixin],
components: { components: {
DebtAccountList, DebtAccountList,
JEllipsis JEllipsis,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
}, },
data () { data () {
return { return {
@@ -175,6 +184,7 @@
supList: [], supList: [],
firstTotal: '', firstTotal: '',
lastTotal: '', lastTotal: '',
setTimeFlag: null,
tabKey: "1", tabKey: "1",
pageName: 'vendorAccount', pageName: 'vendorAccount',
// 默认索引 // 默认索引
@@ -227,6 +237,19 @@
} }
}); });
}, },
handleSearchSupplier(value) {
let that = this
if(this.setTimeFlag != null){
clearTimeout(this.setTimeFlag);
}
this.setTimeFlag = setTimeout(()=>{
findBySelectSup({key: value}).then((res) => {
if(res) {
that.supList = res;
}
})
},500)
},
onDateChange: function (value, dateString) { onDateChange: function (value, dateString) {
this.queryParam.beginTime=dateString[0] this.queryParam.beginTime=dateString[0]
this.queryParam.endTime=dateString[1] this.queryParam.endTime=dateString[1]