|
|
@ -161,10 +161,10 @@ |
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
// defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // 承接 |
|
|
|
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), // 关闭 |
|
|
|
// defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 |
|
|
|
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 |
|
|
|
defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-job-main:accept'}), // 承接 |
|
|
|
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'qms:inspection-job-main:close'}), // 关闭 |
|
|
|
defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2']),hasPermi:'qms:inspection-job-main:abandon'}), // 放弃 |
|
|
|
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2']),hasPermi:'qms:inspection-job-main:execute'}), // 执行 |
|
|
|
defaultButtons.mainListPackageBtn(null), // 包装 |
|
|
|
] |
|
|
|
} |
|
|
@ -176,10 +176,15 @@ const listTableRef = ref() |
|
|
|
}else if (val == 'mainPackage') { // 包装 |
|
|
|
const list = await InspectionJobMainApi.getInspectionJobPackageList(row.id) |
|
|
|
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list) |
|
|
|
} |
|
|
|
else if (val == 'mainJobClo') { // 关闭 |
|
|
|
handleDelete(row.id) |
|
|
|
} |
|
|
|
}else if (val == 'mainJobAba') { // 放弃 |
|
|
|
console.log('列表-操作按钮事件-放弃') |
|
|
|
handleAbandon(row.id) |
|
|
|
} else if (val == 'mainJobClo') { // 关闭 |
|
|
|
handleClose(row.id) |
|
|
|
} else if (val == 'mainJobAcc') { // 承接 |
|
|
|
console.log('列表-操作按钮事件-承接') |
|
|
|
handleAccept(row.id) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
@ -200,14 +205,38 @@ const listTableRef = ref() |
|
|
|
const execute = async (type : string, row ?: number) => { |
|
|
|
formRef.value.open(type, row) |
|
|
|
} |
|
|
|
/** 删除按钮操作 */ |
|
|
|
const handleDelete = async (id : number) => { |
|
|
|
/** 关闭按钮操作 */ |
|
|
|
const handleClose = async (id : number) => { |
|
|
|
try { |
|
|
|
// 删除的二次确认 |
|
|
|
await message.delConfirm() |
|
|
|
await message.confirm(t('common.confirmColse')) |
|
|
|
// 发起删除 |
|
|
|
await InspectionJobMainApi.deleteInspectionJobMain(id) |
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
await InspectionJobMainApi.closeInspectionJobMain(id) |
|
|
|
message.success(t('common.closeSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
// 承接 |
|
|
|
const handleAccept = async (id : number) => { |
|
|
|
try { |
|
|
|
// 承接的二次确认 |
|
|
|
await message.confirm(t('common.confirmAccept')) |
|
|
|
// 发起承接 |
|
|
|
await InspectionJobMainApi.acceptInspectionJobMain(id) |
|
|
|
message.success(t('common.acceptSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|
} |
|
|
|
// 放弃任务 |
|
|
|
const handleAbandon = async (id : number) => { |
|
|
|
try { |
|
|
|
// 放弃的二次确认 |
|
|
|
await message.confirm(t('common.confirmGiveup')) |
|
|
|
// 发起放弃 |
|
|
|
await InspectionJobMainApi.abandonInspectionJobMain(id) |
|
|
|
message.success(t('common.giveupSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
|