Browse Source

fix(订单操作): 在查看订单时确保客户选项正确加载

yz 2 months ago
parent
commit
6be6d958b3
1 changed files with 12 additions and 0 deletions
  1. 12 0
      src/mixins/order/orderOperationsMixin.js

+ 12 - 0
src/mixins/order/orderOperationsMixin.js

@@ -70,6 +70,18 @@ export default {
      */
     async handleView(row) {
       await this.loadOrderDetail(row.id)
+      // 先加载客户选项
+      await this.loadCustomerOptions()
+      
+      this.orderForm.customerId = this.orderForm.customerId.toString()
+      // 如果当前订单有客户ID,确保该客户在选项列表中
+      if (this.orderForm.customerId && this.orderForm.customerCode) {
+        this.ensureCustomerInOptions(
+          this.orderForm.customerId,
+          this.orderForm.customerCode,
+          this.orderForm.customerName
+        )
+      }
       this.showViewDialog(this.orderForm)
     },