menzhenxq.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <view style="width: 100%;height: 100%;background-color: #F6F6F6;">
  3. <u-gap height="30" bg-color="#f6f6f6"></u-gap>
  4. <view style="padding: 20rpx 28rpx;background-color: #FFFFFF;">
  5. <!-- 头部 -->
  6. <view class="flex align-center" style="font-weight: bold;font-size: 30rpx;margin:30rpx 0;">
  7. <view style="width: 25%;">订单号:</view>
  8. <view style="width: 50%;">{{orderID}}</view>
  9. <view style="width: 25%;" class="flex justify-center">
  10. <view class="but">门诊预约</view>
  11. </view>
  12. </view>
  13. <!-- 线 -->
  14. <u-line color="#EFEFEF" />
  15. <!-- 中部内容 -->
  16. <view style="font-size: 26rpx;background-color: #FFFFFF;">
  17. <view class="nr">
  18. <view class="left">患者:</view>
  19. <view class="right">{{name}}</view>
  20. </view>
  21. <view class="nr">
  22. <view class="left">年龄:</view>
  23. <view class="right">{{age}}</view>
  24. </view>
  25. <view class="nr">
  26. <view class="left">身份证号:</view>
  27. <view class="right">{{ID}}</view>
  28. </view>
  29. <view class="nr">
  30. <view class="left">预约时间:</view>
  31. <view class="right">{{appointment}}</view>
  32. </view>
  33. <view class="nr">
  34. <view class="left">门诊机构:</view>
  35. <view class="right">{{local}}</view>
  36. </view>
  37. </view>
  38. </view>
  39. <u-gap height="30" bg-color="#f6f6f6"></u-gap>
  40. <!-- 客户资料 -->
  41. <view class="" style="background-color: #FFFFFF;padding: 10rpx 28rpx;">
  42. <view class="nr">
  43. <view class="left">下单时间:</view>
  44. <view class="right">{{placeTime}}</view>
  45. </view>
  46. <view class="nr">
  47. <view class="left">下单客户:</view>
  48. <view class="right">{{xiadankh}}</view>
  49. </view>
  50. <view class="nr">
  51. <view class="left">订单状态:</view>
  52. <view class="right" v-if="zt==1">未支付</view>
  53. <view class="right" v-else-if="zt==2">待接单</view>
  54. <view class="right" v-else-if="zt==3">进行中</view>
  55. <view class="right" v-else-if="zt==4">已完成</view>
  56. <view class="right" v-else-if="zt==5">已取消</view>
  57. <view class="right" v-else-if="zt==6">已超时</view>
  58. <view class="right" v-else-if="zt==7">已预约</view>
  59. </view>
  60. </view>
  61. <u-gap height="30" bg-color="#f6f6f6"></u-gap>
  62. <!-- 底部按钮 -->
  63. <!-- 当订单状态为未接单 zt==0 -->
  64. <view class="bottomButton" v-if="zt == 2">
  65. <!-- 左边的首页按钮 -->
  66. <view style="width: 20%;" class="flex align-center justify-center">
  67. <u-icon name="home" size="50" @click="home"></u-icon>
  68. </view>
  69. <!-- 右边的其他按钮 -->
  70. <view style="width: 80%;" class="flex justify-end align-center">
  71. <view class="b">
  72. <u-button shape="circle" :custom-style="btStyle" @click="queren">确认接单</u-button>
  73. </view>
  74. </view>
  75. </view>
  76. <!-- 当订单状态为 zt==1 -->
  77. <view class="bottomButton" v-else-if="zt == 3">
  78. <!-- 左边的首页按钮 -->
  79. <view style="width: 20%;" class="flex align-center justify-center">
  80. <u-icon name="home" size="50" @click="home"></u-icon>
  81. </view>
  82. <!-- 右边的其他按钮 -->
  83. <view style="width: 80%;" class="flex justify-end align-center">
  84. <view class="b">
  85. <u-button shape="circle" :custom-style="btStyle" @click="querenok">确认完成</u-button>
  86. </view>
  87. </view>
  88. </view>
  89. <view class="bottomButton" v-else-if="zt > 3&&zt!=7">
  90. <!-- 左边的首页按钮 -->
  91. <view style="width: 20%;" class="flex align-center justify-center">
  92. <u-icon name="home" size="50" @click="home"></u-icon>
  93. </view>
  94. <!-- 右边的其他按钮 -->
  95. <view style="width: 80%;" class="flex justify-end align-center">
  96. <view class="b">
  97. <u-button shape="circle" :custom-style="btStyle" :disabled="true">已完成</u-button>
  98. </view>
  99. </view>
  100. </view>
  101. </view>
  102. </template>
  103. <script>
  104. export default {
  105. onLoad(options) {
  106. let ids = options.data;
  107. if (ids != '' && ids != 0) {
  108. this.xhrId = ids;
  109. // 执行渲染
  110. this.getInfos(ids);
  111. } else {
  112. uni.showToast({
  113. title: '请求错误',
  114. icon: 'none'
  115. })
  116. }
  117. console.log('详情:', options);
  118. },
  119. mounted() {
  120. },
  121. data() {
  122. return {
  123. xhrId: 0,
  124. // 上部数据
  125. orderID: 'ZX202000010', //订单号
  126. //中部数据
  127. name: '', //名字
  128. age: '', //年龄
  129. ID: '', //身份证
  130. appointment: '',
  131. //下部数据
  132. placeTime: '', //下单时间
  133. xiadankh: '', //下单客户
  134. zt: 0, // 状态 0未履行 1已完成
  135. local: '',
  136. //下部按钮样式
  137. bStyle: {
  138. width: '100%',
  139. height: '100%',
  140. fontSize: '28rpx',
  141. },
  142. btStyle: {
  143. width: '100%',
  144. height: '100%',
  145. fontSize: '28rpx',
  146. color: '#0B73B9',
  147. backgroundColor: '#FFFFFF'
  148. }
  149. }
  150. },
  151. methods: {
  152. /**
  153. * 详情渲染
  154. * @author Liu Yuanhang
  155. * @param {Object} id
  156. */
  157. getInfos: async function(id) {
  158. // 获取信息
  159. let res = await this.$request.post("patient/orderPatientDetail", {
  160. patient_id: id
  161. });
  162. if (res.status == 0) {
  163. let datas = res.data;
  164. this.orderID = datas.order_sn;
  165. this.name = datas.name;
  166. this.age = datas.numbirthday;
  167. this.ID = datas.card_number;
  168. this.appointment = datas.appoint_time;
  169. this.placeTime = datas.created_at;
  170. this.xiadankh = datas.nickname;
  171. this.zt = datas.order_status;
  172. this.local = datas.organization;
  173. } else {
  174. uni.showToast({
  175. title: res.message,
  176. duration: 3000
  177. })
  178. return false;
  179. }
  180. },
  181. /**
  182. * 接单
  183. * @author Liu Yuanhang
  184. * @param {Object} e
  185. */
  186. queren: async function(e) {
  187. this.zt = 3;
  188. let res = await this.$request.post("patient/putOrderPatient", {
  189. order_id: this.xhrId
  190. });
  191. console.log('接单:', res);
  192. if (res.status == 0) {
  193. uni.showToast({
  194. title: "接单成功!",
  195. duration: 3000
  196. })
  197. } else {
  198. uni.showToast({
  199. title: res.message,
  200. duration: 3000
  201. })
  202. }
  203. },
  204. /**
  205. * 门诊预约完成订单
  206. * @author Liu Yuanhang
  207. */
  208. querenok: async function() {
  209. this.zt = 4;
  210. let res = await this.$request.post("patient/mzPatientok", {
  211. order_id: this.xhrId
  212. });
  213. console.log('完成接单:', res);
  214. if (res.status == 0) {
  215. uni.showToast({
  216. title: "操作成功!",
  217. duration: 3000
  218. })
  219. } else {
  220. uni.showToast({
  221. title: res.message,
  222. duration: 3000
  223. })
  224. }
  225. console.log('确认订单完成')
  226. },
  227. home(e) {
  228. uni.switchTab({
  229. url: '/pages/index/index'
  230. })
  231. }
  232. }
  233. };
  234. </script>
  235. <style lang="scss">
  236. page {
  237. background-color: #f6f6f6;
  238. }
  239. .but {
  240. padding: 16rpx 30rpx;
  241. border-radius: 20rpx;
  242. background-color: #eaeaea;
  243. height: 50rpx;
  244. color: b1b1b1;
  245. display: flex;
  246. justify-content: center;
  247. align-items: center;
  248. font-weight: 400;
  249. font-size: 28rpx;
  250. }
  251. .nr {
  252. margin: 28rpx 0;
  253. display: flex;
  254. .left {
  255. width: 25%;
  256. color: #666666;
  257. }
  258. .right {
  259. width: 75%;
  260. }
  261. }
  262. .bottomButton {
  263. position: fixed;
  264. bottom: 0;
  265. left: 0;
  266. width: 100%;
  267. height: 100rpx;
  268. display: flex;
  269. background-color: #FFFFFF;
  270. z-index: 1;
  271. .b {
  272. /*按钮样式*/
  273. margin-right: 30rpx;
  274. padding: 20rpx 0rpx;
  275. height: 100%;
  276. width: 150rpx;
  277. }
  278. }
  279. </style>