|
|
@ -128,6 +128,7 @@ const updataTableColumns = (val) => { |
|
|
|
// 判断 物料类型是否与其他物料类型一致 |
|
|
|
const isItemType = async (itemCode, labelTypeParams) => { |
|
|
|
let isType = false |
|
|
|
const labelTypeOld = JSON.parse(JSON.stringify(labelType.value)) |
|
|
|
await ItembasicApi.getItembasicPage({ |
|
|
|
pageSize: 10, |
|
|
|
pageNo: 1, |
|
|
@ -136,8 +137,8 @@ const isItemType = async (itemCode, labelTypeParams) => { |
|
|
|
by: 'ASC', |
|
|
|
}).then(res => { |
|
|
|
if (res.list.length > 0) { |
|
|
|
// 判断物料类型 是否 原料 |
|
|
|
if (res.list[0].type == "RAW") { |
|
|
|
// 判断物料 可采购 可制造 |
|
|
|
if (res.list[0].enableMake == "FALSE") { |
|
|
|
labelType.value = 'cg' |
|
|
|
if (labelTypeParams == 'cg') { |
|
|
|
isType = true |
|
|
@ -151,6 +152,8 @@ const isItemType = async (itemCode, labelTypeParams) => { |
|
|
|
if(labelTypeParams == '') isType = true |
|
|
|
} |
|
|
|
}) |
|
|
|
// 当第二次选择为不同类型时 类型要重置到第一次选择的结果 |
|
|
|
if (!isType) labelType.value = labelTypeOld |
|
|
|
return isType |
|
|
|
} |
|
|
|
|
|
|
@ -162,7 +165,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
if(formField == 'itemCode') { |
|
|
|
const isType = await isItemType(val[0]['itemCode'], labelType.value) |
|
|
|
if(!isType){ |
|
|
|
message.warning('当前物料类型与其他数据不一致,请重新选择!') |
|
|
|
message.warning('当前物料可制造与其他数据不一致,请重新选择!') |
|
|
|
} else { |
|
|
|
row['batch'] = val[0]['batch']==''?formatTime(new Date(), 'yyyyMMdd'):val[0]['batch'] |
|
|
|
row['itemCode'] = val[0]['itemCode'] |
|
|
@ -200,7 +203,7 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
if(formField == 'itemCode') { |
|
|
|
const isType = await isItemType(val[0]['itemCode'], labelType.value) |
|
|
|
if(!isType){ |
|
|
|
message.warning('当前物料类型与其他数据不一致,请重新选择!') |
|
|
|
message.warning('当前物料可制造与其他数据不一致,请重新选择!') |
|
|
|
} else { |
|
|
|
setV['batch'] = val[0]['batch'] |
|
|
|
setV['itemCode'] = val[0]['itemCode'] |
|
|
@ -370,8 +373,8 @@ const buttonTableClick = async (val, row) => { |
|
|
|
by: 'ASC', |
|
|
|
}).then(res => { |
|
|
|
if (res.list.length > 0) { |
|
|
|
// 判断物料类型 是否 原料 |
|
|
|
if (res.list[0].type == "RAW") { |
|
|
|
// 判断物料 可采购 可制造 |
|
|
|
if (res.list[0].enableMake == "FALSE") { |
|
|
|
// 修改 tableform 属性 |
|
|
|
detailListTableColumns.tableFormColumns.map(itemColumns => { |
|
|
|
if(itemColumns.field == 'productionLineCodePackage') { |
|
|
|