Files
klp-oa/klp-ui/src/views/wms/coil/js/coilPrint.js
砂糖 062bcd0b71 feat(标签打印): 添加分条成品标签类型及打印组件
新增分条成品标签类型,支持在特定仓库中自动识别并打印分条成品标签。添加SplitTag.vue组件用于分条成品标签的渲染,并更新相关逻辑以支持新的标签类型。
2026-03-24 14:52:47 +08:00

51 lines
1.8 KiB
JavaScript

const ECoilPrintType = {
'原料标签': '2',
'成品标签': '3',
'镀锌成品': '4',
'镀铬成品': 'ge',
'镀锌原料': '5',
'脱脂原料': '6',
'分条成品': 'split',
}
/**
* 根据钢卷信息获取打印的标签类型
* @param {*} coil 钢卷信息
* @returns 打印的标签类型
*/
export const getCoilTagPrintType = (coil) => {
const itemName = coil.itemName || '';
const itemType = coil.itemType || '';
const warehouseId = coil.warehouseId || '';
let type = '2'
// 在镀锌颜料库的卷使用镀锌原料标签
if (itemType == 'raw_material' && (warehouseId == '1988150263284953089' || warehouseId == '1988150487185289217')) {
type = ECoilPrintType['镀锌原料'];
}
// 脱脂原料库
else if (itemType == 'raw_material' && (warehouseId == '1988150545175736322')) {
type = ECoilPrintType['脱脂原料'];
}
// 分条成品库
else if (itemType == 'product' && (warehouseId == '1988150210872930306' || warehouseId == '1988150800092950529' || warehouseId == '1988150380649967617' || warehouseId == '1988151027466170370')) {
type = ECoilPrintType['分条成品'];
}
// 其他卷使用成品标签
else if (itemType == 'raw_material') {
type = ECoilPrintType['原料标签'];
} else if (itemType == 'product' && itemName == '冷硬卷') {
type = ECoilPrintType['成品标签'];
} else if (itemType == 'product' && itemName == '热轧卷板') {
type = ECoilPrintType['成品标签'];
} else if (itemType == 'product' && itemName == '镀锌卷') {
type = ECoilPrintType['镀锌成品'];
} else if (itemType == 'product' && itemName == '冷轧卷') {
type = ECoilPrintType['成品标签'];
} else if (itemType == 'product' && itemName == '镀铬卷') {
type = ECoilPrintType['镀铬成品'];
} else {
type = ECoilPrintType['成品标签'];
}
return type
}