diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index e11a9cd..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -32,7 +32,7 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') // 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 @@ -207,6 +207,7 @@ if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -216,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -241,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -839,8 +841,9 @@ - + + + import { getCurrentInstance, ref } from 'vue' -import type { Ref } from 'vue' -import type { DateModelType } from 'element-plus' -import { ElLoading, ElMessage } from 'element-plus' +import { ElLoading, ElMessage, ElMessageBox } from 'element-plus' +// import { Row } from 'element-plus/es/components/table-v2/src/components' import type { ICerPrintList, ICertPrintSearch } from './cert-interface' -import DistributeDialog from './components/distributeDialog.vue' import ApprovalDialogPart from './components/ApprovalDialogPart.vue' -import BarCodeBind from '@/components/BarCodeBind/index.vue' import type { TableColumn } from '@/components/NormalTable/table_interface' import { printJSON } from '@/utils/printUtils' import { exportFile } from '@/utils/exportUtils' import { getDictByCode } from '@/api/system/dict' -import { exportTaskList, getTaskList } from '@/api/business/task' import { exportCert, getCertList, submitApproval } from '@/api/business/cert' import { SCHEDULE } from '@/utils/scheduleDict' import type { dictType } from '@/global' +import ButtonBox from '@/components/buttonBox/buttonBox.vue' +import type { IMenu } from '@/components/buttonBox/buttonBox' const { proxy } = getCurrentInstance() as any const $router = useRouter() // 右上角按钮 -const menus = [ - { name: '未打印', value: '未打印' }, - { name: '全部', value: '全部' }, - { name: '待审批', value: '待审批' }, - { name: '已通过', value: '已通过' }, - { name: '未通过', value: '未通过' }, -] -const currentMenu = ref('未打印') // 当前选中状态 +const menu = ref([]) // 右上角审批状态按钮组合 +const active = ref('') // 选中的按钮 +const activeTitle = ref('') // active对应的审批状态名字 // 查询条件 const listQuery = ref({ certificationReportCode: '', // 证书编号 @@ -37,7 +30,11 @@ certificateReportType: '', // 证书类型 printNum: '', // 打印次数 -未打印和全部用 approvalStatus: '', // 审批状态-审批查询用 - formId: 'jlglsygfsp', + orderId: '0', // 委托书id + reason: '', // 操作原因 + sampleId: '0', // 样品id + status: '', // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + formId: SCHEDULE.BUSINESS_CERT_PRINT, offset: 1, limit: 20, }) @@ -49,8 +46,40 @@ getDictByCode('certificationClass').then((response) => { certificationClassList.value = response.data }) + getDictByCode('approvalStatus').then((response) => { + // 审批状态字典 {1:草稿箱} + // response.data.forEach((item: any) => { + // approvalStatusMap.value[`${item.value}`] = item.name + // }) + + // 审批状态字典 {草稿箱: 1} + // response.data.forEach((item: any) => { + // approvalStatusReserveMap.value[item.name] = `${item.value}` + // }) + // 制作右上角的菜单 + response.data.forEach((item: dictType) => { + if (item.name === '可打印' || item.name === '全部' + || item.name === '待审批' || item.name === '审批中' + || item.name === '已通过' || item.name === '未通过' + ) { + if (item.name === '可打印') { + active.value = item.value + activeTitle.value = item.name + menu.value.unshift({ + name: item.name, + id: `${item.value}`, + }) + } + else { + menu.value.push({ + name: item.name, + id: `${item.value}`, + }) + } + } + }) + }) } -getDict() // 表头 const columns = ref([ @@ -78,8 +107,9 @@ // 根据过滤查询条件 function filterQuery() { - switch (currentMenu.value) { - case '未打印': + console.log(activeTitle) + switch (activeTitle.value) { + case '可打印': listQuery.value.printNum = 0 listQuery.value.approvalStatus = '' break @@ -117,8 +147,8 @@ // 模拟数据 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: '待审批' }, + { 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 @@ -146,7 +176,11 @@ certificateReportType: '', // 证书类型 printNum: '', // 打印次数 -未打印和全部用 approvalStatus: '', // 审批状态-审批查询用 - formId: 'jlglsygfsp', + orderId: '0', // 委托书id + reason: '', // 操作原因 + sampleId: '0', // 样品id + status: '', // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + formId: SCHEDULE.BUSINESS_CERT_PRINT, offset: 1, limit: 20, } @@ -166,7 +200,6 @@ else { approvalDialogPart.value.initDialog('refuse', row.taskId, row.id) } - // distributeDialogRef.value.initDialog(row.orderId, row.sampleId) } // 审批结束回调 @@ -194,15 +227,12 @@ }) if (list.value.length > 0) { // const params = { - // bussinessSize: listQuery.value.bussinessSize, // 业务规模 - // customerName: listQuery.value.customerName, // 公司名称 - // customerNo: listQuery.value.customerNo, // 任务分发编号 - // grade: listQuery.value.grade, // 履约评级 + // ...listQuery.value, // ids: checkoutList.value, // } - // exportCustomerList(params).then((res) => { + // exportCert(params).then((res) => { // const blob = new Blob([res.data]) - // exportFile(blob, '任务分发列表.xlsx') + // exportFile(blob, '证书打印列表.xlsx') // }) } else { @@ -212,10 +242,50 @@ } // 打印 -const bindLabel = () => { - // exportCert({orderId:row.orderId,reason:row.reason,sampleId:row.sampleId,status:row.status}).then(res=>{ - // console.log(res) - // }) +const bindLabel = (row: ICerPrintList) => { + console.log(1) + row.printNum = 1 + // 判断状态第一次可以直接打印,之后的打印需要审批 + if (row.printNum == 1) { + ElMessageBox.confirm( + '确定要打印吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + }, + ).then(() => { + exportCert({ orderId: row.orderId, reason: row.reason, sampleId: row.sampleId, status: row.status }).then((res) => { + console.log(res) + }) + }) + } + else { + ElMessageBox.confirm( + '打印前需申请 确定要打印吗?', + '确认操作', + { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + dangerouslyUseHTMLString: true, + }, + ).then(() => { + submitApproval({ id: row.id, formId: listQuery.value.formId }).then((res) => { + console.log(res) + if (res === 200) { + ElMessageBox.confirm( + '已经发送申请!', + '确认操作', + { + type: 'success', + }, + ) + } + }) + }) + } } // 打印列表 @@ -239,25 +309,33 @@ } } -// 选择按钮变更 -watch(currentMenu, (val: string) => { - fetchData(false) -}) +// 按钮切换 +const changeCurrentButton = (val: string) => { + active.value = val + activeTitle.value = menu.value.find(item => item.id === val)!.name + window.sessionStorage.setItem('buttonBoxActive', val) + clearList() +} -fetchData(false) +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', '') // 清除 +}) diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index e11a9cd..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -32,7 +32,7 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') // 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 @@ -207,6 +207,7 @@ if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -216,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -241,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -839,8 +841,9 @@ - + + + { + getDictByCode('approvalStatus').then((res) => { + // 审批状态字典 {1:草稿箱} + res.data.forEach((item: any) => { + approvalStatusMap.value[`${item.value}`] = item.name + }) + console.log(approvalStatusMap.value) + // 审批状态字典 {草稿箱: 1} + res.data.forEach((item: any) => { + approvalStatusReserveMap.value[item.name] = `${item.value}` + }) + console.log(approvalStatusReserveMap.value) + }) +} + watch(current, (newValue) => { - console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) onUnmounted(() => { sessionStorage.setItem('approveFileMenu', current.value) }) onMounted(() => { + getMenuStatus() current.value = sessionStorage.getItem('approveFileMenu') || '全部' sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' }) @@ -46,7 +66,7 @@ - + diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index e11a9cd..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -32,7 +32,7 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') // 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 @@ -207,6 +207,7 @@ if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -216,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -241,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -839,8 +841,9 @@ - + + + { + getDictByCode('approvalStatus').then((res) => { + // 审批状态字典 {1:草稿箱} + res.data.forEach((item: any) => { + approvalStatusMap.value[`${item.value}`] = item.name + }) + console.log(approvalStatusMap.value) + // 审批状态字典 {草稿箱: 1} + res.data.forEach((item: any) => { + approvalStatusReserveMap.value[item.name] = `${item.value}` + }) + console.log(approvalStatusReserveMap.value) + }) +} + watch(current, (newValue) => { - console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) onUnmounted(() => { sessionStorage.setItem('approveFileMenu', current.value) }) onMounted(() => { + getMenuStatus() current.value = sessionStorage.getItem('approveFileMenu') || '全部' sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' }) @@ -46,7 +66,7 @@ - + diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index e11a9cd..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -32,7 +32,7 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') // 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 @@ -207,6 +207,7 @@ if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -216,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -241,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -839,8 +841,9 @@ - + + + { + getDictByCode('approvalStatus').then((res) => { + // 审批状态字典 {1:草稿箱} + res.data.forEach((item: any) => { + approvalStatusMap.value[`${item.value}`] = item.name + }) + console.log(approvalStatusMap.value) + // 审批状态字典 {草稿箱: 1} + res.data.forEach((item: any) => { + approvalStatusReserveMap.value[item.name] = `${item.value}` + }) + console.log(approvalStatusReserveMap.value) + }) +} + watch(current, (newValue) => { - console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) onUnmounted(() => { sessionStorage.setItem('approveFileMenu', current.value) }) onMounted(() => { + getMenuStatus() current.value = sessionStorage.getItem('approveFileMenu') || '全部' sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' }) @@ -46,7 +66,7 @@ - + diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/api/business/cert.ts b/src/api/business/cert.ts index 7fa6610..9de249a 100644 --- a/src/api/business/cert.ts +++ b/src/api/business/cert.ts @@ -2,7 +2,7 @@ * 证书打印 */ import request from '../index' -import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface.ts' +import type { ICertApprove, ICertExport, ICertInitiate, ICertPrintSearch } from '@/views/business/schedule/certPrint/cert-interface' // 证书打印列表 export function getCertList(data: ICertPrintSearch) { @@ -45,6 +45,7 @@ return request({ url: '/business/certificatePrint/export', method: 'post', + responseType: 'blob', data, }) } diff --git a/src/utils/scheduleDict.ts b/src/utils/scheduleDict.ts index 9d4ec40..6c5dbf3 100644 --- a/src/utils/scheduleDict.ts +++ b/src/utils/scheduleDict.ts @@ -19,4 +19,5 @@ DEVICE_BORROW_APPROVAL = 'clsbjysp', // 设备借用申请 DEVICE_FIX_APPROVAL = 'sbglsbjxsq', // 设备检修申请 DEVICE_FIX_ACCEPTANCE = 'sbglsbjxbyysd', // 设备检修保养验收单 + BUSINESS_CERT_PRINT = 'ywglzsdy', // 证书打印 } diff --git a/src/views/business/schedule/certPrint/cert-interface.ts b/src/views/business/schedule/certPrint/cert-interface.ts index 4f274f3..12d7290 100644 --- a/src/views/business/schedule/certPrint/cert-interface.ts +++ b/src/views/business/schedule/certPrint/cert-interface.ts @@ -8,7 +8,12 @@ certificateReportType: string // 证书类型 printNum: number | '' // 打印次数 -未打印和全部用 approvalStatus: string // 审批状态-审批查询用 + orderId: string // 委托书id formId: string // 审批用formId + reason: string // 操作原因 + sampleId: string // 样品id + status: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) + ids?: [] offset: number limit: number } @@ -39,6 +44,9 @@ approvalStatusName?: string // 审批状态 taskId?: string // 任务id id: string // 主键 + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书详情 @@ -89,21 +97,21 @@ // 证书导出 export interface ICertExport { - orderId: number - reason: string - sampleId: number - status: string + orderId: string + reason?: string // 操作原因 + sampleId?: string // 样品id + status?: string // 状态变更(无需检测状态7,收入状态2,归还6,回退状态2.5.1,终止5) } // 证书同意/拒绝 export interface ICertApprove { - comments: number + comments: string id?: string taskId: string } // 证书发起 export interface ICertInitiate { - formId: number + formId: string id: string } diff --git a/src/views/business/schedule/certPrint/certList.vue b/src/views/business/schedule/certPrint/certList.vue index 21b7a5f..3daa2b5 100644 --- a/src/views/business/schedule/certPrint/certList.vue +++ b/src/views/business/schedule/certPrint/certList.vue @@ -1,32 +1,25 @@ diff --git a/src/views/device/stateManage/components/templateAdd.vue b/src/views/device/stateManage/components/templateAdd.vue index e11a9cd..05ba922 100644 --- a/src/views/device/stateManage/components/templateAdd.vue +++ b/src/views/device/stateManage/components/templateAdd.vue @@ -32,7 +32,7 @@ const dialogSelectDiviceVisible = ref(false) // 控制选择设备对话框显隐 const selectIndex = ref() // 点击选择的index--点击第几行 const borrowList = ref([]) - +const processId = ref('') // 状态管理 const ruleForm1 = ref({ applyType: $route.query.applyType, // 申请类型 @@ -207,6 +207,7 @@ if (title.value !== '新建') { console.log(row.id) detailApply({ id: row.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm2.value = res.data borrowList.value = res.data.equipmentInfoList }) @@ -216,6 +217,7 @@ // 状态管理 if ($route.query.title !== '新建') { detailStatus({ id: $route.params.id }).then((res) => { + processId.value = res.data.processId // 流程id存在的时候赋值 ruleForm1.value = res.data ruleForm1.value.applyUnit = res.data.applyUnit ruleForm1.value.equipmentNo = res.data.applyNo @@ -241,7 +243,7 @@ if (valid) { if (borrowList.value.length > 0) { // 整理数据 - delete ruleForm2.value.equipmentInfoList // 去除显示的列表 + // delete ruleForm2.value.equipmentInfoList // 去除显示的列表 ruleForm2.value.applyType = '2' const params = { ...ruleForm2.value, @@ -839,8 +841,9 @@ - + + + { + getDictByCode('approvalStatus').then((res) => { + // 审批状态字典 {1:草稿箱} + res.data.forEach((item: any) => { + approvalStatusMap.value[`${item.value}`] = item.name + }) + console.log(approvalStatusMap.value) + // 审批状态字典 {草稿箱: 1} + res.data.forEach((item: any) => { + approvalStatusReserveMap.value[item.name] = `${item.value}` + }) + console.log(approvalStatusReserveMap.value) + }) +} + watch(current, (newValue) => { - console.log(newValue) currentComp.value = menu.value.filter(item => item.name === newValue)[0].comp }) onUnmounted(() => { sessionStorage.setItem('approveFileMenu', current.value) }) onMounted(() => { + getMenuStatus() current.value = sessionStorage.getItem('approveFileMenu') || '全部' sessionStorage.getItem('approveFileMenu') ? sessionStorage.removeItem('approveFileMenu') : '' }) @@ -46,7 +66,7 @@ - + diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => props.name, () => { + activeTitle.value = props.name + approvalStatus.value = approvalStatusReserveMap.value[props.name] +}, { deep: true, immediate: true }) const searchQuery = reactive({ fileNo: '', // 编号 fileName: '', // 名称 fileCode: '', // 文件号 createUser: '', // 创建人 createTime: '', // 创建 - approvalStatus: approvalStatus.value, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@ diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => props.name, () => { + activeTitle.value = props.name + approvalStatus.value = approvalStatusReserveMap.value[props.name] +}, { deep: true, immediate: true }) const searchQuery = reactive({ fileNo: '', // 编号 fileName: '', // 名称 fileCode: '', // 文件号 createUser: '', // 创建人 createTime: '', // 创建 - approvalStatus: approvalStatus.value, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@ diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => props.name, () => { + activeTitle.value = props.name + approvalStatus.value = approvalStatusReserveMap.value[props.name] +}, { deep: true, immediate: true }) const searchQuery = reactive({ fileNo: '', // 编号 fileName: '', // 名称 fileCode: '', // 文件号 createUser: '', // 创建人 createTime: '', // 创建 - approvalStatus: approvalStatus.value, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@ diff --git a/src/views/measure/file/components/approve/addDialog.vue b/src/views/measure/file/components/approve/addDialog.vue index 6e66400..c4d646a 100644 --- a/src/views/measure/file/components/approve/addDialog.vue +++ b/src/views/measure/file/components/approve/addDialog.vue @@ -306,6 +306,11 @@ 关闭 +
+ + 关闭 + +
diff --git a/src/views/measure/file/components/approve/approve-interface.ts b/src/views/measure/file/components/approve/approve-interface.ts index 7a1b06d..d2cfdd2 100644 --- a/src/views/measure/file/components/approve/approve-interface.ts +++ b/src/views/measure/file/components/approve/approve-interface.ts @@ -3,6 +3,7 @@ createUser: string effectiveStatus: string effectiveStatusName: string + approvalStatus: string approvalStatusName: string effectiveTime: string fileCode: string diff --git a/src/views/measure/file/components/approve/templatePage.vue b/src/views/measure/file/components/approve/templatePage.vue index b1b7476..8dc2bad 100644 --- a/src/views/measure/file/components/approve/templatePage.vue +++ b/src/views/measure/file/components/approve/templatePage.vue @@ -9,42 +9,40 @@ import { getDictByCode } from '@/api/system/dict' import { exportFile } from '@/utils/exportUtils' import { SCHEDULE } from '@/utils/scheduleDict' +import type { TableColumn } from '@/components/NormalTable/table_interface' const props = defineProps({ name: { type: String, default: '', }, + approvalStatusMap: { + type: Object, + default: () => { return {} }, + }, + approvalStatusReserveMap: { + type: Object, + default: () => { return {} }, + }, }) +const { proxy } = getCurrentInstance() as any const $router = useRouter() const approvalStatus = ref('0') // 审批状态字典 -const approvalStatusReserveMap: { [key: string]: string } = { - 全部: '0', - 草稿箱: '1', - 待审批: '2', - 审批中: '3', - 已通过: '4', - 未通过: '5', - 已取消: '6', -} -watch(() => props.name, (_) => { - approvalStatus.value = approvalStatusReserveMap[props.name] - // 获取当前状态 - // getDictByCode('approvalStatus').then((res) => { - // approvalStatus.value = res.data.filter((item: fileResType) => item.name === props.name)[0].value || '0' - // }) -}, -{ - deep: true, - immediate: true, -}) +const approvalStatusMap = ref({ ...props.approvalStatusMap }) // 审批状态字典{1:草稿箱} +const approvalStatusReserveMap = ref({ ...props.approvalStatusReserveMap }) // 审批状态字典{草稿箱: 1} +const activeTitle = ref('') // active对应的审批状态名字 + +watch(() => props.name, () => { + activeTitle.value = props.name + approvalStatus.value = approvalStatusReserveMap.value[props.name] +}, { deep: true, immediate: true }) const searchQuery = reactive({ fileNo: '', // 编号 fileName: '', // 名称 fileCode: '', // 文件号 createUser: '', // 创建人 createTime: '', // 创建 - approvalStatus: approvalStatus.value, // 审批状态 + approvalStatus: approvalStatus.value || '0', // 审批状态 limit: 20, offset: 1, fileType: '', // 文件类别 @@ -53,7 +51,7 @@ }) // 查询参数 const loadingTable = ref(false) // 表格loading const total = ref(0) // 数据总条数 -const columns = ref([ +const columns = ref([ { text: '名称', value: 'fileName', align: 'center' }, { text: '编号', value: 'fileNo', align: 'center' }, { text: '文件号', value: 'fileCode', align: 'center' }, @@ -62,13 +60,18 @@ { text: '创建时间', value: 'createTime', align: 'center' }, { text: '审批状态', value: 'approvalStatusName', align: 'center' }, ]) // 表格 -const list = ref([]) // 表格数据 +const list = ref([]) // 表格数据 // 获取数据列表 const getList = () => { loadingTable.value = true approvallistPageApi(searchQuery).then((res) => { if (res.code === 200) { - list.value = res.data.rows + list.value = res.data.rows.map((item: TableRow) => { + return { + ...item, + approvalStatus: approvalStatusMap.value[item.approvalStatus], + } + }) total.value = res.data.total } loadingTable.value = false @@ -265,28 +268,7 @@ ElMessage('无可打印内容') } } -// 是否审批中或者待审批 -const isApproval = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '审批中' || row.approvalStatusName === '待审批') { - return true - } - else { - return false - } - } -}) -// 是否已通过或者未通过 -const isPass = computed(() => { - return (row: TableRow) => { - if (row.approvalStatusName === '已通过' || row.approvalStatusName === '未通过') { - return true - } - else { - return false - } - } -}) + onMounted(() => { getFileType() getList() @@ -295,7 +277,6 @@