Merge branch 'dev-new' into dev

This commit is contained in:
Guoqs
2025-01-03 11:14:24 +08:00
3 changed files with 36 additions and 20 deletions

View File

@@ -221,7 +221,7 @@
</el-tab-pane>
<el-tab-pane label="分润配置" name="Config">
<Config :stationId="stationId" :merchantId="merchantId"></Config>
<Config ref="Config" :stationId="stationId" :merchantId="merchantId"></Config>
</el-tab-pane>
</el-tabs>
@@ -306,7 +306,7 @@ export default {
parkingDisableFlag: true,
exchange: [],
firstList: [], //第一次复选框的默认值
merchantId: this.$route.params.merchantId, //运营商id
merchantId: "", //运营商id
};
},
created() {
@@ -350,16 +350,19 @@ export default {
this.$refs.order.dataLoading();
} else if (name === "orderReport") {
this.$refs.orderReport.getList();
} else if (name === "Config") {
this.queryStationInfo();
this.$refs.Config.getList();
}
},
queryStationInfo() {
async queryStationInfo() {
console.log("stationId", this.stationId);
getStationInfo(this.stationId).then((res) => {
// console.log(res);
await getStationInfo(this.stationId).then((res) => {
this.stationDetail = res.data;
this.stationLat = res.data.stationLat;
this.stationLng = res.data.stationLng;
console.log(this.stationLat, this.stationLng, "父组件里面的经纬度");
this.merchantId = res.data.merchantId;
console.log(this.merchantId, "父组件里面的运营商id");
console.log("res.data", res.data);
if (res.data.parkingId != null) {
this.getParkingInfo(parseInt(res.data.parkingId));

View File

@@ -395,7 +395,6 @@ export default {
params: {
id: scope.row.id,
stationName: scope.row.stationName,
merchantId: scope.row.merchantId,
}
});
},

View File

@@ -13,7 +13,12 @@
</el-button>
</el-col>
</el-row>
<el-table :data="carList" stripe style="width: 100%; margin-top: 20px">
<el-table
:data="carList"
stripe
style="width: 100%; margin-top: 20px"
v-loading="loading"
>
<el-table-column label="分润人" align="center" prop="splitName" />
<el-table-column label="电费比例(%" align="center" prop="electricitySplitRatio">
<template slot-scope="scope">
@@ -36,7 +41,11 @@
<el-table-column label="汇付会员id" align="center" prop="adapayMemberId" />
<el-table-column label="是否承担手续费" align="center" width="200">
<template slot-scope="scope">
<el-switch v-model="scope.row.feeFlag"></el-switch>
<el-switch
v-model="scope.row.feeFlag"
active-value="1"
inactive-value="0"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
@@ -45,7 +54,7 @@
size="mini"
type="text"
icon="el-icon-delete"
@click="deleteUpdate(scope.row.id)"
@click="deleteUpdate(scope.row.adapayMemberId)"
>删除</el-button
>
</template>
@@ -113,15 +122,13 @@ export default {
form: {},
createMerchantVip: {},
carList: [],
loading: true,
};
},
created() {
this.getMerchantList();
this.getList();
},
methods: {
/** 新增按钮操作 */
handleAdd() {
this.getMerchantList();
this.open = true;
},
cancel() {
@@ -150,10 +157,11 @@ export default {
adapayMemberId: selectedMerchant.adapayMemberId,
electricitySplitRatio: 0,
serviceSplitRatio: 0,
feeFlag: false,
feeFlag: 0,
};
this.carList.push(newDetail);
this.open = false;
this.reset();
console.log(this.carList);
},
// 保存
@@ -172,7 +180,7 @@ export default {
if (totalBbbB != 100) return this.$modal.msgError("服务费分成比例相加必须等于100%");
let trueCount = 0;
this.carList.forEach((car) => {
if (car.feeFlag) trueCount++;
if (car.feeFlag == 1) trueCount++;
});
// 检查是否只有一个人承担手续费
if (trueCount != 1) return this.$modal.msgError("手续费有且只能有1位承担方");
@@ -189,20 +197,26 @@ export default {
this.getList();
})
.catch((error) => {
console.error("保存失败", error);
this.$modal.msgError("保存失败", error);
});
},
//删除
deleteUpdate() {},
//根据汇付id本地删除
deleteUpdate(id) {
this.carList = this.carList.filter((item) => item.adapayMemberId !== id);
console.log(this.carList);
},
// 根据站点id 查询站点分成配置
getList() {
console.log(this.stationId, this.merchantId);
getSplitConfigList(this.stationId)
.then((response) => {
console.log("根据站点id 查询站点分成配置", response);
this.carList = response.rows;
this.loading = false;
})
.catch((error) => {
console.error("查询站点分成配置时出错", error);
this.$modal.msgError("查询站点分成配置时出错", error);
this.loading = false;
});
},
},