退款
Showing
8 changed files
with
58 additions
and
21 deletions
| 1 | // dev | 1 | // dev |
| 2 | const baseUrl_api = 'http://192.168.1.222:8787' | 2 | // const baseUrl_api = 'http://192.168.1.222:8787' |
| 3 | // const baseUrl_api = 'http://47.98.186.233:8787' | 3 | // const baseUrl_api = 'http://47.98.186.233:8787' |
| 4 | // const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/' | 4 | const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/' |
| 5 | const loginImage_api = 'https://tk001.wxjylt.com/stage-api' | 5 | const loginImage_api = 'https://tk001.wxjylt.com/stage-api' |
| 6 | const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' | 6 | const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' |
| 7 | 7 | ... | ... |
| ... | @@ -69,7 +69,7 @@ | ... | @@ -69,7 +69,7 @@ |
| 69 | <view class="info-line"></view> | 69 | <view class="info-line"></view> |
| 70 | <view class="info-item"> | 70 | <view class="info-item"> |
| 71 | <text class="item-label">支付方式</text> | 71 | <text class="item-label">支付方式</text> |
| 72 | <text class="item-value">{{ item.ziZhangBu ? '对公转账' : '民生付' }}</text> | 72 | <text class="item-value">{{ String(item.payType) === '3' ? '对公转账' : '民生付' }}</text> |
| 73 | </view> | 73 | </view> |
| 74 | </view> | 74 | </view> |
| 75 | 75 | ... | ... |
| ... | @@ -33,7 +33,7 @@ | ... | @@ -33,7 +33,7 @@ |
| 33 | </view> | 33 | </view> |
| 34 | <view class="info-row"> | 34 | <view class="info-row"> |
| 35 | <text class="label">支付方式</text> | 35 | <text class="label">支付方式</text> |
| 36 | <text class="value">{{ form.ziZhangBu ? '对公转账' : '民生付' }}</text> | 36 | <text class="value">{{ String(form.payType) === '3' ? '对公转账' : '民生付' }}</text> |
| 37 | </view> | 37 | </view> |
| 38 | <view class="info-row"> | 38 | <view class="info-row"> |
| 39 | <text class="label">提交日期</text> | 39 | <text class="label">提交日期</text> |
| ... | @@ -92,7 +92,7 @@ | ... | @@ -92,7 +92,7 @@ |
| 92 | </view> | 92 | </view> |
| 93 | <view class="info-line"> | 93 | <view class="info-line"> |
| 94 | <text class="info-label">支付方式</text> | 94 | <text class="info-label">支付方式</text> |
| 95 | <text class="info-value">{{ pay.ziZhangBu ? '对公转账' : '民生付' }}</text> | 95 | <text class="info-value">{{ String(pay.payType) === '3' ? '对公转账' : '民生付' }}</text> |
| 96 | </view> | 96 | </view> |
| 97 | <view class="info-line"> | 97 | <view class="info-line"> |
| 98 | <text class="info-label">审核状态</text> | 98 | <text class="info-label">审核状态</text> | ... | ... |
| ... | @@ -24,7 +24,7 @@ | ... | @@ -24,7 +24,7 @@ |
| 24 | <view> | 24 | <view> |
| 25 | 支付方式 | 25 | 支付方式 |
| 26 | <view> | 26 | <view> |
| 27 | {{ item.ziZhangBu ? '对公转账' : '民生付' }} | 27 | {{ String(item.payType) === '3' ? '对公转账' : '民生付' }} |
| 28 | </view> | 28 | </view> |
| 29 | </view> | 29 | </view> |
| 30 | <view> | 30 | <view> |
| ... | @@ -198,4 +198,4 @@ | ... | @@ -198,4 +198,4 @@ |
| 198 | font-size: 26rpx; | 198 | font-size: 26rpx; |
| 199 | color: #999; | 199 | color: #999; |
| 200 | } | 200 | } |
| 201 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 201 | </style> | ... | ... |
| ... | @@ -33,7 +33,7 @@ | ... | @@ -33,7 +33,7 @@ |
| 33 | </view> | 33 | </view> |
| 34 | <view class="info-item"> | 34 | <view class="info-item"> |
| 35 | <text class="label">支付方式</text> | 35 | <text class="label">支付方式</text> |
| 36 | <text class="value">{{ form.ziZhangBu ? '对公转账' : '民生付' }}</text> | 36 | <text class="value">{{ String(form.payType) === '3' ? '对公转账' : '民生付' }}</text> |
| 37 | </view> | 37 | </view> |
| 38 | <view class="info-item"> | 38 | <view class="info-item"> |
| 39 | <text class="label">提交日期</text> | 39 | <text class="label">提交日期</text> |
| ... | @@ -113,7 +113,7 @@ | ... | @@ -113,7 +113,7 @@ |
| 113 | </view> | 113 | </view> |
| 114 | <view class="item-row"> | 114 | <view class="item-row"> |
| 115 | <text class="item-label">支付方式</text> | 115 | <text class="item-label">支付方式</text> |
| 116 | <text class="item-value">{{ item.ziZhangBu ? '对公转账' : '民生付' }}</text> | 116 | <text class="item-value">{{ String(item.payType) === '3' ? '对公转账' : '民生付' }}</text> |
| 117 | </view> | 117 | </view> |
| 118 | <view class="item-row"> | 118 | <view class="item-row"> |
| 119 | <text class="item-label">审核状态</text> | 119 | <text class="item-label">审核状态</text> | ... | ... |
| ... | @@ -80,7 +80,7 @@ | ... | @@ -80,7 +80,7 @@ |
| 80 | <view class="data-header"> | 80 | <view class="data-header"> |
| 81 | <text class="member-label">{{ getOrderLabel(item) }} ·</text> | 81 | <text class="member-label">{{ getOrderLabel(item) }} ·</text> |
| 82 | <text class="value ml10">{{ item.wfCode || '——' }} ·</text> | 82 | <text class="value ml10">{{ item.wfCode || '——' }} ·</text> |
| 83 | <text class="pay-type ml10"> {{ item.payType == '3' ? '对公转账' : '民生付' }}</text> | 83 | <text class="pay-type ml10"> {{ String(item.payType) === '3' ? '对公转账' : '民生付' }}</text> |
| 84 | </view> | 84 | </view> |
| 85 | <text :class="{ | 85 | <text :class="{ |
| 86 | 'status-wait': item.payStatus == 3, | 86 | 'status-wait': item.payStatus == 3, | ... | ... |
| ... | @@ -113,7 +113,7 @@ | ... | @@ -113,7 +113,7 @@ |
| 113 | </view> | 113 | </view> |
| 114 | <view class="price-row"> | 114 | <view class="price-row"> |
| 115 | <text class="price-label">缴费方式</text> | 115 | <text class="price-label">缴费方式</text> |
| 116 | <text class="price-value">{{ item.ziZhangBu ? '对公转账' : '民生付' }}</text> | 116 | <text class="price-value">{{ String(item.payType) === '3' ? '对公转账' : '民生付' }}</text> |
| 117 | </view> | 117 | </view> |
| 118 | <view class="price-row"> | 118 | <view class="price-row"> |
| 119 | <text class="price-label">订单状态</text> | 119 | <text class="price-label">订单状态</text> | ... | ... |
| ... | @@ -37,15 +37,15 @@ | ... | @@ -37,15 +37,15 @@ |
| 37 | <view class="data-header"> | 37 | <view class="data-header"> |
| 38 | <text class="member-label">{{ getOrderLabel(item) }} ·</text> | 38 | <text class="member-label">{{ getOrderLabel(item) }} ·</text> |
| 39 | <text class="value ml10">{{ item.wfCode || '——' }} · </text> | 39 | <text class="value ml10">{{ item.wfCode || '——' }} · </text> |
| 40 | <text class="pay-type"> {{ item.payType == '3' ? '对公转账' : '民生付' }}</text> | 40 | <text class="pay-type">{{ getPayTypeText(item) }}</text> |
| 41 | </view> | 41 | </view> |
| 42 | <text :class="{ | 42 | <text :class="{ |
| 43 | 'status-wait': item.payStatus == 3, | 43 | 'status-wait': item.payStatus == 4, |
| 44 | 'status-pending': item.payStatus == 0, | 44 | 'status-pending': item.payStatus == 0, |
| 45 | 'status-success': item.payStatus == 1, | 45 | 'status-success': item.payStatus == 1, |
| 46 | 'status-danger': item.payStatus == 2 | 46 | 'status-danger': item.payStatus == 2 |
| 47 | }" | 47 | }" |
| 48 | class="status-tag">{{ getStatusText(item.payStatus) }} | 48 | class="status-tag">{{ getStatusText(item.payStatus) }} |
| 49 | </text> | 49 | </text> |
| 50 | </view> | 50 | </view> |
| 51 | </view> | 51 | </view> |
| ... | @@ -61,6 +61,9 @@ | ... | @@ -61,6 +61,9 @@ |
| 61 | <view v-if="item.type==2||item.type==3||item.type==4" class="person">共{{ item.content?.personCount || 0 }}人</view> | 61 | <view v-if="item.type==2||item.type==3||item.type==4" class="person">共{{ item.content?.personCount || 0 }}人</view> |
| 62 | </view> | 62 | </view> |
| 63 | </view> | 63 | </view> |
| 64 | <view v-if="canShowRefund(item)" class="btn-group"> | ||
| 65 | <button class="btn btn-pay" @click.stop="handleRefund(item)">退款</button> | ||
| 66 | </view> | ||
| 64 | <!-- <view class="btn-group"><template v-if="hasInvoice(item)"> | 67 | <!-- <view class="btn-group"><template v-if="hasInvoice(item)"> |
| 65 | <button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看发票</button> | 68 | <button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看发票</button> |
| 66 | </template> | 69 | </template> |
| ... | @@ -151,6 +154,8 @@ import { ref, reactive, onMounted, computed } from 'vue'; | ... | @@ -151,6 +154,8 @@ import { ref, reactive, onMounted, computed } from 'vue'; |
| 151 | import { onReachBottom, onLoad } from '@dcloudio/uni-app' | 154 | import { onReachBottom, onLoad } from '@dcloudio/uni-app' |
| 152 | import * as api from '@/common/api.js' | 155 | import * as api from '@/common/api.js' |
| 153 | import config from '@/config.js' | 156 | import config from '@/config.js' |
| 157 | const app = getApp() | ||
| 158 | const deptType = ref(0) | ||
| 154 | 159 | ||
| 155 | // 标签栏配置 | 160 | // 标签栏配置 |
| 156 | const tabs = ref([ | 161 | const tabs = ref([ |
| ... | @@ -193,6 +198,7 @@ const currentOrder = ref(null); | ... | @@ -193,6 +198,7 @@ const currentOrder = ref(null); |
| 193 | 198 | ||
| 194 | // 页面加载 | 199 | // 页面加载 |
| 195 | onLoad(option => { | 200 | onLoad(option => { |
| 201 | deptType.value = Number(app.globalData?.deptType || 0) | ||
| 196 | if (option.type) { | 202 | if (option.type) { |
| 197 | const type = option.type; | 203 | const type = option.type; |
| 198 | const tabIndex = tabs.value.findIndex(tab => tab.type === type); | 204 | const tabIndex = tabs.value.findIndex(tab => tab.type === type); |
| ... | @@ -297,11 +303,20 @@ const getStatusText = (status) => { | ... | @@ -297,11 +303,20 @@ const getStatusText = (status) => { |
| 297 | const map = { | 303 | const map = { |
| 298 | 0: '待缴费', | 304 | 0: '待缴费', |
| 299 | 1: '缴费成功', | 305 | 1: '缴费成功', |
| 300 | 2: '订单取消' | 306 | 2: '已取消', |
| 307 | 4: '已退款' | ||
| 301 | }; | 308 | }; |
| 302 | return map[status] || ''; | 309 | return map[status] || ''; |
| 303 | }; | 310 | }; |
| 304 | 311 | ||
| 312 | const getPayTypeText = (item) => { | ||
| 313 | return String(item?.payType) === '3' ? '对公转账' : '民生付' | ||
| 314 | } | ||
| 315 | |||
| 316 | const canShowRefund = (item) => { | ||
| 317 | return deptType.value === 1 && String(item?.payStatus) === '1' && String(item?.invoiceStatus) != '1' | ||
| 318 | } | ||
| 319 | |||
| 305 | const isPayDisabled = (item) => { | 320 | const isPayDisabled = (item) => { |
| 306 | if (isPersonalOrder(item)) return String(item?.auditStatus) !== '9' | 321 | if (isPersonalOrder(item)) return String(item?.auditStatus) !== '9' |
| 307 | if (isLevelOrder(item)) return String(item?.auditStatus) !== '9' | 322 | if (isLevelOrder(item)) return String(item?.auditStatus) !== '9' |
| ... | @@ -475,6 +490,27 @@ const confirmCancel = async () => { | ... | @@ -475,6 +490,27 @@ const confirmCancel = async () => { |
| 475 | } | 490 | } |
| 476 | }; | 491 | }; |
| 477 | 492 | ||
| 493 | const handleRefund = async (item) => { | ||
| 494 | const { confirm } = await uni.showModal({ | ||
| 495 | title: '提示', | ||
| 496 | content: `缴费编号为"${item.wfCode}"的订单是否确认退款?` | ||
| 497 | }) | ||
| 498 | if (!confirm) return | ||
| 499 | try { | ||
| 500 | uni.showLoading({ title: '处理中...' }) | ||
| 501 | await api.refundOrder(item.id) | ||
| 502 | uni.showToast({ title: '操作成功', icon: 'success' }) | ||
| 503 | pageNum.value = 1 | ||
| 504 | list.value = [] | ||
| 505 | hasMore.value = true | ||
| 506 | await initData() | ||
| 507 | } catch (e) { | ||
| 508 | uni.showToast({ title: '退款失败', icon: 'none' }) | ||
| 509 | } finally { | ||
| 510 | uni.hideLoading() | ||
| 511 | } | ||
| 512 | } | ||
| 513 | |||
| 478 | // 关闭取消订单弹窗 | 514 | // 关闭取消订单弹窗 |
| 479 | const closeCancelPopup = () => { | 515 | const closeCancelPopup = () => { |
| 480 | showCancelPopup.value = false; | 516 | showCancelPopup.value = false; |
| ... | @@ -511,6 +547,7 @@ const goToDetail = (item) => { | ... | @@ -511,6 +547,7 @@ const goToDetail = (item) => { |
| 511 | <style lang="scss" scoped> | 547 | <style lang="scss" scoped> |
| 512 | .order-page { | 548 | .order-page { |
| 513 | background: #ededf0; | 549 | background: #ededf0; |
| 550 | height: 100vh; | ||
| 514 | min-height: 100vh; | 551 | min-height: 100vh; |
| 515 | display: flex; | 552 | display: flex; |
| 516 | flex-direction: column; | 553 | flex-direction: column; |
| ... | @@ -897,7 +934,7 @@ const goToDetail = (item) => { | ... | @@ -897,7 +934,7 @@ const goToDetail = (item) => { |
| 897 | .btn { | 934 | .btn { |
| 898 | width: 140rpx; | 935 | width: 140rpx; |
| 899 | height: 48rpx; | 936 | height: 48rpx; |
| 900 | line-height: 48rpx; | 937 | line-height: 46rpx; |
| 901 | padding: 0; | 938 | padding: 0; |
| 902 | border-radius: 10rpx; | 939 | border-radius: 10rpx; |
| 903 | font-size: 24rpx; | 940 | font-size: 24rpx; |
| ... | @@ -945,4 +982,4 @@ const goToDetail = (item) => { | ... | @@ -945,4 +982,4 @@ const goToDetail = (item) => { |
| 945 | } | 982 | } |
| 946 | } | 983 | } |
| 947 | } | 984 | } |
| 948 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 985 | </style> | ... | ... |
-
Please register or sign in to post a comment