From 77875ece30740024d0a251774598f9fdf0d9fa2b Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Sat, 28 Feb 2026 11:41:49 +0800 Subject: [PATCH 1/8] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86]?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/business/resource/gsp/comps/gsp/Xq.vue | 3 ++- src/views/business/resource/gyzj/comps/gyzj/Xq.vue | 3 ++- src/views/business/resource/mjy/comps/mjy/Xq.vue | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/business/resource/gsp/comps/gsp/Xq.vue b/src/views/business/resource/gsp/comps/gsp/Xq.vue index 00f2e48..6f2045a 100644 --- a/src/views/business/resource/gsp/comps/gsp/Xq.vue +++ b/src/views/business/resource/gsp/comps/gsp/Xq.vue @@ -135,6 +135,7 @@ export default { components: { JcgjList, }, data() { return { + appTitle: process.env.VUE_APP_TITLE, form: {}, tzList: [], totalTz: 0, @@ -159,7 +160,7 @@ export default { methods: { exportPDF() { this.$modal.loading() - exportDetail({ id: this.form.id,lang:this.$store.getters.language.split("_")[0] }).then(response => { + exportDetail({ id: this.form.id,lang:this.$store.getters.language.split("_")[0],version:this.appTitle }).then(response => { window.open(process.env.VUE_APP_FILE_DOMAIN +response.msg) this.saveSimpleLog({name:this.form.bh,nameEn:this.form.bh,jcmc:'供试品导出',jcmcEn:'Test Item Export'}) this.$modal.closeLoading() diff --git a/src/views/business/resource/gyzj/comps/gyzj/Xq.vue b/src/views/business/resource/gyzj/comps/gyzj/Xq.vue index b851d7e..3bb2f68 100644 --- a/src/views/business/resource/gyzj/comps/gyzj/Xq.vue +++ b/src/views/business/resource/gyzj/comps/gyzj/Xq.vue @@ -162,6 +162,7 @@ export default { data() { return { form: {}, + appTitle: process.env.VUE_APP_TITLE, tzList: [], totalTz: 0, loadingTz: true, @@ -185,7 +186,7 @@ export default { methods: { exportExcel() { this.$modal.loading() - exportDetail({ id: this.form.id,lang:this.$store.getters.language.split("_")[0] }).then(response => { + exportDetail({ id: this.form.id,lang:this.$store.getters.language.split("_")[0],version:this.appTitle }).then(response => { window.open(process.env.VUE_APP_FILE_DOMAIN +response.msg) this.$modal.closeLoading() }).finally(() => { diff --git a/src/views/business/resource/mjy/comps/mjy/Xq.vue b/src/views/business/resource/mjy/comps/mjy/Xq.vue index fa465f2..bde5a58 100644 --- a/src/views/business/resource/mjy/comps/mjy/Xq.vue +++ b/src/views/business/resource/mjy/comps/mjy/Xq.vue @@ -160,6 +160,7 @@ export default { data() { return { form: {}, + appTitle: process.env.VUE_APP_TITLE, tzList: [], totalTz: 0, loadingTz: true, @@ -183,7 +184,7 @@ export default { methods: { exportExcel() { this.$modal.loading() - exportDetail({ id: this.form.id,lang:this.$store.getters.language.split("_")[0] }).then(response => { + exportDetail({ id: this.form.id,lang:this.$store.getters.language.split("_")[0],version:this.appTitle }).then(response => { window.open(process.env.VUE_APP_FILE_DOMAIN +response.msg) this.$modal.closeLoading() }).finally(() => { From b2ec59b2f81509b5bd48a5e1ea2c6ed5c566f8eb Mon Sep 17 00:00:00 2001 From: "15881625488@163.com" <15881625488@163.com> Date: Sat, 28 Feb 2026 12:26:54 +0800 Subject: [PATCH 2/8] =?UTF-8?q?fix:[=E8=A1=A8=E5=8D=95=E7=AE=A1=E7=90=86]?= =?UTF-8?q?=E7=89=A9=E8=B5=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en/template/commonTemplate.js | 6 + src/lang/zh/template/commonTemplate.js | 6 + .../business/comps/template/TemplateTable.vue | 5 +- .../business/comps/template/comps/dl/SYWZPZJHB.vue | 232 ----------- .../comps/template/comps/gsp/DMYPPZJLB.vue | 4 +- .../business/comps/template/comps/gsp/GSP001.vue | 441 +++++++++++++++++++++ .../business/comps/template/comps/gsp/GSP002.vue | 5 +- .../business/comps/template/comps/gsp/GSP003.vue | 4 +- .../business/comps/template/comps/gsp/GSP004.vue | 4 +- .../business/comps/template/comps/gsp/GSP009.vue | 4 +- .../business/comps/template/comps/gsp/GSP010.vue | 4 +- .../business/comps/template/comps/sp/SP001.vue | 4 +- .../business/comps/template/comps/sp/SP003.vue | 3 +- .../business/comps/template/comps/sp/SP00456.vue | 3 +- .../comps/template/mixins/templateMixin.js | 66 ++- 15 files changed, 532 insertions(+), 259 deletions(-) delete mode 100644 src/views/business/comps/template/comps/dl/SYWZPZJHB.vue create mode 100644 src/views/business/comps/template/comps/gsp/GSP001.vue diff --git a/src/lang/en/template/commonTemplate.js b/src/lang/en/template/commonTemplate.js index cf744fc..08f96da 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', diff --git a/src/lang/zh/template/commonTemplate.js b/src/lang/zh/template/commonTemplate.js index e38b352..1fa0ae9 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: '仪器使用信息', 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 @@
- - + Date: Sat, 28 Feb 2026 12:51:36 +0800 Subject: [PATCH 3/8] =?UTF-8?q?fix:[=E7=89=A9=E8=B5=84=E5=88=97=E8=A1=A8]?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lang/en/template/commonTemplate.js | 2 +- src/lang/zh/template/commonTemplate.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lang/en/template/commonTemplate.js b/src/lang/en/template/commonTemplate.js index 08f96da..631b9c8 100644 --- a/src/lang/en/template/commonTemplate.js +++ b/src/lang/en/template/commonTemplate.js @@ -70,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/template/commonTemplate.js b/src/lang/zh/template/commonTemplate.js index 1fa0ae9..5c63563 100644 --- a/src/lang/zh/template/commonTemplate.js +++ b/src/lang/zh/template/commonTemplate.js @@ -71,7 +71,7 @@ export default { reagentExpireDate: '失效日', // 物资信息列 - wzName: '名称', + wzName: '名称/代号', wzCode: '编号', wzConcentration: '浓度', wzSource: '物资来源', From c60c45d9da3ac89e7c58c3dd49114f8894293907 Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Sat, 28 Feb 2026 14:07:24 +0800 Subject: [PATCH 4/8] =?UTF-8?q?fix:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86]e?= =?UTF-8?q?xcel=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.js | 18 +++++++ .../comps/template/mixins/templateMixin.js | 57 ++++------------------ 2 files changed, 28 insertions(+), 47 deletions(-) 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/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js index 46b73ea..7ccff69 100644 --- a/src/views/business/comps/template/mixins/templateMixin.js +++ b/src/views/business/comps/template/mixins/templateMixin.js @@ -1,10 +1,11 @@ import moment from 'moment' import { getLatestSn, getLatestSnArr } from '@/api/template'; -import { isValueEmpty } from '@/utils/index'; +import { isValueEmpty, getStringWidth } from '@/utils/index'; import { isCommonUnit } from "@/utils/conTools"; import { sj_subpackage, sj_startConfiguration, sj_configurationCompleted } from '@/api/business/sj/sj'; import {convertConcentration} from "@/utils/conConverter";//浓度单位转换 import {volumeConverter} from "@/utils/volConverter";//体积单位转换 +import * as XLSX from 'xlsx' export default { dicts: [ 'business_pztj', @@ -602,54 +603,16 @@ export default { } }, // 导出excel模板 - exportExcel(rows, title) { + exportExcel(headerArray, title = '导出模板') { this.$modal.loading() - // 生成表头 - let tableHtml = ''; - tableHtml += ''; - rows.forEach(item => { - tableHtml += ''; - }); - tableHtml += '
' + item + '
'; // 正确闭合 - - // 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() }, + } } From 382344b2dce825e2ed9ed87ab9fc3c89881e0083 Mon Sep 17 00:00:00 2001 From: HanLong <404402223@qq.com> Date: Sat, 28 Feb 2026 14:23:36 +0800 Subject: [PATCH 5/8] =?UTF-8?q?fix:[=E8=AF=95=E9=AA=8C=E7=AE=A1=E7=90=86][?= =?UTF-8?q?=E8=AF=95=E9=AA=8C=E9=94=81=E5=AE=9A]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/business/form/nonTrial/comp/syffList.vue | 5 +++-- src/views/business/study/comp/syffList.vue | 11 ++++++----- src/views/business/study/comp/syjList.vue | 5 +++-- src/views/business/study/comp/wzlb/bacteriaList.vue | 2 +- src/views/business/study/comp/wzlb/cellList.vue | 4 ++-- src/views/business/study/comp/wzlb/gspList.vue | 2 +- src/views/business/study/comp/wzlb/gyzjList.vue | 2 +- src/views/business/study/comp/wzlb/mjyList.vue | 2 +- src/views/business/study/comp/wzlb/sjList.vue | 2 +- 9 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/views/business/form/nonTrial/comp/syffList.vue b/src/views/business/form/nonTrial/comp/syffList.vue index 463f1d5..d574c8b 100644 --- a/src/views/business/form/nonTrial/comp/syffList.vue +++ b/src/views/business/form/nonTrial/comp/syffList.vue @@ -41,7 +41,7 @@
- + {{ $t('page.business.study.studyMethod.scff') }} @@ -58,7 +58,7 @@ -