diff --git a/src/api/business/sj/sj.js b/src/api/business/sj/sj.js index d134100..47448a6 100644 --- a/src/api/business/sj/sj.js +++ b/src/api/business/sj/sj.js @@ -177,3 +177,12 @@ export function sj_configurationCompleted(data) { data: data }) } + +// 详情pdf导出 +export function exportDetail(query) { + return request({ + url: '/system/business/sj/exportDetail', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/src/lang/en/business/study/studyMethod.js b/src/lang/en/business/study/studyMethod.js index 58f03d1..5cf34a1 100644 --- a/src/lang/en/business/study/studyMethod.js +++ b/src/lang/en/business/study/studyMethod.js @@ -17,6 +17,9 @@ export default { qmsj: 'Date', qmyy: 'Meaning of Signature', remark: 'Comment', + ts: '', + gbts: 'This method has been closed, no need to read!', + jcyd: '坚持阅读', qyd:'Go Read', gb: 'Close', sfgb: 'Closed', diff --git a/src/lang/en/template/commonTemplate.js b/src/lang/en/template/commonTemplate.js index cf744fc..631b9c8 100644 --- a/src/lang/en/template/commonTemplate.js +++ b/src/lang/en/template/commonTemplate.js @@ -20,6 +20,12 @@ export default { jtpz:'阶梯配制', // 字段标签 + sjInfo:'Reagent Info', + gyzjInfo:'Formulation Info', + gspInfo:'Specimen Info', + gspsywzInfo:'试验物资信息', + mjyInfo:'Controlled Drug Info', + storageConditionLabel: 'Storage Condition', testName: 'Study Name', testNumber: 'Study Number', @@ -64,7 +70,7 @@ export default { reagentExpireDate: 'Expiration Date', // 物资信息列 - wzName: 'Name', + wzName: 'Name/Code', wzCode: 'Item Number', wzConcentration: 'Concentration', wzSource: 'Source', diff --git a/src/lang/zh/business/study/studyMethod.js b/src/lang/zh/business/study/studyMethod.js index 7d42696..48cb5c9 100644 --- a/src/lang/zh/business/study/studyMethod.js +++ b/src/lang/zh/business/study/studyMethod.js @@ -20,6 +20,8 @@ export default { qyd:'去阅读', gb: '关闭', sfgb: '是否关闭', + gbts: '该方法已关闭,无需阅读!', + jcyd: '坚持阅读', s: '是', f: '否', qrgb: '确认关闭?', diff --git a/src/lang/zh/template/commonTemplate.js b/src/lang/zh/template/commonTemplate.js index e38b352..5c63563 100644 --- a/src/lang/zh/template/commonTemplate.js +++ b/src/lang/zh/template/commonTemplate.js @@ -4,6 +4,12 @@ export default { // 标签 baseInfo: '试验基本信息', + sjInfo:'试验试剂信息', + gyzjInfo:'给药制剂信息', + gspInfo:'供试品信息', + gspsywzInfo:'试验物资信息', + mjyInfo:'麻精药信息', + reagentInfo: '试验试剂信息', wzInfo: '试验物资信息', instrumentInfo: '仪器使用信息', @@ -65,7 +71,7 @@ export default { reagentExpireDate: '失效日', // 物资信息列 - wzName: '名称', + wzName: '名称/代号', wzCode: '编号', wzConcentration: '浓度', wzSource: '物资来源', diff --git a/src/utils/index.js b/src/utils/index.js index 2eb7065..7c1eceb 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -563,3 +563,21 @@ export function isRegent(item, fieldCode = 'type') { ] return typeList.includes(type) } +/** + * 估算字符串在 Excel 中的显示宽度(简单规则:中文字符算2,英文字符算1) + * @param {string} str 要计算的字符串 + * @returns {number} 估算宽度 + */ +export function getStringWidth(str) { + if (!str) return 0 + let width = 0 + for (let char of str.toString()) { + // 中文字符范围(可根据需要扩展) + if (/[\u4e00-\u9fa5]/.test(char)) { + width += 2 + } else { + width += 1 + } + } + return width +} diff --git a/src/views/business/comps/template/TemplateTable.vue b/src/views/business/comps/template/TemplateTable.vue index a5d7f89..19c13ac 100644 --- a/src/views/business/comps/template/TemplateTable.vue +++ b/src/views/business/comps/template/TemplateTable.vue @@ -33,6 +33,7 @@ import SP009 from "./comps/sp/SP009.vue"; import SP0019 from "./comps/sp/SP0019.vue"; import Demo from "./comps/sp/Demo.vue"; //供试品 +import GSP001 from "./comps/gsp/GSP001.vue"; import GSP002 from "./comps/gsp/GSP002.vue"; import GSP003 from "./comps/gsp/GSP003.vue"; import GSP004 from "./comps/gsp/GSP004.vue"; @@ -98,7 +99,7 @@ export default { //试验物质配制计划表/麻精药领取申请单/毒麻药品配制记录表 MJYLQSQD, SYWZPZJHB, DMYPPZJLB, //供试品 - GSP002, GSP003, GSP004,GSP009, GSP010, + GSP001,GSP002, GSP003, GSP004,GSP009, GSP010, //色谱 SP001, SP003, SP00456,SP007, SP008, SP009,SP0019, // PCR @@ -188,7 +189,7 @@ export default { 'SP019': 'SP0019', //供试品 - 'GSP001': 'DMYPPZJLB', + 'GSP001': 'GSP001', 'GSP002': 'GSP002', 'GSP003': 'GSP003', 'GSP004': 'GSP004', diff --git a/src/views/business/comps/template/comps/dl/SYWZPZJHB.vue b/src/views/business/comps/template/comps/dl/SYWZPZJHB.vue deleted file mode 100644 index 39d145d..0000000 --- a/src/views/business/comps/template/comps/dl/SYWZPZJHB.vue +++ /dev/null @@ -1,232 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue b/src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue index d8674fb..e93b860 100644 --- a/src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue +++ b/src/views/business/comps/template/comps/gsp/DMYPPZJLB.vue @@ -10,8 +10,8 @@ - - + + + + + + \ No newline at end of file diff --git a/src/views/business/comps/template/comps/gsp/GSP002.vue b/src/views/business/comps/template/comps/gsp/GSP002.vue index 9532c95..6ce5379 100644 --- a/src/views/business/comps/template/comps/gsp/GSP002.vue +++ b/src/views/business/comps/template/comps/gsp/GSP002.vue @@ -8,8 +8,9 @@
- - + + + diff --git a/src/views/business/comps/template/comps/gsp/GSP003.vue b/src/views/business/comps/template/comps/gsp/GSP003.vue index 672b2df..2c1e59b 100644 --- a/src/views/business/comps/template/comps/gsp/GSP003.vue +++ b/src/views/business/comps/template/comps/gsp/GSP003.vue @@ -10,8 +10,8 @@ - - + + - - + + - - + + diff --git a/src/views/business/comps/template/comps/gsp/GSP010.vue b/src/views/business/comps/template/comps/gsp/GSP010.vue index f66495a..d947da1 100644 --- a/src/views/business/comps/template/comps/gsp/GSP010.vue +++ b/src/views/business/comps/template/comps/gsp/GSP010.vue @@ -10,8 +10,8 @@ - - + + diff --git a/src/views/business/comps/template/comps/sp/SP001.vue b/src/views/business/comps/template/comps/sp/SP001.vue index fabb77a..f4e8766 100644 --- a/src/views/business/comps/template/comps/sp/SP001.vue +++ b/src/views/business/comps/template/comps/sp/SP001.vue @@ -8,9 +8,7 @@
- - + - - + diff --git a/src/views/business/comps/template/comps/sp/SP00456.vue b/src/views/business/comps/template/comps/sp/SP00456.vue index a20ca1d..6b27430 100644 --- a/src/views/business/comps/template/comps/sp/SP00456.vue +++ b/src/views/business/comps/template/comps/sp/SP00456.vue @@ -8,8 +8,7 @@
- - + { - tableHtml += '' + item + ''; - }); - tableHtml += ''; // 正确闭合 - - // Worksheet 名称 - const worksheet = title ? title : '导入模板'; - - // 完整的 HTML 模板(包含编码声明和 Excel 兼容命名空间) - const exportTemplate = ` - - - - - - - ${tableHtml} - - `; - - // 使用 Blob 生成文件(指定 MIME 类型为 application/vnd.ms-excel) - const blob = new Blob([exportTemplate], { type: 'application/vnd.ms-excel;charset=utf-8' }); - const link = document.createElement('a'); - link.href = URL.createObjectURL(blob); - link.download = worksheet + '.xls'; - link.click(); - URL.revokeObjectURL(link.href); // 释放内存 + const ws = XLSX.utils.aoa_to_sheet([headerArray]); + const colWidths = headerArray.map(cell => getStringWidth(cell) + 2); + ws['!cols'] = colWidths.map(width => ({ wch: width })); + const wb = XLSX.utils.book_new(); + XLSX.utils.book_append_sheet(wb, ws, 'Sheet1'); + XLSX.writeFile(wb, `${title}.xlsx`); this.$modal.closeLoading() }, + } } diff --git a/src/views/business/form/nonTrial/comp/syffList.vue b/src/views/business/form/nonTrial/comp/syffList.vue index 463f1d5..96c6941 100644 --- a/src/views/business/form/nonTrial/comp/syffList.vue +++ b/src/views/business/form/nonTrial/comp/syffList.vue @@ -40,7 +40,7 @@
- + {{ $t('page.business.study.studyMethod.scff') }} @@ -51,20 +51,30 @@ - + - + + + + @@ -76,15 +86,18 @@ - + + +