|
@@ -190,6 +190,16 @@
|
|
|
<span class="word8">{{ $t('orderCenter.refunded') }}</span>
|
|
|
<span class="info4">{{ refundObject.refundAmount }}</span>
|
|
|
</div>
|
|
|
+ <div class="layer6 flex-row justify-between l-flex-center"
|
|
|
+ v-if="(refundObject.status != 0 && refundObject.status != 2) && orderType == '3'">
|
|
|
+ <span class="word6 o-mr-40">是否开发票</span>
|
|
|
+ <van-radio-group v-model="isInvoice" direction="horizontal">
|
|
|
+ <van-radio name="1">是</van-radio>
|
|
|
+ <van-radio name="0">否</van-radio>
|
|
|
+ </van-radio-group>
|
|
|
+ <van-button color="#4d6add" type="primary" size="small" class="o-p-20" @click="updateInvoice(refundObject.id)"
|
|
|
+ style="padding: 10px; margin-left: 20px;">更新</van-button>
|
|
|
+ </div>
|
|
|
<!-- 发起退款 -->
|
|
|
<!-- 非已付款订单,线下订单要隐藏按钮 -->
|
|
|
<van-button size="small"
|
|
@@ -203,9 +213,9 @@
|
|
|
</van-popup>
|
|
|
<!-- 退款弹窗 -->
|
|
|
<kDialog :isCloseForConfirm="false" :dialogTitle="$t('orderCenter.refundTip')"
|
|
|
- :confirmBtnTxt="$t('orderCenter.refundSubmit')" ref="kDialogRef" @confirmclk="confirmClk" >
|
|
|
+ :confirmBtnTxt="$t('orderCenter.refundSubmit')" ref="kDialogRef" @confirmclk="confirmClk">
|
|
|
<template #content>
|
|
|
- <div class="refundBox l-flex-RC" style="overflow-y: auto; overflow-x: hidden; max-height: 40vh;" >
|
|
|
+ <div class="refundBox l-flex-RC" style="overflow-y: auto; overflow-x: hidden; max-height: 40vh;">
|
|
|
<div v-for="(item, index) in orderDetails" :key="index" class="card01">
|
|
|
<van-checkbox v-model="isChecked[index]" @change="checkGood(index)" icon-size="20px"></van-checkbox>
|
|
|
<van-card :price="item.price.toFixed(2)" :title="item.productName" :thumb="showSugarPic(item.productNo)">
|
|
@@ -218,6 +228,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="o-mt-5" style="height: 1px; background: #d7d7e2"></div>
|
|
|
+ <van-field v-if="orderType === '3'" v-model="cofficentForm.refundReason" rows="2" autosize label="退款原因"
|
|
|
+ type="textarea" maxlength="30" :clearable="true" placeholder="请输入退款原因" show-word-limit />
|
|
|
<div class="btnFooter">
|
|
|
<van-checkbox class="checkAllBtn o-mt-5" v-model="checkedAll" @click="checkAll">全选</van-checkbox>
|
|
|
<div class="o-mt-5">
|
|
@@ -241,7 +253,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, refundWechatOrder } from "../../service/order/index";
|
|
|
+import { getOrderList, refundOrder, refundWechatOrder, updateIsInvoice } 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";
|
|
@@ -268,6 +280,23 @@ export default {
|
|
|
const refundNum = ref([]);
|
|
|
// 订单类型
|
|
|
const orderType = ref('');
|
|
|
+ // 是否开发票
|
|
|
+ const isInvoice = ref("0");
|
|
|
+ // 更新是否开发票
|
|
|
+ const updateInvoice = (id) => {
|
|
|
+ const params = {
|
|
|
+ id,
|
|
|
+ isInvoice: isInvoice.value,
|
|
|
+ }
|
|
|
+ showConfirmDialog({
|
|
|
+ message: '是否确认更新',
|
|
|
+ }).then(() => {
|
|
|
+ const { data } = updateIsInvoice(params);
|
|
|
+ console.log(data);
|
|
|
+ }).catch(() => {
|
|
|
+ return;
|
|
|
+ });
|
|
|
+ }
|
|
|
// 加载状态
|
|
|
// const isLoading = ref(false);
|
|
|
// 监控退款选择框状态
|
|
@@ -300,7 +329,6 @@ export default {
|
|
|
}
|
|
|
// 点击弹出退款弹窗
|
|
|
const noticeClk = (row) => {
|
|
|
- orderType.value = row.payPlatform;
|
|
|
if (row.orderDetails.length > 0) {
|
|
|
isChecked.value = [];
|
|
|
orderDetails.value = [];
|
|
@@ -362,26 +390,30 @@ export default {
|
|
|
if (cofficentForm.note === "" || cofficentForm.price === 0 || cofficentForm.price === "") {
|
|
|
showToast(t('orderCenter.refundPlace'));
|
|
|
return;
|
|
|
- } else {
|
|
|
- showConfirmDialog({
|
|
|
- // title: "提示",
|
|
|
- message: t('orderCenter.refundCheck'),
|
|
|
- }).then(() => {
|
|
|
- // isLoading.value = true; // 开始加载
|
|
|
- refundAjax();
|
|
|
- // isLoading.value = false; // 加载完成
|
|
|
-
|
|
|
- kDialogRef.value.closeDialog();
|
|
|
- }).catch(() => {
|
|
|
- return;
|
|
|
- });
|
|
|
}
|
|
|
+ if (orderType.value === '3' && (cofficentForm.refundReason === "" || cofficentForm.refundReason === null)) {
|
|
|
+ showToast('请填写退款原因');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ showConfirmDialog({
|
|
|
+ // title: "提示",
|
|
|
+ message: t('orderCenter.refundCheck'),
|
|
|
+ }).then(() => {
|
|
|
+ // isLoading.value = true; // 开始加载
|
|
|
+ refundAjax();
|
|
|
+ // isLoading.value = false; // 加载完成
|
|
|
+
|
|
|
+ kDialogRef.value.closeDialog();
|
|
|
+ }).catch(() => {
|
|
|
+ return;
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
// 退款操作
|
|
|
const refundAjax = async () => {
|
|
|
try {
|
|
|
// 如果为微信退款
|
|
|
- let data = null;
|
|
|
+ let data = null;
|
|
|
if (orderType.value === '3') {
|
|
|
data = await refundWechatOrder(cofficentForm);
|
|
|
} else {
|
|
@@ -409,7 +441,8 @@ export default {
|
|
|
price: 0,
|
|
|
id: "",
|
|
|
productNumber: 0,
|
|
|
- note: 0
|
|
|
+ note: 0,
|
|
|
+ refundReason: "",
|
|
|
});
|
|
|
// 引入语言
|
|
|
const { t } = useI18n();
|
|
@@ -670,6 +703,7 @@ export default {
|
|
|
const orderClick = (item) => {
|
|
|
//查询商户余额,要用admin的type去区分 TODO
|
|
|
refundObject.value = item;
|
|
|
+ orderType.value = item.payPlatform;
|
|
|
refundType.value = true;
|
|
|
};
|
|
|
const accountDetail = ref({});
|
|
@@ -851,6 +885,9 @@ export default {
|
|
|
// isLoading,
|
|
|
isRefund,
|
|
|
currencySymbol,
|
|
|
+ orderType,
|
|
|
+ isInvoice,
|
|
|
+ updateInvoice,
|
|
|
};
|
|
|
},
|
|
|
};
|