prescribeList.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <template>
  2. <view class="content">
  3. <view class="top-fixed">
  4. <u-tabs
  5. :scrollable="false"
  6. :list="tabs"
  7. lineColor="#2583EB"
  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.preId)">
  14. <view class="ordersn-box">
  15. <view class="num">处方编号:{{item.serialNo||''}}</view>
  16. <view class="status-box">
  17. <text class="text black" v-if="item.prescriptionStatusByOrderStatus==1">待生效</text>
  18. <text class="text success" v-if="item.prescriptionStatusByOrderStatus==2">已生效</text>
  19. <text class="text info" v-if="item.prescriptionStatusByOrderStatus==3">已失效</text>
  20. </view>
  21. </view>
  22. <view class="ask-text" >诊断结果:{{item.tags||''}}</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.userFamilyName}} {{item.userFamilyAge}}岁 {{item.userFamilyGender==1?'男':'女'}} </view>
  34. <view class="ask-time" v-if="item.createTime!=null">提交时间:{{item.createTime}}</view>
  35. <view class="ask-time" v-if="item.createdTime!=null">开方时间:{{item.createdTime}}</view>
  36. <view class="bottom-box">
  37. <view class="btn-box">
  38. <view class="btn pay" v-if="status==0" @click.stop="addPrescribe(item)">进入开方</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </mescroll-body>
  44. </view>
  45. </template>
  46. <script>
  47. import {getPrescribeList} from '@/api/prescribe.js'
  48. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  49. export default {
  50. mixins: [MescrollMixin],
  51. data() {
  52. return {
  53. status:0,
  54. tabs:[
  55. {
  56. id:0,
  57. name:'待开方'
  58. },
  59. {
  60. id:1,
  61. name:'已开方'
  62. },
  63. {
  64. id:2,
  65. name:'已拒绝'
  66. }
  67. ],
  68. mescroll:null,
  69. downOption: {
  70. //下拉刷新
  71. use: true,
  72. auto: false // 不自动加载 (mixin已处理第一个tab触发downCallback)
  73. },
  74. // 上拉加载的配置
  75. upOption: {
  76. onScroll:false,
  77. use: true, // 是否启用上拉加载; 默认true
  78. page: {
  79. pae: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
  80. size: 10 // 每页数据的数量,默认10
  81. },
  82. noMoreSize: 10, // 配置列表的总数量要大于等于5条才显示'-- END --'的提示
  83. textNoMore:"已经到底了",
  84. empty: {
  85. icon:'https://bjyjb-1362704775.cos.ap-chongqing.myqcloud.com/app/newImages/empty_icon.png',
  86. tip: '暂无数据'
  87. }
  88. },
  89. // 列表数据
  90. dataList: []
  91. }
  92. },
  93. onLoad() {
  94. },
  95. methods: {
  96. tabChange(item){
  97. this.status=item.id
  98. console.log(item)
  99. this.mescroll.resetUpScroll()
  100. },
  101. navTo(url){
  102. uni.navigateTo({
  103. url: url
  104. })
  105. },
  106. mescrollInit(mescroll) {
  107. this.mescroll = mescroll;
  108. },
  109. /*下拉刷新的回调 */
  110. downCallback(mescroll) {
  111. mescroll.resetUpScroll()
  112. },
  113. upCallback(page) {
  114. //联网加载数据
  115. var that = this;
  116. var data = {
  117. status:this.status,
  118. pageNum: page.num,
  119. pageSize: page.size
  120. };
  121. getPrescribeList(data).then(res => {
  122. if(res.code==200){
  123. //设置列表数据
  124. if (page.num == 1) {
  125. that.dataList = res.datas;
  126. } else {
  127. that.dataList = that.dataList.concat(res.datas);
  128. }
  129. that.mescroll.endBySize(res.datas.length, res.total);
  130. }else{
  131. uni.showToast({
  132. icon:'none',
  133. title: "请求失败",
  134. });
  135. that.dataList = null;
  136. that.mescroll.endErr();
  137. }
  138. });
  139. },
  140. showImg(item) {
  141. var imgArr = [];
  142. imgArr.push(item.rpUrl)
  143. //预览图片
  144. uni.previewImage({
  145. urls: imgArr,
  146. current: imgArr[0]
  147. });
  148. },
  149. addPrescribe(item) {
  150. if(!item.jumpUrl) {
  151. uni.showToast({
  152. icon:'none',
  153. title: "暂无开方链接",
  154. });
  155. return
  156. }
  157. uni.navigateTo({
  158. url: '/pages/index/webview?type=prescribe&url='+encodeURIComponent(item.jumpUrl)
  159. })
  160. }
  161. }
  162. }
  163. </script>
  164. <style lang="scss" scoped>
  165. .bottom-box{
  166. display: flex;
  167. align-items: center;
  168. justify-content: flex-end;
  169. .btn-box{
  170. box-sizing: border-box;
  171. display: flex;
  172. align-items: center;
  173. .btn{
  174. width: 155upx;
  175. height: 64upx;
  176. line-height: 64upx;
  177. font-size: 26upx;
  178. font-family: PingFang SC;
  179. font-weight: 500;
  180. text-align: center;
  181. border-radius: 32upx;
  182. margin-left: 15upx;
  183. &:first-child{
  184. margin-left: 0;
  185. }
  186. &.cancel{
  187. border: 1px solid #DDDDDD;
  188. color: #666666;
  189. }
  190. &.pay{
  191. background: #2BC7B9;
  192. color: #FFFFFF;
  193. }
  194. }
  195. }
  196. }
  197. .content{
  198. .top-fixed{
  199. width: 100%;
  200. position: fixed;
  201. top: 0;
  202. left: 0;
  203. z-index: 10;
  204. height: 88upx;
  205. background-color: #fff;
  206. }
  207. .prescribe-list{
  208. padding: 20upx;
  209. .item{
  210. background: #FFFFFF;
  211. border-radius: 16upx;
  212. padding: 30upx;
  213. position: relative;
  214. margin-bottom: 20upx;
  215. .ordersn-box{
  216. display: flex;
  217. align-items: center;
  218. justify-content: space-between;
  219. padding: 0upx 0 10upx;
  220. .num{
  221. font-size: 26upx;
  222. font-family: PingFang SC;
  223. font-weight: 500;
  224. color: #999999;
  225. line-height: 1;
  226. }
  227. .status-box{
  228. display: flex;
  229. align-items: center;
  230. .text{
  231. font-size: 28upx;
  232. font-family: PingFang SC;
  233. font-weight: 500;
  234. line-height: 1;
  235. &.success{
  236. color: #2583EB;
  237. }
  238. &.black{
  239. color: #111111;
  240. }
  241. &.info{
  242. color: #999999;
  243. }
  244. }
  245. }
  246. }
  247. .doctor-info{
  248. display: flex;
  249. align-items: center;
  250. .img-box{
  251. width: 80upx;
  252. height: 80upx;
  253. background: #E0FFF8;
  254. border-radius: 50%;
  255. overflow: hidden;
  256. margin-right: 20upx;
  257. image{
  258. width: 100%;
  259. height: 100%;
  260. }
  261. }
  262. .name{
  263. font-size: 28upx;
  264. font-family: PingFang SC;
  265. font-weight: 500;
  266. color: #666666;
  267. line-height: 48upx;
  268. text{
  269. margin-right: 10upx;
  270. }
  271. }
  272. }
  273. .ask-text{
  274. margin: 24rpx 0rpx;
  275. font-size: 30upx;
  276. font-family: PingFang SC;
  277. font-weight: 500;
  278. color: #111111;
  279. line-height: 42upx;
  280. }
  281. .patient-text{
  282. font-size: 24upx;
  283. font-family: PingFang SC;
  284. font-weight: 500;
  285. color: #999999;
  286. margin-bottom: 15upx;
  287. }
  288. .ask-time{
  289. font-size: 24upx;
  290. font-family: PingFang SC;
  291. font-weight: 500;
  292. color: #999999;
  293. }
  294. }
  295. }
  296. }
  297. .drug-list{
  298. .drug-item{
  299. padding: 10upx 0;
  300. border-bottom: 1px soli #F0F0F0;
  301. display: flex;
  302. align-items: center;
  303. .drug-info{
  304. width: 100%;
  305. display: flex;
  306. flex-direction: column;
  307. justify-content: space-between;
  308. .name-box{
  309. font-size: 28upx;
  310. font-family: PingFang SC;
  311. font-weight: 500;
  312. color: #111111;
  313. line-height: 40upx;
  314. .tag{
  315. display: inline-block;
  316. padding: 0 6upx;
  317. height: 30upx;
  318. background: linear-gradient(90deg, #2583EB 0%, #2EDAD4 100%);
  319. border-radius: 4upx;
  320. margin-right: 10upx;
  321. font-size: 22upx;
  322. font-family: PingFang SC;
  323. font-weight: bold;
  324. color: #FFFFFF;
  325. line-height: 30upx;
  326. float: left;
  327. margin-top: 7upx;
  328. }
  329. }
  330. }
  331. }
  332. }
  333. </style>