detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. <template>
  2. <view v-if="info">
  3. <view class="order-header">
  4. <view class="order-header-body">
  5. <view class="order-header-left">
  6. <image src="../../images/address.png" mode="aspectFit"></image>
  7. </view>
  8. <view class="order-header-main">
  9. <view>所属科室:{{info.depName}}</view>
  10. <view>联系人:{{info.contact}}</view>
  11. <view>联系电话:{{info.phone}}</view>
  12. </view>
  13. <view class="order-header-right">
  14. <span class="status" v-if="info.status == 0">待分配</span>
  15. <span class="status" v-if="info.status == 1">进行中</span>
  16. <span class="status" v-if="info.status == 2">已完成</span>
  17. <span class="status" v-if="info.status == 3">已作废</span>
  18. <span class="status2" v-if="info.status == 4"><span class="yjs">(已结算)</span></span>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="container">
  23. <view class="order-box">
  24. <view class="order-box-title">订单基础信息</view>
  25. <view class="order-box-list">
  26. <view class="order-box-list-title">病人姓名</view>
  27. <view class="order-box-list-val">{{info.name}}</view>
  28. </view>
  29. <view class="order-box-list">
  30. <view class="order-box-list-title">病人性别</view>
  31. <view class="order-box-list-val">
  32. <span v-if="info.gender == 1">男</span>
  33. <span v-if="info.gender == 2">女</span>
  34. </view>
  35. </view>
  36. <view class="order-box-list">
  37. <view class="order-box-list-title">病人年龄</view>
  38. <view class="order-box-list-val">{{info.age}}</view>
  39. </view>
  40. <view class="order-box-list">
  41. <view class="order-box-list-title">病人床号</view>
  42. <view class="order-box-list-val">{{info.bed}}</view>
  43. </view>
  44. <view class="order-box-list">
  45. <view class="order-box-list-title">所患疾病</view>
  46. <view class="order-box-list-val">{{info.ill}}</view>
  47. </view>
  48. <view class="order-box-list">
  49. <view class="order-box-list-title">服务类型</view>
  50. <view class="order-box-list-val">{{info.cateName}}</view>
  51. </view>
  52. <view class="order-box-list">
  53. <view class="order-box-list-title">单价(/人/天)</view>
  54. <view class="order-box-list-val">{{info.price}}</view>
  55. </view>
  56. <view class="order-box-list">
  57. <view class="order-box-list-title">开始时间</view>
  58. <view class="order-box-list-val">{{info.start}}</view>
  59. </view>
  60. <view class="order-box-list">
  61. <view class="order-box-list-title">结束时间</view>
  62. <view class="order-box-list-val">{{info.end}}</view>
  63. </view>
  64. <view class="order-box-list">
  65. <view class="order-box-list-title">结束时间</view>
  66. <view class="order-box-list-val">{{info.end}}</view>
  67. </view>
  68. <view class="order-box-list">
  69. <view class="order-box-list-title">预收金</view>
  70. <view class="order-box-list-val">{{info.preMoney}}</view>
  71. </view>
  72. <view class="order-box-list">
  73. <view class="order-box-list-title">订单金额</view>
  74. <view class="order-box-list-val">{{info.amount}}</view>
  75. </view>
  76. <view class="order-box-list">
  77. <view class="order-box-list-title">服务费</view>
  78. <view class="order-box-list-val">{{info.serviceMoney}}</view>
  79. </view>
  80. <view class="order-box-list2">
  81. <view class="order-box-list-title">备注</view>
  82. <view class="order-box-list-val">{{info.remark?info.remark:'无'}}</view>
  83. </view>
  84. </view>
  85. <view class="order-box2">
  86. <view>订单号:{{info.sn}}</view>
  87. <view>下单日期:{{info.createTime}}</view>
  88. <view v-if="info.finishTime">完成日期:{{info.finishTime}}</view>
  89. <view v-if="info.canceTime">作废日期:{{info.canceTime}}</view>
  90. <view v-if="info.cancelUserName">作废人:{{info.cancelUserName}}</view>
  91. <view v-if="info.cancelReason">作废原因:{{info.cancelReason}}</view>
  92. </view>
  93. <view v-if="info.todo.length > 0">
  94. <view>工单信息</view>
  95. <view v-for="(item,index) in info.todo" class="order-box2">
  96. <view>调度:{{item.userName}}</view>
  97. <view>护工:{{item.workerName}}</view>
  98. <view>开始时间:{{item.start}}</view>
  99. <view>结束时间:{{item.end}}</view>
  100. <view>备注:{{item.remark}}</view>
  101. <view>状态:
  102. <span v-if="item.status == 0">已作废</span>
  103. <span v-if="item.status == 1">服务中</span>
  104. <span v-if="item.status == 2">已结束</span>
  105. </view>
  106. <view>派发日期:{{item.createTime}}</view>
  107. </view>
  108. </view>
  109. <view v-if="info.pays2.length > 0">
  110. <view>服务费信息</view>
  111. <view v-for="(item,index) in info.pays2" class="order-box3">
  112. <view>金额:¥{{item.money}}</view>
  113. <view>退款金额:¥{{item.money2}}</view>
  114. <view>支付方式:
  115. <span v-if="item.type === 2">线上</span>
  116. <span v-if="item.type === 1">线下</span>
  117. </view>
  118. <view>日期:{{item.payTime}}</view>
  119. </view>
  120. </view>
  121. <view v-if="info.pays.length > 0">
  122. <view>预收金信息</view>
  123. <view v-for="(item,index) in info.pays" class="order-box3">
  124. <view>金额:¥{{item.money}}</view>
  125. <view>退款金额:¥{{item.money2}}</view>
  126. <view>支付方式:
  127. <span v-if="item.type === 2">线上</span>
  128. <span v-if="item.type === 1">线下</span>
  129. </view>
  130. <view>日期:{{item.payTime}}</view>
  131. </view>
  132. </view>
  133. <view v-if="info.status == 0||info.status == 1" class="btn" @click="finishBtn()">预收金</view>
  134. <!-- <view v-if="info.status == 1" class="btn btn-success" @click="finishBtn()">完成</view>
  135. <view v-if="info.status != 3&&info.status != 4" class="btn btn-danger" @click="cancelBtn()">作废</view> -->
  136. </view>
  137. <cmodal :show.sync="cancelShow" title="作废订单" @confirm="cancelConfirm">
  138. <textarea v-model="cancelReason" style="height: 150rpx;" placeholder="请输入作废原因"></textarea>
  139. </cmodal>
  140. <cmodal :show.sync="finishShow" title="预收金" @confirm="finishConfirm" @cancel="cancelFinishConfirm">
  141. <view class="form-box3">
  142. <view class="form-box-label">金额 <text class="text-red">*</text></view>
  143. <view class="form-box-content">
  144. <input type="number" v-model="amount" placeholder="请填写金额" />
  145. </view>
  146. </view>
  147. </cmodal>
  148. </view>
  149. </template>
  150. <script>
  151. var app = getApp();
  152. import cpicker from "../../components/cpicker/cpicker.vue";
  153. import wpicker from "../../components/w-picker/w-picker.vue";
  154. import cmodal from "../../components/cmodel/cmodel.vue";
  155. export default {
  156. components: {
  157. cpicker,
  158. wpicker,
  159. cmodal
  160. },
  161. data() {
  162. return {
  163. info: null,
  164. flag: 0,
  165. id: 0,
  166. cancelReason: '',
  167. cancelShow: false,
  168. end: '',
  169. finishShow: false,
  170. endShow: false,
  171. amount: '',
  172. wx: null,
  173. }
  174. },
  175. onLoad(option) {
  176. this.id = option.id;
  177. let that = this;
  178. if (this.$wechat && this.$wechat.isWechat()) {//获取定位经纬度
  179. this.$wechat.getWx(function (res) {
  180. console.log(res)
  181. that.wx = res;
  182. });
  183. }
  184. },
  185. onShow() {
  186. var that = this;
  187. app.ajaxReadyCallback = res => { //各个接口统一回调方法
  188. var apiname = res.data.apiname;
  189. console.log(res);
  190. if(apiname == 'order'){
  191. that.info = res.data.data;
  192. }else if(apiname == 'payOrder'){
  193. that.getPayParam(res.data.data.payId);
  194. }else if(apiname == 'pay'){
  195. if(that.wx){
  196. that.wx.chooseWXPay({
  197. timestamp: res.data.data.timestamp,
  198. nonceStr: res.data.data.nonceStr,
  199. package: res.data.data.package,
  200. signType: res.data.data.signType,
  201. paySign: res.data.data.paySign,
  202. success: function (r) {
  203. // 支付成功后的回调函数
  204. if (r.errMsg == "chooseWXPay:ok") {
  205. window.location.reload();
  206. } else {
  207. uni.showToast({
  208. title: '支付失败',
  209. icon: 'none',
  210. duration: 2000
  211. })
  212. }
  213. },
  214. cancel: function(r) {},
  215. fail:function(r){
  216. uni.showToast({
  217. title: '支付失败',
  218. icon: 'none',
  219. duration: 2000
  220. })
  221. }
  222. });
  223. }else{
  224. uni.showToast({
  225. title: '支付调用失败,请刷新重试',
  226. icon: 'none',
  227. duration: 2000
  228. })
  229. }
  230. }
  231. }
  232. this.getOrderDetail();
  233. },
  234. methods: {
  235. getOrderDetail(){
  236. app.ajax({
  237. url: app.globalData.serverUrl + 'PhOrders/detail',
  238. type: 'POST',
  239. apiname: 'order',
  240. data:{
  241. id: this.id
  242. }
  243. });
  244. },
  245. sendOrder(id){
  246. uni.navigateTo({
  247. url: '/pages/order/send?orderId='+id
  248. });
  249. },
  250. cancelBtn(){
  251. this.cancelShow = true;
  252. console.log(orderId,this.cancelShow);
  253. },
  254. cancelConfirm(){
  255. app.ajax({
  256. url: app.globalData.serverUrl + 'Order/cancel',
  257. type: 'POST',
  258. apiname: 'cancel',
  259. data: {
  260. cancelReason: this.cancelReason,
  261. id: this.id
  262. }
  263. });
  264. },
  265. selectEnd(){
  266. this.endShow = true;
  267. },
  268. onConfirm(e,type){
  269. this.end = e.result;
  270. },
  271. finishBtn(){
  272. this.finishShow = true;
  273. this.endShow = false;
  274. this.amount = '';
  275. },
  276. finishConfirm(){
  277. if(!this.amount || this.amount <= 0){
  278. uni.showToast({
  279. title: '未输入金额',
  280. icon: 'none',
  281. duration: 2000
  282. })
  283. return;
  284. }
  285. app.ajax({
  286. url: app.globalData.serverUrl + 'PhOrders/payOrder',
  287. type: 'POST',
  288. apiname: 'payOrder',
  289. data: {
  290. orderId: this.id,
  291. money: this.amount
  292. }
  293. });
  294. },
  295. getPayParam(payId){
  296. app.ajax({
  297. url: app.globalData.serverUrl + 'PhOrders/pay',
  298. type: 'POST',
  299. apiname: 'pay',
  300. data: {
  301. payId: payId
  302. }
  303. });
  304. },
  305. cancelFinishConfirm(){
  306. this.end = '';
  307. },
  308. getUrlCode (name) {
  309. return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ''])[1].replace(/\+/g, '%20')) || null
  310. },
  311. }
  312. }
  313. </script>
  314. <style lang="scss" scoped>
  315. page{
  316. overflow-x: hidden;
  317. }
  318. .container{
  319. overflow: hidden;
  320. }
  321. .btn{
  322. // width: 100%;
  323. height: 90rpx;
  324. line-height: 90rpx;
  325. text-align: center;
  326. font-size: 34rpx;
  327. font-weight: bold;
  328. border-radius: 10rpx;
  329. background-color: #FFFFFF;
  330. color: var(--themeColor);
  331. // margin: 10rpx;
  332. }
  333. .btn.btn-success{
  334. background-color: #5cb85c;
  335. color: #FFFFFF;
  336. }
  337. .btn.btn-danger{
  338. background-color: #FF7576;
  339. color: #FFFFFF;
  340. }
  341. .order-box2{
  342. width: 670rpx;
  343. height: auto;
  344. border-radius: 10rpx;
  345. background-color: #FFFFFF;
  346. overflow: hidden;
  347. padding: 30rpx 20rpx;
  348. margin: 20rpx 0;
  349. color: #666666;
  350. font-size: 28rpx;
  351. }
  352. .order-box{
  353. width: 100%;
  354. height: auto;
  355. border-radius: 10rpx;
  356. background-color: #FFFFFF;
  357. overflow: hidden;
  358. }
  359. .order-box-title{
  360. position: relative;
  361. width: 680rpx;
  362. height: 90rpx;
  363. line-height: 90rpx;
  364. padding-left: 30rpx;
  365. color: #333333;
  366. font-size: 34rpx;
  367. font-weight: bold;
  368. }
  369. .order-box-title::before{
  370. content: '';
  371. width: 5rpx;
  372. height: 28rpx;
  373. position: absolute;
  374. left: 16rpx;
  375. top: 32rpx;
  376. background-color: var(--themeColor);
  377. }
  378. .order-box-list{
  379. width: 670rpx;
  380. min-height: 90rpx;
  381. height: auto;
  382. padding: 0 20rpx;
  383. overflow: hidden;
  384. }
  385. .order-box-list .order-box-list-title{
  386. width: 270rpx;
  387. height: 90rpx;
  388. line-height: 90rpx;
  389. float: left;
  390. color: #333333;
  391. font-size: 34rpx;
  392. font-weight: bold;
  393. }
  394. .order-box-list .order-box-list-val{
  395. width: 380rpx;
  396. min-height: 62rpx;
  397. float: right;
  398. color: #333333;
  399. font-size: 30rpx;
  400. font-weight: bold;
  401. padding-top: 28rpx;
  402. text-align: right;
  403. }
  404. .order-box-list2{
  405. width: 670rpx;
  406. min-height: 90rpx;
  407. height: auto;
  408. padding: 0 20rpx;
  409. overflow: hidden;
  410. }
  411. .order-box-list2 .order-box-list-title{
  412. width: 100%;
  413. height: 90rpx;
  414. line-height: 90rpx;
  415. color: #333333;
  416. font-size: 34rpx;
  417. font-weight: bold;
  418. }
  419. .order-box-list2 .order-box-list-val{
  420. width: 630rpx;
  421. min-height: 50rpx;
  422. height: auto;
  423. color: #333333;
  424. font-size: 30rpx;
  425. font-weight: bold;
  426. background-color: #F7F7F7;
  427. border-radius: 10rpx;
  428. padding: 20rpx;
  429. margin-bottom: 20rpx;
  430. }
  431. .order-header{
  432. background-color: var(--themeColor);
  433. width: 100%;
  434. height: auto;
  435. padding: 20rpx;
  436. }
  437. .order-header .order-header-body{
  438. width: 650rpx;
  439. height: 124rpx;
  440. padding: 30rpx;
  441. background-color: #FFFFFF;
  442. border-radius: 10rpx;
  443. }
  444. .order-header-left{
  445. width: 100rpx;
  446. height: 124rpx;
  447. float: left;
  448. }
  449. .order-header-left image{
  450. width: 70rpx;
  451. height: 70rpx;
  452. margin-top: 30rpx;
  453. }
  454. .order-header-main{
  455. width: 400rpx;
  456. height: 124rpx;
  457. float: left;
  458. color: #333333;
  459. font-size: 26rpx;
  460. }
  461. .order-header-main view{
  462. padding: 5rpx 0;
  463. }
  464. .order-header-right{
  465. width: 150rpx;
  466. height: 124rpx;
  467. // line-height: 124rpx;
  468. float: right;
  469. color: var(--themeColor);
  470. font-size: 34rpx;
  471. text-align: right;
  472. // overflow: hidden;
  473. }
  474. .order-header-right .status{
  475. display: inline-block;
  476. margin-top: 35rpx;
  477. }
  478. .order-header-right .status2{
  479. display: inline-block;
  480. margin-top: 15rpx;
  481. }
  482. .order-header-right .yjs{
  483. display: inline-block;
  484. margin-top: 5rpx;
  485. text-align: right;
  486. font-size: 29rpx;
  487. }
  488. .order-box3{
  489. width: 670rpx;
  490. height: auto;
  491. border-radius: 10rpx;
  492. background-color: #FFFFFF;
  493. overflow: hidden;
  494. padding: 30rpx 20rpx;
  495. margin: 20rpx 0;
  496. color: #666666;
  497. font-size: 28rpx;
  498. border-left: 5px solid var(--themeColor);
  499. }
  500. </style>