Преглед на файлове

refactor(订单表单): 统一物料分类相关字段命名

yz преди 2 седмици
родител
ревизия
bc8b092c72

+ 2 - 2
src/components/order-form/material-detail-option.js

@@ -83,7 +83,7 @@ export function getMaterialDetailOption(isEditMode = false) {
       },
       {
         label: '主物料分类',
-        prop: 'category',
+        prop: 'mainItemCategoryName',
         width: 120
       },
       {
@@ -211,7 +211,7 @@ export const DEFAULT_FORM_DATA = {
   itemCode: '',
   itemName: '',
   specification: '',
-  category: '',
+  mainItemCategoryName: '',
   warehouseName: '',
   availableQuantity: 0,
   orderQuantity: 0,

+ 6 - 6
src/components/order-form/material-detail-table.vue

@@ -563,9 +563,9 @@ export default {
             itemName: item.Item_Name,
             specs: item.Item_PECS || '',
             unit: item.InventoryInfo_Name,
-            category: item.MainItemCategory_Name,
-            categoryId: item.MainItemCategory_ID,
-            categoryCode: item.MainItemCategory_Code,
+            mainItemCategoryName: item.MainItemCategory_Name,
+            mainItemCategoryId: item.MainItemCategory_ID,
+            mainItemCategoryCode: item.MainItemCategory_Code,
             description: item.Item_Description || '',
             warehouseId: item.Warehouse_ID,
             warehouseCode: item.Warehouse_Code,
@@ -641,9 +641,9 @@ export default {
         specs: material.specs || '',
         specification: material.specs || '',
         unit: material.unit || '',
-        category: material.category || '',
-        categoryId: material.categoryId,
-        categoryCode: material.categoryCode,
+        mainItemCategoryName: material.mainItemCategoryName || material.MainItemCategory_Name || '',
+        mainItemCategoryId: material.mainItemCategoryId || material.MainItemCategory_ID,
+        mainItemCategoryCode: material.mainItemCategoryCode || material.MainItemCategory_Code || '',
         description: material.description || '',
         warehouseId: material.warehouseId,
         warehouseCode: material.warehouseCode,

+ 4 - 0
src/components/order-form/order-form-mixin.js

@@ -747,6 +747,8 @@ export default {
               warehouseId: String(material.warehouseId || ''),
               mainCategoryId: String(material.mainItemCategoryId) || '',
               mainItemCategoryId: material.mainItemCategoryId ? String(material.mainItemCategoryId) : undefined,
+              mainItemCategoryName: material.mainItemCategoryName || material.mainCategoryName || '',
+              mainCategoryName: material.mainItemCategoryName || material.mainCategoryName || '',
               createTime: material.createTime || new Date().toISOString(),
               updateTime: material.updateTime || new Date().toISOString(),
               dataSource: MaterialDetailDataSource.REMOTE,
@@ -772,6 +774,8 @@ export default {
               ...material,
               id: String(material.id || ''),
               mainItemCategoryId: String(material.mainItemCategoryId || ''),
+              mainItemCategoryName: material.mainItemCategoryName || material.mainCategoryName || '',
+              mainCategoryName: material.mainItemCategoryName || material.mainCategoryName || '',
               itemId: String(material.itemId || ''),
               warehouseId: String(material.warehouseId || ''),
               createTime: material.createTime || new Date().toISOString(),