987c2878 by zhangmeng

个缴费

1 parent f584c37d
...@@ -1681,6 +1681,36 @@ export function goPay(params) { ...@@ -1681,6 +1681,36 @@ export function goPay(params) {
1681 }) 1681 })
1682 } 1682 }
1683 1683
1684
1685 // 再次支付
1686 export function payForOrder(params) {
1687 let url = `/common/order/payForOrder/${params.id}`
1688 const queryParams = []
1689 if (params.id) queryParams.push(`id=${params.id}`)
1690 if (params.payType) queryParams.push(`payType=${params.payType}`)
1691 if (queryParams.length > 0) {
1692 url += '?' + queryParams.join('&')
1693 }
1694 return request({
1695 url,
1696 method: 'post',
1697 showLoading: false
1698 })
1699 }
1700
1701 /**
1702 * 取消订单
1703 * @param params
1704 * @returns {*}
1705 */
1706 export function cancelOrder(id) {
1707 return request({
1708 url: `/common/order/cancelOrder/${id}`,
1709 method: 'post'
1710 })
1711 }
1712
1713
1684 // 缴费单列表学员 1714 // 缴费单列表学员
1685 export function listAPI(params) { 1715 export function listAPI(params) {
1686 return request({ 1716 return request({
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
5 <view class="yearRow"> 5 <view class="yearRow">
6 <view class="label">缴费年限</view> 6 <view class="label">缴费年限</view>
7 <view class="control"> 7 <view class="control">
8 <image v-if="form.payYear > 1" :src="config.baseUrl_api + '/fs/static/dd_02.png'" class="icon" 8 <image v-if="form.payYear > 1&& !form.id" :src="config.baseUrl_api + '/fs/static/dd_02.png'" class="icon"
9 mode="widthFix" 9 mode="widthFix"
10 @click="minusYear"></image> 10 @click="minusYear"></image>
11 <image v-else :src="config.baseUrl_api + '/fs/static/dd_02_g.png'" class="icon" mode="widthFix"></image> 11 <image v-else :src="config.baseUrl_api + '/fs/static/dd_02_g.png'" class="icon" mode="widthFix"></image>
12 <text class="num">{{ form.payYear }}</text> 12 <text class="num">{{ form.payYear }}</text>
13 <image v-if="form.payYear < 5" :src="config.baseUrl_api + '/fs/static/btn_03.png'" class="icon" 13 <image v-if="form.payYear < 5&& !form.id" :src="config.baseUrl_api + '/fs/static/btn_03.png'" class="icon"
14 mode="widthFix" 14 mode="widthFix"
15 @click="plusYear"></image> 15 @click="plusYear"></image>
16 <image v-else :src="config.baseUrl_api + '/fs/static/btn_03_g.png'" class="icon" mode="widthFix"></image> 16 <image v-else :src="config.baseUrl_api + '/fs/static/btn_03_g.png'" class="icon" mode="widthFix"></image>
...@@ -87,7 +87,7 @@ onLoad((options) => { ...@@ -87,7 +87,7 @@ onLoad((options) => {
87 const data = JSON.parse(decodeURIComponent(options.baseFormData)) 87 const data = JSON.parse(decodeURIComponent(options.baseFormData))
88 form.value = { 88 form.value = {
89 ...data, 89 ...data,
90 payYear: 1 // 年限默认1 90 payYear: data.payYear??1 // 年限默认1
91 } 91 }
92 } 92 }
93 // 初始化接口 93 // 初始化接口
...@@ -137,9 +137,19 @@ const handelPay = async () => { ...@@ -137,9 +137,19 @@ const handelPay = async () => {
137 payType: payType.value, 137 payType: payType.value,
138 totalFee: memberTotalFee.value, 138 totalFee: memberTotalFee.value,
139 } 139 }
140 140 let orderErr,orderRes
141 // 创建订单 141 if (form.value.id){
142 const [orderErr, orderRes] = await to(api.insertSinglePay(postData)) 142 // 再次支付
143 const [err,res]=await to(api.payForOrder(postData))
144 orderErr = err
145 orderRes = res
146 }else {
147 // 创建订单
148 const [err, res] = await to(api.insertSinglePay(postData))
149 orderErr = err
150 orderRes = res
151 }
152
143 uni.hideLoading() 153 uni.hideLoading()
144 154
145 if (orderErr) { 155 if (orderErr) {
......
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
45 </view> 45 </view>
46 <text :class="{ 46 <text :class="{
47 'status-wait': item.auditStatus == 0, 47 'status-wait': item.auditStatus == 0,
48 'status-pending': item.auditStatus == 1, 48 'status-pending': item.auditStatus == 1||item.auditStatus == 9,
49 'status-success': item.auditStatus == 2, 49 'status-success': item.auditStatus == 2,
50 'status-danger': item.auditStatus == 3 50 'status-danger': item.auditStatus == 3||item.auditStatus == 4
51 }" 51 }"
52 class="status-tag ">{{ getAuditStatusText(item.auditStatus) }} 52 class="status-tag ">{{ getAuditStatusText(item.auditStatus) }}
53 </text> 53 </text>
...@@ -123,7 +123,12 @@ ...@@ -123,7 +123,12 @@
123 <!-- <template v-if="item.payStatus == 0"> 123 <!-- <template v-if="item.payStatus == 0">
124 <button class="btn btn-pay" @click.stop="goPay(item)">去缴费</button> 124 <button class="btn btn-pay" @click.stop="goPay(item)">去缴费</button>
125 </template> --> 125 </template> -->
126
126 <button class="btn btn-info" @click.stop="goToDetail(item)">查看明细</button> 127 <button class="btn btn-info" @click.stop="goToDetail(item)">查看明细</button>
128 <button v-if="item.auditStatus == 9" class="btn btn-info" @click.stop="handleCancel(item)">取消</button>
129 <template v-if="item.auditStatus == 9">
130 <button class="btn btn-pay" @click.stop="goPay(item)">支付</button>
131 </template>
127 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> 132 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) -->
128 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1 && item.auditStatus == 2 && item.price > 0"> 133 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1 && item.auditStatus == 2 && item.price > 0">
129 <button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice" 134 <button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice"
...@@ -267,7 +272,9 @@ const getAuditStatusText = (status) => { ...@@ -267,7 +272,9 @@ const getAuditStatusText = (status) => {
267 0: '待提交', 272 0: '待提交',
268 1: '审核中', 273 1: '审核中',
269 2: '审核通过', 274 2: '审核通过',
270 3: '审核拒绝' 275 3: '审核拒绝',
276 4: '已取消',
277 9: '待支付'
271 }; 278 };
272 return map[status] || ''; 279 return map[status] || '';
273 }; 280 };
...@@ -280,10 +287,10 @@ const filterTime = (row) => { ...@@ -280,10 +287,10 @@ const filterTime = (row) => {
280 return dayjs(row).format('YYYY年MM月DD日') 287 return dayjs(row).format('YYYY年MM月DD日')
281 } 288 }
282 289
283 // 页面挂载初始化 290 // // 页面挂载初始化
284 onMounted(() => { 291 // onMounted(() => {
285 initData(); 292 // initData();
286 }); 293 // });
287 294
288 // 页面显示时刷新数据(从开票页面返回时) 295 // 页面显示时刷新数据(从开票页面返回时)
289 onShow(() => { 296 onShow(() => {
...@@ -372,6 +379,7 @@ const goToDetail = (item) => { ...@@ -372,6 +379,7 @@ const goToDetail = (item) => {
372 uni.navigateTo({url: `/personalVip/orderDetail?rangeId=${item.sourceId || item.id}&type=${queryParams.type}`}); 379 uni.navigateTo({url: `/personalVip/orderDetail?rangeId=${item.sourceId || item.id}&type=${queryParams.type}`});
373 }; 380 };
374 381
382
375 // 去缴费 383 // 去缴费
376 const goPay = (item) => { 384 const goPay = (item) => {
377 const baseFormData = { 385 const baseFormData = {
...@@ -379,7 +387,8 @@ const goPay = (item) => { ...@@ -379,7 +387,8 @@ const goPay = (item) => {
379 payYear: item.content?.yearCount || 1, 387 payYear: item.content?.yearCount || 1,
380 sourceId: item.sourceId || item.id, 388 sourceId: item.sourceId || item.id,
381 tradeNo: item.tradeNo, 389 tradeNo: item.tradeNo,
382 price: item.price 390 price: item.price,
391 id: item.id,
383 }; 392 };
384 const formStr = encodeURIComponent(JSON.stringify(baseFormData)); 393 const formStr = encodeURIComponent(JSON.stringify(baseFormData));
385 uni.navigateTo({ 394 uni.navigateTo({
...@@ -387,6 +396,7 @@ const goPay = (item) => { ...@@ -387,6 +396,7 @@ const goPay = (item) => {
387 }); 396 });
388 }; 397 };
389 398
399
390 // 删除订单 400 // 删除订单
391 const handleDelete = (item) => { 401 const handleDelete = (item) => {
392 currentOrder.value = item; 402 currentOrder.value = item;
...@@ -457,7 +467,7 @@ const closeInvoicePopup = () => { ...@@ -457,7 +467,7 @@ const closeInvoicePopup = () => {
457 // 取消订单 467 // 取消订单
458 const handleCancel = (item) => { 468 const handleCancel = (item) => {
459 currentOrder.value = item; 469 currentOrder.value = item;
460 cancelModalContent.value = `是否确认取消订单编号为"${item.tradeNo}"的订单?`; 470 cancelModalContent.value = `是否确认取消缴费编号为"${item.wfCode}"的订单?`;
461 showCancelPopup.value = true; 471 showCancelPopup.value = true;
462 isPopupOpen.value = true; 472 isPopupOpen.value = true;
463 }; 473 };
...@@ -466,7 +476,7 @@ const handleCancel = (item) => { ...@@ -466,7 +476,7 @@ const handleCancel = (item) => {
466 const confirmCancel = async () => { 476 const confirmCancel = async () => {
467 if (!currentOrder.value) return; 477 if (!currentOrder.value) return;
468 try { 478 try {
469 await api.cancelPay(currentOrder.value.id); 479 await api.cancelOrder(currentOrder.value.id)
470 uni.showToast({title: '取消成功', icon: 'success'}); 480 uni.showToast({title: '取消成功', icon: 'success'});
471 pageNum.value = 1; 481 pageNum.value = 1;
472 list.value = []; 482 list.value = [];
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!