1.支付相关

This commit is contained in:
邱贞招 2024-09-13 14:10:02 +08:00
parent fd165faf6a
commit bad5c665fa
2 changed files with 69 additions and 70 deletions

View File

@ -36,11 +36,11 @@
<el-table-column label="图片" align="center" prop="picture" width="100"> <el-table-column label="图片" align="center" prop="picture" width="100">
<image-preview slot-scope="d" :src="d.row.picture" :width="32" :height="32"/> <image-preview slot-scope="d" :src="d.row.picture" :width="32" :height="32"/>
</el-table-column> </el-table-column>
<el-table-column label="是否启用" align="center" prop="enabled"> <!-- <el-table-column label="是否启用" align="center" prop="enabled">-->
<template slot-scope="d"> <!-- <template slot-scope="d">-->
<el-switch v-model="d.row.enabled" @change="(nv) => {onChangeEnabled(d.row, nv)}"/> <!-- <el-switch v-model="d.row.enabled" @change="(nv) => {onChangeEnabled(d.row, nv)}"/>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
<el-table-column label="渠道成本" align="center" prop="costRate"> <el-table-column label="渠道成本" align="center" prop="costRate">
<template slot-scope="d">{{d.row.costRate | money}} %</template> <template slot-scope="d">{{d.row.costRate | money}} %</template>
</el-table-column> </el-table-column>
@ -66,7 +66,7 @@
/> />
<!-- 添加或修改充值渠道对话框 --> <!-- 添加或修改充值渠道对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="7em"> <el-form ref="form" :model="form" :rules="rules" label-width="7em">
<form-col :span="span" label="渠道名称" prop="name"> <form-col :span="span" label="渠道名称" prop="name">
<el-input v-model="form.name" placeholder="请输入渠道名称" disabled readonly/> <el-input v-model="form.name" placeholder="请输入渠道名称" disabled readonly/>
@ -74,14 +74,51 @@
<form-col :span="span" label="图片" prop="picture"> <form-col :span="span" label="图片" prop="picture">
<image-upload v-model="form.picture" :limit="1"/> <image-upload v-model="form.picture" :limit="1"/>
</form-col> </form-col>
<form-col :span="span" label="是否启用" prop="enabled"> <!-- <form-col :span="span" label="是否启用" prop="enabled">-->
<el-switch v-model="form.enabled" /> <!-- <el-switch v-model="form.enabled" />-->
</form-col> <!-- </form-col>-->
<form-col :span="span" label="渠道成本" prop="costRate"> <form-col :span="span" label="渠道成本" prop="costRate">
<el-input v-model.number="form.costRate" placeholder="请输入充值成本率" :min="0"> <el-input v-model.number="form.costRate" placeholder="请输入充值成本率" :min="0">
<template #suffix>%</template> <template #suffix>%</template>
</el-input> </el-input>
</form-col> </form-col>
<h2 style="font-weight: 700;font-size: 18px">相关配置</h2>
<el-row>
<el-col :span="12">
<el-form-item label="商户号" prop="merchantId">
<el-input style="width: 100%" v-model="form.merchantId" placeholder="请输入商户号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="apiV3密钥" prop="apiV3Key">
<el-input v-model="form.apiV3Key" placeholder="请输入apiV3密钥" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="通知回调地址" label-width="100" prop="notifyUrl">
<el-input style="width: 66%" v-model="form.notifyUrl" placeholder="请输入通知回调地址" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="密钥所在位置" label-width="100" prop="privateKeyPath">
<el-input style="width: 70%" v-model="form.privateKeyPath" placeholder="请输入密钥所在位置" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="证书序列号" label-width="90" prop="merchantSerialNumber">
<el-input style="width: 70%" v-model="form.merchantSerialNumber" placeholder="请输入证书序列号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="退款回调地址" label-width="100" prop="refundNotifyUrl">
<el-input style="width: 70%" v-model="form.refundNotifyUrl" placeholder="请输入退款回调地址" />
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -136,9 +173,9 @@ export default {
name: [ name: [
{required: true, message: '渠道名称不能为空', target: 'blur'} {required: true, message: '渠道名称不能为空', target: 'blur'}
], ],
enabled: [ // enabled: [
{required: true, type: 'boolean', message: '是否启用不能为空', target: 'blur'} // {required: true, type: 'boolean', message: '', target: 'blur'}
], // ],
costRate: [ costRate: [
{required: true, type: 'number', message: '成本不能为空', target: 'blur'} {required: true, type: 'number', message: '成本不能为空', target: 'blur'}
], ],
@ -156,14 +193,14 @@ export default {
return parseFloat(val); return parseFloat(val);
}, },
// //
onChangeEnabled(row, enabled) { // onChangeEnabled(row, enabled) {
if (row == null) { // if (row == null) {
return this.$message.warning("参数错误"); // return this.$message.warning("");
} // }
updateChannel({channelId: row.channelId, enabled: enabled}).catch(() => { // updateChannel({channelId: row.channelId, enabled: enabled}).catch(() => {
row.enabled = !enabled; // row.enabled = !enabled;
}) // })
}, // },
onChangeWithdrawEnabled(row, enabled) { onChangeWithdrawEnabled(row, enabled) {
if (row == null) { if (row == null) {
return this.$message.warning("参数错误"); return this.$message.warning("参数错误");

View File

@ -230,17 +230,17 @@
<!-- <el-switch v-model="form.isProfitSharing" class="drawer-switch" />--> <!-- <el-switch v-model="form.isProfitSharing" class="drawer-switch" />-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-col>--> <!-- </el-col>-->
<el-col :span="12"> <!-- <el-col :span="12">-->
<el-form-item label="是否有独立支付账户" label-width="120" prop="separateAccount"> <!-- <el-form-item label="是否有独立支付账户" label-width="120" prop="separateAccount">-->
<el-radio-group v-model="form.separateAccount"> <!-- <el-radio-group v-model="form.separateAccount">-->
<el-radio <!-- <el-radio-->
v-for="dict in dict.type.sys_yes_no" <!-- v-for="dict in dict.type.sys_yes_no"-->
:key="dict.value" <!-- :key="dict.value"-->
:label="dict.value" <!-- :label="dict.value"-->
>{{dict.label}}</el-radio> <!-- >{{dict.label}}</el-radio>-->
</el-radio-group> <!-- </el-radio-group>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -315,45 +315,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<div v-if="form.separateAccount == 'Y'">
<h2 style="font-weight: 700;font-size: 18px">支付相关</h2>
<el-row>
<el-col :span="12">
<el-form-item label="商户号" prop="merchantId">
<el-input style="width: 100%" v-model="form.merchantId" placeholder="请输入商户号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="apiV3密钥" prop="apiV3Key">
<el-input v-model="form.apiV3Key" placeholder="请输入apiV3密钥" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="通知回调地址" label-width="100" prop="notifyUrl">
<el-input style="width: 66%" v-model="form.notifyUrl" placeholder="请输入通知回调地址" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="密钥所在位置" label-width="100" prop="privateKeyPath">
<el-input style="width: 70%" v-model="form.privateKeyPath" placeholder="请输入密钥所在位置" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="证书序列号" label-width="90" prop="merchantSerialNumber">
<el-input style="width: 70%" v-model="form.merchantSerialNumber" placeholder="请输入证书序列号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="退款回调地址" label-width="100" prop="refundNotifyUrl">
<el-input style="width: 70%" v-model="form.refundNotifyUrl" placeholder="请输入退款回调地址" />
</el-form-item>
</el-col>
</el-row>
</div>
</div> </div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">