diff --git a/src/common/storeFabricBusinessOut.js b/src/common/storeFabricBusinessOut.js index 4b23c2b..a199283 100644 --- a/src/common/storeFabricBusinessOut.js +++ b/src/common/storeFabricBusinessOut.js @@ -125,7 +125,8 @@ export function getFineCodeDisplayWeight(fineCode) { */ export function normalizeOrder(order) { if (!order) return null; - const itemData = groupItemData((order.item_data || []).map((item) => normalizeItem(item))); + const normalizedItems = (order.item_data || []).map((item) => normalizeItem(item)); + const itemData = groupItemData(normalizedItems); return { id: order.id, order_no: order.order_no || '', @@ -149,10 +150,52 @@ export function normalizeOrder(order) { total_roll: formatRoll(order.total_roll), total_weight: formatWeightKg(order.total_weight), item_data: itemData, + summary_rows: buildSummaryRows(normalizedItems), _raw: order, }; } +/** 扫码区下方汇总表列(与出仓明细表一致,可横向滑动) */ +export const SUMMARY_TABLE_COLUMNS = [ + { label: '坯布编号', key: 'grey_fabric_code', width: 200 }, + { label: '坯布名称', key: 'grey_fabric_name', width: 240 }, + { label: '纱批', key: 'yarn_batch', width: 180 }, + { label: '机台号', key: 'machine_number', width: 160 }, + { label: '条数', key: 'roll', width: 140 }, + { label: '重量', key: 'weight', width: 160 }, +]; + +/** 汇总行归类:坯布编号 + 名称 + 纱批 + 机台号 */ +export function getSummaryGroupKey(item) { + return [ + item.grey_fabric_code || '', + item.grey_fabric_name || '', + item.yarn_batch || '', + item.machine_number || '', + ].join('|'); +} + +/** 按坯布、纱批、机台号汇总条数和重量,供扫码区表格展示 */ +export function buildSummaryRows(items) { + const grouped = new Map(); + (items || []).forEach((item) => { + const groupKey = getSummaryGroupKey(item); + const existing = grouped.get(groupKey); + if (!existing) { + grouped.set(groupKey, { + ...item, + group_key: groupKey, + fine_codes: [...(item.fine_codes || [])], + }); + return; + } + existing.fine_codes.push(...(item.fine_codes || [])); + existing.roll = Number((Number(existing.roll || 0) + Number(item.roll || 0)).toFixed(2)); + existing.weight = Number((Number(existing.weight || 0) + Number(item.weight || 0)).toFixed(2)); + }); + return Array.from(grouped.values()); +} + /** 扫码详情区汇总维度(勾选后随扫码请求把对应 lock 字段传给后端) */ export const SCAN_GROUP_OPTIONS = [ { key: 'produce_order_no', label: '合同' }, @@ -441,6 +484,7 @@ export function orderToFormFields(order) { delivery_time: order.delivery_time, remark: order.remark, item_data: order.item_data, + summary_rows: order.summary_rows || [], }; } diff --git a/src/components/storefabric/FabricOutSummaryTable.vue b/src/components/storefabric/FabricOutSummaryTable.vue new file mode 100644 index 0000000..25a4d3e --- /dev/null +++ b/src/components/storefabric/FabricOutSummaryTable.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/src/manifest.json b/src/manifest.json index e81abce..db0eab7 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,8 +2,8 @@ "name" : "浩拓织厂", "appid" : "__UNI__F79F300", "description" : "周尚-浩拓织厂", - "versionName" : "1.1.17", - "versionCode" : 117, + "versionName" : "1.1.18", + "versionCode" : 118, "transformPx" : false, "app-plus" : { "optimization" : { diff --git a/src/pages/storefabric/storeFabricBusinessOutAdd.vue b/src/pages/storefabric/storeFabricBusinessOutAdd.vue index f4a5b83..09a2453 100644 --- a/src/pages/storefabric/storeFabricBusinessOutAdd.vue +++ b/src/pages/storefabric/storeFabricBusinessOutAdd.vue @@ -1,79 +1,48 @@ - - - - - - diff --git a/src/pages/storefabric/storeFabricBusinessOutEdit.vue b/src/pages/storefabric/storeFabricBusinessOutEdit.vue index e3c1f0e..5dd33fc 100644 --- a/src/pages/storefabric/storeFabricBusinessOutEdit.vue +++ b/src/pages/storefabric/storeFabricBusinessOutEdit.vue @@ -1,35 +1,42 @@