audit.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view class="audit">
  3. <view class="ddlist">
  4. <view class="cont">
  5. <view class="list border"><text class="glay">处方编号</text><text>{{drugNo}}</text></view>
  6. <view class="list"><text class="glay">订单编号</text><text>{{orderId}}</text></view>
  7. <!-- <view class="list"><text class="glay">订单金额</text><text class="red">¥<text>金额</text></text></view> -->
  8. </view>
  9. </view>
  10. <view class="content">
  11. <image :src="picUrlss+'audit.png'" class="img" v-if="flag"></image>
  12. <image :src="picUrlss+'audit2.png'" v-else></image>
  13. <text v-if="flag">处方审核中,请稍等!</text>
  14. <text v-else>
  15. {{drugNo?'处方审核失败':'开方失败'}},请重新下单~
  16. </text>
  17. </view>
  18. <view class="btn">
  19. <view class="mini-btn" v-if="flag" @tap="goOrder">查看订单</view>
  20. <view class="mini-btn" v-else @tap="black">返回</view>
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. // prescription/audit/audit.js
  26. const app = getApp();
  27. const req = require("../../utils/request.js");
  28. export default {
  29. data() {
  30. return {
  31. picUrlss: req.public.picUrls,
  32. orderId: '',
  33. drugNo: '',
  34. flag: true,
  35. config: ''
  36. };
  37. },
  38. components: {},
  39. props: {},
  40. /**
  41. * 生命周期函数--监听页面加载
  42. */
  43. onLoad: function (options) {
  44. this.setData({
  45. orderId: options.orderId,
  46. drugNo: options.drugNo
  47. });
  48. // console.log(options.orderId, options);
  49. uni.setNavigationBarTitle({
  50. title: "处方审核中"
  51. });
  52. },
  53. /**
  54. * 生命周期函数--监听页面显示
  55. */
  56. onShow: function () {
  57. this.getsavedesdrug();
  58. this.config = JSON.parse(req.getStorage('configRes'));
  59. },
  60. methods: {
  61. // async init() {
  62. // await this.getsavedesdrug();
  63. // },
  64. getsavedesdrug(sc) {
  65. let data = {
  66. orderId: this.orderId,
  67. drugNo: this.drugNo
  68. };
  69. let than = this;
  70. // console.log(this.flag);
  71. if (this.drugNo == '') {
  72. than.setData({
  73. flag: false
  74. });
  75. uni.setNavigationBarTitle({
  76. title: "开方失败"
  77. });
  78. uni.showToast({
  79. title: '开方失败',
  80. icon: 'none',
  81. success: function () {
  82. setTimeout(function () {
  83. app.globalData.reLaunchTo('pages/index/index')
  84. }, 2000);
  85. }
  86. });
  87. } else {
  88. req.postRequest('/api/orderdurg/drugStatus', data, function (res) {
  89. //审核中
  90. if (res.checkType == 0) {
  91. // console.log("审核中");
  92. } //审核成功 1 跳转到订单详情
  93. if (res.checkType == 1) {
  94. uni.redirectTo({
  95. url: '/mine/orderDet/orderDet?id=' + res.orderId
  96. });
  97. // console.log("审核成功");
  98. } //审核失败 3 样式改变
  99. if (res.checkType == 3) {
  100. than.setData({
  101. flag: false
  102. });
  103. uni.setNavigationBarTitle({
  104. title: "处方审核失败"
  105. });
  106. }
  107. });
  108. }
  109. },
  110. goOrder() {
  111. uni.redirectTo({
  112. url: '/mine/orderDet/orderDet?id=' + this.orderId
  113. });
  114. },
  115. black() {
  116. app.globalData.reLaunchTo('pages/index/index')
  117. }
  118. }
  119. };
  120. </script>
  121. <style>
  122. @import "./audit.css";
  123. </style>