diff --git a/src/api/quality/supervise/record.ts b/src/api/quality/supervise/record.ts index 5112a70..7d9854a 100644 --- a/src/api/quality/supervise/record.ts +++ b/src/api/quality/supervise/record.ts @@ -69,3 +69,12 @@ responseType: 'blob', }) } +// 导出zip +export function exportQualityRecordZip(data: any) { + return request({ + url: '/quality/bizQualitySupervisionRecord/exportZip', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/api/quality/supervise/record.ts b/src/api/quality/supervise/record.ts index 5112a70..7d9854a 100644 --- a/src/api/quality/supervise/record.ts +++ b/src/api/quality/supervise/record.ts @@ -69,3 +69,12 @@ responseType: 'blob', }) } +// 导出zip +export function exportQualityRecordZip(data: any) { + return request({ + url: '/quality/bizQualitySupervisionRecord/exportZip', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue b/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue index 59dc4bd..a4102f8 100644 --- a/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue @@ -74,7 +74,7 @@ { text: '第10次', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', precision: 2, showUnit: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text', unit: 'unit' }, { text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) @@ -101,7 +101,7 @@ { text: '第10次', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', precision: 2, showUnit: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text', unit: 'unit' }, { text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) @@ -127,7 +127,7 @@ { text: '第10次', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', precision: 3, showUnit: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text', unit: 'unit' }, { text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) @@ -829,7 +829,7 @@ averageValue: '', // 平均值 standardDeviation: '', // 重复性 urel: e.urel, // u(k=2) - + unit: e.unit, // 单位(直接存字典value) testValueOne: 0, // 测量值1/测量值(上升时间) testValueTwo: 0, // 测量值2(示值) testValueThree: 0, // 测量值3(示值) @@ -856,6 +856,7 @@ frequency: e.frequency, checkType: '稳定性', urel: e.urel, // u(k=2) + unit: e.unit, // 单位(直接存字典value) averageValue: '', // 平均值 stability: '', // 稳定性 lessThan: '', // 结论 @@ -880,7 +881,7 @@ averageValue: '', // 平均值 standardDeviation: '', // 重复性 urel: e.urel, // u(k=2) - + unit: e.unit, // 单位(直接存字典value) testValueOne: 0, // 测量值1/测量值(上升时间) testValueTwo: 0, // 测量值2(示值) testValueThree: 0, // 测量值3(示值) @@ -891,6 +892,7 @@ testValueEight: 0, // 测量值8 testValueNine: 0, // 测量值9 testValueTen: 0, // 测量值10 + showUnitData: e.unit, } }) as any // 直流电压稳定性 @@ -902,6 +904,7 @@ id: '', // id,更新/删除使用参数 params: '直流电压', // 核查项目 dataType: '3', + unit: e.unit, // 单位(直接存字典value) nominalValue: e.nominalValue, checkType: '稳定性', urel: e.urel, // u(k=2) @@ -909,6 +912,7 @@ stability: '', // 稳定性 lessThan: '', // 结论 lessThanValue: '', // 结论 + showUnitData: e.unit, } }) as any @@ -1258,7 +1262,7 @@ }) break case '直流电压': - listRelativeLevelRepeatability.value = result + listRelativeLevelRepeatability.value = result.map((item: any) => ({ ...item, showUnitData: item.unit })) // 填充稳定性最后一列的日期和数值 listRelativeLevelStability.value = listRelativeLevelStability.value.map((item, index: number) => { return { @@ -1861,7 +1865,7 @@ const fetchDict = async () => { const res1 = await getDictByCode('standardSecondUnit') standardSecondUnit.value = res1.data.map((item: any) => ({ text: item.name, value: item.name })) - // columns_repeatability_AM_depth.value[1].options = standardSecondUnit.value + columns_repeatability_AM_depth.value[1].options = standardSecondUnit.value } watch(() => listAMDepthRepeatability.value, (newVal) => { if (newVal && newVal.length) { diff --git a/src/api/quality/supervise/record.ts b/src/api/quality/supervise/record.ts index 5112a70..7d9854a 100644 --- a/src/api/quality/supervise/record.ts +++ b/src/api/quality/supervise/record.ts @@ -69,3 +69,12 @@ responseType: 'blob', }) } +// 导出zip +export function exportQualityRecordZip(data: any) { + return request({ + url: '/quality/bizQualitySupervisionRecord/exportZip', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue b/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue index 59dc4bd..a4102f8 100644 --- a/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue @@ -74,7 +74,7 @@ { text: '第10次', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', precision: 2, showUnit: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text', unit: 'unit' }, { text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) @@ -101,7 +101,7 @@ { text: '第10次', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', precision: 2, showUnit: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text', unit: 'unit' }, { text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) @@ -127,7 +127,7 @@ { text: '第10次', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', precision: 3, showUnit: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text', unit: 'unit' }, { text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) @@ -829,7 +829,7 @@ averageValue: '', // 平均值 standardDeviation: '', // 重复性 urel: e.urel, // u(k=2) - + unit: e.unit, // 单位(直接存字典value) testValueOne: 0, // 测量值1/测量值(上升时间) testValueTwo: 0, // 测量值2(示值) testValueThree: 0, // 测量值3(示值) @@ -856,6 +856,7 @@ frequency: e.frequency, checkType: '稳定性', urel: e.urel, // u(k=2) + unit: e.unit, // 单位(直接存字典value) averageValue: '', // 平均值 stability: '', // 稳定性 lessThan: '', // 结论 @@ -880,7 +881,7 @@ averageValue: '', // 平均值 standardDeviation: '', // 重复性 urel: e.urel, // u(k=2) - + unit: e.unit, // 单位(直接存字典value) testValueOne: 0, // 测量值1/测量值(上升时间) testValueTwo: 0, // 测量值2(示值) testValueThree: 0, // 测量值3(示值) @@ -891,6 +892,7 @@ testValueEight: 0, // 测量值8 testValueNine: 0, // 测量值9 testValueTen: 0, // 测量值10 + showUnitData: e.unit, } }) as any // 直流电压稳定性 @@ -902,6 +904,7 @@ id: '', // id,更新/删除使用参数 params: '直流电压', // 核查项目 dataType: '3', + unit: e.unit, // 单位(直接存字典value) nominalValue: e.nominalValue, checkType: '稳定性', urel: e.urel, // u(k=2) @@ -909,6 +912,7 @@ stability: '', // 稳定性 lessThan: '', // 结论 lessThanValue: '', // 结论 + showUnitData: e.unit, } }) as any @@ -1258,7 +1262,7 @@ }) break case '直流电压': - listRelativeLevelRepeatability.value = result + listRelativeLevelRepeatability.value = result.map((item: any) => ({ ...item, showUnitData: item.unit })) // 填充稳定性最后一列的日期和数值 listRelativeLevelStability.value = listRelativeLevelStability.value.map((item, index: number) => { return { @@ -1861,7 +1865,7 @@ const fetchDict = async () => { const res1 = await getDictByCode('standardSecondUnit') standardSecondUnit.value = res1.data.map((item: any) => ({ text: item.name, value: item.name })) - // columns_repeatability_AM_depth.value[1].options = standardSecondUnit.value + columns_repeatability_AM_depth.value[1].options = standardSecondUnit.value } watch(() => listAMDepthRepeatability.value, (newVal) => { if (newVal && newVal.length) { diff --git a/src/views/quality/external/external/components/fileList.vue b/src/views/quality/external/external/components/fileList.vue index ea2336b..c5eb995 100644 --- a/src/views/quality/external/external/components/fileList.vue +++ b/src/views/quality/external/external/components/fileList.vue @@ -5,6 +5,11 @@ import selectFileDialog from './selectFileDialog.vue' import { getDictByCode } from '@/api/system/dict' import { useCheckList, useCheckNoTips } from '@/commonMethods/useCheckList' +import { exportFile, printContent } from '@/utils/exportUtils' +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 $props = defineProps({ data: { type: Array, @@ -149,7 +154,84 @@ } // 预览文件 const preview = (row: any) => { - window.open(row.filePath, '_blank') + console.log(row) + switch (String(row.fileType)) { + // 不符合要求情况分析表 + case '1': + getQualityNoReportFile({ + id: row.id, + pdf: true, + }).then((res) => { + exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + }).catch(() => { + ElMessage.error('文件获取失败') + }) + break + // 内部审核检查表 + case '2': + getReviewFormFile({ + id: row.id, + pdf: true, + }).then((res) => { + exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + }).catch(() => { + ElMessage.error('文件获取失败') + }) + break + // 内部审核不符合顶报告 + case '3': + getNonReviewFormFile({ + id: row.id, + pdf: true, + }).then((res) => { + exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + }).catch(() => { + ElMessage.error('文件获取失败') + }) + break + // 管理评审报告 + case '5': + getReviewRepFile({ + id: row.id, + pdf: true, + }).then((res) => { + exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + }).catch(() => { + ElMessage.error('文件获取失败') + }) + break + // 证书 + case '7': + // getReviewRepFile({ + // id: row.id, + // pdf: true, + // }).then((res) => { + // exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + // }).catch(() => { + // ElMessage.error('文件获取失败') + // }) + break + case '6': + window.open(row.filePath, '_target') + // console.log(row.filePath) + // getReviewRepFile({ + // id: row.id, + // pdf: true, + // }).then((res) => { + // exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + // }).catch(() => { + // ElMessage.error('文件获取失败') + // }) + break + } + // window.open(row.filePath, '_blank') + // console.log(row, '111111111111111') + // 1.不符合要求情况分析表 + // 2.内部审核检查表 + // 3.内部审核不符合顶报告 + // 5.理评审报告 + // 7.证书 + // 6.其他 } diff --git a/src/api/quality/supervise/record.ts b/src/api/quality/supervise/record.ts index 5112a70..7d9854a 100644 --- a/src/api/quality/supervise/record.ts +++ b/src/api/quality/supervise/record.ts @@ -69,3 +69,12 @@ responseType: 'blob', }) } +// 导出zip +export function exportQualityRecordZip(data: any) { + return request({ + url: '/quality/bizQualitySupervisionRecord/exportZip', + method: 'post', + data, + responseType: 'blob', + }) +} diff --git a/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue b/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue index 59dc4bd..a4102f8 100644 --- a/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue +++ b/src/views/equipement/standard/checkData/components/sixteen/checkDataCom.vue @@ -74,7 +74,7 @@ { text: '第10次', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', precision: 2, showUnit: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text', unit: 'unit' }, { text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) @@ -101,7 +101,7 @@ { text: '第10次', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', precision: 2, showUnit: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text', unit: 'unit' }, { text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) @@ -127,7 +127,7 @@ { text: '第10次', value: 'testValueTen', align: 'center', required: true, width: '180', type: 'inputNumber', precision: 3, showUnit: true }, ], }, - { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text' }, + { text: '平均值', value: 'averageValue', align: 'center', required: false, type: 'text', unit: 'unit' }, { text: '重复性S(x)/x', value: 'standardDeviation', align: 'center', required: false, type: 'text' }, ]) @@ -829,7 +829,7 @@ averageValue: '', // 平均值 standardDeviation: '', // 重复性 urel: e.urel, // u(k=2) - + unit: e.unit, // 单位(直接存字典value) testValueOne: 0, // 测量值1/测量值(上升时间) testValueTwo: 0, // 测量值2(示值) testValueThree: 0, // 测量值3(示值) @@ -856,6 +856,7 @@ frequency: e.frequency, checkType: '稳定性', urel: e.urel, // u(k=2) + unit: e.unit, // 单位(直接存字典value) averageValue: '', // 平均值 stability: '', // 稳定性 lessThan: '', // 结论 @@ -880,7 +881,7 @@ averageValue: '', // 平均值 standardDeviation: '', // 重复性 urel: e.urel, // u(k=2) - + unit: e.unit, // 单位(直接存字典value) testValueOne: 0, // 测量值1/测量值(上升时间) testValueTwo: 0, // 测量值2(示值) testValueThree: 0, // 测量值3(示值) @@ -891,6 +892,7 @@ testValueEight: 0, // 测量值8 testValueNine: 0, // 测量值9 testValueTen: 0, // 测量值10 + showUnitData: e.unit, } }) as any // 直流电压稳定性 @@ -902,6 +904,7 @@ id: '', // id,更新/删除使用参数 params: '直流电压', // 核查项目 dataType: '3', + unit: e.unit, // 单位(直接存字典value) nominalValue: e.nominalValue, checkType: '稳定性', urel: e.urel, // u(k=2) @@ -909,6 +912,7 @@ stability: '', // 稳定性 lessThan: '', // 结论 lessThanValue: '', // 结论 + showUnitData: e.unit, } }) as any @@ -1258,7 +1262,7 @@ }) break case '直流电压': - listRelativeLevelRepeatability.value = result + listRelativeLevelRepeatability.value = result.map((item: any) => ({ ...item, showUnitData: item.unit })) // 填充稳定性最后一列的日期和数值 listRelativeLevelStability.value = listRelativeLevelStability.value.map((item, index: number) => { return { @@ -1861,7 +1865,7 @@ const fetchDict = async () => { const res1 = await getDictByCode('standardSecondUnit') standardSecondUnit.value = res1.data.map((item: any) => ({ text: item.name, value: item.name })) - // columns_repeatability_AM_depth.value[1].options = standardSecondUnit.value + columns_repeatability_AM_depth.value[1].options = standardSecondUnit.value } watch(() => listAMDepthRepeatability.value, (newVal) => { if (newVal && newVal.length) { diff --git a/src/views/quality/external/external/components/fileList.vue b/src/views/quality/external/external/components/fileList.vue index ea2336b..c5eb995 100644 --- a/src/views/quality/external/external/components/fileList.vue +++ b/src/views/quality/external/external/components/fileList.vue @@ -5,6 +5,11 @@ import selectFileDialog from './selectFileDialog.vue' import { getDictByCode } from '@/api/system/dict' import { useCheckList, useCheckNoTips } from '@/commonMethods/useCheckList' +import { exportFile, printContent } from '@/utils/exportUtils' +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 $props = defineProps({ data: { type: Array, @@ -149,7 +154,84 @@ } // 预览文件 const preview = (row: any) => { - window.open(row.filePath, '_blank') + console.log(row) + switch (String(row.fileType)) { + // 不符合要求情况分析表 + case '1': + getQualityNoReportFile({ + id: row.id, + pdf: true, + }).then((res) => { + exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + }).catch(() => { + ElMessage.error('文件获取失败') + }) + break + // 内部审核检查表 + case '2': + getReviewFormFile({ + id: row.id, + pdf: true, + }).then((res) => { + exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + }).catch(() => { + ElMessage.error('文件获取失败') + }) + break + // 内部审核不符合顶报告 + case '3': + getNonReviewFormFile({ + id: row.id, + pdf: true, + }).then((res) => { + exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + }).catch(() => { + ElMessage.error('文件获取失败') + }) + break + // 管理评审报告 + case '5': + getReviewRepFile({ + id: row.id, + pdf: true, + }).then((res) => { + exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + }).catch(() => { + ElMessage.error('文件获取失败') + }) + break + // 证书 + case '7': + // getReviewRepFile({ + // id: row.id, + // pdf: true, + // }).then((res) => { + // exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + // }).catch(() => { + // ElMessage.error('文件获取失败') + // }) + break + case '6': + window.open(row.filePath, '_target') + // console.log(row.filePath) + // getReviewRepFile({ + // id: row.id, + // pdf: true, + // }).then((res) => { + // exportFile(res.data, `${row.fileName}-${row.fileCode}.pdf`) + // }).catch(() => { + // ElMessage.error('文件获取失败') + // }) + break + } + // window.open(row.filePath, '_blank') + // console.log(row, '111111111111111') + // 1.不符合要求情况分析表 + // 2.内部审核检查表 + // 3.内部审核不符合顶报告 + // 5.理评审报告 + // 7.证书 + // 6.其他 } diff --git a/src/views/quality/supervise/record/index.vue b/src/views/quality/supervise/record/index.vue index 777bc1e..7ed83c6 100644 --- a/src/views/quality/supervise/record/index.vue +++ b/src/views/quality/supervise/record/index.vue @@ -4,7 +4,7 @@ import filePreview from './components/filePreviewSingle.vue' import { getDictByCode } from '@/api/system/dict' import type { TableColumn } from '@/components/NormalTable/table_interface' -import { deleteQualityRecord, exportQualityRecord, getQualityRecordList, getSearchDept } from '@/api/quality/supervise/record' +import { deleteQualityRecord, exportQualityRecord, exportQualityRecordZip, getQualityRecordList, getSearchDept } from '@/api/quality/supervise/record' import { getUserList } from '@/api/system/user' import type { userType } from '@/views/system/user/user-interface' import pdfFileItem from '@/views/quality/supervise/record/components/pdfFileItem.vue' @@ -210,14 +210,14 @@ } const params = { ...listQuery.value, - // ids: checkoutList.value, + ids: checkoutList.value, } const loading = ElLoading.service({ lock: true, text: '下载中请稍后', background: 'rgba(255, 255, 255, 0.8)', }) - exportQualityRecord(params).then((res) => { + exportQualityRecordZip(params).then((res) => { const blob = new Blob([res.data]) loading.close() exportFile(blob, '证书监督记录.zip')