Explorar o código

医院级空间结构开发

WenNingning %!s(int64=4) %!d(string=hai) anos
pai
achega
3f9173c259

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 0
src/icons/svg/bad_people.svg


A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 0
src/icons/svg/empty_bed.svg


+ 1 - 1
src/views/dashboard/calling/components/PanelGroup.vue

@@ -104,7 +104,7 @@ export default {
 <style lang="scss" title="style1" scoped>
 <style lang="scss" title="style1" scoped>
   :root{
   :root{
     --icon-special-care: #f3556f;
     --icon-special-care: #f3556f;
-    --icon-primary-care:#34bfa3;
+    --icon-primary-care: #469787;
   }
   }
 .panel-group {
 .panel-group {
   margin-top: 0px;
   margin-top: 0px;

+ 0 - 610
src/views/hospital/ncs_customer/customerEdit.vue

@@ -1,610 +0,0 @@
-<template>
-  <div class="formwrap">
-    <el-tabs v-model="activeName" @tab-click="handleClick">
-      <el-tab-pane label="用户管理" name="customerEdit">
-        <el-form ref="editForm" :model="formmodel" :rules="rules" label-width="140px">
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="用户姓名" prop="named">
-                <el-input v-model="formmodel.named" clearable placeholder="请输入姓名" :maxlength="20" />
-              </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-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="年龄" prop="age">
-                <el-input v-model="formmodel.age" clearable :maxlength="4" placeholder="请输入年龄">
-                  <el-select slot="append" v-model="formmodel.age_unit" placeholder="请选择年龄单位">
-                    <el-option label="岁" value="岁" />
-                    <el-option label="月" value="月" />
-                    <el-option label="天" value="天" />
-                  </el-select>
-                </el-input>
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row>
-            <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="0">女</el-radio>
-                <el-radio v-model="formmodel.sex" :label="3">未知</el-radio>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="在院状态">
-                <el-radio v-model="formmodel.status" :label="0">在院</el-radio>
-                <el-radio v-model="formmodel.status" :label="1">已出院</el-radio>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="证件类型">
-                <el-radio v-model="formmodel.id_type" label="身份证">身份证</el-radio>
-                <el-radio v-model="formmodel.id_type" label="护照">护照</el-radio>
-                <el-radio v-model="formmodel.id_type" label="军人证">军人证</el-radio>
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="证件号">
-                <el-input v-model="formmodel.id_no" clearable placeholder="请输入证件号" :maxlength="20" />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="入院日期" prop="in_date">
-                <el-date-picker
-                  v-model="formmodel.in_date"
-                  type="date"
-                  :editable="false"
-                  value-format="timestamp"
-                  placeholder="选择入院日期"
-                  :picker-options="{disabledDate(time) { return time.getTime() > Date.now() }}"
-                />
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="出院日期" prop="out_date">
-                <el-date-picker
-                  v-model="formmodel.out_date"
-                  type="date"
-                  :editable="false"
-                  value-format="timestamp"
-                  placeholder="选择出院日期"
-                  :picker-options="{disabledDate(time) { return time.getTime() < Date.now() }}"
-                />
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row>
-            <el-col :span="8">
-              <el-form-item label="责任医生">
-                <el-select v-model="formmodel.doctor_id" placeholder="请选择医生" @change="doctorChange(1)">
-                  <el-option v-for="(item,index) in doctors" :key="index" :label="item.clerk_name" :value="item.clerk_id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="责任护士">
-                <el-select v-model="formmodel.nurse_id" placeholder="请选择护士" @change="doctorChange(2)">
-                  <el-option v-for="(item,index) in nurses" :key="index" :label="item.clerk_name" :value="item.clerk_id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-            <el-col :span="8">
-              <el-form-item label="责任护工">
-                <el-select v-model="formmodel.worker_id" placeholder="请选择护工" @change="doctorChange(3)">
-                  <el-option v-for="(item,index) in workrs" :key="index" :label="item.clerk_name" :value="item.clerk_id" />
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row v-if="nurseData.length > 0">
-            <el-col v-for="(item, index) in nurseList" :key="index" :span="24 / nurseList.length">
-              <el-form-item :label="item[0]">
-                <el-select v-model="nurseData[index].nurse_level" :placeholder="'请选择'+item[0]" @change="changeNurseData(index)">
-                  <el-option v-for="(t,i) in item[1]" :key="i" :label="t.option_name" :value="t.id">
-                    <span style="float: left">{{ t.option_name }}</span>
-                    <span :style="'float: right; background-color: #'+t.color_rgb+';color: #'+t.color_rgb">颜色</span>
-                  </el-option>
-                </el-select>
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-row>
-            <el-col :span="16">
-              <el-form-item label="病况描述">
-                <el-input
-                  v-model="formmodel.illness_desc"
-                  type="textarea"
-                  :autosize="{ minRows: 2, maxRows: 4}"
-                  :minlength="2"
-                  :maxlength="50"
-                  :placeholder="'请输入文本内容,长度2~50'"
-                />
-              </el-form-item>
-            </el-col>
-          </el-row>
-
-          <el-form-item style="margin-top:15px;">
-            <el-button type="primary" :disabled="isDisabled" class="save" @click="handlerSubmit('editForm')">保存修改</el-button>
-          </el-form-item>
-        </el-form>
-
-        <el-card v-if="this.customerId != 0" style="maring:15px">
-          <div>
-            <div style="float: left"><h4>用户备注</h4></div>
-            <div style="float: right">
-              <el-button type="success" @click="dialogAddVisible = true">添加备注</el-button>
-            </div>
-          </div>
-          <div style="clear:both">
-            <div>
-              <el-card v-for="(item, index) in tableData" :key="index">
-                <div>
-                  <span style="margin-left: 20px;font-weight:bold">备注内容:</span><span style="line-height:1.5">{{ item.content }}</span>
-                </div>
-                <div style="margin: 10px">
-                  <div style="float: left">
-                    <span v-if="item.file_name">
-                      <el-link :href="item.file_path" icon="el-icon-folder" type="success" target="_blank" :download="item.file_name">{{ item.file_name }}</el-link>
-                    </span>
-                  </div>
-                  <div style="float: right">
-                    <p>
-                      <span style="font-weight:bold">创建时间:</span>{{ forDate(item.create_time) }}
-                      <span style="font-weight:bold;margin-left: 10px;">创建人:</span>{{ item.create_name }}
-                    </p>
-                  </div>
-                </div>
-              </el-card>
-              <!--翻页-->
-              <el-pagination
-                v-if="pageData"
-                slot="pagination"
-                :current-page="pageData.page_no"
-                :page-sizes="[10, 30, 50, 100]"
-                :page-size="pageData.page_size"
-                layout="total, sizes, prev, pager, next, jumper"
-                :total="pageData.data_total"
-                @size-change="handlePageSizeChange"
-                @current-change="handlePageCurrentChange"
-              />
-            </div>
-          </div>
-        </el-card>
-        <el-dialog title="添加用户备注" :visible.sync="dialogAddVisible" :append-to-body="true" width="80%">
-          <el-form ref="editForm" :model="formmodel" :rules="rules" label-width="140px">
-            <el-form-item label="内容" prop="content">
-              <el-input
-                v-model="content"
-                type="textarea"
-                :autosize="{ minRows: 2, maxRows: 6}"
-                :minlength="2"
-                :maxlength="300"
-                show-word-limit
-                :placeholder="'请输入文本内容,长度300'"
-              />
-            </el-form-item>
-            <el-form-item label="附件">
-              <el-upload
-                v-if="!filePath"
-                class="avatar-uploader"
-                :action="`${uploadServer}?scene=avatar`"
-                :show-file-list="false"
-                :on-success="uploaded"
-                :before-upload="handleShopLogoBefore"
-              >
-                <i class="el-icon-plus avatar-uploader-icon" />
-              </el-upload>
-              <span v-if="filePath">{{ fileName }}</span>
-            </el-form-item>
-            <el-form-item>
-              <el-button type="primary" @click="addRemark">立即添加</el-button>
-              <el-button @click="quxiao">取消</el-button>
-            </el-form-item>
-          </el-form>
-        </el-dialog>
-      </el-tab-pane>
-      <el-tab-pane v-if="customerId != 0" label="用户亲属" name="customer-relative">
-        <customer-relative :member-id="memberId" />
-      </el-tab-pane>
-    </el-tabs>
-
-  </div>
-
-</template>
-
-<script>
-import * as customer_API from '@/api/ncs_customer'
-import * as clerk_API from '@/api/ncs_clerk'
-import * as NurseConfig_API from '@/api/ncs_nurse_config'
-import * as remark_API from '@/api/ncs_remark'
-import * as RegExp from '@/utils/RegExp'
-import { unixToDate } from '@/utils/Foundation'
-import { serverUrl } from '@/utils/domain'
-import customerRelative from '@/views/customer/customer_relative'
-
-export default {
-  name: 'PatientInfoEdit',
-  components: { customerRelative },
-  props: {
-    customerId: {
-      type: Number,
-      default: 0
-    },
-    frameId: {
-      type: Number,
-      default: 0
-    }
-  },
-  data: function() {
-    return {
-      formmodel: {
-        sex: 1,
-        status: 0,
-        age_unit: '岁',
-        id_type: '身份证',
-        part_id: this.$store.getters.partId
-      },
-      nurseList: [],
-      nurseData: [],
-      nurseConfigDtos: [],
-      rules: {
-        named: [
-          this.MixinRequired('请输入真实姓名!'),
-          { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' },
-          {
-            validator: (rule, value, callback) => {
-              if (!RegExp.userName.test(value)) {
-                callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
-              } else {
-                callback()
-              }
-            }
-          }
-        ],
-        age: [{ required: true, message: '请输入年龄', trigger: 'blur' }],
-        content: [{ required: true, message: '请输入备注内容', trigger: 'blur' }],
-        in_date: [{ required: true, message: '请选择入院日期', trigger: 'blur' }]
-      },
-      isDisabled: false,
-      doctors: [],
-      nurses: [],
-      workrs: [],
-      doctor_mapping_id: false,
-      nurse_Mapping_id: false,
-      worker_mapping_id: false,
-      params: {
-        page_size: 10,
-        page_no: 1,
-        sort: 'create_time',
-        dir: 'desc'
-      },
-      tableData: [],
-      pageData: [],
-      dialogAddVisible: false,
-      fileName: null,
-      filePath: null,
-      uploadServer: serverUrl + '/ncs/upload/uploadFile',
-      userInfo: this.$store.getters.userInfo,
-      content: null,
-      activeName: 'customerEdit',
-      memberId: null
-    }
-  },
-  watch: {
-    frameId: function(val, oldVal) {
-      this.getNurseConfigs()
-      this.hasCustomerId()
-    }
-  },
-  mounted() {
-    this.getEmployees()
-    if (this.nurseList.length === 0) {
-      this.getNurseConfigs()
-      this.hasCustomerId()
-    }
-  },
-
-  methods: {
-    getEmployees() {
-      const _this = this
-      clerk_API.listByPartRoleId({ partId: this.$store.getters.partId }).then(res => {
-        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.role_name)
-        if (Object.entries(groupData).length > 0) {
-          Object.entries(groupData).forEach(item => {
-            if (item[0] === '医生') {
-              _this.doctors = item[1]
-            } else if (item[0] === '护士') {
-              _this.nurses = item[1]
-            } else if (item[0] === '护工') {
-              _this.workrs = item[1]
-            }
-          })
-        }
-      })
-    },
-    getNurseConfigs() {
-      this.nurseData = []
-      const _this = this
-      NurseConfig_API.listByPartId({ partId: this.$store.getters.partId }).then(res => {
-        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.config_name)
-        _this.nurseList = Object.entries(groupData)
-        if (_this.nurseList.length > 0) {
-          _this.nurseList.forEach((item, index) => {
-            _this.nurseData.push({ nurse_level: null, id: null, nurse_config: item[1][0].ncfg_id })
-          })
-        }
-      })
-    },
-    hasCustomerId() {
-      this.clearForm()
-      if (this.customerId !== 0) {
-        const _this = this
-        customer_API.getCustomerInfo(this.customerId).then(res => {
-          _this.formmodel = res
-          _this.doctor_mapping_id = res.doctor_mapping_id
-          _this.nurse_Mapping_id = res.nurse_Mapping_id
-          _this.worker_mapping_id = res.worker_mapping_id
-          _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) => {
-              res.list.forEach((t, i) => { // 为护理项赋值
-                if (item.nurse_config === t.nurse_config) {
-                  item.nurse_level = t.nurse_level
-                  item.id = t.id
-                }
-              })
-            })
-          }
-        })
-      }
-    },
-    doctorChange(type) {
-      if (this.customerId !== 0) {
-        if (type === 1) {
-          if (this.doctor_mapping_id === null) {
-            this.formmodel.doctor_mapping_id = 0 // 为0则新增,// 其他值为修改
-          } else {
-            this.formmodel.doctor_mapping_id = this.doctor_mapping_id
-          }
-        } else if (type === 2) {
-          if (this.nurse_Mapping_id === null) {
-            this.formmodel.nurse_Mapping_id = 0 // 为0则新增,// 其他值为修改
-          } else {
-            this.formmodel.nurse_Mapping_id = this.nurse_Mapping_id
-          }
-        } else {
-          if (this.worker_mapping_id === null) {
-            this.formmodel.worker_mapping_id = 0 // 为0则新增,// 其他值为修改
-          } else {
-            this.formmodel.worker_mapping_id = this.worker_mapping_id
-          }
-        }
-      }
-    },
-    /** 保存按钮处理事件 */
-    handlerSubmit(formName) {
-      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
-            customer_API.addAll(this.formmodel).then(res => {
-              this.$message.success('添加成功!')
-              this.clearForm()
-              this.$emit('saved')
-            }).catch(e => {
-              this.isDisabled = false
-            })
-          } else {
-            this.formmodel.list = this.nurseConfigDtos
-            customer_API.updateAll(this.formmodel).then(res => {
-              this.$message.success('修改成功!')
-              this.isDisabled = false
-              this.$emit('saved')
-            })
-          }
-        } else {
-          this.$message.error('表单填写有误,请检查!')
-          return false
-        }
-      })
-    },
-    clearForm() {
-      this.activeName = 'customerEdit'
-      this.formmodel = {
-        sex: 1,
-        status: 0,
-        age_unit: '岁',
-        id_type: '身份证',
-        part_id: this.$store.getters.partId,
-        named: null,
-        card_no: null,
-        id_no: null,
-        in_date: new Date(new Date().toLocaleDateString()).getTime(),
-        out_date: null,
-        doctor_id: null,
-        nurse_id: null,
-        worker_id: null,
-        illness_desc: null
-      }
-      this.isDisabled = false
-      this.nurseConfigDtos = []
-    },
-    // 选择了护理项
-    changeNurseData(index) {
-      const i = this.nurseConfigDtos.findIndex(item => {
-        return item.nurse_level === this.nurseData[index].nurse_level
-      })
-      if (i !== -1) {
-        this.nurseConfigDtos.splice(i, 1)
-      }
-      this.nurseConfigDtos.push(this.nurseData[index])
-    },
-    getRemarks() {
-      const _this = this
-      this.params.fixedCondition = ' part_id=' + this.$store.getters.partId + ' and type=1 and member_id = ' + this.formmodel.member_id
-      remark_API.getRemarks(this.params).then(res => {
-        _this.tableData = res.data
-        _this.pageData = {
-          page_no: res.page_no,
-          page_size: res.page_size,
-          data_total: res.data_total
-        }
-      })
-    },
-    /** 分页大小发生改变 */
-    handlePageSizeChange(size) {
-      this.params.page_size = size
-      this.getRemarks()
-    },
-    /** 分页页数发生改变 */
-    handlePageCurrentChange(page) {
-      this.params.page_no = page
-      this.getRemarks()
-    },
-    forDate(date) {
-      return unixToDate(date)
-    },
-    /** 上传成功后的钩子 更换图片 置空存储数组*/
-    uploaded(res) {
-      this.filePath = serverUrl + '/' + res
-    },
-    /** 图片上传之前的校验 */
-    handleShopLogoBefore(file) {
-      const _this = this
-      return new Promise((resolve, reject) => {
-        let hz = file.name
-        _this.fileName = hz
-        const index = hz.lastIndexOf('.')
-        hz = hz.substring(index + 1, hz.length)
-        const isImg = hz === 'jpeg' || hz === 'png' || hz === 'jpg' || hz === 'txt' || hz === 'doc' || hz === 'docx' || hz === 'xls' || hz === 'xlsx'
-        const isLt5M = file.size / 1024 / 1024 < 5
-        if (!isImg) {
-          _this.$message.error('上传附件只能是txt,doc,docx,xls,xlsx,jpg,png,jpeg格式!')
-          reject()
-        }
-        if (!isLt5M) {
-          _this.$message.error('上传附件大小不能超过 5MB!')
-          reject()
-        }
-        resolve()
-      })
-    },
-    addRemark() {
-      if (!this.content) {
-        this.$message.info('请输入内容!')
-        return
-      }
-      if (!this.filePath) {
-        this.fileName = null
-      }
-      const data = {
-        partId: this.$store.getters.partId,
-        type: 1,
-        memberId: this.formmodel.member_id,
-        createName: this.userInfo.username,
-        content: this.content,
-        filePath: this.filePath,
-        fileName: this.fileName
-      }
-      const _this = this
-      remark_API.save(data).then(res => {
-        _this.$message.success('添加成功!')
-        _this.getRemarks()
-        _this.quxiao()
-      })
-    },
-    quxiao() {
-      this.dialogAddVisible = false
-      this.content = null
-      this.fileName = null
-      this.filePath = null
-    },
-    handleClick(tab) {
-      this.memberId = this.formmodel.member_id
-    }
-  }
-}
-</script>
-
-<style type="text/scss" scoped>
-  .el-input .el-select {
-    width: 68px;
-  }
-  .el-select {
-    width: 100%;
-  }
-  .formwrap {
-    border: 1px solid #ebebeb;
-    border-radius: 3px;
-    background: #fff;
-    padding: 24px;
-    min-height: 500px;
-  }
-  /deep/ .avatar-uploader .el-upload {
-    border: 1px dashed #d9d9d9;
-    border-radius: 6px;
-    cursor: pointer;
-    position: relative;
-    overflow: hidden;
-  }
-
-  /deep/ .avatar-uploader .el-upload:hover {
-    border-color: #409EFF;
-  }
-
-  /deep/ .avatar-uploader-icon {
-    font-size: 28px;
-    color: #8c939d;
-    width: 100px;
-    height: 100px;
-    line-height: 100px;
-    text-align: center;
-  }
-
-  /deep/ .avatar {
-    width: 100px;
-    height: 100px;
-    display: block;
-  }
-
-</style>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1214 - 0
src/views/hospital/ncs_customer/customerManager.vue


+ 0 - 495
src/views/hospital/ncs_customer/list.vue

@@ -1,495 +0,0 @@
-<template>
-  <div>
-    <!--工具栏-->
-    <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-button slot="append" icon="el-icon-search" @click="clickSearch" />
-          </el-input>
-        </el-form-item>
-        <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" @click="batchDelete">批量删除</el-button>
-        </el-form-item>
-      </el-form>
-    </div>
-    <ag-grid-layout
-      :toolbar="false"
-      :table-height="tableHeight"
-      theme="ag-theme-alpine"
-      :column-defs="columnDefs"
-      :row-data="tableData"
-      :locale-text="localeText"
-      :grid-options="gridOptions"
-      :default-col-def="defaultColDef"
-      :animate-rows="true"
-      :row-selection="rowSelection"
-      @filterChanged="filterModifed"
-      @sortChanged="gridSortChange"
-    >
-      <el-pagination
-        v-if="pageData"
-        slot="pagination"
-        :current-page="pageData.page_no"
-        :page-sizes="[20, 50, 100, 200]"
-        :page-size="pageData.page_size"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="pageData.data_total"
-        @size-change="handlePageSizeChange"
-        @current-change="handlePageCurrentChange"
-      />
-    </ag-grid-layout>
-    <el-dialog title="编辑用户信息" :visible.sync="dialogAddVisible" :append-to-body="true" width="85%">
-      <customer-edit :customer-id="customerId" :frame-id="frameId" @saved="handlePatientFinished" />
-    </el-dialog>
-
-    <el-dialog title="换床" :visible.sync="formshow" :append-to-body="true" width="80%">
-      <el-form ref="editForm" label-width="140px">
-        <el-form-item label="当前病床:"><svg-icon icon-class="bed" style="color: #9aaabf;margin-top: 5px" />{{ full_name }}</el-form-item>
-        <el-form-item label="可换病床:">
-          <el-radio-group v-model="changeFrameId">
-            <el-radio v-for="(item, index) in frameList" :key="index" :label="item.id">
-              <svg-icon icon-class="bed" style="color: #9aaabf;margin-top: 5px" />{{ item.full_name }}
-            </el-radio>
-          </el-radio-group>
-        </el-form-item>
-
-        <el-form-item>
-          <el-button type="primary" @click="updateFrameId">确定换床</el-button>
-        </el-form-item>
-      </el-form>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import * as API_customer from '@/api/ncs_customer'
-import { unixToDate } from '@/utils/Foundation'
-import customerEdit from '@/views/customer/customerEdit'
-import * as API_hospitalFrame from '@/api/ncs_hospitalFrame'
-import { AG_GRID_LOCALE_CN } from '@/utils/AgGridVueLocaleCn'
-import ButtonCellRender from '@/components/AgGridCellRender/ButtonCellRender'
-import RadioFilter from '@/components/AgGridCustomFilter/RadioFilter'
-
-export default {
-  name: 'CustomerList',
-  components: { customerEdit, ButtonCellRender, RadioFilter },
-  props: {
-    frame: {
-      type: Object,
-      default: () => {}
-    }
-  },
-  data: function() {
-    return {
-      /** 列表loading状态 */
-      loading: false,
-      /** 列表参数 */
-      params: {
-        page_size: 20,
-        page_no: 1,
-        sort: 'status,create_time',
-        dir: 'desc',
-        fixedCondition: ' 1 = 1',
-        hospital_id: this.$store.getters.partId,
-        alias: 'nc'
-      },
-      currentRow: {},
-      /** 列表数据 */
-      tableData: [],
-      pageData: [],
-      dialogAddVisible: false,
-      /** 选中行数据 */
-      multipleSelection: [],
-      lookForm: {},
-      formshow: false,
-      changeFrameId: null,
-      customerId: null,
-      frameId: null,
-      callingType: null,
-      frameList: [],
-      searchStr: null,
-      full_name: '',
-      columnDefs: null,
-      defaultColDef: null,
-      gridOptions: null,
-      gridApi: null,
-      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: {
-    tableHeight() {
-      return this.mainAreaHeight - 130
-    }
-  },
-  watch: {
-    frame(val, oldvalue) {
-      if (val.type === 1) { // 医院
-        this.params.fixedCondition = '1=1'
-      } else 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.GET_List()
-    }
-  },
-  beforeMount() {
-    this.gridOptions = {
-    }
-    this.columnDefs = [
-      {
-        headerName: '#',
-        headerCheckboxSelection: true,
-        headerCheckboxSelectionFilteredOnly: true,
-        checkboxSelection: true,
-        sortable: false, filter: false,
-        width: 50,
-        resizable: false,
-        valueGetter: this.hashValueGetter
-      },
-      { headerName: '姓名', field: 'named', sortable: true, filter: 'agTextColumnFilter', minWidth: 160 },
-      { headerName: '用户编号', field: 'card_no', sortable: true, filter: true, width: 120 },
-      { headerName: '年龄', field: 'age', sortable: true, filter: 'agNumberColumnFilter', valueFormatter: this.formatterAge, width: 80 },
-      { headerName: '入驻病床', field: 'full_name', sortable: true, filter: true, minWidth: 160, valueFormatter: this.fullNameFormatter },
-      { headerName: '性别', field: 'sex', sortable: true, filter: true, cellRenderer: this.formatterSex, width: 80, 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, width: 100, filterFramework: 'RadioFilter',
-        filterParams: {
-          listData: this.statusTransfer
-        }
-      },
-      { headerName: '操作任务', field: 'id',
-        cellRendererFramework: 'ButtonCellRender',
-        cellRendererParams: param => {
-          return {
-            onClick: this.handleAdd,
-            label: '编辑',
-            buttonType: 'primary',
-            buttonSize: 'mini'
-          }
-        },
-        filter: false,
-        pinned: 'right',
-        lockPinned: true,
-        width: 100,
-        resizable: false,
-        sortable: false },
-      { headerName: '换床', field: 'id',
-        cellRendererFramework: 'ButtonCellRender',
-        cellRendererParams: param => {
-          return {
-            onClick: this.handlerEdit,
-            label: '换床',
-            buttonType: 'success',
-            buttonSize: 'mini',
-            show: !param.data['status']
-          }
-        },
-        filter: false,
-        pinned: 'right',
-        lockPinned: true,
-        width: 100,
-        resizable: false,
-        sortable: false },
-      { headerName: '出院', field: 'id',
-        cellRendererFramework: 'ButtonCellRender',
-        cellRendererParams: param => {
-          return {
-            onClick: this.cy,
-            label: '出院',
-            buttonType: 'danger',
-            buttonSize: 'mini',
-            show: !param.data['status']
-          }
-        },
-        pinned: 'right',
-        lockPinned: true,
-        width: 100,
-        resizable: false,
-        filter: false,
-        sortable: false }
-    ]
-    this.defaultColDef = {
-      filter: 'agTextColumnFilter',
-      sortable: true,
-      resizable: true,
-      comparator: this.testComparator,
-      filterParams: {
-        debounceMs: 200,
-        newRowsAction: 'keep',
-        textCustomComparator: this.textCustomComparator,
-        comparator: this.testComparator
-      }
-    }
-    this.rowSelection = 'multiple'
-  },
-  mounted() {
-    this.gridApi = this.gridOptions.api
-    // this.GET_List()
-  },
-  methods: {
-    /** 选择行变化时,记录选中的行数据 */
-    selectFun(val) {
-      this.multipleSelection = val
-    },
-    /** 加载设备信息列表 */
-    GET_List() {
-      this.loading = true
-      this.gridApi.showLoadingOverlay()
-      this.gridApi.sizeColumnsToFit()
-      API_customer.customerListByHospital(this.params).then(res => {
-        this.loading = false
-        this.tableData = res.data
-        this.pageData = {
-          page_no: res.page_no,
-          page_size: res.page_size,
-          data_total: res.data_total
-        }
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /** 处理搜索 **/
-    handlerSearch(keywords) {
-      this.params.query = keywords
-      this.GET_List()
-    },
-    changeStatus(value) {
-      delete this.params.fixedCondition
-      if (value) {
-        this.params.fixedCondition = ' part_id =' + this.$store.getters.partId + ' and status=' + value
-      } else {
-        this.params.fixedCondition = ' 1 = 1'
-      }
-      this.GET_List()
-    },
-    /** 单条数据删除处理 */
-    handlerDelete(ids) {
-      const test = '你确定要删除此用户信息?'
-      const _this = this
-      this.$confirm(test, '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        API_customer.remove(ids).then(
-          response => {
-            _this.GET_List()
-          }
-        ).catch(response => {
-          _this.$message({
-            type: 'info',
-            message: response.message
-          })
-        })
-      })
-    },
-    /** 批量数据删除处理(删除选中的行) */
-    batchDelete: function() {
-      const rows = this.gridApi.getSelectedRows()
-      if (rows.length === 0) {
-        this.$message({ type: 'info', message: '请先勾选需要删除的数据' })
-        return
-      }
-      const ids = []
-      rows.forEach(function(item) {
-        ids.push(item.id)
-      })
-      this.handlerDelete(ids.join(','), 'del')
-    },
-    /** 添加设备信息 */
-    handleAdd(row) {
-      this.dialogAddVisible = true
-      this.customerId = row.id
-      this.frameId = row.frame_id
-    },
-    handlerEdit(row) {
-      this.customerId = row.id
-      this.full_name = row.full_name
-      API_hospitalFrame.getSickbedByPartId(row.part_id).then(res => {
-        this.frameList = res
-      })
-      this.formshow = true
-    },
-    cy(row) {
-      this.customerId = row.id
-      const _this = this
-      this.$confirm('你确定要进行出院操作吗', '警告', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        const data = {
-          out_date: new Date(new Date().toLocaleDateString()).getTime(),
-          status: 1
-        }
-        _this.updateSave(data)
-      })
-    },
-    /** 分页大小发生改变 */
-    handlePageSizeChange(size) {
-      this.params.page_size = size
-      this.GET_List()
-    },
-    /** 分页页数发生改变 */
-    handlePageCurrentChange(page) {
-      this.params.page_no = page
-      this.GET_List()
-    },
-    formatterAge(param) {
-      return param.data.age + param.data.age_unit
-    },
-    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 '未知'
-      }
-    },
-    fullNameFormatter(params) {
-      return params.data.shop_name + '-' + params.value
-    },
-    formatterDate(param) {
-      let date = unixToDate(param.data.in_date, 'yyyy-MM-dd')
-      if (param.data.out_date) {
-        date += '至' + unixToDate(param.data.out_date, 'yyyy-MM-dd')
-      } else {
-        if (param.data.in_date) {
-          date += '至今'
-        }
-      }
-      return date
-    },
-    handlePatientFinished() {
-      this.dialogAddVisible = false
-      this.GET_List()
-    },
-    updateFrameId() {
-      if (!this.changeFrameId) {
-        this.$message({
-          type: 'info',
-          message: '请选择病床'
-        })
-        return
-      }
-      const data = {
-        frame_id: this.changeFrameId
-      }
-      this.updateSave(data)
-    },
-    updateSave(data) {
-      API_customer.update(this.customerId, data).then(res => {
-        this.$message({
-          type: 'success',
-          message: '修改成功'
-        })
-        this.formshow = false
-        this.GET_List()
-      })
-    },
-    clickSearch(value) {
-      this.params.query = this.searchStr
-      this.GET_List()
-    },
-    /** 性别格式化 */
-    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) {
-      const model = param.api.getFilterModel()
-      this.params.filter = JSON.stringify(model)
-      this.GET_List()
-    },
-    gridSortChange(param) {
-      const columnState = param.columnApi.getColumnState()
-      // 排序状态
-      const sortState = columnState.filter(function(s) {
-        return s.sort != null
-      }).map(function(s) {
-        return {
-          colId: s.colId,
-          sort: s.sort,
-          sortIndex: s.sortIndex
-        }
-      }).sort(function(a, b) {
-        return a.sortIndex - b.sortIndex
-      })
-      if (sortState.length > 0) {
-        if (sortState.length === 1) {
-          this.params.sort = sortState[0].colId
-          this.params.dir = sortState[0].sort
-        } else {
-          let sortstring = ''
-          sortState.forEach(function(item) {
-            sortstring += item.colId + ' ' + item.sort + ','
-          })
-          this.params.sort = sortstring.substring(0, sortstring.length - 1)
-          this.params.dir = ' '
-        }
-      } else {
-        delete this.params.sort
-        delete this.params.dir
-      }
-      this.GET_List()
-    }
-  }
-}
-</script>
-
-<style type="text/scss" scoped>
-
-  /deep/ div.toolbar {
-    height: 70px;
-    padding: 20px 0;
-  }
-
-  /deep/ .el-table {
-    width: 100%;
-    overflow-x: scroll;
-
-    & td:not(.is-left) {
-      text-align: center;
-    }
-  }
-</style>

+ 29 - 19
src/views/hospital/ncs_frame/frameTreeView.vue

@@ -39,6 +39,7 @@
               icon-class="area"
               icon-class="area"
             />{{ data.name }}</span>
             />{{ data.name }}</span>
             <span v-else><svg-icon
             <span v-else><svg-icon
+              :style="data.customer_id ? 'color: #0a901c' : ''"
               :icon-class="data.type===4?'sickroom':data.type===5?'bed':'area'"
               :icon-class="data.type===4?'sickroom':data.type===5?'bed':'area'"
             />{{ data.full_name }}</span>
             />{{ data.full_name }}</span>
             <span>
             <span>
@@ -71,13 +72,13 @@
           <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
           <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
             <div class="card-panel">
             <div class="card-panel">
               <div class="card-panel-icon-wrapper icon-people">
               <div class="card-panel-icon-wrapper icon-people">
-                <svg-icon icon-class="peoples" class-name="card-panel-icon" />
+                <svg-icon icon-class="sickroom" class-name="card-panel-icon" />
               </div>
               </div>
               <div class="card-panel-description">
               <div class="card-panel-description">
                 <div class="card-panel-text">
                 <div class="card-panel-text">
-                  在院人
+                  病房
                 </div>
                 </div>
-                <count-to :start-val="0" :end-val="zyrs" :duration="2600" class="card-panel-num" />
+                <count-to :start-val="0" :end-val="bfCount" :duration="2600" class="card-panel-num" />
               </div>
               </div>
             </div>
             </div>
           </el-col>
           </el-col>
@@ -88,35 +89,35 @@
               </div>
               </div>
               <div class="card-panel-description">
               <div class="card-panel-description">
                 <div class="card-panel-text">
                 <div class="card-panel-text">
-                  空置病床
+                  病床
                 </div>
                 </div>
-                <count-to :start-val="0" :end-val="kzbc" :duration="2000" class="card-panel-num" />
+                <count-to :start-val="0" :end-val="bcCount" :duration="2000" class="card-panel-num" />
               </div>
               </div>
             </div>
             </div>
           </el-col>
           </el-col>
           <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
           <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
             <div class="card-panel">
             <div class="card-panel">
               <div class="card-panel-icon-wrapper icon-special-care">
               <div class="card-panel-icon-wrapper icon-special-care">
-                <svg-icon icon-class="care" class-name="card-panel-icon" />
+                <svg-icon icon-class="bad_people" class-name="card-panel-icon" />
               </div>
               </div>
               <div class="card-panel-description">
               <div class="card-panel-description">
                 <div class="card-panel-text">
                 <div class="card-panel-text">
-                  病房
+                  在床数
                 </div>
                 </div>
-                <count-to :start-val="0" :end-val="bf" :duration="1900" class="card-panel-num" />
+                <count-to :start-val="0" :end-val="zcCount" :duration="1900" class="card-panel-num" />
               </div>
               </div>
             </div>
             </div>
           </el-col>
           </el-col>
           <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
           <el-col :xs="12" :sm="12" :lg="6" class="card-panel-col">
             <div class="card-panel">
             <div class="card-panel">
               <div class="card-panel-icon-wrapper icon-primary-care">
               <div class="card-panel-icon-wrapper icon-primary-care">
-                <svg-icon icon-class="care1" class-name="card-panel-icon" />
+                <svg-icon icon-class="empty_bed" class-name="card-panel-icon" />
               </div>
               </div>
               <div class="card-panel-description primary-care">
               <div class="card-panel-description primary-care">
                 <div class="card-panel-text primary-care">
                 <div class="card-panel-text primary-care">
-                  在床人
+                  空床
                 </div>
                 </div>
-                <count-to :start-val="0" :end-val="zcrs" :duration="1500" class="card-panel-num" />
+                <count-to :start-val="0" :end-val="kcCount" :duration="1500" class="card-panel-num" />
               </div>
               </div>
             </div>
             </div>
           </el-col>
           </el-col>
@@ -129,7 +130,7 @@
           </el-tab-pane>
           </el-tab-pane>
           <el-tab-pane label="用户列表" name="frameInfo">
           <el-tab-pane label="用户列表" name="frameInfo">
             <keep-alive>
             <keep-alive>
-              <customer-manager :frame="selectedNode" />
+              <customer-manager :frame="selectedNode" @saved="handleCustomerChange" />
             </keep-alive>
             </keep-alive>
           </el-tab-pane>
           </el-tab-pane>
         </el-tabs>
         </el-tabs>
@@ -280,7 +281,7 @@
 <script>
 <script>
 import * as HospitalFrame_API from '@/api/ncs_hospitalFrame'
 import * as HospitalFrame_API from '@/api/ncs_hospitalFrame'
 import * as API_FrameGroup from '@/api/ncs_frameGroup'
 import * as API_FrameGroup from '@/api/ncs_frameGroup'
-import CustomerManager from '@/views/hospital/ncs_customer/list'
+import CustomerManager from '@/views/hospital/ncs_customer/customerManager'
 import DeviceManager from '@/views/hospital/ncs_device/deviceManager'
 import DeviceManager from '@/views/hospital/ncs_device/deviceManager'
 import CountTo from 'vue-count-to'
 import CountTo from 'vue-count-to'
 import * as API_PartInfo from '@/api/ncs_partInfo'
 import * as API_PartInfo from '@/api/ncs_partInfo'
@@ -333,10 +334,10 @@ export default {
       bed_num_demo: '01',
       bed_num_demo: '01',
       room_num_demo: '01',
       room_num_demo: '01',
       createFrameRules: {},
       createFrameRules: {},
-      zyrs: 1232,
-      zcrs: 632,
-      bf: 82,
-      kzbc: 56,
+      bfCount: 1232,
+      zcCount: 632,
+      kcCount: 82,
+      bcCount: 56,
       /** 新建组织弹出参数 **/
       /** 新建组织弹出参数 **/
       formtitle: '新建组织',
       formtitle: '新建组织',
       formshow: false,
       formshow: false,
@@ -375,7 +376,12 @@ export default {
     getFrameTree() {
     getFrameTree() {
       return new Promise((resolve, reject) => {
       return new Promise((resolve, reject) => {
         API_FrameGroup.getframestruct(this.$store.getters.partId, 1).then(res => {
         API_FrameGroup.getframestruct(this.$store.getters.partId, 1).then(res => {
-          this.treeData = [...res]
+          console.log(res)
+          this.bfCount = res.bfCount
+          this.zcCount = res.zcCount
+          this.kcCount = res.kcCount
+          this.bcCount = res.bcCount
+          this.treeData = res.frameTree
           resolve()
           resolve()
         }).catch(err => {
         }).catch(err => {
           reject(err)
           reject(err)
@@ -617,10 +623,14 @@ export default {
             _this.getFrameTree()
             _this.getFrameTree()
           }).catch(err => {
           }).catch(err => {
             _this.formshow = false
             _this.formshow = false
+            _this.formmodel.member_password = ''
             _this.$message.error(err)
             _this.$message.error(err)
           })
           })
         }
         }
       })
       })
+    },
+    handleCustomerChange() {
+      this.getFrameTree()
     }
     }
   }
   }
 }
 }
@@ -693,7 +703,7 @@ export default {
                 }
                 }
 
 
                 .icon-primary-care {
                 .icon-primary-care {
-                    background: var(--icon-primary-care)
+                    background: rgba(16, 173, 246, 0.42);
                 }
                 }
             }
             }
 
 

+ 1 - 1
src/views/hospitalFrame/frameGroupEdit.vue

@@ -74,7 +74,7 @@ export default {
 
 
     getRoomStructs() {
     getRoomStructs() {
       API_FrameGroup.getframestruct(this.$store.getters.partId, 4).then(res => {
       API_FrameGroup.getframestruct(this.$store.getters.partId, 4).then(res => {
-        this.rooms = this.filterGroupFrames(res, this.groupId)
+        this.rooms = this.filterGroupFrames(res.frameTree, this.groupId)
         console.log('rooms', this.rooms)
         console.log('rooms', this.rooms)
       }).catch(err => {
       }).catch(err => {
         this.$message.error(err)
         this.$message.error(err)

+ 1 - 1
src/views/hospitalFrame/frameTreeView.vue

@@ -256,7 +256,7 @@ export default {
     getFrameTree() {
     getFrameTree() {
       return new Promise((resolve, reject) => {
       return new Promise((resolve, reject) => {
         API_FrameGroup.getframestruct(this.$store.getters.partId, 3).then(res => {
         API_FrameGroup.getframestruct(this.$store.getters.partId, 3).then(res => {
-          this.treeData = [...res]
+          this.treeData = res.frameTree
           resolve()
           resolve()
         }).catch(err => {
         }).catch(err => {
           reject(err)
           reject(err)