diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index dbce999..5bd4111 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -45,6 +45,15 @@ data, }) } + +// 设备借用驳回后编辑 +export function failUpdate(data: object) { + return request({ + url: '/equipmentApply/failUpdate', + method: 'post', + data, + }) +} // 设备借用申请删除 export function deleteApply(data: object) { return request({ diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index dbce999..5bd4111 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -45,6 +45,15 @@ data, }) } + +// 设备借用驳回后编辑 +export function failUpdate(data: object) { + return request({ + url: '/equipmentApply/failUpdate', + method: 'post', + data, + }) +} // 设备借用申请删除 export function deleteApply(data: object) { return request({ diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 9049282..7f9431b 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,6 +1,6 @@ // 状态管理相关接口api import request from '../index' -import type { ISearchQuery, ITableRow, Iapprove } from '@/views/device/stateManage/components/status-interface.ts' +import type { ISearchQuery, Iapprove } from '@/views/device/stateManage/components/status-interface' // 设备申请列表 export function getStatusList(data: ISearchQuery) { @@ -11,7 +11,7 @@ }) } // 状态管理新建 -export function addStatus(data: ITableRow) { +export function addStatus(data: Object) { return request({ url: '/meter/stateManage/addStateManageInfo', method: 'post', @@ -20,7 +20,7 @@ } // 状态管理编辑 -export function updateStatus(data: ITableRow) { +export function updateStatus(data: Object) { return request({ url: '/meter/stateManage/updateStateManageInfo', method: 'post', @@ -53,7 +53,7 @@ }) } // 状态管理详情 -export function detailStatus(data: ITableRow) { +export function detailStatus(data: object) { return request({ url: '/meter/stateManage/selectStateManageInfo', method: 'post', diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index dbce999..5bd4111 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -45,6 +45,15 @@ data, }) } + +// 设备借用驳回后编辑 +export function failUpdate(data: object) { + return request({ + url: '/equipmentApply/failUpdate', + method: 'post', + data, + }) +} // 设备借用申请删除 export function deleteApply(data: object) { return request({ diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 9049282..7f9431b 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,6 +1,6 @@ // 状态管理相关接口api import request from '../index' -import type { ISearchQuery, ITableRow, Iapprove } from '@/views/device/stateManage/components/status-interface.ts' +import type { ISearchQuery, Iapprove } from '@/views/device/stateManage/components/status-interface' // 设备申请列表 export function getStatusList(data: ISearchQuery) { @@ -11,7 +11,7 @@ }) } // 状态管理新建 -export function addStatus(data: ITableRow) { +export function addStatus(data: Object) { return request({ url: '/meter/stateManage/addStateManageInfo', method: 'post', @@ -20,7 +20,7 @@ } // 状态管理编辑 -export function updateStatus(data: ITableRow) { +export function updateStatus(data: Object) { return request({ url: '/meter/stateManage/updateStateManageInfo', method: 'post', @@ -53,7 +53,7 @@ }) } // 状态管理详情 -export function detailStatus(data: ITableRow) { +export function detailStatus(data: object) { return request({ url: '/meter/stateManage/selectStateManageInfo', method: 'post', diff --git a/src/components/SearchArea/SearchItem.vue b/src/components/SearchArea/SearchItem.vue index 3adef93..dc53b08 100644 --- a/src/components/SearchArea/SearchItem.vue +++ b/src/components/SearchArea/SearchItem.vue @@ -23,7 +23,6 @@ display: inline-block; margin-bottom: 10px; vertical-align: top; - box-sizing: inherit; margin-right: 5px; } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index dbce999..5bd4111 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -45,6 +45,15 @@ data, }) } + +// 设备借用驳回后编辑 +export function failUpdate(data: object) { + return request({ + url: '/equipmentApply/failUpdate', + method: 'post', + data, + }) +} // 设备借用申请删除 export function deleteApply(data: object) { return request({ diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 9049282..7f9431b 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,6 +1,6 @@ // 状态管理相关接口api import request from '../index' -import type { ISearchQuery, ITableRow, Iapprove } from '@/views/device/stateManage/components/status-interface.ts' +import type { ISearchQuery, Iapprove } from '@/views/device/stateManage/components/status-interface' // 设备申请列表 export function getStatusList(data: ISearchQuery) { @@ -11,7 +11,7 @@ }) } // 状态管理新建 -export function addStatus(data: ITableRow) { +export function addStatus(data: Object) { return request({ url: '/meter/stateManage/addStateManageInfo', method: 'post', @@ -20,7 +20,7 @@ } // 状态管理编辑 -export function updateStatus(data: ITableRow) { +export function updateStatus(data: Object) { return request({ url: '/meter/stateManage/updateStateManageInfo', method: 'post', @@ -53,7 +53,7 @@ }) } // 状态管理详情 -export function detailStatus(data: ITableRow) { +export function detailStatus(data: object) { return request({ url: '/meter/stateManage/selectStateManageInfo', method: 'post', diff --git a/src/components/SearchArea/SearchItem.vue b/src/components/SearchArea/SearchItem.vue index 3adef93..dc53b08 100644 --- a/src/components/SearchArea/SearchItem.vue +++ b/src/components/SearchArea/SearchItem.vue @@ -23,7 +23,6 @@ display: inline-block; margin-bottom: 10px; vertical-align: top; - box-sizing: inherit; margin-right: 5px; } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 12d7290..e3c72af 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -1,5 +1,9 @@ // 证书打印查询 export interface ICertPrintSearch { + certificateClass: string + certificateNo: string + createUserId: number + printStatus: number | null certificationReportCode: string // 证书编号 orderNo: string // 委托书编号 customerName: string // 委托方名称 @@ -13,7 +17,7 @@ reason: string // 操作原因 sampleId: string // 样品id status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) - ids?: [] + ids?: [] | null offset: number limit: number } diff --git a/src/api/device/borrow.ts b/src/api/device/borrow.ts index dbce999..5bd4111 100644 --- a/src/api/device/borrow.ts +++ b/src/api/device/borrow.ts @@ -45,6 +45,15 @@ data, }) } + +// 设备借用驳回后编辑 +export function failUpdate(data: object) { + return request({ + url: '/equipmentApply/failUpdate', + method: 'post', + data, + }) +} // 设备借用申请删除 export function deleteApply(data: object) { return request({ diff --git a/src/api/device/stateManage.ts b/src/api/device/stateManage.ts index 9049282..7f9431b 100644 --- a/src/api/device/stateManage.ts +++ b/src/api/device/stateManage.ts @@ -1,6 +1,6 @@ // 状态管理相关接口api import request from '../index' -import type { ISearchQuery, ITableRow, Iapprove } from '@/views/device/stateManage/components/status-interface.ts' +import type { ISearchQuery, Iapprove } from '@/views/device/stateManage/components/status-interface' // 设备申请列表 export function getStatusList(data: ISearchQuery) { @@ -11,7 +11,7 @@ }) } // 状态管理新建 -export function addStatus(data: ITableRow) { +export function addStatus(data: Object) { return request({ url: '/meter/stateManage/addStateManageInfo', method: 'post', @@ -20,7 +20,7 @@ } // 状态管理编辑 -export function updateStatus(data: ITableRow) { +export function updateStatus(data: Object) { return request({ url: '/meter/stateManage/updateStateManageInfo', method: 'post', @@ -53,7 +53,7 @@ }) } // 状态管理详情 -export function detailStatus(data: ITableRow) { +export function detailStatus(data: object) { return request({ url: '/meter/stateManage/selectStateManageInfo', method: 'post', diff --git a/src/components/SearchArea/SearchItem.vue b/src/components/SearchArea/SearchItem.vue index 3adef93..dc53b08 100644 --- a/src/components/SearchArea/SearchItem.vue +++ b/src/components/SearchArea/SearchItem.vue @@ -23,7 +23,6 @@ display: inline-block; margin-bottom: 10px; vertical-align: top; - box-sizing: inherit; margin-right: 5px; } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 12d7290..e3c72af 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -1,5 +1,9 @@ // 证书打印查询 export interface ICertPrintSearch { + certificateClass: string + certificateNo: string + createUserId: number + printStatus: number | null certificationReportCode: string // 证书编号 orderNo: string // 委托书编号 customerName: string // 委托方名称 @@ -13,7 +17,7 @@ reason: string // 操作原因 sampleId: string // 样品id status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) - ids?: [] + ids?: [] | null offset: number limit: number } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 3daa2b5..391931b 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -22,6 +22,10 @@ const activeTitle = ref('') // active对应的审批状态名字 // 查询条件 const listQuery = ref({ + certificateClass: '', + certificateNo: '', // 证书编号 + createUserId: 0, + printStatus: 0, // 可打印(证书可打印传0,全部传null) certificationReportCode: '', // 证书编号 orderNo: '', // 委托书编号 customerName: '', // 委托方名称 @@ -30,11 +34,12 @@ certificateReportType: '', // 证书类型 printNum: '', // 打印次数 -未打印和全部用 approvalStatus: '', // 审批状态-审批查询用 - orderId: '0', // 委托书id + orderId: '', // 委托书id reason: '', // 操作原因 - sampleId: '0', // 样品id + sampleId: '', // 样品id status: '', // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) formId: SCHEDULE.BUSINESS_CERT_PRINT, + ids: null, // 设置默认值 offset: 1, limit: 20, }) @@ -78,22 +83,30 @@ } } }) + if (window.sessionStorage.getItem('buttonBoxActive') !== 'undefined' && window.sessionStorage.getItem('buttonBoxActive') !== '') { + active.value = window.sessionStorage.getItem('buttonBoxActive')! + activeTitle.value === '未通过' + } + else { + active.value = menu.value.find(item => item.name === '可打印')!.id // 可打印 + activeTitle.value === '可打印' + } }) } // 表头 const columns = ref([ - { text: '证书编号', value: 'certificationReportCode', width: '110', align: 'center' }, - { text: '证书名称', value: 'certificationReportName', width: '120', align: 'center' }, + { text: '证书编号', value: 'certificateNo', width: '110', align: 'center' }, + { text: '证书名称', value: 'certificateName', width: '120', align: 'center' }, { text: '样品编号', value: 'sampleNo', width: '110', align: 'center' }, { text: '样品名称', value: 'sampleName', width: '120', align: 'center' }, { text: '型号', value: 'sampleModel', width: '120', align: 'center' }, { text: '出厂编号', value: 'manufacturingNo', width: '120', align: 'center' }, { text: '委托书编号', value: 'orderNo', width: '120', align: 'center' }, - { text: '检校类别', value: 'customerNo', width: '120', align: 'center' }, - { text: '检定人员', value: 'customerName', width: '120', align: 'center' }, - { text: '证书类型', value: 'certificateReportTypeName', width: '120', align: 'center' }, - { text: '打印状态', value: '', align: 'center', width: '85px', filter: (row: ICerPrintList) => { return row.printNum == 0 ? '未打印' : `${row.printNum}次打印` } }, + { text: '检校类别', value: 'measureType', width: '120', align: 'center' }, + { text: '检定人员', value: 'measurePersonId', width: '120', align: 'center' }, + { text: '证书类型', value: 'certificateType', width: '120', align: 'center' }, + { text: '打印状态', value: 'printNum', align: 'center', width: '85px', filter: (row: ICerPrintList) => { var cnum = ['未打印', '一', '二', '三', '四', '五', '六', '七', '八', '九', '十']; return row.printNum == 0 ? '未打印' : `${cnum[parseInt(row.printNum)]}次打印` } }, { text: '生成时间', value: 'createTime', align: 'center', width: '165px' }, ]) // 表格数据 @@ -107,37 +120,35 @@ // 根据过滤查询条件 function filterQuery() { - console.log(activeTitle) + const approvalStatus = menu.value.find(item => item.name === activeTitle.value)!.id + listQuery.value.approvalStatus = approvalStatus switch (activeTitle.value) { case '可打印': - listQuery.value.printNum = 0 + listQuery.value.printStatus = 0 listQuery.value.approvalStatus = '' break case '全部': - listQuery.value.printNum = 0 + listQuery.value.printStatus = 2 listQuery.value.approvalStatus = '' break case '待审批': - listQuery.value.printNum = '' - listQuery.value.approvalStatus = '1' + listQuery.value.printStatus = 2 break case '审批中': - listQuery.value.printNum = '' - listQuery.value.approvalStatus = '2' + listQuery.value.printStatus = 2 break case '已通过': - listQuery.value.printNum = '' - listQuery.value.approvalStatus = '3' + listQuery.value.printStatus = 2 break case '未通过': - listQuery.value.printNum = '' - listQuery.value.approvalStatus = '4' + listQuery.value.printStatus = 2 break } } // 数据查询 function fetchData(isNowPage = false) { + console.log(listQuery) filterQuery() loadingTable.value = true if (!isNowPage) { @@ -146,15 +157,11 @@ } // 模拟数据 loadingTable.value = false - list.value = [ - { certificationId: '1', certificationReportCode: '12345614', certificationReportName: '力学检定证书', orderId: '1', sampleNo: '1yp123456', sampleName: '压力表', sampleModel: 'xx', manufacturingNo: 'xx', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', createTime: '2023-02-01 08:00:00', printNum: 0, printStatus: '0', printStatusName: '未打印', certificateReportTypeName: '自检', approvalStatusName: '待审批', taskId: '100', id: '10' }, - { certificationId: '1', certificationReportCode: '12345614', certificationReportName: '力学检定证书', orderId: '1', sampleNo: '1yp123457', sampleName: '压力表', sampleModel: 'xx', manufacturingNo: 'xx', orderNo: 'wtd123456', customerNo: 'kh123456', customerName: '北京无线电测量研究所', createTime: '2023-02-01 08:00:00', printNum: 0, printStatus: '1', printStatusName: '已打印', certificateReportTypeName: '自检', approvalStatusName: '待审批', taskId: '1001', id: '101' }, - ] - // getCertList(listQuery.value).then((response) => { - // list.value = response.data.rows - // total.value = parseInt(response.data.total) - // loadingTable.value = false - // }) + getCertList(listQuery.value).then((response) => { + list.value = response.data.rows + total.value = parseInt(response.data.total) + loadingTable.value = false + }) } // 多选发生改变时 function handleSelectionChange(e: any) { @@ -167,7 +174,12 @@ } // 点击重置 const clearList = () => { + const approvalStatus = menu.value.find(item => item.name === activeTitle.value)!.id listQuery.value = { + certificateClass: '', + certificateNo: '', // 证书编号 + createUserId: 0, + printStatus: 0, // 可打印(证书可打印传0,全部传null) certificationReportCode: '', // 证书编号 orderNo: '', // 委托书编号 customerName: '', // 委托方名称 @@ -176,14 +188,18 @@ certificateReportType: '', // 证书类型 printNum: '', // 打印次数 -未打印和全部用 approvalStatus: '', // 审批状态-审批查询用 - orderId: '0', // 委托书id + orderId: '', // 委托书id reason: '', // 操作原因 - sampleId: '0', // 样品id + sampleId: '', // 样品id status: '', // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) formId: SCHEDULE.BUSINESS_CERT_PRINT, offset: 1, limit: 20, } + listQuery.value.approvalStatus = approvalStatus + if (activeTitle.value === '可打印' || activeTitle.value === '全部') { + listQuery.value.approvalStatus = '' + } fetchData(true) } // 点击详情 @@ -226,14 +242,14 @@ background: 'rgba(255, 255, 255, 0.8)', }) if (list.value.length > 0) { - // const params = { - // ...listQuery.value, - // ids: checkoutList.value, - // } - // exportCert(params).then((res) => { - // const blob = new Blob([res.data]) - // exportFile(blob, '证书打印列表.xlsx') - // }) + const params = { + ...listQuery.value, + ids: checkoutList.value, + } + exportCert(params).then((res) => { + const blob = new Blob([res.data]) + exportFile(blob, '证书打印列表.xlsx') + }) } else { ElMessage.warning('无数据可导出数据') @@ -243,10 +259,9 @@ // 打印 const bindLabel = (row: ICerPrintList) => { - console.log(1) - row.printNum = 1 + console.log(row) // 判断状态第一次可以直接打印,之后的打印需要审批 - if (row.printNum == 1) { + if (row.printNum == 0) { ElMessageBox.confirm( '确定要打印吗?', '确认操作', @@ -319,18 +334,9 @@ onMounted(async () => { await getDict() // 获取字典-审批状态 - if (window.sessionStorage.getItem('buttonBoxActive') !== 'undefined' && window.sessionStorage.getItem('buttonBoxActive') !== '') { - active.value = window.sessionStorage.getItem('buttonBoxActive')! - } - else { - active.value = menu.value.find(item => item.name === '可打印')!.id // 可打 - activeTitle.value === '可打印' - } + fetchData(true) }) -onUnmounted(() => { - window.sessionStorage.setItem('buttonBoxActive', '') // 清除 -})