From e3bf19bb6d33f30d5b6baefd5632c590b215626e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Tue, 28 Nov 2023 14:53:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E6=96=99=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/repleinshRequestMain/index.ts | 38 ++++++++- .../issue/issueRequestMain/index.vue | 12 +-- .../repleinsh/repleinshRequestMain/index.vue | 84 ++++++++++++------- 3 files changed, 95 insertions(+), 39 deletions(-) diff --git a/src/api/wms/repleinshRequestMain/index.ts b/src/api/wms/repleinshRequestMain/index.ts index 8ebd4a346..5a30d78cc 100644 --- a/src/api/wms/repleinshRequestMain/index.ts +++ b/src/api/wms/repleinshRequestMain/index.ts @@ -57,10 +57,46 @@ export const deleteRepleinshRequestMain = async (id: number) => { // 导出补料申请主 Excel export const exportRepleinshRequestMain = async (params) => { - return await request.download({ url: `/wms/repleinsh-request-main/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/repleinsh-request-main/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/repleinsh-request-main/export-excel`, params }) + } } // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/repleinsh-request-main/get-import-template' }) +} + + +// 关闭 +export const close = (id) => { + return request.put({ url: '/wms/repleinsh-request-main/close?id=' + id }) +} + +// 重新添加 +export const reAdd = (id) => { + return request.put({ url: '/wms/repleinsh-request-main/reAdd?id=' + id }) +} + +// 提交审批 +export const submit = (id) => { + return request.put({ url: '/wms/repleinsh-request-main/submit?id=' + id }) +} + +// 驳回 +export const refused = (id) => { + return request.put({ url: '/wms/repleinsh-request-main/refused?id=' + id }) +} + +// 审批通过 +export const agree = (id) => { + return request.put({ url: '/wms/repleinsh-request-main/agree?id=' + id }) +} + +// 处理 +export const handle = (id) => { + return request.put({ url: '/wms/repleinsh-request-main/handle?id=' + id }) } \ No newline at end of file diff --git a/src/views/wms/issueManage/issue/issueRequestMain/index.vue b/src/views/wms/issueManage/issue/issueRequestMain/index.vue index 18cba9828..9405da810 100644 --- a/src/views/wms/issueManage/issue/issueRequestMain/index.vue +++ b/src/views/wms/issueManage/issue/issueRequestMain/index.vue @@ -172,12 +172,12 @@ const isShowMainButton = (row,val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4'])}), // 关闭 - defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // 重新添加 - defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 - defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // 驳回 - defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 - defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3'])}), // 处理 + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), hasPermi:'wms:issue-request-main:close'}), // 关闭 + defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:issue-request-main:reAdd'}), // 重新添加 + defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:issue-request-main:submit'}), // 提交审批 + defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:issue-request-main:refused'}), // 驳回 + defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:issue-request-main:handle'}), // 审批通过 + defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:issue-request-main:update'}), // 处理 defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:issue-request-main:update'}), // 编辑 // defaultButtons.mainListDeleteBtn({hasPermi:'wms:issue-request-main:delete'}), // 删除 ] diff --git a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue index 0d36aeef3..0d539cd32 100644 --- a/src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue +++ b/src/views/wms/issueManage/repleinsh/repleinshRequestMain/index.vue @@ -67,7 +67,6 @@ :apiUpdate="RepleinshRequestDetailApi.updateRepleinshRequestDetail" :apiPage="RepleinshRequestDetailApi.getRepleinshRequestDetailPage" :apiDelete="RepleinshRequestDetailApi.deleteRepleinshRequestDetail" - :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: RepleinshRequestMainApi.getRepleinshRequestMainPage // 分页接口 }) @@ -145,7 +128,7 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn({hasPermi:'wms:repleinsh-request-main:create'}), // 新增——需要手动修改下权限 + defaultButtons.defaultAddBtn({hasPermi:'wms:repleinsh-request-main:create'}), // 新增 defaultButtons.defaultImportBtn({hasPermi:'wms:repleinsh-request-main:import'}), // 导入 defaultButtons.defaultExportBtn({hasPermi:'wms:repleinsh-request-main:export'}), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 @@ -189,13 +172,14 @@ const isShowMainButton = (row,val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6'])}), // 关闭 - defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5'])}), // 重新添加 - defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1'])}), // 提交审批 - defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2'])}), // 驳回 - defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2'])}), // 审批通过 - defaultButtons.mainListEditBtn({hasPermi:'wms:repleinsh-request-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:repleinsh-request-main:delete'}), // 删除 + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), hasPermi:'wms:repleinsh-request-main:close'}), // 关闭 + defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:repleinsh-request-main:reAdd'}), // 重新添加 + defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:repleinsh-request-main:submit'}), // 提交审批 + defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:repleinsh-request-main:refused'}), // 驳回 + defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:repleinsh-request-main:handle'}), // 审批通过 + defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:repleinsh-request-main:update'}), // 处理 + defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:repleinsh-request-main:update'}), // 编辑 + // defaultButtons.mainListDeleteBtn({hasPermi:'wms:repleinsh-request-main:delete'}), // 删除 ] } @@ -204,15 +188,51 @@ const butttondata = (row) => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainClose') { // 关闭 - console.log('列表-操作按钮事件-关闭') + await message.confirm('确认要关闭吗?') + RepleinshRequestMainApi.close(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainReAdd') { // 重新添加 - console.log('列表-操作按钮事件-重新添加') + await message.confirm('确认要重新添加吗?') + RepleinshRequestMainApi.reAdd(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainSubmit') { // 提交审批 - console.log('列表-操作按钮事件-提交审批') + await message.confirm('确认要重新添加吗?') + RepleinshRequestMainApi.submit(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainTurnDown') { // 驳回 - console.log('列表-操作按钮事件-驳回') + await message.confirm('确认要重新添加吗?') + RepleinshRequestMainApi.refused(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainApprove') { // 审批通过 - console.log('列表-操作按钮事件-审批通过') + RepleinshRequestMainApi.agree(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainHandle') { // 处理 + RepleinshRequestMainApi.handle(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') { // 删除 @@ -255,7 +275,7 @@ const handleExport = async () => { // 发起导出 exportLoading.value = true const data = await RepleinshRequestMainApi.exportRepleinshRequestMain(setSearchParams) - download.excel(data, '补料申请主.xlsx') + download.excel(data, '补料申请.xlsx') } catch { } finally { exportLoading.value = false @@ -308,7 +328,7 @@ const handleImport = () => { // 导入附件弹窗所需的参数 const importTemplateData = reactive({ templateUrl: '', - templateTitle: '补料申请主导入模版.xlsx' + templateTitle: '补料申请导入模版.xlsx' }) // 导入成功之后