|
@@ -348,41 +348,6 @@ export default {
|
|
|
methods: {
|
|
|
|
|
|
/**
|
|
|
- * 加载客户选项(加载所有客户数据)
|
|
|
- * @returns {Promise<void>}
|
|
|
- */
|
|
|
- async loadCustomerOptions() {
|
|
|
- try {
|
|
|
- this.customerLoading = true
|
|
|
- const response = await getCustomerList(1, 1000, {}) // 加载更多数据,或根据实际情况调整
|
|
|
-
|
|
|
- if (response.data && response.data.success) {
|
|
|
- const customers = response.data.data.records || []
|
|
|
- this.customerOptions = customers.map(customer => ({
|
|
|
- value: customer.Customer_ID.toString(),
|
|
|
- label: `${customer.Customer_CODE} - ${customer.Customer_NAME}`,
|
|
|
- customerCode: customer.Customer_CODE,
|
|
|
- customerName: customer.Customer_NAME,
|
|
|
- customerId: customer.Customer_ID.toString()
|
|
|
- }))
|
|
|
- // 初始化时显示所有选项
|
|
|
- this.filteredCustomerOptions = [...this.customerOptions]
|
|
|
- } else {
|
|
|
- this.customerOptions = []
|
|
|
- this.filteredCustomerOptions = []
|
|
|
- this.$message.warning('获取客户列表失败')
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- this.customerOptions = []
|
|
|
- this.filteredCustomerOptions = []
|
|
|
- console.error('加载客户选项失败:', error)
|
|
|
- this.$message.error('加载客户选项失败,请稍后重试')
|
|
|
- } finally {
|
|
|
- this.customerLoading = false
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- /**
|
|
|
* 本地过滤客户选项
|
|
|
* @param {string} query - 搜索关键词
|
|
|
* @returns {void}
|