订单列表和计费列表调整使用客户下拉全查接口
This commit is contained in:
@@ -9,6 +9,16 @@ export function listCustomer(query) {
|
||||
})
|
||||
}
|
||||
|
||||
// 客户下拉选项:只返回客户ID、客户编码、客户名称
|
||||
// keywords 按客户名称、客户编码、对外代码模糊查询
|
||||
export function listCustomerOption(query) {
|
||||
return request({
|
||||
url: '/customersupplier/customerinfo/optionselect',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询客户主详细
|
||||
export function getCustomer(customerId) {
|
||||
return request({
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
placeholder="客户名称/客户代码/对外代码"
|
||||
multiple
|
||||
remote-search
|
||||
option-select
|
||||
/>
|
||||
</template>
|
||||
<template #search-productCodes="{ model }">
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
placeholder="客户名称/客户代码/对外代码"
|
||||
multiple
|
||||
remote-search
|
||||
option-select
|
||||
/>
|
||||
</template>
|
||||
<template #search-orderStatuses="{ model }">
|
||||
|
||||
Reference in New Issue
Block a user