diff --git a/src/utils/valiateWork.ts b/src/utils/valiateWork.ts index 6019a73..2114c4d 100644 --- a/src/utils/valiateWork.ts +++ b/src/utils/valiateWork.ts @@ -5,7 +5,7 @@ export const valiateWork1 = async (yearTime: string | number, yearNum: string | number, bizLabCode: string, type: string) => { let result = true if (type === '内部审核') { - const res = await getWorkList({ offset: 1, limit: 9999 }) + const res = await getWorkList({ offset: 1, limit: 9999, status: '1' }) const data = res.data.rows const flag = data.some((item: any) => String(item.yearTime) === String(yearTime) && String(item.yearNum) === String(yearNum) && item.bizLabCode === bizLabCode) if (flag) { @@ -18,7 +18,7 @@ } else { // 管理评审 - getReviewWorkList({ offset: 1, limit: 9999 }).then((res) => { + getReviewWorkList({ offset: 1, limit: 9999, managementStatus: '0' }).then((res) => { const data = res.data.rows const flag = data.some((item: any) => String(item.yearTime) === String(yearTime) && String(item.yearNum) === String(yearNum) && item.bizLabCode === bizLabCode) if (flag) { diff --git a/src/utils/valiateWork.ts b/src/utils/valiateWork.ts index 6019a73..2114c4d 100644 --- a/src/utils/valiateWork.ts +++ b/src/utils/valiateWork.ts @@ -5,7 +5,7 @@ export const valiateWork1 = async (yearTime: string | number, yearNum: string | number, bizLabCode: string, type: string) => { let result = true if (type === '内部审核') { - const res = await getWorkList({ offset: 1, limit: 9999 }) + const res = await getWorkList({ offset: 1, limit: 9999, status: '1' }) const data = res.data.rows const flag = data.some((item: any) => String(item.yearTime) === String(yearTime) && String(item.yearNum) === String(yearNum) && item.bizLabCode === bizLabCode) if (flag) { @@ -18,7 +18,7 @@ } else { // 管理评审 - getReviewWorkList({ offset: 1, limit: 9999 }).then((res) => { + getReviewWorkList({ offset: 1, limit: 9999, managementStatus: '0' }).then((res) => { const data = res.data.rows const flag = data.some((item: any) => String(item.yearTime) === String(yearTime) && String(item.yearNum) === String(yearNum) && item.bizLabCode === bizLabCode) if (flag) { diff --git a/src/views/quality/correct/handle/components/ApprovalDialog.vue b/src/views/quality/correct/handle/components/ApprovalDialog.vue index cf7209e..8cac285 100644 --- a/src/views/quality/correct/handle/components/ApprovalDialog.vue +++ b/src/views/quality/correct/handle/components/ApprovalDialog.vue @@ -36,7 +36,7 @@ required: true, }, }) -const emit = defineEmits(['onSuccess', 'refuse']) +const emit = defineEmits(['onSuccess', 'refuse', 'reject']) const $route = useRoute() // 弹窗显示状态 const dialogVisible = ref(false) @@ -289,6 +289,11 @@ btnLoading.value = false emit('refuse', formData.comments, formData.taskId, formData.id) } + else if (formData.type === 'reject') { + dialogVisible.value = false + btnLoading.value = false + emit('reject', formData.comments, formData.taskId, formData.id) + } } }) } @@ -325,9 +330,9 @@ 同意 - + 拒绝 diff --git a/src/utils/valiateWork.ts b/src/utils/valiateWork.ts index 6019a73..2114c4d 100644 --- a/src/utils/valiateWork.ts +++ b/src/utils/valiateWork.ts @@ -5,7 +5,7 @@ export const valiateWork1 = async (yearTime: string | number, yearNum: string | number, bizLabCode: string, type: string) => { let result = true if (type === '内部审核') { - const res = await getWorkList({ offset: 1, limit: 9999 }) + const res = await getWorkList({ offset: 1, limit: 9999, status: '1' }) const data = res.data.rows const flag = data.some((item: any) => String(item.yearTime) === String(yearTime) && String(item.yearNum) === String(yearNum) && item.bizLabCode === bizLabCode) if (flag) { @@ -18,7 +18,7 @@ } else { // 管理评审 - getReviewWorkList({ offset: 1, limit: 9999 }).then((res) => { + getReviewWorkList({ offset: 1, limit: 9999, managementStatus: '0' }).then((res) => { const data = res.data.rows const flag = data.some((item: any) => String(item.yearTime) === String(yearTime) && String(item.yearNum) === String(yearNum) && item.bizLabCode === bizLabCode) if (flag) { diff --git a/src/views/quality/correct/handle/components/ApprovalDialog.vue b/src/views/quality/correct/handle/components/ApprovalDialog.vue index cf7209e..8cac285 100644 --- a/src/views/quality/correct/handle/components/ApprovalDialog.vue +++ b/src/views/quality/correct/handle/components/ApprovalDialog.vue @@ -36,7 +36,7 @@ required: true, }, }) -const emit = defineEmits(['onSuccess', 'refuse']) +const emit = defineEmits(['onSuccess', 'refuse', 'reject']) const $route = useRoute() // 弹窗显示状态 const dialogVisible = ref(false) @@ -289,6 +289,11 @@ btnLoading.value = false emit('refuse', formData.comments, formData.taskId, formData.id) } + else if (formData.type === 'reject') { + dialogVisible.value = false + btnLoading.value = false + emit('reject', formData.comments, formData.taskId, formData.id) + } } }) } @@ -325,9 +330,9 @@ 同意 - + 拒绝 diff --git a/src/views/quality/correct/handle/components/detail.vue b/src/views/quality/correct/handle/components/detail.vue index 7ff49ee..bee1a76 100644 --- a/src/views/quality/correct/handle/components/detail.vue +++ b/src/views/quality/correct/handle/components/detail.vue @@ -7,6 +7,11 @@ import { exportFile, printContent } from '@/utils/exportUtils' import pdfFile from '@/views/quality/supervise/record/components/pdfFile.vue' import { getBizQualityCorrectiveRecordFile } from '@/api/quality/correct/index' +import filePreviewDialog from '@/components/filePreview/filePreviewDialog.vue' +import { getQualityNoReportFile } from '@/api/quality/supervise/analysis' +import { getReviewFormFile } from '@/api/quality/internal/inspect' +import { getNonReviewFormFile } from '@/api/quality/internal/dissatisfied' +import { getReviewRepFile } from '@/api/quality/review/report' const $route = useRoute() const $router = useRouter() // 关闭页面 @@ -36,21 +41,22 @@ }) // 报告详情 const goDetail = () => { - const data = ruleForm.value.fileRelList[0] - if (`${data.fileType}` === '6') { - downloadFileName(data.fileName) - return - } - sessionStorage.setItem('QualityCorrectHandler-info', JSON.stringify(ruleForm.value)) - $router.push({ - path: `${DETAILURL[`${data.fileType}`]}/${data.id}`, - query: { - approvalStatusName: '全部', // 审批状态名称 - processId: data.processId, // 流程实例id - taskId: data.taskId, // 任务id - id: data.id, - }, - }) + // const data = ruleForm.value.fileRelList[0] + // console.log(data, '111') + // if (`${data.fileType}` === '6') { + // downloadFileName(data.fileName) + // return + // } + // sessionStorage.setItem('QualityCorrectHandler-info', JSON.stringify(ruleForm.value)) + // $router.push({ + // path: `${DETAILURL[`${data.fileType}`]}/${data.id}`, + // query: { + // approvalStatusName: '全部', // 审批状态名称 + // processId: data.processId, // 流程实例id + // taskId: data.taskId, // 任务id + // id: data.id, + // }, + // }) } const { proxy } = getCurrentInstance() as any const file = ref() @@ -90,10 +96,71 @@ ElMessage.warning('下载失败') } } +const filePreviewRef = ref() +const filePreview = (row: any) => { + console.log(row, '111') + if (row.fileType == '1') { + // 不符合要求情况分析表 + getQualityNoReportFile({ + id: row.id, + pdf: true, + }).then((res) => { + if (res.data.type.includes('json')) { + ElMessage.error('文件获取失败') + return + } + // exportFile(res.data, `${row.fileName}.pdf`) + filePreviewRef.value.initDialogContent(res.data) + }) + } + else if (row.fileType == '2') { + // 内部审核检查表 + getReviewFormFile({ + id: row.id, + pdf: true, + }).then((res) => { + if (res.data.type.includes('json')) { + ElMessage.error('文件获取失败') + return + } + // exportFile(res.data, `${row.fileName}.pdf`) + filePreviewRef.value.initDialogContent(res.data) + }) + } + else if (row.fileType == '3') { + // 内部审核不符合项报告 + getNonReviewFormFile({ + id: row.id, + pdf: true, + }).then((res) => { + if (res.data.type.includes('json')) { + ElMessage.error('文件获取失败') + return + } + // exportFile(res.data, `${row.fileName}.pdf`) + filePreviewRef.value.initDialogContent(res.data) + }) + } + else if (row.fileType == '5') { + // 管理评审报告 + getReviewRepFile({ + id: row.id, + pdf: true, + }).then((res) => { + if (res.data.type.includes('json')) { + ElMessage.error('文件获取失败') + return + } + // exportFile(res.data, `${row.fileName}.pdf`) + filePreviewRef.value.initDialogContent(res.data) + }) + } +}