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