From 7f5d8f3cb97779f3e8f0157828711bebf572ed47 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Wed, 13 Dec 2023 19:41:54 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E7=AE=A1=E7=90=86=E5=92=8C?= =?UTF-8?q?=E7=9B=98=E7=82=B9=E8=B0=83=E6=95=B4=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/countRecordMain/index.ts | 5 ++ src/api/wms/countRequestMain/index.ts | 12 +-- src/api/wms/countadjustRequestMain/index.ts | 32 +++++++- src/utils/disposition/defaultButtons.ts | 12 +++ .../count/countJobMain/countJobMain.data.ts | 20 ++--- .../count/countPlanMain/countPlanMain.data.ts | 16 ++-- .../countManage/count/countPlanMain/index.vue | 74 ++++++++++++++----- .../countRecordMain/countRecordMain.data.ts | 10 +++ .../count/countRecordMain/index.vue | 14 +++- .../count/countRequestMain/index.vue | 56 +++++++++++--- .../countadjustRequestMain/index.vue | 73 +++++++++++++----- 11 files changed, 250 insertions(+), 74 deletions(-) diff --git a/src/api/wms/countRecordMain/index.ts b/src/api/wms/countRecordMain/index.ts index ae6391533..e4b43a074 100644 --- a/src/api/wms/countRecordMain/index.ts +++ b/src/api/wms/countRecordMain/index.ts @@ -62,4 +62,9 @@ export const exportCountRecordMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/count-record-main/get-import-template' }) +} + +// 生成盘点调整 +export const generateCountRecordMain = async (id) => { + return await request.put({ url: `/wms/count-record-main/generate?id=` + id}) } \ No newline at end of file diff --git a/src/api/wms/countRequestMain/index.ts b/src/api/wms/countRequestMain/index.ts index 2f462c421..7c47d57c4 100644 --- a/src/api/wms/countRequestMain/index.ts +++ b/src/api/wms/countRequestMain/index.ts @@ -64,31 +64,31 @@ export const importTemplate = () => { } // 关闭盘点申请主 Excel -export const closeCountRequestMain = async (id) => { +export const close = async (id) => { return await request.put({ url: `/wms/count-request-main/close?id=` + id }) } // 重新添加盘点申请主 Excel -export const reAddCountRequestMain = async (id) => { +export const reAdd = async (id) => { return await request.put({ url: `/wms/count-request-main/reAdd?id=` + id }) } // 提交盘点申请主 Excel -export const submitCountRequestMain = async (id) => { +export const submit = async (id) => { return await request.put({ url: `/wms/count-request-main/submit?id=` + id }) } // 审批通过盘点申请主 Excel -export const agreeCountRequestMain = async (id) => { +export const agree = async (id) => { return await request.put({ url: `/wms/count-request-main/agree?id=` + id }) } // 审批驳回盘点申请主 Excel -export const refusedCountRequestMain = async (id) => { +export const refused = async (id) => { return await request.put({ url: `/wms/count-request-main/refused?id=` + id }) } // 处理盘点申请主 Excel -export const handleCountRequestMain = async (id) => { +export const handle = async (id) => { return await request.put({ url: `/wms/count-request-main/handle?id=` + id }) } diff --git a/src/api/wms/countadjustRequestMain/index.ts b/src/api/wms/countadjustRequestMain/index.ts index 390c8fe01..57ae5ee0e 100644 --- a/src/api/wms/countadjustRequestMain/index.ts +++ b/src/api/wms/countadjustRequestMain/index.ts @@ -60,4 +60,34 @@ export const exportCountadjustRequestMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/countadjust-request-main/get-import-template' }) -} \ No newline at end of file +} + +// 关闭盘点申请主 Excel +export const close = async (id) => { + return await request.put({ url: `/wms/countadjust-request-main/close?id=` + id }) +} + +// 重新添加盘点申请主 Excel +export const reAdd = async (id) => { + return await request.put({ url: `/wms/countadjust-request-main/reAdd?id=` + id }) +} + +// 提交盘点申请主 Excel +export const submit = async (id) => { + return await request.put({ url: `/wms/countadjust-request-main/submit?id=` + id }) +} + +// 审批通过盘点申请主 Excel +export const agree = async (id) => { + return await request.put({ url: `/wms/countadjust-request-main/agree?id=` + id }) +} + +// 审批驳回盘点申请主 Excel +export const refused = async (id) => { + return await request.put({ url: `/wms/countadjust-request-main/refused?id=` + id }) +} + +// 处理盘点申请主 Excel +export const handle = async (id) => { + return await request.put({ url: `/wms/countadjust-request-main/handle?id=` + id }) +} diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 9f62970ac..22ffb4b48 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -687,6 +687,18 @@ export function mainPutawayRequestBtn(option:any) { hasPermi: '' }) } +// 主列表-生成盘点调整申请 +export function mainCountAdjustRequesttBtn(option:any) { + return __defaultBtnOption(option,{ + label: '生成盘点调整申请', + name: 'countAdjustRequest', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} // 默认按钮规则 function __defaultBtnOption(option:any,specific:any){ return { diff --git a/src/views/wms/countManage/count/countJobMain/countJobMain.data.ts b/src/views/wms/countManage/count/countJobMain/countJobMain.data.ts index bb25e78bd..aa11f150a 100644 --- a/src/views/wms/countManage/count/countJobMain/countJobMain.data.ts +++ b/src/views/wms/countManage/count/countJobMain/countJobMain.data.ts @@ -518,16 +518,16 @@ export const CountJobMain = useCrudSchemas(reactive([ // width: 150 // }, // }, - { - label: '操作', - field: 'action', - isDetail: false, - isForm: false, - table: { - width: 120, - fixed: 'right' - }, - } + // { + // label: '操作', + // field: 'action', + // isDetail: false, + // isForm: false, + // table: { + // width: 120, + // fixed: 'right' + // }, + // } ])) //表单校验 diff --git a/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts b/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts index aa814f623..361bee941 100644 --- a/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts +++ b/src/views/wms/countManage/count/countPlanMain/countPlanMain.data.ts @@ -91,14 +91,14 @@ export const CountPlanMain = useCrudSchemas(reactive([ } } }, - { - label: '盘点范围列表', - field: 'scopeList', - sort: 'custom', - table: { - width: 150 - }, - }, + // { + // label: '盘点范围列表', + // field: 'scopeList', + // sort: 'custom', + // table: { + // width: 150 + // }, + // }, { label: '快照盘点', field: 'isSnapshot', diff --git a/src/views/wms/countManage/count/countPlanMain/index.vue b/src/views/wms/countManage/count/countPlanMain/index.vue index 25130598a..f4c2d91b2 100644 --- a/src/views/wms/countManage/count/countPlanMain/index.vue +++ b/src/views/wms/countManage/count/countPlanMain/index.vue @@ -272,30 +272,64 @@ const butttondata = (row) => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { - if (val == 'mainClose') { - // 关闭 - console.log('列表-操作按钮事件-关闭') - } else if (val == 'mainReAdd') { - // 重新添加 - console.log('列表-操作按钮事件-重新添加') - } else if (val == 'mainSubmit') { - // 提交审批 - console.log('列表-操作按钮事件-提交审批') - } else if (val == 'mainTurnDown') { - // 驳回 - console.log('列表-操作按钮事件-驳回') - } else if (val == 'mainApprove') { - // 审批通过 - console.log('列表-操作按钮事件-审批通过') - } else if (val == 'edit') { - // 编辑 + if (val == 'mainPlanOpe') { // 打开 + CountPlanMainApi.open(row.id).then(() => { + message.success(t('打开成功')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanClo') { // 关闭 + await message.confirm('确认要关闭吗?') + CountPlanMainApi.close(row.id).then(() => { + message.success(t('关闭成功')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanSub') { // 提交审批 + await message.confirm(t('common.confirmSubmit')) + await CountPlanMainApi.submit(row.id) + message.success(t('提交审批成功')) + await getList() + } else if (val == 'mainPlanTur') { // 驳回 + await message.confirm('确认要驳回吗?') + CountPlanMainApi.reject(row.id).then(() => { + message.success(t('驳回成功')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanApp') { // 审批通过 + await message.confirm('确认要审批通过吗?') + CountPlanMainApi.agree(row.id).then(() => { + message.success(t('审批已通过')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanPub') { // 发布 + await message.confirm('确认要发布吗?') + CountPlanMainApi.publish(row.id).then(() => { + message.success(t('发布成功')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainPlanRes') { // 重置 + await message.confirm('确认要重置吗?') + CountPlanMainApi.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') { - // 删除 + } else if (val == 'delete') { // 删除 handleDelete(row.id) } } - /** 添加/修改操作 */ const formRef = ref() const openForm = async (type: string, row?: number) => { diff --git a/src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts b/src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts index edd5f9e38..2bc04a40b 100644 --- a/src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts +++ b/src/views/wms/countManage/count/countRecordMain/countRecordMain.data.ts @@ -247,6 +247,16 @@ export const CountRecordMain = useCrudSchemas(reactive([ width: 150 }, }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 180, + fixed: 'right' + }, + } ])) //表单校验 diff --git a/src/views/wms/countManage/count/countRecordMain/index.vue b/src/views/wms/countManage/count/countRecordMain/index.vue index cc1144865..61aa7c346 100644 --- a/src/views/wms/countManage/count/countRecordMain/index.vue +++ b/src/views/wms/countManage/count/countRecordMain/index.vue @@ -120,11 +120,23 @@ const buttonBaseClick = (val, item) => { // 列表-操作按钮 const butttondata = (row) => { - return [] + return [ + defaultButtons.mainCountAdjustRequesttBtn({ + hasPermi: 'wms:count-record-main:generate' + }), // 生成盘点调整申请 + ] } // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { + if(val == 'countAdjustRequest'){ + CountRecordMainApi.generateCountRecordMain(row.id).then(()=>{ + message.success(t('生成成功')) + getList() + }).catch(err => { + console.log(err) + }) + } } /** 详情操作 */ diff --git a/src/views/wms/countManage/count/countRequestMain/index.vue b/src/views/wms/countManage/count/countRequestMain/index.vue index 923ec3a24..5b84e06d6 100644 --- a/src/views/wms/countManage/count/countRequestMain/index.vue +++ b/src/views/wms/countManage/count/countRequestMain/index.vue @@ -148,8 +148,8 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn({hasPermi:'wms:count-request-main:create'}), // 新增——需要手动修改下权限 - defaultButtons.defaultImportBtn({hasPermi:'wms:count-request-main:import'}), // 导入 + // defaultButtons.defaultAddBtn({hasPermi:'wms:count-request-main:create'}), // 新增——需要手动修改下权限 + // defaultButtons.defaultImportBtn({hasPermi:'wms:count-request-main:import'}), // 导入 defaultButtons.defaultExportBtn({hasPermi:'wms:count-request-main:export'}), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 @@ -205,19 +205,57 @@ const butttondata = (row) => { // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainClose') { // 关闭 - handleClose(row.id) + await message.confirm('确认要关闭吗?') + CountRequestMainApi.close(row.id).then(() => { + message.success(t('关闭成功')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainReAdd') { // 重新添加 - handleReAdd(row.id) + await message.confirm('确认要重新添加吗?') + CountRequestMainApi.reAdd(row.id).then(() => { + message.success(t('添加成功')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainSubmit') { // 提交审批 - handleSubmit(row.id) + await message.confirm('确认要提交审批吗?') + CountRequestMainApi.submit(row.id).then(() => { + message.success(t('提交审批成功')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainTurnDown') { // 驳回 - handleRefused(row.id) + await message.confirm('确认要驳回吗?') + CountRequestMainApi.refused(row.id).then(() => { + message.success(t('驳回成功')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainApprove') { // 审批通过 - handleAgree(row.id) + await message.confirm('确认要审批通过吗?') + CountRequestMainApi.agree(row.id).then(() => { + message.success(t('审批已通过')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainHandle') { // 处理 - handleHandle(row.id) - } else if (val == 'edit') { // 编辑 + await message.confirm('确认要处理吗?') + CountRequestMainApi.handle(row.id).then(() => { + message.success(t('处理成功')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'edit') { // 编辑 openForm('update', row) + } else if (val == 'delete') { // 删除 + handleDelete(row.id) } } diff --git a/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue b/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue index 857ce78dd..f952089db 100644 --- a/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue +++ b/src/views/wms/countManage/countadjust/countadjustRequestMain/index.vue @@ -134,8 +134,8 @@ const { getList, setSearchParams } = tableMethods // 列表头部按钮 const HeadButttondata = [ - defaultButtons.defaultAddBtn({hasPermi:'wms:countadjust-request-main:create'}), // 新增——需要手动修改下权限 - defaultButtons.defaultImportBtn({hasPermi:'wms:countadjust-request-main:import'}), // 导入 + // defaultButtons.defaultAddBtn({hasPermi:'wms:countadjust-request-main:create'}), // 新增——需要手动修改下权限 + // defaultButtons.defaultImportBtn({hasPermi:'wms:countadjust-request-main:import'}), // 导入 defaultButtons.defaultExportBtn({hasPermi:'wms:countadjust-request-main:export'}), // 导出 defaultButtons.defaultFreshBtn(null), // 刷新 defaultButtons.defaultFilterBtn(null), // 筛选 @@ -178,37 +178,73 @@ 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:countadjust-request-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:countadjust-request-main:delete'}), // 删除 + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4','6']),hasPermi:'wms:countadjust-request-main:close'}), // 关闭 + defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:countadjust-request-main:reAdd'}), //重新添加 + defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:countadjust-request-main:submit'}), // 提交审批 + defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:countadjust-request-main:refused'}), // 驳回 + defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:countadjust-request-main:agree'}), // 审批通过 + defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']),hasPermi:'wms:countadjust-request-main:handle'}), // 处理 + defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:countadjust-request-main:delete'}), // 删除 ] } - - - // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainClose') { // 关闭 - console.log('列表-操作按钮事件-关闭') + await message.confirm('确认要关闭吗?') + CountadjustRequestMainApi.close(row.id).then(() => { + message.success(t('关闭成功')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainReAdd') { // 重新添加 - console.log('列表-操作按钮事件-重新添加') + await message.confirm('确认要重新添加吗?') + CountadjustRequestMainApi.reAdd(row.id).then(() => { + message.success(t('添加成功')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainSubmit') { // 提交审批 - console.log('列表-操作按钮事件-提交审批') + await message.confirm('确认要提交审批吗?') + CountadjustRequestMainApi.submit(row.id).then(() => { + message.success(t('提交审批成功')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainTurnDown') { // 驳回 - console.log('列表-操作按钮事件-驳回') + await message.confirm('确认要驳回吗?') + CountadjustRequestMainApi.refused(row.id).then(() => { + message.success(t('驳回成功')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainApprove') { // 审批通过 - console.log('列表-操作按钮事件-审批通过') - } else if (val == 'edit') { // 编辑 + await message.confirm('确认要审批通过吗?') + CountadjustRequestMainApi.agree(row.id).then(() => { + message.success(t('审批已通过')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainHandle') { // 处理 + await message.confirm('确认要处理吗?') + CountadjustRequestMainApi.handle(row.id).then(() => { + message.success(t('处理成功')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'edit') { // 编辑 openForm('update', row) } else if (val == 'delete') { // 删除 handleDelete(row.id) } } + /** 添加/修改操作 */ const formRef = ref() const openForm =async (type: string, row?: number) => { @@ -317,6 +353,5 @@ const searchFormClick = (searchData) => { /** 初始化 **/ onMounted(async () => { getList() - importTemplateData.templateUrl = await CountadjustRequestMainApi.importTemplate() })