|
@@ -309,31 +309,17 @@ export default {
|
|
|
if (value) {
|
|
|
const selectedCustomer = this.customerOptions.find(option => option.value === value)
|
|
|
if (selectedCustomer) {
|
|
|
- // 自动填充客户名称
|
|
|
+ // Auto-fill customer information
|
|
|
this.form.customerId = selectedCustomer.customerId
|
|
|
this.form.customerCode = selectedCustomer.customerCode
|
|
|
this.form.customerName = selectedCustomer.customerName
|
|
|
- // 加载客户地址
|
|
|
+ // Load customer addresses
|
|
|
this.loadCustomerAddresses(value)
|
|
|
} else {
|
|
|
- this.form.customerName = ''
|
|
|
- this.form.customerId = ''
|
|
|
- this.addressOptions = []
|
|
|
- this.form.addressId = ''
|
|
|
- this.form.receiverName = ''
|
|
|
- this.form.receiverPhone = ''
|
|
|
- this.form.receiverAddress = ''
|
|
|
- this.form.receiverRegion = ''
|
|
|
+ this.clearCustomerData()
|
|
|
}
|
|
|
} else {
|
|
|
- this.form.customerName = ''
|
|
|
- this.form.customerId = ''
|
|
|
- this.addressOptions = []
|
|
|
- this.form.addressId = ''
|
|
|
- this.form.receiverName = ''
|
|
|
- this.form.receiverPhone = ''
|
|
|
- this.form.receiverAddress = ''
|
|
|
- this.form.receiverRegion = ''
|
|
|
+ this.clearCustomerData()
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -761,6 +747,22 @@ export default {
|
|
|
},
|
|
|
|
|
|
/**
|
|
|
+ * 清除客户相关数据
|
|
|
+ * @returns {void}
|
|
|
+ */
|
|
|
+ clearCustomerData() {
|
|
|
+ this.form.customerName = ''
|
|
|
+ this.form.customerId = ''
|
|
|
+ this.addressOptions = []
|
|
|
+ this.form.addressId = ''
|
|
|
+ this.form.receiverName = ''
|
|
|
+ this.form.receiverPhone = ''
|
|
|
+ this.form.receiverAddress = ''
|
|
|
+ this.form.receiverRegion = ''
|
|
|
+ this.updateAddressOptions()
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
* 处理明细管理
|
|
|
* @param {OrderItem} row - 订单行数据
|
|
|
*/
|