diff --git a/src/api/device/checkList.ts b/src/api/device/checkList.ts index f350d40..6afd53a 100644 --- a/src/api/device/checkList.ts +++ b/src/api/device/checkList.ts @@ -107,3 +107,49 @@ data, }) } + +// 设备检修保养验收单保存 +export function addAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/addAcceptanceCheck', + method: 'post', + data, + }) +} + +// 设备检修保养验收单提交 +export function submitAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/submitEquipmentApply', + method: 'post', + data, + }) +} + +// 设备检修保养验收单编辑 +export function updateAcceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/updateAcceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单详情信息 +export function acceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/acceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单审批删除 +export function deleteAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/deleteEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/api/device/checkList.ts b/src/api/device/checkList.ts index f350d40..6afd53a 100644 --- a/src/api/device/checkList.ts +++ b/src/api/device/checkList.ts @@ -107,3 +107,49 @@ data, }) } + +// 设备检修保养验收单保存 +export function addAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/addAcceptanceCheck', + method: 'post', + data, + }) +} + +// 设备检修保养验收单提交 +export function submitAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/submitEquipmentApply', + method: 'post', + data, + }) +} + +// 设备检修保养验收单编辑 +export function updateAcceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/updateAcceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单详情信息 +export function acceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/acceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单审批删除 +export function deleteAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/deleteEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue new file mode 100644 index 0000000..d02cee6 --- /dev/null +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -0,0 +1,218 @@ + + + + + + diff --git a/src/api/device/checkList.ts b/src/api/device/checkList.ts index f350d40..6afd53a 100644 --- a/src/api/device/checkList.ts +++ b/src/api/device/checkList.ts @@ -107,3 +107,49 @@ data, }) } + +// 设备检修保养验收单保存 +export function addAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/addAcceptanceCheck', + method: 'post', + data, + }) +} + +// 设备检修保养验收单提交 +export function submitAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/submitEquipmentApply', + method: 'post', + data, + }) +} + +// 设备检修保养验收单编辑 +export function updateAcceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/updateAcceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单详情信息 +export function acceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/acceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单审批删除 +export function deleteAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/deleteEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue new file mode 100644 index 0000000..d02cee6 --- /dev/null +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -0,0 +1,218 @@ + + + + + + diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 2cfe2e0..859b9b0 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -5,14 +5,14 @@ import type { IOptions } from '../checkList_interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getApprovalDelete, getDeptTree, getListSubmit, getapprovalList } from '@/api/system/plan' -import { getacceptanceCheckList } from '@/api/device/checkList' +import { deleteAcceptanceCheck, getacceptanceCheckList, submitAcceptanceCheck } from '@/api/device/checkList' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { SCHEDULE } from '@/utils/scheduleDict' import { submitApproval } from '@/api/approval' const props = defineProps({ status: { type: String, - default: '0', + default: '', }, buttons: { type: Array as PropType, @@ -144,7 +144,7 @@ type: 'warning', }, ).then(() => { - getApprovalDelete({ id: row.id, taskId: row.taskId }).then((res) => { + deleteAcceptanceCheck({ id: row.id, taskId: row.taskId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -256,7 +256,7 @@ } // 跳转到详情 const goDetail = (row: ISupplier) => { - $router.push(`trainPlanApprove/${props.status}/${row.id}`) + $router.push(`maintenanceCheckList/detail/${row.id}`) } // 获取到组织信息 const getDept = () => { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - getListSubmit({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -311,7 +311,7 @@ approvalSubmit(row) break case '编辑': - $router.push(`/train/edit/${row.id}`) + $router.push(`/maintenance/maintenanceCheckList/edit/${row.id}`) break case '同意': approvalDialog.value.initDialog('agree', row.taskId) @@ -342,7 +342,7 @@ // 打印 const printObj = ref({ id: 'print', // 需要打印元素的id - popTitle: '溯源供方列表', // 打印配置页上方的标题 + popTitle: '设备检修保养验收单', // 打印配置页上方的标题 extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', diff --git a/src/api/device/checkList.ts b/src/api/device/checkList.ts index f350d40..6afd53a 100644 --- a/src/api/device/checkList.ts +++ b/src/api/device/checkList.ts @@ -107,3 +107,49 @@ data, }) } + +// 设备检修保养验收单保存 +export function addAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/addAcceptanceCheck', + method: 'post', + data, + }) +} + +// 设备检修保养验收单提交 +export function submitAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/submitEquipmentApply', + method: 'post', + data, + }) +} + +// 设备检修保养验收单编辑 +export function updateAcceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/updateAcceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单详情信息 +export function acceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/acceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单审批删除 +export function deleteAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/deleteEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue new file mode 100644 index 0000000..d02cee6 --- /dev/null +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -0,0 +1,218 @@ + + + + + + diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 2cfe2e0..859b9b0 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -5,14 +5,14 @@ import type { IOptions } from '../checkList_interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getApprovalDelete, getDeptTree, getListSubmit, getapprovalList } from '@/api/system/plan' -import { getacceptanceCheckList } from '@/api/device/checkList' +import { deleteAcceptanceCheck, getacceptanceCheckList, submitAcceptanceCheck } from '@/api/device/checkList' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { SCHEDULE } from '@/utils/scheduleDict' import { submitApproval } from '@/api/approval' const props = defineProps({ status: { type: String, - default: '0', + default: '', }, buttons: { type: Array as PropType, @@ -144,7 +144,7 @@ type: 'warning', }, ).then(() => { - getApprovalDelete({ id: row.id, taskId: row.taskId }).then((res) => { + deleteAcceptanceCheck({ id: row.id, taskId: row.taskId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -256,7 +256,7 @@ } // 跳转到详情 const goDetail = (row: ISupplier) => { - $router.push(`trainPlanApprove/${props.status}/${row.id}`) + $router.push(`maintenanceCheckList/detail/${row.id}`) } // 获取到组织信息 const getDept = () => { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - getListSubmit({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -311,7 +311,7 @@ approvalSubmit(row) break case '编辑': - $router.push(`/train/edit/${row.id}`) + $router.push(`/maintenance/maintenanceCheckList/edit/${row.id}`) break case '同意': approvalDialog.value.initDialog('agree', row.taskId) @@ -342,7 +342,7 @@ // 打印 const printObj = ref({ id: 'print', // 需要打印元素的id - popTitle: '溯源供方列表', // 打印配置页上方的标题 + popTitle: '设备检修保养验收单', // 打印配置页上方的标题 extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index 9b7323f..de22d15 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -3,11 +3,14 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import type { IOptions } from '../checkList_interface' +import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' import { UploadFile } from '@/api/measure/file' +import { submitApproval } from '@/api/approval' import showPhoto from '@/views/system/tool/showPhoto.vue' +import { SCHEDULE } from '@/utils/scheduleDict' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const buttonArray = ref([]) @@ -27,10 +30,10 @@ buttonArray.value = ['同意', '驳回', '拒绝'] } else if (pageType.value === 'edit') { - buttonArray.value = ['提交'] + buttonArray.value = ['保存', '提交'] } else { - buttonArray.value = ['提交'] + buttonArray.value = ['保存', '提交'] } if ($route.params.id) { infoId.value = $route.params.id as string @@ -45,7 +48,7 @@ applyNo: '', applyPerson: '', applyPersonName: '', - applyType: '', + applyType: '9', applyTypeName: '', applyUnit: '', applyUnitName: '', @@ -186,6 +189,12 @@ updateTime: '', version: '', }) +const checkIdObject = ref({ + applyName: '', + applyPersonName: '', + time: '', + applyNo: '', +}) // 检修设备列表数据 const list = ref([]) // 审批弹窗开关 @@ -240,13 +249,14 @@ required: true, }, ]) -// 标准配套设备更换查询条件 -const listQuery = ref({ - limit: 10, - offset: 1, -}) +const checkListRef = ref() +// 检修申请编号按钮 +const selectPerson = () => { + checkListRef.value.initDialog() +} // 标准配套设备更换表格分页 const changePage = () => {} + // 添加表格数据对象 const addList = ref({}) // 检修结果下拉框 @@ -266,9 +276,9 @@ } const rules = ref({ applyName: [{ required: true, message: '验收单名称不能为空', trigger: 'blur' }], - businessContent: [{ required: true, message: '检修申请编号不能为空', trigger: 'blur' }], - taxNumber: [{ required: true, message: '检修申请名称不能为空', trigger: 'blur' }], - supplierName: [{ required: true, message: '检修保养人不能为空', trigger: 'blur' }], + acceptanceCheckId: [{ required: true, message: '检修申请编号不能为空', trigger: 'blur' }], + overhaulPerson: [{ required: true, message: '检修保养人不能为空', trigger: 'blur' }], + time: [{ required: true, message: '检修时间不能为空', trigger: 'blur' }], }) // 表单验证规则 // 审批流程 const approvalActivities = [ @@ -303,7 +313,7 @@ fd.append('multipartFile', event.target.files[0]) UploadFile(fd).then((res) => { if (res.code === 200) { - formInline.value.minioFileName = res.data[0] + formInline.value.fileList[0].minioFileName = res.data[0] // 重置当前验证 ElMessage.success('文件上传成功') } @@ -337,7 +347,7 @@ } // 获取详情信息 const getInfo = () => { - getStandardListDetail({ id: infoId.value }).then((res) => { + acceptanceCheckInfo({ id: infoId.value }).then((res) => { Object.keys(res.data).map((item) => { if (typeof (res.data[item]) === 'number') { res.data[item] = res.data[item].toString() @@ -364,23 +374,112 @@ return ruleFormRef.value } defineExpose({ submitForm }) - -// 点击顶部一排按钮 -const getAddList = (item: string) => { - if (item === '提交' || item === '保存') { - console.log(item) +// 取消 +const handleCancel = () => { + const params = { + taskId: formInline.value.taskId!, + comments: '', } - else { - if (item === '同意') { - applyList.value.select = '1' - } - else if (item === '驳回') { - applyList.value.select = '2' + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + submitApproval('revoke', params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + }) + }) +} +const approvalDialog = ref() +// 点击数据后的操作按钮 +const clickBtn = (buttonType: string) => { + switch (buttonType) { + case '同意': + approvalDialog.value.initDialog('agree', formInline.value.taskId) + break + case '驳回': + approvalDialog.value.initDialog('reject', formInline.value.taskId) + break + case '拒绝': + approvalDialog.value.initDialog('refuse', formInline.value.taskId) + break + case '取消': + handleCancel() + break + } +} +// 保存后的id +const addId = ref('') +// 点击顶部一排按钮 +const getAddList = async (item: string, formEl: FormInstance | undefined) => { + if (item === '保存' && pageType.value === 'add') { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认保存吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + addAcceptanceCheck(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '保存' && pageType.value === 'edit') { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认保存吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + updateAcceptanceCheckInfo(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') } else { - applyList.value.select = '3' + submitAcceptanceCheck({ id: addId.value, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + if (res.code === 200) { + close() + } + }) } - applyShow.value = true + } + else { + clickBtn(item) } } // 点击增加行 @@ -391,6 +490,11 @@ const handleVisibleClose = () => { dialogVisible.value = false } +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + formInline.value.acceptanceCheckId = object.id + checkIdObject.value = object +} // 标准配套设备更换表格删除行 const removeRow = () => { if (SelectionList.value.length > 0) { @@ -440,7 +544,7 @@ @@ -652,17 +762,4 @@ display: flex; justify-content: space-around; } - -:deep .el-input .el-input--default .el-input--suffix { - width: 200px !important; -} - -.isDetail { - ::v-deep { - .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap > .el-form-item__label::before, - .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label::before { - display: none; - } - } -} diff --git a/src/api/device/checkList.ts b/src/api/device/checkList.ts index f350d40..6afd53a 100644 --- a/src/api/device/checkList.ts +++ b/src/api/device/checkList.ts @@ -107,3 +107,49 @@ data, }) } + +// 设备检修保养验收单保存 +export function addAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/addAcceptanceCheck', + method: 'post', + data, + }) +} + +// 设备检修保养验收单提交 +export function submitAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/submitEquipmentApply', + method: 'post', + data, + }) +} + +// 设备检修保养验收单编辑 +export function updateAcceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/updateAcceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单详情信息 +export function acceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/acceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单审批删除 +export function deleteAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/deleteEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue new file mode 100644 index 0000000..d02cee6 --- /dev/null +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -0,0 +1,218 @@ + + + + + + diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 2cfe2e0..859b9b0 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -5,14 +5,14 @@ import type { IOptions } from '../checkList_interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getApprovalDelete, getDeptTree, getListSubmit, getapprovalList } from '@/api/system/plan' -import { getacceptanceCheckList } from '@/api/device/checkList' +import { deleteAcceptanceCheck, getacceptanceCheckList, submitAcceptanceCheck } from '@/api/device/checkList' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { SCHEDULE } from '@/utils/scheduleDict' import { submitApproval } from '@/api/approval' const props = defineProps({ status: { type: String, - default: '0', + default: '', }, buttons: { type: Array as PropType, @@ -144,7 +144,7 @@ type: 'warning', }, ).then(() => { - getApprovalDelete({ id: row.id, taskId: row.taskId }).then((res) => { + deleteAcceptanceCheck({ id: row.id, taskId: row.taskId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -256,7 +256,7 @@ } // 跳转到详情 const goDetail = (row: ISupplier) => { - $router.push(`trainPlanApprove/${props.status}/${row.id}`) + $router.push(`maintenanceCheckList/detail/${row.id}`) } // 获取到组织信息 const getDept = () => { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - getListSubmit({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -311,7 +311,7 @@ approvalSubmit(row) break case '编辑': - $router.push(`/train/edit/${row.id}`) + $router.push(`/maintenance/maintenanceCheckList/edit/${row.id}`) break case '同意': approvalDialog.value.initDialog('agree', row.taskId) @@ -342,7 +342,7 @@ // 打印 const printObj = ref({ id: 'print', // 需要打印元素的id - popTitle: '溯源供方列表', // 打印配置页上方的标题 + popTitle: '设备检修保养验收单', // 打印配置页上方的标题 extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index 9b7323f..de22d15 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -3,11 +3,14 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import type { IOptions } from '../checkList_interface' +import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' import { UploadFile } from '@/api/measure/file' +import { submitApproval } from '@/api/approval' import showPhoto from '@/views/system/tool/showPhoto.vue' +import { SCHEDULE } from '@/utils/scheduleDict' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const buttonArray = ref([]) @@ -27,10 +30,10 @@ buttonArray.value = ['同意', '驳回', '拒绝'] } else if (pageType.value === 'edit') { - buttonArray.value = ['提交'] + buttonArray.value = ['保存', '提交'] } else { - buttonArray.value = ['提交'] + buttonArray.value = ['保存', '提交'] } if ($route.params.id) { infoId.value = $route.params.id as string @@ -45,7 +48,7 @@ applyNo: '', applyPerson: '', applyPersonName: '', - applyType: '', + applyType: '9', applyTypeName: '', applyUnit: '', applyUnitName: '', @@ -186,6 +189,12 @@ updateTime: '', version: '', }) +const checkIdObject = ref({ + applyName: '', + applyPersonName: '', + time: '', + applyNo: '', +}) // 检修设备列表数据 const list = ref([]) // 审批弹窗开关 @@ -240,13 +249,14 @@ required: true, }, ]) -// 标准配套设备更换查询条件 -const listQuery = ref({ - limit: 10, - offset: 1, -}) +const checkListRef = ref() +// 检修申请编号按钮 +const selectPerson = () => { + checkListRef.value.initDialog() +} // 标准配套设备更换表格分页 const changePage = () => {} + // 添加表格数据对象 const addList = ref({}) // 检修结果下拉框 @@ -266,9 +276,9 @@ } const rules = ref({ applyName: [{ required: true, message: '验收单名称不能为空', trigger: 'blur' }], - businessContent: [{ required: true, message: '检修申请编号不能为空', trigger: 'blur' }], - taxNumber: [{ required: true, message: '检修申请名称不能为空', trigger: 'blur' }], - supplierName: [{ required: true, message: '检修保养人不能为空', trigger: 'blur' }], + acceptanceCheckId: [{ required: true, message: '检修申请编号不能为空', trigger: 'blur' }], + overhaulPerson: [{ required: true, message: '检修保养人不能为空', trigger: 'blur' }], + time: [{ required: true, message: '检修时间不能为空', trigger: 'blur' }], }) // 表单验证规则 // 审批流程 const approvalActivities = [ @@ -303,7 +313,7 @@ fd.append('multipartFile', event.target.files[0]) UploadFile(fd).then((res) => { if (res.code === 200) { - formInline.value.minioFileName = res.data[0] + formInline.value.fileList[0].minioFileName = res.data[0] // 重置当前验证 ElMessage.success('文件上传成功') } @@ -337,7 +347,7 @@ } // 获取详情信息 const getInfo = () => { - getStandardListDetail({ id: infoId.value }).then((res) => { + acceptanceCheckInfo({ id: infoId.value }).then((res) => { Object.keys(res.data).map((item) => { if (typeof (res.data[item]) === 'number') { res.data[item] = res.data[item].toString() @@ -364,23 +374,112 @@ return ruleFormRef.value } defineExpose({ submitForm }) - -// 点击顶部一排按钮 -const getAddList = (item: string) => { - if (item === '提交' || item === '保存') { - console.log(item) +// 取消 +const handleCancel = () => { + const params = { + taskId: formInline.value.taskId!, + comments: '', } - else { - if (item === '同意') { - applyList.value.select = '1' - } - else if (item === '驳回') { - applyList.value.select = '2' + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + submitApproval('revoke', params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + }) + }) +} +const approvalDialog = ref() +// 点击数据后的操作按钮 +const clickBtn = (buttonType: string) => { + switch (buttonType) { + case '同意': + approvalDialog.value.initDialog('agree', formInline.value.taskId) + break + case '驳回': + approvalDialog.value.initDialog('reject', formInline.value.taskId) + break + case '拒绝': + approvalDialog.value.initDialog('refuse', formInline.value.taskId) + break + case '取消': + handleCancel() + break + } +} +// 保存后的id +const addId = ref('') +// 点击顶部一排按钮 +const getAddList = async (item: string, formEl: FormInstance | undefined) => { + if (item === '保存' && pageType.value === 'add') { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认保存吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + addAcceptanceCheck(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '保存' && pageType.value === 'edit') { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认保存吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + updateAcceptanceCheckInfo(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') } else { - applyList.value.select = '3' + submitAcceptanceCheck({ id: addId.value, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + if (res.code === 200) { + close() + } + }) } - applyShow.value = true + } + else { + clickBtn(item) } } // 点击增加行 @@ -391,6 +490,11 @@ const handleVisibleClose = () => { dialogVisible.value = false } +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + formInline.value.acceptanceCheckId = object.id + checkIdObject.value = object +} // 标准配套设备更换表格删除行 const removeRow = () => { if (SelectionList.value.length > 0) { @@ -440,7 +544,7 @@ @@ -652,17 +762,4 @@ display: flex; justify-content: space-around; } - -:deep .el-input .el-input--default .el-input--suffix { - width: 200px !important; -} - -.isDetail { - ::v-deep { - .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap > .el-form-item__label::before, - .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label::before { - display: none; - } - } -} diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 2b3c946..44335a6 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -12,7 +12,7 @@ const props = defineProps({ status: { type: String, - default: '0', + default: '', }, buttons: { type: Array as PropType, diff --git a/src/api/device/checkList.ts b/src/api/device/checkList.ts index f350d40..6afd53a 100644 --- a/src/api/device/checkList.ts +++ b/src/api/device/checkList.ts @@ -107,3 +107,49 @@ data, }) } + +// 设备检修保养验收单保存 +export function addAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/addAcceptanceCheck', + method: 'post', + data, + }) +} + +// 设备检修保养验收单提交 +export function submitAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/submitEquipmentApply', + method: 'post', + data, + }) +} + +// 设备检修保养验收单编辑 +export function updateAcceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/updateAcceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单详情信息 +export function acceptanceCheckInfo(data: object) { + return request({ + url: '/acceptanceCheck/acceptanceCheckInfo', + method: 'post', + data, + }) +} + +// 设备检修保养验收单审批删除 +export function deleteAcceptanceCheck(data: object) { + return request({ + url: '/acceptanceCheck/deleteEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue new file mode 100644 index 0000000..d02cee6 --- /dev/null +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -0,0 +1,218 @@ + + + + + + diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 2cfe2e0..859b9b0 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -5,14 +5,14 @@ import type { IOptions } from '../checkList_interface' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getApprovalDelete, getDeptTree, getListSubmit, getapprovalList } from '@/api/system/plan' -import { getacceptanceCheckList } from '@/api/device/checkList' +import { deleteAcceptanceCheck, getacceptanceCheckList, submitAcceptanceCheck } from '@/api/device/checkList' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { SCHEDULE } from '@/utils/scheduleDict' import { submitApproval } from '@/api/approval' const props = defineProps({ status: { type: String, - default: '0', + default: '', }, buttons: { type: Array as PropType, @@ -144,7 +144,7 @@ type: 'warning', }, ).then(() => { - getApprovalDelete({ id: row.id, taskId: row.taskId }).then((res) => { + deleteAcceptanceCheck({ id: row.id, taskId: row.taskId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -256,7 +256,7 @@ } // 跳转到详情 const goDetail = (row: ISupplier) => { - $router.push(`trainPlanApprove/${props.status}/${row.id}`) + $router.push(`maintenanceCheckList/detail/${row.id}`) } // 获取到组织信息 const getDept = () => { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - getListSubmit({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -311,7 +311,7 @@ approvalSubmit(row) break case '编辑': - $router.push(`/train/edit/${row.id}`) + $router.push(`/maintenance/maintenanceCheckList/edit/${row.id}`) break case '同意': approvalDialog.value.initDialog('agree', row.taskId) @@ -342,7 +342,7 @@ // 打印 const printObj = ref({ id: 'print', // 需要打印元素的id - popTitle: '溯源供方列表', // 打印配置页上方的标题 + popTitle: '设备检修保养验收单', // 打印配置页上方的标题 extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 preview: false, // 是否启动预览模式,默认是false standard: '', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index 9b7323f..de22d15 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -3,11 +3,14 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import type { IOptions } from '../checkList_interface' +import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' import { UploadFile } from '@/api/measure/file' +import { submitApproval } from '@/api/approval' import showPhoto from '@/views/system/tool/showPhoto.vue' +import { SCHEDULE } from '@/utils/scheduleDict' const loading = ref(false) // 表单加载状态 const infoId = ref('') // id const buttonArray = ref([]) @@ -27,10 +30,10 @@ buttonArray.value = ['同意', '驳回', '拒绝'] } else if (pageType.value === 'edit') { - buttonArray.value = ['提交'] + buttonArray.value = ['保存', '提交'] } else { - buttonArray.value = ['提交'] + buttonArray.value = ['保存', '提交'] } if ($route.params.id) { infoId.value = $route.params.id as string @@ -45,7 +48,7 @@ applyNo: '', applyPerson: '', applyPersonName: '', - applyType: '', + applyType: '9', applyTypeName: '', applyUnit: '', applyUnitName: '', @@ -186,6 +189,12 @@ updateTime: '', version: '', }) +const checkIdObject = ref({ + applyName: '', + applyPersonName: '', + time: '', + applyNo: '', +}) // 检修设备列表数据 const list = ref([]) // 审批弹窗开关 @@ -240,13 +249,14 @@ required: true, }, ]) -// 标准配套设备更换查询条件 -const listQuery = ref({ - limit: 10, - offset: 1, -}) +const checkListRef = ref() +// 检修申请编号按钮 +const selectPerson = () => { + checkListRef.value.initDialog() +} // 标准配套设备更换表格分页 const changePage = () => {} + // 添加表格数据对象 const addList = ref({}) // 检修结果下拉框 @@ -266,9 +276,9 @@ } const rules = ref({ applyName: [{ required: true, message: '验收单名称不能为空', trigger: 'blur' }], - businessContent: [{ required: true, message: '检修申请编号不能为空', trigger: 'blur' }], - taxNumber: [{ required: true, message: '检修申请名称不能为空', trigger: 'blur' }], - supplierName: [{ required: true, message: '检修保养人不能为空', trigger: 'blur' }], + acceptanceCheckId: [{ required: true, message: '检修申请编号不能为空', trigger: 'blur' }], + overhaulPerson: [{ required: true, message: '检修保养人不能为空', trigger: 'blur' }], + time: [{ required: true, message: '检修时间不能为空', trigger: 'blur' }], }) // 表单验证规则 // 审批流程 const approvalActivities = [ @@ -303,7 +313,7 @@ fd.append('multipartFile', event.target.files[0]) UploadFile(fd).then((res) => { if (res.code === 200) { - formInline.value.minioFileName = res.data[0] + formInline.value.fileList[0].minioFileName = res.data[0] // 重置当前验证 ElMessage.success('文件上传成功') } @@ -337,7 +347,7 @@ } // 获取详情信息 const getInfo = () => { - getStandardListDetail({ id: infoId.value }).then((res) => { + acceptanceCheckInfo({ id: infoId.value }).then((res) => { Object.keys(res.data).map((item) => { if (typeof (res.data[item]) === 'number') { res.data[item] = res.data[item].toString() @@ -364,23 +374,112 @@ return ruleFormRef.value } defineExpose({ submitForm }) - -// 点击顶部一排按钮 -const getAddList = (item: string) => { - if (item === '提交' || item === '保存') { - console.log(item) +// 取消 +const handleCancel = () => { + const params = { + taskId: formInline.value.taskId!, + comments: '', } - else { - if (item === '同意') { - applyList.value.select = '1' - } - else if (item === '驳回') { - applyList.value.select = '2' + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + submitApproval('revoke', params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + }) + }) +} +const approvalDialog = ref() +// 点击数据后的操作按钮 +const clickBtn = (buttonType: string) => { + switch (buttonType) { + case '同意': + approvalDialog.value.initDialog('agree', formInline.value.taskId) + break + case '驳回': + approvalDialog.value.initDialog('reject', formInline.value.taskId) + break + case '拒绝': + approvalDialog.value.initDialog('refuse', formInline.value.taskId) + break + case '取消': + handleCancel() + break + } +} +// 保存后的id +const addId = ref('') +// 点击顶部一排按钮 +const getAddList = async (item: string, formEl: FormInstance | undefined) => { + if (item === '保存' && pageType.value === 'add') { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认保存吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + addAcceptanceCheck(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '保存' && pageType.value === 'edit') { + if (!formEl) { return } + await formEl.validate((valid, fields) => { + if (valid) { + ElMessageBox.confirm( + '确认保存吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + updateAcceptanceCheckInfo(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') } else { - applyList.value.select = '3' + submitAcceptanceCheck({ id: addId.value, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + if (res.code === 200) { + close() + } + }) } - applyShow.value = true + } + else { + clickBtn(item) } } // 点击增加行 @@ -391,6 +490,11 @@ const handleVisibleClose = () => { dialogVisible.value = false } +// 选择完负责人的函数 +const confirmPerson = (object: object) => { + formInline.value.acceptanceCheckId = object.id + checkIdObject.value = object +} // 标准配套设备更换表格删除行 const removeRow = () => { if (SelectionList.value.length > 0) { @@ -440,7 +544,7 @@ @@ -652,17 +762,4 @@ display: flex; justify-content: space-around; } - -:deep .el-input .el-input--default .el-input--suffix { - width: 200px !important; -} - -.isDetail { - ::v-deep { - .el-form-item.is-required:not(.is-no-asterisk) .el-form-item__label-wrap > .el-form-item__label::before, - .el-form-item.is-required:not(.is-no-asterisk) > .el-form-item__label::before { - display: none; - } - } -} diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 2b3c946..44335a6 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -12,7 +12,7 @@ const props = defineProps({ status: { type: String, - default: '0', + default: '', }, buttons: { type: Array as PropType, diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index 3247669..e22bc4c 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -5,7 +5,7 @@ import type { IOptions } from '../checkList_interface' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { addEquipmentApply, equipmentApplyInfo, updateEquipmentApply } from '@/api/device/checkList' +import { addEquipmentApply, equipmentApplyInfo, submitEquipmentApply, updateEquipmentApply } from '@/api/device/checkList' import { UploadFile } from '@/api/measure/file' import { getDeptTreeList } from '@/api/system/dept' import { toTreeList } from '@/utils/structure' @@ -13,6 +13,7 @@ import type { deptType, selectType } from '@/views/device/standingBook/standingBook-interface' import type { userType } from '@/views/system/user/user-interface' import { submitApproval } from '@/api/approval' +import { SCHEDULE } from '@/utils/scheduleDict' import addRow from '@/views/device/stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const loading = ref(false) // 表单加载状态 @@ -34,10 +35,10 @@ buttonArray.value = ['同意', '驳回', '拒绝'] } else if (pageType.value === 'edit') { - buttonArray.value = ['提交'] + buttonArray.value = ['保存', '提交'] } else { - buttonArray.value = ['提交'] + buttonArray.value = ['保存', '提交'] } if ($route.params.id) { infoId.value = $route.params.id as string @@ -222,7 +223,7 @@ applyName: [{ required: true, message: '申请名称不能为空', trigger: 'blur' }], applyUnit: [{ required: true, message: '申请单位不能为空', trigger: 'blur' }], applyPerson: [{ required: true, message: '申请人不能为空', trigger: 'blur' }], - time: [{ required: true, message: '时间不能为空', trigger: 'blur' }], + time: [{ required: true, message: '检修时间不能为空', trigger: 'blur' }], }) // 表单验证规则 // 获取部门列表 getDeptTreeList().then((res) => { @@ -300,33 +301,68 @@ if (pageType.value !== 'add') { getInfo() } - +// 保存后的id +const addId = ref('') // 点击顶部一排按钮 const getAddList = async (item: string, formEl: FormInstance | undefined) => { - if (item === '提交' && pageType.value === 'add') { + if (item === '保存' && pageType.value === 'add') { if (!formEl) { return } await formEl.validate((valid, fields) => { if (valid) { - addEquipmentApply(formInline.value).then((res) => { - if (res.code === 200) { - close() - } + ElMessageBox.confirm( + '确认保存吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + addEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) }) } }) } - else if (item === '提交' && pageType.value === 'edit') { + else if (item === '保存' && pageType.value === 'edit') { if (!formEl) { return } await formEl.validate((valid, fields) => { if (valid) { - updateEquipmentApply(formInline.value).then((res) => { - if (res.code === 200) { - close() - } + ElMessageBox.confirm( + '确认保存吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + updateEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) }) } }) } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitEquipmentApply({ id: addId.value, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } else { clickBtn(item) } @@ -352,7 +388,7 @@ }, ).then(() => { // 删除行 - formInline.value.equipmentList = formInline.value.equipmentList.filter((item) => { + formInline.value.equipmentInfoList = formInline.value.equipmentInfoList.filter((item) => { return !SelectionList.value.includes(item) }) ElMessage.success('删除成功') @@ -366,15 +402,17 @@ const handleSelectionChange = (e: any) => { SelectionList.value = e } +// 设备列表对象类型 +interface returnRowType { + id: string +} // 设备列表添加 const addRowMethods = (row: Array) => { + row.forEach((item: returnRowType, index: string) => { + formInline.value.equipmentList.push({ equipmentId: item.id }) + }) // 设备状态 - if (row.length > 1) { - ElMessage.warning('只能选择一个设备') - } - else { - formInline.value.equipmentList.push(row[0]) - } + formInline.value.equipmentInfoList.push(...row) } // 审批弹窗的关闭 const applyListClose = () => { @@ -398,7 +436,12 @@