diff --git a/src/views/business/manager/sendReceive/components/basic.vue b/src/views/business/manager/sendReceive/components/basic.vue index 2ced226..1ef14e0 100644 --- a/src/views/business/manager/sendReceive/components/basic.vue +++ b/src/views/business/manager/sendReceive/components/basic.vue @@ -21,6 +21,7 @@ type: String, }, }) +const emits = defineEmits(['givePrintForm']) const user = useUserStore() // 用户信息 const countryList = ref(countries) // 国家列表 const testTask = ref([]) @@ -151,6 +152,11 @@ // }) loading.value = true getDetailBaseInfo({ equipmentId: props.equipmentId! }).then((res) => { + emits('givePrintForm', { + manufactureNo: res.data.manufactureNo, // 出厂编号 + measureValidDate: res.data.certificateValid, // 检定有效期、证书有效期 + createUserName: res.data.directorName, // 负责人 + }) form.value = res.data attachmentList.value = res.data.attachmentList // 主附件信息 technicalTargetList.value = res.data.technicalTargetList // 技术指标 diff --git a/src/views/business/manager/sendReceive/components/basic.vue b/src/views/business/manager/sendReceive/components/basic.vue index 2ced226..1ef14e0 100644 --- a/src/views/business/manager/sendReceive/components/basic.vue +++ b/src/views/business/manager/sendReceive/components/basic.vue @@ -21,6 +21,7 @@ type: String, }, }) +const emits = defineEmits(['givePrintForm']) const user = useUserStore() // 用户信息 const countryList = ref(countries) // 国家列表 const testTask = ref([]) @@ -151,6 +152,11 @@ // }) loading.value = true getDetailBaseInfo({ equipmentId: props.equipmentId! }).then((res) => { + emits('givePrintForm', { + manufactureNo: res.data.manufactureNo, // 出厂编号 + measureValidDate: res.data.certificateValid, // 检定有效期、证书有效期 + createUserName: res.data.directorName, // 负责人 + }) form.value = res.data attachmentList.value = res.data.attachmentList // 主附件信息 technicalTargetList.value = res.data.technicalTargetList // 技术指标 diff --git a/src/views/business/manager/sendReceive/components/templateDetail.vue b/src/views/business/manager/sendReceive/components/templateDetail.vue index 9559e24..2ed1d72 100644 --- a/src/views/business/manager/sendReceive/components/templateDetail.vue +++ b/src/views/business/manager/sendReceive/components/templateDetail.vue @@ -10,6 +10,7 @@ import sendReceiveCertificate from './certificate.vue' import { tagBinding } from '@/api/reader' import scanEquipmentDialog from '@/components/scanEquipmentDialog/index.vue' +import printThreeInfo from '@/views/business/taskMeasure/print/components/label/printThreeInfo.vue' const props = defineProps({ radioMenus: { @@ -98,13 +99,50 @@ customerId.value = customerIdParam console.log('委托方id', customerId.value) } + +// ------------------------------------------标识打印------------------------------------------ +const printObj = ref({ + id: 'html', // 需要打印元素的id + popTitle: '', // 打印配置页上方的标题 + extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割 + preview: false, // 是否启动预览模式,默认是false + previewBeforeOpenCallback() { console.log('正在加载预览窗口!') }, // 预览窗口打开之前的callback + previewOpenCallback() { console.log('已经加载完预览窗口,预览打开了!') }, // 预览窗口打开时的callback + beforeOpenCallback() { console.log('开始打印之前!') }, // 开始打印之前的callback + openCallback() { console.log('执行打印了!') }, // 调用打印时的callback + closeCallback() { console.log('关闭了打印工具!') }, // 关闭打印的callback(无法区分确认or取消) + clickMounted() { console.log('点击v-print绑定的按钮了!') }, + standard: '', + extarCss: '', +}) +const printForm = ref<{ [key: string]: string }>({ + manufactureNo: '', + year: '', + month: '', + day: '', + personName: '', +}) + +const givePrintForm = (form: any) => { + printForm.value = { + manufactureNo: form.manufactureNo || '', + year: form.measureValidDate.slice(0, 4), + month: form.measureValidDate.slice(5, 7), + day: form.measureValidDate.slice(8, 10), + personName: form.createUserName, + } + console.log('打印内容', printForm.value) +}