Browse Source

优化uiVersion逻辑,从多个部署多个UI变成部署一个UI

wennn 2 tháng trước cách đây
mục cha
commit
8f0cc83db6

+ 0 - 1
public/domain.js

@@ -6,7 +6,6 @@ const domain = {
   gateWayUrl:'http://8.129.220.143:8014',
   fileServer: 'http://8.129.220.143:8012',
   apiMode: 'dev',
-  uiVersion: 1, // 1 医院版,2 月子中心版,3养老院版
   enableBroadcast: true, //广播使能
   enableMobile: true,  //手机使能
   enableEntraceguard: true,  //门禁使能

+ 2 - 3
src/layout/components/Navbar.vue

@@ -8,7 +8,7 @@
       <template v-if="device!=='mobile'">
         <!--        <search id="header-search" class="right-menu-item" />-->
         <div class="right-menu-item" style="color: #409EFF">{{ partInfo.full_name }} {{ partInfo.part_name }}</div>
-        <div class="right-menu-item" style="color: #ff4949;font-size: 14px">{{ licence }}-{{uiVersion === 1 ? '医院版' : uiVersion === 2 ? '月子中心版' : '养老院版'}}</div>
+        <div class="right-menu-item" style="color: #ff4949;font-size: 14px">{{ licence }}</div>
         <error-log class="errLog-container right-menu-item hover-effect" />
 
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
@@ -62,7 +62,7 @@
 </template>
 
 <script>
-const uiVersion = domain.uiVersion
+import Vue from 'vue'
 import { mapGetters } from 'vuex'
 import Breadcrumb from '@/components/Breadcrumb'
 import Hamburger from '@/components/Hamburger'
@@ -84,7 +84,6 @@ export default {
   },
   data() {
     return {
-      uiVersion: uiVersion,
       avator: avator,
       licence: '',
       value: this.$i18n.locale,

+ 2 - 0
src/main.js

@@ -38,6 +38,8 @@ import i18n from './utils/i18n'
 import BaiduMap from 'vue-baidu-map'
 import $ from 'jquery'
 Vue.prototype.$ = $
+
+Vue.prototype.uiVersionType = 1 // 初始化为空字符串或其他默认值
 /**
  * If you don't want to use mock-server
  * you want to use MockJs for mock api

+ 19 - 28
src/router/index.js

@@ -8,7 +8,6 @@ Vue.use(Router)
 /* Layout */
 import Layout from '@/layout'
 
-const uiVersion = domain.uiVersion
 const enableBroadcast = domain.enableBroadcast
 const enableMobile = domain.enableMobile
 const enableEntraceguard = domain.enableEntraceguard
@@ -113,28 +112,28 @@ export const partRoutes = [
         path: 'mobile',
         component: () => import('@/views/ncs-device/nurse_watch'),
         name: 'device-mobile',
-        hidden: !enableMobile,
+        needShow: enableMobile,
         meta: { title: i18n.t('tab.mobileDeviceManage'), icon: 'el-icon-watch', noCache: true } // 移动设备
       },
       {
         path: 'user_watch',
         component: () => import('@/views/ncs-device/user_watch'),
         name: 'user-watch',
-        hidden: !enableCustomerDevice,
+        needShow: enableCustomerDevice,
         meta: { title: i18n.t('tab.userLocationManage'), icon: 'el-icon-watch-1', noCache: true } // 用户设备
       },
       {
         path: 'huayi_sleep',
         component: () => import('@/views/ncs-device/huayi_sleep'),
         name: 'huayi-sleep',
-        hidden: !enableCustomerDevice,
+        needShow: enableCustomerDevice,
         meta: { title: i18n.t('zy20241209.huayiSleep'), icon: 'sleep_monitoring', noCache: true } // 用户设备
       },
       {
         path: 'sos',
         component: () => import('@/views/ncs-sos-device-setting/sos_device_setting'),
         name: 'sos-device',
-        hidden: !enableSosDevice,
+        needShow: enableSosDevice,
         meta: { title: i18n.t('tab.sosDeviceSettingManage'), icon: 'el-icon-s-help', noCache: true } // 报警设备
       },
       {
@@ -149,21 +148,21 @@ export const partRoutes = [
         component: () => import('@/views/ncs-device/nbDeviceCondition'),
         name: 'nbdevice-condition',
         meta: { title: i18n.t('tab.nbiotDeviceStatus'), icon: 'iot', noCache: true },
-        hidden: !enableNBiot
+        needShow: enableNBiot
       },
       {
         path: 'information_board',
         component: () => import('@/views/calling-board/index'),
         name: 'information-board',
         meta: { title: i18n.t('tab.boardManage'), icon: 'infomation_board', noCache: true },
-        hidden: uiVersion === 2
+        needHidden: [2]
       },
       {
         path: 'custom_infoboard',
         component: () => import('@/views/custom-infoboard/board-title'),
         name: 'board-title',
         meta: { title: i18n.t('tab.customBoardManage'), icon: 'designer', noCache: true },
-        hidden: uiVersion === 2
+        needHidden: [2]
       },
       {
         path: 'index/:id?',
@@ -185,13 +184,6 @@ export const partRoutes = [
         meta: { title: i18n.t('tab.deviceMenuDetail'), icon: 'el-icon-tickets', noCache: true },
         hidden: true
       },
-      // {
-      //   path: 'led',
-      //   component: () => import('@/views/ncs-led/ledDeviceManagement'),
-      //   name: 'led-manager',
-      //   meta: { title: i18n.t('tab.ledDeviceManager'), icon: 'led', noCache: true },
-      //   hidden: uiVersion === 2
-      // },
       {
         path: 'led-control',
         component: () => import('@/views/ncs-led/ledControl'),
@@ -229,14 +221,13 @@ export const partRoutes = [
     component: Layout,
     name: 'entrace-guard',
     redirect: '/entrace_guard/users',
-    hidden: !enableEntraceguard,
+    needShow: enableEntraceguard,
     children: [
       {
         path: 'users',
         component: () => import('@/views/entrace-guard/users'),
         name: 'entrace-guard-list',
-        meta: { title: i18n.t('tab.entraceguardUser'), icon: 'pass_through', noCache: true },
-        hidden: !enableEntraceguard
+        meta: { title: i18n.t('tab.entraceguardUser'), icon: 'pass_through', noCache: true }
       }]
   },
   // 客户信息
@@ -246,17 +237,17 @@ export const partRoutes = [
     redirect: '/customer/list',
     name: 'customer-manager',
     meta: {
-      title: uiVersion === 1 ? i18n.t('tab.patientManage') : i18n.t('tab.customerManage'),
+      title: i18n.t('tab.patientManage'),
       icon: 'el-icon-s-custom',
       noCache: true
     },
     children: [
       {
         path: 'list',
-        component: () => uiVersion === 1 ? import('@/views/customer/patientManagement') : uiVersion === 2 ? import('@/views/customer/customerManagement') : import('@/views/customer/elderlyCareManagement'),
+        component: () => import('@/views/customer/patientManagement'),
         name: 'customer-list',
         meta: {
-          title: uiVersion === 1 ? i18n.t('tab.patientManage') : i18n.t('tab.customerManage'),
+          title: i18n.t('tab.patientManage'),
           icon: 'el-icon-s-custom',
           noCache: true
         }
@@ -398,14 +389,14 @@ export const partRoutes = [
     component: Layout,
     name: 'broadcast',
     redirect: '/broadcast/index',
-    hidden: !enableBroadcast || uiVersion !== 1,
+    needShow: enableBroadcast,
+    needHidden: [2, 3],
     children: [
       {
         path: 'index',
         component: () => import('@/views/ncs-broadcast/index'),
         name: 'broadcast-list',
         meta: { title: i18n.t('tab.broadcastManage'), icon: 'el-icon-headset', noCache: true }, // 广播设置
-        hidden: !enableBroadcast || uiVersion !== 1
       },
       {
         path: 'edit/:id?',
@@ -450,7 +441,7 @@ export const partRoutes = [
         component: () => import('@/views/ncs-nurse-config/index'),
         name: 'nurse-config',
         meta: { title: i18n.t('tab.nurseConfig'), icon: 'care1', noCache: true }, // 护理参数
-        hidden: uiVersion !== 1
+        needHidden: [2, 3]
       },
       {
         path: 'channel',
@@ -584,14 +575,14 @@ export const hospitalRoutes = [
         component: () => import('@/views/calling-board/index'),
         name: 'information-board',
         meta: { title: i18n.t('tab.boardManage'), icon: 'infomation_board', noCache: true },
-        hidden: uiVersion === 2
+        needHidden: [2]
       },
       {
         path: 'custom_infoboard',
         component: () => import('@/views/custom-infoboard/board-title'),
         name: 'board-title',
         meta: { title: i18n.t('tab.customBoardManage'), icon: 'designer', noCache: true },
-        hidden: uiVersion === 2
+        needHidden: [2]
       },
       {
         path: 'index/:id?',
@@ -711,7 +702,7 @@ export const adminRoutes = [
         component: () => import('@/views/ncs-linux-version/linuxVersionSetting'),
         name: 'admin-linux-version',
         meta: { title: i18n.t('tab.linuxVersion'), icon: 'nested', noCache: true },
-        hidden: !enableLinux
+        needShow: enableLinux
       },
       {
         path: 'led_device',
@@ -856,7 +847,7 @@ export const adminRoutes = [
         meta: { title: i18n.t('tab.debugging485'), icon: 'authen', noCache: true }
       }
     ],
-    hidden: !enable485
+    needShow: enable485
   },
   {
     path: '/interaction_push',

+ 28 - 4
src/store/modules/permission.js

@@ -1,6 +1,7 @@
 import { constantRoutes, partRoutes, adminRoutes, hospitalRoutes } from '@/router'
 import store from '@/store'
 import { getUserRolesPermissions } from '@/api/user'
+import Vue from 'vue'
 /**
  * Use meta.role to determine if the current user has permission
  * @param roles
@@ -49,18 +50,24 @@ const mutations = {
 const actions = {
   async generateRoutes({ commit }) {
     return new Promise(resolve => {
+      const shopInfo = store.getters.organization // 机构信息
+      if (!shopInfo.ui_version_type) {
+        shopInfo.ui_version_type = 1
+      }
+      Vue.prototype.uiVersionType = shopInfo.ui_version_type
       const accessedRoutes = [] // asyncRoutes || []
       let lastRoutes = []
       const userInfo = store.getters.userInfo
       if (userInfo.username === 'superadmin') { // 超级管理员
-        lastRoutes = accessedRoutes.concat(adminRoutes)
+        const userRoutes = filterRoleRouter2(adminRoutes, shopInfo.ui_version_type)
+        lastRoutes = accessedRoutes.concat(userRoutes)
         commit('SET_ROUTES', lastRoutes)
         resolve(lastRoutes)
       } else {
-        const shopInfo = store.getters.organization // 机构信息
         if (shopInfo.shop_type === '6') { // 为医院
           if (userInfo && userInfo.founder === 1) { // 医院管理
-            lastRoutes = accessedRoutes.concat(hospitalRoutes)
+            const userRoutes = filterRoleRouter2(hospitalRoutes, shopInfo.ui_version_type)
+            lastRoutes = accessedRoutes.concat(userRoutes)
             commit('SET_ROUTES', lastRoutes)
             resolve(lastRoutes)
           } else {
@@ -73,7 +80,8 @@ const actions = {
           }
         } else if (shopInfo.shop_type === '5') { // 为科室
           if (userInfo && userInfo.founder === 1) { // 科室管理
-            lastRoutes = accessedRoutes.concat(partRoutes)
+            const userRoutes = filterRoleRouter2(partRoutes, shopInfo.ui_version_type)
+            lastRoutes = accessedRoutes.concat(userRoutes)
             commit('SET_ROUTES', lastRoutes)
             resolve(lastRoutes)
           } else {
@@ -113,6 +121,22 @@ function filterRoleRouter(routers, names) {
   return _routers
 }
 
+function filterRoleRouter2(routers, type) {
+  const _routers = []
+  routers.forEach(item => {
+    // 筛选出没有 needHidden 或者 needHidden 包含当前机构类型 或者 hidden 为 true 的路由
+    if ((!('needShow' in item) || item.needShow === true) &&
+      // 检查needHidden是否不存在或不是数组或者不包含当前机构类型
+      (!('needHidden' in item) || !Array.isArray(item.needHidden) || !item.needHidden.includes(type))) {
+      if (item.children) {
+        item.children = filterRoleRouter2(item.children, type)
+      }
+      _routers.push(item)
+    }
+  })
+  return _routers
+}
+
 export default {
   namespaced: true,
   state,

+ 4 - 0
src/store/modules/user.js

@@ -1,3 +1,4 @@
+import Vue from 'vue'
 import { login, logout } from '@/api/user'
 import * as API_Part from '@/api/calling-part'
 import * as Auth from '@/utils/auth'
@@ -134,6 +135,9 @@ const actions = {
           if (!response) {
             reject('Verification failed, please Login again.')
           }
+          // 设置机构是什么模式
+          // response.ui_version_type = 1
+          // Vue.prototype.uiVersionType = 2
           commit('SET_PARTINFO', response)
           resolve(response)
         }).catch(error => {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 1796 - 1694
src/views/customer/components/patientManager.vue


+ 0 - 4
src/views/dashboard/calling/index.vue

@@ -135,7 +135,6 @@ import * as API_Remark from '@/api/ncs_remark'
 import { unixToDate } from '@/utils/Foundation'
 import * as API_CallingList from '@/api/ncs_interaction'
 import {getListByHonePage} from "@/api/ncs_interaction";
-const uiVersion = domain.uiVersion
 
 export default {
   name: 'Index',
@@ -244,9 +243,6 @@ export default {
       this.isShowArticle = true
     },
     goMove(path) {
-      // if (path === 'customerList') {
-      //   uiVersion === 1 ? path = 'patientManagement' : uiVersion === 2 ? path = 'customerManager' : path = 'elderlyCareManager'
-      // }
       this.$router.push({ name: path })
     },
     formatterFromName(row, column, cellValue) {

+ 3 - 6
src/views/hospitalFrame/frameTreeView-admin.vue

@@ -58,8 +58,8 @@
         <el-tabs v-model="activeName" style="margin:0px;" type="border-card">
           <el-tab-pane :label="this.$t('frameManage.memberList')" name="frameInfo">
             <keep-alive>
-              <customer-manager v-if="uiVersion===2" :frame="selectedNode" @saved="handleCustomerChange" />
-              <patient-manager v-if="uiVersion===1" :frame="selectedNode" @saved="handleCustomerChange" />
+<!--              <customer-manager v-if="uiVersionType===2" :frame="selectedNode" @saved="handleCustomerChange" />-->
+              <patient-manager :frame="selectedNode" @saved="handleCustomerChange" />
             </keep-alive>
           </el-tab-pane>
           <el-tab-pane :label="this.$t('frameManage.deviceList')" name="deviceList">
@@ -188,9 +188,7 @@ import * as API_Frame from '@/api/ncs_hospitalFrame'
 import CustomerManager from '../customer/components/customerManager'
 import DeviceManager from '../ncs-device/components/deviceManager'
 import PatientManager from '../customer/components/patientManager'
-// import { uiVersion } from '@/utils/domain'
 import { FRAME_TYPE } from '@/utils/enum/FrameTypeEnum'
-const uiVersion = domain.uiVersion
 export default {
   name: 'FrameTreeView',
   components: { PatientManager, DeviceManager, CustomerManager },
@@ -236,8 +234,7 @@ export default {
       room_num_demo: '01',
       createFrameRules: {
 
-      },
-      uiVersion: uiVersion
+      }
     }
   },
   computed: {

+ 4 - 7
src/views/hospitalFrame/frameTreeView.vue

@@ -98,9 +98,9 @@
         <el-tabs v-model="activeName" style="margin:0px;" type="border-card">
           <el-tab-pane :label="this.$t('frameManage.memberList')" name="frameInfo">
             <keep-alive>
-              <customer-manager v-if="uiVersion===2" :frame="selectedNode" @saved="handleCustomerChange" />
-              <patient-manager v-if="uiVersion===1" :frame="selectedNode" @saved="handleCustomerChange" />
-              <elderly-care-manager v-if="uiVersion===3" :frame="selectedNode" @saved="handleCustomerChange" />
+<!--              <customer-manager v-if="uiVersionType===2" :frame="selectedNode" @saved="handleCustomerChange" />-->
+              <patient-manager :frame="selectedNode" @saved="handleCustomerChange" />
+<!--              <elderly-care-manager v-if="uiVersionType===3" :frame="selectedNode" @saved="handleCustomerChange" />-->
             </keep-alive>
           </el-tab-pane>
           <el-tab-pane :label="this.$t('frameManage.deviceList')" name="deviceList">
@@ -444,10 +444,8 @@ import * as API_Frame from '@/api/ncs_hospitalFrame'
 import CustomerManager from '../customer/components/customerManager'
 import DeviceManager from '../ncs-device/components/deviceManager'
 import PatientManager from '../customer/components/patientManager'
-// import { uiVersion } from '@/utils/domain'
 import { FRAME_TYPE } from '@/utils/enum/FrameTypeEnum'
 import ElderlyCareManager from "../customer/components/elderlyCareManager"
-const uiVersion = domain.uiVersion
 export default {
   name: 'FrameTreeView',
   components: {ElderlyCareManager, PatientManager, DeviceManager, CustomerManager },
@@ -509,8 +507,7 @@ export default {
       room_num_demo: '01',
       createFrameRules: {
 
-      },
-      uiVersion: uiVersion
+      }
     }
   },
   computed: {

+ 6 - 10
src/views/hospitalFrame/nurse_watch_frame.vue

@@ -10,8 +10,8 @@
             <el-col v-for="(item,index) in rooms" :key="index" :xs="8" :sm="8" :md="6" :lg="6" :xl="6">
               <el-card class="box-card">
                 <div v-if="roleId !== 8" slot="header" class="clearfix">
-                  <el-checkbox v-if="uiVersion === 1" v-model="item.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></el-checkbox>
-                  <span v-if="uiVersion !== 1"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></span>
+                  <el-checkbox v-if="uiVersionType === 1" v-model="item.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></el-checkbox>
+                  <span v-if="uiVersionType !== 1"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></span>
                   <el-checkbox v-model="item.allCkeck" style="float: right" :indeterminate="item.indeterminate" @change="(checked)=>{handleCheckAll(checked,item)}">
                     {{ $t('action.choiceAll') }}</el-checkbox>
                 </div>
@@ -33,8 +33,8 @@
             <el-col :span="24">
               <div class="text item">
                 <div v-if="roleId !== 8" style="margin: 10px;">
-                  <el-checkbox v-if="uiVersion === 1" v-model="rooms[0].checked" @change="handleCheckboxChanged(rooms[0])"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ rooms[0].name }}</span></el-checkbox>
-                  <span v-if="uiVersion !== 1"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ rooms[0].name }}</span></span>
+                  <el-checkbox v-if="uiVersionType === 1" v-model="rooms[0].checked" @change="handleCheckboxChanged(rooms[0])"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ rooms[0].name }}</span></el-checkbox>
+                  <span v-if="uiVersionType !== 1"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ rooms[0].name }}</span></span>
                   <el-checkbox v-model="rooms[0].allCkeck" style="margin-left: 30px;" :indeterminate="rooms[0].indeterminate" @change="(checked)=>{handleCheckAll(checked,rooms[0])}">{{ $t('action.choiceAll') }}</el-checkbox>
                 </div>
                 <el-row>
@@ -61,8 +61,8 @@
               <el-col v-for="(item,index) in group[1]" :key="index" :xs="8" :sm="8" :md="6" :lg="6" :xl="6">
                 <el-card class="box-card">
                   <div v-if="roleId !== 8" slot="header" class="clearfix">
-                    <el-checkbox v-if="uiVersion === 1" v-model="item.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></el-checkbox>
-                    <span v-if="uiVersion !== 1"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></span>
+                    <el-checkbox v-if="uiVersionType === 1" v-model="item.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></el-checkbox>
+                    <span v-if="uiVersionType !== 1"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></span>
                     <el-checkbox v-model="item.allCkeck" style="float: right" :indeterminate="item.indeterminate" @change="(checked)=>{handleCheckAll(checked,item)}">
                       {{ $t('action.choiceAll') }}</el-checkbox>
                   </div>
@@ -101,8 +101,6 @@
      */
 import * as API_hospitalFrame from '@/api/ncs_hospitalFrame'
 import * as API_device from '@/api/ncs_device'
-// import { uiVersion } from '@/utils/domain'
-const uiVersion = domain.uiVersion
 import {getFrameByRoleGroupId} from "@/api/ncs_hospitalFrame";
 
 export default {
@@ -136,7 +134,6 @@ export default {
       /** 空间结构分区 **/
       roomGroup:[],
       checkDate: [],
-      uiVersion: null,
       watchDeviceFrame: this.$t('watch.watchDeviceFrame'),
       activeName:'frameInfo'
     }
@@ -150,7 +147,6 @@ export default {
     }
   },
   mounted() {
-    this.uiVersion = uiVersion
     // if (this.deviceId === 0) {
     //   this.deviceId = this.$route.params.id
     // }

+ 2 - 4
src/views/ncs-clerk-frame-manage/components/employeeView.vue

@@ -149,7 +149,7 @@
                                                     <svg-icon icon-class="sickroom"
                                                               style="color: #9aaabf;margin-right: 5px"/>
                                                     <span>{{ item.name }}</span>
-                                                    <span v-if="uiVersion !== 1"><svg-icon icon-class="sickroom"
+                                                    <span v-if="uiVersionType !== 1"><svg-icon icon-class="sickroom"
                                                                                            style="color: #9aaabf;margin-right: 5px"/><span>{{ item.name }}</span></span>
                                                     <el-checkbox v-model="item.allCkeck" style="float: right"
                                                                  :indeterminate="item.indeterminate" :disabled="!clerkManageFrame.permissions.some(k=>k==='MANAGE_BED')"
@@ -194,7 +194,7 @@
                                                     <svg-icon icon-class="sickroom"
                                                               style="color: #9aaabf;margin-right: 5px"/>
                                                     <span>{{ item.name }}</span>
-                                                    <span v-if="uiVersion !== 1"><svg-icon icon-class="sickroom"
+                                                    <span v-if="uiVersionType !== 1"><svg-icon icon-class="sickroom"
                                                                                            style="color: #9aaabf;margin-right: 5px"/><span>{{ item.name }}</span></span>
                                                     <el-checkbox v-model="item.allCkeck" style="float: right"
                                                                  :indeterminate="item.indeterminate"
@@ -248,7 +248,6 @@
     import * as API_Clerk from '@/api/ncs_clerk'
     import {getRoleGroupClerkNoDoctor} from "@/api/ncs_clerk";
 
-    const uiVersion = domain.uiVersion
     const groupBy = (arr, func) =>
         arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
             acc[val] = (acc[val] || []).concat(arr[i])
@@ -277,7 +276,6 @@
                 clerkManageFrameSource: {},
                 managedRoomGroup: [],
                 noManagedRoomGroup: [],
-                uiVersion: uiVersion,
                 activeName1: 'allNoManange',
                 activeName2: 'allManaged',
                 currentClerk:{}

+ 12 - 0
src/views/ncs-orginazition/components/partInfoEdit.vue

@@ -93,6 +93,13 @@
                 <el-input v-model="formmodel.part_nurse_head" clearable :maxlength="100" :placeholder="this.$t('partInfo.partNurseHead')" />
               </el-form-item>
             </el-col>
+            <el-col v-if="isShow" :span="8">
+              <el-form-item label="机构UI类型" prop="ui_version_type">
+                <el-select v-model="formmodel.ui_version_type" placeholder="请选择机构UI类型" clearable>
+                  <el-option v-for="(item, index) in versionTypeList" :key="index" :label="item.label" :value="item.value" />
+                </el-select>
+              </el-form-item>
+            </el-col>
           </el-row>
         </fieldset>
         <fieldset class="margin-top-sm">
@@ -999,6 +1006,11 @@ export default {
         { key : 'Blue Code', value : 'BLUE_CODE' }
       ],
       voiceType: ['RTC', 'SIP'],
+      versionTypeList: [
+        {label: '医院版', value: 1},
+        {label: '月子中心版', value: 2},
+        {label: '养老院版', value: 3}
+      ]
     }
   },
   async mounted() {

+ 40 - 5
src/views/ncs-orginazition/index.vue

@@ -81,11 +81,18 @@
           <el-row>
             <el-col :span="8">
               <el-form-item :label="this.$t('partInfo.shopParentId')" prop="parent_id">
-                <el-select v-model="formmodel.parent_id" :placeholder="this.$t('partInfo.choiceShopParentId')" clearable>
+                <el-select v-model="formmodel.parent_id" :placeholder="this.$t('partInfo.choiceShopParentId')" clearable @change="changeParent">
                   <el-option v-for="(item,index) in parents" :key="index" :label="item.shop_name" :value="item.shop_id" />
                 </el-select>
               </el-form-item>
             </el-col>
+            <el-col :span="8">
+              <el-form-item label="机构UI类型" prop="ui_version_type">
+                <el-select v-model="formmodel.ui_version_type" placeholder="请选择机构UI类型" clearable>
+                  <el-option v-for="(item, index) in versionTypeList" :key="index" :label="item.label" :value="item.value" />
+                </el-select>
+              </el-form-item>
+            </el-col>
           </el-row>
         </el-form>
 
@@ -136,6 +143,9 @@ export default {
         ],
         member_password: [
           { required: true, message: this.$t('partInfo.shopMemberPasswordMsg'), trigger: 'blur' }
+        ],
+        ui_version_type: [
+            { required: true, message: '请选择机构UI类型', trigger: 'blur' }
         ]
       },
       /** 上级机构数组 **/
@@ -155,7 +165,12 @@ export default {
       filterState: null,
       rowSelection: null,
       frameworkComponents: null,
-      isDisabled: false
+      isDisabled: false,
+      versionTypeList: [
+        {label: '医院版', value: 1},
+        {label: '月子中心版', value: 2},
+        {label: '养老院版', value: 3}
+      ]
     }
   },
   computed: {
@@ -195,7 +210,11 @@ export default {
         filterParams: {debounceMs: 200, newRowsAction: 'keep'},
         cellRenderer: this.shopTypeFormatter
       },
-
+      { headerName: 'UI类型', field: 'ui_version_type', sortable: true, filter: 'agTextColumnFilter', width: 110,
+        // flex: 1,
+        filterParams: {debounceMs: 200, newRowsAction: 'keep'},
+        cellRenderer: this.versionTypeTypeFormatter
+      },
       { headerName: this.$t('partInfo.shopMemberName'), field: 'member_name', sortable: true, filter: 'agTextColumnFilter', width: 130
         // flex: 1
       },
@@ -365,7 +384,8 @@ export default {
         shop_name: '',
         full_name: '',
         member_name: '',
-        member_password: ''
+        member_password: '',
+        ui_version_type: null
       }
       this.getPartents()
     },
@@ -467,6 +487,14 @@ export default {
         return '<span style="color:orange">' + this.$t('partInfo.hospital') + '</span>'
       }
     },
+    versionTypeTypeFormatter(param) {
+      const data = this.versionTypeList.find(type => type.value === param.value)
+      if (data) {
+        return data.label
+      } else {
+        return this.$t('member.unknown')
+      }
+    },
     handEdit(row) {
       this.$router.push({ name: 'admin-part-settings', params: { id: row.shop_id, callback: this.getList() }})
     },
@@ -507,13 +535,20 @@ export default {
       initData()
     },
     deviceBind(row) {
-      console.log('--------------------', row.shop_id, row.parent_id)
       this.$router.push({ name: 'admin-device-frame', params: { id: row.shop_id, parent_id: row.parent_id }})
     },
     synchroDevice(row) { // 同步线上设备
       synchroDevice(row.union_id, row.shop_id).then(res => {
         this.$message.info(this.$t('action.initialing'))
       })
+    },
+    changeParent(e) {
+      if (e) {
+        const shop = this.parents.find(p=> p.shop_id === e)
+        if (shop.ui_version_type) {
+          this.formmodel.ui_version_type = shop.ui_version_type
+        }
+      }
     }
   }
 }