|
@@ -241,7 +241,7 @@ import kNoData from "../../components/commom/kNoData/index.vue";
|
|
|
import { onMounted, reactive, ref } from "vue";
|
|
|
import sHeader from "../../components/SimpleHeader";
|
|
|
import orderSearch from "./orderSearch.vue";
|
|
|
-import { getOrderList, refundOrder } from "../../service/order/index";
|
|
|
+import { getOrderList, refundOrder, refundWechatOrder } from "../../service/order/index";
|
|
|
import { showFailToast, showToast, showLoadingToast } from "vant";
|
|
|
import { getLoginUser, $M_IsDate, Format_time, $M_ExportFile, styleUrl } from "../../common/js/utils";
|
|
|
import { getHuifuId } from "../../service/huifuMch/index";
|
|
@@ -266,6 +266,8 @@ export default {
|
|
|
const totalRefund = ref(0);
|
|
|
// 退款商户数量
|
|
|
const refundNum = ref([]);
|
|
|
+ // 订单类型
|
|
|
+ const orderType = ref('');
|
|
|
// 加载状态
|
|
|
// const isLoading = ref(false);
|
|
|
// 监控退款选择框状态
|
|
@@ -298,6 +300,7 @@ export default {
|
|
|
}
|
|
|
// 点击弹出退款弹窗
|
|
|
const noticeClk = (row) => {
|
|
|
+ orderType.value = row.payPlatform;
|
|
|
if (row.orderDetails.length > 0) {
|
|
|
isChecked.value = [];
|
|
|
orderDetails.value = [];
|
|
@@ -377,8 +380,15 @@ export default {
|
|
|
// 退款操作
|
|
|
const refundAjax = async () => {
|
|
|
try {
|
|
|
- const { data } = await refundOrder(cofficentForm);
|
|
|
- if (data.code && data.code !== 'B0001') {
|
|
|
+ // 如果为微信退款
|
|
|
+ let data = null;
|
|
|
+ if (orderType.value === '3') {
|
|
|
+ data = await refundWechatOrder(cofficentForm);
|
|
|
+ } else {
|
|
|
+ data = await refundOrder(cofficentForm);
|
|
|
+ }
|
|
|
+ console.log(data);
|
|
|
+ if (data.data.code && data.data.code !== 'B0001') {
|
|
|
showDialog({
|
|
|
message: t('orderCenter.refundSucceeded'),
|
|
|
}).then(() => {
|
|
@@ -388,7 +398,7 @@ export default {
|
|
|
search({});
|
|
|
});
|
|
|
} else {
|
|
|
- showFailToast(data.message);
|
|
|
+ showFailToast(data.data.message);
|
|
|
}
|
|
|
} catch (error) {
|
|
|
showFailToast(t('orderCenter.requestFailed'));
|