diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index c5e1f79..7fd5f9c 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -54,13 +54,23 @@ }) } // 设备借用申请提交 +// export function submitApply(data: object) { +// return request({ +// url: '/equipmentApply/borrowEquipmentApply', +// method: 'post', +// data, +// }) +// } + +// 状态管理提交 export function submitApply(data: object) { return request({ - url: '/equipmentApply/borrowEquipmentApply', + url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', data, }) } + // 设备借用归还提交 export function returnApply(data: object) { return request({ diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index c5e1f79..7fd5f9c 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -54,13 +54,23 @@ }) } // 设备借用申请提交 +// export function submitApply(data: object) { +// return request({ +// url: '/equipmentApply/borrowEquipmentApply', +// method: 'post', +// data, +// }) +// } + +// 状态管理提交 export function submitApply(data: object) { return request({ - url: '/equipmentApply/borrowEquipmentApply', + url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', data, }) } + // 设备借用归还提交 export function returnApply(data: object) { return request({ diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index e080e57..d1f5b24 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -9,3 +9,4 @@ styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 } + diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index c5e1f79..7fd5f9c 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -54,13 +54,23 @@ }) } // 设备借用申请提交 +// export function submitApply(data: object) { +// return request({ +// url: '/equipmentApply/borrowEquipmentApply', +// method: 'post', +// data, +// }) +// } + +// 状态管理提交 export function submitApply(data: object) { return request({ - url: '/equipmentApply/borrowEquipmentApply', + url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', data, }) } + // 设备借用归还提交 export function returnApply(data: object) { return request({ diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index e080e57..d1f5b24 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -9,3 +9,4 @@ styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 } + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index c0c2553..81c6b47 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -7,12 +7,8 @@ import { useRouter } from 'vue-router' import { SCHEDULE } from '@/utils/scheduleDict' import ButtonBox from '@/components/buttonBox/buttonBox.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { - submitReceiveApplyList, -} from '@/api/device/receive' import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' @@ -23,11 +19,11 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 -const approvalDialog = ref() // 审批对话框显隐 const menu = ref([]) // 审批状态按钮组合 // 筛选时间段数据 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) @@ -62,7 +58,7 @@ // 选中的内容 const checkoutList = ref([]) -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -151,9 +147,20 @@ fetchData(true) } -// 审批结束回调 -const approvalSuccess = () => { - fetchData(true) +// 选择器模糊查询 +const remoteMethod = (query: string) => { + if (query) { + applyPersonLoading.value = true + setTimeout(() => { + applyPersonLoading.value = false + usePersonOptions.value = usePersonList.value.filter((item) => { + return item.name.toLowerCase().includes(query.toLowerCase()) + }) + }, 200) + } + else { + usePersonOptions.value = usePersonList.value + } } // 获取用户列表(增加模糊查询) @@ -257,11 +264,14 @@ // 模板下载 const templateDownload = () => { - } // 标签识别 const identify = () => { +} +// 多选发生改变时 +const handleSelectionChange = (e: any) => { + checkoutList.value = e.map((item: { id: string }) => item.id) } // 借用 @@ -274,7 +284,7 @@ cancelButtonText: '取消', type: 'warning', }, - ).then((res) => { + ).then(() => { submitApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ @@ -311,18 +321,15 @@ const $router = useRouter() -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用处理', - }, - }) +// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 +const changePage = (val: { size?: number; page?: number }) => { + if (val && val.size) { + listQuery.value.limit = val.size + } + if (val && val.page) { + listQuery.value.offset = val.page + } + fetchData(true) } // 详情 @@ -428,9 +435,9 @@ 查看 - + 借用 - + 归还 - + 删除 diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index c5e1f79..7fd5f9c 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -54,13 +54,23 @@ }) } // 设备借用申请提交 +// export function submitApply(data: object) { +// return request({ +// url: '/equipmentApply/borrowEquipmentApply', +// method: 'post', +// data, +// }) +// } + +// 状态管理提交 export function submitApply(data: object) { return request({ - url: '/equipmentApply/borrowEquipmentApply', + url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', data, }) } + // 设备借用归还提交 export function returnApply(data: object) { return request({ diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index e080e57..d1f5b24 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -9,3 +9,4 @@ styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 } + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index c0c2553..81c6b47 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -7,12 +7,8 @@ import { useRouter } from 'vue-router' import { SCHEDULE } from '@/utils/scheduleDict' import ButtonBox from '@/components/buttonBox/buttonBox.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { - submitReceiveApplyList, -} from '@/api/device/receive' import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' @@ -23,11 +19,11 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 -const approvalDialog = ref() // 审批对话框显隐 const menu = ref([]) // 审批状态按钮组合 // 筛选时间段数据 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) @@ -62,7 +58,7 @@ // 选中的内容 const checkoutList = ref([]) -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -151,9 +147,20 @@ fetchData(true) } -// 审批结束回调 -const approvalSuccess = () => { - fetchData(true) +// 选择器模糊查询 +const remoteMethod = (query: string) => { + if (query) { + applyPersonLoading.value = true + setTimeout(() => { + applyPersonLoading.value = false + usePersonOptions.value = usePersonList.value.filter((item) => { + return item.name.toLowerCase().includes(query.toLowerCase()) + }) + }, 200) + } + else { + usePersonOptions.value = usePersonList.value + } } // 获取用户列表(增加模糊查询) @@ -257,11 +264,14 @@ // 模板下载 const templateDownload = () => { - } // 标签识别 const identify = () => { +} +// 多选发生改变时 +const handleSelectionChange = (e: any) => { + checkoutList.value = e.map((item: { id: string }) => item.id) } // 借用 @@ -274,7 +284,7 @@ cancelButtonText: '取消', type: 'warning', }, - ).then((res) => { + ).then(() => { submitApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ @@ -311,18 +321,15 @@ const $router = useRouter() -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用处理', - }, - }) +// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 +const changePage = (val: { size?: number; page?: number }) => { + if (val && val.size) { + listQuery.value.limit = val.size + } + if (val && val.page) { + listQuery.value.offset = val.page + } + fetchData(true) } // 详情 @@ -428,9 +435,9 @@ 查看 - + 借用 - + 归还 - + 删除 diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 89e09ef..aae69c7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -23,6 +23,7 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 @@ -63,7 +64,7 @@ // 选中的内容 const checkoutList = ref([]) // 表格数据 -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -431,16 +432,6 @@ }, }) } - // $router.push({ - // path: `/receive/${title}`, - // query: { - // typeValue: title, - // approvalStatus: approvalStatusReserveMap[row.approvalStatus], - // id: row.id, - // taskId: row.taskId, - // processId: row.processId, - // }, - // }) } } @@ -496,9 +487,9 @@ ([]) // 审批状态按钮组合 // 筛选时间段数据 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) @@ -62,7 +58,7 @@ // 选中的内容 const checkoutList = ref([]) -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -151,9 +147,20 @@ fetchData(true) } -// 审批结束回调 -const approvalSuccess = () => { - fetchData(true) +// 选择器模糊查询 +const remoteMethod = (query: string) => { + if (query) { + applyPersonLoading.value = true + setTimeout(() => { + applyPersonLoading.value = false + usePersonOptions.value = usePersonList.value.filter((item) => { + return item.name.toLowerCase().includes(query.toLowerCase()) + }) + }, 200) + } + else { + usePersonOptions.value = usePersonList.value + } } // 获取用户列表(增加模糊查询) @@ -257,11 +264,14 @@ // 模板下载 const templateDownload = () => { - } // 标签识别 const identify = () => { +} +// 多选发生改变时 +const handleSelectionChange = (e: any) => { + checkoutList.value = e.map((item: { id: string }) => item.id) } // 借用 @@ -274,7 +284,7 @@ cancelButtonText: '取消', type: 'warning', }, - ).then((res) => { + ).then(() => { submitApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ @@ -311,18 +321,15 @@ const $router = useRouter() -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用处理', - }, - }) +// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 +const changePage = (val: { size?: number; page?: number }) => { + if (val && val.size) { + listQuery.value.limit = val.size + } + if (val && val.page) { + listQuery.value.offset = val.page + } + fetchData(true) } // 详情 @@ -428,9 +435,9 @@ 查看 - + 借用 - + 归还 - + 删除 diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 89e09ef..aae69c7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -23,6 +23,7 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 @@ -63,7 +64,7 @@ // 选中的内容 const checkoutList = ref([]) // 表格数据 -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -431,16 +432,6 @@ }, }) } - // $router.push({ - // path: `/receive/${title}`, - // query: { - // typeValue: title, - // approvalStatus: approvalStatusReserveMap[row.approvalStatus], - // id: row.id, - // taskId: row.taskId, - // processId: row.processId, - // }, - // }) } } @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index c5e1f79..7fd5f9c 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -54,13 +54,23 @@ }) } // 设备借用申请提交 +// export function submitApply(data: object) { +// return request({ +// url: '/equipmentApply/borrowEquipmentApply', +// method: 'post', +// data, +// }) +// } + +// 状态管理提交 export function submitApply(data: object) { return request({ - url: '/equipmentApply/borrowEquipmentApply', + url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', data, }) } + // 设备借用归还提交 export function returnApply(data: object) { return request({ diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index e080e57..d1f5b24 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -9,3 +9,4 @@ styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 } + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index c0c2553..81c6b47 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -7,12 +7,8 @@ import { useRouter } from 'vue-router' import { SCHEDULE } from '@/utils/scheduleDict' import ButtonBox from '@/components/buttonBox/buttonBox.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { - submitReceiveApplyList, -} from '@/api/device/receive' import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' @@ -23,11 +19,11 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 -const approvalDialog = ref() // 审批对话框显隐 const menu = ref([]) // 审批状态按钮组合 // 筛选时间段数据 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) @@ -62,7 +58,7 @@ // 选中的内容 const checkoutList = ref([]) -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -151,9 +147,20 @@ fetchData(true) } -// 审批结束回调 -const approvalSuccess = () => { - fetchData(true) +// 选择器模糊查询 +const remoteMethod = (query: string) => { + if (query) { + applyPersonLoading.value = true + setTimeout(() => { + applyPersonLoading.value = false + usePersonOptions.value = usePersonList.value.filter((item) => { + return item.name.toLowerCase().includes(query.toLowerCase()) + }) + }, 200) + } + else { + usePersonOptions.value = usePersonList.value + } } // 获取用户列表(增加模糊查询) @@ -257,11 +264,14 @@ // 模板下载 const templateDownload = () => { - } // 标签识别 const identify = () => { +} +// 多选发生改变时 +const handleSelectionChange = (e: any) => { + checkoutList.value = e.map((item: { id: string }) => item.id) } // 借用 @@ -274,7 +284,7 @@ cancelButtonText: '取消', type: 'warning', }, - ).then((res) => { + ).then(() => { submitApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ @@ -311,18 +321,15 @@ const $router = useRouter() -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用处理', - }, - }) +// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 +const changePage = (val: { size?: number; page?: number }) => { + if (val && val.size) { + listQuery.value.limit = val.size + } + if (val && val.page) { + listQuery.value.offset = val.page + } + fetchData(true) } // 详情 @@ -428,9 +435,9 @@ 查看 - + 借用 - + 归还 - + 删除 diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 89e09ef..aae69c7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -23,6 +23,7 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 @@ -63,7 +64,7 @@ // 选中的内容 const checkoutList = ref([]) // 表格数据 -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -431,16 +432,6 @@ }, }) } - // $router.push({ - // path: `/receive/${title}`, - // query: { - // typeValue: title, - // approvalStatus: approvalStatusReserveMap[row.approvalStatus], - // id: row.id, - // taskId: row.taskId, - // processId: row.processId, - // }, - // }) } } @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index c5e1f79..7fd5f9c 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -54,13 +54,23 @@ }) } // 设备借用申请提交 +// export function submitApply(data: object) { +// return request({ +// url: '/equipmentApply/borrowEquipmentApply', +// method: 'post', +// data, +// }) +// } + +// 状态管理提交 export function submitApply(data: object) { return request({ - url: '/equipmentApply/borrowEquipmentApply', + url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', data, }) } + // 设备借用归还提交 export function returnApply(data: object) { return request({ diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index e080e57..d1f5b24 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -9,3 +9,4 @@ styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 } + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index c0c2553..81c6b47 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -7,12 +7,8 @@ import { useRouter } from 'vue-router' import { SCHEDULE } from '@/utils/scheduleDict' import ButtonBox from '@/components/buttonBox/buttonBox.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { - submitReceiveApplyList, -} from '@/api/device/receive' import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' @@ -23,11 +19,11 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 -const approvalDialog = ref() // 审批对话框显隐 const menu = ref([]) // 审批状态按钮组合 // 筛选时间段数据 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) @@ -62,7 +58,7 @@ // 选中的内容 const checkoutList = ref([]) -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -151,9 +147,20 @@ fetchData(true) } -// 审批结束回调 -const approvalSuccess = () => { - fetchData(true) +// 选择器模糊查询 +const remoteMethod = (query: string) => { + if (query) { + applyPersonLoading.value = true + setTimeout(() => { + applyPersonLoading.value = false + usePersonOptions.value = usePersonList.value.filter((item) => { + return item.name.toLowerCase().includes(query.toLowerCase()) + }) + }, 200) + } + else { + usePersonOptions.value = usePersonList.value + } } // 获取用户列表(增加模糊查询) @@ -257,11 +264,14 @@ // 模板下载 const templateDownload = () => { - } // 标签识别 const identify = () => { +} +// 多选发生改变时 +const handleSelectionChange = (e: any) => { + checkoutList.value = e.map((item: { id: string }) => item.id) } // 借用 @@ -274,7 +284,7 @@ cancelButtonText: '取消', type: 'warning', }, - ).then((res) => { + ).then(() => { submitApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ @@ -311,18 +321,15 @@ const $router = useRouter() -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用处理', - }, - }) +// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 +const changePage = (val: { size?: number; page?: number }) => { + if (val && val.size) { + listQuery.value.limit = val.size + } + if (val && val.page) { + listQuery.value.offset = val.page + } + fetchData(true) } // 详情 @@ -428,9 +435,9 @@ 查看 - + 借用 - + 归还 - + 删除 diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 89e09ef..aae69c7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -23,6 +23,7 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 @@ -63,7 +64,7 @@ // 选中的内容 const checkoutList = ref([]) // 表格数据 -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -431,16 +432,6 @@ }, }) } - // $router.push({ - // path: `/receive/${title}`, - // query: { - // typeValue: title, - // approvalStatus: approvalStatusReserveMap[row.approvalStatus], - // id: row.id, - // taskId: row.taskId, - // processId: row.processId, - // }, - // }) } } @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index c5e1f79..7fd5f9c 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -54,13 +54,23 @@ }) } // 设备借用申请提交 +// export function submitApply(data: object) { +// return request({ +// url: '/equipmentApply/borrowEquipmentApply', +// method: 'post', +// data, +// }) +// } + +// 状态管理提交 export function submitApply(data: object) { return request({ - url: '/equipmentApply/borrowEquipmentApply', + url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', data, }) } + // 设备借用归还提交 export function returnApply(data: object) { return request({ diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index e080e57..d1f5b24 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -9,3 +9,4 @@ styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 } + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index c0c2553..81c6b47 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -7,12 +7,8 @@ import { useRouter } from 'vue-router' import { SCHEDULE } from '@/utils/scheduleDict' import ButtonBox from '@/components/buttonBox/buttonBox.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { - submitReceiveApplyList, -} from '@/api/device/receive' import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' @@ -23,11 +19,11 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 -const approvalDialog = ref() // 审批对话框显隐 const menu = ref([]) // 审批状态按钮组合 // 筛选时间段数据 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) @@ -62,7 +58,7 @@ // 选中的内容 const checkoutList = ref([]) -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -151,9 +147,20 @@ fetchData(true) } -// 审批结束回调 -const approvalSuccess = () => { - fetchData(true) +// 选择器模糊查询 +const remoteMethod = (query: string) => { + if (query) { + applyPersonLoading.value = true + setTimeout(() => { + applyPersonLoading.value = false + usePersonOptions.value = usePersonList.value.filter((item) => { + return item.name.toLowerCase().includes(query.toLowerCase()) + }) + }, 200) + } + else { + usePersonOptions.value = usePersonList.value + } } // 获取用户列表(增加模糊查询) @@ -257,11 +264,14 @@ // 模板下载 const templateDownload = () => { - } // 标签识别 const identify = () => { +} +// 多选发生改变时 +const handleSelectionChange = (e: any) => { + checkoutList.value = e.map((item: { id: string }) => item.id) } // 借用 @@ -274,7 +284,7 @@ cancelButtonText: '取消', type: 'warning', }, - ).then((res) => { + ).then(() => { submitApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ @@ -311,18 +321,15 @@ const $router = useRouter() -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用处理', - }, - }) +// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 +const changePage = (val: { size?: number; page?: number }) => { + if (val && val.size) { + listQuery.value.limit = val.size + } + if (val && val.page) { + listQuery.value.offset = val.page + } + fetchData(true) } // 详情 @@ -428,9 +435,9 @@ 查看 - + 借用 - + 归还 - + 删除 diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 89e09ef..aae69c7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -23,6 +23,7 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 @@ -63,7 +64,7 @@ // 选中的内容 const checkoutList = ref([]) // 表格数据 -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -431,16 +432,6 @@ }, }) } - // $router.push({ - // path: `/receive/${title}`, - // query: { - // typeValue: title, - // approvalStatus: approvalStatusReserveMap[row.approvalStatus], - // id: row.id, - // taskId: row.taskId, - // processId: row.processId, - // }, - // }) } } @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index c5e1f79..7fd5f9c 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -54,13 +54,23 @@ }) } // 设备借用申请提交 +// export function submitApply(data: object) { +// return request({ +// url: '/equipmentApply/borrowEquipmentApply', +// method: 'post', +// data, +// }) +// } + +// 状态管理提交 export function submitApply(data: object) { return request({ - url: '/equipmentApply/borrowEquipmentApply', + url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', data, }) } + // 设备借用归还提交 export function returnApply(data: object) { return request({ diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index e080e57..d1f5b24 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -9,3 +9,4 @@ styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 } + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index c0c2553..81c6b47 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -7,12 +7,8 @@ import { useRouter } from 'vue-router' import { SCHEDULE } from '@/utils/scheduleDict' import ButtonBox from '@/components/buttonBox/buttonBox.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { - submitReceiveApplyList, -} from '@/api/device/receive' import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' @@ -23,11 +19,11 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 -const approvalDialog = ref() // 审批对话框显隐 const menu = ref([]) // 审批状态按钮组合 // 筛选时间段数据 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) @@ -62,7 +58,7 @@ // 选中的内容 const checkoutList = ref([]) -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -151,9 +147,20 @@ fetchData(true) } -// 审批结束回调 -const approvalSuccess = () => { - fetchData(true) +// 选择器模糊查询 +const remoteMethod = (query: string) => { + if (query) { + applyPersonLoading.value = true + setTimeout(() => { + applyPersonLoading.value = false + usePersonOptions.value = usePersonList.value.filter((item) => { + return item.name.toLowerCase().includes(query.toLowerCase()) + }) + }, 200) + } + else { + usePersonOptions.value = usePersonList.value + } } // 获取用户列表(增加模糊查询) @@ -257,11 +264,14 @@ // 模板下载 const templateDownload = () => { - } // 标签识别 const identify = () => { +} +// 多选发生改变时 +const handleSelectionChange = (e: any) => { + checkoutList.value = e.map((item: { id: string }) => item.id) } // 借用 @@ -274,7 +284,7 @@ cancelButtonText: '取消', type: 'warning', }, - ).then((res) => { + ).then(() => { submitApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ @@ -311,18 +321,15 @@ const $router = useRouter() -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用处理', - }, - }) +// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 +const changePage = (val: { size?: number; page?: number }) => { + if (val && val.size) { + listQuery.value.limit = val.size + } + if (val && val.page) { + listQuery.value.offset = val.page + } + fetchData(true) } // 详情 @@ -428,9 +435,9 @@ 查看 - + 借用 - + 归还 - + 删除 diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 89e09ef..aae69c7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -23,6 +23,7 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 @@ -63,7 +64,7 @@ // 选中的内容 const checkoutList = ref([]) // 表格数据 -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -431,16 +432,6 @@ }, }) } - // $router.push({ - // path: `/receive/${title}`, - // query: { - // typeValue: title, - // approvalStatus: approvalStatusReserveMap[row.approvalStatus], - // id: row.id, - // taskId: row.taskId, - // processId: row.processId, - // }, - // }) } } @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index 6f258bc..caa43b1 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -4,11 +4,11 @@ applyNo: string // 申请编号 applyStatus: string // 申请状态 applyUnit: string // 申请单位 - approvalStatus: number // 审批状态 + approvalStatus: string // 审批状态 createUser: string // 创建人 equipmentName: string // 设备名称 equipmentNo: string // 设备编号 - ids: [] // 选中设备数据 + ids?: [] // 选中设备数据 limit: number offset: number applyType: string // 申请类型 @@ -51,6 +51,13 @@ processInstanceId?: string } +// 人员下拉列表 +export interface managerStateItem { + value: string // 值 + name: string // lable + id: string +} + export interface IdeviceList { id?: string equipmentName: string // 仪器名称 @@ -62,6 +69,9 @@ usePersonName: string // 使用人 managerStateName: string // 管理状态 validDate: string // 有效日期 + equipmentSpecifications?: string | undefined + manufacturingNo?: string | undefined + manufacturer?: string | undefined } export interface IdeviceListQuery { @@ -76,3 +86,8 @@ offset: number limit: number } + +// 目录数组 +export interface EquipmentListRow { + equipmentId: string +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 2a74cb2..36d9981 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,5 +7,6 @@ "css", "scss", "vue" - ] + ], + "editor.inlayHints.enabled": "off" } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index c5e1f79..7fd5f9c 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -54,13 +54,23 @@ }) } // 设备借用申请提交 +// export function submitApply(data: object) { +// return request({ +// url: '/equipmentApply/borrowEquipmentApply', +// method: 'post', +// data, +// }) +// } + +// 状态管理提交 export function submitApply(data: object) { return request({ - url: '/equipmentApply/borrowEquipmentApply', + url: '/meter/stateManage/submitStandardEquipmentApply', method: 'post', data, }) } + // 设备借用归还提交 export function returnApply(data: object) { return request({ diff --git a/src/components/NormalTable/table_interface.ts b/src/components/NormalTable/table_interface.ts index e080e57..d1f5b24 100644 --- a/src/components/NormalTable/table_interface.ts +++ b/src/components/NormalTable/table_interface.ts @@ -9,3 +9,4 @@ styleFilter?: Function // 文字过滤器 fixed?: boolean // 固定列 } + diff --git a/src/views/device/borrow/borrowHandle.vue b/src/views/device/borrow/borrowHandle.vue index c0c2553..81c6b47 100644 --- a/src/views/device/borrow/borrowHandle.vue +++ b/src/views/device/borrow/borrowHandle.vue @@ -7,12 +7,8 @@ import { useRouter } from 'vue-router' import { SCHEDULE } from '@/utils/scheduleDict' import ButtonBox from '@/components/buttonBox/buttonBox.vue' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' import type { IMenu } from '@/components/buttonBox/buttonBox' import type { IlistQuery, IlistType, dictType } from '@/views/device/receive/receive' -import { - submitReceiveApplyList, -} from '@/api/device/receive' import { deleteApply, exportApply, getApplyList, returnApply, submitApply } from '@/api/device/borrow' import { getDictByCode } from '@/api/system/dict' @@ -23,11 +19,11 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 -const approvalDialog = ref() // 审批对话框显隐 const menu = ref([]) // 审批状态按钮组合 // 筛选时间段数据 const timeRange = ref<[DateModelType, DateModelType]>(['', '']) @@ -62,7 +58,7 @@ // 选中的内容 const checkoutList = ref([]) -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -151,9 +147,20 @@ fetchData(true) } -// 审批结束回调 -const approvalSuccess = () => { - fetchData(true) +// 选择器模糊查询 +const remoteMethod = (query: string) => { + if (query) { + applyPersonLoading.value = true + setTimeout(() => { + applyPersonLoading.value = false + usePersonOptions.value = usePersonList.value.filter((item) => { + return item.name.toLowerCase().includes(query.toLowerCase()) + }) + }, 200) + } + else { + usePersonOptions.value = usePersonList.value + } } // 获取用户列表(增加模糊查询) @@ -257,11 +264,14 @@ // 模板下载 const templateDownload = () => { - } // 标签识别 const identify = () => { +} +// 多选发生改变时 +const handleSelectionChange = (e: any) => { + checkoutList.value = e.map((item: { id: string }) => item.id) } // 借用 @@ -274,7 +284,7 @@ cancelButtonText: '取消', type: 'warning', }, - ).then((res) => { + ).then(() => { submitApply({ id: row.id as string }).then((res) => { if (res.code === 200) { ElMessage({ @@ -311,18 +321,15 @@ const $router = useRouter() -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用处理', - }, - }) +// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 +const changePage = (val: { size?: number; page?: number }) => { + if (val && val.size) { + listQuery.value.limit = val.size + } + if (val && val.page) { + listQuery.value.offset = val.page + } + fetchData(true) } // 详情 @@ -428,9 +435,9 @@ 查看 - + 借用 - + 归还 - + 删除 diff --git a/src/views/device/borrow/borrwoApply.vue b/src/views/device/borrow/borrwoApply.vue index 89e09ef..aae69c7 100644 --- a/src/views/device/borrow/borrwoApply.vue +++ b/src/views/device/borrow/borrwoApply.vue @@ -23,6 +23,7 @@ import { getDeptTreeList } from '@/api/system/dept' import { exportFile } from '@/utils/exportUtils' import { printJSON } from '@/utils/printUtils' +import type { TableColumn } from '@/components/NormalTable/table_interface' const { proxy } = getCurrentInstance() as any const active = ref('') // 选中的按钮 const activeTitle = ref('') // active对应的审批状态名字 @@ -63,7 +64,7 @@ // 选中的内容 const checkoutList = ref([]) // 表格数据 -const columns = ref([ +const columns = ref([ { text: '申请编号', value: 'applyNo', @@ -431,16 +432,6 @@ }, }) } - // $router.push({ - // path: `/receive/${title}`, - // query: { - // typeValue: title, - // approvalStatus: approvalStatusReserveMap[row.approvalStatus], - // id: row.id, - // taskId: row.taskId, - // processId: row.processId, - // }, - // }) } } @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index 6f258bc..caa43b1 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -4,11 +4,11 @@ applyNo: string // 申请编号 applyStatus: string // 申请状态 applyUnit: string // 申请单位 - approvalStatus: number // 审批状态 + approvalStatus: string // 审批状态 createUser: string // 创建人 equipmentName: string // 设备名称 equipmentNo: string // 设备编号 - ids: [] // 选中设备数据 + ids?: [] // 选中设备数据 limit: number offset: number applyType: string // 申请类型 @@ -51,6 +51,13 @@ processInstanceId?: string } +// 人员下拉列表 +export interface managerStateItem { + value: string // 值 + name: string // lable + id: string +} + export interface IdeviceList { id?: string equipmentName: string // 仪器名称 @@ -62,6 +69,9 @@ usePersonName: string // 使用人 managerStateName: string // 管理状态 validDate: string // 有效日期 + equipmentSpecifications?: string | undefined + manufacturingNo?: string | undefined + manufacturer?: string | undefined } export interface IdeviceListQuery { @@ -76,3 +86,8 @@ offset: number limit: number } + +// 目录数组 +export interface EquipmentListRow { + equipmentId: string +} diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 2253668..94caf8d 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -2,7 +2,7 @@ @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index 6f258bc..caa43b1 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -4,11 +4,11 @@ applyNo: string // 申请编号 applyStatus: string // 申请状态 applyUnit: string // 申请单位 - approvalStatus: number // 审批状态 + approvalStatus: string // 审批状态 createUser: string // 创建人 equipmentName: string // 设备名称 equipmentNo: string // 设备编号 - ids: [] // 选中设备数据 + ids?: [] // 选中设备数据 limit: number offset: number applyType: string // 申请类型 @@ -51,6 +51,13 @@ processInstanceId?: string } +// 人员下拉列表 +export interface managerStateItem { + value: string // 值 + name: string // lable + id: string +} + export interface IdeviceList { id?: string equipmentName: string // 仪器名称 @@ -62,6 +69,9 @@ usePersonName: string // 使用人 managerStateName: string // 管理状态 validDate: string // 有效日期 + equipmentSpecifications?: string | undefined + manufacturingNo?: string | undefined + manufacturer?: string | undefined } export interface IdeviceListQuery { @@ -76,3 +86,8 @@ offset: number limit: number } + +// 目录数组 +export interface EquipmentListRow { + equipmentId: string +} diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 2253668..94caf8d 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -2,7 +2,7 @@ @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index 6f258bc..caa43b1 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -4,11 +4,11 @@ applyNo: string // 申请编号 applyStatus: string // 申请状态 applyUnit: string // 申请单位 - approvalStatus: number // 审批状态 + approvalStatus: string // 审批状态 createUser: string // 创建人 equipmentName: string // 设备名称 equipmentNo: string // 设备编号 - ids: [] // 选中设备数据 + ids?: [] // 选中设备数据 limit: number offset: number applyType: string // 申请类型 @@ -51,6 +51,13 @@ processInstanceId?: string } +// 人员下拉列表 +export interface managerStateItem { + value: string // 值 + name: string // lable + id: string +} + export interface IdeviceList { id?: string equipmentName: string // 仪器名称 @@ -62,6 +69,9 @@ usePersonName: string // 使用人 managerStateName: string // 管理状态 validDate: string // 有效日期 + equipmentSpecifications?: string | undefined + manufacturingNo?: string | undefined + manufacturer?: string | undefined } export interface IdeviceListQuery { @@ -76,3 +86,8 @@ offset: number limit: number } + +// 目录数组 +export interface EquipmentListRow { + equipmentId: string +} diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 2253668..94caf8d 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -2,7 +2,7 @@ @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index 6f258bc..caa43b1 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -4,11 +4,11 @@ applyNo: string // 申请编号 applyStatus: string // 申请状态 applyUnit: string // 申请单位 - approvalStatus: number // 审批状态 + approvalStatus: string // 审批状态 createUser: string // 创建人 equipmentName: string // 设备名称 equipmentNo: string // 设备编号 - ids: [] // 选中设备数据 + ids?: [] // 选中设备数据 limit: number offset: number applyType: string // 申请类型 @@ -51,6 +51,13 @@ processInstanceId?: string } +// 人员下拉列表 +export interface managerStateItem { + value: string // 值 + name: string // lable + id: string +} + export interface IdeviceList { id?: string equipmentName: string // 仪器名称 @@ -62,6 +69,9 @@ usePersonName: string // 使用人 managerStateName: string // 管理状态 validDate: string // 有效日期 + equipmentSpecifications?: string | undefined + manufacturingNo?: string | undefined + manufacturer?: string | undefined } export interface IdeviceListQuery { @@ -76,3 +86,8 @@ offset: number limit: number } + +// 目录数组 +export interface EquipmentListRow { + equipmentId: string +} diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 2253668..94caf8d 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -2,7 +2,7 @@ @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index 6f258bc..caa43b1 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -4,11 +4,11 @@ applyNo: string // 申请编号 applyStatus: string // 申请状态 applyUnit: string // 申请单位 - approvalStatus: number // 审批状态 + approvalStatus: string // 审批状态 createUser: string // 创建人 equipmentName: string // 设备名称 equipmentNo: string // 设备编号 - ids: [] // 选中设备数据 + ids?: [] // 选中设备数据 limit: number offset: number applyType: string // 申请类型 @@ -51,6 +51,13 @@ processInstanceId?: string } +// 人员下拉列表 +export interface managerStateItem { + value: string // 值 + name: string // lable + id: string +} + export interface IdeviceList { id?: string equipmentName: string // 仪器名称 @@ -62,6 +69,9 @@ usePersonName: string // 使用人 managerStateName: string // 管理状态 validDate: string // 有效日期 + equipmentSpecifications?: string | undefined + manufacturingNo?: string | undefined + manufacturer?: string | undefined } export interface IdeviceListQuery { @@ -76,3 +86,8 @@ offset: number limit: number } + +// 目录数组 +export interface EquipmentListRow { + equipmentId: string +} diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 2253668..94caf8d 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -2,7 +2,7 @@ @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index 6f258bc..caa43b1 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -4,11 +4,11 @@ applyNo: string // 申请编号 applyStatus: string // 申请状态 applyUnit: string // 申请单位 - approvalStatus: number // 审批状态 + approvalStatus: string // 审批状态 createUser: string // 创建人 equipmentName: string // 设备名称 equipmentNo: string // 设备编号 - ids: [] // 选中设备数据 + ids?: [] // 选中设备数据 limit: number offset: number applyType: string // 申请类型 @@ -51,6 +51,13 @@ processInstanceId?: string } +// 人员下拉列表 +export interface managerStateItem { + value: string // 值 + name: string // lable + id: string +} + export interface IdeviceList { id?: string equipmentName: string // 仪器名称 @@ -62,6 +69,9 @@ usePersonName: string // 使用人 managerStateName: string // 管理状态 validDate: string // 有效日期 + equipmentSpecifications?: string | undefined + manufacturingNo?: string | undefined + manufacturer?: string | undefined } export interface IdeviceListQuery { @@ -76,3 +86,8 @@ offset: number limit: number } + +// 目录数组 +export interface EquipmentListRow { + equipmentId: string +} diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 2253668..94caf8d 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -2,7 +2,7 @@ @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index 6f258bc..caa43b1 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -4,11 +4,11 @@ applyNo: string // 申请编号 applyStatus: string // 申请状态 applyUnit: string // 申请单位 - approvalStatus: number // 审批状态 + approvalStatus: string // 审批状态 createUser: string // 创建人 equipmentName: string // 设备名称 equipmentNo: string // 设备编号 - ids: [] // 选中设备数据 + ids?: [] // 选中设备数据 limit: number offset: number applyType: string // 申请类型 @@ -51,6 +51,13 @@ processInstanceId?: string } +// 人员下拉列表 +export interface managerStateItem { + value: string // 值 + name: string // lable + id: string +} + export interface IdeviceList { id?: string equipmentName: string // 仪器名称 @@ -62,6 +69,9 @@ usePersonName: string // 使用人 managerStateName: string // 管理状态 validDate: string // 有效日期 + equipmentSpecifications?: string | undefined + manufacturingNo?: string | undefined + manufacturer?: string | undefined } export interface IdeviceListQuery { @@ -76,3 +86,8 @@ offset: number limit: number } + +// 目录数组 +export interface EquipmentListRow { + equipmentId: string +} diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 2253668..94caf8d 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -2,7 +2,7 @@ @@ -496,9 +487,9 @@ -import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' -import type { borrowDeviceType } from '../borrow' -import ApprovalDialog from '@/components/Approval/ApprovalDialog.vue' -import { cancelApproval, deleteApply, exportApply, getApplyList, submitApply } from '@/api/device/borrow' -import { - submitReceiveApplyList, -} from '@/api/device/receive' -import type{ searchType } from '@/views/device/borrow/borrow' -import { printJSON } from '@/utils/printUtils' -import { exportFile } from '@/utils/exportUtils' -import { getDeptTreeList } from '@/api/system/dept' -import { toTreeList } from '@/utils/structure' -import { SCHEDULE } from '@/utils/scheduleDict' -const props = defineProps({ - type: { - type: String, - required: true, - }, - applyType: { - type: String, - required: true, - }, -}) -const approvalDialog = ref() // 审批对话框显隐 -const { proxy } = getCurrentInstance() as any -const $router = useRouter() -const time = ref() -const list = ref([]) // 表格数据 -const searchQuery = reactive({ - applyName: '', // 申请名称 - applyNo: '', // 申请编号 - applyPerson: '', // 申请人 - applyUnit: '', // 申请单位 - approvalStatus: '0', // 审批状态 - createUser: '', // 创建人 - processResult: '', // 处置结果 - applyType: props.applyType, - startTime: '', // 开始时间 - endTime: '', // 结束时间 - ids: [] as string[], - limit: 20, - offset: 1, - formId: SCHEDULE.DEVICE_BORROW_APPROVAL, -}) // 查询参数 -const loadingTable = ref(false) // 表格loading -const total = ref(0) // 数据总条数 -// 全部状态的表格数据 -const columns1 = ref([ - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '文件号', - value: 'fileNo', - align: 'center', - }, - { - text: '类别', - value: 'catergory', - align: 'center', - }, - { - text: '创建人', - value: 'createUser', - align: 'center', - }, - { - text: '创建时间', - value: 'createTime', - width: '200', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -// 其他状态的表格数据 -const columns2 = ref([ - { - text: '申请编号', - value: 'applyNo', - align: 'center', - }, - { - text: '申请名称', - value: 'applyName', - align: 'center', - }, - { - text: '申请部门', - value: 'applyUnitName', - align: 'center', - }, - { - text: '申请人', - value: 'applyPersonName', - align: 'center', - }, - { - text: '申请时间', - value: 'time', - align: 'center', - }, - { - text: '审批状态', - value: 'approvalStatusName', - align: 'center', - }, -]) -const columns = computed(() => { - // if (props.type !== '0') { - // return columns2.value - // } - // else { - // return columns1.value - // } - return columns2.value -}) -const printObj = ref({ - id: 'print', // 需要打印元素的id - popTitle: '固定资产', // 打印配置页上方的标题 - extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 - preview: false, // 是否启动预览模式,默认是false - previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback - previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback - beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback - openCallback() { console.log('执行打印了!') }, // 调用打印时的callback - closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) - clickMounted() { console.log('点击v-print绑定的按钮了!') }, - // url: 'http://localhost:8080/', // 打印指定的URL,确保同源策略相同 - // asyncUrl (reslove) { - // setTimeout(() => { - // reslove('http://localhost:8080/') - // }, 2000) - // }, - standard: '', - extarCss: '', -}) -// 获取数据列表 -const getList = () => { - loadingTable.value = true - getApplyList(searchQuery).then((res) => { - if (res.code === 200) { - list.value = res.data.rows - total.value = res.data.total - } - loadingTable.value = false - }).catch((_) => { - loadingTable.value = false - }) -} -// 页数发生变化后的操作,可能是页码变化,可能是每页容量变化,此函数必写 -const changePage = (val: { size?: number; page?: number }) => { - if (val && val.size) { - searchQuery.limit = val.size - } - if (val && val.page) { - searchQuery.offset = val.page - } - getList() -} -// 详情 -const detail = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'detail', - }, - query: { - id: row.id, - title: '详情', - name: '设备借用申请', - approvalStatus: props.type, - approvalStatusName: row.approvalStatusName, - }, - }) -} -// 编辑 -const update = (row: borrowDeviceType) => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'edit', - }, - query: { - id: row.id, - title: '编辑', - name: '设备借用申请', - }, - }) -} -// 删除 -const remove = (row: borrowDeviceType) => { - ElMessageBox.confirm( - `确认删除${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ) - .then(() => { - deleteApply({ id: row.id as string }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '删除成功', - }) - getList() - } - }) - }) -} -// 搜索 -const search = () => { - searchQuery.startTime = time.value[0] as string || '' - searchQuery.endTime = time.value[1] as string || '' - getList() -} -// 重置 -const reset = () => { - searchQuery.applyName = '' - searchQuery.applyNo = '' - searchQuery.applyPerson = '' - searchQuery.applyUnit = '' - searchQuery.startTime = '' - searchQuery.endTime = '' - time.value = ['', ''] - getList() -} -// 新增 -const addBtn = () => { - $router.push({ - name: 'stateManageDetail', - params: { - type: 'add', - }, - query: { - title: '新建', - name: '设备借用申请', - applyType: props.applyType, - }, - }) -} -// 表格被选中的行 -const selectList = ref([]) -// 表格多选 -const multiSelect = (row: borrowDeviceType[]) => { - selectList.value = row -} -// 导出 -const exportExcelBtn = () => { - const loading = ElLoading.service({ - lock: true, - text: 'Loading', - background: 'rgba(255, 255, 255, 0.8)', - }) - searchQuery.ids = [] - if (selectList.value.length) { - selectList.value.forEach((item) => { - searchQuery.ids?.push(item.id as string) - }) - } - exportApply({ ...searchQuery, limit: undefined, offset: undefined }).then((res) => { - exportFile(res.data, '设备借用申请') - loading.close() - }).catch((_) => { - loading.close() - }) -} -// 打印 -function printList() { - const selectIds = selectList.value.map(item => item.id) - const properties = columns.value.map((item) => { - return { - field: item.value, - displayName: item.text, - } - }) - if (selectIds.length <= 0 && list.value.length > 0) { - printJSON(list.value, properties, '设备借用申请') - } - else if (selectIds.length > 0) { - const printList = list.value.filter(item => selectIds.includes(item.id)) - printJSON(printList, properties, '设备借用申请') - } - else { - ElMessage('无可打印内容') - } -} - -// 审批结束回调 -const approvalSuccess = () => { - close() - getList() -} -// 同意 -// 驳回 -// 拒绝 -const handleClick = (val: string, taskId: string) => { - if (val === 'agree') { // 同意 - approvalDialog.value.initDialog('agree', taskId) - } - else if (val === 'reject') { // 驳回 - approvalDialog.value.initDialog('reject', taskId) - } - else if (val === 'refuse') { // 拒绝 - approvalDialog.value.initDialog('refuse', taskId) - } -} - -// 取消 -const cancel = (row: any) => { - ElMessageBox.confirm( - `确认取消${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - cancelApproval({ processInstanceId: row.processId, comments: '' }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '取消成功', - }) - getList() - } - }) - }) -} -// 提交 -const submit = (row: any) => { - ElMessageBox.confirm( - `确认提交${row.applyName}吗?`, - '提示', - { - confirmButtonText: '确认', - cancelButtonText: '取消', - type: 'warning', - }, - ).then((res) => { - submitReceiveApplyList({ formId: SCHEDULE.DEVICE_BORROW_APPROVAL, id: row.id }).then((res) => { - if (res.code === 200) { - ElMessage({ - type: 'success', - message: '提交成功', - }) - getList() - } - }) - }) -} -const useDeptList = ref([]) -onMounted(() => { - getList() - // 获取使用部门 - getDeptTreeList().then((res) => { - if (res.data) { // 将列表转树结构 - useDeptList.value = toTreeList(res.data, '0', true) - } - }) -}) -watch(() => props.type, (newValue) => { - if (newValue === '0') { - searchQuery.approvalStatus = '' - } - else { - searchQuery.approvalStatus = newValue - } - getList() -}, { - immediate: true, - deep: true, -}) -// watch(() => searchQuery.time, (newVal) => { -// console.log(newVal, 'time') -// }) - - - - - diff --git a/src/views/device/borrow/components/approvalActionDialog.vue b/src/views/device/borrow/components/approvalActionDialog.vue index 214876c..9375861 100644 --- a/src/views/device/borrow/components/approvalActionDialog.vue +++ b/src/views/device/borrow/components/approvalActionDialog.vue @@ -8,6 +8,11 @@ const dialogVisibleApprove = ref(false) const form = reactive({ radio: '1', + certificateNo: '', + certificateName: '', + certificateCompany: '', + certificateDate: '', + validDate: '', }) const ruleFormRef = ref() const rules = reactive({ diff --git a/src/views/device/borrow/components/handleList.vue b/src/views/device/borrow/components/handleList.vue deleted file mode 100644 index bf1d19c..0000000 --- a/src/views/device/borrow/components/handleList.vue +++ /dev/null @@ -1,392 +0,0 @@ - - - - - diff --git a/src/views/device/borrow/editHandle.vue b/src/views/device/borrow/editHandle.vue index 8a92582..d2e423c 100644 --- a/src/views/device/borrow/editHandle.vue +++ b/src/views/device/borrow/editHandle.vue @@ -4,7 +4,7 @@ import { ElLoading } from 'element-plus' import type { Ref } from 'vue' import dayjs from 'dayjs' -import type { IdeviceList, IdeviceListQuery } from '../borrow' +import type { IdeviceList, IdeviceListQuery } from './borrow' import type { TableColumn } from '@/components/NormalTable/table_interface' import { getReceiveApplyListDetail } from '@/api/device/receive' import type { userType } from '@/views/system/user/user-interface' diff --git a/src/views/device/stateManage/components/status-interface.ts b/src/views/device/stateManage/components/status-interface.ts index 6f258bc..caa43b1 100644 --- a/src/views/device/stateManage/components/status-interface.ts +++ b/src/views/device/stateManage/components/status-interface.ts @@ -4,11 +4,11 @@ applyNo: string // 申请编号 applyStatus: string // 申请状态 applyUnit: string // 申请单位 - approvalStatus: number // 审批状态 + approvalStatus: string // 审批状态 createUser: string // 创建人 equipmentName: string // 设备名称 equipmentNo: string // 设备编号 - ids: [] // 选中设备数据 + ids?: [] // 选中设备数据 limit: number offset: number applyType: string // 申请类型 @@ -51,6 +51,13 @@ processInstanceId?: string } +// 人员下拉列表 +export interface managerStateItem { + value: string // 值 + name: string // lable + id: string +} + export interface IdeviceList { id?: string equipmentName: string // 仪器名称 @@ -62,6 +69,9 @@ usePersonName: string // 使用人 managerStateName: string // 管理状态 validDate: string // 有效日期 + equipmentSpecifications?: string | undefined + manufacturingNo?: string | undefined + manufacturer?: string | undefined } export interface IdeviceListQuery { @@ -76,3 +86,8 @@ offset: number limit: number } + +// 目录数组 +export interface EquipmentListRow { + equipmentId: string +} diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index 2253668..94caf8d 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -2,7 +2,7 @@