From bf030e30ac391f13d527f3f12650d599a80e0fcc Mon Sep 17 00:00:00 2001
From: HanLong <404402223@qq.com>
Date: Fri, 27 Feb 2026 17:13:26 +0800
Subject: [PATCH] =?UTF-8?q?feat:[=E8=AF=95=E9=AA=8C=E7=AE=A1=E7=90=86][?=
=?UTF-8?q?=E8=AF=95=E9=AA=8C=E6=96=B9=E6=B3=95=E7=AE=A1=E7=90=86]?=
=?UTF-8?q?=E5=85=B3=E9=97=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/business/study/studyMethod.js | 9 +++
src/lang/en/business/study/studyMethod.js | 7 +-
src/lang/zh/business/study/studyMethod.js | 7 +-
.../comps/template/mixins/templateMixin.js | 78 +++++++++++++---------
src/views/business/study/comp/syffList.vue | 51 ++++++++++++--
vue.config.js | 4 +-
6 files changed, 114 insertions(+), 42 deletions(-)
diff --git a/src/api/business/study/studyMethod.js b/src/api/business/study/studyMethod.js
index fefd8d1..96a3171 100644
--- a/src/api/business/study/studyMethod.js
+++ b/src/api/business/study/studyMethod.js
@@ -57,3 +57,12 @@ export function studyMethod_getReadAllMethodStatus(query) {
params: query
})
}
+
+// 关闭方法
+export function studyMethod_close(data) {
+ return request({
+ url: '/system/business/studyMethod/close',
+ method: 'post',
+ data: data
+ })
+}
\ 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 1a024f6..58f03d1 100644
--- a/src/lang/en/business/study/studyMethod.js
+++ b/src/lang/en/business/study/studyMethod.js
@@ -17,5 +17,10 @@ export default {
qmsj: 'Date',
qmyy: 'Meaning of Signature',
remark: 'Comment',
- qyd:'Go Read'
+ qyd:'Go Read',
+ gb: 'Close',
+ sfgb: 'Closed',
+ s: 'Yes',
+ f: 'No',
+ qrgb: 'Confirm Close?',
}
diff --git a/src/lang/zh/business/study/studyMethod.js b/src/lang/zh/business/study/studyMethod.js
index f78025a..7d42696 100644
--- a/src/lang/zh/business/study/studyMethod.js
+++ b/src/lang/zh/business/study/studyMethod.js
@@ -17,5 +17,10 @@ export default {
qmsj: '签名时间',
qmyy: '签名意义',
remark: '备注',
- qyd:'去阅读'
+ qyd:'去阅读',
+ gb: '关闭',
+ sfgb: '是否关闭',
+ s: '是',
+ f: '否',
+ qrgb: '确认关闭?',
}
\ No newline at end of file
diff --git a/src/views/business/comps/template/mixins/templateMixin.js b/src/views/business/comps/template/mixins/templateMixin.js
index 9c03997..331a3ce 100644
--- a/src/views/business/comps/template/mixins/templateMixin.js
+++ b/src/views/business/comps/template/mixins/templateMixin.js
@@ -360,7 +360,7 @@ export default {
}
}
}
-
+
},
//统一处理blur事件,因为有效周期和过期日期是相关的,所以需要在有效周期失焦时更新过期日期
onHandleBlur(fields) {
@@ -523,7 +523,7 @@ export default {
return;
}
const targetStartVolUnit = targetSolutionConcentrationUnit.split("/")[1];//先按照预设目标溶液浓度的单位标准
-
+
//将起始溶液浓度转换为和预设目标溶液浓度一样的单位再计算;
const converStartCon = convertConcentration.convert(volume+subTargetStartSolution,targetSolutionConcentrationUnit)
//将预设目标溶液体积转换为和预设目标溶液浓度单位的分母一样的单位再计算;如:预设目标溶液浓度单位为mg/mL,预设目标溶液体积单位为uL,则将预设目标溶液体积转换为mL
@@ -549,37 +549,53 @@ export default {
},
// 导出excel模板
exportExcel(rows, title) {
- let that = this
- that.$modal.loading()
- var tabelStr =
- '
' +
- ''
-
+ this.$modal.loading()
+ // 生成表头
+ let tableHtml = '';
+ tableHtml += '';
rows.forEach(item => {
- tabelStr = tabelStr + '| ' + item + ' | '
- })
- tabelStr = tabelStr + '
'
+ tableHtml += '| ' + item + ' | ';
+ });
+ tableHtml += '
'; // 正确闭合
+
+ // Worksheet 名称
+ const worksheet = title ? title : '导入模板';
+
+ // 完整的 HTML 模板(包含编码声明和 Excel 兼容命名空间)
+ const exportTemplate = `
+
+
+
+
+
+
+ ${tableHtml}
+
+ `;
- // Worksheet名
- var worksheet = title ? title : '导入模板'
- var uri = 'data:application/vnd.ms-excel;base64,'
- // 真正要导出(下载)的HTML模板
- var exportTemplate = `
-
-
-
- ${tabelStr}
-
- `
- var a = document.createElement('a')
- a.download = worksheet + '.xls'
- a.href = uri + window.btoa(unescape(encodeURIComponent(exportTemplate)))
- a.click()
- that.$modal.closeLoading()
+ // 使用 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); // 释放内存
+ this.$modal.closeLoading()
},
}
}
diff --git a/src/views/business/study/comp/syffList.vue b/src/views/business/study/comp/syffList.vue
index 463f1d5..dbd6354 100644
--- a/src/views/business/study/comp/syffList.vue
+++ b/src/views/business/study/comp/syffList.vue
@@ -57,6 +57,12 @@
{{ $t('page.business.study.studyMethod.weidu') }}
+
+
+ {{ $t('page.business.study.studyMethod.s') }}
+ {{ $t('page.business.study.studyMethod.f') }}
+
+
@@ -65,6 +71,10 @@
{{
$t('page.business.study.studyMethod.daochu') }}
+
+ {{
+ $t('page.business.study.studyMethod.gb') }}
@@ -76,15 +86,18 @@
-
+
+
+