diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 50b014c..13e05df 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -169,42 +169,6 @@ $router.push({ path: '/receive/add', query: { typeValue: 'add' } }) } -// 导出 -const exportAll = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const params = { - applyNo: listQuery.value.applyNo, // 申请编号 - applyName: listQuery.value.applyName, // 申请名称 - applyUnit: listQuery.value.applyUnit, // 申请部门 - applyPerson: listQuery.value.applyPerson, // 申请人 - startTime: listQuery.value.startTime, // 申请开始日期 - endTime: listQuery.value.endTime, // 申请结束日期 - approvalStatus: listQuery.value.approvalStatus, // 审批状态 - processResult: listQuery.value.processResult, // 处置结果 - applyType: listQuery.value.applyType, // 申请类型 领用0 - createUser: listQuery.value.createUser, // 创建人 - formId: SCHEDULE.DEVICE_CONSUMING_APPROVAL, - offset: 1, - limit: 20, - ids: checkoutList.value, - } - // 调导出接口 - exportReceiveApplyList(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, '设备领用申请列表.xlsx') - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} - // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -450,7 +414,6 @@ - - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 50b014c..13e05df 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -169,42 +169,6 @@ $router.push({ path: '/receive/add', query: { typeValue: 'add' } }) } -// 导出 -const exportAll = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const params = { - applyNo: listQuery.value.applyNo, // 申请编号 - applyName: listQuery.value.applyName, // 申请名称 - applyUnit: listQuery.value.applyUnit, // 申请部门 - applyPerson: listQuery.value.applyPerson, // 申请人 - startTime: listQuery.value.startTime, // 申请开始日期 - endTime: listQuery.value.endTime, // 申请结束日期 - approvalStatus: listQuery.value.approvalStatus, // 审批状态 - processResult: listQuery.value.processResult, // 处置结果 - applyType: listQuery.value.applyType, // 申请类型 领用0 - createUser: listQuery.value.createUser, // 创建人 - formId: SCHEDULE.DEVICE_CONSUMING_APPROVAL, - offset: 1, - limit: 20, - ids: checkoutList.value, - } - // 调导出接口 - exportReceiveApplyList(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, '设备领用申请列表.xlsx') - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} - // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -450,7 +414,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 50b014c..13e05df 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -169,42 +169,6 @@ $router.push({ path: '/receive/add', query: { typeValue: 'add' } }) } -// 导出 -const exportAll = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const params = { - applyNo: listQuery.value.applyNo, // 申请编号 - applyName: listQuery.value.applyName, // 申请名称 - applyUnit: listQuery.value.applyUnit, // 申请部门 - applyPerson: listQuery.value.applyPerson, // 申请人 - startTime: listQuery.value.startTime, // 申请开始日期 - endTime: listQuery.value.endTime, // 申请结束日期 - approvalStatus: listQuery.value.approvalStatus, // 审批状态 - processResult: listQuery.value.processResult, // 处置结果 - applyType: listQuery.value.applyType, // 申请类型 领用0 - createUser: listQuery.value.createUser, // 创建人 - formId: SCHEDULE.DEVICE_CONSUMING_APPROVAL, - offset: 1, - limit: 20, - ids: checkoutList.value, - } - // 调导出接口 - exportReceiveApplyList(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, '设备领用申请列表.xlsx') - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} - // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -450,7 +414,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { list.value = response.data.rows.map((item: IsolveListType) => { return { diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 50b014c..13e05df 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -169,42 +169,6 @@ $router.push({ path: '/receive/add', query: { typeValue: 'add' } }) } -// 导出 -const exportAll = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const params = { - applyNo: listQuery.value.applyNo, // 申请编号 - applyName: listQuery.value.applyName, // 申请名称 - applyUnit: listQuery.value.applyUnit, // 申请部门 - applyPerson: listQuery.value.applyPerson, // 申请人 - startTime: listQuery.value.startTime, // 申请开始日期 - endTime: listQuery.value.endTime, // 申请结束日期 - approvalStatus: listQuery.value.approvalStatus, // 审批状态 - processResult: listQuery.value.processResult, // 处置结果 - applyType: listQuery.value.applyType, // 申请类型 领用0 - createUser: listQuery.value.createUser, // 创建人 - formId: SCHEDULE.DEVICE_CONSUMING_APPROVAL, - offset: 1, - limit: 20, - ids: checkoutList.value, - } - // 调导出接口 - exportReceiveApplyList(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, '设备领用申请列表.xlsx') - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} - // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -450,7 +414,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { list.value = response.data.rows.map((item: IsolveListType) => { return { diff --git a/src/views/device/standingBook/standingBook-interface.ts b/src/views/device/standingBook/standingBook-interface.ts index e3cf134..4d239dd 100644 --- a/src/views/device/standingBook/standingBook-interface.ts +++ b/src/views/device/standingBook/standingBook-interface.ts @@ -28,6 +28,7 @@ name: string id: string value: string + isSelectItemDisabled?: boolean // 选择项目禁用 } // 部门类型 export interface deptType { diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 50b014c..13e05df 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -169,42 +169,6 @@ $router.push({ path: '/receive/add', query: { typeValue: 'add' } }) } -// 导出 -const exportAll = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const params = { - applyNo: listQuery.value.applyNo, // 申请编号 - applyName: listQuery.value.applyName, // 申请名称 - applyUnit: listQuery.value.applyUnit, // 申请部门 - applyPerson: listQuery.value.applyPerson, // 申请人 - startTime: listQuery.value.startTime, // 申请开始日期 - endTime: listQuery.value.endTime, // 申请结束日期 - approvalStatus: listQuery.value.approvalStatus, // 审批状态 - processResult: listQuery.value.processResult, // 处置结果 - applyType: listQuery.value.applyType, // 申请类型 领用0 - createUser: listQuery.value.createUser, // 创建人 - formId: SCHEDULE.DEVICE_CONSUMING_APPROVAL, - offset: 1, - limit: 20, - ids: checkoutList.value, - } - // 调导出接口 - exportReceiveApplyList(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, '设备领用申请列表.xlsx') - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} - // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -450,7 +414,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { list.value = response.data.rows.map((item: IsolveListType) => { return { diff --git a/src/views/device/standingBook/standingBook-interface.ts b/src/views/device/standingBook/standingBook-interface.ts index e3cf134..4d239dd 100644 --- a/src/views/device/standingBook/standingBook-interface.ts +++ b/src/views/device/standingBook/standingBook-interface.ts @@ -28,6 +28,7 @@ name: string id: string value: string + isSelectItemDisabled?: boolean // 选择项目禁用 } // 部门类型 export interface deptType { diff --git a/src/views/device/stateManage/components/selectDevice.vue b/src/views/device/stateManage/components/selectDevice.vue index eddd910..237e92a 100644 --- a/src/views/device/stateManage/components/selectDevice.vue +++ b/src/views/device/stateManage/components/selectDevice.vue @@ -43,6 +43,7 @@ text: '管理状态', value: 'managerStateName', align: 'center', + width: '120', }, { text: '使用人', @@ -54,7 +55,6 @@ value: 'validDate', align: 'center', width: '120', - }, ]) // 选中的内容 @@ -148,8 +148,13 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 50b014c..13e05df 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -169,42 +169,6 @@ $router.push({ path: '/receive/add', query: { typeValue: 'add' } }) } -// 导出 -const exportAll = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const params = { - applyNo: listQuery.value.applyNo, // 申请编号 - applyName: listQuery.value.applyName, // 申请名称 - applyUnit: listQuery.value.applyUnit, // 申请部门 - applyPerson: listQuery.value.applyPerson, // 申请人 - startTime: listQuery.value.startTime, // 申请开始日期 - endTime: listQuery.value.endTime, // 申请结束日期 - approvalStatus: listQuery.value.approvalStatus, // 审批状态 - processResult: listQuery.value.processResult, // 处置结果 - applyType: listQuery.value.applyType, // 申请类型 领用0 - createUser: listQuery.value.createUser, // 创建人 - formId: SCHEDULE.DEVICE_CONSUMING_APPROVAL, - offset: 1, - limit: 20, - ids: checkoutList.value, - } - // 调导出接口 - exportReceiveApplyList(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, '设备领用申请列表.xlsx') - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} - // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -450,7 +414,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { list.value = response.data.rows.map((item: IsolveListType) => { return { diff --git a/src/views/device/standingBook/standingBook-interface.ts b/src/views/device/standingBook/standingBook-interface.ts index e3cf134..4d239dd 100644 --- a/src/views/device/standingBook/standingBook-interface.ts +++ b/src/views/device/standingBook/standingBook-interface.ts @@ -28,6 +28,7 @@ name: string id: string value: string + isSelectItemDisabled?: boolean // 选择项目禁用 } // 部门类型 export interface deptType { diff --git a/src/views/device/stateManage/components/selectDevice.vue b/src/views/device/stateManage/components/selectDevice.vue index eddd910..237e92a 100644 --- a/src/views/device/stateManage/components/selectDevice.vue +++ b/src/views/device/stateManage/components/selectDevice.vue @@ -43,6 +43,7 @@ text: '管理状态', value: 'managerStateName', align: 'center', + width: '120', }, { text: '使用人', @@ -54,7 +55,6 @@ value: 'validDate', align: 'center', width: '120', - }, ]) // 选中的内容 @@ -148,8 +148,13 @@ import { ref } from 'vue' import dayjs from 'dayjs' +import { ElMessage } from 'element-plus' import type { IdeviceList } from './status-interface' import useUserStore from '@/store/modules/user' import { listPageApi } from '@/api/device/standingBook' import type { TableColumn } from '@/components/NormalTable/table_interface' - +import { getDictByCode } from '@/api/system/dict' +import type { selectType } from '@/views/device/standingBook/standingBook-interface' +import { getStatusList } from '@/api/device/stateManage' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ dialogSelectDiviceVisible: { type: Boolean, default: false, }, - isMulti: Boolean, + isMulti: Boolean, // 是否多选 + statusTypeName: { // 状态管理类型 + type: String, + default: '', + }, }) +// 提醒文字 const emits = defineEmits(['closeDialog', 'updateDeviceConfirm']) +const defineMessageTest = ref('') // 提醒文字 const loadingTable = ref(false) const userStore = useUserStore() // 查询条件 const listQuery = ref({ equipmentName: '', // 设备名称 equipmentNo: '', // 设备编号 + managerState: '', // 管理状态 offset: 1, limit: 20, }) const total = ref(20) // 多选选中的内容 -const checkoutList = ref([]) - +const checkoutList = ref([]) as any +const isSelectDisabled = ref(false) // 状态管理筛选框是否禁用 const list = ref([])// 表格数据 const columns = ref([ { text: '设备名称', value: 'equipmentName', align: 'center', fixed: true }, - { text: '设备编号', value: 'equipmentNo', align: 'center', fixed: true }, + { text: '设备编号', value: 'equipmentNo', align: 'center', fixed: true, width: '160' }, { text: '型号', value: 'modelNo', align: 'center' }, { text: '出厂编号', value: 'manufacturingNo', align: 'center' }, - { text: '管理状态', value: 'managerStateName', align: 'center' }, + { text: '管理状态', value: 'managerStateName', align: 'center', width: '120' }, { text: '使用人', value: 'usePersonName', align: 'center' }, - { text: '有效日期', value: 'validDate', align: 'center' }, + { text: '有效日期', value: 'validDate', align: 'center', width: '120' }, ]) const table = ref() const dialogTableVisible = ref(false)// 控制对话框显隐 - +// 获取数据 +const managerStateList = ref([]) +const getDict = () => { + // 获取管理状态 + getDictByCode('managerState').then((response) => { + managerStateList.value = response.data.map((item: { name: string; isSelectItemDisabled: boolean }) => { + if (props.statusTypeName === '闲置' && item.name !== '在用(启封)') { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '封存' && (item.name !== '在用(启封)' && item.name !== '闲置')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '启封' && (item.name !== '封存' && item.name !== '闲置')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '报废' && (item.name !== '在用(启封)' && item.name !== '闲置' && item.name !== '封存')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '处置' && item.name !== '报废') { + item.isSelectItemDisabled = true + } + return item + }) + }) +} +getDict() // 获取数据列表 const fetchData = () => { loadingTable.value = true + listQuery.value.limit = props.isMulti ? 20 : 5 listPageApi(listQuery.value).then((res) => { list.value = res.data.rows.map((item: IdeviceList) => { return { @@ -64,12 +101,38 @@ table.value.clearMulti() // 清除多选选中 } }) +watch(() => props.statusTypeName, (val) => { + if (val === '闲置') { + defineMessageTest.value = '在用(启封)' + listQuery.value.managerState = '1' // 启封 // 默认查询哪个状态 + } + else if (val === '封存') { + defineMessageTest.value = '闲置、在用(启封)' + listQuery.value.managerState = '1' // 启封 + } + else if (val === '启封') { + defineMessageTest.value = '闲置、封存' + listQuery.value.managerState = '3' // 封存 + } + else if (val === '报废') { + defineMessageTest.value = '闲置、封存、在用(启封)' + listQuery.value.managerState = '1' // 启封 + } + else if (val === '处置') { + defineMessageTest.value = '报废' + listQuery.value.managerState = '4' // 报废 + } +}) // 关闭对话框 const close = () => { emits('closeDialog') } // 确认 const confirm = () => { + if (!checkoutList.value.length) { + ElMessage.warning('请选中') + return + } emits('updateDeviceConfirm', checkoutList.value) close() } @@ -101,7 +164,7 @@ - + + + + + + - + @@ -144,8 +218,10 @@ - - + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + 取消 diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 50b014c..13e05df 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -169,42 +169,6 @@ $router.push({ path: '/receive/add', query: { typeValue: 'add' } }) } -// 导出 -const exportAll = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const params = { - applyNo: listQuery.value.applyNo, // 申请编号 - applyName: listQuery.value.applyName, // 申请名称 - applyUnit: listQuery.value.applyUnit, // 申请部门 - applyPerson: listQuery.value.applyPerson, // 申请人 - startTime: listQuery.value.startTime, // 申请开始日期 - endTime: listQuery.value.endTime, // 申请结束日期 - approvalStatus: listQuery.value.approvalStatus, // 审批状态 - processResult: listQuery.value.processResult, // 处置结果 - applyType: listQuery.value.applyType, // 申请类型 领用0 - createUser: listQuery.value.createUser, // 创建人 - formId: SCHEDULE.DEVICE_CONSUMING_APPROVAL, - offset: 1, - limit: 20, - ids: checkoutList.value, - } - // 调导出接口 - exportReceiveApplyList(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, '设备领用申请列表.xlsx') - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} - // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -450,7 +414,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { list.value = response.data.rows.map((item: IsolveListType) => { return { diff --git a/src/views/device/standingBook/standingBook-interface.ts b/src/views/device/standingBook/standingBook-interface.ts index e3cf134..4d239dd 100644 --- a/src/views/device/standingBook/standingBook-interface.ts +++ b/src/views/device/standingBook/standingBook-interface.ts @@ -28,6 +28,7 @@ name: string id: string value: string + isSelectItemDisabled?: boolean // 选择项目禁用 } // 部门类型 export interface deptType { diff --git a/src/views/device/stateManage/components/selectDevice.vue b/src/views/device/stateManage/components/selectDevice.vue index eddd910..237e92a 100644 --- a/src/views/device/stateManage/components/selectDevice.vue +++ b/src/views/device/stateManage/components/selectDevice.vue @@ -43,6 +43,7 @@ text: '管理状态', value: 'managerStateName', align: 'center', + width: '120', }, { text: '使用人', @@ -54,7 +55,6 @@ value: 'validDate', align: 'center', width: '120', - }, ]) // 选中的内容 @@ -148,8 +148,13 @@ import { ref } from 'vue' import dayjs from 'dayjs' +import { ElMessage } from 'element-plus' import type { IdeviceList } from './status-interface' import useUserStore from '@/store/modules/user' import { listPageApi } from '@/api/device/standingBook' import type { TableColumn } from '@/components/NormalTable/table_interface' - +import { getDictByCode } from '@/api/system/dict' +import type { selectType } from '@/views/device/standingBook/standingBook-interface' +import { getStatusList } from '@/api/device/stateManage' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ dialogSelectDiviceVisible: { type: Boolean, default: false, }, - isMulti: Boolean, + isMulti: Boolean, // 是否多选 + statusTypeName: { // 状态管理类型 + type: String, + default: '', + }, }) +// 提醒文字 const emits = defineEmits(['closeDialog', 'updateDeviceConfirm']) +const defineMessageTest = ref('') // 提醒文字 const loadingTable = ref(false) const userStore = useUserStore() // 查询条件 const listQuery = ref({ equipmentName: '', // 设备名称 equipmentNo: '', // 设备编号 + managerState: '', // 管理状态 offset: 1, limit: 20, }) const total = ref(20) // 多选选中的内容 -const checkoutList = ref([]) - +const checkoutList = ref([]) as any +const isSelectDisabled = ref(false) // 状态管理筛选框是否禁用 const list = ref([])// 表格数据 const columns = ref([ { text: '设备名称', value: 'equipmentName', align: 'center', fixed: true }, - { text: '设备编号', value: 'equipmentNo', align: 'center', fixed: true }, + { text: '设备编号', value: 'equipmentNo', align: 'center', fixed: true, width: '160' }, { text: '型号', value: 'modelNo', align: 'center' }, { text: '出厂编号', value: 'manufacturingNo', align: 'center' }, - { text: '管理状态', value: 'managerStateName', align: 'center' }, + { text: '管理状态', value: 'managerStateName', align: 'center', width: '120' }, { text: '使用人', value: 'usePersonName', align: 'center' }, - { text: '有效日期', value: 'validDate', align: 'center' }, + { text: '有效日期', value: 'validDate', align: 'center', width: '120' }, ]) const table = ref() const dialogTableVisible = ref(false)// 控制对话框显隐 - +// 获取数据 +const managerStateList = ref([]) +const getDict = () => { + // 获取管理状态 + getDictByCode('managerState').then((response) => { + managerStateList.value = response.data.map((item: { name: string; isSelectItemDisabled: boolean }) => { + if (props.statusTypeName === '闲置' && item.name !== '在用(启封)') { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '封存' && (item.name !== '在用(启封)' && item.name !== '闲置')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '启封' && (item.name !== '封存' && item.name !== '闲置')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '报废' && (item.name !== '在用(启封)' && item.name !== '闲置' && item.name !== '封存')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '处置' && item.name !== '报废') { + item.isSelectItemDisabled = true + } + return item + }) + }) +} +getDict() // 获取数据列表 const fetchData = () => { loadingTable.value = true + listQuery.value.limit = props.isMulti ? 20 : 5 listPageApi(listQuery.value).then((res) => { list.value = res.data.rows.map((item: IdeviceList) => { return { @@ -64,12 +101,38 @@ table.value.clearMulti() // 清除多选选中 } }) +watch(() => props.statusTypeName, (val) => { + if (val === '闲置') { + defineMessageTest.value = '在用(启封)' + listQuery.value.managerState = '1' // 启封 // 默认查询哪个状态 + } + else if (val === '封存') { + defineMessageTest.value = '闲置、在用(启封)' + listQuery.value.managerState = '1' // 启封 + } + else if (val === '启封') { + defineMessageTest.value = '闲置、封存' + listQuery.value.managerState = '3' // 封存 + } + else if (val === '报废') { + defineMessageTest.value = '闲置、封存、在用(启封)' + listQuery.value.managerState = '1' // 启封 + } + else if (val === '处置') { + defineMessageTest.value = '报废' + listQuery.value.managerState = '4' // 报废 + } +}) // 关闭对话框 const close = () => { emits('closeDialog') } // 确认 const confirm = () => { + if (!checkoutList.value.length) { + ElMessage.warning('请选中') + return + } emits('updateDeviceConfirm', checkoutList.value) close() } @@ -101,7 +164,7 @@ - + + + + + + - + @@ -144,8 +218,10 @@ - - + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + 取消 diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index dd27189..acb9b35 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -41,6 +41,7 @@ time: string // 时间 updateTime: string // 修改时间 version: string // 版本 + decisionItem?: string | number } // 删除/提交/取消 @@ -72,6 +73,9 @@ equipmentSpecifications?: string | undefined manufacturingNo?: string | undefined manufacturer?: string | undefined + isRadioDisabled?: boolean // 禁用单选按钮 + isMultiDisabled?: boolean // 禁用多选框 + isSelectItemDisabled?: boolean // 选择器选项禁用 } export interface IdeviceListQuery { diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 50b014c..13e05df 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -169,42 +169,6 @@ $router.push({ path: '/receive/add', query: { typeValue: 'add' } }) } -// 导出 -const exportAll = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const params = { - applyNo: listQuery.value.applyNo, // 申请编号 - applyName: listQuery.value.applyName, // 申请名称 - applyUnit: listQuery.value.applyUnit, // 申请部门 - applyPerson: listQuery.value.applyPerson, // 申请人 - startTime: listQuery.value.startTime, // 申请开始日期 - endTime: listQuery.value.endTime, // 申请结束日期 - approvalStatus: listQuery.value.approvalStatus, // 审批状态 - processResult: listQuery.value.processResult, // 处置结果 - applyType: listQuery.value.applyType, // 申请类型 领用0 - createUser: listQuery.value.createUser, // 创建人 - formId: SCHEDULE.DEVICE_CONSUMING_APPROVAL, - offset: 1, - limit: 20, - ids: checkoutList.value, - } - // 调导出接口 - exportReceiveApplyList(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, '设备领用申请列表.xlsx') - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} - // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -450,7 +414,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { list.value = response.data.rows.map((item: IsolveListType) => { return { diff --git a/src/views/device/standingBook/standingBook-interface.ts b/src/views/device/standingBook/standingBook-interface.ts index e3cf134..4d239dd 100644 --- a/src/views/device/standingBook/standingBook-interface.ts +++ b/src/views/device/standingBook/standingBook-interface.ts @@ -28,6 +28,7 @@ name: string id: string value: string + isSelectItemDisabled?: boolean // 选择项目禁用 } // 部门类型 export interface deptType { diff --git a/src/views/device/stateManage/components/selectDevice.vue b/src/views/device/stateManage/components/selectDevice.vue index eddd910..237e92a 100644 --- a/src/views/device/stateManage/components/selectDevice.vue +++ b/src/views/device/stateManage/components/selectDevice.vue @@ -43,6 +43,7 @@ text: '管理状态', value: 'managerStateName', align: 'center', + width: '120', }, { text: '使用人', @@ -54,7 +55,6 @@ value: 'validDate', align: 'center', width: '120', - }, ]) // 选中的内容 @@ -148,8 +148,13 @@ import { ref } from 'vue' import dayjs from 'dayjs' +import { ElMessage } from 'element-plus' import type { IdeviceList } from './status-interface' import useUserStore from '@/store/modules/user' import { listPageApi } from '@/api/device/standingBook' import type { TableColumn } from '@/components/NormalTable/table_interface' - +import { getDictByCode } from '@/api/system/dict' +import type { selectType } from '@/views/device/standingBook/standingBook-interface' +import { getStatusList } from '@/api/device/stateManage' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ dialogSelectDiviceVisible: { type: Boolean, default: false, }, - isMulti: Boolean, + isMulti: Boolean, // 是否多选 + statusTypeName: { // 状态管理类型 + type: String, + default: '', + }, }) +// 提醒文字 const emits = defineEmits(['closeDialog', 'updateDeviceConfirm']) +const defineMessageTest = ref('') // 提醒文字 const loadingTable = ref(false) const userStore = useUserStore() // 查询条件 const listQuery = ref({ equipmentName: '', // 设备名称 equipmentNo: '', // 设备编号 + managerState: '', // 管理状态 offset: 1, limit: 20, }) const total = ref(20) // 多选选中的内容 -const checkoutList = ref([]) - +const checkoutList = ref([]) as any +const isSelectDisabled = ref(false) // 状态管理筛选框是否禁用 const list = ref([])// 表格数据 const columns = ref([ { text: '设备名称', value: 'equipmentName', align: 'center', fixed: true }, - { text: '设备编号', value: 'equipmentNo', align: 'center', fixed: true }, + { text: '设备编号', value: 'equipmentNo', align: 'center', fixed: true, width: '160' }, { text: '型号', value: 'modelNo', align: 'center' }, { text: '出厂编号', value: 'manufacturingNo', align: 'center' }, - { text: '管理状态', value: 'managerStateName', align: 'center' }, + { text: '管理状态', value: 'managerStateName', align: 'center', width: '120' }, { text: '使用人', value: 'usePersonName', align: 'center' }, - { text: '有效日期', value: 'validDate', align: 'center' }, + { text: '有效日期', value: 'validDate', align: 'center', width: '120' }, ]) const table = ref() const dialogTableVisible = ref(false)// 控制对话框显隐 - +// 获取数据 +const managerStateList = ref([]) +const getDict = () => { + // 获取管理状态 + getDictByCode('managerState').then((response) => { + managerStateList.value = response.data.map((item: { name: string; isSelectItemDisabled: boolean }) => { + if (props.statusTypeName === '闲置' && item.name !== '在用(启封)') { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '封存' && (item.name !== '在用(启封)' && item.name !== '闲置')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '启封' && (item.name !== '封存' && item.name !== '闲置')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '报废' && (item.name !== '在用(启封)' && item.name !== '闲置' && item.name !== '封存')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '处置' && item.name !== '报废') { + item.isSelectItemDisabled = true + } + return item + }) + }) +} +getDict() // 获取数据列表 const fetchData = () => { loadingTable.value = true + listQuery.value.limit = props.isMulti ? 20 : 5 listPageApi(listQuery.value).then((res) => { list.value = res.data.rows.map((item: IdeviceList) => { return { @@ -64,12 +101,38 @@ table.value.clearMulti() // 清除多选选中 } }) +watch(() => props.statusTypeName, (val) => { + if (val === '闲置') { + defineMessageTest.value = '在用(启封)' + listQuery.value.managerState = '1' // 启封 // 默认查询哪个状态 + } + else if (val === '封存') { + defineMessageTest.value = '闲置、在用(启封)' + listQuery.value.managerState = '1' // 启封 + } + else if (val === '启封') { + defineMessageTest.value = '闲置、封存' + listQuery.value.managerState = '3' // 封存 + } + else if (val === '报废') { + defineMessageTest.value = '闲置、封存、在用(启封)' + listQuery.value.managerState = '1' // 启封 + } + else if (val === '处置') { + defineMessageTest.value = '报废' + listQuery.value.managerState = '4' // 报废 + } +}) // 关闭对话框 const close = () => { emits('closeDialog') } // 确认 const confirm = () => { + if (!checkoutList.value.length) { + ElMessage.warning('请选中') + return + } emits('updateDeviceConfirm', checkoutList.value) close() } @@ -101,7 +164,7 @@ - + + + + + + - + @@ -144,8 +218,10 @@ - - + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + 取消 diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index dd27189..acb9b35 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -41,6 +41,7 @@ time: string // 时间 updateTime: string // 修改时间 version: string // 版本 + decisionItem?: string | number } // 删除/提交/取消 @@ -72,6 +73,9 @@ equipmentSpecifications?: string | undefined manufacturingNo?: string | undefined manufacturer?: string | undefined + isRadioDisabled?: boolean // 禁用单选按钮 + isMultiDisabled?: boolean // 禁用多选框 + isSelectItemDisabled?: boolean // 选择器选项禁用 } export interface IdeviceListQuery { diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 73f8ddb..114d99c 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -1,36 +1,38 @@ @@ -398,47 +385,30 @@ - - - - - 提交 - - - 保存 - - - - 保存 - - - - 保存 - - - - - - - 编辑 + + 同意 - - + + 驳回 + + + 拒绝 + + + 取消 + + + 提交 + + + 保存 + + 关闭 - + @@ -466,7 +436,7 @@ - + 选择 @@ -477,12 +447,12 @@ - + - + - + - + - + - + + @@ -543,7 +514,7 @@ 上传 - + × @@ -559,11 +530,14 @@ + + diff --git a/.env.production b/.env.production index 0fca4ad..ff5a80a 100644 --- a/.env.production +++ b/.env.production @@ -3,9 +3,9 @@ # 页面标题 VITE_APP_TITLE = 计量业务系统 # 接口请求地址,会设置到 axios 的 baseURL 参数上 -# VITE_APP_API_BASEURL = http://111.198.10.15:21609 +VITE_APP_API_BASEURL = http://111.198.10.15:21609 # VITE_APP_API_BASEURL = http://192.168.83.213:8085 -VITE_APP_API_BASEURL = http://192.168.2.96:8085 +# VITE_APP_API_BASEURL = http://192.168.2.96:8085 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空 VITE_APP_DEBUG_TOOL = diff --git a/src/components/NormalTable/index.vue b/src/components/NormalTable/index.vue index f342066..9c4581f 100644 --- a/src/components/NormalTable/index.vue +++ b/src/components/NormalTable/index.vue @@ -196,7 +196,7 @@ - + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index b2bfdba..f685105 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -462,7 +462,7 @@ - + {{ scope.row.backTime }} diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 0bd10c8..e3fe562 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -55,6 +55,7 @@ form.value.applyPerson = res.data.applyPerson// 申请人 form.value.time = res.data.time // 借用时间 form.value.applyDesc = res.data.applyDesc // 申请说明 + form.value.backTime = res.data.backTime // 归还时间 list.value = res.data.equipmentInfoList.map((item: IdeviceList) => { return { ...item, diff --git a/src/views/device/deviceMaintenance/checkList_interface.ts b/src/views/device/deviceMaintenance/checkList_interface.ts index 0ada9c2..a884fd8 100644 --- a/src/views/device/deviceMaintenance/checkList_interface.ts +++ b/src/views/device/deviceMaintenance/checkList_interface.ts @@ -19,6 +19,7 @@ remark: string // 备注 updateTime: null | string // 更新时间 approvalStatusName?: string // 审批状态名称 + decisionItem?: string | number } // 标准配套设备表头类型 export interface columnsType { diff --git a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue index 7f02a38..ba6cc7d 100644 --- a/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue +++ b/src/views/device/deviceMaintenance/components/listMaintenanceApproval.vue @@ -254,7 +254,13 @@ } // 跳转到详情 const goDetail = (row: IlistApproval, type: string) => { - $router.push(`/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`) + $router.push({ + path: `/maintenance/maintenanceList/${type}/${row.id}/${row.approvalStatusName}/${row.processId}`, + query: { + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, + }, + }) } // 获取到组织信息 const getDept = () => { @@ -275,7 +281,7 @@ cancelButtonText: '取消', type: 'warning', }).then(() => { - submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL }).then((res) => { + submitEquipmentApply({ id: row.id, formId: SCHEDULE.DEVICE_FIX_APPROVAL, processId: row.processId }).then((res) => { if (res.code === 200) { ElMessage({ type: 'success', @@ -488,20 +494,8 @@ > 取消 - - - + + + + + + + + + + + + + + + + + + + + + + {{ (listQuery.offset - 1) * listQuery.limit + scope.$index + 1 }} + + + + + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + + + + 取消 + + 确定 + + + + + + + diff --git a/src/views/device/receive/apply/applyEdit.vue b/src/views/device/receive/apply/applyEdit.vue index 13e9528..8b50fc0 100644 --- a/src/views/device/receive/apply/applyEdit.vue +++ b/src/views/device/receive/apply/applyEdit.vue @@ -10,6 +10,7 @@ import SelectDeviceDialog from '../selectDeviceDialog.vue' import { toTreeList } from '@/utils/structure' import { SCHEDULE } from '@/utils/scheduleDict' +import { cancelApproval, fetchApproval, submitApproval } from '@/api/approval' import type { TableColumn } from '@/components/NormalTable/table_interface' import { failUpdateEquipmentApply, @@ -22,9 +23,9 @@ import type { deptType } from '@/views/device/standingBook/standingBook-interface' import { getDeptTreeList } from '@/api/system/dept' import { getUserList } from '@/api/system/user' -import { fetchApproval, submitApproval } from '@/api/approval' import ApprovalRecord from '@/components/ApprovalRecord/ApprovalRecord.vue' import useUserStore from '@/store/modules/user' +import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' const user = useUserStore() // 用户信息 const $route = useRoute() @@ -39,6 +40,8 @@ const isMulti = ref(false) // 是否批量添加(允许多选) const selectIndex = ref() // 点击选择的index--点击第几行 const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 +const decisionItem = ref('') // 同意、驳回、拒绝按钮权限 +const taskId = ref('') // 任务id,用于同意、驳回、拒绝审批 const textMap: { [key: string]: string } = { edit: '编辑', add: '新建', @@ -88,42 +91,6 @@ $router.back() } -const handleClick = (val: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', form.value.taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', form.value.taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', form.value.taskId) - } - else if (val === 'revoke') { - const params = { - taskId: form.value.taskId!, - comments: '', - } - ElMessageBox.confirm( - '确认撤回该审批吗?', - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - submitApproval('revoke', params).then((res) => { - ElMessage({ - type: 'success', - message: '已撤回', - }) - }) - close() - }) - } -} - // 多选发生改变时 const handleSelectionChange = (e: any) => { checkoutList.value = e @@ -314,11 +281,6 @@ }) } -// 审批结束回调 -const approvalSuccess = () => { - close() -} - // 编辑、详情--获取详细信息 const fetchReceiveApplyListDetail = () => { getReceiveApplyListDetail({ id: form.value.id }).then((res) => { @@ -355,6 +317,7 @@ } } +// ---------------------------------------------审批-------------------------------------- const approvalRecordData = ref([]) // 审批流程数据 // 查询审批记录 function getApprovalRecord(processId: string) { @@ -369,6 +332,47 @@ } } } +// 审批结束回调 +const approvalSuccess = () => { + close() +} +// 审批 +const handleApprove = (val: string, title = '') => { + if (val === '取消') { + const params = { + processInstanceId: form.value.processId!, + comments: '', + } + ElMessageBox.confirm( + '确认取消该审批吗?', + '提示', + { + confirmButtonText: '确认', + cancelButtonText: '取消', + type: 'warning', + }, + ) + .then(() => { + cancelApproval(params).then((res) => { + ElMessage({ + type: 'success', + message: '取消成功', + }) + close() + }) + }) + } + else if (val === '同意') { + approvalDialog.value.initDialog('agree', taskId.value) + } + else if (val === '驳回') { + approvalDialog.value.initDialog('reject', taskId.value) + } + else if (val === '拒绝') { + approvalDialog.value.initDialog('refuse', taskId.value) + } +} +// -------------------------------------------------------------------------------------- onMounted(() => { typeValue.value = $route.query.typeValue // 类型add、edit、detail @@ -376,6 +380,8 @@ form.value.taskId = $route.query.taskId as string // 任务id form.value.processId = $route.query.processId as string // 任务id approvalStatus.value = $route.query.approvalStatus // 审批类型 + decisionItem.value = $route.query.decisionItem as string // 同意、驳回、拒绝按钮权限 + taskId.value = $route.query.taskId as string // 流程实例id approvalStatusName.value = $route.query.approvalStatusName // 审批类型名称 form.value.applyName = '设备领用申请' // 申请名称固定 form.value.applyUnit = user.deptId // 申请单位 @@ -401,24 +407,24 @@ - + 同意 - + 驳回 - + 拒绝 + + 取消 + 提交 保存 - - 撤回 - 关闭 @@ -544,7 +550,7 @@ align="center" > - + 选择 diff --git a/src/views/device/receive/apply/applyList.vue b/src/views/device/receive/apply/applyList.vue index 50b014c..13e05df 100644 --- a/src/views/device/receive/apply/applyList.vue +++ b/src/views/device/receive/apply/applyList.vue @@ -169,42 +169,6 @@ $router.push({ path: '/receive/add', query: { typeValue: 'add' } }) } -// 导出 -const exportAll = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const params = { - applyNo: listQuery.value.applyNo, // 申请编号 - applyName: listQuery.value.applyName, // 申请名称 - applyUnit: listQuery.value.applyUnit, // 申请部门 - applyPerson: listQuery.value.applyPerson, // 申请人 - startTime: listQuery.value.startTime, // 申请开始日期 - endTime: listQuery.value.endTime, // 申请结束日期 - approvalStatus: listQuery.value.approvalStatus, // 审批状态 - processResult: listQuery.value.processResult, // 处置结果 - applyType: listQuery.value.applyType, // 申请类型 领用0 - createUser: listQuery.value.createUser, // 创建人 - formId: SCHEDULE.DEVICE_CONSUMING_APPROVAL, - offset: 1, - limit: 20, - ids: checkoutList.value, - } - // 调导出接口 - exportReceiveApplyList(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, '设备领用申请列表.xlsx') - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} - // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 const changePage = (val: { size?: number; page?: number }) => { if (val && val.size) { @@ -450,7 +414,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { list.value = response.data.rows.map((item: IsolveListType) => { return { diff --git a/src/views/device/standingBook/standingBook-interface.ts b/src/views/device/standingBook/standingBook-interface.ts index e3cf134..4d239dd 100644 --- a/src/views/device/standingBook/standingBook-interface.ts +++ b/src/views/device/standingBook/standingBook-interface.ts @@ -28,6 +28,7 @@ name: string id: string value: string + isSelectItemDisabled?: boolean // 选择项目禁用 } // 部门类型 export interface deptType { diff --git a/src/views/device/stateManage/components/selectDevice.vue b/src/views/device/stateManage/components/selectDevice.vue index eddd910..237e92a 100644 --- a/src/views/device/stateManage/components/selectDevice.vue +++ b/src/views/device/stateManage/components/selectDevice.vue @@ -43,6 +43,7 @@ text: '管理状态', value: 'managerStateName', align: 'center', + width: '120', }, { text: '使用人', @@ -54,7 +55,6 @@ value: 'validDate', align: 'center', width: '120', - }, ]) // 选中的内容 @@ -148,8 +148,13 @@ import { ref } from 'vue' import dayjs from 'dayjs' +import { ElMessage } from 'element-plus' import type { IdeviceList } from './status-interface' import useUserStore from '@/store/modules/user' import { listPageApi } from '@/api/device/standingBook' import type { TableColumn } from '@/components/NormalTable/table_interface' - +import { getDictByCode } from '@/api/system/dict' +import type { selectType } from '@/views/device/standingBook/standingBook-interface' +import { getStatusList } from '@/api/device/stateManage' +import { SCHEDULE } from '@/utils/scheduleDict' const props = defineProps({ dialogSelectDiviceVisible: { type: Boolean, default: false, }, - isMulti: Boolean, + isMulti: Boolean, // 是否多选 + statusTypeName: { // 状态管理类型 + type: String, + default: '', + }, }) +// 提醒文字 const emits = defineEmits(['closeDialog', 'updateDeviceConfirm']) +const defineMessageTest = ref('') // 提醒文字 const loadingTable = ref(false) const userStore = useUserStore() // 查询条件 const listQuery = ref({ equipmentName: '', // 设备名称 equipmentNo: '', // 设备编号 + managerState: '', // 管理状态 offset: 1, limit: 20, }) const total = ref(20) // 多选选中的内容 -const checkoutList = ref([]) - +const checkoutList = ref([]) as any +const isSelectDisabled = ref(false) // 状态管理筛选框是否禁用 const list = ref([])// 表格数据 const columns = ref([ { text: '设备名称', value: 'equipmentName', align: 'center', fixed: true }, - { text: '设备编号', value: 'equipmentNo', align: 'center', fixed: true }, + { text: '设备编号', value: 'equipmentNo', align: 'center', fixed: true, width: '160' }, { text: '型号', value: 'modelNo', align: 'center' }, { text: '出厂编号', value: 'manufacturingNo', align: 'center' }, - { text: '管理状态', value: 'managerStateName', align: 'center' }, + { text: '管理状态', value: 'managerStateName', align: 'center', width: '120' }, { text: '使用人', value: 'usePersonName', align: 'center' }, - { text: '有效日期', value: 'validDate', align: 'center' }, + { text: '有效日期', value: 'validDate', align: 'center', width: '120' }, ]) const table = ref() const dialogTableVisible = ref(false)// 控制对话框显隐 - +// 获取数据 +const managerStateList = ref([]) +const getDict = () => { + // 获取管理状态 + getDictByCode('managerState').then((response) => { + managerStateList.value = response.data.map((item: { name: string; isSelectItemDisabled: boolean }) => { + if (props.statusTypeName === '闲置' && item.name !== '在用(启封)') { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '封存' && (item.name !== '在用(启封)' && item.name !== '闲置')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '启封' && (item.name !== '封存' && item.name !== '闲置')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '报废' && (item.name !== '在用(启封)' && item.name !== '闲置' && item.name !== '封存')) { + item.isSelectItemDisabled = true + } + else if (props.statusTypeName === '处置' && item.name !== '报废') { + item.isSelectItemDisabled = true + } + return item + }) + }) +} +getDict() // 获取数据列表 const fetchData = () => { loadingTable.value = true + listQuery.value.limit = props.isMulti ? 20 : 5 listPageApi(listQuery.value).then((res) => { list.value = res.data.rows.map((item: IdeviceList) => { return { @@ -64,12 +101,38 @@ table.value.clearMulti() // 清除多选选中 } }) +watch(() => props.statusTypeName, (val) => { + if (val === '闲置') { + defineMessageTest.value = '在用(启封)' + listQuery.value.managerState = '1' // 启封 // 默认查询哪个状态 + } + else if (val === '封存') { + defineMessageTest.value = '闲置、在用(启封)' + listQuery.value.managerState = '1' // 启封 + } + else if (val === '启封') { + defineMessageTest.value = '闲置、封存' + listQuery.value.managerState = '3' // 封存 + } + else if (val === '报废') { + defineMessageTest.value = '闲置、封存、在用(启封)' + listQuery.value.managerState = '1' // 启封 + } + else if (val === '处置') { + defineMessageTest.value = '报废' + listQuery.value.managerState = '4' // 报废 + } +}) // 关闭对话框 const close = () => { emits('closeDialog') } // 确认 const confirm = () => { + if (!checkoutList.value.length) { + ElMessage.warning('请选中') + return + } emits('updateDeviceConfirm', checkoutList.value) close() } @@ -101,7 +164,7 @@ - + + + + + + - + @@ -144,8 +218,10 @@ - - + + + *注意:只能查询管理状态为 {{ defineMessageTest }} 的设备 + 取消 diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index dd27189..acb9b35 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -41,6 +41,7 @@ time: string // 时间 updateTime: string // 修改时间 version: string // 版本 + decisionItem?: string | number } // 删除/提交/取消 @@ -72,6 +73,9 @@ equipmentSpecifications?: string | undefined manufacturingNo?: string | undefined manufacturer?: string | undefined + isRadioDisabled?: boolean // 禁用单选按钮 + isMultiDisabled?: boolean // 禁用多选框 + isSelectItemDisabled?: boolean // 选择器选项禁用 } export interface IdeviceListQuery { diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 73f8ddb..114d99c 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -1,36 +1,38 @@ @@ -398,47 +385,30 @@ - - - - - 提交 - - - 保存 - - - - 保存 - - - - 保存 - - - - - - - 编辑 + + 同意 - - + + 驳回 + + + 拒绝 + + + 取消 + + + 提交 + + + 保存 + + 关闭 - + @@ -466,7 +436,7 @@ - + 选择 @@ -477,12 +447,12 @@ - + - + - + - + - + - + + @@ -543,7 +514,7 @@ 上传 - + × @@ -559,11 +530,14 @@ + + diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index d5b53e2..bb932dd 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -48,8 +48,8 @@ cancel: '/device/unusedApply/cancle', // 取消 delete: '/device/unusedApply/delete', // 删除 } -const activeTitle = ref(props.title) // 状态按钮选中 const approvalStatusVal = ref(props.type) + // const approvalStatusMap = ref({}) as any// 审批状态字典{1:草稿箱} // const approvalStatusReserveMap = ref({}) as any// 审批状态字典{草稿箱: 1} const $router = useRouter() @@ -150,18 +150,24 @@ } // 获取数据列表 -const getList = () => { +const getList = (isNowPage = false) => { loadingTable.value = true + if (!isNowPage) { + // 是否显示当前页,否则跳转第一页 + searchQuery.offset = 1 + } + if (!searchQuery.approvalStatus) { + searchQuery.approvalStatus = '0' + } getStatusList(searchQuery).then((res) => { if (res.code === 200) { list.value = res.data.rows total.value = res.data.total } loadingTable.value = false + }).catch((_) => { + loadingTable.value = false }) - .catch((_) => { - loadingTable.value = false - }) } // 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 @@ -187,7 +193,8 @@ name: props.name, applyType: props.applyType, approvalStatusName: row.approvalStatusName, - + decisionItem: `${row.decisionItem}`, // 同意、驳回、拒绝 + taskId: row.taskId, }, }) } @@ -304,10 +311,6 @@ clearSearch() getList() } -// 模板下载 -const templateDownload = () => {} -// 标签识别 -const identify = () => {} // 新增 const add = () => { $router.push({ @@ -351,51 +354,6 @@ ElMessage('无可打印内容') } } -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: '下载中请稍后', - background: 'rgba(255, 255, 255, 0.8)', - }) - if (list.value.length > 0) { - const selectIds = selectList.value.map(item => item.id) - const params = { - applyNo: searchQuery.applyNo, // 申请编号 - applyStatus: searchQuery.applyStatus, // 申请状态 - applyUnit: searchQuery.applyUnit, // 申请部门 - approvalStatus: searchQuery.approvalStatus, // 申请状态 - createUser: searchQuery.createUser, // 创建人 - equipmentName: searchQuery.equipmentName, // 设备名称 - equipmentNo: searchQuery.equipmentNo, // 设备编号 - applyType: searchQuery.applyType, // 申请类型 - formId: SCHEDULE[props.formCode as keyof typeof SCHEDULE], - ids: selectIds, - } - // 调导出接口 - exportStatus(params).then((res) => { - const blob = new Blob([res.data]) - exportFile(blob, `${props.name}.xlsx`) - }) - } - else { - ElMessage.warning('无数据可导出数据') - } - loading.close() -} -const fileRef = ref() // 文件上传input -const onFileChange = (event: any) => { - // 原生上传 - if (event.target.files?.length !== 0) { - // 创建formdata对象 - const fd = new FormData() - fd.append('multipartFile', event.target.files[0]) - } -} -// 批量导入 -const batchImport = () => { - fileRef.value.click() -} const getApplyUnitList = () => { // 获取部门列表 @@ -412,178 +370,160 @@ } onMounted(() => { - getList() // 获取申请单位 getApplyUnitList() + nextTick(() => { + getList() + }) }) - - - - - - {{ title }} - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} + + + + + - - - - {{ (searchQuery.offset - 1) * searchQuery.limit + scope.$index + 1 }} - - - - - + - - - 查看 - - - 编辑 - - - 提交 - - - 同意 - - - 驳回 - - - 拒绝 - - - 取消 - - - 删除 - - - + 查看 + + + 编辑 + + + 提交 + + + 同意 + + + 驳回 + + + 拒绝 + + + 取消 + + + 删除 + - - - - + + + + + +