index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. <template>
  2. <view class="content">
  3. <view class="tab">
  4. <view class="item" @click="changeTab(4)" :class="tabIndex===4?'active':''">
  5. <text>待接单</text>
  6. </view>
  7. <view class="item" @click="changeTab(1)" :class="tabIndex===1?'active':''">
  8. <text>待确诊</text>
  9. </view>
  10. <view class="item" @click="changeTab(2)" :class="tabIndex===2?'active':''">
  11. <text>待确认</text>
  12. </view>
  13. <view class="item" @click="changeTab(3)" :class="tabIndex===3?'active':''">
  14. <text>已完成</text>
  15. </view>
  16. </view>
  17. <view class="search">
  18. <view class="inp">
  19. <text class="zhcx-iconfont zhcx-icon-sousuo"></text>
  20. <input class="search-inp" type="text" v-model="keyword" placeholder="请输入关键字"/>
  21. </view>
  22. <view class="searchBt" @click="search">
  23. <button type="primary">搜索</button>
  24. </view>
  25. </view>
  26. <view class="tab-cont">
  27. <view class="item-container">
  28. <roll-load
  29. :total="total"
  30. :size="pageSize"
  31. @lower="lower"
  32. :topBt="topBt"
  33. ref="roll-load"
  34. styles="height:calc(100vh - 180rpx)">
  35. <template v-slot:cont>
  36. <block></block>
  37. <view class="item" v-for="(item,index) in items" :key="index" @click="showdetail(item.id)">
  38. <view class="avatar">
  39. <image src="../../../static/images/doctor.jpg" mode="widthFix" class="pic"></image>
  40. </view>
  41. <view class="item-info">
  42. <view class="doctor">
  43. <view class="lf">
  44. <text class="name" v-if="tabIndex==4||tabIndex==1">Ai医生</text>
  45. <text class="name" v-if="item.doctor&&tabIndex!=4">{{item.doctor}}</text>
  46. <text class="status">线上</text>
  47. </view>
  48. <text class="diagnose-status" v-if="tabIndex==2||tabIndex==3">已就诊</text>
  49. </view>
  50. <view class=" jobTitle-box" v-if="tabIndex==4">
  51. <text class="jobTitle">云影医通</text>
  52. <text class="department" >人工智能</text>
  53. </view>
  54. <view class=" jobTitle-box" v-if="tabIndex!=4&&!formateJobTitle(item)">
  55. <text class="jobTitle" v-if="item.doctorJobTitle">{{item.doctorJobTitle}}</text>
  56. <text class="department" v-if="item.doctorDepartment">{{item.doctorDepartment}}</text>
  57. </view>
  58. <view class="doctorHospital" v-if="item.doctorHospital">{{item.doctorHospital}}</view>
  59. <view class="time">
  60. <text>就诊时间:</text>
  61. <text>{{item.time}}</text>
  62. </view>
  63. </view>
  64. </view>
  65. </template>
  66. <template v-slot:toTop>
  67. <text>顶部</text>
  68. </template>
  69. </roll-load>
  70. </view>
  71. </view>
  72. </view>
  73. </template>
  74. <script>
  75. import RollLoad from '@/components/RollLoad/index.vue';
  76. import {deepClone,notEmpty} from '@/libs/index.js';
  77. import {recordList} from '@/api/patient';
  78. export default{
  79. name:"doctor-index",
  80. components:{
  81. RollLoad
  82. },
  83. data() {
  84. return {
  85. keyword: '',
  86. tabIndex:4,
  87. items:[],
  88. detailModal:false,
  89. pageNumber:1,
  90. pageSize:15,
  91. total:0,
  92. topBt:{
  93. show:true,
  94. style:'top:80%'
  95. }
  96. }
  97. },
  98. created() {
  99. let accountInfo=uni.getStorageSync('accountInfo');
  100. this.userType=accountInfo.userType;
  101. if(accountInfo.userType===2){
  102. this.init();
  103. }
  104. },
  105. methods:{
  106. init(type){
  107. if(type==="appraise"){
  108. this.tabIndex=3;
  109. }
  110. this.getList();
  111. },
  112. changeTab(index){
  113. this.tabIndex=index;
  114. this.items=[];
  115. this.getList();
  116. },
  117. search(){
  118. this.pageNumber=1;
  119. this.items=[];
  120. this.getList();
  121. },
  122. getList(){
  123. let status=this.tabIndex-1;
  124. let keyword=this.keyword;
  125. // let startTime=formatTime(this.time[0]);
  126. // let endTime=formatTime(this.time[1]);
  127. let page= this.pageNumber;
  128. let limit=this.pageSize;
  129. this.$nextTick(()=>{
  130. this.$refs['roll-load'].init();
  131. })
  132. recordList({
  133. status,keyword,page,limit
  134. }).then((res)=>{
  135. this.total=res.data.totalCount;
  136. let items=res.data.list.map((item)=>{
  137. return{
  138. id:item.seekId,
  139. name:item.patientName,
  140. time:item.seekTime,
  141. desc:item.diseaseDesc,
  142. tags:this.formateSite(item.aiDiagnosisSite),
  143. doctor:item.doctorName,
  144. doctorHospital:item.doctorHospital,
  145. doctorDepartment:item.doctorDepartment,
  146. doctorJobTitle:item.doctorJobTitle
  147. }
  148. })
  149. this.items=items;
  150. }).catch(()=>{
  151. this.items=[]
  152. uni.showToast({
  153. icon:'error',
  154. title:"请求数据失败"
  155. });
  156. })
  157. },
  158. getItem(){
  159. let status=(this.tabIndex)-1;
  160. let keyword=this.keyword;
  161. let page= this.pageNumber;
  162. let limit=this.pageSize;
  163. return new Promise((resolve,reject)=>{
  164. recordList({
  165. status,keyword,page,limit
  166. }).then((res)=>{
  167. let total=res.data.totalCount;
  168. let items=res.data.list.map((item)=>{
  169. return{
  170. id:item.seekId,
  171. name:item.patientName,
  172. time:item.seekTime,
  173. desc:item.diseaseDesc,
  174. tags:this.formateSite(item.aiDiagnosisSite),
  175. doctor:item.doctorName,
  176. doctorHospital:item.doctorHospital,
  177. doctorDepartment:item.doctorDepartment,
  178. doctorJobTitle:item.doctorJobTitle
  179. }
  180. })
  181. this.total=total;
  182. resolve(items)
  183. }).catch((err)=>{reject(err);})
  184. })
  185. },
  186. async lower(e){
  187. let items=deepClone(this.items);
  188. if(e.status){
  189. let data=await this.getItem();
  190. this.items=items.concat(data);
  191. }
  192. },
  193. showdetail(id){
  194. let status=this.tabIndex;
  195. uni.navigateTo({
  196. url:`/views/detail/index?type=diagnose&user=patient&id=${id}&status=${status}`,
  197. animationType: 'pop-in',
  198. animationDuration: 200
  199. })
  200. },
  201. formateSite(site){
  202. try{
  203. if(!site){
  204. return []
  205. }else{
  206. let tags=JSON.parse(site);
  207. if(Array.isArray(tags)&&site.length>0){
  208. tags=tags.map((item)=>{
  209. return item.illnessname;
  210. })
  211. return tags;
  212. }
  213. return [];
  214. }
  215. }catch(err){
  216. return [];
  217. }
  218. },
  219. formateJobTitle(item){
  220. return !notEmpty(item.doctorJobTitle)&&!notEmpty(item.doctorDepartment);
  221. }
  222. }
  223. }
  224. </script>
  225. <style lang="scss" scoped>
  226. @import url('./index.css');
  227. </style>