分润配置页面

This commit is contained in:
BOOL\25024
2024-09-28 17:00:25 +08:00
parent a7b69567ce
commit 1aff2edea8
2 changed files with 282 additions and 286 deletions

View File

@@ -34,13 +34,21 @@
<el-row>
<el-col :span="12">
<el-form-item label="当前配置二维码规则:">
<el-input v-model="stationDetail.qrcodePrefix" maxlength="100px" :disabled="true" />
<el-input
v-model="stationDetail.qrcodePrefix"
maxlength="100px"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item>
<el-button icon="el-icon-setting" size="big" @click="handleCreate"
v-has-permi="['pile:station:edit']">配置参数
<el-button
icon="el-icon-setting"
size="big"
@click="handleCreate"
v-has-permi="['pile:station:edit']"
>配置参数
</el-button>
</el-form-item>
</el-col>
@@ -50,17 +58,27 @@
<el-card style="margin-bottom: 10px">
<h2>互联互通配置</h2>
<!-- <el-button icon="el-icon-edit" size="big" @click="openEdit" v-has-permi="['pile:station:edit']">编辑参数-->
<!-- </el-button>-->
<el-form ref="stationSettingForm" :model="stationSettingInfo" label-position="right" label-width="200px"
style="margin-top: 10px">
<!-- <el-button icon="el-icon-edit" size="big" @click="openEdit" v-has-permi="['pile:station:edit']">编辑参数-->
<!-- </el-button>-->
<el-form
ref="stationSettingForm"
:model="stationSettingInfo"
label-position="right"
label-width="200px"
style="margin-top: 10px"
>
<el-row>
<el-col :span="12">
<el-form-item label="对接平台名称:" prop="type">
<el-checkbox-group v-model="checkList">
<el-checkbox v-for="dict in dict.type.third_party_type" :label="dict.label" :key="dict.value"
:value="dict.value" :disabled="firstList.includes(dict.label)"
@change="getPlatform(dict.raw.dictValue)" />
<el-checkbox
v-for="dict in dict.type.third_party_type"
:label="dict.label"
:key="dict.value"
:value="dict.value"
:disabled="firstList.includes(dict.label)"
@change="getPlatform(dict.raw.dictValue)"
/>
</el-checkbox-group>
</el-form-item>
</el-col>
@@ -69,9 +87,13 @@
<!--<el-button size="big" @click="pushStation" v-has-permi="['pile:station:edit']">-->
<!-- 推送站点信息-->
<!--</el-button>-->
<el-button size="big" @click="saveStationThirdParty" v-has-permi="['pile:station:edit']">
保存对接平台关系
</el-button>
<el-button
size="big"
@click="saveStationThirdParty"
v-has-permi="['pile:station:edit']"
>
保存对接平台关系
</el-button>
</el-form-item>
</el-col>
</el-row>
@@ -80,48 +102,89 @@
<el-card style="margin-bottom: 10px">
<h2>绑定停车平台(配置完成后订单完成将自动下发优惠券)</h2>
<el-button icon="el-icon-edit" size="big" @click="parkingOpenEdit" v-has-permi="['pile:station:edit']">编辑参数
<el-button
icon="el-icon-edit"
size="big"
@click="parkingOpenEdit"
v-has-permi="['pile:station:edit']"
>编辑参数
</el-button>
<el-form ref="parkingForm" :model="parkingInfo" label-position="right" label-width="200px"
style="margin-top: 10px">
<el-form
ref="parkingForm"
:model="parkingInfo"
label-position="right"
label-width="200px"
style="margin-top: 10px"
>
<el-row>
<el-col :span="5">
<el-form-item label="停车平台名称:" prop="type">
<el-select v-model="parkingInfo.parkingName" placeholder="请选择停车平台名称" clearable filterable
style="width: 220px" :disabled="parkingDisableFlag" @change="getParkingInfo($event)">
<el-option v-for="item in parkingInfoList" :key="item.id" :label="item.parkingName"
:value="item.id" />
<el-select
v-model="parkingInfo.parkingName"
placeholder="请选择停车平台名称"
clearable
filterable
style="width: 220px"
:disabled="parkingDisableFlag"
@change="getParkingInfo($event)"
>
<el-option
v-for="item in parkingInfoList"
:key="item.id"
:label="item.parkingName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item>
<el-button size="big" @click="saveParkingSetting(parkingInfo.id)" v-has-permi="['pile:station:edit']">
<el-button
size="big"
@click="saveParkingSetting(parkingInfo.id)"
v-has-permi="['pile:station:edit']"
>
保存
</el-button>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停车场库secretKey:" prop="secretKey">
<el-input placeholder="请输入" v-model="parkingInfo.secretKey" :disabled="true" />
<el-input
placeholder="请输入"
v-model="parkingInfo.secretKey"
:disabled="true"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停车场库appId:" prop="appId">
<el-input placeholder="请输入" v-model="parkingInfo.appId" :disabled="true" />
<el-input
placeholder="请输入"
v-model="parkingInfo.appId"
:disabled="true"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="票券id:" prop="couponId">
<el-input placeholder="请输入" v-model="parkingInfo.couponId" :disabled="false" />
<el-input
placeholder="请输入"
v-model="parkingInfo.couponId"
:disabled="false"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停车场库商户id:" prop="parkingMerchantId">
<el-input placeholder="请输入" v-model="parkingInfo.parkingMerchantId" :disabled="false" />
<el-input
placeholder="请输入"
v-model="parkingInfo.parkingMerchantId"
:disabled="false"
/>
</el-form-item>
</el-col>
</el-row>
@@ -135,8 +198,13 @@
<el-col :span="12">
<el-form-item label="查询地锁列表二维码:" />
<div>
<vue-qr ref="Qrcode" :text="queryGroundLockQrCode" qid="lockListQrCode" :width="150"
style="margin-left: 190px; margin-top: -10px" />
<vue-qr
ref="Qrcode"
:text="queryGroundLockQrCode"
qid="lockListQrCode"
:width="150"
style="margin-left: 190px; margin-top: -10px"
/>
</div>
</el-col>
</el-row>
@@ -152,15 +220,19 @@
<order-report ref="orderReport"></order-report>
</el-tab-pane>
<el-tab-pane label="分成配置" name="orderReport">
<order-report ref="orderReport"></order-report>
<el-tab-pane label="分成配置" name="Config">
<Config ref="orderReport"></Config>
</el-tab-pane>
</el-tabs>
<el-dialog :title="dialogTitle" :visible.sync="dialogFormVisible">
<el-form ref="form" :model="form" @submit.native.prevent>
<el-form-item label="二维码前缀:" prop="prefix" label-width="100px">
<el-input v-model="form.prefix" placeholder="请输入二维码前缀" style="width: 300px" />
<el-input
v-model="form.prefix"
placeholder="请输入二维码前缀"
style="width: 300px"
/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer" align="center">
@@ -181,17 +253,20 @@ import MapContainer from "../../../components/MapContainer/MapContainer.vue";
import stationOrderList from "@/views/pile/station/stationOrderList";
import stationWhiteList from "@/views/pile/station/stationWhiteList";
import {
getStationInfo,
updateStationQRCodePrefix,
getSettingByStationId,
updateSettingByStationId,
pushStationInfo,
getSettingInfo,
getParkingInfoList,
bindParkingPlatform, getRelationByStationId, updateThirdPartyStationRelation,
getStationInfo,
updateStationQRCodePrefix,
getSettingByStationId,
updateSettingByStationId,
pushStationInfo,
getSettingInfo,
getParkingInfoList,
bindParkingPlatform,
getRelationByStationId,
updateThirdPartyStationRelation,
} from "@/api/pile/station";
import Whitelist from "@/views/pile/station/stationWhiteList";
import OrderReport from "./orderReport.vue";
import Config from "@/views/pile/station/splitConfig.vue";
export default {
dicts: ["third_party_type"],
@@ -206,6 +281,7 @@ export default {
stationOrderList,
stationWhiteList,
OrderReport,
Config
},
data() {
return {
@@ -236,9 +312,8 @@ export default {
// console.log(this.stationId, "充电桩详情 create");
// const stationId = this.stationId;
this.queryGroundLockQrCode =
"https://api.jsowellcloud.com/app-xcx-h5/getGroundLockInfo/" +
this.stationId;
this.updateTitle();
"https://api.jsowellcloud.com/app-xcx-h5/getGroundLockInfo/" + this.stationId;
this.updateTitle();
this.getRelationByStationId();
this.getParkingList();
this.queryStationInfo();
@@ -247,13 +322,13 @@ export default {
this.initializeData(this.activeName);
},
methods: {
// 更新页面title显示
updateTitle() {
const stationName = this.stationName;
const title = "【" + stationName + "】站点详情";
const route = Object.assign({}, this.$route, { title: `${title}` });
this.$store.dispatch("tagsView/updateVisitedView", route);
},
// 更新页面title显示
updateTitle() {
const stationName = this.stationName;
const title = "【" + stationName + "】站点详情";
const route = Object.assign({}, this.$route, { title: `${title}` });
this.$store.dispatch("tagsView/updateVisitedView", route);
},
handleClick(tab, event) {
// console.log(tab, event);
this.initializeData(tab.name);
@@ -300,7 +375,7 @@ export default {
res.rows.forEach((item, index) => {
this.checkList.push(item.thirdPartyType);
this.firstList.push(item.thirdPartyType);
})
});
console.log("this.checkList", this.checkList, this.firstList);
// if (res.data === undefined) {
// this.stationSettingInfo.thirdPartyType = "0";
@@ -379,12 +454,12 @@ export default {
},
// 推送站点
pushStation() {
let exchange = ''
let exchange = "";
const param = {
stationId: this.stationId,
thirdPartyTypes: this.exchange,
};
console.log('param', param);
console.log("param", param);
pushStationInfo(param).then((response) => {
console.log("response", response);
this.$modal.msg(response.obj);
@@ -392,17 +467,17 @@ export default {
});
},
// 保存站点与第三方平台关系
saveStationThirdParty() {
const param = {
stationId: this.stationId,
thirdPartyTypes: this.exchange,
};
console.log('param', param);
updateThirdPartyStationRelation(param).then((response) => {
this.$message.success(response.msg);
});
},
// 保存站点与第三方平台关系
saveStationThirdParty() {
const param = {
stationId: this.stationId,
thirdPartyTypes: this.exchange,
};
console.log("param", param);
updateThirdPartyStationRelation(param).then((response) => {
this.$message.success(response.msg);
});
},
// 绑定站点与停车平台配置
saveParkingSetting(parkingId) {
@@ -449,13 +524,17 @@ export default {
// 复选框状态
getPlatform(id) {
this.exchange.push(id);
}
},
},
//监听复选框状态
watch: {
checkList: {
handler(newVal) {
this.exchange = newVal.map(item => this.dict.type.third_party_type.find(dict => dict.label === item)?.raw?.dictValue);
this.exchange = newVal.map(
(item) =>
this.dict.type.third_party_type.find((dict) => dict.label === item)?.raw
?.dictValue
);
},
deep: true,
},

View File

@@ -1,92 +1,79 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="交易日期" prop="tradeDate">
<el-date-picker
v-model="value"
style="width: 240px"
value-format="yyyy-MM-dd HH:mm:ss"
:default-time="['00:00:00', '23:59:59']"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
:clearable=false
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table v-loading="loading" :data="reportList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="交易日期" align="center" prop="tradeDate" />
<el-table-column label="用电度数" align="center" prop="useElectricity" />
<el-table-column label="充电次数" align="center" prop="chargeNum" />
<el-table-column label="充电时长" align="center" prop="chargeTime" />
<el-table-column label="电费金额" align="center" prop="electricityAmount" />
<el-table-column label="服务费金额" align="center" prop="serviceAmount" />
<el-table-column label="收入金额" align="center" prop="totalAmount" />
<el-table-column label="虚拟金额" align="center" prop="virtualAmount" />
<el-table-column label="交易金额" align="center" prop="tradeAmount" />
<el-table-column label="交易手续费" align="center" prop="tradeFee" />
<el-row :gutter="10">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>
新增
</el-button>
</el-col>
</el-row>
<el-table :data="carList" stripe style="width: 100%; margin-top: 20px">
<el-table-column label="分润人" align="center" prop="aaa" />
<el-table-column label="电费比例(%" align="center" prop="bbb">
<template slot-scope="scope">
<el-input
style="width: 200px"
v-model="scope.row.bbb"
placeholder="请输入手机号码"
/>
</template>
</el-table-column>
<el-table-column label="服务费比例(%" align="center" prop="ccc">
<template slot-scope="scope">
<el-input
style="width: 200px"
v-model="scope.row.ccc"
placeholder="请输入手机号码"
/>
</template>
</el-table-column>
<el-table-column label="是否承担手续费" align="center" width="200">
<template slot-scope="scope">
<!-- <el-switch
v-model="scope.row.state"
active-text=""
inactive-text=""
></el-switch> -->
<el-switch
v-model="scope.row.state"
></el-switch>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改结算订单报对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="运营商id" prop="merchantId">
<el-input v-model="form.merchantId" placeholder="请输入运营商id" />
</el-form-item>
<el-form-item label="站点id" prop="stationId">
<el-input v-model="form.stationId" placeholder="请输入站点id" />
</el-form-item>
<el-form-item label="用电度数" prop="useElectricity">
<el-input v-model="form.useElectricity" placeholder="请输入用电度数" />
</el-form-item>
<el-form-item label="充电次数" prop="chargeNum">
<el-input v-model="form.chargeNum" placeholder="请输入充电次数" />
</el-form-item>
<el-form-item label="充电时长" prop="chargeTime">
<el-input v-model="form.chargeTime" placeholder="请输入充电时长" />
</el-form-item>
<el-form-item label="电费金额" prop="electricityAmount">
<el-input v-model="form.electricityAmount" placeholder="请输入电费金额" />
</el-form-item>
<el-form-item label="服务费金额" prop="serviceAmount">
<el-input v-model="form.serviceAmount" placeholder="请输入服务费金额" />
</el-form-item>
<el-form-item label="收入金额" prop="totalAmount">
<el-input v-model="form.totalAmount" placeholder="请输入收入金额" />
</el-form-item>
<el-form-item label="虚拟金额" prop="virtualAmount">
<el-input v-model="form.virtualAmount" placeholder="请输入虚拟金额" />
</el-form-item>
<el-form-item label="交易日期" prop="tradeDate">
<el-input v-model="form.tradeDate" placeholder="请输入交易日期" />
</el-form-item>
<el-form-item label="交易金额" prop="tradeAmount">
<el-input v-model="form.tradeAmount" placeholder="请输入交易金额" />
</el-form-item>
<el-form-item label="交易手续费" prop="tradeFee">
<el-input v-model="form.tradeFee" placeholder="请输入交易手续费" />
</el-form-item>
<el-form-item label="删除标识" prop="delFlag">
<el-input v-model="form.delFlag" placeholder="请输入删除标识" />
<div class="save">
<el-button type="primary" @click="getSave"> 保存 </el-button>
</div>
<!-- 添加分润人弹框 -->
<el-dialog
title="添加分润人"
:visible.sync="open"
width="600px"
append-to-body
:before-close="cancel"
>
<el-form ref="form" :model="form" label-width="100px">
<el-form-item label="选择运营商">
<el-select
v-model="createMerchantVip.targetMerchantId"
clearable
filterable
placeholder="请选择运营商"
@change="$forceUpdate()"
>
<el-option
v-for="item in merchantList"
:key="item.merchantId"
:label="item.merchantName"
:value="item.merchantId"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -98,168 +85,98 @@
</template>
<script>
import { listReport, getReport, delReport, addReport, updateReport } from "@/api/settle/orderReport";
import { getMerchantListByAuth } from "@/api/member/info";
export default {
name: "Report",
data() {
return {
value:'',
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 结算订单报表格数据
reportList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
merchantId: null,
stationId: null,
useElectricity: null,
chargeNum: null,
chargeTime: null,
electricityAmount: null,
serviceAmount: null,
totalAmount: null,
virtualAmount: null,
tradeDate: null,
tradeAmount: null,
tradeFee: null,
},
// 运营商列表
merchantList: [],
// 表单参数
form: {},
// 表单校验
rules: {
}
createMerchantVip: {},
carList: [
{
aaa: "运营商A",
bbb: "20",
ccc: "20",
state: false,
},
{
aaa: "运营商B",
bbb: "60",
ccc: "40",
state: true,
},
{
aaa: "运营商C",
bbb: "30",
ccc: "40",
state: true,
},
],
};
},
created() {
// this.getList();
this.getMerchantList();
},
methods: {
/** 查询结算订单报列表 */
getList() {
this.loading = true;
this.queryParams.stationId = this.$route.params.id
listReport(this.queryParams).then(response => {
console.log('查询订单日报',response)
this.reportList = response.rows;
this.total = response.total;
this.loading = false;
});
/** 新增按钮操作 */
handleAdd() {
this.open = true;
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
merchantId: null,
stationId: null,
useElectricity: null,
chargeNum: null,
chargeTime: null,
electricityAmount: null,
serviceAmount: null,
totalAmount: null,
virtualAmount: null,
tradeDate: null,
tradeAmount: null,
tradeFee: null,
createTime: null,
delFlag: null
};
this.resetForm("form");
this.createMerchantVip = {};
},
/** 搜索按钮操作 */
handleQuery() {
console.log('this.value 日期',this.value)
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.value = null
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加结算订单报";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getReport(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改结算订单报";
// 获取运营商列表
getMerchantList() {
getMerchantListByAuth().then((response) => {
console.log("response", response);
this.merchantList = response.obj;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateReport(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addReport(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
this.$refs["form"].validate((valid) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
// this.getList();
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除结算订单报编号为"' + ids + '"的数据项?').then(function() {
return delReport(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
// 保存
getSave() {
let totalBbbA = 0;
this.carList.forEach((car) => {
totalBbbA += Number(car.bbb);
});
// 检查总和是否等于100
if (totalBbbA != 100) return this.$modal.msgError("电费分成比例相加必须等于100%");
let totalBbbB = 0;
this.carList.forEach((car) => {
totalBbbB += Number(car.ccc);
});
// 检查总和是否等于100
if (totalBbbB != 100) return this.$modal.msgError("服务费分成比例相加必须等于100%");
let trueCount = 0;
this.carList.forEach((car) => {
if (car.state) trueCount++;
});
// 检查是否只有一个人承担手续费
if (trueCount != 1) return this.$modal.msgError("手续费只能有一个人承担");
},
/** 导出按钮操作 */
handleExport() {
this.download('pile/report/export', {
...this.queryParams
}, `report_${new Date().getTime()}.xlsx`)
}
}
},
};
</script>
<style scoped>
.save {
text-align: right;
margin-top: 20px;
}
</style>