refundOrder.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. <view class="container">
  3. <view class="order-list">
  4. <view class="order-item" v-for="item,index in orderList" :key="index" @click="toDetails(item)">
  5. <view class="order-t-box">
  6. <view class="order-t-box-l">
  7. <view class="order-name">
  8. {{item.serviceName || '-'}}(数量:{{item.orderNum || '-'}})
  9. </view>
  10. <view class="order-no">
  11. <span>退款订单号:{{item.orderRefundNo || '-'}}</span>
  12. <image class="icon" :src="copyImg" mode="aspectFill"
  13. @click.stop="$utils.copyTxt(item.orderRefundNo)"></image>
  14. </view>
  15. </view>
  16. <view class="order-t-box-r">
  17. <span class="title">退款金额</span>
  18. <span class="price">¥{{item.refundAmount || '-'}}</span>
  19. </view>
  20. </view>
  21. <u-line color="#f0f0f0"></u-line>
  22. <view class="order-b-box">
  23. <view class="order-b-box-l">
  24. <view class="order-b-item">
  25. <span class="title">医院:</span>
  26. <span class="txt">{{item.orderVo.hospitalName || '-'}}</span>
  27. </view>
  28. <view class="order-b-item">
  29. <span class="title">科室:</span>
  30. <span class="txt">{{item.orderVo.hospitalDepartmentName || '-'}}</span>
  31. </view>
  32. <view class="order-b-item">
  33. <span class="title">就诊人:</span>
  34. <span
  35. class="txt">{{item.orderVo.patientName || '-'}}({{item.orderVo.patientMobile || '-'}})</span>
  36. </view>
  37. </view>
  38. <view class="order-b-box-r">
  39. <span class="status">{{getRefundTxt(item.refundStatus)}}</span>
  40. </view>
  41. </view>
  42. <u-line color="#f0f0f0"></u-line>
  43. <view class="btn-box">
  44. <span class="time">{{$utils.mFormatDate(item.createTime, 'yyyy-MM-dd HH:mm') || '-'}}</span>
  45. <view class="btn-box-r">
  46. <span class="btn btn1" v-if="item.refundStatus == 1"
  47. @click.stop="opration(item.id,'refuse')">拒绝退款</span>
  48. <span class="btn btn2" v-if="item.refundStatus == 1"
  49. @click.stop="opration(item.id,'agree')">同意退款</span>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="empty-box" v-if="!orderList.length">
  55. <u-image src="/static/none.png" mode="aspectFill" width="582rpx" height="582rpx"></u-image>
  56. <span class="empty-txt">暂无数据!</span>
  57. </view>
  58. <view style="width: 100%;padding-bottom: 40rpx;" v-else>
  59. <u-loadmore :status="status" :loading-text="loadingText" :loadmore-text="loadmoreText"
  60. :nomore-text="nomoreText" @loadmore="loadmore" dashed line marginTop="20" />
  61. </view>
  62. <!-- 操作 -->
  63. <u-popup :overlayStyle="{'touch-action':'none'}" closeable mode="bottom" :show="popShow" @close="popClose"
  64. @open="open" :round="20">
  65. <view class="pop-box">
  66. <view class="pop-title">{{popTile}}</view>
  67. <view class="pop-content">
  68. <u--form labelWidth="140rpx" labelPosition="top" :model="formData" :rules="rules" ref="uForm">
  69. <u-form-item label="实退金额" prop="actualRefundAmount" borderBottom required
  70. v-if="popType == 'agree'">
  71. <u--input type="number" maxlength="9" v-model="formData.actualRefundAmount"
  72. placeholder-class="input-placeholder" border="none" clearable
  73. placeholder="请输入"></u--input>
  74. </u-form-item>
  75. <u-form-item label="操作原因" prop="operationReason" borderBottom required>
  76. <u--textarea v-model="formData.operationReason" placeholder="请输入内容"></u--textarea>
  77. </u-form-item>
  78. </u--form>
  79. </view>
  80. <view class="footer-btn">
  81. <span class="btn" @click="confirm">确认</span>
  82. </view>
  83. </view>
  84. </u-popup>
  85. </view>
  86. </template>
  87. <script>
  88. import {
  89. getAfterSaleOrderList,
  90. getRefundStatus,
  91. agreeOrRefuseAfterSaleOrder
  92. } from "@/api/hospital.js"
  93. export default {
  94. data() {
  95. return {
  96. orderList: [],
  97. loading: false,
  98. pageSize: 10,
  99. pageNum: 1,
  100. botLoadingShow: 0, //0不显示 1显示 3.显示没有更多了
  101. loadingShow: false,
  102. status: 'loadmore',
  103. loadingText: '努力加载中',
  104. loadmoreText: '上拉或点击加载更多',
  105. nomoreText: '实在没有了',
  106. total: 0,
  107. customBar: 0, //状态栏高度 + 导航栏高度
  108. refundStatusList: [],
  109. popShow: false,
  110. popTile: '退款处置',
  111. popType: '',
  112. orderId: '',
  113. formData: {
  114. actualRefundAmount: '',
  115. operationReason: '',
  116. },
  117. rules: {
  118. actualRefundAmount: [{
  119. required: true,
  120. message: '请填写实退金额',
  121. trigger: ['blur', 'change'],
  122. }],
  123. operationReason: [{
  124. required: true,
  125. message: '请填写操作原因',
  126. trigger: ['blur', 'change'],
  127. }],
  128. }
  129. }
  130. },
  131. onReady() {
  132. this.$refs.uForm.setRules(this.rules);
  133. },
  134. onShow() {
  135. this.getOrderList("reload")
  136. },
  137. methods: {
  138. //获取订单列表
  139. getOrderList(reload) {
  140. let that = this;
  141. if (reload) {
  142. that.pageNum = 1;
  143. that.orderList = [];
  144. }
  145. uni.showLoading({
  146. title: '加载中',
  147. mask: true,
  148. });
  149. let param = {
  150. status: that.orderStatus,
  151. serviceName: that.serviceName,
  152. pageNum: that.pageNum,
  153. pageSize: that.pageSize,
  154. };
  155. getAfterSaleOrderList(param).then(res => {
  156. let data = res.rows;
  157. if (data) {
  158. that.orderList.push(...data); //在列表后面新增新获取的数据
  159. that.total = res.total; //获取数据总页数
  160. if (that.orderList.length >= that.total) {
  161. that.status = 'nomore';
  162. return;
  163. }
  164. } else {
  165. that.status = 'nomore';
  166. }
  167. })
  168. .catch((err) => {
  169. console.log(err);
  170. })
  171. .finally(() => {
  172. uni.hideLoading();
  173. });
  174. },
  175. getRefundTxt(value) {
  176. let obj = this.refundStatusList.find(item => item.code == value);;
  177. return obj ? obj.value : '-'
  178. },
  179. //查询退款状态
  180. getRefundStatus() {
  181. let that = this;
  182. getRefundStatus().then(res => {
  183. if (res.code == 200) {
  184. let data = res.data.refundStatus;
  185. this.refundStatusList = data;
  186. }
  187. })
  188. .catch((err) => {
  189. console.log(err);
  190. })
  191. },
  192. //去详情
  193. toDetails(item) {
  194. uni.navigateTo({
  195. url: '/pages/order/refundDetails?id=' + item.id + '&role=guanli'
  196. })
  197. },
  198. opration(id, type) {
  199. this.orderId = id;
  200. this.popShow = true;
  201. this.popType = type;
  202. },
  203. open() {
  204. this.popShow = true;
  205. },
  206. popClose() {
  207. this.popShow = false;
  208. },
  209. confirm() {
  210. let that = this;
  211. uni.showLoading({
  212. title: '操作中',
  213. mask: true,
  214. });
  215. that.$refs.uForm.validate().then((res) => {
  216. if (res) {
  217. that.formData.id = that.orderId
  218. that.formData.refundStatus = that.popType == 'agree' ? 2 : 3
  219. agreeOrRefuseAfterSaleOrder(this.formData).then(res => {
  220. uni.$u.toast('操作成功');
  221. that.formData = {
  222. actualRefundAmount: '',
  223. operationReason: '',
  224. }
  225. that.popClose();
  226. that.getOrderList('reload')
  227. }, err => {
  228. console.log(err);
  229. }).finally(() => {
  230. uni.hideLoading()
  231. });
  232. }
  233. })
  234. },
  235. }
  236. }
  237. </script>
  238. <style scoped lang="scss">
  239. .container {
  240. background-color: #f6f6f6;
  241. .order-list {
  242. margin: 20rpx;
  243. .order-item {
  244. margin-bottom: 20rpx;
  245. background-color: #fff;
  246. border-radius: 20rpx;
  247. padding: 10rpx 24rpx 30rpx;
  248. .order-t-box {
  249. display: flex;
  250. justify-content: space-between;
  251. align-items: flex-start;
  252. padding: 20rpx 0;
  253. .order-t-box-l {
  254. .order-name {
  255. font-size: 32rpx;
  256. font-weight: bold;
  257. }
  258. .order-no {
  259. display: flex;
  260. align-items: center;
  261. margin-top: 15rpx;
  262. font-size: 24rpx;
  263. color: #6F6F6F;
  264. .icon {
  265. width: 40rpx;
  266. height: 40rpx;
  267. margin-left: 10rpx;
  268. }
  269. }
  270. }
  271. .order-t-box-r {
  272. display: flex;
  273. align-items: center;
  274. flex-direction: column;
  275. .title {
  276. font-size: 24rpx;
  277. color: #6F6F6F;
  278. }
  279. .price {
  280. margin-top: 15rpx;
  281. font-size: 32rpx;
  282. font-weight: bold;
  283. color: #FF0000;
  284. }
  285. }
  286. }
  287. .order-b-box {
  288. display: flex;
  289. justify-content: space-between;
  290. align-items: center;
  291. padding: 20rpx 0;
  292. .order-b-box-l {
  293. flex: 1;
  294. .order-b-item {
  295. margin-bottom: 15rpx;
  296. &:last-child {
  297. margin-bottom: 0;
  298. }
  299. .title {
  300. font-size: 26rpx;
  301. color: #1A1A1A;
  302. }
  303. .txt {
  304. font-size: 26rpx;
  305. color: #808080;
  306. }
  307. }
  308. }
  309. .order-b-box-r {
  310. width: 110rpx;
  311. text-align: right;
  312. font-size: 24rpx;
  313. color: #0085FF;
  314. .cancle {
  315. color: #FF0000;
  316. }
  317. }
  318. }
  319. .btn-box {
  320. display: flex;
  321. align-items: center;
  322. justify-content: space-between;
  323. margin-top: 15rpx;
  324. .time {
  325. font-size: 24rpx;
  326. color: #6F6F6F;
  327. }
  328. .btn-box-r {
  329. display: flex;
  330. align-items: center;
  331. .btn {
  332. width: 160rpx;
  333. height: 60rpx;
  334. margin-left: 20rpx;
  335. line-height: 60rpx;
  336. text-align: center;
  337. background-color: #4B91D1;
  338. color: #fff;
  339. border-radius: 30rpx;
  340. font-size: 24rpx;
  341. }
  342. .btn1 {
  343. background-color: #fff;
  344. border: 1rpx solid #FF0000;
  345. color: #FF0000;
  346. }
  347. }
  348. }
  349. }
  350. }
  351. }
  352. .pop-box {
  353. .pop-title {
  354. font-size: 32rpx;
  355. font-weight: bold;
  356. text-align: center;
  357. padding: 20rpx 0;
  358. }
  359. .pop-content {
  360. margin-top: 30rpx;
  361. font-size: 28rpx;
  362. color: #6F6F6F;
  363. padding: 0rpx 40rpx;
  364. box-sizing: border-box;
  365. .tip-txt {
  366. display: flex;
  367. flex-direction: column;
  368. padding: 20rpx 0;
  369. width: 100%;
  370. .name {
  371. margin-bottom: 20rpx;
  372. }
  373. }
  374. }
  375. .footer-btn {
  376. display: flex;
  377. flex-direction: column;
  378. align-items: center;
  379. margin-top: 30rpx;
  380. padding: 20rpx 40rpx;
  381. .btn {
  382. width: 100%;
  383. padding: 20rpx 0;
  384. border: 1rpx solid #4B91D1;
  385. background-color: #4B91D1;
  386. border-radius: 40rpx;
  387. color: #fff;
  388. text-align: center;
  389. }
  390. }
  391. }
  392. </style>