123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944 |
- <template>
- <div class="main-contain">
- <div class="position">
- <bread-crumb :crumbs='crumbs'></bread-crumb>
- </div>
- <div class="app-container">
- <!-- <div class="cell clearfix">
- <label class="title"><span class="name">病人查询</span> : </label>
- <el-input size="small" style="width: 280px;" v-model.trim="search_input" class="filter-item"/>
- <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="searchAction">搜索</el-button>
- </div> -->
- <!-- <div class="cell clearfix">
- <label class="title"><span class="name">日期查询</span> : </label>
- <el-date-picker v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange" :editable="false" :clearable="false" style="width: 196px;" type="date" placeholder="选择日期时间" align="right" ></el-date-picker>
- </div>
- <div class="cell clearfix">
- <label class="title"><span class="name">排班班次</span> : </label>
- <div class="time ">
- <ul class="">
- <li v-for="option in schedule_type_options" :key="option.value" @click="handletimeType(option.value)" :class="schedule_type_selected == option.value ? 'active' : ''" >{{option.text}}
- </li>
- </ul>
- </div>
- </div>
- <div class="cell clearfix">
- <label class="title"><span class="name">分区</span> : </label>
- <div class="time ">
- <ul class="">
- <li v-for="option in zone_options" :key="option.id" :class="option.id == zone_selected ? 'active' : ''" @click='handleZoneChange(option.id)'>{{ option.text }}
- </li>
- </ul>
- </div>
- </div> -->
- <div class="cell clearfix">
- <label class="title"><span class="name">患者状态</span> : </label>
- <div class="time ">
- <ul class="">
- <li v-for="option in patient_state" :key="option.value" @click="handleStateChange(option.value)" :class="patientStateVal == option.value ? 'active' : ''" >{{option.label}}
- </li>
- </ul>
- </div>
- <!-- <label class="title"><span class="name">叫号状态</span> : </label>
- <div class="time ">
- <ul class="">
- <li v-for="option in call_state" :key="option.value" @click="handleCallChange(option.value)" :class="callVal == option.value ? 'active' : ''" >{{option.label}}
- </li>
- </ul>
- </div> -->
- </div>
- <div class="cell clearfix">
- <label class="title"><span class="name">治疗状态</span> : </label>
- <div class="time ">
- <ul class="">
- <li v-for="option in treat_state" :key="option.value" @click="handleTreatChange(option.value)" :class="treatStateVal == option.value ? 'active' : ''" >{{option.label}}
- </li>
- </ul>
- </div>
- </div>
- <div class="cell clearfix" style="margin-bottom:10px;">
- <label class="title"><span class="name">其他查询</span> : </label>
- <el-select v-model="schedule_type_selected" placeholder="班次" style="margin-right:10px;" @change="handletimeType">
- <el-option
- v-for="item in schedule_type_options"
- :key="item.value"
- :label="item.text"
- :value="item.value">
- </el-option>
- </el-select>
- <el-select v-model="zone_selected" placeholder="分区" style="margin-right:10px;" @change="handleZoneChange">
- <el-option
- v-for="item in zone_options"
- :key="item.id"
- :label="item.text"
- :value="item.id">
- </el-option>
- </el-select>
- <label class="title"><span class="name">日期查询</span> : </label>
- <el-date-picker v-model="selected_date" prefix-icon="el-icon-date" @change="handleScheduleDateChange" :editable="false" :clearable="false" style="width: 196px;margin-right:10px;" type="date" placeholder="选择日期时间" align="right" ></el-date-picker>
- <el-input size="small" style="width: 180px;" @keyup.enter.native='searchAction' v-model.trim="search_input" class="filter-item"/>
- <el-button size="small" class="filter-item" type="primary" icon="el-icon-search" @click="searchAction">搜索</el-button>
- </div>
- <div style="display:flex;justify-content: space-between;">
- <div :class="queueConfig.txglsyxs != 1 ? 'PatientArea' : 'PatientArea smallWidth'">
- <div v-for="zone_schedule in allPatient" :key="zone_schedule.zone_id" class="list clearfix">
- <!-- <h3 style="width:40px;" class="title">{{zone_schedule.zone_name}}</h3> -->
- <div v-if="zone_schedule.schedules.length > 0 && patientStateVal != 1" style="font-size:16px;font-weight: bold;color: #34495e;margin-right:10px;line-height:30px;">{{zone_schedule.zone_name}}</div>
- <patient-box :schedules="zone_schedule.schedules" :patientStateVal='patientStateVal' style="flex:1"></patient-box>
- </div>
- <div class="NoData" v-show="filtedSchedules.length == 0">
- <img src="@/assets/img/data.jpg" alt="">
- </div>
- </div>
- <div class="nowCalling" v-if="queueConfig.txglsyxs == 1">
- <p class="nowCallingTitle">当前叫号</p>
- <p class="nowCallingName">{{ fisrtQueueInfo ? fisrtQueueInfo.patient_name : '' }}</p>
- <p class="nowCallingTime">签到时间:{{ fisrtQueueInfo ? fisrtQueueInfo.create_time : '' }}</p>
- <el-button type="primary" @click="call(fisrtQueueInfo && fisrtQueueInfo.patient_id ? fisrtQueueInfo.patient_id : '')" style="margin-left:0;margin: 30px 0 20px 0;"> 叫号 </el-button>
- <!-- <el-button style="margin: 0px 0 20px 0;" @click="pass(fisrtQueueInfo.patient_id)"> 过号 </el-button> -->
- <el-button style="margin:0 auto;" @click="next(fisrtQueueInfo && fisrtQueueInfo.patient_id ? fisrtQueueInfo.patient_id : '')">下一位</el-button>
- </div>
- </div>
- </div>
- </div>
- </template>
-
- <script>
- const moment = require('moment')
- import axios from 'axios'
- import PatientBox from './PatientBox'
- import { getDialysisRecordInitData, getDialysisSchedules } from '@/api/dialysis_record'
- import { parseTime } from '@/utils'
- import BreadCrumb from '@/xt_pages/components/bread-crumb'
-
- export default {
- name: 'Patient',
- components: {
- PatientBox,
- BreadCrumb
- },
- data() {
- return {
- crumbs: [
- { path: false, name: '透析管理' },
- { path: 'dialysis/dialysisrecord', name: '透析记录' }
- ],
- selected_date: new Date(), // this.$store.getters.app.dialysis_area.schedule_date,
- schedule_type_selected: 0, // this.$store.getters.app.dialysis_area.schedule_type_select_index,
- schedule_type_options: [
- { value: 0, text: '全部班' },
- { value: 1, text: '上午' },
- { value: 2, text: '下午' },
- { value: 3, text: '晚上' }
- ],
- zone_selected: 0, // this.$store.getters.app.dialysis_area.zone_select_index,
- zone_options: [
- { id: 0, text: '全部分区' }
- ],
- zone_schedules: [],
-
- date_picker_options: {
- shortcuts: [
- {
- text: '今天',
- onClick(picker) {
- picker.$emit('pick', new Date())
- }
- },
- {
- text: '昨天',
- onClick(picker) {
- const date = new Date()
- date.setTime(date.getTime() - 3600 * 1000 * 24)
- picker.$emit('pick', date)
- }
- },
- {
- text: '一周前',
- onClick(picker) {
- const date = new Date()
- date.setTime(date.getTime() - 3600 * 1000 * 24 * 7)
- picker.$emit('pick', date)
- }
- }
- ]
- },
-
- // search_input 和 search_keyword,使输入关键字时不会经常刷新 filtedSchedules
- search_keyword: '', // 确定用于搜索的关键字
- search_input: '', // 输入中的关键字
-
- //
- patient_state:[
- {value: 0,label: '全部'},
- {value: 1,label: '已签到'},
- {value: 2,label: '未签到'},
- {value: 3,label: '已上机'},
- {value: 4,label: '已下机'},
- ],
- patientStateVal: 0,
- treat_state:[
- {value: 0,label: '全部'},
- {value: 1,label: '待开处方'},
- {value: 2,label: '待开小结'},
- {value: 3,label: '待医嘱核对'},
- ],
- treatStateVal: 0,
- allPatient:[],
-
- //叫号
- waitingCalled:[],
- called:[],
- fisrtQueueInfo:{},
- call_state:[
- {value: 0,label: '全部'},
- {value: 1,label: '待叫号'},
- {value: 2,label: '已叫号'},
- ],
- callVal: 0,
- timers:null,
- queueConfig:{}
- }
- },
- computed: {
- websocket() {
- return this.$store.state.user.websocket;
- },
- filtedSchedules: function() {
- var search_keyword = this.search_keyword
- if (search_keyword.length > 0) {
- var schedules = []
- for (let o_i = 0; o_i < this.zone_schedules.length; o_i++) {
- const scheduleInfo = this.zone_schedules[o_i]
- var originSchedules = scheduleInfo.schedules
- if (originSchedules.length == 0) {
- continue
- }
- var filtedSchedules = []
- for (let s_i = 0; s_i < originSchedules.length; s_i++) {
- const schedule = originSchedules[s_i]
- if (schedule.patient.name.indexOf(search_keyword) != -1) {
- filtedSchedules.push(schedule)
- // break
- }
- }
- if (filtedSchedules.length > 0) {
- schedules.push({ zone_id: scheduleInfo.zone_id, zone_name: scheduleInfo.zone_name, schedules: filtedSchedules })
- }
- }
- return schedules
- }
-
- var zone_selected = this.zone_selected
- var timetype_selected = this.schedule_type_selected
- if ((zone_selected == 0 && timetype_selected == 0) || this.zone_options.length <= 1) {
- var schedules = []
- for (let index = 0; index < this.zone_schedules.length; index++) {
- const scheduleInfo = this.zone_schedules[index]
- if (scheduleInfo.schedules.length != 0) {
- schedules.push(scheduleInfo)
- }
- }
- return schedules
- }
-
- var schedules = []
- for (let o_i = 0; o_i < this.zone_schedules.length; o_i++) {
- const scheduleInfo = this.zone_schedules[o_i]
- if (zone_selected == scheduleInfo.zone_id && timetype_selected == 0) {
- if (scheduleInfo.schedules.length == 0) {
- return []
- } else {
- return [scheduleInfo]
- }
- }
- var originSchedules = scheduleInfo.schedules
- if (originSchedules.length == 0) {
- continue
- }
- var filtedSchedules = []
- for (let s_i = 0; s_i < originSchedules.length; s_i++) {
- const schedule = originSchedules[s_i]
- if (zone_selected != 0) {
- if (zone_selected == schedule.device_number.zone.id) {
- if (timetype_selected == 0 || schedule.schedule_type == timetype_selected) {
- filtedSchedules.push(schedule)
- }
- }
- } else {
- if (timetype_selected == 0 || schedule.schedule_type == timetype_selected) {
- filtedSchedules.push(schedule)
- }
- }
- }
- if (filtedSchedules.length > 0) {
- schedules.push({ zone_id: scheduleInfo.zone_id, zone_name: scheduleInfo.zone_name, schedules: filtedSchedules })
- }
- }
- return schedules
- }
- },
- created() {
- var schedule_type_selected = this.$store.getters.schedule_type_selected
- var zone_selected = this.$store.getters.zone_selected
- var patient_state_selected = this.$store.getters.patient_state_selected
- var treat_state_selected = this.$store.getters.treat_state_selected
- var selected_date = this.$store.getters.selected_date
- if (schedule_type_selected) {
- this.schedule_type_selected = schedule_type_selected.schedule_type_selected
- }
- if (zone_selected) {
- this.zone_selected = zone_selected.zone_selected
- }
- if (patient_state_selected) {
- this.patientStateVal = patient_state_selected.patient_state_selected
- }
- if (treat_state_selected) {
- this.treatStateVal = treat_state_selected.treat_state_selected
- }
- if(selected_date.selected_date){
- this.selected_date = selected_date.selected_date
- }
- this.initData = {
- cmd: "queue/join",
- data: {type:3,page:0,size:0},
- };
- this.websocketSend(this.initData)
-
-
- this.getInitData()
-
-
-
- },
- beforeMount() {
- if (this.websocket) {
- if (this.websocket.readyState == 1) {
- console.log('执行1')
- this.websocketMess();
- } else {
- setTimeout(() => {
- console.log('执行2')
- this.websocketMess();
- }, 1000);
- }
- } else {
- setTimeout(() => {
- if (this.websocket) {
- console.log('执行3')
- this.websocketMess();
- } else {
- setTimeout(() => {
- console.log('执行4')
- this.websocketMess();
- }, 1000);
- }
- }, 1000);
- }
- },
- mounted() {
- const timer = setInterval(() => {
- // this.getInitData();
- this.requestDialysisSchedules()
- }, 1000 * 30)
- // 通过$once来监听定时器,在beforeDestroy钩子可以被清除。
- this.$once('hook:beforeDestroy', () => {
- clearInterval(timer)
- })
-
- let obj = {
- cmd: "queue/join",
- data: {type:3,page:0,size:0},
- };
- this.websocketSend(obj)
- },
- beforeDestroy(){
-
- let unObj = {
- cmd: "queue/unjoin",
- data: {type:3},
- };
- this.websocketSend(unObj)
- },
- methods: {
- websocketSend(data) {
- try {
- this.websocket.send(JSON.stringify(data))
-
- } catch (error) {
- this.showError = true;
- this.showIndex = 4;
- this.errorInfo = "网络异常,请稍后退出重试!";
- }
- },
- websocketMess() {
- console.log('执行',this.websocket)
- this.websocket.onmessage = e => {
- let res = JSON.parse(e.data);
- // let res = re.data;
- console.log('res3333333333',res)
- if(res.channel == 'queue/join'){
- if(res.data.fisrtQueueInfo != null){
- if(res.data.fisrtQueueInfo.create_time){
- res.data.fisrtQueueInfo.create_time = moment(parseInt(res.data.fisrtQueueInfo.create_time) * 1000).format('HH:mm')
- }
- }
- this.queueConfig = res.data.queueConfig
- this.fisrtQueueInfo = res.data.fisrtQueueInfo
- let arr = res.data.patientQueueList.data
- let waitingCalledArr = []
- let calledArr = []
- arr.map(item => {
- if(item.status == 1){
- // item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
- waitingCalledArr.push(item)
- }else if(item.status == 2){
- // item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
- calledArr.push(item)
- }
- })
- console.log('waitingCalledArr待叫号',waitingCalledArr)
- console.log('waitingCalledArr以较好',calledArr)
- this.waitingCalled = waitingCalledArr
- this.called = calledArr
- }else if(res.channel == 'allQueueList'){
- let arr = res.data.queue_list.data
- let waitingCalledArr = []
- let calledArr = []
- arr.map(item => {
- if(item.status == 1){
- // item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
- waitingCalledArr.push(item)
- }else if(item.status == 2){
- // item.create_time = moment(item.create_time * 1000).format('HH:mm:ss')
- calledArr.push(item)
- }
- })
- this.waitingCalled = waitingCalledArr
- this.called = calledArr
- }else if(res.channel == 'patientCallInfo'){
- res.data.patientInfo.create_time = moment(res.data.patientInfo.create_time * 1000).format('HH:mm')
- this.fisrtQueueInfo = res.data.patientInfo
- }
- }
- },
- call(patient_id){
- if(patient_id == undefined || patient_id == ""){
- this.$message.error('已经是最后一位了');
- return
- }
- console.log('patient_id',patient_id)
- let org_id = parseInt(sessionStorage.getItem("org_id"));
- let admin_user_id = parseInt(sessionStorage.getItem("admin_user_id"));
- axios.get('/api/index/callpatient?org_id=' + org_id + '&patient_id=' + patient_id + '&admin_user_id=' + admin_user_id).then(res => {
- console.log(res)
- // let patientArr = res.data.queue_list.data
- // this.patientArr = patientArr
- // this.$emit('child-event',this.patientArr)
- if(res.data.code == 200){
- this.$message({
- message: res.data.msg,
- type: 'success'
- });
- }
- })
- },
- next(patient_id){
- if(patient_id == undefined || patient_id == ""){
- this.$message.error('已经是最后一位了');
- return
- }
- console.log('patient_id',patient_id)
- let org_id = parseInt(sessionStorage.getItem("org_id"));
- let admin_user_id = parseInt(sessionStorage.getItem("admin_user_id"));
- axios.get('/api/index/nextcall?org_id=' + org_id + '&patient_id=' + patient_id + '&admin_user_id=' + admin_user_id).then(res => {
- console.log(res)
- // let patientArr = res.data.queue_list.data
- // this.patientArr = patientArr
- // this.$emit('child-event',this.patientArr)
- if(res.data.data.patientInfo == null){
- this.$message.error('已经是最后一位了');
- return
- }
- if(res.data.code == 200){
- this.$message({
- message: res.data.msg,
- type: 'success'
- });
- }
-
- })
- },
- handleCallChange: function(index) {
- this.callVal = index
- // this.$store.dispatch('SetTreatStateSelected', { treat_state_selected: index })
- this.search_keyword = this.search_input = ''
- this.getData()
- },
- // handletimeType: function(index) {
- // this.schedule_type_selected = index
- // this.$store.dispatch('SetScheduleTypeSelected', { schedule_type_selected: index })
- // this.search_keyword = this.search_input = ''
- // // this.$store.dispatch("SaveDialysisAreaSelectIndexs", {
- // // zone: this.zone_selected,
- // // schedule_type: this.schedule_type_selected,
- // // schedule_date: this.selected_date,
- // // })
- // },
- // handleZoneChange: function(index) {
- // this.zone_selected = index
- // this.$store.dispatch('SetZoneSelected', { zone_selected: index })
- // this.search_keyword = this.search_input = ''
- // // this.$store.dispatch("SaveDialysisAreaSelectIndexs", {
- // // zone: this.zone_selected,
- // // schedule_type: this.schedule_type_selected,
- // // schedule_date: this.selected_date,
- // // })
- // },
- handleScheduleDateChange: function(index) {
- console.log("askdjlkas",index)
- this.zone_selected = 0
- this.schedule_type_selected = 0
- this.patientStateVal = 0
- this.treatStateVal = 0
- this.search_keyword = this.search_input = ''
- // this.$store.dispatch("SaveDialysisAreaSelectIndexs", {
- // zone: this.zone_selected,
- // schedule_type: this.schedule_type_selected,
- // schedule_date: this.selected_date,
- // })
- this.selected_date = index
- this.$store.dispatch('SetSelectedDate', { selected_date: index })
- this.requestDialysisSchedules()
- },
- searchAction: function() {
- this.search_keyword = this.search_input
- this.schedule_type_selected = 0
- this.zone_selected = 0
- this.treatStateVal = 0
- this.patientStateVal = 0
- if(this.search_input != ''){
- this.allPatient = this.filtedSchedules
- }else{
- this.getData()
- }
-
- },
- getInitData: function() {
- getDialysisRecordInitData().then(rs => {
- var resp = rs.data
- if (resp.state == 1) {
- var zones = resp.data.zones
- var schedules = resp.data.schedules
- var zone_options = [{ id: 0, text: '全部分区' }]
- for (let z_i = 0; z_i < zones.length; z_i++) {
- const zone = zones[z_i]
- zone_options.push({ id: zone.id, text: zone.name })
- }
- this.zone_options = zone_options
- // this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
- this.requestDialysisSchedules()
-
- console.log(1111111111111,this.zone_schedules)
- } else {
- this.$message.error(resp.msg)
- }
- })
- },
- requestDialysisSchedules: function() {
- var ymd = parseTime(this.selected_date, '{y}-{m}-{d}')
- getDialysisSchedules(ymd).then(rs => {
- var resp = rs.data
- if (resp.state == 1) {
- var schedules = resp.data.schedules
- this.zone_schedules = this.processedDialysisSchedules(schedules, this.zone_options)
- this.allPatient = this.filtedSchedules
- this.getData()
- } else {
- this.$message.error(resp.msg)
- }
- })
- },
- processedDialysisSchedules: function(schedules, zone_options) {
- var zoneMap = {}
- var scheduleMap = {}
- for (let z_i = 0; z_i < zone_options.length; z_i++) {
- const zone = zone_options[z_i]
- if (zone.id == 0) {
- continue
- }
- scheduleMap[zone.id] = []
- }
- for (let index = 0; index < schedules.length; index++) {
- const schedule = schedules[index]
- scheduleMap[schedule.device_number.zone.id].push(schedule)
- }
- var zone_schedules = []
- for (let index = 0; index < zone_options.length; index++) {
- const zone = zone_options[index]
- if (zone.id == 0) {
- continue
- }
- var schedules = scheduleMap[zone.id]
- zone_schedules.push({ zone_id: zone.id, zone_name: zone.text, schedules: schedules })
- }
- return zone_schedules
- },
-
- //
- handleStateChange: function(index) {
- this.patientStateVal = index
- this.$store.dispatch('SetPatientStateSelected', { patient_state_selected: index })
- this.search_keyword = this.search_input = ''
- this.getData()
- },
- handleTreatChange: function(index) {
- this.treatStateVal = index
- this.$store.dispatch('SetTreatStateSelected', { treat_state_selected: index })
- this.search_keyword = this.search_input = ''
- this.getData()
- },
- handletimeType: function(index) {
- this.schedule_type_selected = index
- this.$store.dispatch('SetScheduleTypeSelected', { schedule_type_selected: index })
- this.search_keyword = this.search_input = ''
- this.getData()
- },
- //分区
- handleZoneChange: function(index) {
- this.zone_selected = index
- this.$store.dispatch('SetZoneSelected', { zone_selected: index })
- this.search_keyword = this.search_input = ''
- this.getData()
- },
- getData(){
- let newobj = {
- cmd: "queue/join",
- data: {type:3,page:0,size:0},
- };
- this.websocketSend(newobj)
-
- let patientArr = []
- patientArr = JSON.parse(JSON.stringify(this.zone_schedules))
- // for (let i = 0; i < patientArr.length; i++) {
-
- // for (let j = 0; j < patientArr[i].schedules.length; j++) {
- // if (patientArr[i].schedules.length > 0 && patientArr[i].schedules[j].dialysis_order != null) {
- // // 删除元素后改变i的值
-
- // console.log("候诊区",patientArr[i].schedules[j])
- // patientArr[i].schedules.splice(j--, 1);
- // }
- // }
- // }
- let arr1 = []
- if(this.patientStateVal == 0){
- arr1 = patientArr
- }else if(this.patientStateVal == 1){
- let arr = []
- arr = patientArr
- for (let i = 0; i <arr.length; i++) {
- for (let j = 0; j < arr[i].schedules.length; j++) {
- if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis == null || (arr[i].schedules[j].assessment_before_dislysis.weight_before == '' && arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure == '' && arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure == ''))) {
- // 删除元素后改变i的值
- arr[i].schedules.splice(j--, 1);
- }
- }
- }
- console.log("执行1",arr)
- arr1 = arr
- }else if(this.patientStateVal == 2){
- let arr = []
- arr = patientArr
- for (let i = 0; i < arr.length; i++) {
- for (let j = 0; j < arr[i].schedules.length; j++) {
- if (arr[i].schedules.length > 0 && (arr[i].schedules[j].assessment_before_dislysis != null && (arr[i].schedules[j].assessment_before_dislysis.weight_before != 0 || arr[i].schedules[j].assessment_before_dislysis.diastolic_blood_pressure != 0 || arr[i].schedules[j].assessment_before_dislysis.systolic_blood_pressure != 0))) {
- // 删除元素后改变i的值
- console.log('几次')
- arr[i].schedules.splice(j--, 1);
- }
- }
- }
- console.log("执行2",arr)
- arr1 = arr
- }else if(this.patientStateVal == 3){
- let arr = []
- arr = patientArr
- for (let i = 0; i <arr.length; i++) {
- for (let j = 0; j < arr[i].schedules.length; j++) {
- if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order == null || (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 1))) {
- // 删除元素后改变i的值
- arr[i].schedules.splice(j--, 1);
- }
- }
- }
- console.log("执行1",arr)
- arr1 = arr
- }else if(this.patientStateVal == 4){
- let arr = []
- arr = patientArr
- for (let i = 0; i < arr.length; i++) {
- for (let j = 0; j < arr[i].schedules.length; j++) {
- if (arr[i].schedules.length > 0 && (arr[i].schedules[j].dialysis_order == null || (arr[i].schedules[j].dialysis_order != null && arr[i].schedules[j].dialysis_order.stage != 2))) {
- // 删除元素后改变i的值
- arr[i].schedules.splice(j--, 1);
- }
- }
- }
- console.log("执行2",arr)
- arr1 = arr
- }
-
- let arr2 = []
- if(this.treatStateVal == 0){
- arr2 = JSON.parse(JSON.stringify(arr1))
- }else if(this.treatStateVal == 1){
- let arr = []
- arr = JSON.parse(JSON.stringify(arr1))
- for (let i = 0; i < arr.length; i++) {
- for (let j = 0; j < arr[i].schedules.length; j++) {
- if (arr[i].schedules.length > 0 && (arr[i].schedules[j].prescription != null || arr[i].schedules[j].prescription != null ? arr[i].schedules[j].prescription.creater != 0 : false)) {
- // 删除元素后改变i的值
- arr[i].schedules.splice(j--, 1);
- }
- }
- }
- arr2 = arr
- }else if(this.treatStateVal == 2){
- let arr = []
- arr = JSON.parse(JSON.stringify(arr1))
- for (let i = 0; i < arr.length; i++) {
- for (let j = 0; j < arr[i].schedules.length; j++) {
- if (arr[i].schedules.length > 0 && arr[i].schedules[j].treatment_summary != null && arr[i].schedules[j].treatment_summary.dialysis_summary != '') {
- // 删除元素后改变i的值
- arr[i].schedules.splice(j--, 1);
- }
- }
- }
- arr2 = arr
- }else if(this.treatStateVal == 3){
- let arr = []
- arr = JSON.parse(JSON.stringify(arr1))
- for (let i = 0; i < arr.length; i++) {
- for (let j = 0; j < arr[i].schedules.length; j++) {
- if(arr[i].schedules[j].doctor_advice.length == 0){
- arr[i].schedules.splice(j--, 1)
- }
- if(arr[i].schedules && arr[i].schedules[j] && arr[i].schedules[j].doctor_advice){
- let sign = 0
- arr[i].schedules[j].doctor_advice.map(item => {
- if(item.check_state == 1){
- sign++
- }
- })
- if(sign == arr[i].schedules[j].doctor_advice.length && arr[i].schedules[j].doctor_advice.length > 0){
- arr[i].schedules.splice(j--, 1)
- }
- }
- }
- }
- arr2 = arr
- }
-
-
- let arr3 = []
- if(this.schedule_type_selected == 0){
- arr3 = JSON.parse(JSON.stringify(arr2))
- }else{
- let arr = []
- arr = JSON.parse(JSON.stringify(arr2))
- for (let i = 0; i < arr.length; i++) {
- for (let j = 0; j < arr[i].schedules.length; j++) {
- if (this.schedule_type_selected != arr[i].schedules[j].schedule_type) {
- // 删除元素后改变i的值
- arr[i].schedules.splice(j--, 1);
- }
- }
- }
- arr3 = arr
- }
-
-
- let arr4 = []
- if(this.zone_selected == 0){
- arr4 = JSON.parse(JSON.stringify(arr3))
- }else{
- let arr = []
- arr = JSON.parse(JSON.stringify(arr3))
- for (let i = 0; i < arr.length; i++) {
- if (this.zone_selected != arr[i].zone_id) {
- // 删除元素后改变i的值
- arr.splice(i--, 1);
- }
- }
- arr4 = arr
- }
-
-
- if(this.patientStateVal == 1){
- arr4.map((item,index) => {
- if(index != 0){
- arr4[0].schedules.push(...arr4[index].schedules)
- arr4[index].schedules = []
- }
- })
- arr4[0].schedules.map(item => {
- item.created_time = item.assessment_before_dislysis.created_time
- })
- arr4[0].schedules.sort(this.compare('created_time'))
- this.allPatient = arr4
- console.log("arr4",arr4)
- }else{
- this.allPatient = arr4
- }
- // let arr5 = JSON.parse(JSON.stringify(this.allPatient))
-
-
- // if(this.callVal == 1){
- // let arr = []
- // arr = JSON.parse(JSON.stringify(arr5))
- // for (let i = 0; i < arr.length; i++) {
- // for (let j = 0; j < arr[i].schedules.length; j++) {
- // // console.log(this.waitingCalled)
- // let a = []
- // this.waitingCalled.map(item => {
- // a.push(parseInt(item.patient_id))
- // })
- // console.log(6666666666,a)
- // console.log(2222,arr[i].schedules[j].patient_id)
- // if (a.indexOf(arr[i].schedules[j].patient_id) == -1) {
- // // 删除元素后改变i的值
- // console.log('下标值',a.indexOf(arr[i].schedules[j].patient_id))
- // arr[i].schedules.splice(j--, 1);
- // }
- // }
- // }
- // console.log('arr111111111111',arr)
- // }else if(this.callVal == 2) {
- // let arr = []
- // arr = JSON.parse(JSON.stringify(arr5))
- // for (let i = 0; i < arr.length; i++) {
- // for (let j = 0; j < arr[i].schedules.length; j++) {
- // // console.log(this.waitingCalled)
- // let a = []
- // this.called.map(item => {
- // a.push(parseInt(item.patient_id))
- // })
- // console.log(6666666666,a)
- // console.log(2222,arr[i].schedules[j].patient_id)
- // if (a.indexOf(arr[i].schedules[j].patient_id) == -1) {
- // // 删除元素后改变i的值
- // console.log('下标值',a.indexOf(arr[i].schedules[j].patient_id))
- // arr[i].schedules.splice(j--, 1);
- // }
- // }
- // }
- // console.log('arr222222222',arr)
- // }
-
-
- },
- compare(property){
- return function(a,b){
- var value1 = a[property];
- var value2 = b[property];
- return value1 - value2;
- }
- }
- }
- }
- </script>
-
- <style rel="stylesheet/scss" lang="scss" scoped>
- .app-container {
- // margin: 20px;
- font-size: 15px;
- .filter-container {
- padding-bottom: 5px;
- }
- .search-component {
- width: 500px;
- .searchBox {
- width: 300px;
- height: 36px;
- line-height: 36px;
- padding-left: 15px;
- border: 1px #dcdfe6 solid;
- border-right: none;
- outline: none;
- float: left;
- border-radius: 6px 0 0 6px;
- font-size: 14px;
- color: #333;
- background: #fff;
- box-shadow: 3px 3px 4px rgba(135, 135, 135, 0.05);
- }
- .searchBtn {
- background-color: #409eff;
- color: #fff;
- font-size: 15px;
- text-align: center;
- height: 36px;
- line-height: 36px;
- float: left;
- outline: none;
- width: 70px;
- border: none;
- border-radius: 0 6px 6px 0;
- font-family: "Microsoft Yahei";
- cursor: pointer;
- }
- }
-
- .amount {
- font-weight: normal;
- padding: 10px 0 0 0;
- color: #606266;
- font-size: 14px;
- span {
- color: #ef2525;
- font-family: "Arial";
- padding: 0 2px;
- }
- }
- }
- .PatientArea{
- .list{
- .title{
- font-size: 16px;
- color: #34495e;
- height:50px ;
- line-height: 50px;
- font-weight: bold;
- }
- }
- }
- .smallWidth{
- width:88%;
- }
- .nowCalling{
- height: 313px;
- border: 1px solid #e5e5ee;
- // flex: 1;
- width: 12%;
- text-align: center;
- .nowCallingTitle{
- font-size: 20px;
- font-weight: 600;
- margin-top: 20px;
- text-align: center;
- }
- .nowCallingName{
- color: #338AFB;
- font-size: 18px;
- margin-top: 10px;
- font-weight: 600;
- }
- .nowCallingTime{
- font-size: 16px;
- margin-top: 30px;
- }
- }
- </style>
-
|