diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@ - + diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@ - + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@ - + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@ - + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/api/approval.ts b/src/api/approval.ts new file mode 100644 index 0000000..cb8a9af --- /dev/null +++ b/src/api/approval.ts @@ -0,0 +1,24 @@ +// 审批接口 +import request from './index' +const approvalType: { [key: string]: string } = { + agree: '/approval/operate/agree', + refuse: '/approval/operate/refuse', + reject: '/approval/operate/reject', + revoke: '/approval/operate/revoke', +} +// 审批操作接口 +export function submitApproval(type: string, data: { taskId: string; comments: string }) { + return request({ + url: approvalType[type], + method: 'post', + data, + }) +} +// 查询审批记录 +export function fetchApproval(processId: string) { + return request({ + url: '/approval/operate/approvalLog', + method: 'get', + params: { processId }, + }) +} diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts new file mode 100644 index 0000000..47a713e --- /dev/null +++ b/src/api/device/borrow.ts @@ -0,0 +1,60 @@ +// 设备借用相关接口api +import request from '../index' +import type{ searchType } from '@/views/device/borrow/borrow-interface' +// 设备借用申请列表 +export function getApplyList(data: searchType) { + return request({ + url: `/equipmentApply/equipmentApplyList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 设备借用申请新建 +export function addApply(data: object) { + return request({ + url: '/equipmentApply/addEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请详情 +export function detailApply(data: object) { + return request({ + url: '/equipmentApply/equipmentApplyInfo', + method: 'post', + data, + }) +} +// 设备借用申请编辑 +export function editApply(data: object) { + return request({ + url: '/equipmentApply/updateEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请删除 +export function deleteApply(data: object) { + return request({ + url: '/equipmentApply/deleteEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请提交 +export function submitApply(data: object) { + return request({ + url: '/equipmentApply/borrowEquipmentApply', + method: 'post', + data, + }) +} +// 设备借用申请导出 +export function exportApply(data: object) { + return request({ + url: '/equipmentApply/exportList', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/device/standard.ts b/src/api/device/standard.ts index 4f0d99c..5ae03f9 100644 --- a/src/api/device/standard.ts +++ b/src/api/device/standard.ts @@ -55,3 +55,38 @@ }) } +// 获取申请列表 +export function getstandardEquipmentApplyList(data: object) { + return request({ + url: `/standard/standardEquipmentApplyList?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} + +// 删除申请列表信息 +export function getStandardLisdelete(data: object) { + return request({ + url: '/standard/deleteStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 新建申请列表信息 +export function getStandardLisAdd(data: object) { + return request({ + url: '/standard/addStandardEquipmentApply', + method: 'post', + data, + }) +} + +// 获取到申请列表信息 +export function getStandardLisdetali(data: object) { + return request({ + url: '/standard/standardEquipmentApplyInfo', + method: 'post', + data, + }) +} diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts new file mode 100644 index 0000000..8771c29 --- /dev/null +++ b/src/api/device/stateManage.ts @@ -0,0 +1,34 @@ +// 状态管理相关接口api +import request from '../index' +// 设备申请列表 +export function getStatusList(data: any) { + return request({ + url: `/meter/stateManage/stateManageList?limit=${data.limit}&offset=${data.offset}`, + method: 'post', + data, + }) +} +// 状态管理新建 +export function addStatus(data: object) { + return request({ + url: '/meter/stateManage/addStateManageInfo', + method: 'post', + data, + }) +} +// 状态管理删除 +export function deleteStatus(data: object) { + return request({ + url: '/meter/stateManage/deleteStateManageList', + method: 'post', + data, + }) +} +// 状态管理详情 +export function detailStatus(data: object) { + return request({ + url: '/meter/stateManage/selectStateManageInfo', + method: 'post', + data, + }) +} diff --git a/src/api/measure/measureDept.ts b/src/api/measure/measureDept.ts index 9a30ce3..3d34a2b 100644 --- a/src/api/measure/measureDept.ts +++ b/src/api/measure/measureDept.ts @@ -43,3 +43,11 @@ data, }) } +// 获取父级组织 +export function getpDeptApi(data: object) { + return request({ + url: '/meter/organize/deptInfo', + method: 'post', + data, + }) +} diff --git a/src/api/system/notice.ts b/src/api/system/notice.ts index 9f38397..90ae2a7 100644 --- a/src/api/system/notice.ts +++ b/src/api/system/notice.ts @@ -8,8 +8,10 @@ export interface listParamsType { noticeNo: string // 编号 noticePublisher: string // 发布人 - noticeTime: string // 发布时间 + noticeTime?: string // 发布时间 noticeTitle: string // 标题 + noticeStartTime: string // 标题 + noticeEndTime: string // 标题 limit: number offset: number } @@ -43,4 +45,29 @@ data, }) } +// 通知公告删除 +export function removeNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/delete`, + method: 'post', + data, + }) +} +// 通知公告编辑 +export function updateNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + }) +} +// 导出通知公告 +export function exportNoticeApi(data: object) { + return request({ + url: `${prefix}/notice/update`, + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/system/plan.ts b/src/api/system/plan.ts index 8b448cd..33b384f 100644 --- a/src/api/system/plan.ts +++ b/src/api/system/plan.ts @@ -82,6 +82,15 @@ }) } +// 培训记录修改 +export function getListLogupdate(data: object) { + return request({ + url: `${prefix}/train/log/update`, + method: 'post', + data, + }) +} + // 培训记录详情 export function getListLogDetail(data: object) { return request({ diff --git a/src/api/system/source.ts b/src/api/system/source.ts index 65c14fe..93f5f12 100644 --- a/src/api/system/source.ts +++ b/src/api/system/source.ts @@ -55,6 +55,7 @@ data, }) } + // 导出详情 export function getSoucreLisListExport(data: object) { return request({ @@ -64,3 +65,12 @@ data, }) } + +// 溯源供方审批接口 +export function getapprovalListPage(data: object) { + return request({ + url: `${prefix}/supplier/approval/listPage?offset=${data.offset}&limit=${data.limit}`, + method: 'post', + data, + }) +} diff --git a/src/api/system/tool.ts b/src/api/system/tool.ts index 1798ce5..7b61c3f 100644 --- a/src/api/system/tool.ts +++ b/src/api/system/tool.ts @@ -72,7 +72,7 @@ templateNo: string // 编号 templateName: string // 名称 templateCreator: string // 负责人 - createTime: string // 创建时间 + // createTime: string // 创建时间 limit: number offset: number templateType: string diff --git a/src/components/Approval/ApprovalDialog.vue b/src/components/Approval/ApprovalDialog.vue new file mode 100644 index 0000000..036ebbd --- /dev/null +++ b/src/components/Approval/ApprovalDialog.vue @@ -0,0 +1,167 @@ + + + + + diff --git a/src/components/DeptSelect/index.vue b/src/components/DeptSelect/index.vue index 2344541..ef7bd91 100644 --- a/src/components/DeptSelect/index.vue +++ b/src/components/DeptSelect/index.vue @@ -174,6 +174,7 @@ check-on-click-node filterable class="full-width-input" + :disabled="props.disabled" /> diff --git a/src/components/SelectTree/index.vue b/src/components/SelectTree/index.vue deleted file mode 100644 index 7c087f8..0000000 --- a/src/components/SelectTree/index.vue +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - diff --git a/src/layouts/components/Tools/index.vue b/src/layouts/components/Tools/index.vue index 93f7084..cd62c8b 100644 --- a/src/layouts/components/Tools/index.vue +++ b/src/layouts/components/Tools/index.vue @@ -1,5 +1,6 @@ diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index c5771f7..53046f0 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -1,9 +1,12 @@ @@ -32,7 +56,7 @@
- + diff --git a/src/views/device/borrow/components/applyList.vue b/src/views/device/borrow/components/applyList.vue index 9520aca..ec43b86 100644 --- a/src/views/device/borrow/components/applyList.vue +++ b/src/views/device/borrow/components/applyList.vue @@ -1,58 +1,126 @@ diff --git a/src/views/device/standardEquipment/components/standardList/baseInfo.vue b/src/views/device/standardEquipment/components/standardList/baseInfo.vue index c47ad1d..c762b33 100644 --- a/src/views/device/standardEquipment/components/standardList/baseInfo.vue +++ b/src/views/device/standardEquipment/components/standardList/baseInfo.vue @@ -154,35 +154,28 @@ standardHumidity: [{ required: true, message: '标准湿度不能为空', trigger: 'blur' }, { pattern: /(^-?\d\d*\.\d*$)|(^-?\d\d*$)|(^-?\.\d\d*$)/, message: '标准湿度只能为数字', trigger: 'blur' }], }) // 表单验证规则 -// 上传请求 -const uploadQuarterlyEvaluateFile = (file: File) => { - const fd = new FormData() - fd.append('multipartFile', file.file) - UploadFile(fd).then((res) => { - if (res.code === 200) { - formInline.value.fileList = res.data - // 重置当前验证 - ElMessage.success('文件上传成功') - } - }) +const fileRef = ref() // 文件上传input +const onFileChange = (event: any) => { + // 原生上传 + console.log(event.target.files) + if (event.target.files?.length !== 0) { + // 创建formdata对象 + const fd = new FormData() + fd.append('multipartFile', event.target.files[0]) + UploadFile(fd).then((res) => { + if (res.code === 200) { + formInline.value.minioFileName = res.data[0] + // 重置当前验证 + ElMessage.success('文件上传成功') + } + else { + ElMessage.error(res.message) + } + }) + } } -const handleExceed: UploadProps['onExceed'] = (files, uploadFiles) => { - ElMessage.warning('只能上传一个文件') -} -// 移除时触发 -const beforeRemove: UploadProps['beforeRemove'] = (uploadFile, uploadFiles) => { - return ElMessageBox.confirm( - `确认移除${uploadFile.name}文件吗 ?`, - ).then( - () => true, - () => false, - - ) -} -// 点击文件预览 -const uploadShow = (e: any) => { - const URL = window.URL || window.webkitURL - window.open(URL.createObjectURL(e.raw)) +const upload = () => { + fileRef.value.click() } const testForm = ref({ fileList: [], @@ -214,7 +207,7 @@ formInline.value.laboratoryOwnerContact = null formInline.value.laboratoryOwner = null } -// 获取详情信息 +// 获取detail信息 const getInfo = () => { getStandardListDetail({ id: props.infoId }).then((res) => { Object.keys(res.data).map((item) => { @@ -225,7 +218,7 @@ formInline.value = res.data }) } -if (props.buttonType !== '') { +if (props.buttonType !== 'add') { getInfo() } watch(() => formInline.value, (newVal) => { @@ -266,7 +259,7 @@ @@ -275,7 +268,7 @@ @@ -284,7 +277,7 @@ @@ -295,7 +288,7 @@ @@ -307,7 +300,7 @@ @@ -318,7 +311,7 @@ clearable placeholder="标准负责人" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -347,7 +340,7 @@ clearable placeholder="类别" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -413,18 +406,18 @@ placeholder="请选择筹建日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> - + - + @@ -451,7 +444,7 @@ @@ -464,7 +457,7 @@ clearable placeholder="管理状态" size="default" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" > @@ -510,7 +503,7 @@ placeholder="请选择考核日期" format="YYYY/MM/DD HH:mm:ss" value-format="YYYY-MM-DD h:m:s" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -522,7 +515,7 @@ v-model.trim="formInline.uncertainty" style="width: 500px;" placeholder="不确定度" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -534,7 +527,7 @@ v-model.trim="formInline.mesureRange" placeholder="测量范围" style="width: 500px;" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> @@ -548,7 +541,7 @@ @@ -557,7 +550,7 @@ @@ -608,26 +601,17 @@
- + @@ -635,7 +619,7 @@ v-model.trim="formInline.remark" style="width: 500px;" placeholder="备注" - :disabled="buttonType === '详情'" + :disabled="buttonType === 'detail'" /> diff --git a/src/views/device/standardEquipment/components/standardListAdd.vue b/src/views/device/standardEquipment/components/standardListAdd.vue index 348bb41..1263b6c 100644 --- a/src/views/device/standardEquipment/components/standardListAdd.vue +++ b/src/views/device/standardEquipment/components/standardListAdd.vue @@ -9,17 +9,23 @@ import { getTypeSelect } from '@/api/system/price' import { getStandardLisUpdate, getStandardListAdd, getStandardListDetail, getUsersDept } from '@/api/device/standard' import { UploadFile } from '@/api/measure/file' -const props = defineProps({ - infoId: { - type: String, - default: '0', - }, - buttonType: { - type: String, - default: '', - }, -}) -const emit = defineEmits(['close']) +const loading = ref(false) // 表单加载状态 +const infoId = ref('') // id +const pageType = ref('add') // 页面类型: add,edit, detail +const buttonLoading = ref(false) // 按钮加载状态 +const textMap: { [key: string]: string } = { + edit: '编辑', + add: '新建', + detail: '详情', +}// 字典 +// 从路由中获取页面类型参数 +const $route = useRoute() +if ($route.params && $route.params.type) { + pageType.value = $route.params.type as string + if ($route.params.id) { + infoId.value = $route.params.id as string + } +} // 定义数据 const formInline = ref({}) // 关闭 @@ -42,17 +48,19 @@ watch(current, (newValue) => { currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) -// 关闭 +// 初始化router +const $router = useRouter() +// 关闭新增页面的回调 const close = () => { - emit('close') + $router.back() } const setData = (newValue: object) => { formInline.value = newValue } // 编辑获取详情的提交按钮 const submitFormDetail = () => { - if (props.buttonType === '编辑') { - formInline.value.id = props.infoId + if (pageType.value === 'edit') { + formInline.value.id = infoId.value getStandardLisUpdate(formInline.value).then((res) => { if (res.code === 200) { close() @@ -73,7 +81,7 @@ } // 提交 const submitForm = () => { - if (props.buttonType === '详情') { return submitFormDetail() } + if (pageType.value === 'detail') { return submitFormDetail() } ElMessageBox.confirm( '确认提交吗?', '提示', @@ -85,7 +93,7 @@ ).then(() => { current.value = '基本信息' currentCompRef.value.submitForm().validate().then(() => { - props.buttonType === '' + pageType.value === 'add' ? getStandardListAdd(formInline.value).then((res) => { if (res.code === 200) { close() @@ -101,15 +109,15 @@

- 测量标准装置 + {{ `测量标准装置-${textMap[pageType]}` }}

- {{ buttonType === '详情' ? '打印' : '提交' }} + {{ pageType === 'detail' ? '打印' : '提交' }} 关闭 @@ -125,7 +133,7 @@ - +
diff --git a/src/views/device/standardEquipment/expirationRemind.vue b/src/views/device/standardEquipment/expirationRemind.vue index 1826c22..94520ba 100644 --- a/src/views/device/standardEquipment/expirationRemind.vue +++ b/src/views/device/standardEquipment/expirationRemind.vue @@ -116,6 +116,8 @@ getSelectList('standardCategory') // 获取类别下拉框 getSelectList('standardManagerState') // 获取管理状态下拉框 +// 初始化路由 +const $router = useRouter() // 获取部门信息 getUsersDept({ createTime: '', @@ -238,12 +240,12 @@ }) }) } -// 点击编辑或详情 -const handleClick = (index: number, row: rowReturn, text: string) => { - infoId.value = row.id - buttonType.value = text - isShow.value = false +// 点击编辑/详情 +const handleEdit = (row: rowReturn) => { + $router.push(`/standard/detail/${row.id}`) } +// 提醒函数 +const warnClick = (row: object) => {} diff --git a/src/views/device/stateManage/components/templateList.vue b/src/views/device/stateManage/components/templateList.vue index 7cc9075..d98c06f 100644 --- a/src/views/device/stateManage/components/templateList.vue +++ b/src/views/device/stateManage/components/templateList.vue @@ -2,7 +2,7 @@