diff --git a/src/api/eam/equipmentRepairJobMain/index.ts b/src/api/eam/equipmentRepairJobMain/index.ts index 0d83bcb3e..0d19f793a 100644 --- a/src/api/eam/equipmentRepairJobMain/index.ts +++ b/src/api/eam/equipmentRepairJobMain/index.ts @@ -14,9 +14,12 @@ export interface EquipmentRepairJobMainVO { startTime: Date endTime: Date totalMinutes: number - verifyer: number - verifyContent: string - verifyTime: Date + verifyerRepair: number + verifyContentRepair: string + verifyTimeRepair: Date + verifyerReport: number + verifyContentReport: string + verifyTimeReport: Date maintenancer: number maintenancePhone: string completeResult: string @@ -100,3 +103,9 @@ export const importTemplate = () => { export const updateEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => { return await request.post({ url: `/eam/equipment-repair-job-main/updateOrder`, data }) } + +//验证不通过,打回维修工单 +export const backEquipmentRepairOrder = async (data: EquipmentRepairJobMainVO) => { + return await request.post({ url: `/eam/equipment-repair-job-main/fallback`, data }) +} + diff --git a/src/hooks/web/useMessage.ts b/src/hooks/web/useMessage.ts index 8bd660bcb..1de182273 100644 --- a/src/hooks/web/useMessage.ts +++ b/src/hooks/web/useMessage.ts @@ -62,9 +62,10 @@ export const useMessage = () => { // 验证窗体 confirmPassword(content: string, tip?: string) { return ElMessageBox.confirm(content, tip ? tip : t('common.confirmTitle'), { + distinguishCancelAndClose: true, confirmButtonText: t('验证通过'), cancelButtonText: t('验证不通过'), - type: 'warning' + type: 'warning', }) }, // 审核窗体 diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 25cb20558..e56253106 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -415,6 +415,32 @@ export function mainListValidateBtn(option:any) { }) } +// 主列表-报修验证按钮 +export function mainListValidateReportBtn(option:any) { + return __defaultBtnOption(option,{ + label: t(`ts.报修验证`).replace('ts.', ''), + name: 'validate_report', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + +// 主列表-维修验证按钮 +export function mainListValidateRepairBtn(option:any) { + return __defaultBtnOption(option,{ + label: t(`ts.维修验证`).replace('ts.', ''), + name: 'validate_repair', + hide: false, + type: 'primary', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + // 主列表-审核按钮 export function mainListAuditingBtn(option:any) { return __defaultBtnOption(option,{ diff --git a/src/views/eam/equipmentMaintenanceMain/finishForm1.vue b/src/views/eam/equipmentMaintenanceMain/finishForm1.vue index c50b366ad..34f04c3ce 100644 --- a/src/views/eam/equipmentMaintenanceMain/finishForm1.vue +++ b/src/views/eam/equipmentMaintenanceMain/finishForm1.vue @@ -169,8 +169,7 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗 /** 提交表单 */ const submitForm = async (val) => { - //把success函数传递到父页面 - emit('success',formData.value.id) + // 校验表单 if (!basicFormRef) return const valid = await basicFormRef.value.validate() @@ -178,6 +177,8 @@ const submitForm = async (val) => { //发送数据 await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value) + //把success函数传递到父页面 + emit('success',formData.value.id) dialogVisible.value = false } diff --git a/src/views/eam/equipmentMaintenanceMain/index.vue b/src/views/eam/equipmentMaintenanceMain/index.vue index d9f106904..a9dd788f7 100644 --- a/src/views/eam/equipmentMaintenanceMain/index.vue +++ b/src/views/eam/equipmentMaintenanceMain/index.vue @@ -363,14 +363,16 @@ const handleValidate = async (row) => { // 二次确认 //打开提交表单 finishForm1Ref.value.open('update', row); - }).catch (async () => { - const params = ref({id: '', status:''}) - params.value.id = row.id - params.value.status = '5' - await EquipmentMaintenanceMainApi.backMaintenanceOrder(params.value) - message.success(t('工单已打回')) - // 刷新列表 - await getList() + }).catch (async (action: Action) => { + if(action === 'cancel'){ + const params = ref({id: '', status:''}) + params.value.id = row.id + params.value.status = '5' + await EquipmentMaintenanceMainApi.backMaintenanceOrder(params.value) + message.success(t('工单已打回')) + // 刷新列表 + await getList() + } }) } diff --git a/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts b/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts index f516ddd2a..14f3d3a3a 100644 --- a/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts +++ b/src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts @@ -166,20 +166,54 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive([ isSearch: false, }, { - label: '验证人', - field: 'verifyer', + label: '维修验证人', + field: 'verifyerRepair', sort: 'custom', isSearch: false, }, { - label: '验证内容', - field: 'verifyContent', + label: '维修验证内容', + field: 'verifyContentRepair', sort: 'custom', isSearch: false, }, { - label: '验证时间', - field: 'verifyTime', + label: '维修验证时间', + field: 'verifyTimeRepair', + sort: 'custom', + formatter: dateFormatter, + isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + }, + { + label: '报修验证人', + field: 'verifyerReport', + sort: 'custom', + isSearch: false, + }, + { + label: '报修验证内容', + field: 'verifyContentReport', + sort: 'custom', + isSearch: false, + }, + { + label: '报修验证时间', + field: 'verifyTimeReport', sort: 'custom', formatter: dateFormatter, isSearch: false, diff --git a/src/views/eam/equipmentRepairJobMain/finishForm1.vue b/src/views/eam/equipmentRepairJobMain/finishForm1.vue new file mode 100644 index 000000000..6fe664349 --- /dev/null +++ b/src/views/eam/equipmentRepairJobMain/finishForm1.vue @@ -0,0 +1,211 @@ + + + + diff --git a/src/views/eam/equipmentRepairJobMain/finishForm3.vue b/src/views/eam/equipmentRepairJobMain/finishForm3.vue new file mode 100644 index 000000000..41dbd233c --- /dev/null +++ b/src/views/eam/equipmentRepairJobMain/finishForm3.vue @@ -0,0 +1,209 @@ + + + + diff --git a/src/views/eam/equipmentRepairJobMain/index.vue b/src/views/eam/equipmentRepairJobMain/index.vue index d341b418a..4360f477d 100644 --- a/src/views/eam/equipmentRepairJobMain/index.vue +++ b/src/views/eam/equipmentRepairJobMain/index.vue @@ -50,7 +50,9 @@ :isBusiness="false" /> + + { defaultButtons.mainListReceiveOrderBtn({hide: isShowStatusButton(row,['3']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 接单 defaultButtons.mainListExecuteBtn({hide: isShowStatusButton(row,['4']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 执行 defaultButtons.mainListFinishBtn({hide: isShowStatusButton(row,['5']),hasPermi:'eam:equipmentRepairJobMain:update'}), //完成 + defaultButtons.mainListValidateRepairBtn({hide: isShowStatusButton(row,['6']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 维修验证 + defaultButtons.mainListValidateReportBtn({hide: isShowStatusButton(row,['7']),hasPermi:'eam:equipmentRepairJobMain:update'}), // 报修验证 ] } @@ -182,6 +188,10 @@ const buttonTableClick = async (val, row) => { handleExecute(row.id) } else if (val == 'finish') { // 完成 handleFinish(row) + } else if (val == 'validate_repair') { // 维修验证 + handleValidateRepair(row) + } else if (val == 'validate_report') { // 报修验证 + handleValidateReport(row) } @@ -251,6 +261,52 @@ const searchTableSuccessDetail = (formField, searchField, val, formRef ) => { }) } + +/** 报修验证按钮操作 */ +const finishForm3Ref = ref() +const handleValidateReport = async (row) => { + await message.delConfirm('是否验证所选中工单?'); + message.confirmPassword(t('')).then(async () => { + // 二次确认 + //打开提交表单 + finishForm3Ref.value.open('update', row); + }).catch (async (action: Action) => { + if(action === 'cancel'){ + const params = ref({id: '', status:''}) + params.value.id = row.id + params.value.status = '5' + //生成新工单 + await EquipmentRepairJobMainApi.backEquipmentRepairOrder(params.value) + message.success(t('工单已打回')) + // 刷新列表 + await getList() + } + }) + +} + +/** 维修验证按钮操作 */ +const finishForm1Ref = ref() +const handleValidateRepair = async (row) => { + await message.delConfirm('是否验证所选中工单?'); + message.confirmPassword(t('')).then(async () => { + // 二次确认 + //打开提交表单 + finishForm1Ref.value.open('update', row); + }).catch (async (action: Action) => { + if(action === 'cancel'){ + const params = ref({id: '', status:''}) + params.value.id = row.id + params.value.status = '5' + await EquipmentRepairJobMainApi.backEquipmentRepairOrder(params.value) + message.success(t('工单已打回')) + // 刷新列表 + await getList() + } + }) + +} + /** 完成按钮操作 */ const finishForm2Ref = ref() const handleFinish = async (row) => { @@ -313,6 +369,36 @@ const handleDelete = async (id: number) => { } +//finishForm1 关闭按钮回传 +const getClosed1=(val)=> { + nextTick?.(() => { + console.log(val) + getList() + }) +} + +//finishForm1 提交按钮回传 +const getData1=(val)=> { + nextTick?.(async () => { + console.log(val) + try { + const params = ref({ + id: '', + status:'', + }) + params.value.id = val + params.value.status = '7' + await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value) + message.success(t('工单已流转')) + // 刷新列表 + await getList() + } catch {} + + } + ) +} + + //finishForm2 关闭按钮回传 const getClosed2=(val)=> { @@ -338,6 +424,37 @@ const getData2=(val)=> { }) } + + +//finishForm3 关闭按钮回传 +const getClosed3=(val)=> { + nextTick?.(() => { + console.log(val) + getList() + }) +} + +//finishForm3 提交按钮回传 +const getData3=(val)=> { + nextTick?.(async () => { + console.log(val) + try { + const params = ref({ + id: '', + status:'', + }) + params.value.id = val + params.value.status = '7' + await EquipmentRepairJobMainApi.updateEquipmentRepairOrder(params.value) + message.success(t('工单已流转')) + // 刷新列表 + await getList() + } catch {} + + } + ) +} + /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 const handleExport = async () => { diff --git a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts index 642c6ac15..e56c65428 100644 --- a/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts +++ b/src/views/wms/supplierManage/supplierinvoice/supplierinvoiceRequestMain/supplierinvoiceRequestMain.data.ts @@ -28,7 +28,7 @@ const requestsettingData = data?.list[0] || {} userDept.id = userDept.id.toString() const userDeptArray:any = [userDept] - const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'purchase',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' }) + const procurementCreators = await SupplierinvoiceRequestMainApi.queryUserInfoByRoleCode({ roleCode: 'procurement_role',pageSize: 1000,pageNo: 1,sort: '',by: 'ASC' }) /** * @returns {Array} 采购员列表 */