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

This commit is contained in:
jishenghua
2025-09-27 22:39:55 +08:00
parent b699da8aaf
commit d038d41190
2 changed files with 70 additions and 3 deletions

View File

@@ -22,7 +22,12 @@
<a-row :gutter="24">
<a-col :md="4" :sm="24" v-if="organLabel">
<a-form-item :label="organLabel" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">
<a-select v-model="queryParam.organId" :dropdownMatchSelectWidth="false" showSearch optionFilterProp="children">
<a-select placeholder="请选择" v-model="queryParam.organId" :dropdownMatchSelectWidth="false" showSearch 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="loadSupplier(organLabel)"><a-icon type="reload" /> 刷新列表</div>
</div>
<a-select-option v-for="(item,index) in supplierList" :key="index" :value="item.id">
{{ item.supplier }}
</a-select-option>
@@ -104,6 +109,10 @@
mixins:[JeecgListMixin, mixinDevice],
components: {
BillDetail,
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
@@ -113,7 +122,7 @@
organLabel: '',
supplierList: [],
queryParam: {
organId: "",
organId: undefined,
number: "",
materialParam: "",
type: "",
@@ -225,6 +234,29 @@
})
}
},
handleSearchSupplier(value) {
let that = this
if(this.setTimeFlag != null){
clearTimeout(this.setTimeFlag);
}
if(this.organLabel === '供应商') {
this.setTimeFlag = setTimeout(() => {
findBySelectSup({ key: value }).then((res) => {
if (res) {
that.supplierList = res;
}
})
}, 500)
} else if(this.organLabel === '客户') {
this.setTimeFlag = setTimeout(() => {
findBySelectCus({ key: value }).then((res) => {
if (res) {
that.supplierList = res;
}
})
}, 500)
}
},
close () {
this.$emit('close');
this.visible = false;

View File

@@ -23,7 +23,12 @@
<a-col :md="12" :sm="24">
<a-form-item :label="organType" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-select :placeholder="'请选择'+ organType" 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">
{{ item.supplier }}
</a-select-option>
@@ -68,6 +73,12 @@
export default {
name: 'WaitNeedList',
mixins:[JeecgListMixin],
components: {
VNodes: {
functional: true,
render: (h, ctx) => ctx.props.vnodes,
}
},
data () {
return {
title: "操作",
@@ -75,6 +86,7 @@
disableMixinCreated: true,
organType: '',
actionType: '',
setTimeFlag: null,
supList: [],
selectBillRows: [],
queryParam: {
@@ -152,6 +164,29 @@
})
}
},
handleSearchSupplier(value) {
let that = this
if(this.setTimeFlag != null){
clearTimeout(this.setTimeFlag);
}
if(this.organType === '客户') {
this.setTimeFlag = setTimeout(() => {
findBySelectCus({ key: value }).then((res) => {
if (res) {
that.supList = res
}
})
}, 500)
} else if(this.organType === '供应商') {
this.setTimeFlag = setTimeout(() => {
findBySelectSup({ key: value }).then((res) => {
if (res) {
that.supList = res;
}
})
}, 500)
}
},
//选择供应商进行付款,选择客户进行收款
handleAction(record) {
let type = ''