From 42eff8ad73e1da5f5a2b71113e179308ced81839 Mon Sep 17 00:00:00 2001 From: bianyaqi Date: Tue, 9 May 2023 17:34:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E4=BC=A0=E5=8F=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E7=AD=BE=E5=AD=97=E7=89=88=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/components/360View/img-editor.vue | 71 +++++++++++------ src/components/360View/index1.vue | 8 +- .../views/modules/formList/mraOrder.vue | 79 ++++++++++++++++--- .../reservation/schedule/addPatientOrder.vue | 3 +- 5 files changed, 120 insertions(+), 42 deletions(-) diff --git a/package.json b/package.json index c8100ee..08e817c 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "echarts": "^4.9.0", "element-resize-detector": "^1.2.3", "element-ui": "^2.13.2", + "fabric": "^5.3.0", "file-saver": "^2.0.5", "hammerjs": "^2.0.8", "jquery": "^3.6.0", diff --git a/src/components/360View/img-editor.vue b/src/components/360View/img-editor.vue index 1ffc301..d2bf2bf 100644 --- a/src/components/360View/img-editor.vue +++ b/src/components/360View/img-editor.vue @@ -25,6 +25,7 @@ import 'tui-image-editor/dist/tui-image-editor.css' import 'tui-color-picker/dist/tui-color-picker.css' import ImageEditor from 'tui-image-editor' +import { fabric } from 'fabric' // 汉化 const locale_zh = { // override default English locale to your custom @@ -199,12 +200,50 @@ export default { instance: null, textOne: '', textTwo: '', - textThree: '' + textThree: '', + editorOptions: { + includeUI: { + loadImage: { + path: '', + name: 'image' + }, + // menu: ['crop', 'rotate', 'draw', 'shape', 'icon', 'text', 'filter'], // 底部菜单按钮列表 隐藏镜像flip和遮罩mask + initMenu: 'draw', + selectionStyle: { + lineWidth: 5, + borderColor: '#000000' + }, + menuBarPosition: 'bottom', + locale: locale_zh, // 本地化语言为中文 + theme: customTheme // 自定义主题 + }, + fabricConfig: { + // 添加背景颜色 + backgroundColor: 'rgba(255, 255, 255, 1)', + // 禁用缩放 + scalable: false, + // 添加自定义图形 + customShapes: [ + { + name: 'triangle', + icon: 'path://M0,0 L50,50 L100,0 Z', + points: [25, 0, 50, 50, 0, 50], + offset: 25 + } + ] + } + } } }, mounted() { - // ImageEditor - + // const ref = this.$refs.can + // const canvas = new fabric.Canvas(ref) + // const rect = new fabric.Rect({ + // fill: 'red', + // width: 20, + // height: 20 + // }) + // canvas.add(rect) }, methods: { init(textOne, textTwo, textThree) { @@ -213,28 +252,12 @@ export default { textThree ? this.textThree = textThree : '' this.visible = true this.$nextTick(() => { - // console.log(this.imgUrl) + this.editorOptions.includeUI.loadImage.path = this.imgUrl this.instance = new ImageEditor( - document.querySelector('#tui-image-editor'), - { - includeUI: { - loadImage: { - path: this.imgUrl, - name: 'image' - }, - // menu: ['crop', 'rotate', 'draw', 'shape', 'icon', 'text', 'filter'], // 底部菜单按钮列表 隐藏镜像flip和遮罩mask - initMenu: 'draw', - selectionStyle: { - lineWidth: 5, - borderColor: '#000000' - }, - menuBarPosition: 'bottom', - locale: locale_zh, // 本地化语言为中文 - theme: customTheme // 自定义主题 - } - } + '#tui-image-editor', + this.editorOptions ) - // document.querySelector('.tie-btn-resize').style.display = 'none' // 隐藏顶部重置按钮 + this.instance.setBrush({ width: 20, color: 'red' }) document.querySelector('.tie-btn-mask').style.display = 'none' // 隐藏遮罩按钮 }) }, @@ -257,11 +280,9 @@ export default { // 替换图片 replaceHandle(e) { var file = e.target.files[0] - console.log(file) var reader = new FileReader() var that = this reader.readAsDataURL(file) - console.log(reader) reader.onload = function(e) { that.imgUrl = reader.result that.init() diff --git a/src/components/360View/index1.vue b/src/components/360View/index1.vue index 278fcf0..950141d 100644 --- a/src/components/360View/index1.vue +++ b/src/components/360View/index1.vue @@ -396,8 +396,12 @@ export default { this.drawerWidth = (this.drawerWidth === '500px') ? '800px' : '500px' }, backList() { - this.$parent.detailViewVisible = false - this.$parent.getDataListInitial() + if (this.$route.query.patientId) { + this.$router.go(-1) + } else { + this.$parent.detailViewVisible = false + this.$parent.getDataListInitial() + } }, // 360浏览器 handlePacs() { diff --git a/src/page-subspecialty/views/modules/formList/mraOrder.vue b/src/page-subspecialty/views/modules/formList/mraOrder.vue index 27fc93b..ed51c73 100644 --- a/src/page-subspecialty/views/modules/formList/mraOrder.vue +++ b/src/page-subspecialty/views/modules/formList/mraOrder.vue @@ -122,9 +122,10 @@ @@ -180,6 +181,7 @@ export default { return { origin: '', formData: { + idList: [], patientName: '', patientAge: '', patientSex: '', @@ -195,7 +197,7 @@ export default { remark: '', yzOpen: '', isPrint: '', - date: '', + examineDate: '', checkAdvice: '', docAdvice: '' }, @@ -228,23 +230,74 @@ export default { ] } }, + watch: { + caseId(val) { + if (val) { + this.getOrderDetail() + } + } + }, created() { - this.origin = JSON.parse(JSON.stringify(this.formData)) - // 患者信息带入 - this.formData.patientName = this.patientDetail.patientName - this.formData.patientAge = this.patientDetail.patientAge - this.formData.patientSex = this.patientDetail.patientSex - this.formData.patientId = this.patientDetail.patientId - this.formData.patientBirthday = this.patientDetail.patientBirthday - this.formData.patientPhone = this.patientDetail.patientPhone + this.getOrderDetail() + this.queryProject() }, methods: { handleSaveTable() { - this.$emit('handleSaveTable', this.formData) + this.formData.jzNumber = window.localStorage.getItem('jzNumber') + this.$http.post('/mzbl/saveMzblYdxgzy', { + caseId: this.caseId, + ...this.formData + }).then(() => { + this.$emit('handleSaveTable') + }) + }, + getOrderDetail() { + this.$http.get('/mzbl/getMzblYdxgzyInfo', { params: { + caseId: this.caseId, + patientId: this.patientDetail.patientId + }}).then(data => { + this.formData = { ...data.data.data } + // 患者信息带入 + this.formData.patientName = this.patientDetail.patientName + this.formData.patientAge = this.patientDetail.patientAge + this.formData.patientSex = this.patientDetail.patientSex + this.formData.patientId = this.patientDetail.patientId + this.formData.patientBirthday = this.patientDetail.patientBirthday + this.formData.patientPhone = this.patientDetail.patientPhone + }) + }, + // 获取项目id列表 + async queryProject() { + const project = window.localStorage.getItem('projectItem') ? JSON.parse(window.localStorage.getItem('projectItem')) : [] + const { data: res } = await this.$http.get( + '/patient/getZlItemDict', + { + params: { + caseName: '眼底血管造影患者预约单' + } + } + ) + if (res.code === 0) { + const data = res.data || [] + const list = [] + if (data.length) { + for (let i = 0; i < data.length; i++) { + for (let j = 0; j < project.length; j++) { + if (data[i].itemId === project[j].porjectCode) { + list.push(project[j].id) + } + } + } + this.confirmData.idList = list + } + } else { + this.$message.error(res.msg) + } }, + // 删除 formDelete() { - this.$confirmFun('确定删除吗?').then(() => { - this.$http.post('/case/delete', { + this.$confirmFun('确定删除吗?').then(() => { + this.$http.post('/mzbl/delMzblYdxgzyInfo', { id: this.caseId }).then(() => { this.$message.success('删除成功') diff --git a/src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/addPatientOrder.vue b/src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/addPatientOrder.vue index b6db0a1..800595a 100644 --- a/src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/addPatientOrder.vue +++ b/src/page-subspecialty/views/modules/nurseManagement/reservation/schedule/addPatientOrder.vue @@ -243,7 +243,7 @@ export default { }, goFormList() { if (this.patientInfo) { - const { href } = this.$router.resolve({ + this.$router.push({ path: '/360view', query: { onlyRead: false, @@ -252,7 +252,6 @@ export default { patientIdNumber: this.patientInfo.patientIdNumber } }) - window.open(href, '_blank') } else { this.$message.info('请选择患者') }