From edcbdfe73b2b2256c193c6db48568b916cacd64f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Thu, 14 Dec 2023 19:05:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E5=93=81=E4=B8=8A=E6=9E=B6=E7=94=B3?= =?UTF-8?q?=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/productputawayRequestMain/index.ts | 38 +++++++++- .../productputawayRequestMain/index.vue | 70 ++++++++++++++----- .../productputawayRequestMain.data.ts | 67 +++++++++++++----- 3 files changed, 139 insertions(+), 36 deletions(-) diff --git a/src/api/wms/productputawayRequestMain/index.ts b/src/api/wms/productputawayRequestMain/index.ts index 6470124f8..72640c600 100644 --- a/src/api/wms/productputawayRequestMain/index.ts +++ b/src/api/wms/productputawayRequestMain/index.ts @@ -59,10 +59,46 @@ export const deleteProductputawayRequestMain = async (id: number) => { // 导出制品上架申请主 Excel export const exportProductputawayRequestMain = async (params) => { - return await request.download({ url: `/wms/productputaway-request-main/export-excel`, params }) + if (params.isSearch) { + const data = {...params} + return await request.downloadPost({ url: `/wms/productputaway-request-main/export-excel-senior`, data }) + } else { + return await request.download({ url: `/wms/productputaway-request-main/export-excel`, params }) + } } // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/productputaway-request-main/get-import-template' }) +} + + +// 关闭 +export const close = (id) => { + return request.put({ url: '/wms/productputaway-request-main/close?id=' + id }) +} + +// 重新添加 +export const reAdd = (id) => { + return request.put({ url: '/wms/productputaway-request-main/reAdd?id=' + id }) +} + +// 提交审批 +export const submit = (id) => { + return request.put({ url: '/wms/productputaway-request-main/submit?id=' + id }) +} + +// 驳回 +export const refused = (id) => { + return request.put({ url: '/wms/productputaway-request-main/refused?id=' + id }) +} + +// 审批通过 +export const agree = (id) => { + return request.put({ url: '/wms/productputaway-request-main/agree?id=' + id }) +} + +// 处理 +export const handle = (id) => { + return request.put({ url: '/wms/productputaway-request-main/handle?id=' + id }) } \ No newline at end of file diff --git a/src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue b/src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue index 3889cf296..33bb6aed7 100644 --- a/src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue +++ b/src/views/wms/productionManage/productputaway/productputawayRequestMain/index.vue @@ -190,31 +190,67 @@ 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:productputaway-request-main:update'}), // 编辑 - defaultButtons.mainListDeleteBtn({hasPermi:'wms:productputaway-request-main:delete'}), // 删除 - ] + return [ + defaultButtons.mainListCloseBtn({hide:isShowMainButton(row,['1','2','3','4']), hasPermi:'wms:productputaway-request-main:close'}), // 关闭 + defaultButtons.mainListReAddBtn({hide:isShowMainButton(row,['4','5']), hasPermi:'wms:productputaway-request-main:reAdd'}), // 重新添加 + defaultButtons.mainListSubmitBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productputaway-request-main:submit'}), // 提交审批 + defaultButtons.mainListTurnDownBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productputaway-request-main:refused'}), // 驳回 + defaultButtons.mainListApproveBtn({hide:isShowMainButton(row,['2']), hasPermi:'wms:productputaway-request-main:agree'}), // 审批通过 + defaultButtons.mainListHandleBtn({hide:isShowMainButton(row,['3']), hasPermi:'wms:productputaway-request-main:handle'}), // 处理 + defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']), hasPermi:'wms:productputaway-request-main:update'}), // 编辑 + ] } - - // 列表-操作按钮事件 const buttonTableClick = async (val, row) => { if (val == 'mainClose') { // 关闭 - console.log('列表-操作按钮事件-关闭') + await message.confirm('确认要关闭吗?') + ProductputawayRequestMainApi.close(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainReAdd') { // 重新添加 - console.log('列表-操作按钮事件-重新添加') + await message.confirm('确认要重新添加吗?') + ProductputawayRequestMainApi.reAdd(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainSubmit') { // 提交审批 - console.log('列表-操作按钮事件-提交审批') + await message.confirm('确认要重新添加吗?') + ProductputawayRequestMainApi.submit(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainTurnDown') { // 驳回 - console.log('列表-操作按钮事件-驳回') + await message.confirm('确认要重新添加吗?') + ProductputawayRequestMainApi.refused(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) } else if (val == 'mainApprove') { // 审批通过 - console.log('列表-操作按钮事件-审批通过') + await message.confirm('确认要审批通过吗?') + ProductputawayRequestMainApi.agree(row.id).then(() => { + message.success(t('common.updateSuccess')) + getList() + }).catch(err => { + console.log(err) + }) + } else if (val == 'mainHandle') { // 处理 + await message.confirm('确认要处理吗?') + ProductputawayRequestMainApi.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') { // 删除 @@ -256,7 +292,7 @@ const handleExport = async () => { await message.exportConfirm() // 发起导出 exportLoading.value = true - const data = await ProductputawayRequestMainApi.exportProductputawayRequestMain(setSearchParams) + const data = await ProductputawayRequestMainApi.exportProductputawayRequestMain(tableObject.params) download.excel(data, '制品上架申请主.xlsx') } catch { } finally { diff --git a/src/views/wms/productionManage/productputaway/productputawayRequestMain/productputawayRequestMain.data.ts b/src/views/wms/productionManage/productputaway/productputawayRequestMain/productputawayRequestMain.data.ts index 35ceb6933..5108e12b1 100644 --- a/src/views/wms/productionManage/productputaway/productputawayRequestMain/productputawayRequestMain.data.ts +++ b/src/views/wms/productionManage/productputaway/productputawayRequestMain/productputawayRequestMain.data.ts @@ -25,16 +25,16 @@ const userDept = userStore.userSelfInfo.dept * @returns {Array} 制品上架申请主表 */ export const ProductputawayRequestMain = useCrudSchemas(reactive([ - { - label: '供应商代码', - field: 'supplierCode', - sort: 'custom', - table: { - width: 150 - }, - isSearch: true, - isForm: false, - }, + // { + // label: '供应商代码', + // field: 'supplierCode', + // sort: 'custom', + // table: { + // width: 150 + // }, + // isSearch: true, + // isForm: false, + // }, { label: '从仓库代码', field: 'fromWarehouseCode', @@ -165,6 +165,7 @@ export const ProductputawayRequestMain = useCrudSchemas(reactive([ form: { component: 'DatePicker', componentProps: { + style: {width:'100%'}, type: 'datetime', dateFormat: 'YYYY-MM-DD HH:mm:ss', valueFormat: 'x', @@ -429,6 +430,11 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive table: { width: 150 }, + form: { + componentProps: { + disabled: true + } + }, tableForm: { disabled: true } @@ -440,6 +446,11 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive table: { width: 150 }, + form: { + componentProps: { + disabled: true + } + }, tableForm: { disabled: true } @@ -451,6 +462,11 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive table: { width: 150 }, + form: { + componentProps: { + disabled: true + } + }, tableForm: { disabled: true } @@ -465,6 +481,11 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive table: { width: 150 }, + form: { + componentProps: { + disabled: true + } + }, tableForm: { type: 'Select', disabled: true @@ -497,6 +518,11 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive table: { width: 150 }, + form: { + componentProps: { + disabled: true + } + }, tableForm: { disabled: true } @@ -515,14 +541,6 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive } } }, - { - label: '备注', - field: 'remark', - sort: 'custom', - table: { - width: 150 - }, - }, { label: '创建时间', field: 'createTime', @@ -625,6 +643,11 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive table: { width: 150 }, + form: { + componentProps: { + disabled: true + } + }, tableForm:{ type: 'Select', disabled: true @@ -650,6 +673,14 @@ export const ProductputawayRequestDetail = useCrudSchemas(reactive isTableForm: false, isForm: false }, + { + label: '备注', + field: 'remark', + sort: 'custom', + table: { + width: 150 + }, + }, { label: '最后更新时间', field: 'updateTime',