prescribeList.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <view class="content">
  3. <view class="top-fixed">
  4. <u-tabs
  5. :scrollable="false"
  6. :list="tabs"
  7. lineColor="#C39A58"
  8. @change="tabChange">
  9. </u-tabs>
  10. </view>
  11. <mescroll-body top="88rpx" bottom="0" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :down="downOption" :up="upOption">
  12. <view class="prescribe-list">
  13. <view v-for="(item,index) in dataList" :key="index" class="item" @click="navTo('/pages_order/prescribeDetails?prescribeId='+item.prescribeId)">
  14. <view class="ordersn-box">
  15. <view class="num">处方单号:{{item.prescribeCode}}</view>
  16. <view class="status-box">
  17. <text class="text info" v-if="item.status==0">待开方</text>
  18. <text class="text success" v-if="item.status==1">已开方</text>
  19. <text class="text black" v-if="item.status==2">已拒绝</text>
  20. </view>
  21. </view>
  22. <view class="ask-text" >诊断结果:{{item.diagnose}}</view>
  23. <view class="drug-list" >
  24. <view class="drug-item" v-for="(subItme,index) in item.drugs" >
  25. <view class="drug-info" >
  26. <view class="name-box ellipsis">
  27. <view class="tag">{{index+1}}</view>{{subItme.drugName}}
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="ask-text">审核结果:{{item.auditReason}}</view>
  33. <view class="patient-text">患者:{{item.patientName}} {{item.patientAge}}岁 {{item.patientGender==1?'男':'女'}} </view>
  34. <view class="ask-time" v-if="item.createTime!=null">提交时间:{{item.createTime}}</view>
  35. <view class="ask-time" v-if="item.auditTime!=null">审核时间:{{item.auditTime}}</view>
  36. </view>
  37. </view>
  38. </mescroll-body>
  39. </view>
  40. </template>
  41. <script>
  42. import {getPrescribeList} from '@/api/prescribe.js'
  43. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  44. export default {
  45. mixins: [MescrollMixin],
  46. data() {
  47. return {
  48. status:0,
  49. tabs:[
  50. {
  51. id:0,
  52. name:'待开方'
  53. },
  54. {
  55. id:1,
  56. name:'已开方'
  57. },
  58. {
  59. id:2,
  60. name:'已拒绝'
  61. }
  62. ],
  63. mescroll:null,
  64. // 上拉加载的配置
  65. upOption: {
  66. onScroll:false,
  67. use: true, // 是否启用上拉加载; 默认true
  68. page: {
  69. pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  70. size: 10 // 每页数据的数量,默认10
  71. },
  72. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  73. textNoMore:"已经到底了",
  74. empty: {
  75. icon:'https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png',
  76. tip: '暂无数据'
  77. }
  78. },
  79. // 列表数据
  80. dataList: []
  81. }
  82. },
  83. onLoad() {
  84. },
  85. methods: {
  86. tabChange(item){
  87. this.status=item.id
  88. console.log(item)
  89. this.mescroll.resetUpScroll()
  90. },
  91. navTo(url){
  92. uni.navigateTo({
  93. url: url
  94. })
  95. },
  96. mescrollInit(mescroll) {
  97. this.mescroll = mescroll;
  98. },
  99. /*下拉刷新的回调 */
  100. downCallback(mescroll) {
  101. mescroll.resetUpScroll()
  102. },
  103. upCallback(page) {
  104. //联网加载数据
  105. var that = this;
  106. var data = {
  107. status:this.status,
  108. pageNum: page.num,
  109. pageSize: page.size
  110. };
  111. getPrescribeList(data).then(res => {
  112. if(res.code==200){
  113. //设置列表数据
  114. if (page.num == 1) {
  115. that.dataList = res.data.list;
  116. } else {
  117. that.dataList = that.dataList.concat(res.data.list);
  118. }
  119. that.mescroll.endBySize(res.data.list.length, res.data.total);
  120. }else{
  121. uni.showToast({
  122. icon:'none',
  123. title: "请求失败",
  124. });
  125. that.dataList = null;
  126. that.mescroll.endErr();
  127. }
  128. });
  129. },
  130. showImg(item) {
  131. var imgArr = [];
  132. imgArr.push(item.rpUrl)
  133. //预览图片
  134. uni.previewImage({
  135. urls: imgArr,
  136. current: imgArr[0]
  137. });
  138. }
  139. }
  140. }
  141. </script>
  142. <style lang="scss">
  143. .content{
  144. .top-fixed{
  145. width: 100%;
  146. position: fixed;
  147. top: 0;
  148. left: 0;
  149. z-index: 10;
  150. height: 88upx;
  151. background-color: #fff;
  152. }
  153. .prescribe-list{
  154. padding: 20upx;
  155. .item{
  156. background: #FFFFFF;
  157. border-radius: 16upx;
  158. padding: 30upx;
  159. position: relative;
  160. margin-bottom: 20upx;
  161. .ordersn-box{
  162. display: flex;
  163. align-items: center;
  164. justify-content: space-between;
  165. padding: 0upx 0 10upx;
  166. .num{
  167. font-size: 26upx;
  168. font-family: PingFang SC;
  169. font-weight: 500;
  170. color: #999999;
  171. line-height: 1;
  172. }
  173. .status-box{
  174. display: flex;
  175. align-items: center;
  176. .text{
  177. font-size: 28upx;
  178. font-family: PingFang SC;
  179. font-weight: 500;
  180. line-height: 1;
  181. &.success{
  182. color: #2BC7B9;
  183. }
  184. &.black{
  185. color: #111111;
  186. }
  187. &.info{
  188. color: #999999;
  189. }
  190. }
  191. }
  192. }
  193. .doctor-info{
  194. display: flex;
  195. align-items: center;
  196. .img-box{
  197. width: 80upx;
  198. height: 80upx;
  199. background: #E0FFF8;
  200. border-radius: 50%;
  201. overflow: hidden;
  202. margin-right: 20upx;
  203. image{
  204. width: 100%;
  205. height: 100%;
  206. }
  207. }
  208. .name{
  209. font-size: 28upx;
  210. font-family: PingFang SC;
  211. font-weight: 500;
  212. color: #666666;
  213. line-height: 48upx;
  214. text{
  215. margin-right: 10upx;
  216. }
  217. }
  218. }
  219. .ask-text{
  220. margin: 24rpx 0rpx;
  221. font-size: 30upx;
  222. font-family: PingFang SC;
  223. font-weight: 500;
  224. color: #111111;
  225. line-height: 42upx;
  226. }
  227. .patient-text{
  228. font-size: 24upx;
  229. font-family: PingFang SC;
  230. font-weight: 500;
  231. color: #999999;
  232. margin-bottom: 15upx;
  233. }
  234. .ask-time{
  235. font-size: 24upx;
  236. font-family: PingFang SC;
  237. font-weight: 500;
  238. color: #999999;
  239. }
  240. }
  241. }
  242. }
  243. .drug-list{
  244. .drug-item{
  245. padding: 10upx 0;
  246. border-bottom: 1px soli #F0F0F0;
  247. display: flex;
  248. align-items: center;
  249. .drug-info{
  250. width: 100%;
  251. display: flex;
  252. flex-direction: column;
  253. justify-content: space-between;
  254. .name-box{
  255. font-size: 28upx;
  256. font-family: PingFang SC;
  257. font-weight: 500;
  258. color: #111111;
  259. line-height: 40upx;
  260. .tag{
  261. display: inline-block;
  262. padding: 0 6upx;
  263. height: 30upx;
  264. background: linear-gradient(90deg, #C39A58 0%, #E2C99E 100%);
  265. border-radius: 4upx;
  266. margin-right: 10upx;
  267. font-size: 22upx;
  268. font-family: PingFang SC;
  269. font-weight: bold;
  270. color: #FFFFFF;
  271. line-height: 30upx;
  272. float: left;
  273. margin-top: 7upx;
  274. }
  275. }
  276. }
  277. }
  278. }
  279. </style>