|
@@ -190,6 +190,10 @@
|
|
|
<span class="word8">{{ $t('orderCenter.refunded') }}</span>
|
|
|
<span class="info4">{{ refundObject.refundAmount }}</span>
|
|
|
</div>
|
|
|
+ <div v-if="refundObject.status === 3" class="layer7 flex-row justify-between">
|
|
|
+ <span class="word8">退款原因</span>
|
|
|
+ <span class="info4">{{ refundObject.refundReason }}</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>
|
|
@@ -197,16 +201,29 @@
|
|
|
<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>
|
|
|
+ <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-field v-if="refundObject.status === 1 && user.ifForeign === '0' && user.type < 2 && orderType != '3'"
|
|
|
+ v-model="customerPhone" center label="联系方式" placeholder="消费者联系方式,没有则不填">
|
|
|
+ </van-field>
|
|
|
<!-- 发起退款 -->
|
|
|
<!-- 非已付款订单,线下订单要隐藏按钮 -->
|
|
|
- <van-button size="small"
|
|
|
- v-if="(refundObject.status === 1 && user.ifForeign === '0') || (refundObject.status === 1 && user.ifForeign === '1' && refundObject.isAir === '1')"
|
|
|
- @click="noticeClk(refundObject)" round type="primary" style="margin-top: 20px;">
|
|
|
- {{ $t('orderCenter.initiateRefund') }}
|
|
|
- </van-button>
|
|
|
+ <div style="display: flex; justify-content: center;">
|
|
|
+ <van-button size="small"
|
|
|
+ v-if="refundObject.status === 1 && user.ifForeign === '0' && user.type < 2 && orderType != '3'"
|
|
|
+ @click="sentRefundMessage(refundObject)" round type="primary"
|
|
|
+ style="padding: 20px 30px;margin-top: 20px;" color="#4dc193">
|
|
|
+ 退款提醒
|
|
|
+ </van-button>
|
|
|
+ <div v-if="refundObject.status === 1 && user.ifForeign === '0' && user.type < 2" style="width: 20px;">
|
|
|
+ </div>
|
|
|
+ <van-button size="small"
|
|
|
+ v-if="(refundObject.status === 1 && user.ifForeign === '0') || (refundObject.status === 1 && user.ifForeign === '1' && refundObject.isAir === '1')"
|
|
|
+ @click="noticeClk(refundObject)" round type="primary" style="padding: 20px 30px; margin-top: 20px;">
|
|
|
+ {{ $t('orderCenter.initiateRefund') }}
|
|
|
+ </van-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -248,12 +265,12 @@ import { getAdminMch } from "../../service/merchantManage";
|
|
|
// 导入弹窗
|
|
|
import kDialog from "../../components/commom/kDialog/index.vue";
|
|
|
// 导入无数据组件
|
|
|
-import { showDialog, showConfirmDialog } from 'vant';
|
|
|
+import { showDialog, showConfirmDialog, showSuccessToast } from 'vant';
|
|
|
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, updateIsInvoice } from "../../service/order/index";
|
|
|
+import { getOrderList, refundOrder, refundWechatOrder, updateIsInvoice, sentMessage } 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";
|
|
@@ -283,16 +300,20 @@ export default {
|
|
|
// 是否开发票
|
|
|
const isInvoice = ref("0");
|
|
|
// 更新是否开发票
|
|
|
- const updateInvoice = (id) => {
|
|
|
+ const updateInvoice = async (id) => {
|
|
|
const params = {
|
|
|
id,
|
|
|
isInvoice: isInvoice.value,
|
|
|
}
|
|
|
showConfirmDialog({
|
|
|
message: '是否确认更新',
|
|
|
- }).then(() => {
|
|
|
- const { data } = updateIsInvoice(params);
|
|
|
- console.log(data);
|
|
|
+ }).then(async () => {
|
|
|
+ const { data } = await updateIsInvoice(params);
|
|
|
+ if (data.code) {
|
|
|
+ showSuccessToast(data.data);
|
|
|
+ } else {
|
|
|
+ showFailToast(data.data);
|
|
|
+ }
|
|
|
}).catch(() => {
|
|
|
return;
|
|
|
});
|
|
@@ -329,6 +350,7 @@ export default {
|
|
|
}
|
|
|
// 点击弹出退款弹窗
|
|
|
const noticeClk = (row) => {
|
|
|
+ cofficentForm.refundReason = '';
|
|
|
if (row.orderDetails.length > 0) {
|
|
|
isChecked.value = [];
|
|
|
orderDetails.value = [];
|
|
@@ -409,6 +431,28 @@ export default {
|
|
|
});
|
|
|
|
|
|
}
|
|
|
+ const customerPhone = ref(''); // 消费者号码
|
|
|
+ // 发送退款提醒短信
|
|
|
+ const sentRefundMessage = async (row) => {
|
|
|
+ console.log(row)
|
|
|
+ const params = {
|
|
|
+ id: row.id,
|
|
|
+ customerPhone: customerPhone.value,
|
|
|
+ }
|
|
|
+ showConfirmDialog({
|
|
|
+ message: '是否确认发送短信?',
|
|
|
+ }).then(async () => {
|
|
|
+ const { data } = await sentMessage(params);
|
|
|
+ console.log(data);
|
|
|
+ if (data.code) {
|
|
|
+ showSuccessToast(data.data);
|
|
|
+ } else {
|
|
|
+ showFailToast(data.data);
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ return;
|
|
|
+ });
|
|
|
+ }
|
|
|
// 退款操作
|
|
|
const refundAjax = async () => {
|
|
|
try {
|
|
@@ -867,6 +911,8 @@ export default {
|
|
|
kDialogRef,
|
|
|
noticeClk,
|
|
|
confirmClk,
|
|
|
+ sentRefundMessage,
|
|
|
+ customerPhone,
|
|
|
cofficentForm,
|
|
|
accountDetail,
|
|
|
Format_time,
|