From 02ee1cc0dd8a1d3d632a1bd8345b3e864dc1aeb2 Mon Sep 17 00:00:00 2001 From: zhang_li <2235006734@qqq.com> Date: Thu, 13 Jun 2024 19:48:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=B6=E5=85=A5=E5=BA=93=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/eam/sparePartsInLocationMain/index.ts | 19 ++- src/locales/en-US.ts | 4 + src/locales/zh-CN.ts | 4 + src/views/eam/sparepartsinlocation/index.vue | 124 ++++++++++++------ .../sparePartsInLocationMain.data.ts | 52 +++++--- 5 files changed, 150 insertions(+), 53 deletions(-) diff --git a/src/api/eam/sparePartsInLocationMain/index.ts b/src/api/eam/sparePartsInLocationMain/index.ts index 528bbb907..2365b84e3 100644 --- a/src/api/eam/sparePartsInLocationMain/index.ts +++ b/src/api/eam/sparePartsInLocationMain/index.ts @@ -67,4 +67,21 @@ export const exportSparePartsInLocationMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/spare-parts-in-location-main/get-import-template' }) -} \ No newline at end of file +} + +// 撤回 +export const cancelSparePartsInLocation = async (id) => { + return await request.get({ url: `/eam/spare-parts-in-location-main/cancel?id=` + id }) +} +// 审核 +export const submitExamineSparePartsInLocation = async (id) => { + return await request.get({ url: `/eam/spare-parts-in-location-main/submitExamine?id=` + id }) +} +// 审核驳回 +export const rejectSparePartsInLocation = async (id) => { + return await request.get({ url: `/eam/spare-parts-in-location-main/reject?id=` + id }) +} +// 审核通过 +export const approveSparePartsInLocation = async (data) => { + return await request.post({ url: `/eam/spare-parts-in-location-main/approve`,data }) +} diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts index 9e67fa18a..04a464311 100644 --- a/src/locales/en-US.ts +++ b/src/locales/en-US.ts @@ -326,6 +326,7 @@ export default { viewDetail:'Detailed list', updataRecode:'Updata recode', applyDecision:'Apply Decision', + auditing:'Auditing', }, dialog: { dialog: 'Dialog', @@ -993,6 +994,8 @@ export default { '是否接受所选中数据?':'Do you accept the selected data?', '接受成功!':'Accept Successfully!', '是否驳回所选中数据?':'Do you reject the selected data?', + '是否撤回所选中数据?':'Do you revoke the selected data?', + '是否提交审核?':'Do you audit the selected data?', '驳回成功!':'Reject Succussfully!', '要货计划主':'Ask for master data of cargo plan', '要货计划数量不得大于订单数量-已计划数量':'The planned quantity of the requested goods shall not be greater than the order quantity - the planned quantity', @@ -1053,6 +1056,7 @@ export default { 供应商发票申请明细:'Supplier invoice request details', 供应商发票记录主:'Supplier invoice record master data', 审核通过:'Pass the audit', + 撤回成功:'Recall successful', 作废:'Cancellation', '是否审批拒绝所选中数据?':'Do you want to approve and reject selected data?', '审批成功!':'Approval is successful!', diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index d5b769a23..24c79366e 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -325,6 +325,7 @@ export default { viewDetail:'明细列表', updataRecode:'更新记录', applyDecision:'使用决策', + auditing:'审核', }, dialog: { dialog: '弹窗', @@ -993,6 +994,8 @@ export default { '是否接受所选中数据?':'是否接受所选中数据?', '接受成功!':'接受成功!', '是否驳回所选中数据?':'是否驳回所选中数据?', + '是否撤回所选中数据?':'是否撤回所选中数据?', + '是否提交审核?':'是否提交审核?', '驳回成功!':'驳回成功!', '要货计划主':'要货计划主', '要货计划数量不得大于订单数量-已计划数量':'要货计划数量不得大于订单数量-已计划数量', @@ -1053,6 +1056,7 @@ export default { 供应商发票申请明细:'供应商发票申请明细', 供应商发票记录主:'供应商发票记录主', 审核通过:'审核通过', + 撤回成功:'撤回成功', 作废:'作废', '是否审批拒绝所选中数据?':'是否审批拒绝所选中数据?', '审批成功!':'审批成功!', diff --git a/src/views/eam/sparepartsinlocation/index.vue b/src/views/eam/sparepartsinlocation/index.vue index a931b9e36..f7fdcfb65 100644 --- a/src/views/eam/sparepartsinlocation/index.vue +++ b/src/views/eam/sparepartsinlocation/index.vue @@ -78,7 +78,14 @@ :isShowAddBtn="true" :detailButtonIsShowAdd="false" /> - + + + { tableColumns.value = val @@ -223,8 +233,12 @@ const isShowMainButton = (row, val) => { // 列表-操作按钮 const butttondata = (row) => { return [ - defaultButtons.mainListEditBtn({ hasPermi: 'eam:spare-parts-in-location-main:update' }), // 编辑 - defaultButtons.mainListDeleteBtn({ hasPermi: 'eam:spare-parts-in-location-main:delete' }) // 删除 + defaultButtons.mainListEditBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:update' }), // 编辑 + defaultButtons.mainListDeleteBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:delete' }), // 删除 + defaultButtons.mainListAuditingBtn({hide: isShowStatusButton(row, ['0']), hasPermi: 'eam:spare-parts-in-location-main:examine' }), //审核 + defaultButtons.mainListRevokeBtn({hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:spare-parts-in-location-main:cancel'}), // 撤回 + defaultButtons.mainListTurnDownBtn({hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:spare-parts-in-location-main:rejecte' }), //驳回 + defaultButtons.mainListApproveBtn({hide: isShowStatusButton(row, ['3']), hasPermi: 'eam:spare-parts-in-location-main:approve' }), //审批通过 ] } @@ -234,16 +248,35 @@ const buttonTableClick = async (val, row) => { // 编辑 openForm('update', row) } - // else if (val == 'mainOrderClo') { - // // 关闭 - // handleClose(row.id) - // } + else if (val == 'auditing') { + //审核 + handleSubmitExamine(row.id) + } + else if (val == 'mainTurnDown') { + //驳回 + handleRejecte(row.id) + } + else if (val == 'mainApprove') { + //审核通过 + formRefApproved.value.open('update',row,{masterId:row.id},'auditing') + } + else if (val == 'revoke') { // 撤回 + handleCancel(row.id) + } else if (val == 'delete') { // 删除 handleDelete(row.id) } } +const isShowStatusButton = (row,val) => { + if (val.indexOf(row.status) > -1) { + return false + } else { + return true + } +} + /** 添加/修改操作 */ const openForm = async (type: string, row?: number) => { tableData.value = [] // 重置明细数据 @@ -269,35 +302,7 @@ const handleDelete = async (id: number) => { } catch {} } -/** 列表导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 -const handleMainExport = async (id: number) => { - try { - // 导出的二次确认 - await message.exportConfirm() - // 发起导出 - exportLoading.value = true - const data = await SparePartsInLocationMainApi.exportSparePartsInLocationMain(id) - download.excel(data, '盘点工单.xlsx') - } catch { - } finally { - exportLoading.value = false - } -} - -/** 关闭按钮操作 */ -// const handleClose = async (id: number) => { -// try { -// // 关闭的二次确认 -// await message.confirm('是否关闭所选中数据?') -// // 发起关闭 -// await SparePartsApplyMainApi.closeSparePartsApplyMain(id) -// message.success(t('关闭成功!')) -// // 刷新列表 -// await getList() -// } catch {} -// } - /** 导出按钮操作 */ const handleExport = async () => { try { @@ -379,7 +384,52 @@ const searchFormClick = (searchData) => { } getList() // 刷新当前列表 } +// 审核 +const handleSubmitExamine = async (id: number) => { + await message.delConfirm(t('ts.是否提交审核?')); + try { + await SparePartsInLocationMainApi.submitExamineSparePartsInLocation(id) + message.success(t('ts.提交审批成功!')) + // 刷新列表 + await getList() + } catch {} +} +/** 撤回按钮操作 */ +const handleCancel = async (id: number) => { + await message.delConfirm(t('ts.是否撤回所选中数据?')); + try { + await SparePartsInLocationMainApi.cancelSparePartsInLocation(id) + message.success(t('ts.撤回成功')) + // 刷新列表 + await getList() + } catch {} +} +//审核驳回按钮 +const handleRejecte=async(id: number)=> { + await message.delConfirm(t('ts.是否驳回所选中数据?')); + try { + await SparePartsInLocationMainApi.rejectSparePartsInLocation(id) + message.success(t('ts.驳回成功!')) + // 刷新列表 + await getList() + } catch {} +} +// 审核通过 +const approveSparePartsInLocation =async(formType,data)=> { + console.log(data) + try { + // const params = { + // id: + // } + await SparePartsInLocationMainApi.approveSparePartsInLocation(data) + message.success(t('ts.审核通过!')) + // 刷新列表 + await getList() + } catch {} + + +} /** 初始化 **/ onMounted(async () => { getList() diff --git a/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts b/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts index e0f238228..c9cd5edb4 100644 --- a/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts +++ b/src/views/eam/sparepartsinlocation/sparePartsInLocationMain.data.ts @@ -65,12 +65,14 @@ export const SparePartsInLocationMain = useCrudSchemas(reactive([ field: 'approver', sort: 'custom', isSearch: false, + isForm:false }, { label: '审核内容', field: 'approveContent', sort: 'custom', isSearch: false, + isForm:false }, { label: '审核时间', @@ -78,6 +80,7 @@ export const SparePartsInLocationMain = useCrudSchemas(reactive([ sort: 'custom', formatter: dateFormatter, isSearch: false, + isForm:false, search: { component: 'DatePicker', componentProps: { @@ -130,7 +133,7 @@ export const SparePartsInLocationMain = useCrudSchemas(reactive([ field: 'action', isForm: false, table: { - width: 150, + width: 220, fixed: 'right' }, isDetail:false @@ -170,19 +173,19 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive( } }, tableForm: { - isInpuFocusShow: true, - searchListPlaceholder: '请选择备件编号', // 输入框占位文本 - searchField: 'itemNumber', // 查询弹窗赋值字段 - searchTitle: '备件信息', // 查询弹窗标题 - searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 - searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 - searchCondition: [ - { - key: 'available', - value: 'TRUE', - isMainValue: false - } - ] + // isInpuFocusShow: true, + // searchListPlaceholder: '请选择备件编号', // 输入框占位文本 + // searchField: 'itemNumber', // 查询弹窗赋值字段 + // searchTitle: '备件信息', // 查询弹窗标题 + // searchAllSchemas: Location.allSchemas, // 查询弹窗所需类 + // searchPage: LocationApi.getLocationPage, // 查询弹窗所需分页方法 + // searchCondition: [ + // { + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // } + // ] } }, { @@ -196,7 +199,7 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive( } }, tableForm:{ - disabled: true + // disabled: true } }, { @@ -272,4 +275,23 @@ export const SparePartsInLocationDetail = useCrudSchemas(reactive( isTable:false } ])) +export const SparePartsInLocationExamineRules = reactive({ + approver: [required], + approveContent: [required], + sparePartsCode: [required], +}) +// 审核完成字段 +export const SparePartsInLocationExamine = useCrudSchemas(reactive([ + { + label: '审核内容', + field: 'approveContent', + sort: 'custom', + isSearch: false, + form:{ + componentProps:{ + + } + } + }, +]))