Merge branch 'new-pay'

This commit is contained in:
邱贞招 2024-09-16 03:33:52 +08:00
commit 6e533a2524
6 changed files with 133 additions and 73 deletions

View File

@ -36,11 +36,11 @@
<el-table-column label="图片" align="center" prop="picture" width="100">
<image-preview slot-scope="d" :src="d.row.picture" :width="32" :height="32"/>
</el-table-column>
<el-table-column label="是否启用" align="center" prop="enabled">
<template slot-scope="d">
<el-switch v-model="d.row.enabled" @change="(nv) => {onChangeEnabled(d.row, nv)}"/>
</template>
</el-table-column>
<!-- <el-table-column label="是否启用" align="center" prop="enabled">-->
<!-- <template slot-scope="d">-->
<!-- <el-switch v-model="d.row.enabled" @change="(nv) => {onChangeEnabled(d.row, nv)}"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="渠道成本" align="center" prop="costRate">
<template slot-scope="d">{{d.row.costRate | money}} %</template>
</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">
<form-col :span="span" label="渠道名称" prop="name">
<el-input v-model="form.name" placeholder="请输入渠道名称" disabled readonly/>
@ -74,14 +74,51 @@
<form-col :span="span" label="图片" prop="picture">
<image-upload v-model="form.picture" :limit="1"/>
</form-col>
<form-col :span="span" label="是否启用" prop="enabled">
<el-switch v-model="form.enabled" />
</form-col>
<!-- <form-col :span="span" label="是否启用" prop="enabled">-->
<!-- <el-switch v-model="form.enabled" />-->
<!-- </form-col>-->
<form-col :span="span" label="渠道成本" prop="costRate">
<el-input v-model.number="form.costRate" placeholder="请输入充值成本率" :min="0">
<template #suffix>%</template>
</el-input>
</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>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -136,9 +173,9 @@ export default {
name: [
{required: true, message: '渠道名称不能为空', target: 'blur'}
],
enabled: [
{required: true, type: 'boolean', message: '是否启用不能为空', target: 'blur'}
],
// enabled: [
// {required: true, type: 'boolean', message: '', target: 'blur'}
// ],
costRate: [
{required: true, type: 'number', message: '成本不能为空', target: 'blur'}
],
@ -156,14 +193,14 @@ export default {
return parseFloat(val);
},
//
onChangeEnabled(row, enabled) {
if (row == null) {
return this.$message.warning("参数错误");
}
updateChannel({channelId: row.channelId, enabled: enabled}).catch(() => {
row.enabled = !enabled;
})
},
// onChangeEnabled(row, enabled) {
// if (row == null) {
// return this.$message.warning("");
// }
// updateChannel({channelId: row.channelId, enabled: enabled}).catch(() => {
// row.enabled = !enabled;
// })
// },
onChangeWithdrawEnabled(row, enabled) {
if (row == null) {
return this.$message.warning("参数错误");

View File

@ -212,7 +212,7 @@
<el-row>
<el-col :span="24">
<el-form-item label="绑定运营区" label-width="90">
<el-select style="width: 85%" v-model="form.areaIds" multiple placeholder="请绑定运营区">
<el-select style="width: 91%" v-model="form.areaIds" multiple placeholder="请绑定运营区">
<el-option
v-for="item in areaOptions"
:key="item.areaId"
@ -223,6 +223,20 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="支付渠道" label-width="90" prop="payChannel">
<el-select style="width: 91%" v-model="form.payChannel" placeholder="请绑定支付渠道">
<el-option
v-for="item in channelOptions"
:key="item.channelId"
:label="item.name"
:value="item.channelId"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<div v-if="form.parentId != 0">
<el-row>
<!-- <el-col :span="12">-->
@ -230,17 +244,17 @@
<!-- <el-switch v-model="form.isProfitSharing" class="drawer-switch" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<el-col :span="12">
<el-form-item label="是否有独立支付账户" label-width="120" prop="separateAccount">
<el-radio-group v-model="form.separateAccount">
<el-radio
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<!-- <el-col :span="12">-->
<!-- <el-form-item label="是否有独立支付账户" label-width="120" prop="separateAccount">-->
<!-- <el-radio-group v-model="form.separateAccount">-->
<!-- <el-radio-->
<!-- v-for="dict in dict.type.sys_yes_no"-->
<!-- :key="dict.value"-->
<!-- :label="dict.value"-->
<!-- >{{dict.label}}</el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- </el-col>-->
</el-row>
<el-row>
<el-col :span="12">
@ -315,45 +329,7 @@
</el-form-item>
</el-col>
</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>
</el-form>
<div slot="footer" class="dialog-footer">
@ -408,6 +384,7 @@ import { listArea } from '../../../api/system/area'
import { fastSearch } from '@/api/user/user'
import { getUser } from '@/api/system/user'
import { withdraw } from '@/api/system/flow'
import { listChannel } from '@/api/system/channel'
export default {
name: "Dept",
@ -472,6 +449,8 @@ export default {
options: [],
//
areaOptions: [],
//
channelOptions: [],
//
defaultSort: {prop: 'createTime', order: 'descending'},
//
@ -516,6 +495,9 @@ export default {
handlingCharge: [
{ required: true, message: "手续费不能为空", trigger: "blur" }
],
payChannel: [
{ required: true, message: "支付渠道不能为空", trigger: "blur" }
],
// orderNum: [
// { required: true, message: "", trigger: "blur" }
// ],
@ -708,6 +690,9 @@ export default {
this.areaOptions = response.rows;
this.form.parentId = 100;
});
listChannel(this.queryParams).then(response => {
this.channelOptions = response.rows;
});
});
},
/** 展开/折叠操作 */
@ -736,6 +721,9 @@ export default {
listArea({ pageNum: 1, pageSize: 999}).then(response => {
this.areaOptions = response.rows;
});
listChannel(this.queryParams).then(response => {
this.channelOptions = response.rows;
});
listDeptExcludeChild(row.deptId).then(response => {
this.deptOptions = this.handleTree(response.data, "deptId");
if (this.deptOptions.length == 0) {

View File

@ -1027,7 +1027,7 @@ export default {
{ key: 13, label: `车辆状态`, visible: true },
{ key: 14, label: ``, visible: true },
{ key: 15, label: `网络`, visible: true },
{ key: 16, label: `二维码`, visible: false },
{ key: 16, label: `二维码`, visible: true },
{ key: 17, label: `创建时间`, visible: false },
],
showPlaceSearchMap: false,

View File

@ -80,6 +80,17 @@
<el-table-column label="亏电电压(V)" align="center" prop="lowVoltage" />
<el-table-column label="满电续航(km)" align="center" prop="fullEndurance" />
<el-table-column label="骑行低电量提醒(%)" align="center" prop="lowBatteryReminder" />
<!-- 新增低电量提醒开关 -->
<el-table-column label="低电量提醒开关" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.lowBatteryReminderSwitch"
:active-value="true"
:inactive-value="false"
@change="handleLowBatteryReminderSwitchChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="已投放车辆" align="center" prop="deviceNum" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
@ -275,6 +286,25 @@ export default {
},
},
methods: {
handleLowBatteryReminderSwitchChange(row) {
//
let text = row.lowBatteryReminderSwitch ? "启用低电量提醒" : "关闭低电量提醒";
this.$modal.confirm(`确认要"${text}"吗?`).then(() => {
//
const updateData = {
...row, //
lowBatteryReminderSwitch: row.lowBatteryReminderSwitch //
};
// updateModel
return updateModel(updateData).then(response => {
this.$modal.msgSuccess(`${text}成功`);
this.getList(); //
}).catch(() => {
//
row.lowBatteryReminderSwitch = !row.lowBatteryReminderSwitch;
});
});
},
/** 当选择代理商时 根据代理商id获取运营区和型号 */
fetchData2(deptId,oldVal) {
console.log("deptId1111",deptId)
@ -410,6 +440,10 @@ export default {
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.lowBatteryReminderSwitch === undefined || this.form.lowBatteryReminderSwitch === null) {
this.form.lowBatteryReminderSwitch = false;
}
if (this.form.modelId != null) {
updateModel(this.form).then(response => {
this.$modal.msgSuccess("修改成功");

View File

@ -401,7 +401,7 @@
{{ form.rule.name }}
</span><br />
<span>
{{ form.rule.description }}
{{ form.description }}
</span><br />
</el-form-item>
</el-col>

View File

@ -438,6 +438,7 @@ export default {
dividendStatus: undefined,
status: "0",
remark: undefined,
payChannel: undefined,
areaIds: [],
postIds: [],
roleIds: []