diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/views/business/bench/bench.vue b/src/views/business/bench/bench.vue index 64a6818..1f5af41 100644 --- a/src/views/business/bench/bench.vue +++ b/src/views/business/bench/bench.vue @@ -1,13 +1,528 @@ - + + diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/views/business/bench/bench.vue b/src/views/business/bench/bench.vue index 64a6818..1f5af41 100644 --- a/src/views/business/bench/bench.vue +++ b/src/views/business/bench/bench.vue @@ -1,13 +1,528 @@ - + + diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b1d51bf..5be4fa1 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -7,7 +7,7 @@ limit: number } export interface ISupplier { - checkDate: null | string + checkDate: string checkName: string checkNo: string checkPerson: string diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/views/business/bench/bench.vue b/src/views/business/bench/bench.vue index 64a6818..1f5af41 100644 --- a/src/views/business/bench/bench.vue +++ b/src/views/business/bench/bench.vue @@ -1,13 +1,528 @@ - + + diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b1d51bf..5be4fa1 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -7,7 +7,7 @@ limit: number } export interface ISupplier { - checkDate: null | string + checkDate: string checkName: string checkNo: string checkPerson: string diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue index d02cee6..0046fa3 100644 --- a/src/views/device/deviceMaintenance/components/checkList.vue +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -192,11 +192,6 @@ - diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/views/business/bench/bench.vue b/src/views/business/bench/bench.vue index 64a6818..1f5af41 100644 --- a/src/views/business/bench/bench.vue +++ b/src/views/business/bench/bench.vue @@ -1,13 +1,528 @@ - + + diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b1d51bf..5be4fa1 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -7,7 +7,7 @@ limit: number } export interface ISupplier { - checkDate: null | string + checkDate: string checkName: string checkNo: string checkPerson: string diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue index d02cee6..0046fa3 100644 --- a/src/views/device/deviceMaintenance/components/checkList.vue +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -192,11 +192,6 @@ - diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/views/business/bench/bench.vue b/src/views/business/bench/bench.vue index 64a6818..1f5af41 100644 --- a/src/views/business/bench/bench.vue +++ b/src/views/business/bench/bench.vue @@ -1,13 +1,528 @@ - + + diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b1d51bf..5be4fa1 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -7,7 +7,7 @@ limit: number } export interface ISupplier { - checkDate: null | string + checkDate: string checkName: string checkNo: string checkPerson: string diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue index d02cee6..0046fa3 100644 --- a/src/views/device/deviceMaintenance/components/checkList.vue +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -192,11 +192,6 @@ - diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/views/business/bench/bench.vue b/src/views/business/bench/bench.vue index 64a6818..1f5af41 100644 --- a/src/views/business/bench/bench.vue +++ b/src/views/business/bench/bench.vue @@ -1,13 +1,528 @@ - + + diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b1d51bf..5be4fa1 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -7,7 +7,7 @@ limit: number } export interface ISupplier { - checkDate: null | string + checkDate: string checkName: string checkNo: string checkPerson: string diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue index d02cee6..0046fa3 100644 --- a/src/views/device/deviceMaintenance/components/checkList.vue +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -192,11 +192,6 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/views/business/bench/bench.vue b/src/views/business/bench/bench.vue index 64a6818..1f5af41 100644 --- a/src/views/business/bench/bench.vue +++ b/src/views/business/bench/bench.vue @@ -1,13 +1,528 @@ - + + diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b1d51bf..5be4fa1 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -7,7 +7,7 @@ limit: number } export interface ISupplier { - checkDate: null | string + checkDate: string checkName: string checkNo: string checkPerson: string diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue index d02cee6..0046fa3 100644 --- a/src/views/device/deviceMaintenance/components/checkList.vue +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -192,11 +192,6 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/views/business/bench/bench.vue b/src/views/business/bench/bench.vue index 64a6818..1f5af41 100644 --- a/src/views/business/bench/bench.vue +++ b/src/views/business/bench/bench.vue @@ -1,13 +1,528 @@ - + + diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b1d51bf..5be4fa1 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -7,7 +7,7 @@ limit: number } export interface ISupplier { - checkDate: null | string + checkDate: string checkName: string checkNo: string checkPerson: string diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue index d02cee6..0046fa3 100644 --- a/src/views/device/deviceMaintenance/components/checkList.vue +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -192,11 +192,6 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index a5d557a..6e6fdfa 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -118,3 +118,12 @@ }) } +// 申请编辑 +export function updateStandardEquipmentApply(data: object) { + return request({ + url: '/standard/updateStandardEquipmentApply', + method: 'post', + data, + }) +} + diff --git a/src/assets/images/bench/1671087276259.jpg b/src/assets/images/bench/1671087276259.jpg deleted file mode 100644 index 34b76f5..0000000 --- a/src/assets/images/bench/1671087276259.jpg +++ /dev/null Binary files differ diff --git a/src/assets/images/bench/sampie-status.png b/src/assets/images/bench/sampie-status.png new file mode 100644 index 0000000..ff9eb2d --- /dev/null +++ b/src/assets/images/bench/sampie-status.png Binary files differ diff --git a/src/views/business/bench/bench.vue b/src/views/business/bench/bench.vue index 64a6818..1f5af41 100644 --- a/src/views/business/bench/bench.vue +++ b/src/views/business/bench/bench.vue @@ -1,13 +1,528 @@ - + + diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index b1d51bf..5be4fa1 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -7,7 +7,7 @@ limit: number } export interface ISupplier { - checkDate: null | string + checkDate: string checkName: string checkNo: string checkPerson: string diff --git a/src/views/device/deviceMaintenance/components/checkList.vue b/src/views/device/deviceMaintenance/components/checkList.vue index d02cee6..0046fa3 100644 --- a/src/views/device/deviceMaintenance/components/checkList.vue +++ b/src/views/device/deviceMaintenance/components/checkList.vue @@ -192,11 +192,6 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@ -
diff --git a/src/views/device/deviceMaintenance/components/listApproval.vue b/src/views/device/deviceMaintenance/components/listApproval.vue index 859b9b0..7bfd090 100644 --- a/src/views/device/deviceMaintenance/components/listApproval.vue +++ b/src/views/device/deviceMaintenance/components/listApproval.vue @@ -160,7 +160,7 @@ const handleCancel = (row: ISupplier) => { const params = { taskId: row.taskId!, - comments: '', + comments: '取消', } ElMessageBox.confirm( '确认取消该审批吗?', @@ -192,7 +192,7 @@ console.log('cancel!') } // 装载时间数组 -const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) +const checkTimeArr = ref([listQuery.value.checkStartDate, listQuery.value.checkEndDate]) // 点击重置 const clearList = () => { listQuery.value = { @@ -277,7 +277,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.TRAIN_APPROVAL }).then((res) => { + submitAcceptanceCheck({ id: row.id, formId: SCHEDULE.DEVICE_FIX_ACCEPTANCE }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', diff --git a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue index de22d15..a8e1295 100644 --- a/src/views/device/deviceMaintenance/components/listApprovalAdd.vue +++ b/src/views/device/deviceMaintenance/components/listApprovalAdd.vue @@ -6,7 +6,7 @@ import checkList from './checkList.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { acceptanceCheckInfo, addAcceptanceCheck, submitAcceptanceCheck, updateAcceptanceCheckInfo } from '@/api/device/checkList' +import { acceptanceCheckInfo, addAcceptanceCheck, equipmentApplyInfo, 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' @@ -56,130 +56,23 @@ approvalStatusName: '', createTime: '', createUser: '', - equipmentInfoList: [ - { - abc: '', - abcName: '', - assetNo: '', - assetSource: '', - assetType: '', - assetTypeName: '', - attribute: '', - capitalSource: '', - capitalSourceName: '', - cardEstablishmentDate: '', - createTime: '', - createUser: 0, - depreciationMethod: '', - depreciationMethodName: '', - depreciationPeriod: 0, - enableDate: '', - equipmentCategory: '', - equipmentCategoryName: '', - equipmentName: '', - equipmentNo: '', - equipmentSpecifications: '', - equipmentType: '', - equipmentTypeName: '', - fileList: [ - { - assetId: 0, - createTime: '', - createUser: 0, - fileName: '', - id: 0, - isDel: 0, - minioFileName: '', - remark: '', - updateTime: '', - }, - ], - id: 0, - installIncidentalExpenses: '', - installPlace: '', - intactState: '', - isCalibrationTestEquipment: 0, - isDel: 0, - isFixedAssets: 0, - isMeasureAccount: 0, - isStandardSupportEquipment: 0, - labelBind: '', - majorCategory: '', - majorCategoryName: '', - managerLevel: '', - managerLevelName: '', - managerState: '', - managerStateName: '', - manufacturer: '', - manufacturerCountry: '', - manufacturingDate: '', - manufacturingNo: '', - mesureCycle: 0, - mesureDate: '', - mesureDept: 0, - mesureRange: '', - mesureResult: '', - mesureResultName: '', - mesureType: '', - mesureTypeName: '', - modelNo: '', - originValue: 0, - overallDimension: '', - presentOriginValue: 0, - purpose: '', - remark: '', - singlePrice: 0, - supportStandardEquipmentName: '', - supportStandardEquipmentNo: '', - technicalLevel: '', - uncertainty: '', - updateTime: '', - useDept: 0, - useDeptName: '', - usePerson: 0, - usePersonName: '', - validDate: '', - version: 0, - weight: 0, - }, - ], - equipmentList: [ - { - applyId: '', - assetOriginValue: 0, - createTime: '', - createUser: '', - equipmentId: '', - equipmentName: '', - equipmentNo: '', - financialValue: 0, - id: 0, - isDel: 0, - measureRange: '', - overhaulIdea: '', - overhaulResult: '', - overhaulResultName: '', - remark: '', - updateTime: '', - useDept: '', - usePerson: '', - }, - ], + equipmentInfoList: [], + equipmentList: [], fileList: [ { - applyId: 0, + applyId: '', createTime: '', - createUser: 0, + createUser: '', fileName: '', - id: 0, - isDel: 0, + id: '', + isDel: '', minioFileName: '', remark: '', updateTime: '', }, ], - id: 0, - isDel: 0, + id: '', + isDel: '', overhaulPerson: '', processId: '', processResult: '', @@ -189,7 +82,15 @@ updateTime: '', version: '', }) -const checkIdObject = ref({ +// 审批弹窗信息收集类型 +interface checkIdObjectType { + applyName: string + applyPersonName: string + time: string + applyNo: string +} +// 获取到检修申请列表数据 +const checkIdObject = ref({ applyName: '', applyPersonName: '', time: '', @@ -225,25 +126,25 @@ const columns = ref([ { text: '设备名称', - value: 'name', + value: 'equipmentName', align: 'center', - required: true, + required: false, }, { text: '设备编号', - value: 'bianhao', + value: 'equipmentNo', align: 'center', - required: true, + required: false, }, { text: '检修结果', - value: 'xinghao', + value: 'overhaulResult', align: 'center', required: true, }, { text: '检修意见', - value: 'xinghao', + value: 'overhaulIdea', width: '450px', align: 'center', required: true, @@ -482,45 +383,34 @@ clickBtn(item) } } -// 点击增加行 -const addRoow = () => { - list.value.push(JSON.parse(JSON.stringify(addList.value))) -} -// 点击关闭 -const handleVisibleClose = () => { - dialogVisible.value = false + +// 标准实验室发生改变row类型 +interface objectReturn { + id: string + applyName: string + applyPersonName: string + time: string + applyNo: string + equipmentId: string } // 选择完负责人的函数 -const confirmPerson = (object: object) => { +const confirmPerson = (object: objectReturn) => { formInline.value.acceptanceCheckId = object.id checkIdObject.value = object -} -// 标准配套设备更换表格删除行 -const removeRow = () => { - if (SelectionList.value.length > 0) { - ElMessageBox.confirm( - '确认删除选中的数据吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then(() => { - // 删除行 - list.value = list.value.filter((item) => { - return !SelectionList.value.includes(item) - }) - ElMessage.success('删除成功') + // 获取到详情 + equipmentApplyInfo({ id: object.id }).then((res) => { + res.data.equipmentInfoList.map((item: objectReturn) => { + if (item.id) { + item.equipmentId = item.id + item.id = '' + } + // 如果选择的没有id则就让装置数组置空 + else { + return formInline.value.equipmentList = [] + } }) - } - else { - ElMessage.warning('请先选择需要删除的数据') - } -} -// 表格多选框 -const handleSelectionChange = (e: any) => { - SelectionList.value = e + formInline.value.equipmentList = res.data.equipmentInfoList + }) } // 审批弹窗的关闭 const applyListClose = () => { @@ -661,47 +551,37 @@ - + + + + + + + - - - - - - - -
diff --git a/src/views/device/deviceMaintenance/components/listPageAdd.vue b/src/views/device/deviceMaintenance/components/listPageAdd.vue index e22bc4c..a3129d4 100644 --- a/src/views/device/deviceMaintenance/components/listPageAdd.vue +++ b/src/views/device/deviceMaintenance/components/listPageAdd.vue @@ -544,45 +544,46 @@ 删除行 - - - - - - - - - + + + + + + + +
diff --git a/src/views/device/deviceMaintenance/components/manageAdd.vue b/src/views/device/deviceMaintenance/components/manageAdd.vue index 9f8f98b..1efebea 100644 --- a/src/views/device/deviceMaintenance/components/manageAdd.vue +++ b/src/views/device/deviceMaintenance/components/manageAdd.vue @@ -33,7 +33,7 @@ } } const formInline: Ref = ref({ - checkDate: null, + checkDate: '', checkName: '', checkNo: '', checkPerson: '', @@ -290,7 +290,7 @@ - + {{ formInline.fileList[0].minioFileName === '' ? '上传' : '更换附件' }} diff --git a/src/views/device/standardEquipment/components/listApply/listPage.vue b/src/views/device/standardEquipment/components/listApply/listPage.vue index d4f8601..275ed66 100644 --- a/src/views/device/standardEquipment/components/listApply/listPage.vue +++ b/src/views/device/standardEquipment/components/listApply/listPage.vue @@ -139,8 +139,8 @@ // 点击按钮 const buttonType = ref('') const loadingTable = ref(false) -// 获取部门信息 -getUsersDept({ +// 获取部门信息参数 +const DeptParams = ref({ createEndTime: '', createstartTime: '', director: '', @@ -151,7 +151,9 @@ pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(DeptParams.value).then((res) => { standardUsersDeptList.value = res.data.rows }) const fetchData = (isNowPage: boolean) => { @@ -210,6 +212,7 @@ params: { type: 'detail', id: row.id, + formId: props.schedule, }, }) } @@ -271,6 +274,7 @@ params: { type: 'edit', id: row.id, + formId: props.schedule, }, }) break @@ -399,6 +403,7 @@ title: '新建', name: props.name, applyType: props.applyType, + formId: props.schedule, }, }) } diff --git a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue index 6d85903..e022442 100644 --- a/src/views/device/standardEquipment/components/listApply/listPageAdd.vue +++ b/src/views/device/standardEquipment/components/listApply/listPageAdd.vue @@ -3,12 +3,11 @@ import { ElMessage, ElMessageBox } from 'element-plus' import type { FormInstance, UploadProps, UploadUserFile } from 'element-plus' import { conditionalExpression } from '@babel/types' -import type { IOptions } from '../standard_interface' import UserListDialog from '../../../stateManage/components/addRow.vue' import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import { getStaffList } from '@/api/measure/person' import { getTypeSelect } from '@/api/system/price' -import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept } from '@/api/device/standard' +import { getStandardLisAdd, getStandardList, getStandardListDetail, getUsersDept, submitStandardEquipmentApply, updateStandardEquipmentApply } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' import useUserStore from '@/store/modules/user' import { submitApproval } from '@/api/approval' @@ -24,9 +23,11 @@ } // 字典 // 从路由中获取页面类型参数 const $route = useRoute() +const formId = ref('') const { username } = useUserStore() if ($route.params && $route.params.type) { pageType.value = $route.params.type as string + formId.value = $route.params.formId as string if (pageType.value === 'add') { buttonArray.value = ['提交', '保存'] } @@ -45,7 +46,7 @@ const formInline = ref({ assessDate: '', assessmentUnit: '', - category: null, + category: '', categoryName: '', constructionStandardProject: '', constructionStandardUnitName: '', @@ -54,12 +55,12 @@ createUser: null, id: '', isDel: null, - laboratoryOwner: null, - laboratoryOwnerContact: null, - laboratoryOwnerName: null, - managerState: null, + laboratoryOwner: '', + laboratoryOwnerContact: '', + laboratoryOwnerName: '', + managerState: '', managerStateName: '', - measureMajor: null, + measureMajor: '', fileList: [], measureMajorName: '', mesureRange: '', @@ -68,17 +69,17 @@ projectNo: '', remark: '', standardHumidity: null, - standardLaboratory: null, + standardLaboratory: '', standardLaboratoryName: '', - standardLevel: null, + standardLevel: '', standardLevelName: '', standardName: '', standardNo: '', - standardOwner: null, + standardOwner: '', standardOwnerName: '', standardTemperature: null, totalInvestment: null, - transmitRange: null, + transmitRange: '', transmitRangeName: '', uncertainty: '', updateTime: null, @@ -109,7 +110,14 @@ version: null, taskId: '', }) - +// 下拉框数组类型 +interface IOptions { + id: string + name: string + value: string + organizeName: string + deptId: string +} const checkTypeOptions = ref([]) const standardOwnerOptions = ref([]) // 标准负责人 const fileList = ref([]) // 文件对象数组 @@ -145,19 +153,20 @@ getSelectList('transmitRange') // 获取传递范围下拉框 getSelectList('standardCategory') // 获取类别下拉框 const approvalDialog = ref() -// 获取部门信息 -getUsersDept({ - createEndTime: '', - createstartTime: '', +const params = ref({ director: '', meterMajor: '', + createEndTime: '', + createstartTime: '', organizeName: '', organizeNo: '', organizeType: '2', pdeptId: null, offset: 1, limit: 999999, -}).then((res) => { +}) +// 获取部门信息 +getUsersDept(params.value).then((res) => { standardUsersDeptList.value = res.data.rows }) // 获取到标准负责人数组 @@ -324,8 +333,13 @@ const addList = ref({}) // 添加表格弹窗开关 const dialogVisible = ref(false) +// 选择标准装置数据列表下拉框类型 +interface standardListType { + id: string + standardName: string +} // 选择标准装置数据列表下拉框 -const standardList = ref([]) +const standardList = ref([]) // 初始化路由 const $router = useRouter() // 关闭 @@ -375,7 +389,7 @@ } fetchData() // 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { +const uploadQuarterlyEvaluateFile = (file: any) => { const fd = new FormData() fd.append('multipartFile', file.file) UploadFile(fd).then((res) => { @@ -443,16 +457,19 @@ interface rowReturn { phone: string director: string + deptId: string + organizeName: string + id: string } // 标准实验室发生改变 -const changeDeptList = (row: object) => { +const changeDeptList = (row: rowReturn) => { formInline.value.laboratoryOwnerContact = row.phone formInline.value.laboratoryOwner = row.director } // 标准实验室清空时 const clearDeptList = () => { - formInline.value.laboratoryOwnerContact = null - formInline.value.laboratoryOwner = null + formInline.value.laboratoryOwnerContact = '' + formInline.value.laboratoryOwner = '' } // 获取详情信息 const getInfo = (id: string | number) => { @@ -469,12 +486,6 @@ getInfo(infoId.value) } -// 提交 -const submitForm = () => { - return ruleFormRef.value -} -defineExpose({ submitForm }) - // 取消 const handleCancel = () => { const params = { @@ -500,15 +511,8 @@ }) } // 点击数据后的操作按钮 -const getAddList = (buttonType: string) => { +const clickBtn = (buttonType: string) => { switch (buttonType) { - case '提交': - getStandardLisAdd(fromListInfo.value).then((res) => { - if (res.code === '200') { - close() - } - }) - break case '同意': approvalDialog.value.initDialog('agree', fromListInfo.value.taskId) break @@ -523,6 +527,72 @@ 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(() => { + getStandardLisAdd(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(() => { + updateStandardEquipmentApply(formInline.value).then((res) => { + if (res.code === 200) { + ElMessage.success('保存成功') + addId.value = res.data.id + } + }) + }) + } + }) + } + else if (item === '提交') { + if (addId.value === '') { + ElMessage.warning('请先保存') + } + else { + submitStandardEquipmentApply({ id: addId.value, formId: formId.value }).then((res) => { + if (res.code === 200) { + close() + } + }) + } + } + else { + clickBtn(item) + } +} const approvalActivities = [ { @@ -615,25 +685,20 @@