|
|
@ -67,7 +67,6 @@ |
|
|
|
:apiUpdate="ProductionDetailApi.updateProductionDetail" |
|
|
|
:apiPage="ProductionDetailApi.getProductionDetailPage" |
|
|
|
:apiDelete="ProductionDetailApi.deleteProductionDetail" |
|
|
|
:Echo="Echo" |
|
|
|
@searchTableSuccessDetail="searchTableSuccessDetail" |
|
|
|
/> |
|
|
|
|
|
|
@ -104,21 +103,9 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
//row['poLine'] = val[0]['poLine'] |
|
|
|
//row['batch'] = val[0]['toBatch'] |
|
|
|
//row['altBatch'] = val[0]['altBatch'] |
|
|
|
//row['itemCode'] = val[0]['itemCode'] |
|
|
|
//row['itemName'] = val[0]['itemName'] |
|
|
|
//row['itemDesc1'] = val[0]['itemDesc1'] |
|
|
|
//row['itemDesc2'] = val[0]['itemDesc2'] |
|
|
|
//row['projectCode'] = val[0]['projectCode'] |
|
|
|
//row['qty'] = val[0]['qty'] |
|
|
|
//row['uom'] = val[0]['uom'] |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
//setV['ppNumber'] = val[0]['ppNumber'] |
|
|
|
//setV['supplierCode'] = val[0]['supplierCode'] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
@ -132,10 +119,6 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 子表新增的时候选择表格之后需要会显得字段 |
|
|
|
// const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] |
|
|
|
const Echo = [] |
|
|
|
|
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: ProductionMainApi.getProductionMainPage // 分页接口 |
|
|
|
}) |
|
|
@ -189,29 +172,75 @@ const isShowMainButton = (row,val) => { |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5','4'])}), // 打开 |
|
|
|
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 |
|
|
|
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5'])}), // 打开 |
|
|
|
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4'])}), // 关闭 |
|
|
|
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 |
|
|
|
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2'])}), // 驳回 |
|
|
|
defaultButtons.mainListPlanAppBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 |
|
|
|
defaultButtons.mainListPlanPubBtn({hide:isShowMainButton(row,['3'])}), // 发布 |
|
|
|
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4'])}), // 重置 |
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // 编辑 |
|
|
|
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 |
|
|
|
// defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // 删除 |
|
|
|
] |
|
|
|
} |
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'mainPlanOpe') { // 打开 |
|
|
|
console.log('列表-操作按钮事件-打开') |
|
|
|
ProductionMainApi.open(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanClo') { // 关闭 |
|
|
|
console.log('列表-操作按钮事件-关闭') |
|
|
|
await message.confirm('确认要关闭吗?') |
|
|
|
ProductionMainApi.close(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanSub') { // 提交审批 |
|
|
|
console.log('列表-操作按钮事件-提交审批') |
|
|
|
await message.confirm('确认要提交审批吗?') |
|
|
|
ProductionMainApi.submit(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanTur') { // 驳回 |
|
|
|
console.log('列表-操作按钮事件-驳回') |
|
|
|
await message.confirm('确认要驳回吗?') |
|
|
|
ProductionMainApi.reject(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanApp') { // 审批通过 |
|
|
|
console.log('列表-操作按钮事件-审批通过') |
|
|
|
await message.confirm('确认要审批通过吗?') |
|
|
|
ProductionMainApi.agree(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanPub') { // 发布 |
|
|
|
await message.confirm('确认要发布吗?') |
|
|
|
ProductionMainApi.publish(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'mainPlanRes') { // 重置 |
|
|
|
await message.confirm('确认要重置吗?') |
|
|
|
ProductionMainApi.resetting(row.id).then(() => { |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
|
openForm('update', row) |
|
|
|
} else if (val == 'delete') { // 删除 |
|
|
@ -254,7 +283,7 @@ const handleExport = async () => { |
|
|
|
// 发起导出 |
|
|
|
exportLoading.value = true |
|
|
|
const data = await ProductionMainApi.exportProductionMain(setSearchParams) |
|
|
|
download.excel(data, '生产计划主.xls') |
|
|
|
download.excel(data, '生产计划.xls') |
|
|
|
} catch { |
|
|
|
} finally { |
|
|
|
exportLoading.value = false |
|
|
@ -281,9 +310,9 @@ const handleDeleteTable = (item, index) => { |
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
await ProductionMainApi.createProductionMain(data) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
@ -307,7 +336,7 @@ const handleImport = () => { |
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: '生产计划主导入模版.xls' |
|
|
|
templateTitle: '生产计划导入模版.xls' |
|
|
|
}) |
|
|
|
|
|
|
|
// 导入成功之后 |
|
|
|