fix: 切换客户种类时重新拉取对应种类客户列表
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -216,7 +216,7 @@ export default {
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
this.loadCustomers()
|
||||
this.loadCustomersByType()
|
||||
this.loadProducts()
|
||||
if (options.orderId) {
|
||||
this.editingOrderId = options.orderId
|
||||
@@ -302,8 +302,21 @@ export default {
|
||||
const idx = e.detail.value
|
||||
this.selectedType = this.typeOptions[idx].value
|
||||
this.selectedTypeLabel = this.typeOptions[idx].label
|
||||
// 切换种类后清除已选客户
|
||||
// 切换种类后清除已选客户,重新拉取该种类的客户
|
||||
this.selectedCustomer = null
|
||||
this.loadCustomersByType()
|
||||
},
|
||||
async loadCustomersByType() {
|
||||
try {
|
||||
const res = await customerApi.getCustomers({
|
||||
type: this.selectedType,
|
||||
page: 1,
|
||||
pageSize: 100
|
||||
})
|
||||
this.customers = res.records || []
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
},
|
||||
goToSelectProduct() {
|
||||
uni.navigateTo({ url: '/pages/product/select' })
|
||||
|
||||
Reference in New Issue
Block a user