|
@@ -1,651 +0,0 @@
|
|
-<template>
|
|
|
|
- <div class="formwrap">
|
|
|
|
-
|
|
|
|
- <el-form :model="formmodel" :rules="rules" ref="editForm" label-width="150px">
|
|
|
|
-
|
|
|
|
- <el-card>
|
|
|
|
- <h4>必须信息</h4>
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="8">
|
|
|
|
- <el-form-item label="设备型号" prop="model">
|
|
|
|
- <el-select v-model="formmodel.model" placeholder="请选择设备型号" @change="deviceModelsChange">
|
|
|
|
- <el-option v-for="item in deviceModels" :key="item.id" :label="item.code" :value="item.code">{{item.code}} ({{item.name}})</el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="8">
|
|
|
|
- <el-form-item label="设备名称" prop="name">
|
|
|
|
- <el-input v-model="formmodel.name" placeholder="设备名称" disabled></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="8">
|
|
|
|
- <el-form-item label="空间类型" prop="frame_type">
|
|
|
|
- <el-select v-model="formmodel.frame_type" placeholder="请选择" disabled>
|
|
|
|
- <el-option label="床位" :value="2"/>
|
|
|
|
- <el-option label="房间" :value="1"/>
|
|
|
|
- <el-option label="科室" :value="0"/>
|
|
|
|
- <el-option label="其它" :value="3"/>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="8">
|
|
|
|
- <el-form-item label="出厂编号" prop="code">
|
|
|
|
- <el-input v-model="formmodel.code" clearable placeholder="请输入编号" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="8">
|
|
|
|
- <el-form-item label="串口地址" prop="uart_address">
|
|
|
|
- <el-input v-model="formmodel.uart_address" clearable placeholder="请输入串口地址" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="7">
|
|
|
|
- <el-form-item label="具体位置" prop="frame_name">
|
|
|
|
- <el-select placeholder="请选择具体位置" v-model="formmodel.frame_id" @change="frameChange($event)" disabled="">
|
|
|
|
- <el-option
|
|
|
|
- v-for="item in frames"
|
|
|
|
- :key="item.id"
|
|
|
|
- :label="item.name"
|
|
|
|
- :value="item.id">
|
|
|
|
- <div v-if="item.type===1" class="el-col-lg-offset-4">{{item.name}} 房</div>
|
|
|
|
- <div v-if="item.type===2" class="el-col-lg-offset-8">{{item.name}} 床</div>
|
|
|
|
- <div v-else class="el-col-lg-offset-1">{{item.name}}</div>
|
|
|
|
- </el-option>
|
|
|
|
- </el-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="1">
|
|
|
|
- <div style="line-height:32px;"> {{frameName}}</div>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </el-card>
|
|
|
|
-
|
|
|
|
- <el-card style="margin-top:15px;">
|
|
|
|
- <h4>其它信息</h4>
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="软件版本" prop="soft_ver">
|
|
|
|
- <el-input v-model="formmodel.soft_ver" clearable placeholder="请输入软件版本" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="硬件版本" prop="hard_ver">
|
|
|
|
- <el-input v-model="formmodel.hard_ver" clearable placeholder="请输入硬件版本" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="以太网卡MAC地址" prop="eth_mac">
|
|
|
|
- <el-input v-model="formmodel.eth_mac" clearable placeholder="请输入以太网卡MAC地址" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="以太网卡IP地址" prop="eth_ip">
|
|
|
|
- <el-input v-model="formmodel.eth_ip" clearable placeholder="请输入硬件以太网卡IP地址" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="WIFI网卡MAC地址" prop="wifi_mac">
|
|
|
|
- <el-input v-model="formmodel.wifi_mac" clearable placeholder="请输入WIFI网卡MAC地址" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="WIFI网卡IP地址" prop="wifi_ip">
|
|
|
|
- <el-input v-model="formmodel.wifi_ip" clearable placeholder="请输入WIFI网卡IP地址" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="WIFI热点名称" prop="wifi_hostname">
|
|
|
|
- <el-input v-model="formmodel.wifi_hostname" clearable placeholder="请输入WIFI热点名称" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="启用状态">
|
|
|
|
- <el-radio v-model="formmodel.status" :label="false">未启用</el-radio>
|
|
|
|
- <el-radio v-model="formmodel.status" :label="true">已启用</el-radio>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="病房号名称" prop="room_num">
|
|
|
|
- <el-input v-model="formmodel.room_num" clearable placeholder="请输入病房号名称" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="门口机ID号" prop="room_id">
|
|
|
|
- <el-input v-model="formmodel.room_id" clearable placeholder="请输入门口机ID号" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="床位号" prop="bed_num">
|
|
|
|
- <el-input v-model="formmodel.bed_num" readonly></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="床位别名" prop="bed_name">
|
|
|
|
- <el-input v-model="formmodel.bed_name" readonly></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="24">
|
|
|
|
- <el-form-item label="使用者类型">
|
|
|
|
- <el-radio v-model="formmodel.human_type" :label="0">未使用</el-radio>
|
|
|
|
- <el-radio v-model="formmodel.human_type" :label="1">病人</el-radio>
|
|
|
|
- <el-radio v-model="formmodel.human_type" :label="2">医生</el-radio>
|
|
|
|
- <el-radio v-model="formmodel.human_type" :label="3">护士</el-radio>
|
|
|
|
- <el-radio v-model="formmodel.human_type" :label="4">护工</el-radio>
|
|
|
|
- <el-radio v-model="formmodel.human_type" :label="5">其它</el-radio>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row v-if="formmodel.human_type===1 || formmodel.human_type===2 || formmodel.human_type===3 || formmodel.human_type===4">
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="使用者名称" prop="human_name">
|
|
|
|
- <el-input v-model="formmodel.human_name" clearable readonly></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-button size="mini" type="primary" icon="el-icon-circle-plus-outline" @click="handleAddHuman">选择使用者</el-button>
|
|
|
|
-
|
|
|
|
- <el-dialog
|
|
|
|
- title="选择使用者"
|
|
|
|
- :visible.sync="editHumanDialogVisible"
|
|
|
|
- width="500px"
|
|
|
|
- :modal="false"
|
|
|
|
- :close-on-click-modal="false"
|
|
|
|
- :close-on-press-escape="false"
|
|
|
|
- >
|
|
|
|
- <el-form :model="chooseHumanForm" :rules="chooseHumanFormRules" ref="chooseHumanForm" label-width="120px">
|
|
|
|
- <el-form-item label="使用者列表" prop="human_id" >
|
|
|
|
- <pop-grid-select v-if="formmodel.human_type===2 ||formmodel.human_type===3 ||formmodel.human_type===4" server-url="/care/employee/page" readonly title="选择使用者"
|
|
|
|
- v-model="chooseHumanForm"
|
|
|
|
- :base-url="baseurl"
|
|
|
|
- method="post"
|
|
|
|
- store-field="human_name"
|
|
|
|
- :columns="[{prop:'type',label:'类型',align:'center',filter:'employeeTypeFormat'},{prop:'name',label:'名称',align:'center'},{prop:'sex',label:'性别',align:'center',filter:'employeeSexFormat'},{prop:'age',label:'年龄',align:'center'},{prop:'face',element:'img',label:'头像',align:'center'}]"
|
|
|
|
- :filter-param="{page_size:10}"
|
|
|
|
- :fields-mapping="[{source:'id',target:'human_id'},{source:'name',target:'human_name'}]"
|
|
|
|
-
|
|
|
|
- ></pop-grid-select>
|
|
|
|
- <pop-grid-select server-url="/care/patient_info/page" v-if="formmodel.human_type===1" readonly title="选择使用者"
|
|
|
|
- v-model="chooseHumanForm"
|
|
|
|
- :base-url="baseurl"
|
|
|
|
- method="post"
|
|
|
|
- store-field="human_name"
|
|
|
|
- :columns="[{prop:'name',label:'病人姓名',align:'center'},{prop:'sex',label:'性别',align:'center',filter:'patienSexFormat'},{prop:'mobile',label:'联系电话',align:'center'},{prop:'age',label:'年龄',align:'center'},{prop:'idcard',label:'身份证号',align:'center'}]"
|
|
|
|
- :filter-param="{page_size:10}"
|
|
|
|
- :fields-mapping="[{source:'id',target:'human_id'},{source:'name',target:'human_name'}]"
|
|
|
|
-
|
|
|
|
- ></pop-grid-select>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-form>
|
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
|
- <el-button @click="editHumanDialogVisible = false">取 消</el-button>
|
|
|
|
- <el-button type="primary" @click="editchooseHumanForm">确 定</el-button>
|
|
|
|
- </span>
|
|
|
|
- </el-dialog>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="SIP服务器IP地址" prop="sip_ip">
|
|
|
|
- <el-input v-model="formmodel.sip_ip" clearable placeholder="请输入SIP服务器IP地址" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="SIP账号" prop="sip_id">
|
|
|
|
- <el-input v-model="formmodel.sip_id" clearable placeholder="请输入SIP账号" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="SIP密码" prop="sip_password">
|
|
|
|
- <el-input type="password" v-model="formmodel.sip_password" clearable placeholder="请输入SIP密码" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="SIP账号状态">
|
|
|
|
- <el-radio v-model="formmodel.sip_status" :label="true">可以使用</el-radio>
|
|
|
|
- <el-radio v-model="formmodel.sip_status" :label="false">暂停使用</el-radio>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="SIP是否在线">
|
|
|
|
- <el-radio v-model="formmodel.online" :label="true">在线</el-radio>
|
|
|
|
- <el-radio v-model="formmodel.online" :label="false">离线</el-radio>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="SIP呼叫清单" prop="sip_calllist">
|
|
|
|
- <el-input
|
|
|
|
- type="textarea"
|
|
|
|
- :autosize="{ minRows: 2, maxRows: 4}"
|
|
|
|
- :minlength="2"
|
|
|
|
- :maxlength="20"
|
|
|
|
- :placeholder="'请输入文本内容,长度2~100'"
|
|
|
|
- v-model="formmodel.sip_calllist">
|
|
|
|
- </el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="被管理的主机ID号" prop="sip_hosting_id">
|
|
|
|
- <el-input v-model="formmodel.sip_hosting_id" clearable placeholder="请输入被管理的主机ID号" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="SIP主机名称" prop="sip_hosting_name">
|
|
|
|
- <el-input v-model="formmodel.sip_hosting_name" clearable placeholder="请输入SIP主机名称" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="设备相关数据" prop="ir_cfg">
|
|
|
|
- <el-input v-model="formmodel.ir_cfg" clearable placeholder="请输入设备相关数据" :maxlength="50"></el-input>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="0号区域" prop="zone0">
|
|
|
|
- <el-input-number v-model="formmodel.zone0" placeholder="0号区域" size="small" type="number" :controls="false" :maxlength="50">
|
|
|
|
- </el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="1号区域" prop="zone1">
|
|
|
|
- <el-input-number v-model="formmodel.zone1" placeholder="1号区域" size="small" type="number" :controls="false" :maxlength="50">
|
|
|
|
- </el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="2号区域" prop="zone2">
|
|
|
|
- <el-input-number v-model="formmodel.zone2" placeholder="2号区域" size="small" type="number" :controls="false" :maxlength="50">
|
|
|
|
- </el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="3号区域" prop="zone3">
|
|
|
|
- <el-input-number v-model="formmodel.zone3" placeholder="3号区域" size="small" type="number" :controls="false" :maxlength="50">
|
|
|
|
- </el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
-
|
|
|
|
- <el-row>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="4号区域" prop="zone4">
|
|
|
|
- <el-input-number v-model="formmodel.zone4" placeholder="4号区域" size="small" type="number" :controls="false" :maxlength="50">
|
|
|
|
- </el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- <el-col :span="12">
|
|
|
|
- <el-form-item label="5号区域" prop="zone5">
|
|
|
|
- <el-input-number v-model="formmodel.zone5" placeholder="5号区域" size="small" type="number" :controls="false" :maxlength="50">
|
|
|
|
- </el-input-number>
|
|
|
|
- </el-form-item>
|
|
|
|
- </el-col>
|
|
|
|
- </el-row>
|
|
|
|
- </el-card>
|
|
|
|
-
|
|
|
|
- <el-form-item style="margin-top:15px;">
|
|
|
|
- <el-button type="primary" @click="handlerSubmit('editForm')" class="save">保存修改</el-button>
|
|
|
|
- </el-form-item>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- </el-form>
|
|
|
|
-
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script>
|
|
|
|
- import { UE } from '@/components'
|
|
|
|
- // import * as DeviceInfo_API from '@/api/deviceInfo'
|
|
|
|
- import * as RegExp from '@/utils/RegExp'
|
|
|
|
- // import * as HospitalFrame_API from '@/api/hospitalFrame'
|
|
|
|
-
|
|
|
|
- export default {
|
|
|
|
- name: 'deviceInfoEdit',
|
|
|
|
- components: {
|
|
|
|
- [UE.name]: UE
|
|
|
|
- },
|
|
|
|
- props: {
|
|
|
|
- formmodel: {
|
|
|
|
- type: Object,
|
|
|
|
- default: () => ({})
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- data: function() {
|
|
|
|
- return {
|
|
|
|
- id: this.$route.params.id,
|
|
|
|
- imageUrl: '',
|
|
|
|
- uploadurl: '/uploaders/uploadFile',
|
|
|
|
- usertags: [],
|
|
|
|
- /** 输入校验 */
|
|
|
|
- rules: {
|
|
|
|
- name: [
|
|
|
|
- this.MixinRequired('请输入别名!'),
|
|
|
|
- { min: 2, max: 50, message: '长度在 2 到 50 个字符', trigger: 'blur' },
|
|
|
|
- {
|
|
|
|
- validator: (rule, value, callback) => {
|
|
|
|
- if (!RegExp.userName.test(value)) {
|
|
|
|
- callback(new Error('只支持汉字、字母、数字、“-”、“_”的组合!'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- ],
|
|
|
|
- code: [{
|
|
|
|
- required: true, message: '请输入出厂编号', trigger: 'blur'
|
|
|
|
- }],
|
|
|
|
- type: [{
|
|
|
|
- required: true, message: '请选择类型', trigger: 'blur'
|
|
|
|
- }],
|
|
|
|
- model: [{
|
|
|
|
- required: true, message: '请输入设备型号', trigger: 'blur'
|
|
|
|
- }]
|
|
|
|
- },
|
|
|
|
- /** 选择医院结构 */
|
|
|
|
- frames: [],
|
|
|
|
- editHospitalFrameDialogVisible: false,
|
|
|
|
- chooseHospitalFrameForm: {},
|
|
|
|
- chooseHospitalFrameFormRules: {
|
|
|
|
- frame_id: [this.MixinRequired('医院结构必须选择!')]
|
|
|
|
- },
|
|
|
|
- /** 选择使用者 */
|
|
|
|
- editHumanDialogVisible: false,
|
|
|
|
- chooseHumanForm: {},
|
|
|
|
- chooseHumanFormRules: {
|
|
|
|
- human_id: [this.MixinRequired('使用者必须选择!')]
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- frameName: '',
|
|
|
|
- deviceModels: []
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- mounted() {
|
|
|
|
- // console.log(this.formmodel)
|
|
|
|
- this.getFrames()
|
|
|
|
- },
|
|
|
|
- activated() {
|
|
|
|
- },
|
|
|
|
- watch: {
|
|
|
|
- 'formmodel': function(newval) {
|
|
|
|
- this.getFrameName(this.formmodel.frame_type)
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- methods: {
|
|
|
|
- getFrameName(type) {
|
|
|
|
- switch (type) {
|
|
|
|
- case 0:
|
|
|
|
- this.frameName = '科室'
|
|
|
|
- break
|
|
|
|
- case 1:
|
|
|
|
- this.frameName = '房'
|
|
|
|
- break
|
|
|
|
- case 2:
|
|
|
|
- this.frameName = '床'
|
|
|
|
- break
|
|
|
|
- default:
|
|
|
|
- this.frameName = ''
|
|
|
|
- break
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- getFrames() {
|
|
|
|
- const params = { page_size: 10000, page_no: 1 }
|
|
|
|
- // HospitalFrame_API.getHospitalFrameList(params).then(response => {
|
|
|
|
- // if (response.data) {
|
|
|
|
- // this.frames.push({
|
|
|
|
- // id: -1,
|
|
|
|
- // type: 0,
|
|
|
|
- // name: '科室'
|
|
|
|
- // })
|
|
|
|
- // response.data.forEach(item => {
|
|
|
|
- // this.frames.push(item)
|
|
|
|
- // if (item.has_children) {
|
|
|
|
- // item.children.forEach(subItem => {
|
|
|
|
- // this.frames.push(subItem)
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- //
|
|
|
|
- // if (!this.formmodel.frame_id) {
|
|
|
|
- // return
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
-
|
|
|
|
- // DeviceInfo_API.getDeviceModelBySeries('风尚版').then(res => {
|
|
|
|
- // this.deviceModels = res
|
|
|
|
- // this.getFrameName(this.formmodel.frame_type)
|
|
|
|
- // })
|
|
|
|
- },
|
|
|
|
- deviceModelsChange(e) {
|
|
|
|
- let deviceModel = this.deviceModels.find(item => {
|
|
|
|
- return item.code === e
|
|
|
|
- })
|
|
|
|
- this.formmodel.frame_type = Number.parseInt(deviceModel.frame_type)
|
|
|
|
- this.formmodel.name = deviceModel.name
|
|
|
|
- this.getFrameName(deviceModel.frame_type)
|
|
|
|
- },
|
|
|
|
- frameChange(e) {
|
|
|
|
- let frameItems = this.frames.find(item => {
|
|
|
|
- return item.id === e
|
|
|
|
- })
|
|
|
|
- if (frameItems) {
|
|
|
|
- if (frameItems.type === -1) {
|
|
|
|
- this.frameName = '科室'
|
|
|
|
- } else if (frameItems.type === 1) {
|
|
|
|
- this.frameName = '房'
|
|
|
|
- } else if (frameItems.type === 2) {
|
|
|
|
- this.frameName = '床'
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- /** 保存按钮处理事件 */
|
|
|
|
- handlerSubmit(formName) {
|
|
|
|
- this.$refs[formName].validate(valid => {
|
|
|
|
- if (valid) {
|
|
|
|
- const params = this.MixinClone(this.formmodel)
|
|
|
|
- if (params.id) {
|
|
|
|
- // DeviceInfo_API.updateDeviceInfo(params.id, params).then(response => {
|
|
|
|
- // this.$message.success('修改成功!')
|
|
|
|
- // this.$emit('saved')
|
|
|
|
- // })
|
|
|
|
- } else {
|
|
|
|
- params.part_id = this.$store.getters.partId
|
|
|
|
- params.frame_id = this.formmodel.frame_id
|
|
|
|
- // DeviceInfo_API.addDeviceInfo(params).then(response => {
|
|
|
|
- // this.$message.success('添加成功!')
|
|
|
|
- // this.$emit('saved')
|
|
|
|
- // })
|
|
|
|
- }
|
|
|
|
- } else {
|
|
|
|
- this.$message.error('表单填写有误,请检查!')
|
|
|
|
- return false
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 图片上传之前的校验 */
|
|
|
|
- handleShopLogoBefore(file) {
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
- const isImg = file.type === 'image/jpeg' || file.type === 'image/png' || file.type === 'image/gif'
|
|
|
|
- const isLt2M = file.size / 1024 / 1024 < 2
|
|
|
|
-
|
|
|
|
- if (!isImg) {
|
|
|
|
- this.$message.error('上传头像图片只能是 JPG、PNG、GIF 格式!')
|
|
|
|
- reject()
|
|
|
|
- }
|
|
|
|
- if (!isLt2M) {
|
|
|
|
- this.$message.error('上传头像图片大小不能超过 2MB!')
|
|
|
|
- reject()
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- let reader = new FileReader()
|
|
|
|
- reader.onload = (event) => {
|
|
|
|
- let image = new Image()
|
|
|
|
- image.onload = () => {
|
|
|
|
- let width = image.width
|
|
|
|
- let height = image.height
|
|
|
|
- if (width > 500 || width < 100) {
|
|
|
|
- this.$message.error('图片宽度必须在100~500之间,宽高比为1:1!')
|
|
|
|
- reject()
|
|
|
|
- }
|
|
|
|
- if (width !== height) {
|
|
|
|
- this.$message.error('请上传宽高比为1:1的图片')
|
|
|
|
- reject()
|
|
|
|
- }
|
|
|
|
- if (height > 500 || height < 100) {
|
|
|
|
- this.$message.error('图片高度必须在100~500之间!')
|
|
|
|
- reject()
|
|
|
|
- }
|
|
|
|
- resolve()
|
|
|
|
- }
|
|
|
|
- image.src = event.target.result
|
|
|
|
- }
|
|
|
|
- reader.readAsDataURL(file)
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- /** 上传成功后的钩子 更换图片 置空存储数组*/
|
|
|
|
- uploaded(response) {
|
|
|
|
- this.imageUrl = response.url
|
|
|
|
- this.formmodel.face = response.url
|
|
|
|
- },
|
|
|
|
- /** 选择医院结构按钮*/
|
|
|
|
- handleAddHospitalFrame() {
|
|
|
|
- this.editHospitalFrameDialogVisible = true
|
|
|
|
- },
|
|
|
|
- editchooseHospitalFrameForm() {
|
|
|
|
- this.$refs['chooseHospitalFrameForm'].validate((valid, error) => {
|
|
|
|
- if (valid) {
|
|
|
|
- this.formmodel.frame_id = this.chooseHospitalFrameForm.frame_id
|
|
|
|
- this.formmodel.frame_name = this.chooseHospitalFrameForm.frame_name
|
|
|
|
- this.editHospitalFrameDialogVisible = false
|
|
|
|
- } else {
|
|
|
|
- this.$message.error('表单填写有误,请检查!')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- /** 选择使用者按钮*/
|
|
|
|
- handleAddHuman() {
|
|
|
|
- this.editHumanDialogVisible = true
|
|
|
|
- },
|
|
|
|
- editchooseHumanForm() {
|
|
|
|
- this.$refs['chooseHumanForm'].validate((valid, error) => {
|
|
|
|
- if (valid) {
|
|
|
|
- this.formmodel.human_id = this.chooseHumanForm.human_id
|
|
|
|
- this.formmodel.human_name = this.chooseHumanForm.human_name
|
|
|
|
- this.editHumanDialogVisible = false
|
|
|
|
- } else {
|
|
|
|
- this.$message.error('表单填写有误,请检查!')
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-</script>
|
|
|
|
-
|
|
|
|
-<style type="text/scss" scoped>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- .formwrap /deep/ .el-tabs__content {
|
|
|
|
- overflow: visible !important;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .formwrap /deep/ .app-address-title {
|
|
|
|
- height: 32px !important;
|
|
|
|
- line-height: 32px !important;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .formwrap /deep/ .app-address {
|
|
|
|
- width: 100% !important;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- .el-select {
|
|
|
|
- width: 100%;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .el-date-editor {
|
|
|
|
- width: 100%;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .formwrap {
|
|
|
|
- border: 1px solid #ebebeb;
|
|
|
|
- border-radius: 3px;
|
|
|
|
- background: #fff;
|
|
|
|
- padding: 24px;
|
|
|
|
- min-height: 700px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .app-address {
|
|
|
|
- margin-top: 4px;
|
|
|
|
- z-index: 1;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- .area-tip {
|
|
|
|
- color: #666;
|
|
|
|
- margin-left: 10px;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /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: 200px;
|
|
|
|
- height: 200px;
|
|
|
|
- line-height: 200px;
|
|
|
|
- text-align: center;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /deep/ .avatar {
|
|
|
|
- width: 200px;
|
|
|
|
- height: 200px;
|
|
|
|
- display: block;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-</style>
|
|
|