From 19da9193d5c890b5ff4484c35dfa5702a4154a2a Mon Sep 17 00:00:00 2001
From: liutao <790864623@qq.com>
Date: Thu, 11 Jun 2026 15:32:00 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=89=93=E5=8D=B0=E6=9C=BA?=
=?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/mes/printconfig/index.ts | 46 ++++++
src/locales/en.ts | 13 ++
src/locales/zh-CN.ts | 20 +++
src/views/mes/printconfig/ConfigForm.vue | 121 ++++++++++++++
src/views/mes/printconfig/index.vue | 200 +++++++++++++++++++++++
5 files changed, 400 insertions(+)
create mode 100644 src/api/mes/printconfig/index.ts
create mode 100644 src/views/mes/printconfig/ConfigForm.vue
create mode 100644 src/views/mes/printconfig/index.vue
diff --git a/src/api/mes/printconfig/index.ts b/src/api/mes/printconfig/index.ts
new file mode 100644
index 00000000..06314d8b
--- /dev/null
+++ b/src/api/mes/printconfig/index.ts
@@ -0,0 +1,46 @@
+import request from '@/config/axios'
+
+// 打印机配置 VO
+export interface ConfigVO {
+ id: number // 主键ID
+ hostName: string // 主机名(如PACKING-PC-01),不可修改
+ systemPrinterName: string // 系统打印机名称,关联下拉选项
+ isDefault: boolean // 是否默认:0-否,1-是
+ isEnabled: boolean // 是否启用:0-禁用,1-启用
+ remark: string // 备注,记录打印机用途说明,用户不可修改
+ createdAt: Date // 创建时间
+ updatedAt: Date // 更新时间
+}
+
+// 打印机配置 API
+export const ConfigApi = {
+ // 查询打印机配置分页
+ getConfigPage: async (params: any) => {
+ return await request.get({ url: `/printer/config/page`, params })
+ },
+
+ // 查询打印机配置详情
+ getConfig: async (id: number) => {
+ return await request.get({ url: `/printer/config/get?id=` + id })
+ },
+
+ // 新增打印机配置
+ createConfig: async (data: ConfigVO) => {
+ return await request.post({ url: `/printer/config/create`, data })
+ },
+
+ // 修改打印机配置
+ updateConfig: async (data: ConfigVO) => {
+ return await request.put({ url: `/printer/config/update`, data })
+ },
+
+ // 删除打印机配置
+ deleteConfig: async (id: number) => {
+ return await request.delete({ url: `/printer/config/delete?id=` + id })
+ },
+
+ // 导出打印机配置 Excel
+ exportConfig: async (params) => {
+ return await request.download({ url: `/printer/config/export-excel`, params })
+ },
+}
\ No newline at end of file
diff --git a/src/locales/en.ts b/src/locales/en.ts
index 392c338a..4c818b10 100644
--- a/src/locales/en.ts
+++ b/src/locales/en.ts
@@ -3229,6 +3229,19 @@ export default {
validatorTypeRequired: 'Template type can not be empty',
design: 'Design',
designTitle: 'Template Design'
+ },
+ PrintConfig: {
+ hostName: 'Host Name',
+ systemPrinterName: 'Printer Name',
+ defaultStatus: 'Is Default',
+ isEnable: 'Is Enabled',
+ remark: 'remark',
+ createTime: 'Create Time',
+ updateTime: 'Update Time',
+ operate: 'Operate',
+ placeholderHostName: 'Please input host name',
+ placeholderSystemPrinterName: 'Please input printer name',
+ placeholderRemark: 'Please input printer remark',
}
},
QualityManagement: {
diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts
index bcc9da21..9e5ad5aa 100644
--- a/src/locales/zh-CN.ts
+++ b/src/locales/zh-CN.ts
@@ -2719,6 +2719,26 @@ export default {
validatorTypeRequired: '模板类型不能为空',
design: '配置',
designTitle: '模板配置'
+ },
+ PrintConfig: {
+ hostName: '主机名',
+ systemPrinterName: '打印机名称',
+ defaultStatus: '是否默认',
+ isEnable: '是否启用',
+ remark: '备注',
+ createTime: '创建时间',
+ updateTime: '更新时间',
+ operate: '操作',
+ placeholderHostName: '请输入主机名',
+ placeholderSystemPrinterName: '请输入系统打印机名称',
+ placeholderTemplateType: '请选择模板类型',
+ placeholderTemplateJson: '请输入模板JSON内容',
+ placeholderRemark: '请输入备注',
+ validatorCodeRequired: '模板编码不能为空',
+ validatorNameRequired: '模板名称不能为空',
+ validatorTypeRequired: '模板类型不能为空',
+ design: '配置',
+ designTitle: '模板配置'
}
},
QualityManagement: {
diff --git a/src/views/mes/printconfig/ConfigForm.vue b/src/views/mes/printconfig/ConfigForm.vue
new file mode 100644
index 00000000..7331b26f
--- /dev/null
+++ b/src/views/mes/printconfig/ConfigForm.vue
@@ -0,0 +1,121 @@
+
+
+
+
diff --git a/src/views/mes/printconfig/index.vue b/src/views/mes/printconfig/index.vue
new file mode 100644
index 00000000..3f3d35e8
--- /dev/null
+++ b/src/views/mes/printconfig/index.vue
@@ -0,0 +1,200 @@
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('common.query') }}
+ {{ t('common.reset') }}
+
+ {{ t('action.add') }}
+
+
+ {{ t('action.export') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('action.edit') }}
+
+
+ {{ t('action.del') }}
+
+
+
+
+
+
+
+
+
+
+
+
+