gaoluyang
4 天以前 f4a4737d69746268f3648effcf66e1c1c83e64e1
src/views/salesManagement/opportunityManagement/index.vue
@@ -456,7 +456,9 @@
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
@@ -473,6 +475,23 @@
    }
  })()
  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
}
// 分页配置
@@ -703,9 +722,7 @@
  
  // 加载用户列表和客户列表
  await loadUserList()
  customerList().then((res) => {
    customerOption.value = res
  })
  await loadCustomerList()
   getProvinceList().then(res => {
      provinceOptions.value = res.data
   })
@@ -724,9 +741,7 @@
  
  // 加载用户列表和客户列表
  await loadUserList()
  customerList().then((res) => {
    customerOption.value = res
  })
  await loadCustomerList()
  
  // 使用当前行数据作为基础,但只能修改状态和拜访记录;付款描述、改造内容等保留反显
  Object.assign(form, row, {
@@ -745,9 +760,7 @@
  
  // 加载用户列表和客户列表
  await loadUserList()
  customerList().then((res) => {
    customerOption.value = res
  })
  await loadCustomerList()
  
  // 使用updateTime作为录入时间反显
  Object.assign(form, row, {
@@ -787,9 +800,7 @@
  
  // 加载用户列表和客户列表
  await loadUserList()
  customerList().then((res) => {
    customerOption.value = res
  })
  await loadCustomerList()
  
  // 加载省份列表
  await getProvinceList().then(res => {
@@ -1162,4 +1173,4 @@
    }
  }
}
</style>
</style>