Browse Source

线上退款

zhangrenyuan/feature-20251104133449-现金管理二期
ZhangYong 3 weeks ago
parent
commit
44f89aee6d
  1. 282
      src/views/moneyManage/receiveDetail/receiveFinance.vue
  2. 13
      src/views/moneyManage/receiveDetail/utils/util.js

282
src/views/moneyManage/receiveDetail/receiveFinance.vue

@ -200,6 +200,10 @@
v-else-if="activeTab == 'pass' && !(scope.row.status == 6 || scope.row.status == 4)"
style="color: #2741DE;" @click="openEditForm(scope.row)">编辑
</el-link>
<el-link
v-else-if="activeTab == 'done' && scope.row.status == 4 && startsWith(scope.row.orderCode, 'GOLDCOIN')"
style="color: #2741DE;" @click="openRefundConfirm">退款
</el-link>
</template>
</el-table-column>
</el-table>
@ -212,6 +216,21 @@
</div>
</el-card>
</div>
<!-- 退款确认弹窗 -->
<div class="recallDialog" v-show="refundConfirmDialog">
<div class="close">
<button @click="closeConfirmRefund" class="Btn">关闭</button>
</div>
<div class="text">
<text class="txt">{{ textContent }}</text>
</div>
<div class="cancle">
<button @click="closeConfirmRefund" class="Btn">取消</button>
</div>
<div class="confirm">
<button @click="openRefundDialog" class="Btn">确定</button>
</div>
</div>
<!-- 仅保留地区财务相关弹窗审核弹窗编辑手续费弹窗 -->
<!-- 审核弹窗 -->
@ -406,6 +425,110 @@
</div>
</div>
</el-dialog>
<!-- 新增退款 -->
<el-dialog v-model="refundDialog" title="退款" class="refundDialog" overflow draggable style="width: 40vw;"
:before-close="closeRefundForm">
<div style="display: flex;">
<div class="left">
<div class="add-item">
<el-text style="width:4vw;">精网号</el-text>
<el-input v-model="refundFormData.jwcode" style="width:10vw;" disabled />
</div>
<div class="add-item">
<el-text style="width:4vw;">客户姓名</el-text>
<el-input v-model="refundFormData.name" style="width:10vw;" disabled />
</div>
<div class="add-item">
<el-text style="width:4vw;">所属地区</el-text>
<el-input v-model="refundFormData.marketName" style="width:10vw;" disabled />
</div>
<div class="add-item">
<el-text style="width:4vw;">活动名称</el-text>
<el-input v-model="refundFormData.activity" style="width:10vw;" disabled />
</div>
<div class="add-item">
<el-text style="width:4vw;">产品名称</el-text>
<el-input v-model="refundFormData.goodsName" style="width:10vw;" disabled />
</div>
<div v-show="!isRefundGold" class="add-item">
<el-text style="width:4vw;">产品数量</el-text>
<el-input style="padding-right: 10px; width:10.5vw;" v-model="refundFormData.goodNum"
placeholder="请输入产品数量" disabled />
<span style="color: #999999;">{{ productUnit }}</span>
</div>
<div v-show="isRefundGold" style="margin-bottom: 15px; ">
<div style=" display: flex; ">
<span
style="color: #999999; display: flex; white-space: nowrap;align-items: center;">永久金币</span>
<el-input style="padding-right: 10px; height: 30px; width: 110px; margin-bottom: 10px"
v-model="refundFormData.permanentGold" disabled />
</div>
<div style="padding-right: 5px; display: flex;">
<span
style="color: #999999; display: flex; white-space: nowrap;align-items: center;">免费金币</span>
<el-input style="padding-right: 10px; height: 30px; width: 110px;"
v-model="refundFormData.freeGold" disabled />
</div>
</div>
<div class="add-item">
<el-text style="width:4vw;">付款币种</el-text>
<el-input v-model="refundFormData.paymentCurrency" style="width:10vw;" disabled />
</div>
<div class="add-item">
<el-text style="width:4vw;">付款金额</el-text>
<el-input v-model="refundFormData.paymentAmount" style="width:10vw;" disabled />
</div>
<div class="add-item">
<el-text style="width:4vw;">支付方式</el-text>
<el-input v-model="refundFormData.payType" style="width:10vw;" disabled />
</div>
<div class="add-item">
<el-text style="width:4vw;">付款时间</el-text>
<el-date-picker v-model="refundFormData.payTime" type="datetime" style="width:10vw;" disabled />
</div>
<div class="add-item">
<el-text style="width:4vw;" size="small">转账凭证</el-text>
<el-form-item :rules="{ required: true, message: '请上传图片', trigger: 'change' }">
<el-upload ref="uploadRef" :auto-upload="false" list-type="picture-card"
:show-file-list="false">
<template #default>
<img v-if="refundFormData.voucher" :src="refundFormData.voucher"
style="width: 100%; height: 100%; object-fit: cover;">
<el-icon v-else>
<Plus />
</el-icon>
</template>
</el-upload>
</el-form-item>
</div>
<div class="add-item">
<el-text style="width:4vw;">备注</el-text>
<el-input v-model="refundFormData.remark" style="width:10vw;" :rows="2" type="textarea"
maxLength="100" disabled show-word-limit />
</div>
</div>
<div class="right">
<div class="add-item">
<el-text style="width:4vw;">退款模式</el-text>
<el-radio-group v-model="refundFormData.refundModel">
<el-radio value="0">全部退款</el-radio>
<el-radio value="1">部分退款</el-radio>
</el-radio-group>
</div>
<div class="add-item">
<el-text style="width:4vw;">退款理由</el-text>
<el-input v-model="refundFormData.refundReason" style="width:10vw;" :rows="5" maxlength="150"
show-word-limit type="textarea" />
</div>
<div>ps:请在退款理由表明用户的退款需求</div>
<div style="display:flex;justify-content: center;margin-top: 5vh;">
<el-button type="default" @click="">重置</el-button>
<el-button type="primary" @click="throttledsubmitRefund">提交</el-button>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
@ -419,6 +542,7 @@ import request from '@/util/http.js';
import moment from 'moment';
import _ from 'lodash';
import { Plus } from '@element-plus/icons-vue';
import { startsWith } from './utils/util.js'
//
import CurrencySelect from '@/components/MoneyManage/CurrencySelect.vue';
@ -474,7 +598,26 @@ const tooltipContent = ref('');
const tooltipLeft = ref(0);
const tooltipTop = ref(0);
//
// 退
const refundConfirmDialog = ref(false)
const textContent = ref('')
//退
const refundDialog = ref(false)
const openRefundDialog = () => {
refundDialog.value = true
closeConfirmRefund()
}
const closeRefundForm = () => {
refundDialog.value = false
refundFormData.value = {}
}
//
const adminData = ref({});
const activityList = ref([]);
const customOptions = ref(['美元(USD)', '港币(HKD)', '新币(SGD)', '马币(MYR)', '泰铢(THB)', '加币(CAD)', '越南盾(VDN)', '韩元(KRW)']);
@ -482,6 +625,19 @@ const paytypeList = ["Stripe-链接收款", "PaymentAsia-链接收款", "Ipay88-
const paytypeOptions = ref([...paytypeList]);
// ===================== 2. =====================
//退
const openRefundConfirm = () => {
textContent.value = '将要对该订单退款!'
refundConfirmDialog.value = true
}
const closeConfirmRefund = () => {
refundConfirmDialog.value = false
textContent.value = ''
}
// 2.1
const getlist = async () => {
try {
@ -544,6 +700,54 @@ const getlist = async () => {
}
};
//退
const submitRefund = async () => {
try {
const result = await request({
url: '/Money/add',
data: {
jwcode: refundFormData.value.jwcode, //
name: refundFormData.value.name, //
market: refundFormData.value.marketName, //
activity: refundFormData.value.activity, //
bankCode: refundFormData.value.bankCode, //
goodsName: refundFormData.value.goodsName, //
goodNum: refundFormData.value.goodNum, // 0
paymentCurrency: refundFormData.value.paymentCurrency, //
paymentAmount: (refundFormData.value.paymentAmount) * 100, //
receivedCurrency: refundFormData.value.receivedCurrency, //
receivedAmount: (refundFormData.value.receivedAmount) * 100, //
handlingCharge: (refundFormData.value.handlingCharge) * 100, //
receivedMarket: refundFormData.value.receivedMarket, //
payType: refundFormData.value.payType, //
payTime: refundFormData.value.payTime, // yyyy-MM-dd HH:mm:ss
receivedTime: refundFormData.value.receivedTime, // yyyy-MM-dd HH:mm:ss
areaServise: adminData.value.adminName, //
submitterId: adminData.value.id,
voucher: refundFormData.value.voucher, // URL
remark: refundFormData.value.remark, //
refundReason: refundFormData.value.refundReason, // 退-
refundModel: refundFormData.value.refundModel, // 退0-1-
id: refundFormData.value.id, //id
orderCode: refundFormData.value.orderCode,
permanentGold: (refundFormData.value.permanentGold) * 100 || 0,
freeGold: (refundFormData.value.freeGold) * 100 || 0
}
})
if (result.code == 200) {
ElMessage.success('新增退款成功')
getlist()
closeRefundForm()
} else {
ElMessage.error(result.msg)
getlist()
}
console.log('返回参数:', result);
} catch (error) {
console.log(error);
}
}
// 2.2
const search = () => {
getlist();
@ -1128,4 +1332,80 @@ const handlePagination = (type, val) => {
overflow-y: auto;
white-space: pre-wrap;
}
.recallDialog {
//
height: 392px;
width: 700px;
background-image: url('/src/assets/收款明细撤回背景.png');
position: fixed; //
top: 50%; // 50%
left: 50%; // 50%
transform: translate(-50%, -50%); // 50%
z-index: 1000; //
.close {
position: absolute;
left: 625px;
top: 20px;
height: 38px;
width: 38px;
opacity: 0;
.Btn {
height: 100%;
width: 100%;
border-radius: 10px;
}
}
.text {
position: absolute;
left: 185px;
top: 190px;
height: 67px;
width: 500px;
.txt {
height: 100%;
width: 100%;
color: #001a42;
font-family: "PingFang SC";
font-size: 48px;
font-style: normal;
font-weight: 900;
line-height: normal;
}
}
.cancle {
position: absolute;
left: 185px;
top: 304px;
height: 55px;
width: 150px;
opacity: 0;
.Btn {
height: 100%;
width: 100%;
border-radius: 20px;
}
}
.confirm {
position: absolute;
left: 375px;
top: 304px;
height: 55px;
width: 150px;
opacity: 0;
.Btn {
height: 100%;
width: 100%;
border-radius: 20px;
}
}
}
</style>

13
src/views/moneyManage/receiveDetail/utils/util.js

@ -0,0 +1,13 @@
//判断是否为线上订单
export const startsWith = (mainStr, prefix) => {
// 处理前缀为空字符串的情况(空字符串是所有字符串的前缀)
if (prefix === '') {
return true;
}
// 处理主字符串长度小于前缀长度的情况
if (mainStr.length < prefix.length) {
return false;
}
// 比较主字符串开头与前缀相同长度的部分
return mainStr.substring(0, prefix.length) === prefix;
}
Loading…
Cancel
Save