From 84d1dd57c26226502ba09348433a7fca9788bee9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Mar 2021 10:19:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=BF=A1=E6=81=AF=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 11 +- src/common/portrait.styl | 15 +- src/components/Echarts/Cisualmap.vue | 95 ++++++++- src/components/Echarts/Treemap.vue | 89 +++++--- src/components/PatientInfo/PatientTable.vue | 34 +++- src/config/api-user.js | 2 +- src/config/api.js | 2 +- src/config/setting.js | 4 +- src/store/modules/home/mutations.js | 9 +- src/store/modules/home/state.js | 3 +- src/views/CaseAnalysis/CaseAnalysis.vue | 66 ++++-- src/views/CaseSearch/CaseSearch.vue | 66 ++++-- src/views/PatientInfo/PatientInfo.vue | 215 ++++++++++++++------ 13 files changed, 455 insertions(+), 156 deletions(-) diff --git a/src/App.vue b/src/App.vue index 59264ff..7ba75e7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -40,6 +40,9 @@ export default { if (localStorage.getItem('patientId')) { this.setPatientId(localStorage.getItem('patientId')); } + if (localStorage.getItem('hospitalization')) { + this.setHospitalization(localStorage.getItem('hospitalization')); + } const that = this; window.plugin = window.TallPlugin.init(); // 调用created方法 向主窗体发送created消息,以便来接受、存储主窗体传递来的参数 @@ -53,7 +56,7 @@ export default { methods: { ...mapActions('home', ['getUserId']), - ...mapMutations('home', ['setPtProps', 'setHospitalId', 'setPatientId', 'getToken']), + ...mapMutations('home', ['setPtProps', 'setHospitalId', 'setPatientId', 'getToken', 'setHospitalization']), async getHospitalId(Id) { try { @@ -61,12 +64,8 @@ export default { const { code, msg, data } = res.data; if (code === 200) { this.setHospitalId(data.id); - } else { - this.$message.error('医院查询失败'); } - } catch (error) { - this.$message.error(error); - } + } catch (error) {} }, }, }; diff --git a/src/common/portrait.styl b/src/common/portrait.styl index c523727..2d36ae6 100644 --- a/src/common/portrait.styl +++ b/src/common/portrait.styl @@ -186,8 +186,19 @@ width: 200px; margin: 0 auto } - - +.bot-right-btn{ + position: fixed; + height: 40px; + right: 50px; + bottom: 50px; +} +.bot-right-tips { + position: fixed; + height: 40px; + font-size: 14px; + right: 50px; + top: 60px; +} // flex .d-flex{ display: flex; diff --git a/src/components/Echarts/Cisualmap.vue b/src/components/Echarts/Cisualmap.vue index caac068..717e03d 100644 --- a/src/components/Echarts/Cisualmap.vue +++ b/src/components/Echarts/Cisualmap.vue @@ -25,7 +25,92 @@ export default { dataList2: [], // 已完成数据数组 }; }, - computed: mapState('home', ['ptProps', 'hospitalId']), + computed: { + ...mapState('home', ['ptProps', 'hospitalId']), + option1() { + return { + title: { + left: 'center', + text: '新建病例', + }, + tooltip: { + trigger: 'item', + formatter: '数量 : {c}', + }, + dataZoom: [ + { + type: 'slider', + xAxisIndex: 0, + filterMode: 'empty', + }, + { + type: 'inside', + xAxisIndex: 0, + filterMode: 'empty', + }, + ], + xAxis: { + type: 'category', + data: this.dateList1, + }, + yAxis: { type: 'value' }, + series: [ + { + data: this.dataList1, + type: 'line', + areaStyle: { color: 'rgba(229,244,254,1)' }, + lineStyle: { color: 'rgb(45,151,213)' }, + itemStyle: { color: 'rgb(45,151,213)' }, + smooth: true, + }, + ], + }; + }, + option2() { + return { + title: { + left: 'center', + text: '已完成病例', + }, + tooltip: { + trigger: 'item', + formatter: '数量 : {c}', + }, + dataZoom: [ + { + type: 'slider', + xAxisIndex: 0, + filterMode: 'empty', + }, + { + type: 'inside', + xAxisIndex: 0, + filterMode: 'empty', + }, + ], + xAxis: { + type: 'category', + data: this.dateList2, + }, + yAxis: { type: 'value' }, + series: [ + { + data: this.dataList2, + type: 'line', + areaStyle: { color: 'rgba(229,244,254,1)' }, + lineStyle: { color: 'rgb(45,151,213)' }, + itemStyle: { color: 'rgb(45,151,213)' }, + smooth: true, + }, + ], + }; + }, + }, + watch: { + hospitalId() { + this.init(this.drawLine); + }, + }, mounted() { this.init(this.drawLine); }, @@ -110,11 +195,15 @@ export default { }, ], }; - myChart1.setOption(option1); - myChart2.setOption(option2); + myChart1.setOption(this.option1); + myChart2.setOption(this.option2); }, async getData() { try { + this.dateList1 = []; + this.dataList1 = []; + this.dateList2 = []; + this.dataList2 = []; const params = { param: { hospitalId: this.hospitalId ? this.hospitalId : '', diff --git a/src/components/Echarts/Treemap.vue b/src/components/Echarts/Treemap.vue index 1547a5a..32c60be 100644 --- a/src/components/Echarts/Treemap.vue +++ b/src/components/Echarts/Treemap.vue @@ -18,11 +18,49 @@ export default { width: '', height: '', valueList: [], - timer: null, maxNum: 0, }; }, - computed: mapState('home', ['ptProps', 'hospitalId']), + computed: { + ...mapState('home', ['ptProps', 'hospitalId']), + option() { + return { + tooltip: { trigger: 'axis' }, + radar: [ + { + indicator: [ + { text: '已完成', max: this.maxNum }, + { text: '废弃', max: this.maxNum }, + { text: '进行中', max: this.maxNum }, + { text: '未完成', max: this.maxNum }, + ], + center: ['50%', '50%'], + radius: 120, + }, + ], + series: [ + { + type: 'radar', + tooltip: { trigger: 'item' }, + areaStyle: { color: 'rgba(84,112,198,0.9)' }, + lineStyle: { color: 'rgb(84,112,198)' }, + itemStyle: { color: 'rgb(84,112,198)' }, + data: [ + { + value: this.valueList === [] ? [0, 0, 0, 0, 0] : this.valueList, + name: '病例统计', + }, + ], + }, + ], + }; + }, + }, + watch: { + hospitalId() { + this.init(this.drawLine); + }, + }, mounted() { this.init(this.drawLine); }, @@ -30,7 +68,6 @@ export default { async drawLine() { // 基于准备好的dom,初始化echarts实例 await this.getData(); - console.log(this.valueList); let myChart = this.$echarts.init(document.getElementById('Treemap')); // 绘制图表 var option = { @@ -63,30 +100,36 @@ export default { }, ], }; - myChart.setOption(option); + myChart.setOption(this.option); }, async getData() { - const params = { - param: { - hospitalId: this.hospitalId ? this.hospitalId : '', - userId: this.ptProps && this.ptProps.userId ? this.ptProps.userId : '', - }, - }; - const res = await complete(params); - const { code, data, msg } = res.data; - if (code === 200) { - // console.log(data); - for (let key in data) { - this.valueList.push(data[key]); - } - for (let i = 0; i < this.valueList.length; i++) { - if (this.valueList[i] > this.maxNum) { - this.maxNum = this.valueList[i]; + try { + this.valueList = []; + this.maxNum = 0; + const params = { + param: { + hospitalId: this.hospitalId ? this.hospitalId : '', + userId: this.ptProps && this.ptProps.userId ? this.ptProps.userId : '', + }, + }; + const res = await complete(params); + const { code, data, msg } = res.data; + if (code === 200) { + // console.log(data); + for (let key in data) { + this.valueList.push(data[key]); + } + console.log(this.valueList); + for (let i = 0; i < this.valueList.length; i++) { + if (this.valueList[i] > this.maxNum) { + this.maxNum = this.valueList[i]; + } } + } else { + console.log(msg); } - console.log(this.maxNum); - } else { - console.log(msg); + } catch (error) { + console.log(error); } }, }, diff --git a/src/components/PatientInfo/PatientTable.vue b/src/components/PatientInfo/PatientTable.vue index 9d21ecc..273b243 100644 --- a/src/components/PatientInfo/PatientTable.vue +++ b/src/components/PatientInfo/PatientTable.vue @@ -33,11 +33,16 @@ + + 是否要录入住院号为: + {{ hospitalization }} + 的患者的相关数据 + @@ -90,6 +95,9 @@ export default { return { columns, loading: false, + visible: false, + patientId: '', + hospitalization: '', }; }, @@ -105,24 +113,34 @@ export default { }, methods: { - ...mapMutations('home', ['setPatientId']), - + ...mapMutations('home', ['setPatientId', 'setHospitalization']), + showModal(id, hospitalization) { + this.patientId = id; + this.hospitalization = hospitalization; + this.visible = true; + }, + handleCancel(e) { + this.visible = false; + }, + handleOk() { + this.chooseItem(this.patientId, this.hospitalization); + }, // 选择病患 - async chooseItem(id) { + async chooseItem(id, hospitalization) { try { this.setPatientId(id); + this.setHospitalization(hospitalization); localStorage.setItem('patientId', id); + localStorage.setItem('hospitalization', hospitalization); const params = { param: { patientId: id } }; const res = await generatePatientReport(params); const { code, msg, data } = res.data; if (code === 200) { console.log(data); localStorage.setItem('reportId', data.id); - if (localStorage.getItem('reportId')) { - this.$message.success('生成报告单成功'); - } } - if (localStorage.getItem('patientId')) { + if (localStorage.getItem('patientId') && localStorage.getItem('hospitalization')) { + this.visible = false; this.$message.success('选择成功'); } } catch (error) { diff --git a/src/config/api-user.js b/src/config/api-user.js index 3056438..5640597 100644 --- a/src/config/api-user.js +++ b/src/config/api-user.js @@ -4,7 +4,7 @@ * email: 18603454788@163.com */ import axios from 'axios'; -let { proxyUrl, msgUrl } = require('@/config/setting'); +let { proxyUrl } = require('@/config/setting'); const tall = `${proxyUrl}/tall/v1.0`; const users = `${tall}/users`; diff --git a/src/config/api.js b/src/config/api.js index 96e0f65..9494c52 100644 --- a/src/config/api.js +++ b/src/config/api.js @@ -6,7 +6,7 @@ * @LastEditTime: 2021-02-19 18:01:03 */ import axios from 'axios'; -let { proxyUrl, msgUrl } = require('@/config/setting'); +let { proxyUrl } = require('@/config/setting'); const tcm = `${proxyUrl}/tcm`; const question = `${proxyUrl}/question`; diff --git a/src/config/setting.js b/src/config/setting.js index a2c7f05..352ed26 100644 --- a/src/config/setting.js +++ b/src/config/setting.js @@ -4,7 +4,7 @@ const baseUrl = process.env.VUE_APP_BASE_URL; const apiUrl = process.env.VUE_APP_API_URL; const proxyUrl = process.env.VUE_APP_PROXY_URL; const publicPath = process.env.VUE_APP_PUBLIC_PATH; -const msgUrl = process.env.VUE_APP_MSG_URL; +// const msgUrl = process.env.VUE_APP_MSG_URL; module.exports = { // 首页标题 @@ -20,7 +20,7 @@ module.exports = { apiUrl, // 消息系统地址 - msgUrl, + // msgUrl, // api代理地址 proxyUrl, diff --git a/src/store/modules/home/mutations.js b/src/store/modules/home/mutations.js index 86ad67d..66bd9eb 100644 --- a/src/store/modules/home/mutations.js +++ b/src/store/modules/home/mutations.js @@ -45,7 +45,14 @@ const mutations = { setPatientId(state, data) { state.patientId = data; }, - + /** + * 设置病患住院号 + * @param {object} state + * @param {string} data + */ + setHospitalization(state, data) { + state.hospitalization = data; + }, /** * 设置预览信息 * @param {object} state diff --git a/src/store/modules/home/state.js b/src/store/modules/home/state.js index f22404e..42d8ae2 100644 --- a/src/store/modules/home/state.js +++ b/src/store/modules/home/state.js @@ -3,9 +3,10 @@ const state = { user: { id: '', phone: '', account: '' }, controlGroups: [], // 对照组 patientId: '', // 病患id + hospitalization: '', // 病患住院号 previewInfo: { host: '', place: '', startTime: '', endTime: '', participants: '', meetingMinutes: '', discussionContent: '' }, // 预览信息 ptProps: null, // 接受PT传过来的 pluginId,projectId,roleId,taskId,userId - hospitalId: '', + hospitalId: '', // 医院Id }; export default state; diff --git a/src/views/CaseAnalysis/CaseAnalysis.vue b/src/views/CaseAnalysis/CaseAnalysis.vue index 4de8c01..ae8f9fa 100644 --- a/src/views/CaseAnalysis/CaseAnalysis.vue +++ b/src/views/CaseAnalysis/CaseAnalysis.vue @@ -40,7 +40,7 @@ - + {{ b.showValue }} @@ -63,9 +63,17 @@ @change="fileChange($event, a.id)" name="files" > - 点击上传 + + 点击上传 + - + {{ f.showValue }} @@ -184,11 +192,7 @@ style="height: 100px" @change="onChange($event, ohter.type, ohter.id)" /> - + {{ b.showValue }} @@ -226,13 +230,17 @@ @change="fileChange($event, ohter.id)" name="files" > - 点击上传 + + 点击上传 + - + {{ f.showValue }} @@ -388,7 +396,7 @@ - + {{ b.showValue }} @@ -411,9 +419,17 @@ @change="fileChange($event, e.id, e.recordId)" name="files" > - 点击上传 + + 点击上传 + - + {{ f.showValue }} @@ -527,7 +543,7 @@ style="height: 100px" @change="onChange($event, h.type, h.id, h.recordId)" /> - + {{ b.showValue }} @@ -554,9 +570,17 @@ @change="fileChange($event, h.id)" name="files" > - 点击上传 + + 点击上传 + - + {{ f.showValue }} @@ -717,7 +741,7 @@ - 提交 + 搜索 diff --git a/src/views/CaseSearch/CaseSearch.vue b/src/views/CaseSearch/CaseSearch.vue index 1deba31..dfdd440 100644 --- a/src/views/CaseSearch/CaseSearch.vue +++ b/src/views/CaseSearch/CaseSearch.vue @@ -37,7 +37,7 @@ - + {{ b.showValue }} @@ -60,9 +60,17 @@ @change="fileChange($event, a.id)" name="files" > - 点击上传 + + 点击上传 + - + {{ f.showValue }} @@ -181,11 +189,7 @@ style="height: 100px" @change="onChange($event, ohter.type, ohter.id)" /> - + {{ b.showValue }} @@ -223,13 +227,17 @@ @change="fileChange($event, ohter.id)" name="files" > - 点击上传 + + 点击上传 + - + {{ f.showValue }} @@ -385,7 +393,7 @@ - + {{ b.showValue }} @@ -408,9 +416,17 @@ @change="fileChange($event, e.id, e.recordId)" name="files" > - 点击上传 + + 点击上传 + - + {{ f.showValue }} @@ -524,7 +540,7 @@ style="height: 100px" @change="onChange($event, h.type, h.id, h.recordId)" /> - + {{ b.showValue }} @@ -551,9 +567,17 @@ @change="fileChange($event, h.id)" name="files" > - 点击上传 + + 点击上传 + - + {{ f.showValue }} @@ -698,7 +722,7 @@ - 提交 + 搜索 diff --git a/src/views/PatientInfo/PatientInfo.vue b/src/views/PatientInfo/PatientInfo.vue index bef57c4..6452622 100644 --- a/src/views/PatientInfo/PatientInfo.vue +++ b/src/views/PatientInfo/PatientInfo.vue @@ -18,7 +18,7 @@ @@ -35,12 +35,13 @@ - + {{ b.showValue }} - 点击上传 + + 点击上传 + @@ -80,8 +90,8 @@ })) " > - - + + @@ -90,6 +100,7 @@ @@ -99,10 +110,10 @@
- + @@ -112,7 +123,7 @@
- + {{ b.showValue }}
@@ -128,14 +139,18 @@ })) " > - - + +
- + {{ ques.showValue }} @@ -145,14 +160,14 @@
- 说明: + 说明:
@@ -173,7 +188,7 @@ " >
- +
- + @@ -218,6 +238,7 @@ - 点击上传 + + 点击上传 + @@ -258,10 +288,10 @@ })) " > - + @@ -271,6 +301,7 @@ @@ -280,10 +311,10 @@
- + @@ -295,7 +326,7 @@
@@ -315,10 +346,10 @@ })) " > - + @@ -326,7 +357,11 @@
- + {{ ques.showValue }} @@ -336,14 +371,14 @@
- 说明: + 说明:
@@ -383,7 +418,8 @@
- + + {{ h.units }}
图片识别
@@ -394,7 +430,8 @@
- + + {{ a.units }}
图片识别
@@ -412,7 +449,7 @@ @@ -432,7 +469,7 @@ {{ b.showValue }} @@ -441,6 +478,7 @@ show-time placeholder="日期时间选择" v-else-if="e.type === 6" + style="width: 100%" :default-value="e.answer ? $moment(e.answer, dateFormat) : ''" @change="onChange($event, e.type, e.id, e.recordId)" /> @@ -453,11 +491,20 @@ @change="fileChange($event, e.id, e.recordId)" name="files" > - 点击上传 + + 点击上传 + @@ -478,8 +525,8 @@ })) " > - - + + @@ -487,6 +534,7 @@ @@ -496,10 +544,10 @@
- + @@ -509,7 +557,7 @@
- + {{ b.showValue }}
@@ -525,14 +573,14 @@ })) " > - - + +
- + {{ ques.showValue }} @@ -542,14 +590,14 @@
- 说明: + 说明:
@@ -573,7 +621,7 @@ @@ -583,7 +631,7 @@ @@ -605,7 +653,7 @@ @@ -616,6 +664,7 @@ show-time placeholder="日期时间选择" v-else-if="h.type === 6" + style="width: 100%" :default-value="h.answer ? $moment(h.answer, dateFormat) : ''" @change="onChange($event, h.type, h.id, h.recordId)" /> @@ -628,11 +677,20 @@ @change="fileChange($event, h.id)" name="files" > - 点击上传 + + 点击上传 + @@ -655,10 +713,10 @@ })) " > - + @@ -668,6 +726,7 @@ @@ -677,10 +736,10 @@
- + @@ -692,7 +751,7 @@
@@ -712,10 +771,10 @@ })) " > - + @@ -723,7 +782,11 @@
- + {{ ques.showValue }} @@ -733,14 +796,14 @@
- 说明: + 说明:
@@ -780,7 +843,12 @@
- + + {{ h.units }}
图片识别
@@ -791,7 +859,8 @@
- + + {{ e.units }}
图片识别
@@ -799,14 +868,23 @@ - - + /> --> +
+ 当前选择患者的住院号为:{{ hospitalization }} +
+ 提交 @@ -819,12 +897,17 @@ const formItemLayout = { labelCol: { span: 6 }, wrapperCol: { span: 12 }, }; +const formItemLayout1 = { + labelCol: { span: 0 }, + wrapperCol: { span: 24 }, +}; const tailItemLayout = { wrapperCol: { span: 18, offset: 4 } }; export default { name: 'PatientInfo', data() { return { formItemLayout, + formItemLayout1, tailItemLayout, form: this.$form.createForm(this, { name: 'page-add' }), value: 1, @@ -850,7 +933,7 @@ export default { }, computed: { - ...mapState('home', ['patientId']), + ...mapState('home', ['patientId', 'hospitalization']), // 上传附加请求头 headers() { const token = sessionStorage.getItem('anyringToken'); @@ -1186,9 +1269,9 @@ export default { } }, // 改变提交时间 - changeDate(date) { - this.subDateTime = this.$moment(date._d).format('YYYY-MM-DD HH:mm:ss'); - }, + // changeDate(date) { + // this.subDateTime = this.$moment(date._d).format('YYYY-MM-DD HH:mm:ss'); + // }, // 提交表单 async setData() { try { @@ -1196,7 +1279,7 @@ export default { param: { list: this.contentList, patientId: this.patientId, - timeSlot: this.subDateTime ? this.subDateTime : this.$moment(this.dateChoose).format('YYYY-MM-DD HH:mm:ss'), + // timeSlot: this.subDateTime ? this.subDateTime : this.$moment(this.dateChoose).format('YYYY-MM-DD HH:mm:ss'), nums: this.tabNums, }, };