prescribeList.vue 7.6 KB

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