From 583e1038163d7b95f7927f83b19d81f6eac32020 Mon Sep 17 00:00:00 2001 From: jazz <jazzxhunter@163.com> Date: 星期四, 28 十二月 2023 19:35:44 +0800 Subject: [PATCH] update_202312281935_单个治疗室多个客人的逻辑编写v1 --- src/components/xio_room_off_narcosis_notice/index.vue | 9 + static/imgs/cancel.png | 0 src/components/xio_room_guest_info_box/index.vue | 56 +++++++- src/components/xio_room_guest_box/index.vue | 2 src/pages/room/detail.vue | 293 ++++++++++++++++++++++++++++++++---------------- 5 files changed, 248 insertions(+), 112 deletions(-) diff --git a/src/components/xio_room_guest_box/index.vue b/src/components/xio_room_guest_box/index.vue index d6ae849..86cf0d9 100644 --- a/src/components/xio_room_guest_box/index.vue +++ b/src/components/xio_room_guest_box/index.vue @@ -17,7 +17,7 @@ <span class="tx flex-1 flex-1-w1 ell">{{ item.aDoctorName?item.aDoctorName+'(鍖荤敓)銆�':'' }}{{ item.aNurseName?item.aNurseName+'(鎶ゅ+)':'' }}</span> </div> <div class="guest_list__td flex flex-center"> - <div v-if="!item.act" class="tx" style="text-decoration: underline;color: #227beb;">鍒囨崲</div> + <div v-if="!item.act" class="tx" style="text-decoration: underline;color: #227beb;">閫夋嫨</div> <!-- <div class="icon"> <img class="img" src="static/imgs/choose.png"> </div> --> diff --git a/src/components/xio_room_guest_info_box/index.vue b/src/components/xio_room_guest_info_box/index.vue index 9f74b9f..c5d07fd 100644 --- a/src/components/xio_room_guest_info_box/index.vue +++ b/src/components/xio_room_guest_info_box/index.vue @@ -35,20 +35,27 @@ <div v-if="occupyInfoView.startTime" class="time">瀹夋帓娌荤枟鏃堕棿锛歿{ occupyInfoView.startTime }} 寮�濮�</div> </div> <div v-show="roomInfo" class="room_left_btn_box flex flex-ver" style="margin-top: 105px;"> - <div v-show="roomInfo.status == 0" class="room_left_btn_box__item flex flex-1 flex-center b-green btn_ani" @click="setStatus('鏁烽夯涓�', 4)">寮�濮嬫暦楹�</div> - <div v-show="roomInfo.status == 0" class="room_left_btn_box__item flex flex-1 flex-center green btn_ani" style="margin-right: 0;" @click="setStatus('浣跨敤涓�', 1)">寮�濮嬫不鐤�</div> - <div v-show="roomInfo.status == 4" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('浣跨敤涓�', 1)">寮�濮嬫不鐤�</div> - <div v-show="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow btn_ani" @click="setStatus('瀹汉浼戞伅', 2)">瀹汉浼戞伅</div> - <div v-show="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray btn_ani" style="margin-right: 0;" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> - <div v-show="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('鎵撴壂涓�', 3)">閫氱煡鎵撴壂</div> - <div v-show="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('绌洪棽', 0)">缁撴潫鎵撴壂</div> + <div v-show="roomInfo.status == 0" class="room_left_btn_box__item flex flex-1 flex-center b-green btn_ani" @click="setStatus('鏁烽夯涓�', 4, occupyInfoView)">寮�濮嬫暦楹�</div> + <div v-show="roomInfo.status == 0" class="room_left_btn_box__item flex flex-1 flex-center green btn_ani" style="margin-right: 0;" @click="setStatus('浣跨敤涓�', 1, occupyInfoView)">寮�濮嬫不鐤�</div> + <div v-show="roomInfo.status == 4" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('浣跨敤涓�', 1, occupyInfoView)">寮�濮嬫不鐤�</div> + <div v-show="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center yellow btn_ani" @click="setStatus('瀹汉浼戞伅', 2, occupyInfoView)">瀹汉浼戞伅</div> + <div v-show="roomInfo.status == 1" class="room_left_btn_box__item flex-1 flex flex-center gray btn_ani" style="margin-right: 0;" @click="setStatus('鎵撴壂涓�', 3, occupyInfoView)">閫氱煡鎵撴壂</div> + <div v-show="roomInfo.status == 2" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('鎵撴壂涓�', 3, occupyInfoView)">閫氱煡鎵撴壂</div> + <div v-show="roomInfo.status == 3" class="room_left_btn_box__item flex flex-center green btn_ani" @click="setStatus('绌洪棽', 0, occupyInfoView)">缁撴潫鎵撴壂</div> </div> + <!-- MIC閫氱煡鍗搁夯 --> + <XioRoomOffNarcosisNotice ref="XioRoomOffNarcosisNotice" @confirm="offNarcosisNoticeConfirm" /> </div> </template> <script> +// 閫氱煡鍗搁夯 +import XioRoomOffNarcosisNotice from '@/components/xio_room_off_narcosis_notice' export default { name: 'XioRoomStatusChg', + components: { + XioRoomOffNarcosisNotice + }, props: { roomInfo: { type: Object, @@ -61,6 +68,12 @@ default: () => { return {} } + }, + offNarcosisIds: { + type: Array, + default: () => { + return [] + } } }, data() { @@ -72,12 +85,36 @@ noop() { return }, + // 璁剧疆宸查�氱煡鍗搁夯id鏁扮粍 + setLocalStorageOffNarcosisIds() { + localStorage.setItem('offNarcosisIds', JSON.stringify(this.offNarcosisIds)) + }, + // 鍗搁夯閫氱煡纭 + offNarcosisNoticeConfirm() { + if (this.occupyInfoView) { + if (this.offNarcosisIds && this.offNarcosisIds.length) { + var flag = this.offNarcosisIds.find((o) => { return o === this.occupyInfoView.userId }) + if (!flag) { + this.offNarcosisIds.push(this.occupyInfoView.userId) + } + } else if (this.offNarcosisIds) { + this.offNarcosisIds.push(this.occupyInfoView.userId) + } + this.setLocalStorageOffNarcosisIds() + } + }, + // 鏄剧ず閫氱煡鍗搁夯寮圭獥 + showOffNarcosisNotice() { + // 鎵撳紑寮圭獥 + this.$refs['XioRoomOffNarcosisNotice'].showDialog() + this.$refs['XioRoomOffNarcosisNotice'].dataInit(this.occupyInfoView) + }, // 鐐瑰嚮鏄剧ず闅愯棌绉拌皳 tapAppellationHandle() { this.isShowAppellationName = !this.isShowAppellationName }, - setStatus(tx, status) { - this.$emit('setStatus', { tx, status }) + setStatus(tx, status, item) { + this.$emit('setStatus', { tx, status, item }) }, // 纭 confirm() { @@ -103,6 +140,7 @@ height: 100%; box-sizing: border-box; padding-top: 39px; + position: relative; } .guest_info_box .room_title { line-height: 50px; diff --git a/src/components/xio_room_off_narcosis_notice/index.vue b/src/components/xio_room_off_narcosis_notice/index.vue index f233407..cc70c4d 100644 --- a/src/components/xio_room_off_narcosis_notice/index.vue +++ b/src/components/xio_room_off_narcosis_notice/index.vue @@ -1,7 +1,7 @@ <template> <div v-if="isShow" class="mask" @click="hideDialog"> <div class="xio_room_status_chg_dialog" @click.stop="noop"> - <div class="title">MIC閫氱煡鍗搁夯锛�</div> + <div class="title">MIC閫氱煡{{ info.appellationName }}鍗搁夯锛�</div> <div class="btn_box flex flex-center"> <div class="btn_box_item flex flex-center" @click="confirm"> <div class="flex flex-ver"> @@ -24,7 +24,8 @@ }, data() { return { - isShow: false + isShow: false, + info: {} } }, methods: { @@ -40,6 +41,10 @@ showDialog() { this.isShow = true }, + // 鏁版嵁澶勭悊 + dataInit(data) { + this.info = { ...data } + }, // 鍏抽棴寮圭獥 hideDialog() { this.isShow = false diff --git a/src/pages/room/detail.vue b/src/pages/room/detail.vue index ee10f21..13df298 100644 --- a/src/pages/room/detail.vue +++ b/src/pages/room/detail.vue @@ -23,7 +23,7 @@ </div> <div class="page_header_placeholer" /> <!-- 鏈湁瀹夋帓 --> - <div v-if="!occupyInfoView && (!assignTreatListView || !assignTreatListView.length)" class="page_container flex flex-1"> + <div v-if="(!occupyInfoViewArr || !occupyInfoViewArr.length) && (!assignTreatListView || !assignTreatListView.length)" class="page_container flex flex-1"> <div class="main flex-1"> <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div> <div v-if="roomInfo" class="room_main_tip" style="margin-top: 93px;line-height: 186px;font-size: 140px;">-{{ statusTx[roomInfo.status] }}-</div> @@ -66,7 +66,7 @@ </div> </div> <!-- 娌℃湁瀹汉鍜屾湁瀹夋帓 --> - <div v-if="!occupyInfoView && (assignTreatListView && assignTreatListView.length)" class="page_container flex flex-1"> + <div v-if="(!occupyInfoViewArr || !occupyInfoViewArr.length) && (assignTreatListView && assignTreatListView.length)" class="page_container flex flex-1"> <div class="main flex-1"> <div v-if="roomInfo && roomInfo.roomNo" class="room_title">{{ roomInfo.roomNo }}</div> <div v-if="roomInfo" class="room_main_tip">-{{ statusTx[roomInfo.status] }}-</div> @@ -84,15 +84,20 @@ </div> </div> <!-- 瀹汉鍜屾湁瀹夋帓 over-width --> - <div v-if="occupyInfoView" class="page_container flex flex-1"> - <div class="main flex-1"> - <XioRoomGuestInfoBox ref="XioRoomGuestInfoBox" :room-info="roomInfo" :occupy-info-view="occupyInfoView" @setStatus="setComStatus" /> + <div v-if="occupyInfoViewArr && occupyInfoViewArr.length" class="page_container flex flex-1" :class="[occupyInfoViewArr && occupyInfoViewArr.length>1?'over-width':'']"> + <div class="flex flex-1"> + <div v-for="(item,index) in occupyInfoViewArr" :key="index" class="main flex-1"> + <div v-if="occupyInfoViewArr.length>1" class="cancel_icon_block" @click="cancelCustomerItem(item)"> + <img class="img" src="static/imgs/cancel.png"> + </div> + <XioRoomGuestInfoBox :ref="`XioRoomGuestInfoBox_${item.id}`" :room-info="roomInfo" :occupy-info-view="item" :off-narcosis-ids="offNarcosisIds" @setStatus="setComStatus" /> + </div> </div> <div class="right flex flex-col"> - <div class="flex-1"> - <XioRoomInfoBlock ref="XioRoomInfoBlock" :occupy-info-view="occupyInfoView" /> + <div v-for="(item,index) in occupyInfoViewArr" :key="index" class="flex-1 right_room_info"> + <XioRoomInfoBlock ref="XioRoomInfoBlock" :occupy-info-view="item" /> </div> - <div class="flex flex-col" style="border-radius: 10px;"> + <div v-if="occupyInfoViewArr.length<=1" class="flex flex-col" style="border-radius: 10px;"> <XioRoomGuestBox ref="XioRoomGuestBox" :assign-treat-list-view-com="assignTreatListView" @selectCustomer="selectCustomer" /> </div> </div> @@ -102,7 +107,7 @@ <!-- 鏇存敼鎴块棿鐘舵�佺獥 --> <XioRoomStatusChg ref="XioRoomStatusChg" @changeStatus="changeStatus" /> <!-- MIC閫氱煡鍗搁夯 --> - <XioRoomOffNarcosisNotice ref="XioRoomOffNarcosisNotice" @confirm="offNarcosisNoticeConfirm" /> + <!-- <XioRoomOffNarcosisNotice ref="XioRoomOffNarcosisNotice" @confirm="offNarcosisNoticeConfirm" /> --> </div> </template> @@ -123,13 +128,11 @@ // 鏇存敼鎴块棿鐘舵�佺獥 import XioRoomStatusChg from '@/components/xio_room_status_chg' // 閫氱煡鍗搁夯 -import XioRoomOffNarcosisNotice from '@/components/xio_room_off_narcosis_notice' +// import XioRoomOffNarcosisNotice from '@/components/xio_room_off_narcosis_notice' import Req from '../../utils/jun_httpInstall' // http 璇锋眰 // import xioFn from './utils/xio_fn.js' var isUseDefault = false // 鏄惁宸蹭娇鐢ㄩ粯璁ゅ浜� var isUseDefaultChg = 0// 宸蹭娇鐢ㄩ粯璁ゅ浜哄悗鎴块棿鏄惁鏈夋敼鍙樼姸鎬� -var offNarcosisIds = [] // 鏄惁宸查�氱煡鍗搁夯id鏁扮粍 -var isOffNarcosisShow = false // 鏄惁鏄剧ず宸查�氱煡鍗搁夯寮圭獥 export default { name: 'RoomDetail', components: { @@ -137,8 +140,8 @@ XioRoomInfoBlock, XioRoomGuestBox, XioCustomerSelect, - XioRoomStatusChg, - XioRoomOffNarcosisNotice + XioRoomStatusChg + // XioRoomOffNarcosisNotice }, inject: ['noop'], data() { @@ -150,17 +153,20 @@ statusTx: ['绌洪棽', '浣跨敤涓�', '瀹汉浼戞伅', '鎵撴壂涓�', '鏁烽夯涓�'], timeObj: {}, // week锛氭槦鏈燂紝date锛氬勾鏈堟棩锛宼imeMin锛氭椂鍒嗭紝time锛氭椂鍒嗙锛宼imeStamp锛氭椂闂存埑 curTreatId: '', - curTreatIds: '' + curTreatIds: '', // 宸查�変腑鐨勬不鐤楄褰昳d鏁扮粍 + offNarcosisIds: [] // 鏄惁宸查�氱煡鍗搁夯鐨勭敤鎴穒d鏁扮粍 // isShowAppellationName: true // 鏄惁鏄剧ず绉拌皳 } }, - // todo 椤甸潰鏄剧ず鍙婃暟缁勫鐞� computed: { + // 褰撳墠宸查�夋嫨鐢ㄦ埛鐨勬暟缁勬暟鎹� occupyInfoViewArr() { // 缂撳瓨璁板綍 - if (this.curTreatIds) { + if (this.curTreatIds && this.curTreatIds.length) { + // todo 瀛樺湪缂撳瓨涓斿瓨鍦ㄥ崰鐢ㄦ暟鎹殑鏃跺�欙紝鏍规嵁鍚庣杩斿洖鍐嶈ˉ鍏呴�昏緫 return this.getCurTreatArr(this.curTreatIds) } else { + // todo 瀛樺湪鍗犵敤鏁版嵁鐨勬椂鍊欙紝鏍规嵁鍚庣杩斿洖鍐嶈ˉ鍏呴�昏緫 if (this.occupyInfo) { this.occupyInfoViewArrIdsHandle(this.occupyInfo) return [this.occupyInfo] @@ -175,8 +181,9 @@ } } }, + // 褰撳墠宸查�夋嫨鐢ㄦ埛鐨勬暟鎹紙鍗曚釜锛夛紙鏆傛棤鐢級 occupyInfoView() { - console.log('00000000000000000000000', this.occupyInfo, isUseDefault, isUseDefaultChg) + // console.log('00000000000000000000000', this.occupyInfo, isUseDefault, isUseDefaultChg) // 鏈夊綋鍓嶉�変腑鐨勶紝鏍规嵁闇�姹備慨鏀瑰鍔犻�変腑涓嶆洿鏀圭姸鎬侊紝鐢辩┖闂插紑濮� if (this.curTreatId) { return this.gatCurTreatInfo() @@ -197,12 +204,16 @@ } } }, + // 璇ユ不鐤楀鐢ㄦ埛鍒楄〃 assignTreatListView() { if (this.assignTreatList && this.assignTreatList.length) { this.assignTreatList.forEach((o) => { - o.act = false - if (this.occupyInfoView && this.occupyInfoView.id === o.id) { - o.act = true + if (this.occupyInfoViewArr && this.occupyInfoViewArr.length) { + this.occupyInfoViewArr.forEach((_o) => { + if (_o.id === o.id) { + o.act = true + } + }) } }) return this.assignTreatList @@ -214,23 +225,19 @@ activated() { console.log('roomDetail mounted') // 璁板綍褰撳墠鐨勬不鐤桰D - var curTreatId = localStorage.getItem('curTreatId') - // 璁板綍褰撳墠鐨勬不鐤桰D鏁扮粍 + // var curTreatId = localStorage.getItem('curTreatId') + // 璁板綍褰撳墠鐨勬不鐤楄褰旾D鏁扮粍 var curTreatIds = localStorage.getItem('curTreatIds') // 鍗搁夯鐩稿叧 var localOffNarcosisIds = localStorage.getItem('offNarcosisIds') - var localIsOffNarcosisShow = localStorage.getItem('isOffNarcosisShow') // 鑾峰彇鏄惁宸查�氱煡鍗搁夯鏁扮粍 if (localOffNarcosisIds) { - offNarcosisIds = JSON.parse(localOffNarcosisIds) + this.offNarcosisIds = JSON.parse(localOffNarcosisIds) } else { - offNarcosisIds = [] + this.offNarcosisIds = [] this.setLocalStorageOffNarcosisIds() } - if (localIsOffNarcosisShow) { - isOffNarcosisShow = localIsOffNarcosisShow - } - // 鏁扮粍 + // 娌荤枟璁板綍ID鏁扮粍 if (curTreatIds) { try { this.curTreatIds = JSON.parse(curTreatIds) @@ -238,7 +245,8 @@ this.curTreatIds = '' } } - this.curTreatId = curTreatId || '' + // this.curTreatId = curTreatId || '' + // 娌荤枟瀹d this.id = this.$route.query.id || '' this.init() }, @@ -257,7 +265,7 @@ this.pollingAjaxFn(this, 'getData', 'detail', 8000) // this.getData() }, - // 鍒濆鍗犵敤id鏁扮粍澶勭悊 + // 鍒濆榛樿閫夋嫨鐨刬d鏁扮粍澶勭悊 occupyInfoViewArrIdsHandle(item) { if (!this.curTreatIds) { this.curTreatIds = [] @@ -267,28 +275,33 @@ }, // 璁剧疆宸查�氱煡鍗搁夯id鏁扮粍 setLocalStorageOffNarcosisIds() { - localStorage.setItem('offNarcosisIds', JSON.stringify(offNarcosisIds)) + localStorage.setItem('offNarcosisIds', JSON.stringify(this.offNarcosisIds)) }, // 鍗搁夯閫氱煡纭 - offNarcosisNoticeConfirm() { - if (this.occupyInfoView) { - if (offNarcosisIds && offNarcosisIds.length) { - var flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.userId }) - if (!flag) { - offNarcosisIds.push(this.occupyInfoView.userId) - } - } else if (offNarcosisIds) { - offNarcosisIds.push(this.occupyInfoView.userId) - } - this.setLocalStorageOffNarcosisIds() - } - isOffNarcosisShow = true - localStorage.setItem('isOffNarcosisShow', true) - }, - // 鏄剧ず閫氱煡鍗搁夯寮圭獥 - showOffNarcosisNotice() { - // 鎵撳紑寮圭獥 - this.$refs['XioRoomOffNarcosisNotice'].showDialog() + // offNarcosisNoticeConfirm() { + // if (this.occupyInfoView) { + // if (offNarcosisIds && offNarcosisIds.length) { + // var flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.userId }) + // if (!flag) { + // offNarcosisIds.push(this.occupyInfoView.userId) + // } + // } else if (offNarcosisIds) { + // offNarcosisIds.push(this.occupyInfoView.userId) + // } + // this.setLocalStorageOffNarcosisIds() + // } + // }, + // // 鏄剧ず閫氱煡鍗搁夯寮圭獥 + // showOffNarcosisNotice() { + // // 鎵撳紑寮圭獥 + // this.$refs['XioRoomOffNarcosisNotice'].showDialog() + // }, + // 鏄剧ず閫氱煡鍗搁夯寮圭獥锛堝涓級 + showOffNarcosisNoticeMulti(id) { + // 鎵撳紑寮圭獥锛屽姩鎬佺殑ref瀵硅薄鑾峰彇 + // eslint-disable-next-line no-eval + var ref = eval('this.$refs.XioRoomGuestInfoBox_' + id)[0] + ref.showOffNarcosisNotice() }, // 鐐瑰嚮鏄剧ず闅愯棌绉拌皳 // tapAppellationHandle() { @@ -346,7 +359,7 @@ startTime: '2023-12-08 00:00:00', userName: '榛勫槈鑽�', gender: 1, - hempStatus: 0, + hempStatus: 2, ciq: '123', adviserName: 'a鍚�', aDoctorName: 'b鍚�', @@ -359,7 +372,7 @@ startTime: '2023-12-08 00:15:00', userName: '鏉庡痉鍗�', gender: 1, - hempStatus: 0, + hempStatus: 2, ciq: '456', adviserName: 'd鍚�', aDoctorName: 'e鍚�', @@ -372,7 +385,7 @@ startTime: '2023-12-08 00:20:00', userName: '鐚涘鍙�', gender: 2, - hempStatus: 0, + hempStatus: 2, ciq: '789', adviserName: 'g鍚�', aDoctorName: 'h鍚�', @@ -386,22 +399,23 @@ } }).then((res) => { if (res && res.data) { - // 娌荤枟鏃堕棿澶勭悊 if (res.data.assignTreatList && res.data.assignTreatList.length) { res.data.assignTreatList.forEach((o) => { + // 娌荤枟鏃堕棿澶勭悊 var st = (o.startTime).split(' ')[1].split(':') o.startTime = `${st[0]}:${st[1]}` + // 绉拌皳澶勭悊 o.appellationName = o.userName[0] + `${o.gender ? ['濂冲+', '鍏堢敓', '濂冲+'][o.gender] : '濂冲+'}` }) } - // 宸插崰鐢ㄧ敤鎴锋暟鎹鐞� + // todo 宸插崰鐢ㄧ敤鎴锋暟鎹鐞嗭紝寰呭悗绔慨鏀瑰啀澶勭悊 if (res.data.occupyInfo && res.data.occupyInfo.userName) { res.data.occupyInfo.appellationName = res.data.occupyInfo.userName[0] + `${res.data.occupyInfo.gender ? ['濂冲+', '鍏堢敓', '濂冲+'][res.data.occupyInfo.gender] : '濂冲+'}` } - // 宸叉湁鍗犵敤鐨勶紝鏇存敼宸蹭娇鐢ㄩ粯璁ゅ浜虹殑鐘舵�� + // todo 宸叉湁鍗犵敤鐨勶紝鏇存敼宸蹭娇鐢ㄩ粯璁ゅ浜虹殑鐘舵�� res.data.occupyInfo && (isUseDefaultChg = 1) res.data.occupyInfo && (isUseDefault = 1) - // 鍗犵敤淇℃伅娌荤枟鏃堕棿澶勭悊 + // todo 鍗犵敤淇℃伅娌荤枟鏃堕棿澶勭悊 if (res.data.occupyInfo && res.data.occupyInfo.startTime) { var ost = (res.data.occupyInfo.startTime).split(' ')[1].split(':') res.data.occupyInfo.startTime = `${ost[0]}:${ost[1]}` @@ -411,16 +425,21 @@ } } // console.log('999999999999999999999999999', res) + // 鍗搁夯寮圭獥閫昏緫 var offNarcosisTimer = null offNarcosisTimer = setTimeout(() => { - console.log('================================>', this.occupyInfoView, 'offNarcosisIds:', offNarcosisIds, 'isOffNarcosisShow:', isOffNarcosisShow) - if (this.occupyInfoView && this.occupyInfoView.hempStatus === 2 && this.occupyInfoView.userId) { - var flag - offNarcosisIds && offNarcosisIds.length && (flag = offNarcosisIds.find((o) => { return o === this.occupyInfoView.userId })) - // flag = isOffNarcosisShow - if (!flag) { - this.showOffNarcosisNotice() - } + console.log('================================>鍒ゆ柇鍗搁夯寮圭獥', this.occupyInfoViewArr, 'offNarcosisIds:', this.offNarcosisIds) + if (this.occupyInfoViewArr && this.occupyInfoViewArr.length && this.offNarcosisIds) { + this.occupyInfoViewArr.forEach((o) => { + // 鍒ゆ柇鏀圭敤鎴锋槸鍚﹀脊鍑鸿繃鍗搁夯寮圭獥 + var flag + flag = this.offNarcosisIds.find((_o) => { return _o === o.userId }) + // 鐘舵��2涓旀病鏈夊脊鍑鸿繃寮圭獥 + if (o.hempStatus === 2 && !flag) { + // 寮瑰嚭瀵瑰簲id寮圭獥 + this.showOffNarcosisNoticeMulti(o.id) + } + }) } clearTimeout(offNarcosisTimer) offNarcosisTimer = null @@ -449,29 +468,29 @@ // 鏈湁瀹夋帓鐩存帴鐘舵�佸彉鏇� statusChg(e) { var { tx, status } = e.currentTarget.dataset - var { occupyInfoView, roomInfo } = this - console.log(tx, status) + // var { occupyInfoView, roomInfo } = this + console.log('==========================>娌℃湁瀹夋帓鏃舵病鏈夊浜虹洿鎺ュ彉鏇寸姸鎬�', tx, status) // if (roomInfo && status * 1 == roomInfo.status) { // return // } - this.changeStatusFn(occupyInfoView, status, () => { + this.changeStatusFn({}, status, () => { this.getData() }) }, - // 鎸夋祦绋嬭缃埧闂寸姸鎬� + // 娌℃湁瀹汉鐨勬寜娴佺▼璁剧疆鎴块棿鐘舵�� setStatus(tx, status) { - var { occupyInfoView, roomInfo } = this - console.log(tx, status) - this.changeStatusFn(occupyInfoView, status, () => { + // var { occupyInfoView, roomInfo } = this + console.log('============================>鏈夊畨鎺掓病鏈夊浜鸿缃埧闂寸姸鎬�', tx, status) + this.changeStatusFn({}, status, () => { // 鍒锋柊璇︽儏 this.getData() }) }, - // 鎸夋祦绋嬭缃埧闂寸姸鎬� + // 鎸夋祦绋嬭缃埧闂寸姸鎬侊紙缁勪欢锛� setComStatus(opt) { - var { occupyInfoView, roomInfo } = this - console.log(opt.tx, opt.status) - this.changeStatusFn(occupyInfoView, opt.status, () => { + // var { occupyInfoView, roomInfo } = this + console.log('============================>瀹汉淇℃伅缁勪欢鐐瑰嚮鏇存敼鐘舵��', opt.tx, opt.status, opt.item) + this.changeStatusFn(opt.item, opt.status, () => { // 鍒锋柊璇︽儏 this.getData() }) @@ -505,18 +524,24 @@ isUseDefaultChg = 1 } // 褰撳墠閫変腑鐨勭敤鎴锋埧闂存洿鏀逛簡鐘舵�侊紝宸茬粡鎴愪负鍗犵敤鏃讹紝娓呴櫎閫変腑鍖荤枟璁板綍id - if (item && item.id && item.id === this.curTreatId) { - console.log('褰撳墠閫変腑鐨勭敤鎴锋埧闂存洿鏀逛簡鐘舵�侊紝宸茬粡鎴愪负鍗犵敤鏃讹紝娓呴櫎閫変腑鍖荤枟璁板綍id') - localStorage.removeItem('curTreatId') - this.curTreatId = '' - } + // if (item && item.id && item.id === this.curTreatId) { + // console.log('褰撳墠閫変腑鐨勭敤鎴锋埧闂存洿鏀逛簡鐘舵�侊紝宸茬粡鎴愪负鍗犵敤鏃讹紝娓呴櫎閫変腑鍖荤枟璁板綍id') + // localStorage.removeItem('curTreatId') + // this.curTreatId = '' + // } // 鍙鏇存敼涓虹┖闂插氨閲嶇疆鍙傛暟 if (status === 0) { - console.log('鏇存敼涓虹┖闂�') + console.log('鎴块棿鏇存敼涓虹┖闂�') // 閲嶇疆榛樿宸蹭娇鐢ㄥ浜虹殑鍙傛暟 isUseDefault = false isUseDefaultChg = 0 // this.isShowAppellationName = true + } + // todo 鐢ㄦ埛缁撴潫娌荤枟鍚庯紝灏嗗叾浠庣紦瀛樹腑鍒犻櫎, 寰呮祴璇� + if (item && item.id && this.curTreatIds && this.curTreatIds.length && status === 0) { + console.log('褰撳墠鐢ㄦ埛鎵�鍦ㄦ埧闂存洿鏀逛簡鐘舵�佷负缁撴潫锛屾竻闄ゅ綋鍓嶇殑鍖荤枟璁板綍id') + // 褰撳墠閫夋嫨瀹㈡埛鐨勬暟缁勫垹闄ゅ鎴� + this.occupyInfoViewArrDataHandle('cancel', item) } // console.log('8888888888888888888888888888888888', res) cb && cb() @@ -529,14 +554,18 @@ }, // 鏇存敼鎴块棿鐘舵�侊紙閲嶇疆鐘舵�佺殑鏇存敼鏂规硶锛� changeStatus(opt) { - var { occupyInfoView, roomInfo } = this - console.log(opt.statusTx, opt.status) + // var { occupyInfoView, roomInfo } = this + console.log('============================>閲嶇疆鎴块棿鐘舵��', opt.statusTx, opt.status) // if (roomInfo && opt.status * 1 == roomInfo.status) { // return // } // 娓呴櫎閫変腑鍖荤枟璁板綍id - localStorage.removeItem('curTreatId') - this.curTreatId = '' + // localStorage.removeItem('curTreatId') + // this.curTreatId = '' + // 娓呴櫎閫変腑鍖荤枟璁板綍ids鏁扮粍 + localStorage.removeItem('curTreatIds') + this.curTreatIds = '' + // 鍙樻洿鎴块棿鐘舵�佹柟娉� this.changeStatusFn({}, opt.status, () => { // 鍒锋柊璇︽儏 this.getData() @@ -563,18 +592,10 @@ selectCustomerSubmit(opt) { console.log('=======================>submit', opt) // 纭畾閫夋嫨鐨勭敤鎴凤紝璁板綍id - localStorage.setItem('curTreatId', opt.id) - this.curTreatId = opt.id - if (this.curTreatIds && this.curTreatIds.length) { - var flag = this.curTreatIds.find((o) => { return o === opt.id }) - if (!flag) { - this.curTreatIds.push(opt.id) - } - this.setLocalCurTreatIds() - } - if (this.occupyInfoViewArr && this.occupyInfoViewArr.length) { - this.occupyInfoViewArr.push(opt) - } + // localStorage.setItem('curTreatId', opt.id) + // this.curTreatId = opt.id + // 褰撳墠閫夋嫨瀹㈡埛鐨勬暟缁勫鍔犲鎴� + this.occupyInfoViewArrDataHandle('add', opt) // 閲嶇疆鎴块棿鐘舵�� if (this.roomInfo) { this.changeStatusFn({}, 0, () => { @@ -584,6 +605,53 @@ } // 鍏抽棴寮圭獥 this.$refs['XioCustomerSelect'].hideDialog() + }, + // 鍒犻櫎宸查�夋嫨鐨勫鎴锋暟鎹� + cancelCustomerItem(item) { + // 褰撳墠閫夋嫨瀹㈡埛鐨勬暟缁勫垹闄ゅ鎴� + this.occupyInfoViewArrDataHandle('cancel', item, true) + }, + // 褰撳墠閫夋嫨瀹㈡埛鐨勬暟缁勫鍒犲鐞嗘柟娉� + occupyInfoViewArrDataHandle(key, item, isReset) { + // 澧炲姞锛堥�夋嫨锛� + if (key === 'add') { + // id鏁扮粍澶勭悊 + if (this.curTreatIds && this.curTreatIds.length) { + // 褰撳墠娌荤枟璁板綍id娌℃湁鎵�閫夌敤鎴风殑娌荤枟璁板綍id + var flag = this.curTreatIds.find((o) => { return o === item.id }) + if (!flag) { + this.curTreatIds.push(item.id) + } + // 缂撳瓨 + this.setLocalCurTreatIds() + } + // 鏁扮粍鏁版嵁澶勭悊 + // if (this.occupyInfoViewArr && this.occupyInfoViewArr.length) { + // this.occupyInfoViewArr.push(item) + // } + } + // 鍒犻櫎 + if (key === 'cancel') { + // id鏁扮粍澶勭悊 + if (this.curTreatIds && this.curTreatIds.length) { + // 娣卞鍒� + var ids = JSON.parse(JSON.stringify(this.curTreatIds)) + this.curTreatIds = ids.filter((o) => { return o !== item.id }) + // 缂撳瓨 + this.setLocalCurTreatIds() + // 鍒锋柊 + if (isReset) { + // 鍒锋柊璇︽儏 + this.getData() + } + } + // 鏁扮粍鏁版嵁澶勭悊 + // if (this.occupyInfoViewArr && this.occupyInfoViewArr.length) { + // // 娣卞鍒� + // var arr = JSON.parse(JSON.stringify(this.occupyInfoViewArr)) + // this.occupyInfoViewArr = arr.filter((o) => { o.id !== item.id }) + // } + } }, // 璁剧疆鏈湴缂撳瓨ids鏁扮粍 setLocalCurTreatIds() { @@ -639,6 +707,25 @@ font-size: 14px; /* text-align: center; */ font-family: Roboto; + position: relative; +} +.page_container.over-width .main { + margin-right: 50px; +} +.page_container.over-width .main:last-child { + margin-right: 0; +} +.page_container .main .cancel_icon_block { + width: 50px; + height: 50px; + position: absolute; + top: 12px; + right: 11px; + z-index: 1; +} +.page_container .main .cancel_icon_block .img { + width: 100%; + height: 100%; } .page_container .main .room_title { line-height: 50px; @@ -808,6 +895,12 @@ margin-left: 30px; /* height: 100%; */ } +.page_container.over-width .right_room_info { + margin-bottom: 58px; +} +.page_container.over-width .right_room_info:last-child { + margin-bottom: 0; +} .page_container .right_block { width: 100%; height: 100%; diff --git a/static/imgs/cancel.png b/static/imgs/cancel.png new file mode 100644 index 0000000..ee7220e --- /dev/null +++ b/static/imgs/cancel.png Binary files differ -- Gitblit v1.8.0