feat(customer): 新增客户相关配卷和财务信息查询接口 fix(base.vue): 修复发货单时间条件显示问题 refactor(CustomerEdit): 替换地址选择组件为普通输入框 feat(CoilSelector): 增加入场卷号查询条件并调整对话框宽度 style(OrderEdit): 调整客户名称和销售员选择框宽度 refactor(ChinaAreaSelect): 优化地址解析逻辑并支持空对象处理 feat(FileUpload/FileList): 新增文件预览功能组件 refactor(KLPService/CustomerSelect): 优化客户选择组件并支持自定义字段绑定 fix(AbnormalForm): 修复异常位置校验逻辑并保留当前卷号 feat(ContractTabs): 新增合同附件展示功能 refactor(warehouse/record): 重构操作记录统计展示方式 feat(contract): 集成客户选择组件并优化合同信息填充 refactor(order): 调整订单表单布局并集成合同信息 feat(FilePreview): 新增文件预览组件 feat(customer): 新增财务状态和发货配卷展示 refactor(CustomerOrder): 移除冗余代码并优化布局 feat(PlanDetailForm): 新增合同附件查看功能 feat(dict): 新增字典管理页面
62 lines
1.6 KiB
Vue
62 lines
1.6 KiB
Vue
<template>
|
|
<el-select filterable v-model="_customerId" remote :remote-method="remoteSearchCustomer" :style="style" :loading="customerLoading" placeholder="请选择客户">
|
|
<el-option v-for="item in customerList" :key="item[bindField]" :label="item.companyName" :value="item[bindField]" />
|
|
</el-select>
|
|
</template>
|
|
|
|
<script>
|
|
import { listCustomer } from '@/api/crm/customer';
|
|
|
|
export default {
|
|
name: 'CustomerSelect',
|
|
props: {
|
|
value: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
bindField: {
|
|
type: String,
|
|
default: 'customerId'
|
|
},
|
|
style: {
|
|
type: Object,
|
|
default: () => ({})
|
|
}
|
|
},
|
|
computed: {
|
|
_customerId: {
|
|
get() {
|
|
return this.value;
|
|
},
|
|
set(value) {
|
|
this.$emit('input', value);
|
|
// 找到对应的客户信息
|
|
const customer = this.customerList.find(item => item[this.bindField] === value);
|
|
// 触发 change 事件,传递客户信息
|
|
if (customer) {
|
|
this.$emit('change', customer);
|
|
}
|
|
}
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
customerList: [],
|
|
customerLoading: false
|
|
}
|
|
},
|
|
mounted() {
|
|
this.remoteSearchCustomer('');
|
|
},
|
|
methods: {
|
|
remoteSearchCustomer(query) {
|
|
this.customerLoading = true;
|
|
listCustomer({ companyName: query, pageNum: 1, pageSize: 10 }).then(response => {
|
|
this.customerList = response.rows;
|
|
}).finally(() => {
|
|
this.customerLoading = false;
|
|
});
|
|
}
|
|
}
|
|
}
|
|
</script> |