订单列表和计费列表调整使用客户下拉全查接口

This commit is contained in:
liuminghui
2026-10-29 10:33:41 +08:00
parent 3bb7267b0b
commit d02d3dd881
10 changed files with 119 additions and 2 deletions
@@ -32,7 +32,7 @@
</template>
<script setup name="CustomerSelect">
import { listCustomer } from '@/api/customersuppliermanagement/customerinfo/customer.js'
import { listCustomer, listCustomerOption } from '@/api/customersuppliermanagement/customerinfo/customer.js'
import { listSupplier } from '@/api/customersuppliermanagement/supplierinfo/supplier.js'
const props = defineProps({
@@ -95,6 +95,11 @@ const props = defineProps({
remoteSearch: {
type: Boolean,
default: false
},
// 为 true 时客户下拉走专用选项接口,默认仍走客户列表接口
optionSelect: {
type: Boolean,
default: false
}
})
@@ -138,7 +143,9 @@ const displayOptions = computed(() => {
function fetchList(keyword = '') {
if (!props.remoteSearch && loaded.value) return Promise.resolve(options.value)
loading.value = true
const api = isCustomer.value ? listCustomer : listSupplier
const api = !isCustomer.value
? listSupplier
: (props.optionSelect ? listCustomerOption : listCustomer)
const currentRequest = ++requestSerial
const query = String(keyword || '').trim()
return api({