提交 ef401584 编写于 作者: xiaoping.di's avatar xiaoping.di

xiugai

上级 643377fe
import { teamDetail, callDirect } from '@/api/diagnosis'; import { teamDetail, callDirect } from '@/api/diagnosis';
import { import { waitPersonNum, manualCall } from '@/api/workbench.js';
waitPersonNum,
doctorAdviceList,
manualCall,
} from '@/api/workbench.js';
import { createNamespacedHelpers } from 'vuex'; import { createNamespacedHelpers } from 'vuex';
const { mapState } = createNamespacedHelpers('main'); const { mapState } = createNamespacedHelpers('main');
let clipboard = null;
export default { export default {
props: { props: {
item: { item: {
...@@ -48,7 +45,6 @@ export default { ...@@ -48,7 +45,6 @@ export default {
computed: { computed: {
...mapState({ ...mapState({
showChat: (state) => state.showChat, showChat: (state) => state.showChat,
showAdvice: (state) => state.showAdvice,
}), }),
doctorCallStatus() { doctorCallStatus() {
switch (this.item.doctorCallStatus) { switch (this.item.doctorCallStatus) {
...@@ -60,6 +56,8 @@ export default { ...@@ -60,6 +56,8 @@ export default {
return '被挂断'; return '被挂断';
case 4: case 4:
return '已拨打完成'; return '已拨打完成';
case 5:
return '电话呼叫中';
default: default:
return ''; return '';
} }
...@@ -78,30 +76,6 @@ export default { ...@@ -78,30 +76,6 @@ export default {
return ''; return '';
} }
}, },
diagnoseType() {
switch (this.item.diagnoseType) {
case 1:
return '语音问诊';
case 2:
return '视频问诊';
case 3:
return '图文问诊';
default:
return '';
}
},
diagnoseTypeIcon() {
switch (this.item.diagnoseType) {
case 1:
return 'voice';
case 2:
return 'voice';
case 3:
return 'photo';
default:
return 'photo';
}
},
appointBeginTime() { appointBeginTime() {
if (this.item.appointBeginTime) { if (this.item.appointBeginTime) {
return new Date(this.item.appointBeginTime).format('hh:mm'); return new Date(this.item.appointBeginTime).format('hh:mm');
...@@ -116,28 +90,18 @@ export default { ...@@ -116,28 +90,18 @@ export default {
return ''; return '';
} }
}, },
userCallTime() { // 基层医生上次呼叫医助时间
return new Date(this.item.userCallTime).format('hh:mm'); userLastCallTime() {
}, if (this.item.userLastCallTime) {
// 助诊呼叫状态 return new Date(this.item.userLastCallTime).getTime();
userCallKfStatus() { } else {
return this.item.userCallKfStatus; return null;
}, }
// 接诊呼叫状态
doctorCallKfStatus() {
return this.item.doctorCallKfStatus;
},
// 接诊 在线状态
doctorTrtcEntryStatus() {
return this.item.doctorTrtcEntryStatus;
},
// 助诊 在线状态
userTrtcEntryStatus() {
return this.item.userTrtcEntryStatus;
}, },
pastUserCallTime() { // 上级医生上一次呼叫医助时间
if (this.item.userCallTime) { doctorLastCallTime() {
return this.formatDateData(this.item.userCallTime); if (this.item.doctorLastCallTime) {
return this.formatDateData(this.item.doctorLastCallTime);
} else { } else {
return null; return null;
} }
...@@ -161,12 +125,6 @@ export default { ...@@ -161,12 +125,6 @@ export default {
console.log(newVal, 'newValnewValnewVal'); console.log(newVal, 'newValnewValnewVal');
console.log(newVal, oldVal, 'newVal, oldVal'); console.log(newVal, oldVal, 'newVal, oldVal');
if (newVal !== oldVal) { if (newVal !== oldVal) {
if (newVal.doctorTrtcEntryStatus == 2) {
this.isDoctorChat = false;
}
if (newVal.userTrtcEntryStatus == 2) {
this.isUserChat = false;
}
if (newVal.doctorCallStatus !== oldVal.doctorCallStatus) { if (newVal.doctorCallStatus !== oldVal.doctorCallStatus) {
this.isManuacall = false; this.isManuacall = false;
} }
...@@ -180,18 +138,7 @@ export default { ...@@ -180,18 +138,7 @@ export default {
}, },
}, },
created() {}, created() {},
mounted() { mounted() {},
if (this.item.returnStatus == 1 || this.item.returnStatus == 3) {
const nowData = new Date().getTime();
const timeleft = this.item.appointBeginTime - nowData;
if (timeleft < 120000 && nowData < this.item.appointEndTime) {
clearInterval(this.timer);
this.down();
} else {
this.isCall = true;
}
}
},
methods: { methods: {
manualDialing(type) { manualDialing(type) {
if (this.doctorCallKfStatus === 1) { if (this.doctorCallKfStatus === 1) {
...@@ -244,7 +191,7 @@ export default { ...@@ -244,7 +191,7 @@ export default {
}, },
formatDateData(time) { formatDateData(time) {
const now_data = new Date().getTime(); const now_data = new Date().getTime();
const my_time = now_data - time; const my_time = now_data - new Date(time).getTime();
const hours = my_time / 1000 / 60 / 60; const hours = my_time / 1000 / 60 / 60;
const hoursRound = Math.floor(hours); const hoursRound = Math.floor(hours);
const minutes = my_time / 1000 / 60 - 60 * hoursRound; const minutes = my_time / 1000 / 60 - 60 * hoursRound;
...@@ -259,7 +206,7 @@ export default { ...@@ -259,7 +206,7 @@ export default {
return hoursRound + '小时' + minutesRound + '分' + seconds + '秒'; return hoursRound + '小时' + minutesRound + '分' + seconds + '秒';
} }
if (hoursRound == 0 && minutesRound > 0) { if (hoursRound == 0 && minutesRound > 0) {
return minutesRound + '分'; return minutesRound + '分';
} }
if (hoursRound == 0 && minutesRound == 0) { if (hoursRound == 0 && minutesRound == 0) {
return seconds + '秒'; return seconds + '秒';
...@@ -335,35 +282,6 @@ export default { ...@@ -335,35 +282,6 @@ export default {
const i = this.item; const i = this.item;
this.$store.dispatch('main/gotoInquiry', i); this.$store.dispatch('main/gotoInquiry', i);
}, },
openAdvice() {
if (this.showAdvice) {
this.$message({
message: '不可同时打开多个诊断建议,请先退出已打开的诊断建议,再试。',
type: 'warning',
duration: 1000,
});
return false;
}
// const i = 11;
doctorAdviceList({
diagnoseLogId: this.item.diagnoseLogId,
})
.then((res) => {
if (res.code == '000000') {
this.$store.commit('main/updateShowAdvice', true);
this.$store.commit('main/updateCurrentAdvice', res.data);
} else {
this.$message({
message: res.message,
type: 'warning',
duration: 1000,
});
}
})
.catch((err) => {
console.log(err);
});
},
waitPersonFun() { waitPersonFun() {
if (!this.isShowWait) { if (!this.isShowWait) {
console.log(this.item.doctorId, 'this.item.doctorId'); console.log(this.item.doctorId, 'this.item.doctorId');
...@@ -391,5 +309,19 @@ export default { ...@@ -391,5 +309,19 @@ export default {
}); });
} }
}, },
// 粘帖文本
clipboardAction() {
const _this = this;
console.log(11);
clipboard && clipboard.destroy(); // 不是单例的,所以每次都要销毁
clipboard = new this.ClipboardJS('.copy-orderId', {
// .footer:文档的CSS类名
text: function () {
console.log(_this.item.diagnoseLogId);
_this.$message.success('复制成功');
return _this.item.diagnoseLogId; // 要粘贴的文案
},
});
},
}, },
}; };
...@@ -58,9 +58,19 @@ ...@@ -58,9 +58,19 @@
height: 40px; height: 40px;
.offline { .offline {
position: absolute; position: absolute;
left: -4px; left: 1px;
top: -4px; top: 0px;
z-index: 10; z-index: 10;
img {
width: 10px;
height: auto;
}
}
.online {
width: 10px;
height: 10px;
background: #0d9078;
border-radius: 50%;
} }
.avatar { .avatar {
position: absolute; position: absolute;
...@@ -145,7 +155,24 @@ ...@@ -145,7 +155,24 @@
justify-content: flex-start; justify-content: flex-start;
.basic-user-img, .basic-user-img,
.basic-user-info { .basic-user-info {
position: relative;
padding-right: 6px; padding-right: 6px;
.offline {
position: absolute;
left: 1px;
top: 0px;
z-index: 10;
img {
width: 10px;
height: auto;
}
}
.online {
width: 10px;
height: 10px;
background: #0d9078;
border-radius: 50%;
}
.info-name-wrap { .info-name-wrap {
display: flex; display: flex;
align-items: center; align-items: center;
......
...@@ -5,20 +5,17 @@ ...@@ -5,20 +5,17 @@
<div class="superior-doctor"> <div class="superior-doctor">
<div class="inquiry-user-img"> <div class="inquiry-user-img">
<div <div
v-if="
diagnoseTypeIcon == 'voice' &&
(item.returnStatus == 1 || item.returnStatus == 3) &&
doctorTrtcEntryStatus != 1
"
class="offline" class="offline"
:class="{ online: item.doctorOnlineStatus == 2 }"
> >
<img <img
v-if="item.doctorOnlineStatus == 3"
:src="offline" :src="offline"
alt="" alt=""
> >
</div> </div>
<div class="avatar"> <div class="avatar">
<el-avatar :src="item.doctorImageUrl" /> <el-avatar :src="item.doctorImageUrl || ''" />
</div> </div>
</div> </div>
<div class="inquiry-user-info"> <div class="inquiry-user-info">
...@@ -35,6 +32,7 @@ ...@@ -35,6 +32,7 @@
<li class="inquiry-user-status"> <li class="inquiry-user-status">
<!-- 只有--> <!-- 只有-->
<span <span
v-if="item.userId"
:class=" :class="
doctorCallStatus === '已拨打完成' doctorCallStatus === '已拨打完成'
? 'status-cll-user-finish' ? 'status-cll-user-finish'
...@@ -42,13 +40,14 @@ ...@@ -42,13 +40,14 @@
" "
>{{ doctorCallStatus }}</span> >{{ doctorCallStatus }}</span>
<span <span
v-if="doctorCallKfStatus == 1" v-if="item.doctorCallKfStatus == 1"
class="status-cll-user-answer" class="status-cll-user-answer"
>正在呼叫</span> >正在呼叫</span>
<span <span
v-else v-else
class="status-cll-user-answer" class="status-cll-user-answer"
> 未呼叫</span> >
{{ doctorLastCallTime }}前呼叫医助</span>
</li> </li>
</ul> </ul>
</div> </div>
...@@ -60,14 +59,11 @@ ...@@ -60,14 +59,11 @@
> >
<ul class="basic-user-img"> <ul class="basic-user-img">
<li <li
v-if="
diagnoseTypeIcon == 'voice' &&
(item.returnStatus == 1 || item.returnStatus == 3) &&
userTrtcEntryStatus != 1
"
class="offline" class="offline"
:class="{ online: item.userOnlineStatus == 2 }"
> >
<img <img
v-if="item.userOnlineStatus == 3"
:src="offline" :src="offline"
alt="" alt=""
> >
...@@ -88,7 +84,7 @@ ...@@ -88,7 +84,7 @@
{{ item.userMobile }} {{ item.userMobile }}
</div> </div>
<div <div
v-if="userCallKfStatus == 1" v-if="item.userCallKfStatus == 1"
class="info-calling" class="info-calling"
> >
呼叫中 呼叫中
...@@ -111,7 +107,7 @@ ...@@ -111,7 +107,7 @@
class="no-info" class="no-info"
> >
<div <div
v-if="item.acceptStatus == 4" v-if="item.acceptStatus == 2"
class="doctor-late" class="doctor-late"
> >
未开始接诊 未开始接诊
...@@ -124,7 +120,6 @@ ...@@ -124,7 +120,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- 预约时间,复制单号 --> <!-- 预约时间,复制单号 -->
<div class="line line-second"> <div class="line line-second">
<div class="left"> <div class="left">
...@@ -151,8 +146,8 @@ ...@@ -151,8 +146,8 @@
</li> </li>
<li <li
v-if="item.diagnoseLogId" v-if="item.diagnoseLogId"
class="copy" class="copy copy-orderId"
@click="copyDiagnoseLogId" @click="clipboardAction"
> >
复制 复制
</li> </li>
...@@ -172,13 +167,22 @@ ...@@ -172,13 +167,22 @@
/> />
</div> </div>
</div> </div>
<!-- 有基层医生信息 展示进入诊室 -->
<div <div
v-if="item.userId && item.acceptStatus != 1 && item.acceptStatus != 4"
class="line-btn line-btn-enter" class="line-btn line-btn-enter"
:class="{ isManuacall: isManuacall, noIsCall: !isManuacall }" :class="{ isManuacall: isManuacall, noIsCall: !isManuacall }"
@click="openChat" @click="openChat"
>
进入诊室
</div>
<!-- -->
<div
v-else
class="line-btn line-btn-enter"
> >
<div <div
v-if="doctorCallKfStatus == 1" v-if="item.doctorCallKfStatus == 1"
class="call-box" class="call-box"
> >
<img <img
......
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
:key="index" :key="index"
class="workbench-li" class="workbench-li"
> >
{{ item.diagnoseLogId }}
<!-- key 动态随机无意义 促发组件数据更新 --> <!-- key 动态随机无意义 促发组件数据更新 -->
<consultation-card <consultation-card
:key="item.definitionRandom" :key="item.definitionRandom"
...@@ -180,6 +179,7 @@ ...@@ -180,6 +179,7 @@
currentDiagList: [], // 卡片列表数据 currentDiagList: [], // 卡片列表数据
mockData: [ mockData: [
{ {
doctorLastCallTime: '2021-12-02 19:58:01',
adviceStatus: 2, adviceStatus: 2,
appointBeginTime: '2021-12-02 18:00:00', appointBeginTime: '2021-12-02 18:00:00',
appointEndTime: '2021-12-02 19:00:00', appointEndTime: '2021-12-02 19:00:00',
...@@ -204,6 +204,7 @@ ...@@ -204,6 +204,7 @@
sort: null, sort: null,
status: null, status: null,
userCallKfStatus: 2, userCallKfStatus: 2,
doctorOnlineStatus: 2,
userCallStatus: 1, userCallStatus: 1,
userCallTime: null, userCallTime: null,
userId: 1006276934, userId: 1006276934,
...@@ -211,9 +212,12 @@ ...@@ -211,9 +212,12 @@
'https://test-file.yunqueyi.com//image/png/2019/04/08/20190408101124702-0db0bcea.png', 'https://test-file.yunqueyi.com//image/png/2019/04/08/20190408101124702-0db0bcea.png',
userMobile: '13817741327', userMobile: '13817741327',
userName: '郑志猛', userName: '郑志猛',
userTrtcEntryStatus: 2, userOnlineStatus: 2,
}, },
{ {
userLastCallTime: '',
doctorLastCallTime: '2021-12-02 20:05:01',
doctorOnlineStatus: 3,
adviceStatus: 2, adviceStatus: 2,
appointBeginTime: '2021-12-02 20:00:00', appointBeginTime: '2021-12-02 20:00:00',
appointEndTime: '2021-12-02 21:00:00', appointEndTime: '2021-12-02 21:00:00',
...@@ -245,7 +249,7 @@ ...@@ -245,7 +249,7 @@
'https://test-file.yunqueyi.com//image/png/2019/04/08/20190408101124702-0db0bcea.png', 'https://test-file.yunqueyi.com//image/png/2019/04/08/20190408101124702-0db0bcea.png',
userMobile: '13817741327', userMobile: '13817741327',
userName: '郑志猛', userName: '郑志猛',
userTrtcEntryStatus: 2, userOnlineStatus: 3,
}, },
], ],
}; };
...@@ -274,15 +278,13 @@ ...@@ -274,15 +278,13 @@
); );
this.initCard(); this.initCard();
const that = this; const that = this;
// if(this.tabPositionValue != 3) {
// 轮循 // 轮循
this.timer = window.setInterval(() => { this.timer = window.setInterval(() => {
setTimeout(() => { setTimeout(() => {
// that.isShowCardData = false; // that.isShowCardData = false;
that.initCard(); that.initCard();
}, 0); }, 0);
}, 4000); }, 5000);
// }
}, },
destroyed() { destroyed() {
window.clearInterval(this.timer); window.clearInterval(this.timer);
...@@ -317,7 +319,7 @@ ...@@ -317,7 +319,7 @@
handleData(data) { handleData(data) {
this.currentDiagList = []; this.currentDiagList = [];
data.forEach((item, index) => { data.forEach((item, index) => {
item.diagnoseLogId = '--' + Math.random() * 10; // item.diagnoseLogId = '--' + Math.random() * 10;
item['definitionRandom'] = Math.random() * 10; item['definitionRandom'] = Math.random() * 10;
this.$set(this.currentDiagList, index, item); this.$set(this.currentDiagList, index, item);
}); });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册