WenNingning il y a 4 ans
Parent
commit
244e839776

+ 5 - 5
src/api/calling-patient.js

@@ -1,10 +1,10 @@
 /**
- * 病人信息接口请求
+ * 用户信息接口请求
  * @param params
  * @returns {Promise<any>}
  */
 import request from '@/utils/request'
-/** 新增病人 */
+/** 新增用户 */
 export function add(params) {
   return request({
     url: '/mgr/patient',
@@ -14,7 +14,7 @@ export function add(params) {
   })
 }
 
-/** 病人出院 */
+/** 用户出院 */
 export function remove(patientId, bedId) {
   return request({
     url: `/mgr/patient/${patientId}/${bedId}`,
@@ -23,7 +23,7 @@ export function remove(patientId, bedId) {
   })
 }
 
-/** 更新病人 */
+/** 更新用户 */
 export function update(id, params) {
   return request({
     url: `/mgr/patient/${id}`,
@@ -32,7 +32,7 @@ export function update(id, params) {
   })
 }
 
-/** 查询单个病人 */
+/** 查询单个用户 */
 export function get(id, params) {
   return request({
     url: `/mgr/patient/${id}`,

+ 7 - 0
src/api/ncs_device.js

@@ -161,4 +161,11 @@ export function updateByIds(params) {
     data: params
   })
 }
+export function getFrameByDeviceId(id) {
+  return request({
+    url: `/ncs/device/getFrameByDeviceId/${id}`,
+    method: 'GET',
+    loading: false
+  })
+}
 

+ 15 - 0
src/api/ncs_hospitalFrame.js

@@ -89,3 +89,18 @@ export function getFramesPartId(part_id) {
     loading: false
   })
 }
+export function getFrameByType(id, deviceId) {
+  return request({
+    url: `/ncs/frame/getFrameByType/${id}/${deviceId}`,
+    method: 'GET',
+    loading: false
+  })
+}
+export function updateDeviceFrameManage(params) {
+  return request({
+    url: '/ncs/frame/updateDeviceFrameManage',
+    method: 'POST',
+    loading: true,
+    data: params
+  })
+}

+ 16 - 16
src/layout/components/Navbar.vue

@@ -82,22 +82,22 @@ export default {
     }
   },
   mounted() {
-    if (Number(this.$store.getters.partId) > 0) {
-      API_Part.getExpire().then(res => {
-        if (res.timeout === 'nolimt') {
-          this.licence = '永久授权'
-        } else {
-          const days = Math.floor(((Number(res.timeout) * 1000) - new Date()) / (1000 * 60 * 60 * 24))
-          if (days > 30) {
-            this.licence = '授权有效期至: ' + new Date((Number(res.timeout) * 1000)).toLocaleString()
-          } else {
-            this.licence = '授权剩余有效期:' + days + '天,请联系售后获得授权'
-          }
-        }
-      }).catch(err => {
-        this.$message.error(err)
-      })
-    }
+    // if (Number(this.$store.getters.partId) > 0) {
+    //   API_Part.getExpire().then(res => {
+    //     if (res.timeout === 'nolimt') {
+    //       this.licence = '永久授权'
+    //     } else {
+    //       const days = Math.floor(((Number(res.timeout) * 1000) - new Date()) / (1000 * 60 * 60 * 24))
+    //       if (days > 30) {
+    //         this.licence = '授权有效期至: ' + new Date((Number(res.timeout) * 1000)).toLocaleString()
+    //       } else {
+    //         this.licence = '授权剩余有效期:' + days + '天,请联系售后获得授权'
+    //       }
+    //     }
+    //   }).catch(err => {
+    //     this.$message.error(err)
+    //   })
+    // }
   },
   methods: {
     toggleSideBar() {

+ 8 - 1
src/router/index.js

@@ -174,7 +174,7 @@ export const partRoutes = [
         path: 'index',
         component: () => import('@/views/ncs-device/nurse_watch'),
         name: 'nurse_watch',
-        meta: { title: '腕表管理', icon: 'component', noCache: true }
+        meta: { title: '腕表管理', icon: 'el-icon-watch', noCache: true }
       }
     ]
   },
@@ -248,6 +248,13 @@ export const partRoutes = [
         name: 'frameGroupEdit',
         meta: { title: '编辑区域信息', icon: 'area', noCache: true },
         hidden: true
+      },
+      {
+        path: 'nurse_watch_frame/:id?',
+        component: () => import('@/views/hospitalFrame/nurse_watch_frame'),
+        name: 'nurseWatchFrame',
+        meta: { title: '腕表管理空间', icon: 'area', noCache: true },
+        hidden: true
       }
     ]
   },

+ 1 - 1
src/views/customer/components/customerManager.vue

@@ -72,7 +72,7 @@
                       <el-select slot="append" v-model="formmodel.age_unit" placeholder="请选择年龄单位">
                         <el-option label="岁" value="岁" />
                         <el-option label="月" value="月" />
-                        <el-option label="天" value="" />
+                        <el-option label="天" value="" />
                       </el-select>
                     </el-input>
                   </el-form-item>

+ 19 - 6
src/views/customer/customerEdit.vue

@@ -5,13 +5,13 @@
         <el-form :model="formmodel" :rules="rules" ref="editForm" label-width="140px">
           <el-row>
             <el-col :span="8">
-              <el-form-item label="病人姓名" prop="named">
+              <el-form-item label="用户姓名" prop="named">
                 <el-input v-model="formmodel.named" clearable placeholder="请输入姓名" :maxlength="20"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
-              <el-form-item label="病人编号">
-                <el-input v-model="formmodel.card_no" clearable placeholder="请输入病人编号" :maxlength="20"></el-input>
+              <el-form-item label="用户编号">
+                <el-input v-model="formmodel.card_no" clearable placeholder="请输入用户编号" :maxlength="20"></el-input>
               </el-form-item>
             </el-col>
             <el-col :span="8">
@@ -20,7 +20,7 @@
                   <el-select slot="append" v-model="formmodel.age_unit" placeholder="请选择年龄单位">
                     <el-option label="岁" value="岁" />
                     <el-option label="月" value="月" />
-                    <el-option label="天" value="" />
+                    <el-option label="天" value="" />
                   </el-select>
                 </el-input>
               </el-form-item>
@@ -31,7 +31,7 @@
             <el-col :span="8">
               <el-form-item label="性别" class="form-item-sex">
                 <el-radio v-model="formmodel.sex" :label="1">男</el-radio>
-                <el-radio v-model="formmodel.sex" :label="2">女</el-radio>
+                <el-radio v-model="formmodel.sex" :label="0">女</el-radio>
                 <el-radio v-model="formmodel.sex" :label="3">未知</el-radio>
               </el-form-item>
             </el-col>
@@ -213,7 +213,7 @@
           </el-form>
         </el-dialog>
       </el-tab-pane>
-      <el-tab-pane v-if="customerId != 0" label="病人亲属" name="customer-relative">
+      <el-tab-pane v-if="customerId != 0" label="用户亲属" name="customer-relative">
         <customer-relative :member-id="memberId"></customer-relative>
       </el-tab-pane>
     </el-tabs>
@@ -369,6 +369,13 @@
             _this.formmodel.doctor_mapping_id = null
             _this.formmodel.nurse_Mapping_id = null
             _this.formmodel.worker_mapping_id = null
+            if (_this.formmodel.in_date) {
+              _this.formmodel.in_date = _this.formmodel.in_date * 1000
+            }
+            if (_this.formmodel.out_date) {
+              _this.formmodel.out_date = _this.formmodel.out_date * 1000
+            }
+            console.log(_this.formmodel.in_date, _this.formmodel.out_date)
             _this.getRemarks()
             if (res.list !== null) {
               _this.nurseData.forEach((item, index)=> {
@@ -413,6 +420,12 @@
         this.$refs[formName].validate(valid => {
           if (valid) {
             this.isDisabled = true
+            if (this.formmodel.in_date) {
+              this.formmodel.in_date = this.formmodel.in_date / 1000
+            }
+            if (this.formmodel.out_date) {
+              this.formmodel.out_date = this.formmodel.out_date / 1000
+            }
             if (this.customerId === 0) {
               this.formmodel.frame_id = this.frameId
               this.formmodel.list = this.nurseConfigDtos

+ 4 - 4
src/views/customer/customer_relative.vue

@@ -49,7 +49,7 @@
       </el-pagination>
     </en-table-layout>
 
-    <el-dialog title="添加病人亲属" :visible.sync="dialogAddVisible" :append-to-body="true" width="80%">
+    <el-dialog title="添加用户亲属" :visible.sync="dialogAddVisible" :append-to-body="true" width="80%">
       <el-form :model="formmodel" :rules="rules" ref="editForm" label-width="140px">
         <el-row>
           <el-col :span="12">
@@ -67,7 +67,7 @@
           <el-col :span="12">
             <el-form-item label="性别" class="form-item-sex">
               <el-radio v-model="formmodel.sex" :label="1">男</el-radio>
-              <el-radio v-model="formmodel.sex" :label="2">女</el-radio>
+              <el-radio v-model="formmodel.sex" :label="0">女</el-radio>
               <el-radio v-model="formmodel.sex" :label="3">未知</el-radio>
             </el-form-item>
           </el-col>
@@ -192,7 +192,7 @@
       },
       /** 单条数据删除处理 */
       handlerDelete(ids) {
-        let test = '你确定要删除此病人亲属信息?'
+        let test = '你确定要删除此用户亲属信息?'
         let _this = this
         this.$confirm(test, '警告', {
           confirmButtonText: '确定',
@@ -255,7 +255,7 @@
       formatterSex(row, column, cellValue) {
         if (row.sex === 1) {
           return '男'
-        } else if (row.sex === 2) {
+        } else if (row.sex === 0) {
           return '女'
         } else {
           return '未知'

+ 62 - 25
src/views/customer/list.vue

@@ -4,18 +4,18 @@
     <div class="toolbar" style="padding-left: 20px">
       <el-form :inline="true" label-width="120px">
         <el-form-item>
-          <el-input v-model="searchStr" placeholder="请输入病人姓名、编号、病床" clearable @clear="clickSearch" @keyup.native.enter="clickSearch">
+          <el-input v-model="searchStr" placeholder="请输入用户姓名、编号、病床" clearable @clear="clickSearch" @keyup.native.enter="clickSearch">
             <el-button slot="append" icon="el-icon-search" @click="clickSearch"></el-button>
           </el-input>
         </el-form-item>
-        <el-form-item label="病人状态">
-          <el-select v-model="callingType" placeholder="请选择病人状态" clearable @change="changeStatus">
+        <el-form-item label="用户状态">
+          <el-select v-model="callingType" placeholder="请选择用户状态" clearable @change="changeStatus">
             <el-option label="在院" :value="0" />
             <el-option label="已出院" :value="1" />
           </el-select>
         </el-form-item>
         <el-form-item>
-          <el-button type="danger" :disabled="multipleSelection.length === 0" @click="batchDelete">批量删除</el-button>
+          <el-button type="danger" @click="batchDelete">批量删除</el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -45,7 +45,7 @@
               @current-change="handlePageCurrentChange"
       />
     </ag-grid-layout>
-    <el-dialog title="编辑病人信息" :visible.sync="dialogAddVisible" :append-to-body="true" width="85%">
+    <el-dialog title="编辑用户信息" :visible.sync="dialogAddVisible" :append-to-body="true" width="85%">
       <customer-edit :customer-id="customerId" :frame-id="frameId" @saved="handlePatientFinished"></customer-edit>
     </el-dialog>
 
@@ -70,17 +70,18 @@
 
 <script>
   import * as API_customer from '@/api/ncs_customer'
-  import {unix2Date} from "@/utils/Foundation"
+  import { unixToDate } from "@/utils/Foundation"
   import customerEdit from '@/views/customer/customerEdit'
   import * as RegExp from "@/utils/RegExp"
   import * as API_hospitalFrame from "@/api/ncs_hospitalFrame"
   import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
   import {param} from "@/utils"
   import ButtonCellRender from "@/components/AgGridCellRender/ButtonCellRender";
+  import RadioFilter from "@/components/AgGridCustomFilter/RadioFilter";
 
   export default {
     name: 'customer_list',
-    components: { customerEdit, ButtonCellRender },
+    components: { customerEdit, ButtonCellRender, RadioFilter },
     data: function() {
       return {
         /** 列表loading状态 */
@@ -117,6 +118,14 @@
         columnApi: null,
         localeText: AG_GRID_LOCALE_CN,
         rowSelection: null,
+        sexTransfer: [
+          { key: '男', value: 1, color: 'green' },
+          { key: '女', value: 0, color: 'red' }
+        ],
+        statusTransfer: [
+          { key: '已出院', value: 1,  color: 'orange' },
+          { key: '在院', value: 0,  color: 'green' }
+        ]
       }
     },
     computed: {
@@ -138,13 +147,27 @@
           resizable: false,
           valueGetter: this.hashValueGetter
         },
-        { headerName: '姓名', field: 'named', sortable: true, filter: 'agTextColumnFilter', width: 160 },
-        { headerName: '病人编号', field: 'card_no', sortable: true, filter: true, width: 170 },
-        { headerName: '年龄', field: 'age', sortable: true, filter: false, valueFormatter: this.formatterAge, width: 100 },
-        { headerName: '性别', field: 'sex', sortable: true, filter: false, valueFormatter: this.formatterSex, width: 100 },
-        { headerName: '住院时间', field: 'in_date', valueFormatter: this.formatterDate, sortable: true, filter: false, width: 220 },
-        { headerName: '状态', field: 'status', sortable: true, filter: false, valueFormatter: this.formatterStatus, width: 100 },
-        { headerName: '病床', field: 'full_name', sortable: true, filter: true, width: 120 },
+        { headerName: '姓名', field: 'named', sortable: true, filter: 'agTextColumnFilter', minWidth: 160 },
+        { headerName: '用户编号', field: 'card_no', sortable: true, filter: true, minWidth: 170 },
+        { headerName: '年龄', field: 'age', sortable: true, filter: 'agNumberColumnFilter', valueFormatter: this.formatterAge, minWidth: 100 },
+        { headerName: '性别', field: 'sex', sortable: true, filter: true, cellRenderer: this.formatterSex, minWidth: 100, filterFramework: 'RadioFilter',
+          filterParams: {
+            listData: this.sexTransfer
+          }
+        },
+        { headerName: '住院时间', field: 'in_date', valueFormatter: this.formatterDate, sortable: true, minWidth: 220, filter: 'agDateColumnFilter',
+          filterParams: {
+            comparator: (filterLocalDateAtMidnight, cellValue) => { // 所有数据都由服务器端过滤,此处只需返回0 即可
+              return 0
+            }
+          }
+        },
+        { headerName: '状态', field: 'status', sortable: true, filter: false, cellRenderer: this.formatterStatus, minWidth: 100, filterFramework: 'RadioFilter',
+          filterParams: {
+            listData: this.statusTransfer
+          }
+        },
+        { headerName: '病床', field: 'full_name', sortable: true, filter: true, minWidth: 120 },
         { headerName: '操作任务', field: 'id',
           cellRendererFramework: 'ButtonCellRender',
           cellRendererParams: param => {
@@ -223,6 +246,7 @@
       GET_List() {
         this.loading = true
         this.gridApi.showLoadingOverlay()
+        this.gridApi.sizeColumnsToFit()
         API_customer.getList(this.params).then(res => {
           this.loading = false
           this.tableData = res.data
@@ -251,7 +275,7 @@
       },
       /** 单条数据删除处理 */
       handlerDelete(ids) {
-        let test = '你确定要删除此病人信息?'
+        let test = '你确定要删除此用户信息?'
         let _this = this
         this.$confirm(test, '警告', {
           confirmButtonText: '确定',
@@ -272,8 +296,13 @@
       },
       /** 批量数据删除处理(删除选中的行) */
       batchDelete: function() {
+        let rows = this.gridApi.getSelectedRows()
+        if (rows.length === 0) {
+          this.$message({ type: 'info', message: '请先勾选需要删除的数据' })
+          return
+        }
         const ids = []
-        this.multipleSelection.forEach(function(item) {
+        rows.forEach(function (item) {
           ids.push(item.id)
         })
         this.handlerDelete(ids.join(','), 'del')
@@ -320,17 +349,19 @@
       formatterAge(param) {
         return param.data.age + param.data.age_unit
       },
-      formatterStatus(param) {
-        if (param.value) {
-          return '已出院'
+      formatterStatus(params) {
+        if (params.value === null || params.value === undefined) return ''
+        const item = this.statusTransfer.filter(p => p.value === params.value)[0]
+        if (item) {
+          return '<span style="color:' + item.color + ';">' + item.key + '</span>'
         } else {
-          return '在院'
+          return '未知'
         }
       },
       formatterDate(param) {
-        let date = unix2Date(param.data.in_date, 'yyyy-MM-dd')
+        let date = unixToDate(param.data.in_date, 'yyyy-MM-dd')
         if (param.data.out_date) {
-          date += '至' + unix2Date(param.data.out_date, 'yyyy-MM-dd')
+          date += '至' + unixToDate(param.data.out_date, 'yyyy-MM-dd')
         } else {
           if (param.data.in_date) {
             date += '至今'
@@ -366,12 +397,18 @@
         })
       },
       clickSearch(value) {
-        this.params.filerStr = this.searchStr
+        this.params.query = this.searchStr
         this.GET_List()
       },
       /** 性别格式化 */
-      formatterSex(row) {
-        return row.data.sex === 1 ? '男' :  row.data.sex === 2 ? '女' : '未知'
+      formatterSex(params) {
+        if (params.value === null || params.value === undefined) return ''
+        const item = this.sexTransfer.filter(p => p.value === params.value)[0]
+        if (item) {
+          return '<span style="color:' + item.color + ';">' + item.key + '</span>'
+        } else {
+          return '未知'
+        }
       },
       filterModifed(param) {
         let model = param.api.getFilterModel()

+ 4 - 4
src/views/dashboard/calling/components/SickBedBoard.vue

@@ -96,7 +96,7 @@
                   <el-form-item label="性别" prop="patient_sex">
                     <el-select v-model="formmodel.patient_sex" placeholder="请选择性别" clearable>
                       <el-option label="男" :value="1" />
-                      <el-option label="女" :value="2" />
+                      <el-option label="女" :value="0" />
                       <el-option label="未知" :value="3" />
                     </el-select>
                   </el-form-item>
@@ -383,7 +383,7 @@ export default {
         notice_text: null
       },
       /** 弹出窗口标题信息 */
-      formtitle: '编辑病人信息',
+      formtitle: '编辑用户信息',
       formshow: false, // 编辑表单显示开关
       formshow1: false, // 换床dialog
       noticehow: false, // 推送通知弹窗
@@ -513,7 +513,7 @@ export default {
     /** 入院登记 */
     inHospital(bedinfo) {
       this.editflag = 0
-      this.formtitle = '病人入院登记【' + bedinfo.DEVICE_ROOM_NUM + '房' + bedinfo.DEVICE_BED_NUM + '床】'
+      this.formtitle = '用户入院登记【' + bedinfo.DEVICE_ROOM_NUM + '房' + bedinfo.DEVICE_BED_NUM + '床】'
       this.formshow = true
       this.formmodel = {
         bed_id: bedinfo.ID,
@@ -570,7 +570,7 @@ export default {
         this.$refs.editform.resetFields()
       }
       this.getPatientInfo(bedinfo.DEVICE_HUMAN_ID)
-      this.formtitle = '编辑病人资料【' + bedinfo.DEVICE_ROOM_NUM + '房' + bedinfo.DEVICE_BED_NUM + '床】'
+      this.formtitle = '编辑用户资料【' + bedinfo.DEVICE_ROOM_NUM + '房' + bedinfo.DEVICE_BED_NUM + '床】'
       this.formshow = true
     },
     getPatientInfo(id) {

+ 2 - 2
src/views/dashboard/calling/index.vue

@@ -71,7 +71,7 @@
       </el-col>
     </el-row>
 
-    <el-row :gutter="20">
+    <el-row :gutter="20" style="margin-top: 20px">
       <el-col :span="16">
         <el-card style="maring:10px">
           <div slot="header" class="clearfix">
@@ -93,7 +93,7 @@
       <el-col :span="8">
         <el-card>
           <div slot="header" class="clearfix">
-            <span style="float: left">最近患者备注</span>
+            <span style="float: left">最近用户备注</span>
             <el-link type="primary" style="float: right" @click="goMove('customerList')">更多</el-link>
           </div>
           <div style="clear:both;font-size: 14px;height: 300px;">

+ 186 - 186
src/views/hospitalFrame/hospitalFrame.vue

@@ -37,12 +37,12 @@
               <el-button style="width: 150px;" size="mini" plain round @click="handleEditPatient(subItem.customer_id,subItem.frame_bed.id)">
                 <i class="el-icon-user" /> {{ subItem.customer_name+ ' '+ subItem.customer_age+subItem.customer_age_unit }}
                 <span v-if="subItem.customer_sex === 1">男</span>
-                <span v-else-if="subItem.customer_sex === 2">女</span>
+                <span v-else-if="subItem.customer_sex === 0">女</span>
                 <span v-else>未知</span>
               </el-button>
             </span>
             <span v-else>
-              <el-button size="mini" type="success" plain round @click="handleAddPatient(subItem.frame_bed)"><i class="el-icon-circle-plus-outline" /> 病人</el-button>
+              <el-button size="mini" type="success" plain round @click="handleAddPatient(subItem.frame_bed)"><i class="el-icon-circle-plus-outline" /> 用户</el-button>
             </span>
             <span>
               <el-dropdown size="mini" @command="handleGroupCommand">
@@ -66,9 +66,9 @@
     </div>
 
     <el-dialog
-      title="病人信息"
-      :visible.sync="dialogPatientVisible"
-      width="85%"
+            title="用户信息"
+            :visible.sync="dialogPatientVisible"
+            width="85%"
     >
       <customer-edit :customer-id="customerId" :frame-id="frameId" @saved="handlePatientFinished" />
     </el-dialog>
@@ -109,10 +109,10 @@
     </el-dialog>
 
     <el-drawer
-      :title="selectedFrame.full_name+' 设备'"
-      :visible.sync="deviceVisible"
-      :append-to-body="true"
-      size="60%"
+            :title="selectedFrame.full_name+' 设备'"
+            :visible.sync="deviceVisible"
+            :append-to-body="true"
+            size="60%"
     >
       <device-info :frame-id="frameId" :frame="selectedFrame" />
     </el-drawer>
@@ -120,206 +120,206 @@
 </template>
 
 <script>
-import * as HospitalFrame_API from '@/api/ncs_hospitalFrame'
-import * as RegExp from '@/utils/RegExp'
-import customerEdit from '@/views/customer/customerEdit'
-import DeviceInfo from '@/views/ncs-device/deviceInfo'
+  import * as HospitalFrame_API from '@/api/ncs_hospitalFrame'
+  import * as RegExp from '@/utils/RegExp'
+  import customerEdit from '@/views/customer/customerEdit'
+  import DeviceInfo from '@/views/ncs-device/deviceInfo'
 
-export default {
-  name: 'HospitalFrame',
-  components: { DeviceInfo, customerEdit },
-  data: function() {
-    return {
-      hospital_frame: null,
-      frameAddVisible: false,
-      frameName: '',
-      dialogPatientVisible: false,
-      customerId: null,
-      dialogFrameVisible: false,
-      frameInfo: {},
-      deviceVisible: false,
-      frameId: 0,
-      selectedFrame: {},
-      rules: {
-        name: [
-          this.MixinRequired('请输入名称!'),
-          { min: 1, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
-          {
-            validator: (rule, value, callback) => {
-              if (!RegExp.userName.test(value)) {
-                callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
-              } else {
-                callback()
+  export default {
+    name: 'HospitalFrame',
+    components: { DeviceInfo, customerEdit },
+    data: function() {
+      return {
+        hospital_frame: null,
+        frameAddVisible: false,
+        frameName: '',
+        dialogPatientVisible: false,
+        customerId: null,
+        dialogFrameVisible: false,
+        frameInfo: {},
+        deviceVisible: false,
+        frameId: 0,
+        selectedFrame: {},
+        rules: {
+          name: [
+            this.MixinRequired('请输入名称!'),
+            { min: 1, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
+            {
+              validator: (rule, value, callback) => {
+                if (!RegExp.userName.test(value)) {
+                  callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
+                } else {
+                  callback()
+                }
               }
             }
-          }
-        ],
-        alias: [
-          { min: 1, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
-          {
-            validator: (rule, value, callback) => {
-              if (!value) {
-                callback()
-              }
-              if (!RegExp.userName.test(value)) {
-                callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
-              } else {
-                callback()
+          ],
+          alias: [
+            { min: 1, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
+            {
+              validator: (rule, value, callback) => {
+                if (!value) {
+                  callback()
+                }
+                if (!RegExp.userName.test(value)) {
+                  callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
+                } else {
+                  callback()
+                }
               }
             }
-          }
-        ]
-      },
-      fullName: null
-    }
-  },
-  watch: {
-    deviceVisible: function(newData) {
-      if (!newData) {
-        this.GET_All()
+          ]
+        },
+        fullName: null
       }
-    }
-  },
-  mounted() {
-    this.GET_All()
-  },
-  methods: {
-    GET_All() {
-      HospitalFrame_API.getHospitalFrameList(this.$store.getters.userInfo.last_login_shopid).then(response => {
-        if (response) {
-          console.log(response)
-          this.hospital_frame = response
-        }
-      }).catch(response => {
-        this.$message({
-          type: 'info',
-          message: response.message
-        })
-      })
-    },
-    /** 下拉触发 */
-    handleGroupCommand(object) {
-      console.log(object)
-      this.selectedFrame = object.frame
-      switch (object.type) {
-        case 'edit':
-          this.handelEditFrame(object.frame)
-          break
-        case 'delete':
-          this.handlerDeleteFrame(object.frame.id)
-          break
-        case 'device':
-          this.frameId = object.frame.id
-          this.openDeviceList()
-          break
-      }
-    },
-    handleAddPatient(bedFrame) {
-      this.customerId = 0
-      this.frameId = bedFrame.id
-      this.dialogPatientVisible = true
-    },
-    handlePatientFinished() {
-      this.dialogPatientVisible = false
-      this.GET_All()
-    },
-    handleEditPatient(id, frameId) {
-      this.dialogPatientVisible = true
-      this.customerId = id
-      this.frameId = frameId
     },
-    // frame handle
-    handleAddRoom() {
-      let parent_id = null
-      if (this.hospital_frame) {
-        parent_id = this.hospital_frame.frame_part.id
+    watch: {
+      deviceVisible: function(newData) {
+        if (!newData) {
+          this.GET_All()
+        }
       }
-      const params = { type: 4, name: this.frameName, part_id: this.$store.getters.partId, parent_id: parent_id }
-      params.full_name = params.name + '房'
-      HospitalFrame_API.addHospitalFrame(params).then(response => {
-        this.$message.success('添加成功!')
-        this.GET_All()
-      })
-    },
-    handleAddFrame(id, name) { // 新增床位
-      this.frameInfo = {}
-      this.frameInfo = { parent_id: id, type: 5 }
-      this.fullName = name
-      this.dialogFrameVisible = true
     },
-    handelEditFrame(frame) {
-      this.frameInfo = { id: frame.id, type: frame.type, name: frame.name, alias: frame.alias, full_name: frame.full_name }
-      this.dialogFrameVisible = true
-    },
-    handleFrameFinished() {
-      this.dialogFrameVisible = false
+    mounted() {
       this.GET_All()
     },
-    /** 单条数据删除处理 */
-    handlerDeleteFrame(ids) {
-      this.$confirm('确定要删除此结构及其所有下级吗?', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        HospitalFrame_API.deleteHospitalFrame(ids).then(response => {
-          this.$message({
-            type: 'success',
-            message: '已删除!'
-          })
-          this.GET_All()
+    methods: {
+      GET_All() {
+        HospitalFrame_API.getHospitalFrameList(this.$store.getters.userInfo.last_login_shopid).then(response => {
+          if (response) {
+            console.log(response)
+            this.hospital_frame = response
+          }
         }).catch(response => {
           this.$message({
             type: 'info',
             message: response.message
           })
         })
-      })
-    },
+      },
+      /** 下拉触发 */
+      handleGroupCommand(object) {
+        console.log(object)
+        this.selectedFrame = object.frame
+        switch (object.type) {
+          case 'edit':
+            this.handelEditFrame(object.frame)
+            break
+          case 'delete':
+            this.handlerDeleteFrame(object.frame.id)
+            break
+          case 'device':
+            this.frameId = object.frame.id
+            this.openDeviceList()
+            break
+        }
+      },
+      handleAddPatient(bedFrame) {
+        this.customerId = 0
+        this.frameId = bedFrame.id
+        this.dialogPatientVisible = true
+      },
+      handlePatientFinished() {
+        this.dialogPatientVisible = false
+        this.GET_All()
+      },
+      handleEditPatient(id, frameId) {
+        this.dialogPatientVisible = true
+        this.customerId = id
+        this.frameId = frameId
+      },
+      // frame handle
+      handleAddRoom() {
+        let parent_id = null
+        if (this.hospital_frame) {
+          parent_id = this.hospital_frame.frame_part.id
+        }
+        const params = { type: 4, name: this.frameName, part_id: this.$store.getters.partId, parent_id: parent_id }
+        params.full_name = params.name + '房'
+        HospitalFrame_API.addHospitalFrame(params).then(response => {
+          this.$message.success('添加成功!')
+          this.GET_All()
+        })
+      },
+      handleAddFrame(id, name) { // 新增床位
+        this.frameInfo = {}
+        this.frameInfo = { parent_id: id, type: 5 }
+        this.fullName = name
+        this.dialogFrameVisible = true
+      },
+      handelEditFrame(frame) {
+        this.frameInfo = { id: frame.id, type: frame.type, name: frame.name, alias: frame.alias, full_name: frame.full_name }
+        this.dialogFrameVisible = true
+      },
+      handleFrameFinished() {
+        this.dialogFrameVisible = false
+        this.GET_All()
+      },
+      /** 单条数据删除处理 */
+      handlerDeleteFrame(ids) {
+        this.$confirm('确定要删除此结构及其所有下级吗?', '警告', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          HospitalFrame_API.deleteHospitalFrame(ids).then(response => {
+            this.$message({
+              type: 'success',
+              message: '已删除!'
+            })
+            this.GET_All()
+          }).catch(response => {
+            this.$message({
+              type: 'info',
+              message: response.message
+            })
+          })
+        })
+      },
 
-    // --------------------设备管理
-    handlePartDevice() {
-      this.frameId = this.hospital_frame.frame_part.id
-      this.selectedFrame = this.hospital_frame.frame_part
-      this.openDeviceList()
-    },
-    openDeviceList() {
-      this.deviceVisible = true
-    },
-    handlerSubmit(formName) {
-      this.$refs[formName].validate(valid => {
-        if (valid) {
-          const params = this.MixinClone(this.frameInfo)
-          if (params.id) {
-            if (params.type === 5) {
-              const name = params.full_name.split('-')
-              params.full_name = name[0] + '-' + params.name + '床'
-            } else if (params.type === 4) {
-              params.full_name = params.name + '房'
+      // --------------------设备管理
+      handlePartDevice() {
+        this.frameId = this.hospital_frame.frame_part.id
+        this.selectedFrame = this.hospital_frame.frame_part
+        this.openDeviceList()
+      },
+      openDeviceList() {
+        this.deviceVisible = true
+      },
+      handlerSubmit(formName) {
+        this.$refs[formName].validate(valid => {
+          if (valid) {
+            const params = this.MixinClone(this.frameInfo)
+            if (params.id) {
+              if (params.type === 5) {
+                const name = params.full_name.split('-')
+                params.full_name = name[0] + '-' + params.name + '床'
+              } else if (params.type === 4) {
+                params.full_name = params.name + '房'
+              }
+              HospitalFrame_API.updateHospitalFrame(params.id, params).then(response => {
+                this.$message.success('修改成功!')
+                this.handleFrameFinished()
+              })
+            } else {
+              if (!params.part_id) {
+                params.part_id = this.$store.getters.partId
+              }
+              params.full_name = this.fullName + '房-' + params.name + '床'
+              HospitalFrame_API.addHospitalFrame(params).then(response => {
+                this.$message.success('添加成功!')
+                this.handleFrameFinished()
+              })
             }
-            HospitalFrame_API.updateHospitalFrame(params.id, params).then(response => {
-              this.$message.success('修改成功!')
-              this.handleFrameFinished()
-            })
           } else {
-            if (!params.part_id) {
-              params.part_id = this.$store.getters.partId
-            }
-            params.full_name = this.frameInfo.name + '房-' + params.name + '床'
-            HospitalFrame_API.addHospitalFrame(params).then(response => {
-              this.$message.success('添加成功!')
-              this.handleFrameFinished()
-            })
+            this.$message.error('表单填写有误,请检查!')
+            return false
           }
-        } else {
-          this.$message.error('表单填写有误,请检查!')
-          return false
-        }
-      })
-    }
+        })
+      }
 
+    }
   }
-}
 </script>
 
 <style type="text/scss" lang="scss" scoped>

+ 224 - 0
src/views/hospitalFrame/nurse_watch_frame.vue

@@ -0,0 +1,224 @@
+<template>
+  <div>
+    <el-card style="margin: 15px">
+      <el-form ref="editform" label-width="80px">
+        <fieldset class="margin-top-sm">
+          <legend>腕表管辖空间</legend>
+<!--          <el-row :gutter="20">-->
+<!--            <el-col v-for="(item,index) in rooms" :key="index" gut :xs="8" :sm="6" :md="4" :lg="4" :xl="4">-->
+<!--              <el-card class="box-card">-->
+<!--                <div slot="header" class="clearfix">-->
+<!--                  <svg-icon icon-class="sickroom" style="color: #9aaabf;margin-right: 5px" /><span>{{ item[1][0].full_name.split('-')[0] }}房</span>-->
+<!--                  &lt;!&ndash;                  <el-checkbox v-model="item.allCkeck" style="float: right;" :indeterminate="item.indeterminate" @change="(checked)=>{handleCheckAll(checked,item)}">全选</el-checkbox>&ndash;&gt;-->
+<!--                </div>-->
+<!--                <el-checkbox-group v-model="checkList">-->
+<!--                  <div v-for="(bed,_index) in item[1]" :key="_index" class="text item">-->
+<!--                    <el-checkbox :label="bed.id"><svg-icon icon-class="bed" style="color: #9aaabf;margin-right: 5px" />{{ bed.name }}床</el-checkbox>-->
+<!--                  </div>-->
+<!--                </el-checkbox-group>-->
+
+<!--              </el-card>-->
+<!--            </el-col>-->
+<!--          </el-row>-->
+          <el-row :gutter="20">
+            <el-col v-for="(item,index) in rooms" :key="index" gut :xs="8" :sm="6" :md="4" :lg="4" :xl="4">
+              <el-card class="box-card">
+                <div slot="header" class="clearfix">
+                  <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>
+                </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>
+                </div>
+              </el-card>
+            </el-col>
+          </el-row>
+        </fieldset>
+        <el-form-item align="center" class="margin-top-sm">
+          <el-button type="success" @click="onSubmit">保存设置</el-button>
+          <el-button @click="back">返回</el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+  </div>
+</template>
+
+<script>
+/**
+     * 编辑病区信息
+     */
+import * as API_hospitalFrame from '@/api/ncs_hospitalFrame'
+import * as API_device from '@/api/ncs_device'
+
+export default {
+  name: 'FrameGroupEdit',
+  data() {
+    return {
+      deviceId: this.$route.params.id,
+      deviceFrames: [],
+      /** 空间结构房间 **/
+      rooms: [],
+      checkList: [],
+      checkDate: []
+    }
+  },
+  mounted() {
+    this.getGroup()
+  },
+  methods: {
+
+    getGroup() {
+      const _this = this
+      API_device.getFrameByDeviceId(this.deviceId).then(res => {
+        _this.deviceFrames = res
+        _this.getFrameByType()
+      })
+    },
+
+    getFrameByType() {
+      // const _this = this
+      API_hospitalFrame.getFrameByType(this.$store.getters.partId, this.deviceId).then(res => {
+        // if (res.length > 0) {
+        //   res.forEach((item, index) => {
+        //     _this.deviceFrames.forEach((t, i) => {
+        //       if (item.id === t.frame_id) {
+        //         console.log('我进来了')
+        //         // item.checked = true
+        //         _this.checkList.push(item.id)
+        //       }
+        //     })
+        //     // _this.rooms.push({ nurse_level: null, id: null, nurse_config: item[1][0].ncfg_id })
+        //   })
+        // }
+        // const groupBy = (arr, func) =>
+        //   arr.map(typeof func === 'function' ? func : val => val[func]).reduce((acc, val, i) => {
+        //     acc[val] = (acc[val] || []).concat(arr[i])
+        //     return acc
+        //   }, {})
+        // // 以参数名称来分组
+        // const groupData = groupBy(res, item => item.parent_id)
+        // _this.rooms = Object.entries(groupData)
+        // _this.rooms.forEach((item, index) => {
+        //   console.log(item, index)
+        //   _this.checkDate.push({ nurse_level: null, id: null, nurse_config: item[1][0].ncfg_id })
+        // })
+        this.rooms = this.filterGroupFrames(res)
+        // console.log('rooms', this.rooms)
+      }).catch(err => {
+        this.$message.error(err)
+      })
+    },
+    /** 递归筛选被选空间节点 */
+    filterGroupFrames(frames) {
+      this.deviceFrames.forEach(t => {
+        frames.forEach(item => {
+          if (t.frame_id === item.id) {
+            item.checked = true
+            return
+          }
+        })
+      })
+      console.log(frames[0])
+      frames.forEach(item => {
+        if (item.children) {
+          this.$set(item, 'children', this.filterGroupFrames(item.children, item.id))
+        }
+        this.countAllFrame(item)
+      })
+      return frames
+    },
+    /** 获取所有frame的长度、被选中的长度 */
+    countAllFrame(frame) {
+      const _list = []
+      if (!Array.isArray(frame)) {
+        _list.push(frame)
+        if (frame.children) _list.push(...this.countAllFrame(frame.children))
+      } else {
+        frame.forEach(item => {
+          _list.push(item)
+          if (item.children) _list.push(...this.countAllFrame(item.children))
+        })
+      }
+      const length = _list.length
+      const length_checked = _list.filter(_item => _item.checked).length
+      this.$set(frame, 'allCkeck', length === _list.filter(_item => _item.checked).length)
+      this.$set(frame, 'indeterminate', (length_checked !== 0) && (length !== length_checked))
+      console.log('list', _list)
+      return _list
+    },
+    /** 选择 */
+    handleCheckboxChanged(item) {
+      this.countAllFrame(item)
+    },
+    handleCheckAll(checked, item) {
+      this.$set(item, 'indeterminate', false)
+      this.setFrameCheck(item, checked)
+    },
+    /** 设置选择状态 */
+    setFrameCheck(item, checked) {
+      const perm = this.MixinClone(item)
+      if (!Array.isArray(perm)) {
+        this.$set(item, 'checked', checked)
+        if (item.children && item.children.length) {
+          this.$set(item, 'children', this.setFrameCheck(item.children, checked))
+        }
+      } else {
+        perm.map(item => {
+          item.checked = checked
+          this.$set(item, 'checked', checked)
+          if (item.children && item.children.length) {
+            this.$set(item, 'children', this.setFrameCheck(item.children, checked))
+          }
+        })
+      }
+      return perm
+    },
+    onSubmit() {
+      const data = []
+      this.rooms.forEach(item => {
+        item.children.forEach(t => {
+          if (t.checked) {
+            data.push(t.id)
+          }
+        })
+      })
+      if (data.length === 0) {
+        this.$message.info('请选择病床!')
+        return
+      }
+      console.log(data)
+      API_hospitalFrame.updateDeviceFrameManage({ deviceId: this.deviceId, frameIds: data }).then(res => {
+        this.$message.success('保存成功!')
+      }).catch(err => {
+        this.$message.error(err.message)
+      })
+    },
+    back() {
+      window.history.back()
+    }
+  }
+
+}
+</script>
+
+<style scoped type="text/scss">
+  /deep/ .el-checkbox__input.is-checked + .el-checkbox__label svg{
+    color: #1890ff !important;
+  }
+  .item {
+    margin-bottom: 10px;
+  }
+  /deep/ .el-card__body {
+      min-height: 130px;
+    }
+  /deep/ .el-card__header{
+      padding:10px 20px;
+    }
+  .margin-top-sm{
+    margin-top: 20px;
+  }
+fieldset{
+  border:1px solid #DCDFE6;
+  border-radius: 5px;
+}
+</style>

+ 14 - 5
src/views/ncs-clerk/clerkList.vue

@@ -88,7 +88,7 @@
           <el-col :span="12">
             <el-form-item label="性别" class="form-item-sex">
               <el-radio v-model="addMemberForm.sex" :label="1">男</el-radio>
-              <el-radio v-model="addMemberForm.sex" :label="2">女</el-radio>
+              <el-radio v-model="addMemberForm.sex" :label="0">女</el-radio>
             </el-form-item>
           </el-col>
           <el-col :span="12">
@@ -185,11 +185,12 @@
   import ButtonCellRender from "@/components/AgGridCellRender/ButtonCellRender"
   import AgGridImg from "@/components/AgGridImg/AgGridImg"
   import ImageViewer from "element-ui/packages/image/src/image-viewer"
+  import RadioFilter from "@/components/AgGridCustomFilter/RadioFilter";
   let prevOverflow = ''
 
   export default {
     name: 'careDoctorManager',
-    components: { ButtonCellRender, AgGridImg, ImageViewer },
+    components: { ButtonCellRender, AgGridImg, ImageViewer, RadioFilter },
     data: function() {
       return {
         uploadurl: serverUrl + '/ncs/upload/uploadFile',
@@ -262,7 +263,11 @@
         columnApi: null,
         localeText: AG_GRID_LOCALE_CN,
         rowSelection: null,
-        showViewer: false
+        showViewer: false,
+        sexTransfer: [
+          { key: '男', value: 1 },
+          { key: '女', value: 0 }
+        ]
       }
     },
     computed: {
@@ -295,7 +300,11 @@
         },
         { headerName: '登陆名', field: 'uname', sortable: true, filter: true, minWidth: 170 },
         { headerName: '真实名字', field: 'clerk_name', sortable: true, filter: true, minWidth: 120 },
-        { headerName: '性别', field: 'sex', sortable: true, filter: false, valueFormatter: this.formatterSex, width: 100 },
+        { headerName: '性别', field: 'sex', sortable: true, valueFormatter: this.formatterSex, width: 100, filterFramework: 'RadioFilter',
+          filterParams: {
+            listData: this.sexTransfer
+          }
+        },
         { headerName: '手机', field: 'mobile', sortable: true, filter: true, minWidth: 170 },
         { headerName: '角色', field: 'role_name', sortable: true, filter: false, valueFormatter: this.formatterRole, width: 120 },
         { headerName: '操作', field: 'id',
@@ -427,7 +436,7 @@
 
       /** 性别格式化 */
       formatterSex(row) {
-        return row.data.sex === 1 ? '男' :  row.data.sex === 2 ? '女' : '未知'
+        return row.data.sex === 1 ? '男' :  row.data.sex === 0 ? '女' : '未知'
       },
 
       formatterRole(row) {

+ 1 - 1
src/views/ncs-device/device-admin.vue

@@ -587,7 +587,7 @@ export default {
     formatterSex(row, column, cellValue) {
       if (row.staff_sex === 1) {
         return '男'
-      } else if (row.staff_sex === 2) {
+      } else if (row.staff_sex === 0) {
         return '女'
       } else {
         return '未知'

+ 68 - 24
src/views/ncs-device/nurse_watch.vue

@@ -100,9 +100,12 @@ import { unixToDate } from '@/utils/Foundation'
 import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
 import { DeviceUrl } from '@/utils/domain'
 import * as clerk_API from '@/api/ncs_clerk'
+import ButtonCellRender from "@/components/AgGridCellRender/ButtonCellRender"
+import RadioFilter from "@/components/AgGridCustomFilter/RadioFilter";
 
 export default {
   name: 'Index',
+  components: { ButtonCellRender, RadioFilter },
   data: function() {
     return {
       /** 表格数据 */
@@ -137,7 +140,12 @@ export default {
       columnApi: null,
       localeText: AG_GRID_LOCALE_CN,
       rowSelection: null,
-      showViewer: false
+      showViewer: false,
+      timer: '',
+      deviceStatusTransfer: [
+        { key: '启用', value: 1, color: 'green' },
+        { key: '未启用', value: 0, color: 'red' }
+      ]
     }
   },
   computed: {
@@ -159,23 +167,49 @@ export default {
         resizable: false,
         valueGetter: this.hashValueGetter
       },
-      { headerName: '设备别名', field: 'name', sortable: true, minWidth: 150 },
-      { headerName: '设备状态', field: 'status', sortable: true, cellRenderer: this.formatterSatus, minWidth: 100 },
-      { headerName: '绑定人', field: 'member_name', sortable: true, minWidth: 140 },
-      { headerName: '所属位置', field: 'full_name', sortable: true, minWidth: 140 },
-      { headerName: '有线物理地址', field: 'eth_mac', sortable: true, minWidth: 150 },
-      { headerName: '有线IP地址', field: 'eth_ip', sortable: true, minWidth: 150 },
-      { headerName: '设备型号', field: 'model', sortable: true, minWidth: 150 },
-      { headerName: '出厂编号', field: 'code', sortable: true, minWidth: 150 },
-      { headerName: '软件版本', field: 'soft_ver', sortable: true, minWidth: 150 },
-      { headerName: '硬件版本', field: 'hard_ver', sortable: true, minWidth: 150 },
-      { headerName: 'WIFI物理地址', field: 'wifi_mac', sortable: true, minWidth: 150 },
-      { headerName: 'WIFIIP地址', field: 'wifi_ip', sortable: true, minWidth: 150 },
-      { headerName: 'SIP账号', field: 'sip_id', sortable: true, minWidth: 150 },
-      { headerName: '最后修改时间', field: 'update_time', sortable: true, valueFormatter: this.formatterDate, minWidth: 170 }
+      { 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: 'member_name', sortable: true, filter: 'agTextColumnFilter', minWidth: 140 },
+      { 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: '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,
+        filterParams: {
+          comparator: (filterLocalDateAtMidnight, cellValue) => { // 所有数据都由服务器端过滤,此处只需返回0 即可
+            return 0
+          }
+        }
+      },
+      {
+        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 = {
-      filter: false,
       sortable: true,
       resizable: true,
       comparator: this.testComparator,
@@ -193,6 +227,12 @@ export default {
     this.getList()
     this.initWebSocket()
   },
+  beforeDestroy() {
+    clearTimeout(this.timer)
+  },
+  destroyed() {
+    clearTimeout(this.timer)
+  },
   methods: {
     initWebSocket: function() {
       const stockbase = DeviceUrl.replace('http', 'ws')
@@ -220,12 +260,13 @@ export default {
     websocketclose: function(e) {
       const _this = this
       console.log('socket连接关闭connection closed (' + e.code + ')')
-      this.$alert('连接已断开,需重新连接', '连接确定', {
-        confirmButtonText: '确定',
-        callback: action => {
-          _this.initWebSocket()
-        }
-      })
+      _this.timer = setTimeout(_this.initWebSocket, 30000)
+      // this.$alert('连接已断开,需重新连接', '连接确定', {
+      //   confirmButtonText: '确定',
+      //   callback: action => {
+      //     _this.initWebSocket()
+      //   }
+      // })
     },
     /** 选择行变化时,记录选中的行数据 */
     selectFun(val) {
@@ -302,7 +343,7 @@ export default {
     filterModifed(param) {
       const model = param.api.getFilterModel()
       this.params.filter = JSON.stringify(model)
-      this.GET_List()
+      this.getList()
     },
     gridSortChange(param) {
       const columnState = param.columnApi.getColumnState()
@@ -334,7 +375,7 @@ export default {
         delete this.params.sort
         delete this.params.dir
       }
-      this.GET_List()
+      this.getList()
     },
     formatterSatus(param) {
       if (param.value === 1) {
@@ -360,6 +401,9 @@ export default {
           })
         }
       })
+    },
+    handEdit(row) {
+      this.$router.push({ name: 'nurseWatchFrame', params: { id: row.id, callback: this.getList() }})
     }
   }
 }

+ 14 - 6
src/views/ncs-event/index.vue

@@ -216,10 +216,15 @@
                 },
                 { headerName: '名称', field: 'name', sortable: true, minWidth: 150 },
                 { headerName: '描述', field: 'desc', sortable: true, minWidth: 220 },
-                { headerName: '唯一标识码', field: 'key_code', sortable: true, width: 160 },
-                { headerName: 'x轴范围', field: 'min_x', sortable: true, filter: false, valueFormatter: this.formatterX, minWidth: 150 },
-                { headerName: 'y轴范围', field: 'min_y', sortable: true, filter: false, valueFormatter: this.formatterY, width: 150 },
-                { headerName: '创建时间', field: 'create_time', sortable: true, filter: false, valueFormatter: this.formatterDate, width: 170 },
+                { headerName: '唯一标识码', field: 'key_code', sortable: true, minWidth: 160 },
+                { headerName: 'x轴范围', field: 'min_x', sortable: true, filter: false, valueFormatter: this.formatterX, minWidth: 100 },
+                { headerName: 'y轴范围', field: 'min_y', sortable: true, filter: false, valueFormatter: this.formatterY, minWidth: 100 },
+                { headerName: '创建时间', field: 'create_time', sortable: true,  valueFormatter: this.formatterDate, minWidth: 170, filter: 'agDateColumnFilter',
+                    filterParams: {
+                        comparator: (filterLocalDateAtMidnight, cellValue) => { // 所有数据都由服务器端过滤,此处只需返回0 即可
+                            return 0
+                        }
+                    } },
                 { headerName: '编辑', field: 'id',
                     cellRendererFramework: 'ButtonCellRender',
                     cellRendererParams: param => {
@@ -270,6 +275,7 @@
                 this.rowSelection = 'multiple'
         },
         mounted() {
+            this.gridApi = this.gridOptions.api
             this.getList()
         },
         methods: {
@@ -337,6 +343,8 @@
             /** 加载通知列表 */
             getList() {
                 this.loading = true
+                this.gridApi.showLoadingOverlay()
+                this.gridApi.sizeColumnsToFit()
                 API_event.getList(this.params).then(response => {
                     this.loading = false
                     this.tableData = response.data
@@ -496,7 +504,7 @@
             filterModifed(param) {
                 let model = param.api.getFilterModel()
                 this.params.filter = JSON.stringify(model)
-                this.GET_List()
+                this.getList()
             },
             gridSortChange(param) {
                 const columnState = param.columnApi.getColumnState()
@@ -528,7 +536,7 @@
                     delete this.params.sort
                     delete this.params.dir
                 }
-                this.GET_List()
+                this.getList()
             }
         }
     }

+ 80 - 15
src/views/ncs-nurse-config/index.vue

@@ -1,16 +1,17 @@
 <template>
   <div  class="app-container">
     <el-row>
-      <el-col :span="8">
-        <el-row>
-          <el-col :span="24" class="toolbar">
-            <el-form :inline="true">
-              <el-form-item>
-                <el-button type="primary" @click="addNurseConfig(1,null,1)">添加护理</el-button>
-              </el-form-item>
-            </el-form>
-          </el-col>
-        </el-row>
+      <el-col :span="24" class="toolbar">
+        <el-form :inline="true">
+          <el-form-item>
+            <el-button type="primary" @click="addNurseConfig(1,null,1)">添加护理</el-button>
+          </el-form-item>
+        </el-form>
+      </el-col>
+    </el-row>
+    <el-container :style="{height: tableHeight+'px'}">
+
+      <el-aside width="360px" style="background-color: rgb(238, 241, 246)">
         <el-table :data="tagList1" highlight-current-row v-loading="listLoading" stripe
                   @cell-click="tableClick" class="mytable">
           <el-table-column v-if="false" prop="id"></el-table-column>
@@ -28,12 +29,12 @@
             </template>
           </el-table-column>
         </el-table>
-      </el-col>
-
-      <el-col :span="15">
+      </el-aside>
+      <el-main>
         <el-row>
           <el-col>当前选择:<h4>{{pName}}</h4></el-col>
         </el-row>
+<!--        <el-header style="text-align: right; font-size: 12px;height: 30px">当前选择:<h4>{{pName}}</h4></el-header>-->
         <el-table :data="tagList2" highlight-current-row v-loading="listLoading" stripe class="mytable">
           <el-table-column v-if="false" prop="id"></el-table-column>
           <el-table-column prop="option_name" label="护理项名"></el-table-column>
@@ -49,8 +50,60 @@
             </template>
           </el-table-column>
         </el-table>
-      </el-col>
-    </el-row>
+      </el-main>
+    </el-container>
+
+<!--    <el-row>-->
+<!--      <el-col :span="8">-->
+<!--        <el-row>-->
+<!--          <el-col :span="24" class="toolbar">-->
+<!--            <el-form :inline="true">-->
+<!--              <el-form-item>-->
+<!--                <el-button type="primary" @click="addNurseConfig(1,null,1)">添加护理</el-button>-->
+<!--              </el-form-item>-->
+<!--            </el-form>-->
+<!--          </el-col>-->
+<!--        </el-row>-->
+<!--        <el-table :data="tagList1" highlight-current-row v-loading="listLoading" stripe-->
+<!--                  @cell-click="tableClick" class="mytable">-->
+<!--          <el-table-column v-if="false" prop="id"></el-table-column>-->
+<!--          <el-table-column prop="config_name" label="护理名"></el-table-column>-->
+<!--          <el-table-column-->
+<!--                  label=""-->
+<!--                  width="180">-->
+<!--            <template slot-scope="scope">-->
+<!--              <el-button type="success" icon="el-icon-circle-plus-outline" circle-->
+<!--                         @click.native.prevent="addNurseConfig(scope.$index, scope.row,2)"></el-button>-->
+<!--              <el-button type="primary" icon="el-icon-edit" circle-->
+<!--                         @click.native.prevent="updateRow(scope.$index, scope.row, 1)"></el-button>-->
+<!--              <el-button type="danger" icon="el-icon-delete" circle-->
+<!--                         @click.native.prevent="deleteRow(scope.$index, scope.row,1)"></el-button>-->
+<!--            </template>-->
+<!--          </el-table-column>-->
+<!--        </el-table>-->
+<!--      </el-col>-->
+
+<!--      <el-col :span="15">-->
+<!--        <el-row>-->
+<!--          <el-col>当前选择:<h4>{{pName}}</h4></el-col>-->
+<!--        </el-row>-->
+<!--        <el-table :data="tagList2" highlight-current-row v-loading="listLoading" stripe class="mytable">-->
+<!--          <el-table-column v-if="false" prop="id"></el-table-column>-->
+<!--          <el-table-column prop="option_name" label="护理项名"></el-table-column>-->
+<!--          <el-table-column prop="nursecfg_color" label="颜色标识" width="160" align="center">-->
+<!--            <template slot-scope="scope">-->
+<!--              <el-button :style="'width: 120px;height: 30px;background-color: #'+scope.row.color_rgb" />-->
+<!--            </template>-->
+<!--          </el-table-column>-->
+<!--          <el-table-column label="" width="140">-->
+<!--            <template slot-scope="scope">-->
+<!--              <el-button type="primary" icon="el-icon-edit" circle @click.native.prevent="updateRow(scope.$index, scope.row, 2)"></el-button>-->
+<!--              <el-button type="danger" icon="el-icon-delete" circle @click.native.prevent="deleteRow(scope.$index, scope.row,2)"></el-button>-->
+<!--            </template>-->
+<!--          </el-table-column>-->
+<!--        </el-table>-->
+<!--      </el-col>-->
+<!--    </el-row>-->
     <!--新增护理界面-->
     <el-dialog :title="myTitle" v-model="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false">
       <el-form :model="addForm" label-width="140px" :rules="addFormRules" ref="addForm">
@@ -127,6 +180,11 @@
         pName: null
       }
     },
+    computed: {
+      tableHeight() {
+        return this.mainAreaHeight - 40
+      }
+    },
     methods: {
       gettagList1() {
         this.params.fixedCondition = ' part_id=' + this.partId,
@@ -287,6 +345,13 @@
 </script>
 
 <style scoped>
+  .permission-container {
+    padding: 10px;
+    background-color: #fff;
+  }
+  .el-aside{
+    padding: 8px 10px;
+  }
   .mytable {
     width: 100%;
     padding: 20px;

+ 7 - 6
src/views/ncs-task/index.vue

@@ -157,7 +157,7 @@
         },
         computed: {
             tableHeight() {
-                return this.mainAreaHeight - 130
+                return this.mainAreaHeight - 220
             }
         },
         beforeMount() {
@@ -180,17 +180,17 @@
                         content: 'task_content'
                     },
                 },
-                { headerName: '计划任务时间', field: 'task_plan_time', valueFormatter: this.formatterDate, sortable: true, filter: false, width: 170 },
-                { headerName: '实际任务时间', field: 'task_do_time', valueFormatter: this.formatterDate, sortable: true, filter: false, width: 170 },
-                { headerName: '任务状态', field: 'task_success', filter: false, cellRenderer: this.formatterStasus, width: 100 },
+                { headerName: '计划任务时间', field: 'task_plan_time', valueFormatter: this.formatterDate, sortable: true, filter: false, minWidth: 170 },
+                { headerName: '实际任务时间', field: 'task_do_time', valueFormatter: this.formatterDate, sortable: true, filter: false, minWidth: 170 },
+                { headerName: '任务状态', field: 'task_success', filter: false, cellRenderer: this.formatterStasus, minWidth: 100 },
                 // { headerName: '任务结果', field: 'task_result', sortable: true, filter: false, width: 220,
                 //     cellRendererFramework: 'Tooltip',
                 //     cellRendererParams: {
                 //         content: 'task_result'
                 //     },
                 // },
-                { headerName: '任务操作人', field: 'task_do_name', sortable: true, filter: true, width: 120 },
-                { headerName: '创建人', field: 'create_name', valueFormatter: this.formatterName, sortable: true, filter: true, width: 120},
+                { headerName: '任务操作人', field: 'task_do_name', sortable: true, filter: true, minWidth: 120 },
+                { headerName: '创建人', field: 'create_name', valueFormatter: this.formatterName, sortable: true, filter: true, minWidth: 120},
                 { headerName: '操作任务', field: 'id',
                     cellRendererFramework: 'ButtonCellRender',
                     cellRendererParams: param => {
@@ -340,6 +340,7 @@
             getList() {
                 this.loading = true
                 this.gridApi.showLoadingOverlay()
+                this.gridApi.sizeColumnsToFit()
                 API_task.getList(this.params).then(response => {
                     this.loading = false
                     this.tableData = response.data