cdac517b by lttnew

退款

1 parent 3daf0a09
// dev
const baseUrl_api = 'http://192.168.1.222:8787'
// const baseUrl_api = 'http://192.168.1.222:8787'
// const baseUrl_api = 'http://47.98.186.233:8787'
// const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/'
const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/'
const loginImage_api = 'https://tk001.wxjylt.com/stage-api'
const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
......
......@@ -69,7 +69,7 @@
<view class="info-line"></view>
<view class="info-item">
<text class="item-label">支付方式</text>
<text class="item-value">{{ item.ziZhangBu ? '对公转账' : '民生付' }}</text>
<text class="item-value">{{ String(item.payType) === '3' ? '对公转账' : '民生付' }}</text>
</view>
</view>
......
......@@ -33,7 +33,7 @@
</view>
<view class="info-row">
<text class="label">支付方式</text>
<text class="value">{{ form.ziZhangBu ? '对公转账' : '民生付' }}</text>
<text class="value">{{ String(form.payType) === '3' ? '对公转账' : '民生付' }}</text>
</view>
<view class="info-row">
<text class="label">提交日期</text>
......@@ -92,7 +92,7 @@
</view>
<view class="info-line">
<text class="info-label">支付方式</text>
<text class="info-value">{{ pay.ziZhangBu ? '对公转账' : '民生付' }}</text>
<text class="info-value">{{ String(pay.payType) === '3' ? '对公转账' : '民生付' }}</text>
</view>
<view class="info-line">
<text class="info-label">审核状态</text>
......
......@@ -24,7 +24,7 @@
<view>
支付方式
<view>
{{ item.ziZhangBu ? '对公转账' : '民生付' }}
{{ String(item.payType) === '3' ? '对公转账' : '民生付' }}
</view>
</view>
<view>
......
......@@ -33,7 +33,7 @@
</view>
<view class="info-item">
<text class="label">支付方式</text>
<text class="value">{{ form.ziZhangBu ? '对公转账' : '民生付' }}</text>
<text class="value">{{ String(form.payType) === '3' ? '对公转账' : '民生付' }}</text>
</view>
<view class="info-item">
<text class="label">提交日期</text>
......@@ -113,7 +113,7 @@
</view>
<view class="item-row">
<text class="item-label">支付方式</text>
<text class="item-value">{{ item.ziZhangBu ? '对公转账' : '民生付' }}</text>
<text class="item-value">{{ String(item.payType) === '3' ? '对公转账' : '民生付' }}</text>
</view>
<view class="item-row">
<text class="item-label">审核状态</text>
......
......@@ -80,7 +80,7 @@
<view class="data-header">
<text class="member-label">{{ getOrderLabel(item) }} ·</text>
<text class="value ml10">{{ item.wfCode || '——' }} ·</text>
<text class="pay-type ml10"> {{ item.payType == '3' ? '对公转账' : '民生付' }}</text>
<text class="pay-type ml10"> {{ String(item.payType) === '3' ? '对公转账' : '民生付' }}</text>
</view>
<text :class="{
'status-wait': item.payStatus == 3,
......
......@@ -113,7 +113,7 @@
</view>
<view class="price-row">
<text class="price-label">缴费方式</text>
<text class="price-value">{{ item.ziZhangBu ? '对公转账' : '民生付' }}</text>
<text class="price-value">{{ String(item.payType) === '3' ? '对公转账' : '民生付' }}</text>
</view>
<view class="price-row">
<text class="price-label">订单状态</text>
......
......@@ -37,10 +37,10 @@
<view class="data-header">
<text class="member-label">{{ getOrderLabel(item) }} ·</text>
<text class="value ml10">{{ item.wfCode || '——' }} · </text>
<text class="pay-type"> {{ item.payType == '3' ? '对公转账' : '民生付' }}</text>
<text class="pay-type">{{ getPayTypeText(item) }}</text>
</view>
<text :class="{
'status-wait': item.payStatus == 3,
'status-wait': item.payStatus == 4,
'status-pending': item.payStatus == 0,
'status-success': item.payStatus == 1,
'status-danger': item.payStatus == 2
......@@ -61,6 +61,9 @@
<view v-if="item.type==2||item.type==3||item.type==4" class="person">{{ item.content?.personCount || 0 }}</view>
</view>
</view>
<view v-if="canShowRefund(item)" class="btn-group">
<button class="btn btn-pay" @click.stop="handleRefund(item)">退款</button>
</view>
<!-- <view class="btn-group"><template v-if="hasInvoice(item)">
<button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看发票</button>
</template>
......@@ -151,6 +154,8 @@ import { ref, reactive, onMounted, computed } from 'vue';
import { onReachBottom, onLoad } from '@dcloudio/uni-app'
import * as api from '@/common/api.js'
import config from '@/config.js'
const app = getApp()
const deptType = ref(0)
// 标签栏配置
const tabs = ref([
......@@ -193,6 +198,7 @@ const currentOrder = ref(null);
// 页面加载
onLoad(option => {
deptType.value = Number(app.globalData?.deptType || 0)
if (option.type) {
const type = option.type;
const tabIndex = tabs.value.findIndex(tab => tab.type === type);
......@@ -297,11 +303,20 @@ const getStatusText = (status) => {
const map = {
0: '待缴费',
1: '缴费成功',
2: '订单取消'
2: '已取消',
4: '已退款'
};
return map[status] || '';
};
const getPayTypeText = (item) => {
return String(item?.payType) === '3' ? '对公转账' : '民生付'
}
const canShowRefund = (item) => {
return deptType.value === 1 && String(item?.payStatus) === '1' && String(item?.invoiceStatus) != '1'
}
const isPayDisabled = (item) => {
if (isPersonalOrder(item)) return String(item?.auditStatus) !== '9'
if (isLevelOrder(item)) return String(item?.auditStatus) !== '9'
......@@ -475,6 +490,27 @@ const confirmCancel = async () => {
}
};
const handleRefund = async (item) => {
const { confirm } = await uni.showModal({
title: '提示',
content: `缴费编号为"${item.wfCode}"的订单是否确认退款?`
})
if (!confirm) return
try {
uni.showLoading({ title: '处理中...' })
await api.refundOrder(item.id)
uni.showToast({ title: '操作成功', icon: 'success' })
pageNum.value = 1
list.value = []
hasMore.value = true
await initData()
} catch (e) {
uni.showToast({ title: '退款失败', icon: 'none' })
} finally {
uni.hideLoading()
}
}
// 关闭取消订单弹窗
const closeCancelPopup = () => {
showCancelPopup.value = false;
......@@ -511,6 +547,7 @@ const goToDetail = (item) => {
<style lang="scss" scoped>
.order-page {
background: #ededf0;
height: 100vh;
min-height: 100vh;
display: flex;
flex-direction: column;
......@@ -897,7 +934,7 @@ const goToDetail = (item) => {
.btn {
width: 140rpx;
height: 48rpx;
line-height: 48rpx;
line-height: 46rpx;
padding: 0;
border-radius: 10rpx;
font-size: 24rpx;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!