Browse Source

fix(订单表单): 统一ID字段类型为字符串类型

yz 2 weeks ago
parent
commit
0609af18c6
1 changed files with 6 additions and 6 deletions
  1. 6 6
      src/components/order-form/order-form-mixin.js

+ 6 - 6
src/components/order-form/order-form-mixin.js

@@ -659,8 +659,8 @@ export default {
       try {
         // 并行加载订单详情和物料明细数据以提高性能
         const [orderResponse, materialResponse] = await Promise.all([
-          getDetail(orderId),
-          this.loadMaterialDetails(orderId)
+          getDetail(String(orderId)),
+          this.loadMaterialDetails(String(orderId))
         ])
 
         // 验证订单详情响应数据
@@ -820,10 +820,10 @@ export default {
       return {
         id: orderData.id ? String(orderData.id) : undefined,
         orderCode: String(orderData.orderCode || ''),
-        orgId: orderData.orgId ? Number(orderData.orgId) : undefined,
+        orgId: orderData.orgId ? String(orderData.orgId) : undefined,
         orgCode: String(orderData.orgCode || ''),
         orgName: String(orderData.orgName || ''),
-        customerId: Number(orderData.customerId) || null,
+        customerId: orderData.customerId ? String(orderData.customerId) : null,
         customerCode: String(orderData.customerCode || ''),
         customerName: String(orderData.customerName || ''),
         orderType: Number(orderData.orderType) || ORDER_TYPES.NORMAL,
@@ -1478,7 +1478,7 @@ export default {
     handleCustomerSelected(/** @type {import('./types').CustomerSelectData} */ customerData) {
       if (this.formData) {
         // 更新客户相关字段
-        this.$set(this.formData, 'customerId', customerData.customerId)
+        this.$set(this.formData, 'customerId', customerData.customerId != null ? String(customerData.customerId) : null)
         this.$set(this.formData, 'customerCode', customerData.customerCode)
         this.$set(this.formData, 'customerName', customerData.customerName)
 
@@ -1501,7 +1501,7 @@ export default {
     handleAddressSelected(/** @type {import('./types').AddressSelectData} */ addressData) {
       if (this.formData) {
         // 更新地址相关字段
-        this.$set(this.formData, 'addressId', addressData.addressId)
+        this.$set(this.formData, 'addressId', addressData.addressId != null ? String(addressData.addressId) : '')
         this.$set(this.formData, 'receiverName', addressData.receiverName || '')
         this.$set(this.formData, 'receiverPhone', addressData.receiverPhone || '')
         this.$set(this.formData, 'receiverRegion', addressData.regionName || '')