2 Commits 0feaa9c1f3 ... 34e7874f54

Author SHA1 Message Date
  yz 34e7874f54 Merge remote-tracking branch 'origin/dev' into dev 1 week ago
  yz e30dfe2360 refactor: 将数字类型转换改为字符串类型处理 1 week ago

+ 2 - 2
src/components/announcement/announcement-form-mixin.js

@@ -79,7 +79,7 @@ const dataConverter = {
       content: formModel.content,
       categoryId: formModel.categoryId != null ? String(formModel.categoryId) : '',
       categoryName: formModel.categoryName,
-      orgId: Number(formModel.orgId),
+      orgId: formModel.orgId ? formModel.orgId.toString() : '0',
       orgCode: formModel.orgCode,
       orgName: formModel.orgName,
       /** @type {string} */
@@ -355,7 +355,7 @@ export default {
             content: newVal.content || '',
             categoryId: newVal.categoryId != null ? String(newVal.categoryId) : '',
             categoryName: newVal.categoryName,
-            orgId: Number(newVal.orgId || 0),
+            orgId: newVal.orgId ? newVal.orgId.toString() : '0',
             orgCode: newVal.orgCode || '',
             orgName: newVal.orgName || '',
             visibleRoles: dataConverter.parseVisibleRoles(newVal.visibleRoles || 0),

+ 1 - 1
src/components/announcement/index.js

@@ -39,7 +39,7 @@ const DataConverter = {
        title: formData.title,
        content: formData.content,
        categoryId: formData.categoryId,
-       orgId: Number(formData.orgId) || 0,
+       orgId: formData.orgId ? formData.orgId.toString() : '0',
        orgCode: formData.orgCode,
        orgName: formData.orgName,
        visibleRoles: '0', // 需要根据实际逻辑计算

+ 4 - 4
src/components/forecast-form/forecast-form-mixin.js

@@ -610,7 +610,7 @@ export default {
         customerId: data.customerId ? data.customerId.toString() : null,
         customerCode: String(data.customerCode || ''),
         customerName: String(data.customerName || ''),
-        brandId: Number(data.brandId) || null,
+        brandId: data.brandId ? data.brandId.toString() : null,
         brandCode: String(data.brandCode || ''),
         brandName: String(data.brandName || ''),
         itemId: data.itemId ? data.itemId.toString() : null,
@@ -765,7 +765,7 @@ export default {
         const data = ok ? response.data.data : null
         if (ok && data) {
           // 根据接口common.d.ts中的CustomerInfoData结构进行赋值
-          this.formData.customerId = data.Customer_ID ? Number(data.Customer_ID) : null
+          this.formData.customerId = data.Customer_ID ? data.Customer_ID.toString() : null
           this.formData.customerCode = data.Customer_CODE || ''
           this.formData.customerName = data.Customer_NAME || ''
         }
@@ -1201,7 +1201,7 @@ export default {
      */
     handleCustomerSelected(/** @type {import('./types').CustomerSelectData} */ customerData) {
       if (customerData && customerData.customerId) {
-        this.formData.customerId = Number(customerData.customerId)
+        this.formData.customerId = customerData.customerId ? customerData.customerId.toString() : null
         this.formData.customerCode = customerData.customerCode
         this.formData.customerName = customerData.customerName
         // 选中客户后加载该用户关联的品牌与库存物料(仅新增模式自动加载,编辑模式不覆盖回显数据)
@@ -1576,7 +1576,7 @@ export default {
      */
     handleMaterialSelected(/** @type {import('./types').MaterialSelectData} */ materialData) {
       if (materialData && materialData.itemId) {
-        this.formData.itemId = Number(materialData.itemId)
+        this.formData.itemId = materialData.itemId ? materialData.itemId.toString() : null
         this.formData.itemCode = materialData.itemCode
         this.formData.itemName = materialData.itemName
         this.formData.itemSpecs = materialData.specification || ''

+ 1 - 1
src/components/forecast-form/index.js

@@ -384,7 +384,7 @@ export default {
         customerId: data.customerId ? data.customerId.toString() : null,
         customerCode: String(data.customerCode || ''),
         customerName: String(data.customerName || ''),
-        brandId: Number(data.brandId) || null,
+        brandId: data.brandId ? data.brandId.toString() : null,
         brandCode: String(data.brandCode || ''),
         brandName: String(data.brandName || ''),
         itemId: data.itemId ? data.itemId.toString() : null,

+ 1 - 1
src/views/order/address/addressMixin.js

@@ -300,7 +300,7 @@ export default {
         const selectedCustomer = this.customerOptions.find(option => option.value === value)
         if (selectedCustomer) {
           // 自动填充客户信息
-          this.form.customerId = Number(selectedCustomer.customerId)
+          this.form.customerId = selectedCustomer.customerId
           this.form.customerCode = selectedCustomer.customerCode
           this.form.customerName = selectedCustomer.customerName
         } else {