diff --git a/package.json b/package.json index 947479a..ee0e140 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "jquery": "^3.7.1", "js-beautify": "^1.14.11", "js-cookie": "3.0.5", + "jsbarcode": "^3.12.1", "jsencrypt": "3.3.2", "nprogress": "0.2.0", "pinia": "2.1.7", @@ -32,6 +33,7 @@ "vue": "3.4.0", "vue-cropper": "1.1.1", "vue-router": "4.2.5", + "vue3-print-nb": "^0.1.4", "vue3-select2-component": "^0.1.7", "vuedraggable": "^4.1.0" }, diff --git a/src/api/mzcx/cydj.js b/src/api/mzcx/cydj.js index 61b363f..4e937bc 100644 --- a/src/api/mzcx/cydj.js +++ b/src/api/mzcx/cydj.js @@ -8,7 +8,21 @@ export function querySQD(query) { params: query }) } - +// 查询采样登记列表 +export function printBarcode(query) { + return request({ + url: '/mzcx/printBarcode', + method: 'get', + params: query + }) +} +export function printBarcodeall(data) { + return request({ + url: '/mzcx/printBarcode', + method: 'post', + data: data + }) +} // 查询采样登记详细 export function getReqmain(sqh) { return request({ diff --git a/src/main.js b/src/main.js index 48efb02..377ca16 100644 --- a/src/main.js +++ b/src/main.js @@ -48,7 +48,7 @@ import ImagePreview from "@/components/ImagePreview" import TreeSelect from '@/components/TreeSelect' // 字典标签组件 import DictTag from '@/components/DictTag' - +import Print from 'vue3-print-nb'; const app = createApp(App) // 全局方法挂载 @@ -74,7 +74,8 @@ app.component('Editor', Editor) //VUE3标准方法注入全局方法 app.provide('comDict', comDict); - +app.use(Print); // 注册打印插件 +app.provide('$vuePrint', app.config.globalProperties.$vuePrint); app.use(router) app.use(store) app.use(plugins) diff --git a/src/views/mzcx/cydj/components/BarcodePrinter.vue b/src/views/mzcx/cydj/components/BarcodePrinter.vue new file mode 100644 index 0000000..6811ec4 --- /dev/null +++ b/src/views/mzcx/cydj/components/BarcodePrinter.vue @@ -0,0 +1,181 @@ + + + + + {{ $slots.default() }} + 打印条码 + + + + + + + {{ printTitle }} + + + + 条码号:{{ item.sqh }} + 患者:{{ item.brxm }} + 项目:{{ item.sqxmmc }} + + + + + + + + + \ No newline at end of file diff --git a/src/views/mzcx/cydj/components/printtest.vue b/src/views/mzcx/cydj/components/printtest.vue new file mode 100644 index 0000000..e2eff64 --- /dev/null +++ b/src/views/mzcx/cydj/components/printtest.vue @@ -0,0 +1,633 @@ + + + + + + + + + 就诊卡号/病历号/磁卡号: + + + + + {{item.label}} + + + 申请获取期限: + + + + {{item.label}} + + + + + + + + + 读卡 + + + 查找病人 + + + + + + + + + 查询 + + + 打印 + + + 单打条码 + + + 单打回单 + + + 取消采样 + + + + 打印条码 + + + + + + + + + + + + + + + {{ parseTime(scope.row.sqsj, '{y}-{m}-{d} {h}:{i}:{s}') }} + + + + + + + + + + + + + + + + + + + + + + + + + {{ parseTime(scope.row.brsr, '{y}-{m}-{d}') }} + + + + + + + + + + {{ parseTime(scope.row.cysj, '{y}-{m}-{d} {h}:{i}:{s}') }} + + + + + + + 条码数: + {{ idsnew.length }} + + + 项目数: + {{ totalRows }} + + + 合计金额: + {{ totalPrice.toFixed(2) }} + + + + + + + + diff --git a/src/views/mzcx/cydj/index.vue b/src/views/mzcx/cydj/index.vue index 15f9015..59d0b85 100644 --- a/src/views/mzcx/cydj/index.vue +++ b/src/views/mzcx/cydj/index.vue @@ -164,7 +164,15 @@