| | |
| | | const userList = ref([]) |
| | | const customerOption = ref([]) |
| | | const DEFAULT_USER_QUERY = { postCode: 'Market_Sales' } |
| | | const DEFAULT_CUSTOMER_QUERY = { customerType: 2 } |
| | | let userListPromise = null |
| | | let customerListPromise = null |
| | | |
| | | const loadUserList = async (query = DEFAULT_USER_QUERY) => { |
| | | if (userListPromise) return userListPromise |
| | |
| | | } |
| | | })() |
| | | return userListPromise |
| | | } |
| | | |
| | | const loadCustomerList = async (query = DEFAULT_CUSTOMER_QUERY) => { |
| | | if (customerListPromise) return customerListPromise |
| | | customerListPromise = (async () => { |
| | | try { |
| | | const res = await customerList(query) |
| | | customerOption.value = res || [] |
| | | return customerOption.value |
| | | } catch (err) { |
| | | console.error('获取客户列表失败:', err) |
| | | customerOption.value = [] |
| | | customerListPromise = null |
| | | throw err |
| | | } |
| | | })() |
| | | return customerListPromise |
| | | } |
| | | |
| | | // 分页配置 |
| | |
| | | |
| | | // 加载用户列表和客户列表 |
| | | await loadUserList() |
| | | customerList().then((res) => { |
| | | customerOption.value = res |
| | | }) |
| | | await loadCustomerList() |
| | | getProvinceList().then(res => { |
| | | provinceOptions.value = res.data |
| | | }) |
| | |
| | | |
| | | // 加载用户列表和客户列表 |
| | | await loadUserList() |
| | | customerList().then((res) => { |
| | | customerOption.value = res |
| | | }) |
| | | await loadCustomerList() |
| | | |
| | | // 使用当前行数据作为基础,但只能修改状态和拜访记录;付款描述、改造内容等保留反显 |
| | | Object.assign(form, row, { |
| | |
| | | |
| | | // 加载用户列表和客户列表 |
| | | await loadUserList() |
| | | customerList().then((res) => { |
| | | customerOption.value = res |
| | | }) |
| | | await loadCustomerList() |
| | | |
| | | // 使用updateTime作为录入时间反显 |
| | | Object.assign(form, row, { |
| | |
| | | |
| | | // 加载用户列表和客户列表 |
| | | await loadUserList() |
| | | customerList().then((res) => { |
| | | customerOption.value = res |
| | | }) |
| | | await loadCustomerList() |
| | | |
| | | // 加载省份列表 |
| | | await getProvinceList().then(res => { |