Files
klp-oa/klp-ui/src/views/wms/coil/js/coilPrint.js
砂糖 b27f246fa0 feat(钢卷): 重构标签打印逻辑并添加合卷操作功能
重构钢卷标签打印逻辑,提取公共方法到coilPrint.js
添加合卷操作区功能,支持200-299操作类型
为合卷表单添加验证规则
2026-03-16 13:15:54 +08:00

46 lines
1.7 KiB
JavaScript

const ECoilPrintType = {
'原料标签': '2',
'成品标签': '3',
'镀锌成品': '4',
'镀铬成品': 'ge',
'镀锌原料': '5',
'脱脂原料': '6'
}
/**
* 根据钢卷信息获取打印的标签类型
* @param {*} coil 钢卷信息
* @returns 打印的标签类型
*/
export const getCoilTagPrintType = (coil) => {
const item = coil.itemType === 'product' ? coil.product : coil.rawMaterial;
const itemName = coil.itemType === 'product' ? item?.productName || '' : item?.rawMaterialName || '';
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 == '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
}