|
|
@ -131,6 +131,7 @@ const tableColumns = ref(UnplannedreceiptRequestMain.allSchemas.tableColumns) |
|
|
|
const detailListTableColumns = UnplannedreceiptRequestDetailLabel.allSchemas |
|
|
|
const isCreateLabel = ref(false) |
|
|
|
const formLabelRef = ref() |
|
|
|
const labelType = ref('') // 标签类别 采购还是制造等 |
|
|
|
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({ |
|
|
|
getListApi: UnplannedreceiptRequestDetailApi.getUnplannedreceiptRequestDetailPage |
|
|
|
}) |
|
|
@ -141,19 +142,56 @@ const updataTableColumns = (val) => { |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
|
|
|
|
// 判断 物料类型是否与其他物料类型一致 |
|
|
|
const isItemType = async (itemCode, labelTypeParams) => { |
|
|
|
let isType = false |
|
|
|
const labelTypeOld = JSON.parse(JSON.stringify(labelType.value)) |
|
|
|
await ItembasicApi.getItembasicPage({ |
|
|
|
pageSize: 10, |
|
|
|
pageNo: 1, |
|
|
|
code: itemCode, |
|
|
|
sort: '', |
|
|
|
by: 'ASC', |
|
|
|
}).then(res => { |
|
|
|
if (res.list.length > 0) { |
|
|
|
// 判断物料 可采购 可制造 |
|
|
|
if (res.list[0].enableMake == "FALSE") { |
|
|
|
labelType.value = 'cg' |
|
|
|
if (labelTypeParams == 'cg') { |
|
|
|
isType = true |
|
|
|
} |
|
|
|
} else { |
|
|
|
labelType.value = 'zz' |
|
|
|
if (labelTypeParams == 'zz') { |
|
|
|
isType = true |
|
|
|
} |
|
|
|
} |
|
|
|
if(labelTypeParams == '') isType = true |
|
|
|
} |
|
|
|
}) |
|
|
|
// 当第二次选择为不同类型时 类型要重置到第一次选择的结果 |
|
|
|
if (!isType) labelType.value = labelTypeOld |
|
|
|
return isType |
|
|
|
} |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { |
|
|
|
nextTick(() => { |
|
|
|
nextTick(async () => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
if(formField == 'toLocationCode'){ |
|
|
|
row['toLocationCode'] = val[0]['code'] |
|
|
|
} |
|
|
|
if(formField == 'itemCode'){ |
|
|
|
} else if(formField == 'itemCode'){ |
|
|
|
const isType = await isItemType(val[0]['code'], labelType.value) |
|
|
|
if(!isType){ |
|
|
|
message.warning('当前物料可制造与其他数据不一致,请重新选择!') |
|
|
|
} else { |
|
|
|
row['itemCode'] = val[0]['code'] |
|
|
|
row['uom'] = val[0]['uom'] |
|
|
|
} |
|
|
|
} else { |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
} |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
@ -190,7 +228,7 @@ const { getList, setSearchParams } = tableMethods |
|
|
|
|
|
|
|
// 列表头部按钮 |
|
|
|
const HeadButttondata = [ |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:unplannedreceipt-request-main:create'}), // 新增——需要手动修改下权限 |
|
|
|
defaultButtons.defaultAddBtn({hasPermi:'wms:unplannedreceipt-request-main:create'}), // 新增 |
|
|
|
defaultButtons.defaultImportBtn({hasPermi:'wms:unplannedreceipt-request-main:import'}), // 导入 |
|
|
|
defaultButtons.defaultExportBtn({hasPermi:'wms:unplannedreceipt-request-main:export'}), // 导出 |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
@ -323,8 +361,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(item => { |
|
|
|
if(item.field == 'productionLineCodePackage') { |
|
|
|