index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351
  1. <template>
  2. <view class="content">
  3. <view class="search">
  4. <view class="inp">
  5. <text class="zhcx-iconfont zhcx-icon-sousuo"></text>
  6. <input type="text" v-model="keyword" placeholder="请输入关键字"/>
  7. </view>
  8. <view class="searchBt">
  9. <button type="primary" @click="search">搜索</button>
  10. </view>
  11. <view class="filterBt" @click="filterHandle">
  12. <text>筛选</text>
  13. <text class="zhcx-iconfont " :class="showMorefilter?'zhcx-icon-xiangshang':'zhcx-icon-xiangxia'"></text>
  14. </view>
  15. </view>
  16. <view class="more-filter" v-if="showMorefilter">
  17. <view class="illnessTypes">
  18. <picker @change="changeIllnessType" :value="illnessTypeIndex" :range="illnessTypes">
  19. <view class="uni-input">{{illnessTypeIndex>-1?illnessTypes[illnessTypeIndex]:"请选择病症类型"}}</view>
  20. </picker>
  21. </view>
  22. </view>
  23. <view class="tab-cont">
  24. <view class="item-container" :class="showMorefilter?'showMorefilter':''">
  25. <view class="item" v-for="item in items" :key="item.id" @click="showdetail(item.id)">
  26. <view class="avatar">
  27. <image src="../../../static/images/order/mine_location.png" mode="widthFix" class="pic"></image>
  28. </view>
  29. <view class="item-info">
  30. <view class="user">
  31. <text class="name">{{item.name}}</text>
  32. <view class="gender" :class="item.gender==='1'?'woman':'man'">
  33. <text>{{item.gender==='1'?'女':"男"}}</text>
  34. </view>
  35. <text class="age">{{item.age}}</text>
  36. </view>
  37. <view class="illnessType">
  38. <text>{{item.illnessType}}</text>
  39. </view>
  40. <view class="time">
  41. <text>就诊时间:</text>
  42. <text>{{item.time}}</text>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <!-- #ifndef H5 -->
  49. <view class="createBt" @click="createTherapy">
  50. <!-- #endif -->
  51. <!-- #ifdef H5 -->
  52. <view class="createBt h5" @click="createTherapy">
  53. <!-- #endif -->
  54. <view class="icon"></view>
  55. <text class="word">新建</text>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import {treatmentList,removeTreatmentPatient} from '@/api/doctor';
  61. import { getIlltype } from '@/api/user.js'
  62. export default{
  63. name:"doctor-index",
  64. data() {
  65. return {
  66. showMorefilter:false,
  67. illnessTypeIndex:-1,
  68. illnessTypes:[],
  69. keyword: '',
  70. items:[],
  71. pageNumber:1,
  72. pageSize:9999
  73. }
  74. },
  75. created() {
  76. let accountInfo=uni.getStorageSync('accountInfo');
  77. this.userType=accountInfo.userType;
  78. if(accountInfo.userType===1){
  79. this.init();
  80. }
  81. },
  82. methods:{
  83. init(){
  84. this.getList()
  85. this.setIllnessType()
  86. },
  87. setIllnessType(){
  88. getIlltype().then((result) => {
  89. let illnessTypes=result.data;
  90. illnessTypes=illnessTypes.map((item)=>{
  91. return item.typename
  92. })
  93. illnessTypes.unshift('全部病症类型');
  94. this.illnessTypes = illnessTypes;
  95. })
  96. },
  97. filterHandle(){
  98. this.showMorefilter=!this.showMorefilter;
  99. },
  100. getList(){
  101. let accountInfo=uni.getStorageSync('accountInfo');
  102. let doctorId=accountInfo.id;
  103. let keyword=this.keyword;
  104. let illnessTypeIndex=this.illnessTypeIndex;
  105. let illnessType=this.illnessTypes[illnessTypeIndex];
  106. if(illnessTypeIndex<1){
  107. illnessType="";
  108. }
  109. // let startTime=formatTime(this.time[0]);
  110. // let endTime=formatTime(this.time[1]);
  111. let page= this.pageNumber;
  112. let limit=this.pageSize;
  113. const maxAge = 60;
  114. const minAge = 20;
  115. var dictionaries={};
  116. treatmentList({
  117. keyword,page,limit,doctorId,illnessType
  118. }).then((res)=>{
  119. //this.total=res.data.totalCount;
  120. let list=res.data.list;
  121. let age="";
  122. let items=list.map((item)=>{
  123. if(dictionaries.hasOwnProperty(item.patientName)){
  124. age=dictionaries[item.patientName]
  125. }else{
  126. age=dictionaries[item.patientName]=Math.floor(Math.random()*(maxAge-minAge+1)+minAge);
  127. }
  128. return{
  129. id:item.treatmentId,
  130. name:item.patientName,
  131. time:item.seekTime,
  132. gender:item.patientSex,
  133. illnessType:item.illnessType,
  134. age
  135. }
  136. });
  137. this.items=items;
  138. })
  139. },
  140. search(){
  141. this.pageNumber=1;
  142. this.getList();
  143. },
  144. showdetail(id){
  145. uni.navigateTo({
  146. url:`/views/detail/index?type=therapy&user=doctor&id=${id}`
  147. // #ifdef MP-WEIXIN
  148. ,animationType: 'pop-out',
  149. animationDuration: 200
  150. // #endif
  151. })
  152. },
  153. createTherapy(){
  154. uni.navigateTo({
  155. url:"/views/doctorItems/createPatient/index"
  156. })
  157. },
  158. removeSubmit(id=null){
  159. removeTreatmentPatient(id).then((res)=>{
  160. console.log(res)
  161. })
  162. },
  163. changeIllnessType({detail}){
  164. this.illnessTypeIndex=detail.value;
  165. this.search();
  166. }
  167. }
  168. }
  169. </script>
  170. <style lang="scss" scoped>
  171. .content{
  172. .search{
  173. height: 100upx;
  174. display: flex;
  175. justify-content: space-between;
  176. align-items: center;
  177. padding: 0 20upx;
  178. .inp{
  179. width: 350upx;
  180. height: 60upx;
  181. display: flex;
  182. justify-content:flex-start;
  183. align-items: center;
  184. input{
  185. height: 100%;
  186. margin-left: 14upx;
  187. display: inline-block;
  188. font-size: 24upx;
  189. color: #999999;
  190. &::-webkit-input-placeholder {
  191. font-size: 24upx;
  192. color: #999999;
  193. }
  194. }
  195. }
  196. .searchBt{
  197. button{
  198. width: 130upx;
  199. height: 60upx;
  200. line-height: 60upx;
  201. background-color: #3384FF;
  202. text-align: center;
  203. color: #fff;
  204. font-size: 24upx;
  205. }
  206. }
  207. }
  208. .more-filter{
  209. padding: 20upx;
  210. border-top: 1px solid #eaeaea;
  211. .filterBt{
  212. padding-left: 20upx;
  213. .zhcx-iconfont{
  214. font-size: 16upx;
  215. padding-left: 10upx;
  216. }
  217. }
  218. .uni-input{
  219. border: 1px solid #ccc;
  220. display: inline-block;
  221. padding: 10upx 20upx;
  222. }
  223. }
  224. .tab-cont{
  225. &{
  226. padding-bottom: 30upx;
  227. background-color: #fff;
  228. }
  229. .item-container{
  230. border-top: 1px solid #eaeaea;
  231. .item{
  232. position: relative;
  233. padding: 20upx;
  234. background-color: #fff;
  235. // margin-bottom: 10upx;
  236. border-bottom: 1upx solid #eaeaea;
  237. .avatar{
  238. overflow: hidden;
  239. position: absolute;
  240. left: 20upx;
  241. top: 20upx;
  242. &,.pic{
  243. width: 86upx;
  244. height: 86upx;
  245. border-radius: 50%;
  246. }
  247. }
  248. .item-info{
  249. margin-left: 120upx;
  250. line-height: 1;
  251. .user{
  252. display: flex;
  253. justify-content: flex-start;
  254. align-items: center;
  255. .name{
  256. color: #333;
  257. font-size: 30upx;
  258. width: 300upx;
  259. white-space: nowrap;
  260. overflow: hidden;
  261. text-overflow: ellipsis;
  262. }
  263. .gender{
  264. position: relative;
  265. padding:0 30upx;
  266. &::after{
  267. width: 16upx;
  268. height: 16upx;
  269. border-radius: 50%;
  270. position: absolute;
  271. left: 10upx;
  272. top: 50%;
  273. transform: translateY(-50%);
  274. background-color: #1890FF;
  275. display: block;
  276. content: "";
  277. }
  278. &.woman::after{
  279. background-color: red;
  280. }
  281. }
  282. }
  283. .illnessType{
  284. padding-top:24upx;
  285. color: #424242;
  286. font-size: 28upx;
  287. }
  288. .time{
  289. color: #999;
  290. font-size: 28upx;
  291. padding-top: 24upx;
  292. }
  293. }
  294. }
  295. }
  296. }
  297. .createBt{
  298. width:110upx;
  299. height: 110upx;
  300. border-radius: 50%;
  301. background-color: #1890FF;
  302. color: #fff;
  303. display: flex;
  304. justify-content: center;
  305. align-items: center;
  306. flex-direction: column;
  307. position: fixed;
  308. right: 20upx;
  309. bottom: 150upx;
  310. box-shadow: 0 0 2px #65c4ff;
  311. z-index: 99;
  312. &.h5{
  313. bottom: 160upx;
  314. }
  315. .icon{
  316. width: 45upx;
  317. height: 45upx;
  318. position: relative;
  319. &::after{
  320. width: 45upx;
  321. height: 4upx;
  322. display: block;
  323. content: "";
  324. position: absolute;
  325. left: 50%;
  326. top: 50%;
  327. transform: translate(-50%,-50%);
  328. background-color: #fff;
  329. }
  330. &::before{
  331. width: 4upx;
  332. height: 45upx;
  333. display: block;
  334. content: "";
  335. position: absolute;
  336. left: 50%;
  337. top: 50%;
  338. transform: translate(-50%,-50%);
  339. background-color: #fff;
  340. }
  341. }
  342. .word{
  343. font-size: 24upx;
  344. padding-top: 4upx;
  345. }
  346. }
  347. }
  348. </style>