index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <template>
  2. <view :style="[mainStyle]" v-if="isShowView">
  3. <view class="service-bar" v-if="dataList.length > 0">
  4. <view v-for="(item, index) in dataList" :key="index" class="bar-item">
  5. <view class="bar-top" @click="jumpUrl('fillPrescription/detail/detail?id=' + item.id)">
  6. <view><image :src="getImg(item)" class="prescription-image"></image></view>
  7. <view>
  8. <view class="prescription-data" style="margin-bottom: 30rpx;">
  9. <text class="prescription-tinfo">服务处方编号</text>
  10. <text class="prescription-dinfo">{{ item.id }}</text>
  11. </view>
  12. <view class="prescription-data">
  13. <text class="prescription-tinfo">处方提交时间</text>
  14. <text class="prescription-dinfo">{{ item.createDate }}</text>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="bar-bottom">
  19. <!-- 0 待审核 1已审核 2驳回 -->
  20. <view>{{ item.state == 1 ? '已抓药' : item.state == 2 ? '拒绝抓药' : '待审核' }}</view>
  21. <view class="buttons">
  22. <view class="btn" @click="jumpUrl('fillPrescription/detail/detail?id=' + item.id)">处方详情</view>
  23. <view class="btn btn-red" v-if="item.state == 1" @click="jumpUrl('mine/orderDet/orderDet?id=' + item.orderId)">查看报价</view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="nodata" v-else>
  29. <image :src="picUrlss + 'empty_sc.png'"></image>
  30. <text>暂无药方记录</text>
  31. </view>
  32. <!-- 按钮 -->
  33. <view class="bottom-bar">
  34. <view class="bottom-btn" @click="jumpUrl('fillPrescription/uploadPrescription/uploadPrescription')"><text>上传药方</text></view>
  35. <view class="bottom-text ddflex">
  36. <image src="../static/images/help.png"></image>
  37. <view class="bottom-text-share" @click="jumpUrl('fillPrescription/process/process')">了解按方抓药流程</view>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. const app = getApp();
  44. const req = require('../../utils/request.js');
  45. const api = require('../../utils/api.js');
  46. const utils = require('../../utils/util.js');
  47. export default {
  48. data() {
  49. return {
  50. mainStyle: app.globalData.mainStyle,
  51. picUrlss: req.public.picUrls,
  52. isShowView: false,
  53. isFirst: true,
  54. form: {
  55. page: 1,
  56. limit: 10
  57. },
  58. isLoad: true,
  59. dataList: []
  60. };
  61. },
  62. components: {},
  63. props: {},
  64. onLoad: function(options) {
  65. // this.getDataList(true);
  66. },
  67. onShow() {
  68. this.form.page = 1;
  69. this.isLoad = true;
  70. this.getDataList(this.isFirst);
  71. },
  72. onReachBottom: function() {
  73. this.form.page++;
  74. this.getDataList(false);
  75. },
  76. methods: {
  77. jumpUrl(url) {
  78. if (!req.isLogin()) return false;
  79. app.globalData.navigateTo(url);
  80. },
  81. getImg(item) {
  82. var url = '';
  83. var list = item.drugImgUrl.split(',');
  84. if (list.length > 0) {
  85. url = list[0];
  86. }
  87. return url;
  88. },
  89. getDataList(isShow) {
  90. if (!this.isLoad) {
  91. return;
  92. }
  93. this.form.type = this.type;
  94. this.isLoad = false;
  95. this.isFirst = false;
  96. req.getRequest(
  97. '/api/orderdurg/page',
  98. this.form,
  99. data => {
  100. if (data && data.length == this.form.limit) {
  101. this.isLoad = true;
  102. }
  103. if (this.form.page > 1) {
  104. data = this.dataList.concat(data);
  105. } else {
  106. if (data && data.length > 0) {
  107. this.isLoad = true;
  108. }
  109. }
  110. this.dataList = data;
  111. this.isShowView = true;
  112. },
  113. isShow
  114. );
  115. }
  116. },
  117. mounted() {}
  118. };
  119. </script>
  120. <style>
  121. @import './index.css';
  122. </style>