From fe6d0d375ac29cf5f0e558e6695283d29387376e Mon Sep 17 00:00:00 2001 From: bianyaqi Date: Fri, 7 Apr 2023 09:53:25 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=A8=E8=AF=8A=E7=97=85=E4=BE=8B=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E4=B8=80=E5=A4=A9=E5=8F=AA=E8=83=BD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../medicalRecord/callMedical/index.vue | 12 ++++++-- .../360View/medicalRecord/index.vue | 27 +++++++++++------ src/page-subspecialty/router/index.js | 29 ++++++++++++++++--- 3 files changed, 53 insertions(+), 15 deletions(-) diff --git a/src/components/360View/medicalRecord/callMedical/index.vue b/src/components/360View/medicalRecord/callMedical/index.vue index 90d9de3..61e59b7 100644 --- a/src/components/360View/medicalRecord/callMedical/index.vue +++ b/src/components/360View/medicalRecord/callMedical/index.vue @@ -8,7 +8,7 @@

{{ item.createTime }}

{{ item.name }}

- + @@ -28,7 +28,7 @@ -
+

门急诊电子病历

@@ -92,6 +92,14 @@ export default { }, async saveTableData(name) { const date = this.$moment().format('YYYY-MM-DD HH:mm:ss') + const isToday = this.formList.some(item => item.createTime.includes(date.split(' ')[0])) + if (name === '门急诊电子病历' && isToday) { + this.$message({ + message: '已有今日病例,请勿重复添加!', + type: 'warning' + }) + return + } const params = { flag: 8, name: name, diff --git a/src/components/360View/medicalRecord/index.vue b/src/components/360View/medicalRecord/index.vue index ca40ede..a30c811 100644 --- a/src/components/360View/medicalRecord/index.vue +++ b/src/components/360View/medicalRecord/index.vue @@ -17,16 +17,17 @@ @addRecord="addRecord" />
-
+
-
- - - - - -
+
@@ -84,7 +85,7 @@ export default { }, created() { if (this.isSearch === '2') { - this.getFormList() + this.getFormList() } }, methods: { @@ -122,6 +123,14 @@ export default { addRecord(name) { this.name = name const date = this.$moment().format('YYYY-MM-DD HH:mm:ss') + const isToday = this.formList.some(item => item.createTime.includes(date.split(' ')[0])) + if (name === '门急诊电子病历' && isToday) { + this.$message({ + message: '已有今日病例,请勿重复添加!', + type: 'warning' + }) + return + } const params = { flag: 8, name: name, diff --git a/src/page-subspecialty/router/index.js b/src/page-subspecialty/router/index.js index 2a56a62..c3db663 100644 --- a/src/page-subspecialty/router/index.js +++ b/src/page-subspecialty/router/index.js @@ -104,13 +104,23 @@ export function addDynamicRoute(routeParams, router) { title: `${routeParams.title}` } } - router.addRoutes([ + const dynamicRoutes = [ { ...moduleRoutes, name: `main-dynamic__${dynamicRoute.name}`, children: [dynamicRoute] } - ]) + ] + dynamicRoutes.forEach(res => { + router.addRoute(res) + }) + // router.addRoutes([ + // { + // ...moduleRoutes, + // name: `main-dynamic__${dynamicRoute.name}`, + // children: [dynamicRoute] + // } + // ]) window.SITE_CONFIG['dynamicRoutes'].push(dynamicRoute) router.push({ name: dynamicRoute.name, params: routeParams.params }) } @@ -305,14 +315,25 @@ function fnAddDynamicMenuRoutes(menuList = [], menuListChildLength, routes = []) routes = menuList // PH:底层调用一次 // 添加路由 - router.addRoutes([ + const dynamicRoutes = [ { ...moduleRoutes, name: 'main-dynamic-menu', children: [...routes] }, { path: '*', redirect: { name: '404' }} - ]) + ] + dynamicRoutes.forEach(res => { + router.addRoute(res) + }) + // router.addRoutes([ + // { + // ...moduleRoutes, + // name: 'main-dynamic-menu', + // children: [...routes] + // }, + // { path: '*', redirect: { name: '404' }} + // ]) // console.log('----------------------') window.SITE_CONFIG['dynamicMenuRoutes'] = routes window.SITE_CONFIG['dynamicMenuRoutesHasAdded'] = true