From 1747a0382619ef790ad83d2fc87a3a2cdfc35fe8 Mon Sep 17 00:00:00 2001 From: houjunxiang Date: Thu, 8 Jan 2026 15:40:44 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=89=93=E5=8D=B0=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nx/helper/print.js | 13 ++++++++++--- nx/store/company-dept.js | 3 +++ nx/store/user.js | 4 ++++ pages/analysis/sample/sample-work-edit-task.vue | 4 ++-- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/nx/helper/print.js b/nx/helper/print.js index 2c40e40..dc19617 100644 --- a/nx/helper/print.js +++ b/nx/helper/print.js @@ -224,7 +224,14 @@ export default { }) }, //调用send方法执行打印 - print(businessSubData) { + print( + businessSubData, + printParams = { + PrintPaperType: '64MM', + printCopies: 1, + showPrintDialog: false + } + ) { const { printTemplate } = businessSubData if (!printTemplate) return uni.showToast({ title: '样品未配置打印模板', icon: 'error' }) const me = this @@ -233,11 +240,11 @@ export default { data: [businessSubData] } let printData = { - type: 'preview', + type: 'print', + ...printParams, reportTemplate: res.content, reportData: JSON.stringify(reportData) } - console.log(printData) //连接打印服务 let printList = uni.getStorageSync('KEY_PRINT_LIST') diff --git a/nx/store/company-dept.js b/nx/store/company-dept.js index 61395a1..56441d1 100644 --- a/nx/store/company-dept.js +++ b/nx/store/company-dept.js @@ -72,6 +72,9 @@ const companyDeptStore = defineStore({ this.onCancel() } this.close() + }, + reset() { + Object.assign(this.$state, defaultState()) } } }) diff --git a/nx/store/user.js b/nx/store/user.js index b3a7a27..acb2d30 100644 --- a/nx/store/user.js +++ b/nx/store/user.js @@ -3,6 +3,7 @@ import userApi from '@/nx/api/user' import { getSysParameterBizByName } from '@/nx/api/sys' import md5 from 'md5' import nx from '@/nx' +import companyDeptStore from './company-dept' import { COMPANY_DEPT_RETRY_HEADER, VISIT_COMPANY_STORAGE_KEY, VISIT_DEPT_STORAGE_KEY } from '@/nx/config' // 默认用户信息 const defaultUserInfo = { @@ -131,6 +132,9 @@ const user = defineStore({ uni.removeStorageSync(COMPANY_DEPT_RETRY_HEADER) uni.removeStorageSync(VISIT_COMPANY_STORAGE_KEY) uni.removeStorageSync(VISIT_DEPT_STORAGE_KEY) + + const deptStore = companyDeptStore() + deptStore.reset() } } }) diff --git a/pages/analysis/sample/sample-work-edit-task.vue b/pages/analysis/sample/sample-work-edit-task.vue index 42886c2..3620d30 100644 --- a/pages/analysis/sample/sample-work-edit-task.vue +++ b/pages/analysis/sample/sample-work-edit-task.vue @@ -271,9 +271,9 @@ const realFormData = computed(() => { // 实际保存逻辑 async function handleSave(change) { let params = {} - const staticFieldKeys = staticFormSchema.map(item => item.fieldKey); + const dynamicData = Object.fromEntries( - Object.entries(realFormData.value).filter(([key]) => !staticFieldKeys.includes(key)) + Object.entries(realFormData.value).filter(([key]) => key !== 'assayTime') ); console.log(dynamicData) if (change) {