diff --git a/apps/hand-factory/components/panels/code/apart.vue b/apps/hand-factory/components/panels/code/apart.vue index e2bea94..7e3ff4a 100644 --- a/apps/hand-factory/components/panels/code/apart.vue +++ b/apps/hand-factory/components/panels/code/apart.vue @@ -15,6 +15,10 @@ 原钢卷信息 + + + 参数 + @@ -90,46 +94,60 @@ class="field-input" /> - - 目标库区 - - - {{ item.warehouseName || '请选择目标库区' }} - - - + + 目标库区 + + + {{ item.warehouseName || '请选择目标库区' }} + + - - - - 选择产品 - - - {{ item.productName || '请选择产品' }} - - - + + + + + 物品类型 + + + {{ item.itemType === 'product' ? '成品' : item.itemType === 'raw_material' ? '原料' : '请选择物品类型' }} + + - - - - 选择原材料 - - - {{ item.rawMaterialName || '请选择原材料' }} - - - + + + + + 选择产品 + + + {{ item.productName || '请选择产品' }} + + + + + + + 选择原材料 + + + {{ item.rawMaterialName || '请选择原材料' }} + + + + 毛重 (吨) @@ -263,6 +281,54 @@ + + + + + + 选择物品类型 + + + + + 成品 + + + + 原料 + + + + + + + + + + + BOM 清单 + + + + + {{ index + 1 }} + + + {{ item.attrKey }}: + {{ item.attrValue }} + + + 备注: + {{ item.remark }} + + + + + 暂无参数数据 + + + + @@ -424,26 +490,60 @@ export default { if (this.currentPickerItemIndex === -1) return; const item = this.splitCoils[this.currentPickerItemIndex]; - const currentIndex = this.currentPickerItemIndex; // 使用 $set 确保响应式更新 this.$set(item, 'warehouseId', warehouse.warehouseId); this.$set(item, 'warehouseName', warehouse.warehouseName); this.closeWarehousePickerForItem(); + }, + + // 显示物品类型选择器 + showItemTypePickerForItem(index) { + this.currentPickerItemIndex = index; + this.$refs.itemTypePopup.open(); + }, + + // 关闭物品类型选择器 + closeItemTypePickerForItem() { + this.$refs.itemTypePopup.close(); + this.currentPickerItemIndex = -1; + }, + + // 选择物品类型 + selectItemType(type) { + if (this.currentPickerItemIndex === -1) return; - // 根据库区ID判断类型:999为成品库,其他为原材料库 - if (warehouse.warehouseId === 999) { - // 成品库,显示产品选择器 - this.$set(item, 'itemType', 'product'); + const item = this.splitCoils[this.currentPickerItemIndex]; + const currentIndex = this.currentPickerItemIndex; + + // 设置物品类型 + this.$set(item, 'itemType', type); + // 清空之前选择的物品 + this.$set(item, 'itemId', undefined); + this.$set(item, 'productName', ''); + this.$set(item, 'rawMaterialName', ''); + + this.closeItemTypePickerForItem(); + + // 根据类型自动弹出对应的选择器 + if (type === 'product') { this.showProductPickerForItem(currentIndex); - } else { - // 其他库区,显示原材料选择器 - this.$set(item, 'itemType', 'raw_material'); + } else if (type === 'raw_material') { this.showRawMaterialPickerForItem(currentIndex); } }, + // 显示BOM弹窗 + showBomDialog() { + this.$refs.bomPopup.open(); + }, + + // 关闭BOM弹窗 + closeBomDialog() { + this.$refs.bomPopup.close(); + }, + // 显示库区选择器(为特定分卷) showWarehousePickerForItem(index) { this.currentPickerItemIndex = index; @@ -1270,4 +1370,120 @@ export default { } } } + +/* 参数按钮 */ +.more-btn { + display: flex; + align-items: center; + gap: 8rpx; + padding: 8rpx 16rpx; + background: #fff3e0; + border-radius: 20rpx; + border: 1rpx solid #ff9500; + + .icon-more { + font-size: 24rpx; + color: #ff9500; + } + + .more-text { + font-size: 24rpx; + color: #ff9500; + } +} + +/* BOM弹窗 */ +.bom-popup { + background: #fff; + border-radius: 24rpx 24rpx 0 0; + max-height: 70vh; + + .popup-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 30rpx; + border-bottom: 1rpx solid #f0f0f0; + + .popup-title { + font-size: 32rpx; + color: #333; + font-weight: 600; + } + + .popup-close { + font-size: 40rpx; + color: #999; + width: 60rpx; + height: 60rpx; + display: flex; + align-items: center; + justify-content: center; + } + } + + .popup-body { + padding: 30rpx; + max-height: 500rpx; + + .bom-item { + display: flex; + gap: 20rpx; + padding: 24rpx; + background: #f8f9fa; + border-radius: 12rpx; + margin-bottom: 20rpx; + + &:last-child { + margin-bottom: 0; + } + + .bom-index { + width: 60rpx; + height: 60rpx; + background: #ff9500; + color: #fff; + border-radius: 50%; + display: flex; + align-items: center; + justify-content: center; + font-size: 24rpx; + font-weight: bold; + flex-shrink: 0; + } + + .bom-content { + flex: 1; + + .bom-row { + display: flex; + margin-bottom: 10rpx; + + &:last-child { + margin-bottom: 0; + } + + .bom-label { + font-size: 26rpx; + color: #666; + min-width: 120rpx; + } + + .bom-value { + font-size: 26rpx; + color: #333; + font-weight: 500; + } + } + } + } + + .empty-tip { + text-align: center; + padding: 60rpx 0; + color: #999; + font-size: 28rpx; + } + } +} diff --git a/apps/hand-factory/components/panels/code/merge.vue b/apps/hand-factory/components/panels/code/merge.vue index 371cd13..c1a42f5 100644 --- a/apps/hand-factory/components/panels/code/merge.vue +++ b/apps/hand-factory/components/panels/code/merge.vue @@ -83,7 +83,21 @@ - + + + 物品类型 + + + {{ itemType === 'product' ? '成品' : itemType === 'raw_material' ? '原料' : '请选择物品类型' }} + + + + + + 选择产品 - + 选择原材料 + + + + + + 选择物品类型 + + + + + 成品 + + + + 原料 + + + + + @@ -497,15 +531,33 @@ export default { this.warehouseName = warehouse.warehouseName; this.warehouseKeyword = warehouse.warehouseName; this.closeWarehousePicker(); + }, + + // 显示物品类型选择器 + showItemTypePicker() { + this.$refs.itemTypePopup.open(); + }, + + // 关闭物品类型选择器 + closeItemTypePicker() { + this.$refs.itemTypePopup.close(); + }, + + // 选择物品类型 + selectItemType(type) { + // 设置物品类型 + this.itemType = type; + // 清空之前选择的物品 + this.itemId = undefined; + this.selectedProductName = ''; + this.selectedRawMaterialName = ''; - // 根据库区ID判断类型:999为成品库,其他为原材料库 - if (warehouse.warehouseId === 999) { - // 成品库,显示产品选择器 - this.itemType = 'product'; + this.closeItemTypePicker(); + + // 根据类型自动弹出对应的选择器 + if (type === 'product') { this.showProductPicker(); - } else { - // 其他库区,显示原材料选择器 - this.itemType = 'raw_material'; + } else if (type === 'raw_material') { this.showRawMaterialPicker(); } }, diff --git a/apps/hand-factory/components/panels/code/typing.vue b/apps/hand-factory/components/panels/code/typing.vue index 6344038..0c350d0 100644 --- a/apps/hand-factory/components/panels/code/typing.vue +++ b/apps/hand-factory/components/panels/code/typing.vue @@ -33,14 +33,10 @@ 当前库区 {{ currentWarehouseName || '未分配' }} - + 原材料 {{ materialDetail.rawMaterialName || '-' }} - - 规格 - {{ materialDetail.specification || '-' }} - @@ -84,7 +80,7 @@ /> - + 目标库区 - + + + 物品类型 + + + {{ form.itemType === 'product' ? '成品' : form.itemType === 'raw_material' ? '原料' : '请选择物品类型' }} + + + + + + 选择产品 - + 选择原材料 + + + + + 选择物品类型 + + + + + 成品 + + + + 原料 + + + + + + @@ -554,15 +585,33 @@ import { listProduct } from '@/api/wms/product.js' this.form.warehouseName = warehouse.warehouseName; this.currentWarehouseName = warehouse.warehouseName; this.closeWarehousePicker(); + }, + + // 显示物品类型选择器 + showItemTypePicker() { + this.$refs.itemTypePopup.open(); + }, + + // 关闭物品类型选择器 + closeItemTypePicker() { + this.$refs.itemTypePopup.close(); + }, + + // 选择物品类型 + selectItemType(type) { + // 设置物品类型 + this.form.itemType = type; + // 清空之前选择的物品 + this.form.itemId = undefined; + this.selectedProductName = ''; + this.selectedRawMaterialName = ''; - // 根据库区ID判断类型:999为成品库,其他为原材料库 - if (warehouse.warehouseId === 999) { - // 成品库,显示产品选择器 - this.form.itemType = 'product'; + this.closeItemTypePicker(); + + // 根据类型自动弹出对应的选择器 + if (type === 'product') { this.showProductPicker(); - } else { - // 其他库区,显示原材料选择器 - this.form.itemType = 'raw_material'; + } else if (type === 'raw_material') { this.showRawMaterialPicker(); } }, @@ -959,6 +1008,10 @@ import { listProduct } from '@/api/wms/product.js' padding: 20rpx; border-radius: 12rpx; + &.full-width { + flex: 0 0 100%; + } + .item-label { display: block; font-size: 24rpx;