Browse Source

单位适配以及线上退款对接

zhangrenyuan/feature-20251104133449-现金管理二期
ZhangYong 3 weeks ago
parent
commit
553f88b5ac
  1. 95
      src/views/moneyManage/receiveDetail/receiveFinance.vue
  2. 2
      src/views/moneyManage/receiveDetail/utils/recriveFormRules.js

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

@ -250,6 +250,30 @@
<el-form-item label="产品名称"> <el-form-item label="产品名称">
<el-select disabled="true" v-model="auditFormData.goodsName" /> <el-select disabled="true" v-model="auditFormData.goodsName" />
</el-form-item> </el-form-item>
<el-form-item v-if="!isGold" label="产品数量">
<div style="display: flex;">
<el-input disabled="true" style="padding-right: 30px; flex: 3;" v-model="auditFormData.goodNum"
placeholder="请输入产品数量" />
<CurrencySelect disabled="true" v-model="auditFormData.numUnit" :items="numUnitList"
style="flex: 1.5;" placeholder="单位" @change="handleCurrencyChange" />
</div>
</el-form-item>
<div v-show="isGold" style="margin-bottom: 15px; display: flex;">
<div style=" display: flex; ">
<span
style="color: #999999; display: flex; white-space: nowrap;align-items: center;">永久金币</span>
<el-input disabled="true"
style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
v-model="auditFormData.permanentGold" />
</div>
<div style="padding-right: 5px; display: flex;">
<span
style="color: #999999; display: flex; white-space: nowrap;align-items: center;">免费金币</span>
<el-input disabled="true"
style="padding-right: 10px; padding-left: 10px; height: 30px; width: 110px;"
v-model="auditFormData.freeGold" />
</div>
</div>
<el-form-item label="付款币种"> <el-form-item label="付款币种">
<el-select disabled="true" v-model="auditFormData.paymentCurrency" placeholder="请选择付款币种" <el-select disabled="true" v-model="auditFormData.paymentCurrency" placeholder="请选择付款币种"
@change="handleCurrencyChange" /> @change="handleCurrencyChange" />
@ -333,10 +357,11 @@
</el-form-item> </el-form-item>
<!-- 金币产品特殊显示 --> <!-- 金币产品特殊显示 -->
<el-form-item v-show="!isEditGold" label="产品数量"> <el-form-item v-show="!isEditGold" label="产品数量">
<div style="padding-right: 50px; display: flex;">
<el-input disabled="true" style="padding-right: 10px;" v-model="editFormData.goodNum"
placeholder="产品数量" />
<span style="color: #999999;"></span>
<div style="display: flex;">
<el-input disabled="true" style="padding-right: 30px; flex: 3;"
v-model="editFormData.goodNum" placeholder="请输入产品数量" />
<CurrencySelect disabled="true" v-model="editFormData.numUnit" :items="numUnitList"
style="flex: 1.5;" placeholder="单位" @change="handleCurrencyChange" />
</div> </div>
</el-form-item> </el-form-item>
<div v-show="isEditGold" style="margin-bottom: 15px; display: flex;"> <div v-show="isEditGold" style="margin-bottom: 15px; display: flex;">
@ -403,10 +428,10 @@
<CurrencySelect v-model="editFormData.receivedCurrency" :items="customOptions" <CurrencySelect v-model="editFormData.receivedCurrency" :items="customOptions"
placeholder="请选择到账货币" /> placeholder="请选择到账货币" />
</el-form-item> </el-form-item>
<el-form-item label="到账金额" prop="receivedAmount" required>
<el-form-item label="到账金额" prop="receivedAmount">
<el-input v-model="editFormData.receivedAmount" placeholder="请输入到账金额" type="number" /> <el-input v-model="editFormData.receivedAmount" placeholder="请输入到账金额" type="number" />
</el-form-item> </el-form-item>
<el-form-item label="手续费" prop="handlingCharge" required>
<el-form-item label="手续费" prop="handlingCharge">
<el-input v-model="editFormData.handlingCharge" placeholder="请输入手续费" type="number" /> <el-input v-model="editFormData.handlingCharge" placeholder="请输入手续费" type="number" />
</el-form-item> </el-form-item>
<el-form-item label="到账时间" required> <el-form-item label="到账时间" required>
@ -452,8 +477,10 @@
</div> </div>
<div v-show="!isRefundGold" class="add-item"> <div v-show="!isRefundGold" class="add-item">
<el-text style="width:4vw;">产品数量</el-text> <el-text style="width:4vw;">产品数量</el-text>
<el-input style="padding-right: 10px; width:10.5vw;" v-model="refundFormData.goodNum"
<el-input style="padding-right: 10px; width:6.5vw;" v-model="refundFormData.goodNum"
placeholder="请输入产品数量" disabled /> placeholder="请输入产品数量" disabled />
<CurrencySelect disabled="true" v-model="refundFormData.numUnit" :items="numUnitList"
style=" width: 3.5vw;" placeholder="单位" @change="handleCurrencyChange" />
</div> </div>
<div v-show="isRefundGold" style="display: flex; margin-bottom: 10px;"> <div v-show="isRefundGold" style="display: flex; margin-bottom: 10px;">
<div style=" display: flex; align-items: center;justify-content: center; "> <div style=" display: flex; align-items: center;justify-content: center; ">
@ -462,8 +489,7 @@
v-model="refundFormData.permanentGold" disabled /> v-model="refundFormData.permanentGold" disabled />
</div> </div>
<div style=" display: flex; align-items: center;justify-content: center; "> <div style=" display: flex; align-items: center;justify-content: center; ">
<span
style="color: #999999; white-space: nowrap;">免费金币</span>
<span style="color: #999999; white-space: nowrap;">免费金币</span>
<el-input style="padding-right: 10px; height: 30px; width: 70px;" <el-input style="padding-right: 10px; height: 30px; width: 70px;"
v-model="refundFormData.freeGold" disabled /> v-model="refundFormData.freeGold" disabled />
</div> </div>
@ -513,6 +539,18 @@
<el-radio value="1">部分退款</el-radio> <el-radio value="1">部分退款</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div v-show="refundFormData.refundModel == '1'" style="display: flex; margin-bottom: 10px;">
<div style=" display: flex; align-items: center;justify-content: center; ">
<span style="color: #999999; white-space: nowrap;">永久金币</span>
<el-input style="padding-right: 10px; height: 30px; width: 70px;"
v-model="refundCoinData.permanentGold" dsabled />
</div>
<div style=" display: flex; align-items: center;justify-content: center; ">
<span style="color: #999999; white-space: nowrap;">免费金币</span>
<el-input style="padding-right: 10px; height: 30px; width: 70px;"
v-model="refundCoinData.freeGold" />
</div>
</div>
<div class="add-item"> <div class="add-item">
<el-text style="width:4vw;">退款理由</el-text> <el-text style="width:4vw;">退款理由</el-text>
<el-input v-model="refundFormData.refundReason" style="width:10vw;" :rows="5" maxlength="150" <el-input v-model="refundFormData.refundReason" style="width:10vw;" :rows="5" maxlength="150"
@ -614,6 +652,10 @@ const closeRefundForm = () => {
refundFormData.value = {} refundFormData.value = {}
} }
const refundCoinData = ref({
permanentGold: 0,
freeGold: 0
})
const isRefundGold = ref(false) const isRefundGold = ref(false)
const ifRefundGold = () => { const ifRefundGold = () => {
if (refundFormData.value.goodsName === '金币充值') { if (refundFormData.value.goodsName === '金币充值') {
@ -716,8 +758,18 @@ const getlist = async () => {
//退 //退
const submitRefund = async () => { const submitRefund = async () => {
try { try {
if (refundFormData.value.goodsName != '金币充值') {
return ElMessage.error('线上数据仅支持金币充值退款');
}
if (!refundFormData.value.refundModel) {
return ElMessage.error('请选择退款方式');
}
if (!refundFormData.value.refundReason) {
return ElMessage.error('请输入退款原因');
}
const result = await request({ const result = await request({
url: '/Money/add',
url: '/Money/addOnline',
data: { data: {
jwcode: refundFormData.value.jwcode, // jwcode: refundFormData.value.jwcode, //
name: refundFormData.value.name, // name: refundFormData.value.name, //
@ -743,8 +795,8 @@ const submitRefund = async () => {
refundModel: refundFormData.value.refundModel, // 退0-1- refundModel: refundFormData.value.refundModel, // 退0-1-
id: refundFormData.value.id, //id id: refundFormData.value.id, //id
orderCode: refundFormData.value.orderCode, orderCode: refundFormData.value.orderCode,
permanentGold: (refundFormData.value.permanentGold) * 100 || 0,
freeGold: (refundFormData.value.freeGold) * 100 || 0
permanentGold: (refundCoinData.value.permanentGold) * 100 || 0,
freeGold: (refundCoinData.value.freeGold) * 100 || 0
} }
}) })
if (result.code == 200) { if (result.code == 200) {
@ -784,6 +836,9 @@ const navigateTo = async (tab) => {
// //
const openAuditForm = (row) => { const openAuditForm = (row) => {
auditFormData.value = { ...row, market: row.marketName }; auditFormData.value = { ...row, market: row.marketName };
ifGold(auditFormData.value)
console.log('isGold', isGold.value);
auditFormisible.value = true; auditFormisible.value = true;
}; };
@ -850,6 +905,17 @@ const handelAuditReject = async () => {
} }
}; };
//
const isGold = ref(false)
const ifGold = (data) => {
console.log('data', data);
if (data.goodsName === '金币充值') {
isGold.value = true
} else {
isGold.value = false
}
}
// //
watch(auditFormisible, (val) => { watch(auditFormisible, (val) => {
if (val) { if (val) {
@ -888,6 +954,7 @@ const openEditForm = (row) => {
const closeEditForm = () => { const closeEditForm = () => {
editFormisible.value = false; editFormisible.value = false;
editFormData.value = {}; editFormData.value = {};
editFormRef.value.resetFields();
}; };
// //
@ -1022,7 +1089,9 @@ const getActivitys = async () => {
// 2.8 // 2.8
const throttledhandelAuditReject = _.throttle(handelAuditReject, 3000, { trailing: false }); const throttledhandelAuditReject = _.throttle(handelAuditReject, 3000, { trailing: false });
const throttledsubmitEditForm = _.throttle(submitEditForm, 3000, { trailing: false }); const throttledsubmitEditForm = _.throttle(submitEditForm, 3000, { trailing: false });
const throttledsubmitRefund = _.throttle(submitRefund, 5000, {
trailing: false
})
// 2.9 // 2.9
onMounted(async () => { onMounted(async () => {
await getAdminData(); await getAdminData();

2
src/views/moneyManage/receiveDetail/utils/recriveFormRules.js

@ -87,6 +87,7 @@ export const addFormRule = {
export const editFormRule = { export const editFormRule = {
// 到账金额:最大6位(整数部分最多4位,小数2位),支持两位小数 // 到账金额:最大6位(整数部分最多4位,小数2位),支持两位小数
receivedAmount: [ receivedAmount: [
{ required: true, message: '请输入到账金额', trigger: 'blur' },
{ {
pattern: /^\d{1,6}(\.\d{1,2})?$/, pattern: /^\d{1,6}(\.\d{1,2})?$/,
message: '请检查到账金额格式', message: '请检查到账金额格式',
@ -95,6 +96,7 @@ export const editFormRule = {
], ],
// 手续费:同到账金额规则 // 手续费:同到账金额规则
handlingCharge: [ handlingCharge: [
{ required: true, message: '请输入手续费', trigger: 'blur' },
{ {
pattern: /^\d{1,6}(\.\d{1,2})?$/, pattern: /^\d{1,6}(\.\d{1,2})?$/,
message: '请检查手续费格式', message: '请检查手续费格式',

Loading…
Cancel
Save