Browse Source

优化护士与护士长之间关系;优化护士换班;其他优化

wenningning 4 years ago
parent
commit
688e17980b

+ 8 - 2
src/api/ncs_clerk.js

@@ -56,9 +56,15 @@ export function getRoles(params) {
     data: params
   })
 }
-export function getNurseByRoleId(role_id, clerk_id) {
+export function getNurseByRoleId(roleId, partId) {
   return request({
-    url: `/ncs/clerk/getNurseByRoleId/${role_id}/${clerk_id}`,
+    url: `/ncs/clerk/getNurseByRoleId/${roleId}/${partId}`,
+    method: 'GET'
+  })
+}
+export function getNurseIds(partId, memberId) {
+  return request({
+    url: `/ncs/clerk/getNurseIds/${partId}/${memberId}`,
     method: 'GET'
   })
 }

+ 16 - 1
src/api/ncs_hospitalFrame.js

@@ -96,12 +96,27 @@ export function getFrameByType(id, deviceId, roleId) {
     loading: false
   })
 }
+export function getFrameByRoleId(id, roleId) {
+  return request({
+    url: `/ncs/frame/getFrameByRoleId/${id}/${roleId}`,
+    method: 'GET',
+    loading: false
+  })
+}
+export function getFrameByRoleGroupId(id, memberId) {
+  return request({
+    url: `/ncs/frame/getFrameByRoleGroupId/${id}/${memberId}`,
+    method: 'GET',
+    loading: false
+  })
+}
 export function updateDeviceFrameManage(params) {
   return request({
     url: '/ncs/frame/updateDeviceFrameManage',
     method: 'POST',
     loading: true,
-    data: params
+    data: params,
+    headers: { 'Content-Type': 'application/json' }
   })
 }
 /** 清空 */

+ 19 - 3
src/views/customer/components/customerManager.vue

@@ -587,8 +587,20 @@ export default {
   },
   watch: {
     frame(val, oldvalue) {
-      this.params.fixedCondition = Object.keys(this.frame).length === 0 ? 'part_id=' + this.$store.getters.partId : 'part_id=' + this.$store.getters.partId + ' and frame_id =' + this.frame.id
+      if (val.type === 3) { // 科室
+        this.params.fixedCondition = ' part_id =' + this.frame.part_id
+      } else if (val.type === 4) { // 房间
+        const ids = []
+        this.frame.children.forEach(item => {
+          ids.push(item.id)
+        })
+        this.params.fixedCondition = ' frame_id in (' + ids + ')'
+      } else {
+        this.params.fixedCondition = ' frame_id = ' + this.frame.id
+      }
       this.getList()
+      // this.params.fixedCondition = Object.keys(this.frame).length === 0 ? 'part_id=' + this.$store.getters.partId : 'part_id=' + this.$store.getters.partId + ' and frame_id =' + this.frame.id
+      // this.getList()
       this.infoChanged()
     }
   },
@@ -606,9 +618,10 @@ export default {
         resizable: false,
         valueGetter: this.hashValueGetter
       },
-      { headerName: 'ID', field: 'id', sortable: true, filter: 'agNumberColumnFilter', width: 100 },
+      // { headerName: 'ID', field: 'id', sortable: true, filter: 'agNumberColumnFilter', width: 100 },
       { headerName: '用户姓名', field: 'named', sortable: true, filter: 'agTextColumnFilter', width: 160 },
       { headerName: '昵称', field: 'nickname', sortable: true, filter: 'agTextColumnFilter', width: 130 },
+      { headerName: '入住床位', field: 'full_name', sortable: true, filter: 'agTextColumnFilter' },
       { headerName: '当前状态', field: 'status', sortable: true, filterFramework: 'RadioFilter', width: 130,
         filterParams: {
           listData: this.customerStatusTransfer
@@ -636,7 +649,6 @@ export default {
       { headerName: '入住编号', field: 'card_no', sortable: true, filter: 'agTextColumnFilter' },
       { headerName: '身份证件类型', field: 'id_type', sortable: true, filter: 'agTextColumnFilter' },
       { headerName: '证件号码', field: 'id_no', sortable: true, filter: 'agNumberColumnFilter', width: 160 },
-      { headerName: '入住床位', field: 'full_name', sortable: true, filter: 'agTextColumnFilter' },
       { headerName: '手机号码', field: 'mobile', sortable: true, filter: 'agTextColumnFilter' },
       { headerName: '家庭住址', field: 'address', sortable: true, filter: 'agTextColumnFilter', width: 260 },
 
@@ -999,6 +1011,7 @@ export default {
               this.isDisabled = false
               this.getList()
               this.infoChanged()
+              this.$emit('saved')
             }).catch(e => {
               this.$message.error(e)
               this.isDisabled = false
@@ -1032,6 +1045,7 @@ export default {
       }).then(() => {
         API_Customer.remove(ids).then(
           response => {
+            this.$emit('saved')
             this.getList()
             this.infoChanged()
           }
@@ -1075,6 +1089,7 @@ export default {
       }).then(() => {
         API_Customer.updateAll(this.formmodel).then(res => {
           this.$message.success('退床成功!')
+          this.$emit('saved')
           this.getList()
           this.infoChanged()
         })
@@ -1097,6 +1112,7 @@ export default {
         if (valid) {
           API_Customer.updateAll(this.changeBedFormModel).then(res => {
             this.$message.success('换床成功!')
+            this.$emit('saved')
             this.getList()
             this.infoChanged()
             this.changeBedFormVisible = false

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

@@ -34,7 +34,8 @@
           @node-click="nodeClick"
         >
           <span slot-scope="{ node, data }" class="custom-tree-node">
-            <span><svg-icon :icon-class="data.type===4?'sickroom':data.type===5?'bed':'area'" />{{ data.full_name }}</span>
+<!--            <span><svg-icon :icon-class="data.type===4?'sickroom':data.type===5?'bed':'area'" />{{ data.full_name }}</span>-->
+            <span><svg-icon :style="data.customer_id ? 'color: #0a901c' : ''" :icon-class="data.type===4?'sickroom':data.type===5?'bed':'area'" />{{ data.full_name }}</span>
             <span>
               <el-button
                 v-if="data.type!==5"
@@ -62,14 +63,14 @@
       </el-aside>
       <el-main>
         <el-tabs v-model="activeName" style="margin:0px;" type="border-card">
-          <el-tab-pane label="设备列表" name="deviceList">
+          <el-tab-pane label="用户列表" name="frameInfo">
             <keep-alive>
-              <device-manager :frame="selectedNode" />
+              <customer-manager :frame="selectedNode" @saved="handleCustomerChange"/>
             </keep-alive>
           </el-tab-pane>
-          <el-tab-pane label="用户列表" name="frameInfo">
+          <el-tab-pane label="设备列表" name="deviceList">
             <keep-alive>
-              <customer-manager :frame="selectedNode" />
+              <device-manager :frame="selectedNode" />
             </keep-alive>
           </el-tab-pane>
         </el-tabs>
@@ -184,7 +185,8 @@
     </el-dialog>
     <!---快速创建结构弹窗 -->
 
-  </div></template>
+  </div>
+</template>
 
 <script>
 import * as HospitalFrame_API from '@/api/ncs_hospitalFrame'
@@ -202,7 +204,7 @@ export default {
       selectedNodeId: 0,
       selectedNode: {},
       filterText: '',
-      activeName: 'deviceList',
+      activeName: 'frameInfo',
       /** 上级机构数组 **/
       parents: [],
       /** frame 编辑弹窗 **/
@@ -480,6 +482,9 @@ export default {
           // this.frameInfo.full_name =
         }
       }
+    },
+    handleCustomerChange() {
+      this.getFrameTree()
     }
   }
 }

+ 47 - 18
src/views/hospitalFrame/nurse_watch_frame.vue

@@ -5,21 +5,24 @@
         <fieldset class="margin-top-sm">
           <legend>移动设备管辖空间</legend>
           <el-row :gutter="20" type="flex">
-            <el-col v-for="(item,index) in rooms" :key="index"  :xs="8" :sm="6" :md="4" :lg="4" :xl="4">
+            <el-col v-for="(item,index) in rooms" :key="index" :xs="8" :sm="6" :md="4" :lg="4" :xl="4">
               <el-card class="box-card">
                 <div slot="header" class="clearfix">
-                  <el-checkbox v-model="item.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}</span></el-checkbox>
+                  <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>
 <!--                  <svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item.name }}房</span>-->
-                  <el-checkbox v-model="item.allCkeck" style="float: right;" :indeterminate="item.indeterminate" @change="(checked)=>{handleCheckAll(checked,item)}">全选</el-checkbox>
+                  <el-checkbox v-model="item.allCkeck" :style="uiVersion === 1 ? 'float: right;' : ''" :indeterminate="item.indeterminate" @change="(checked)=>{handleCheckAll(checked,item)}">全选</el-checkbox>
                 </div>
                 <div v-for="(bed,_index) in item.children" :key="_index" class="text item">
-                  <el-checkbox v-model="bed.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="bed" style="color: #9aaabf;margin-right: 5px" />{{ bed.name }}床</el-checkbox>
+                  <el-checkbox v-model="bed.checked" @change="handleCheckboxChanged(item)"><svg-icon icon-class="bed" style="color: #9aaabf;margin-right: 5px" />
+                    <span v-if="bed.device_id && !bed.checked" style="color: #13ce66">{{ bed.name }}床 {{ bed.clerk_name }}</span>
+                    <span v-else>{{ bed.name }}床</span>
+                  </el-checkbox>
                 </div>
               </el-card>
             </el-col>
           </el-row>
         </fieldset>
-        <el-form-item align="center" class="margin-top-sm">
+        <el-form-item v-if="roleName !== '护士组长'" align="center" class="margin-top-sm">
           <el-button type="success" @click="onSubmit">保存设置</el-button>
           <el-button type="primary" @click="onQK">清空设置</el-button>
           <el-button @click="back">返回</el-button>
@@ -35,6 +38,8 @@
      */
 import * as API_hospitalFrame from '@/api/ncs_hospitalFrame'
 import * as API_device from '@/api/ncs_device'
+import { uiVersion } from '@/utils/domain'
+import {getFrameByRoleGroupId} from "@/api/ncs_hospitalFrame";
 
 export default {
   name: 'FrameGroupEdit',
@@ -46,6 +51,14 @@ export default {
     roleId: {
       type: Number,
       default: 0
+    },
+    roleName: {
+      type: String,
+      default: ''
+    },
+    memberId: {
+      type: Number,
+      default: 0
     }
   },
   data() {
@@ -56,7 +69,8 @@ export default {
       /** 空间结构房间 **/
       rooms: [],
       checkList: [],
-      checkDate: []
+      checkDate: [],
+      uiVersion: null
     }
   },
   watch: {
@@ -65,12 +79,13 @@ export default {
     }
   },
   mounted() {
-    if (this.deviceId === 0) {
-      this.deviceId = this.$route.params.id
-    }
-    if (this.roleId === 0) {
-      this.roleId = this.$route.params.role_id
-    }
+    this.uiVersion = uiVersion
+    // if (this.deviceId === 0) {
+    //   this.deviceId = this.$route.params.id
+    // }
+    // if (this.roleId === 0) {
+    //   this.roleId = this.$route.params.role_id
+    // }
     this.getGroup()
   },
   methods: {
@@ -84,11 +99,18 @@ export default {
 
     getFrameByType() {
       const _this = this
-      API_hospitalFrame.getFrameByType(this.$store.getters.partId, this.deviceId, this.roleId).then(res => {
-        _this.rooms = _this.filterGroupFrames(res)
-      }).catch(err => {
-        this.$message.error(err)
-      })
+      // API_hospitalFrame.getFrameByType(this.$store.getters.partId, this.deviceId, this.roleId).then(res => {
+      //   _this.rooms = _this.filterGroupFrames(res)
+      // })
+      if (this.roleName === '护士组长') {
+        API_hospitalFrame.getFrameByRoleGroupId(this.$store.getters.partId, this.memberId).then(res => {
+          _this.rooms = _this.filterGroupFrames(res)
+        })
+      } else {
+        API_hospitalFrame.getFrameByRoleId(this.$store.getters.partId, this.roleId).then(res => {
+          _this.rooms = _this.filterGroupFrames(res)
+        })
+      }
     },
     /** 递归筛选被选空间节点 */
     filterGroupFrames(frames) {
@@ -154,13 +176,20 @@ export default {
     },
     onSubmit() {
       const data = []
+      const otherData = []
       this.rooms.forEach(item => {
         if (item.checked) {
           data.push(item.id)
+          if (item.device_id && item.device_id !== this.deviceId) {
+            otherData.push({ device_id: item.device_id, frame_id: item.id })
+          }
         }
         item.children.forEach(t => {
           if (t.checked) {
             data.push(t.id)
+            if (t.device_id && t.device_id !== this.deviceId) {
+              otherData.push({ device_id: t.device_id, frame_id: t.id })
+            }
           }
         })
       })
@@ -168,7 +197,7 @@ export default {
         this.$message.info('请选择病床!')
         return
       }
-      API_hospitalFrame.updateDeviceFrameManage({ deviceId: this.deviceId, frameIds: data }).then(res => {
+      API_hospitalFrame.updateDeviceFrameManage({ deviceId: this.deviceId, frameIds: data.join(','), delList: otherData }).then(res => {
         this.$message.success('保存成功!')
       }).catch(err => {
         this.$message.error(err.message)

+ 31 - 12
src/views/ncs-clerk/clerkList.vue

@@ -196,6 +196,7 @@
   import ImageViewer from "element-ui/packages/image/src/image-viewer"
   import RadioFilter from "@/components/AgGridCustomFilter/RadioFilter";
   import * as API_event from "@/api/ncs_event";
+  import {getNurseIds} from "@/api/ncs_clerk";
   let prevOverflow = ''
 
   export default {
@@ -495,6 +496,7 @@
       },
       /** 提交添加会员表单 */
       submitAddMemberForm(formName) {
+        const _this = this
         this.$refs[formName].validate((valid) => {
           if (valid) {
             const params = this.MixinClone(this.addMemberForm)
@@ -508,11 +510,16 @@
             }
             if (params.member_id) {
               if (this.roleZzId === params.role_id) {
+                let addIds = this.newCheckList.filter(function (val) { return _this.oldCheckList.indexOf(val) === -1 })
+                console.log('addIds=', addIds)
+                let delIds = this.oldCheckList.filter(function (val) { return _this.newCheckList.indexOf(val) === -1 })
+                console.log('delIds=', delIds)
                 const data = {
                   clerkId: params.clerk_id,
-                  newIds: this.newCheckList.join(','),
-                  oldIds: this.oldCheckList.join(',')
+                  addIds: addIds.join(','),
+                  delIds: delIds.join(',')
                 }
+                console.log('data==', data)
                 clerk_API.updateParentById(data)
               }
               clerk_API.update(params.clerk_id, params).then(response => {
@@ -547,7 +554,8 @@
       handlerEdit(row) {
         this.addMemberForm = Object.assign({}, row)
         if (this.roleZzId && this.roleZzId === row.role_id) { // 只有护士组长才能编辑小组成员
-          this.getNurseByRoleId(row.clerk_id)
+          this.getNurseByRoleId()
+          this.getNurseIds(row.member_id)
         }
         this.nurseList = []
         this.imageUrl = row.face
@@ -558,20 +566,31 @@
         }
         this.dialogAddMemberVisible = true
       },
-      getNurseByRoleId(id) {
+      getNurseByRoleId() {
         const _this = this
         this.newCheckList = []
         this.oldCheckList = []
-        clerk_API.getNurseByRoleId(_this.roleId, id).then(r => {
+        clerk_API.getNurseByRoleId(_this.roleId, this.shopId).then(r => {
           _this.nurseList = r
-          r.forEach(item => {
-            if (item.parent_id=== id) {
-              _this.newCheckList.push(item.clerk_id)
-              _this.oldCheckList.push(item.clerk_id)
-            }
-          })
+          // r.forEach(item => {
+          //   if (item.parent_id=== id) {
+          //     _this.newCheckList.push(item.clerk_id)
+          //     _this.oldCheckList.push(item.clerk_id)
+          //   }
+          // })
+        })
+      },
+      getNurseIds(id) {
+        const _this = this
+        clerk_API.getNurseIds(this.shopId, id).then(r => {
+          if (r) {
+            r.split(',').forEach(item => {
+              const id = parseInt(item)
+              _this.newCheckList.push(id)
+              _this.oldCheckList.push(id)
+            })
+          }
         })
-
       },
       /** 分页大小发生改变 */
       handlePageSizeChange(size) {

+ 55 - 46
src/views/ncs-device/nurse_watch.vue

@@ -17,7 +17,7 @@
       <!--工具栏-->
       <div slot="toolbar" class="inner-toolbar">
         <div class="toolbar-search">
-          <en-table-search placeholder="请输入搜索关键字" @search="handlerSearch" />
+          <en-table-search placeholder="请输入设备别名或设备标识码" @search="handlerSearch" />
         </div>
       </div>
       <el-pagination
@@ -48,13 +48,13 @@
               </el-radio-group>
             </el-form-item>
             <el-form-item style="margin-top:15px;">
-              <el-button type="primary" @click="handlerFormSubmit('editform')">保存修改</el-button>
-              <el-button v-if="member_id" type="primar" @click="xiaban('editform')">下班</el-button>
+              <el-button type="success" @click="handlerFormSubmit('editform')">保存修改</el-button>
+              <el-button v-if="member_id" type="primary" @click="xiaban">初始化设备</el-button>
             </el-form-item>
           </el-form>
         </el-tab-pane>
-        <el-tab-pane v-if="role_id" label="管理空间" name="watch-frame">
-          <nurse-watch-frame :device-id="deviceInfo.id" :role-id="role_id" @fanhui="fanhui" />
+        <el-tab-pane v-if="member_id" label="管理空间" name="watch-frame">
+          <nurse-watch-frame :device-id="deviceInfo.id" :role-id="role_id" :role-name="role_name" :member-id="member_id" @fanhui="fanhui" />
         </el-tab-pane>
       </el-tabs>
     </el-dialog>
@@ -70,7 +70,6 @@ import * as clerk_API from '@/api/ncs_clerk'
 import ButtonCellRender from '@/components/AgGridCellRender/ButtonCellRender'
 import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
 import nurseWatchFrame from '@/views/hospitalFrame/nurse_watch_frame'
-import * as API_UserInfo from "@/api/calling-userInfo";
 
 export default {
   name: 'Index',
@@ -117,6 +116,7 @@ export default {
       ],
       clerks: [],
       role_id: null,
+      role_name: '',
       activeName: 'huan-ban',
       member_id: null
     }
@@ -141,21 +141,21 @@ export default {
         valueGetter: this.hashValueGetter
       },
       { headerName: '设备别名', field: 'name', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
-      { headerName: '设备状态', field: 'status', sortable: true, cellRenderer: this.formatterSatus, minWidth: 120, filterFramework: 'RadioFilter',
-        filterParams: {
-          listData: this.deviceStatusTransfer
-        }
-      },
+      // { headerName: '设备状态', field: 'status', sortable: true, cellRenderer: this.formatterSatus, minWidth: 120, filterFramework: 'RadioFilter',
+      //   filterParams: {
+      //     listData: this.deviceStatusTransfer
+      //   }
+      // },
       { headerName: '绑定人', field: 'member_name', sortable: true, filter: 'agTextColumnFilter', minWidth: 140, valueFormatter: this.formatterName },
-      { headerName: '所属位置', field: 'full_name', sortable: true, filter: 'agTextColumnFilter', minWidth: 140 },
-      { headerName: '有线物理地址', field: 'eth_mac', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
+      // { headerName: '所属位置', field: 'full_name', sortable: true, filter: 'agTextColumnFilter', minWidth: 140 },
+      { headerName: '设备标识码', field: 'eth_mac', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
       { headerName: '有线IP地址', field: 'eth_ip', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
       { headerName: '设备型号', field: 'model', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
       { headerName: '出厂编号', field: 'code', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
-      { headerName: '软件版本', field: 'soft_ver', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
-      { headerName: '硬件版本', field: 'hard_ver', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
-      { headerName: 'WIFI物理地址', field: 'wifi_mac', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
-      { headerName: 'WIFIIP地址', field: 'wifi_ip', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
+      // { headerName: '软件版本', field: 'soft_ver', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
+      // { headerName: '硬件版本', field: 'hard_ver', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
+      // { headerName: 'WIFI物理地址', field: 'wifi_mac', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
+      // { headerName: 'WIFIIP地址', field: 'wifi_ip', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
       { headerName: 'SIP账号', field: 'sip_id', sortable: true, filter: 'agTextColumnFilter', minWidth: 150 },
       // { headerName: '最后修改时间', field: 'update_time', sortable: true, valueFormatter: this.formatterDate, minWidth: 170 },
       { headerName: '更新时间', field: 'update_time', sortable: true, filter: 'agDateColumnFilter', minWidth: 170, valueFormatter: this.formatterDate,
@@ -169,11 +169,13 @@ export default {
       {
         headerName: '换班', field: 'shop_id',
         cellRendererFramework: 'ButtonCellRender',
-        cellRendererParams: {
-          onClick: this.huanban,
-          label: '换班',
-          buttonType: 'success',
-          buttonSize: 'mini'
+        cellRendererParams: param => {
+          return {
+            onClick: this.huanban,
+            label: param.data['member_id'] === null ? '绑定' : '换班',
+            buttonType: param.data['member_id'] === null ? 'primary' : 'success',
+            buttonSize: 'mini'
+          }
         },
         filter: false,
         pinned: 'right',
@@ -182,22 +184,22 @@ export default {
         resizable: false,
         sortable: false
       },
-      {
-        headerName: '管理', field: 'shop_id',
-        cellRendererFramework: 'ButtonCellRender',
-        cellRendererParams: {
-          onClick: this.handEdit,
-          label: '管理',
-          buttonType: 'primary',
-          buttonSize: 'mini'
-        },
-        filter: false,
-        pinned: 'right',
-        lockPinned: true,
-        minWidth: 100,
-        resizable: false,
-        sortable: false
-      }
+      // {
+      //   headerName: '管理', field: 'shop_id',
+      //   cellRendererFramework: 'ButtonCellRender',
+      //   cellRendererParams: {
+      //     onClick: this.handEdit,
+      //     label: '管理',
+      //     buttonType: 'primary',
+      //     buttonSize: 'mini'
+      //   },
+      //   filter: false,
+      //   pinned: 'right',
+      //   lockPinned: true,
+      //   minWidth: 100,
+      //   resizable: false,
+      //   sortable: false
+      // }
     ]
     this.defaultColDef = {
       sortable: true,
@@ -250,7 +252,8 @@ export default {
         this.deviceInfo = JSON.parse(e.data)
         this.role_id = this.deviceInfo.role_id
         this.member_id = this.deviceInfo.member_id
-        this.getEmployees(this.deviceInfo.role_name)
+        this.role_name = this.deviceInfo.role_name
+        this.getEmployees()
       }
     },
     websocketclose: function(e) {
@@ -320,9 +323,13 @@ export default {
         role_id: this.role_id
       }
       this.sendMsg(sendData)
+      const _this = this
+      _this.member_id = _this.deviceInfo.member_id
+      _this.activeName = 'watch-frame'
+      _this.getEmployees()
     },
     xiaban() {
-      this.$confirm('您确定要下班吗?', '提示', {
+      this.$confirm('您确定要初始化吗?', '提示', {
         confirmButtonText: '确定',
         cancelButtonText: '取消',
         type: 'warning'
@@ -335,11 +342,11 @@ export default {
           role_id: this.role_id
         }
         this.sendMsg(sendData)
+        this.formshow = false
       })
     },
     sendMsg(sendData) {
       this.websock.send(JSON.stringify(sendData))
-      this.formshow = false
       const _this = this
       setTimeout(function() {
         _this.$message.success('操作成功')
@@ -420,7 +427,7 @@ export default {
         return '<span style="color:red">未启用</span>'
       }
     },
-    getEmployees(role_name) {
+    getEmployees() {
       const _this = this
       _this.nurses = []
       clerk_API.listByPartRoleId({ partId: this.$store.getters.partId }).then(res => {
@@ -432,10 +439,9 @@ export default {
           }, {})
         const groupData = groupBy(res, item => item.role_name)
         if (Object.entries(groupData).length > 0) {
-          console.log('_this.deviceInfo.member_id===', _this.deviceInfo.member_id)
           if (_this.deviceInfo.member_id) {
             Object.entries(groupData).forEach(item => {
-              if (item[0] === role_name) {
+              if (item[0] === _this.role_name) {
                 _this.nurses.push(item)
               }
             })
@@ -453,16 +459,19 @@ export default {
       }
     },
     huanban(row) {
+      this.activeName = 'huan-ban'
       this.formshow = true
-      this.deviceInfo = row
+      this.deviceInfo = Object.assign({}, row)
       this.role_id = this.deviceInfo.role_id
       this.member_id = this.deviceInfo.member_id
-      this.getEmployees(this.deviceInfo.role_name)
+      this.role_name = this.deviceInfo.role_name
+      this.getEmployees()
     },
     changeClerk(e) {
       const clerk = this.clerks.find(res => res.member_id === e)
       if (clerk) {
         this.role_id = clerk.role_id
+        this.role_name = clerk.role_name
       }
     },
     fanhui() {