From a2c533ee00e5c80519fdcb05caa05c47d39bf9f6 Mon Sep 17 00:00:00 2001 From: zhaoxuebing <1291173720@qq.com> Date: Wed, 22 May 2024 15:09:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E4=BB=BB=E5=8A=A1=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/countJobMain/index.ts | 10 +++++- .../count/countJobMain/countJobMain.data.ts | 2 +- .../countManage/count/countJobMain/index.vue | 35 ++++++++++++++++++- 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/src/api/wms/countJobMain/index.ts b/src/api/wms/countJobMain/index.ts index 3d9c2a5e8..2f685a8cf 100644 --- a/src/api/wms/countJobMain/index.ts +++ b/src/api/wms/countJobMain/index.ts @@ -89,5 +89,13 @@ export const importTemplate = () => { // 关闭盘点任务主 export const closeCountJobMain = (id: number) => { - return request.download({ url: '/wms/count-job-main/close?id=' + id }) + return request.put({ url: '/wms/count-job-main/close?id=' + id }) } + +// 关闭盘点任务主 +export const handleExportCountJob = async (id: number) => { + let params = { + masterId:id + } + return await request.download({ url: `/wms/count-job-main/export-excel-single`, params }) +} \ No newline at end of file diff --git a/src/views/wms/countManage/count/countJobMain/countJobMain.data.ts b/src/views/wms/countManage/count/countJobMain/countJobMain.data.ts index 8fb474d8a..d8a07ccd3 100644 --- a/src/views/wms/countManage/count/countJobMain/countJobMain.data.ts +++ b/src/views/wms/countManage/count/countJobMain/countJobMain.data.ts @@ -501,7 +501,7 @@ export const CountJobMain = useCrudSchemas(reactive([ isDetail: false, isForm: false, table: { - width: 120, + width: 180, fixed: 'right' }, } diff --git a/src/views/wms/countManage/count/countJobMain/index.vue b/src/views/wms/countManage/count/countJobMain/index.vue index 8cf17ac71..ba882335d 100644 --- a/src/views/wms/countManage/count/countJobMain/index.vue +++ b/src/views/wms/countManage/count/countJobMain/index.vue @@ -186,7 +186,25 @@ const butttondata = (row,$index) => { } return [ // defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1'])}), // 承接 - defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:count-job-main:close'}), // 关闭 + defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1','2']),hasPermi:'wms:count-job-main:close'}), // 关闭 + { + label: '导出', + name: 'exportCountJob', + hide: isShowMainButton(row,['1','2']), + type: 'success', + color: '', + link: true, //文本展现按钮 + hasPermi: '' // wms:count-job-main:exportCountJob + }, + { + label: '导入', + name: 'importCountJob', + hide: isShowMainButton(row,['1','2']), + type: 'success', + color: '', + link: true, //文本展现按钮 + hasPermi: '' // wms:count-job-main:importCountJob + } // defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2'])}), // 放弃 // defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2'])}), // 执行 ] @@ -202,6 +220,8 @@ const buttonTableClick = async (val, row) => { handleClose(row.masterId) } else if (val == 'mainJobAcc') { // 承接 console.log('列表-操作按钮事件-承接') + } else if (val == 'exportCountJob'){// 当前任务导出 + handleExportCountJob(row.masterId,row.number) } } @@ -240,6 +260,19 @@ const handleExport = async () => { } } +/** 单条任务导出 */ +const handleExportCountJob = async (id: number,number: string) => { + try { + await message.exportConfirm() + exportLoading.value = true + const data = await CountJobMainApi.handleExportCountJob(id) + download.excel(data, '盘点任务主'+number+'.xlsx') + } catch { + }finally { + exportLoading.value = false + } +} + // 筛选提交 const searchFormClick = (searchData) => { tableObject.params = {