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

xiugai

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