From bb364bc555a85b4d6f93144037a445e6efbd1ad7 Mon Sep 17 00:00:00 2001
From: luojie <125330818@qq.com>
Date: Fri, 23 Jan 2026 22:14:48 +0800
Subject: [PATCH] =?UTF-8?q?feat:[=E6=A8=A1=E6=9D=BF=E7=AE=A1=E7=90=86][upd?=
=?UTF-8?q?ate]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Template/operation/TableOpertaion.vue | 19 ++++-
.../business/comps/template/TemplateTable.vue | 2 +-
.../comps/template/comps/sp/SWYPBQGZYZBB.vue | 22 +++---
.../comps/template/dialog/PrintTagDialog.vue | 80 ++++++++++++++++++++++
.../comps/template/dialog/SubPackageDialog.vue | 6 +-
.../comps/template/dialog/TagPrintDialog.vue | 41 -----------
.../comps/template/mixins/templateMixin.js | 18 +++++
7 files changed, 133 insertions(+), 55 deletions(-)
create mode 100644 src/views/business/comps/template/dialog/PrintTagDialog.vue
delete mode 100644 src/views/business/comps/template/dialog/TagPrintDialog.vue
diff --git a/src/components/Template/operation/TableOpertaion.vue b/src/components/Template/operation/TableOpertaion.vue
index fa02457..dbc61be 100644
--- a/src/components/Template/operation/TableOpertaion.vue
+++ b/src/components/Template/operation/TableOpertaion.vue
@@ -11,7 +11,7 @@
分装
开始配置
配置完成
- 打印标签
+ onPrintTag()">打印标签
@@ -45,7 +45,14 @@ export default {
EventBus.$on("dialogSubPackageSubmit", (data) => {
this.onSubPackageSubmit(data)
})
+ EventBus.$on("subPackageDialogPrintTag", (data) => {
+ this.onPrintTag(data)
+ })
},
+ destroyed() {
+ EventBus.$off("dialogSubPackageSubmit")
+ EventBus.$off("subPackageDialogPrintTag")
+ },
watch: {
row: {
handler(newVal, oldVal) {
@@ -69,8 +76,14 @@ export default {
this.$emit("configComplete", { rowData: this.innerRow, rowIndex: this.rowIndex, headerSelectFields: this.columns.headerSelectFields })
},
// 打印标签
- onPrintLabel() {
- this.$emit("printLabel", { rowData: this.innerRow, rowIndex: this.rowIndex, headerSelectFields: this.columns.headerSelectFields })
+ onPrintTag(data) {
+ if(data) {
+ if(data.rowIndex === this.rowIndex){
+ this.$emit("printTag", { printCode: data.printCode,type:"subPackage" })
+ }
+ }else{
+ this.$emit("printTag", { row: this.innerRow,type:"row" })
+ }
},
// 分装
onSubPackage() {
diff --git a/src/views/business/comps/template/TemplateTable.vue b/src/views/business/comps/template/TemplateTable.vue
index 838d9de..d1b5ca0 100644
--- a/src/views/business/comps/template/TemplateTable.vue
+++ b/src/views/business/comps/template/TemplateTable.vue
@@ -31,7 +31,7 @@ import Demo from "./comps/sp/Demo.vue";
import SYWZPZJHB from "./comps/gsp/SYWZPZJHB.vue";
import MJYLQSQD from "./comps/gsp/MJYLQSQD.vue";
import SubPackageDialog from "./dialog/SubPackageDialog.vue";//分装弹窗
-import TagPrintDialog from "./dialog/TagPrintDialog.vue";//标签打印弹窗
+import TagPrintDialog from "./dialog/PrintTagDialog.vue";//标签打印弹窗
export default {
name: "TemplateTable",
diff --git a/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue b/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
index 165e694..ecb69a3 100644
--- a/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
+++ b/src/views/business/comps/template/comps/sp/SWYPBQGZYZBB.vue
@@ -10,8 +10,8 @@
:formData="formData" />
-
+
@@ -255,7 +255,9 @@ export default {
// 清除相关字段的错误状态
this.formErrors.mfbzl = false;
},
- onPrint() { },
+ onPrint(item) {
+ EventBus.$emit('subPackageDialogPrintTag', {...this.formData, printCode: `${this.formData.mybh}-set${item.subCode}`});
+ },
onCommonBlur(e, field) {
if (this.formData[field]) {
this.formErrors[field] = false;
diff --git a/src/views/business/comps/template/dialog/TagPrintDialog.vue b/src/views/business/comps/template/dialog/TagPrintDialog.vue
deleted file mode 100644
index 731339b..0000000
--- a/src/views/business/comps/template/dialog/TagPrintDialog.vue
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
\ 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 7eb1989..0833ac3 100644
--- a/src/views/business/comps/template/mixins/templateMixin.js
+++ b/src/views/business/comps/template/mixins/templateMixin.js
@@ -129,6 +129,24 @@ export default {
this.setTemplateData({})
},
methods: {
+ //获取打印配置
+ getBasePrintConfig (data){
+ const { printCode,type,row } = data;
+ const {stepStorageCondition,startDate,expireDate} = this.formData;
+ const { nickName, name } = this.$store.getters;
+ const lang = this.$i18n.locale;
+ const printConfig = {
+ "品名":"暂时还不知道品名是哪个字段",
+ "存储条件":stepStorageCondition,
+ "配制日期":moment(startDate).format("YYYY-MM-DD"),
+ "有效期至":moment(expireDate).format("YYYY-MM-DD HH:mm"),
+ "配置者":lang === "zh_CN" ? nickName : name,
+ //type==="subPackage"从分装打印过来的,
+ //type==="row" 从列表上点过来的
+ "编号":type === "subPackage" ? printCode : (row.targetSolutionCode+row.subTargetSolutionCode),
+ }
+ return printConfig
+ },
async getLatestSn(count = 1) {
const res = await getLatestSn({ count })
if (res.code === 200) {