|
@ -166,6 +166,16 @@ const buttonBaseClick = (val, item) => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
|
|
const isShowMainButton = (row,val) => { |
|
|
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
|
|
return false |
|
|
|
|
|
} else { |
|
|
|
|
|
return true |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
// 列表-操作按钮 |
|
|
const butttondata = (row,$index) => { |
|
|
const butttondata = (row,$index) => { |
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
@ -173,8 +183,14 @@ const butttondata = (row,$index) => { |
|
|
return [] |
|
|
return [] |
|
|
} |
|
|
} |
|
|
return [ |
|
|
return [ |
|
|
defaultButtons.mainListEditBtn({hasPermi:'wms:processproduction-request-main:update'}), // 编辑 |
|
|
defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:processproduction-request-main:close'}), // 关闭 |
|
|
defaultButtons.mainListDeleteBtn({hasPermi:'wms:processproduction-request-main:delete'}), // 删除 |
|
|
defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']),hasPermi:'wms:transferreceipt-request-main:reAdd'}), // 重新添加 |
|
|
|
|
|
defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:transferreceipt-request-main:submit'}), // 提交审批 |
|
|
|
|
|
defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:transferreceipt-request-main:refused'}), // 驳回 |
|
|
|
|
|
defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:transferreceipt-request-main:agree'}), // 审批通过 |
|
|
|
|
|
defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:transferreceipt-request-main:handle'}), // 处理 |
|
|
|
|
|
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:processproduction-request-main:update'}), // 编辑 |
|
|
|
|
|
defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:processproduction-request-main:delete'}), // 删除 |
|
|
] |
|
|
] |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -182,19 +198,116 @@ const buttondataTable = ref() |
|
|
|
|
|
|
|
|
// 列表-操作按钮事件 |
|
|
// 列表-操作按钮事件 |
|
|
const buttonTableClick = async (val, row) => { |
|
|
const buttonTableClick = async (val, row) => { |
|
|
if (val == 'edit') { // 编辑 |
|
|
if (val == 'mainClose') { // 关闭 |
|
|
|
|
|
handleClose(row.masterId) |
|
|
|
|
|
} else if(val == 'mainReAdd'){// 重新添加 |
|
|
|
|
|
handleReAdd(row.masterId) |
|
|
|
|
|
} else if(val == ''){ // 提交审批 |
|
|
|
|
|
handleSubmit(row.masterId) |
|
|
|
|
|
} else if (val == 'mainTurnDown') { // 驳回 |
|
|
|
|
|
handleRefused(row.masterId) |
|
|
|
|
|
} else if (val == 'mainApprove') { // 审批通过 |
|
|
|
|
|
handleAgree(row.masterId) |
|
|
|
|
|
} else if (val == 'mainHandle') { // 处理 |
|
|
|
|
|
handleHandle(row.masterId) |
|
|
|
|
|
} else if (val == 'edit') { // 编辑 |
|
|
openForm('update', row) |
|
|
openForm('update', row) |
|
|
} else if (val == 'delete') { // 删除 |
|
|
} else if (val == 'delete') { // 删除 |
|
|
handleDelete(row.id) |
|
|
handleDelete(row.id) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 关闭按钮操作 */ |
|
|
|
|
|
const handleClose = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmColse')) |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
await ProcessproductionRequestMainApi.closeProcessproductionRequestMain(id) |
|
|
|
|
|
message.success(t('common.closeSuccess')) |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 重新添加按钮操作 */ |
|
|
|
|
|
const handleReAdd = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmReAdd')) |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
await ProcessproductionRequestMainApi.reAddProcessproductionRequestMain(id) |
|
|
|
|
|
message.success(t('common.reAddSuccess')) |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 提交按钮操作 */ |
|
|
|
|
|
const handleSubmit = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmSubmit')) |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
await ProcessproductionRequestMainApi.submitProcessproductionRequestMain(id) |
|
|
|
|
|
message.success(t('common.submitSuccess')) |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 审批驳回按钮操作 */ |
|
|
|
|
|
const handleRefused = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmRefused')) |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
await ProcessproductionRequestMainApi.refusedProcessproductionRequestMain(id) |
|
|
|
|
|
message.success(t('common.refusedSuccess')) |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 审批通过按钮操作 */ |
|
|
|
|
|
const handleAgree = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmAgree')) |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
await ProcessproductionRequestMainApi.agreeProcessproductionRequestMain(id) |
|
|
|
|
|
message.success(t('common.agreeSuccess')) |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 处理按钮操作 */ |
|
|
|
|
|
const handleHandle = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
await message.confirm(t('common.confirmHandle')) |
|
|
|
|
|
tableObject.loading = true |
|
|
|
|
|
await ProcessproductionRequestMainApi.handleProcessproductionRequestMain(id) |
|
|
|
|
|
message.success(t('common.handleSuccess')) |
|
|
|
|
|
tableObject.loading = false |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 添加/修改操作 */ |
|
|
/** 添加/修改操作 */ |
|
|
const basicFormRef = ref() |
|
|
const basicFormRef = ref() |
|
|
const openForm = (type: string, row?: any) => { |
|
|
const openForm = (type: string, row?: any) => { |
|
|
basicFormRef.value.open(type, row) |
|
|
basicFormRef.value.open(type, row) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
|
|
|
const handleDelete = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
// 删除的二次确认 |
|
|
|
|
|
await message.delConfirm() |
|
|
|
|
|
// 发起删除 |
|
|
|
|
|
await ProcessproductionRequestMainApi.deleteProcessproductionRequestMain(id) |
|
|
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
// 主子数据 提交 |
|
|
const submitForm = async (formType, data) => { |
|
|
const submitForm = async (formType, data) => { |
|
@ -241,19 +354,6 @@ const openDetail = (row: any, titleName: any, titleValue: any) => { |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicProcessproductionRequestMain') |
|
|
detailRef.value.openDetail(row, titleName, titleValue, 'basicProcessproductionRequestMain') |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 删除按钮操作 */ |
|
|
|
|
|
const handleDelete = async (id: number) => { |
|
|
|
|
|
try { |
|
|
|
|
|
// 删除的二次确认 |
|
|
|
|
|
await message.delConfirm() |
|
|
|
|
|
// 发起删除 |
|
|
|
|
|
await ProcessproductionRequestMainApi.deleteProcessproductionRequestMain(id) |
|
|
|
|
|
message.success(t('common.delSuccess')) |
|
|
|
|
|
// 刷新列表 |
|
|
|
|
|
await getList() |
|
|
|
|
|
} catch {} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */ |
|
|
/** 导出按钮操作 */ |
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
const exportLoading = ref(false) // 导出的加载中 |
|
|
const handleExport = async () => { |
|
|
const handleExport = async () => { |
|
|