mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-14 20:30:04 +08:00
站点修改费率
This commit is contained in:
@@ -105,4 +105,10 @@ export function changeStationTemplate(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询全部计费模板
|
// 查询vip站点计费模板
|
||||||
|
export function queryStationPreferentialBillingTemplateList(stationId) {
|
||||||
|
return request({
|
||||||
|
url: "/billing/template/queryStationPreferentialBillingTemplateList/" + stationId,
|
||||||
|
method: "get",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -175,10 +175,11 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<!-- 添加修改站点 -->
|
<!-- 添加修改站点 -->
|
||||||
<el-dialog title="添加站点" :visible.sync="getSite" :before-close="getCancel" width="1000px" append-to-body>
|
<el-dialog :title="getTitle" :visible.sync="getSite" :before-close="getCancel" width="1000px" append-to-body>
|
||||||
<el-form ref="exchangeRate" :model="exchangeRate" :rules="dialogRules">
|
<el-form ref="exchangeRateB" :model="exchangeRateB" :rules="dialogRules">
|
||||||
<el-form-item label="请选择站点">
|
<el-form-item label="请选择站点">
|
||||||
<el-select v-model="selectSite" placeholder="请选择站点" filterable style="width:300px" @change="queryInfo">
|
<el-select v-model="selectSite" placeholder="请选择站点" filterable :disabled="getDisabled"
|
||||||
|
style="width:300px" @change="queryInfo">
|
||||||
<el-option v-for="(station, index) in stationList" :key="index" :label="station.stationName"
|
<el-option v-for="(station, index) in stationList" :key="index" :label="station.stationName"
|
||||||
:value="station.id" />
|
:value="station.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -218,13 +219,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item prop="modifyServiceA">
|
<el-form-item prop="modifyServiceA">
|
||||||
<el-input v-model="exchangeRate.modifyServiceA" type="number" class="clearInputScore"
|
<el-input v-model="exchangeRateB.modifyServiceA" type="number" class="clearInputScore"
|
||||||
placeholder="0" clearable />
|
placeholder="0" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item prop="modifyElectricityA">
|
<el-form-item prop="modifyElectricityA">
|
||||||
<el-input v-model="exchangeRate.modifyElectricityA" placeholder="0" clearable type="number"
|
<el-input v-model="exchangeRateB.modifyElectricityA" placeholder="0" clearable type="number"
|
||||||
class="clearInputScore" />
|
class="clearInputScore" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -248,13 +249,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item prop="modifyServiceB">
|
<el-form-item prop="modifyServiceB">
|
||||||
<el-input v-model="exchangeRate.modifyServiceB" type="number" class="clearInputScore"
|
<el-input v-model="exchangeRateB.modifyServiceB" type="number" class="clearInputScore"
|
||||||
placeholder="0" clearable />
|
placeholder="0" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item prop="modifyElectricityB">
|
<el-form-item prop="modifyElectricityB">
|
||||||
<el-input v-model="exchangeRate.modifyElectricityB" placeholder="0" clearable type="number"
|
<el-input v-model="exchangeRateB.modifyElectricityB" placeholder="0" clearable type="number"
|
||||||
class="clearInputScore" />
|
class="clearInputScore" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -278,13 +279,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item prop="modifyServiceC">
|
<el-form-item prop="modifyServiceC">
|
||||||
<el-input v-model="exchangeRate.modifyServiceC" type="number" class="clearInputScore"
|
<el-input v-model="exchangeRateB.modifyServiceC" type="number" class="clearInputScore"
|
||||||
placeholder="0" clearable />
|
placeholder="0" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item prop="modifyElectricityC">
|
<el-form-item prop="modifyElectricityC">
|
||||||
<el-input v-model="exchangeRate.modifyElectricityC" placeholder="0" clearable type="number"
|
<el-input v-model="exchangeRateB.modifyElectricityC" placeholder="0" clearable type="number"
|
||||||
class="clearInputScore" />
|
class="clearInputScore" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -308,13 +309,13 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item prop="modifyServiceD">
|
<el-form-item prop="modifyServiceD">
|
||||||
<el-input v-model="exchangeRate.modifyServiceD" type="number" class="clearInputScore"
|
<el-input v-model="exchangeRateB.modifyServiceD" type="number" class="clearInputScore"
|
||||||
placeholder="0" clearable />
|
placeholder="0" clearable />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="4">
|
<el-col :span="4">
|
||||||
<el-form-item prop="modifyElectricityD">
|
<el-form-item prop="modifyElectricityD">
|
||||||
<el-input v-model="exchangeRate.modifyElectricityD" placeholder="0" clearable type="number"
|
<el-input v-model="exchangeRateB.modifyElectricityD" placeholder="0" clearable type="number"
|
||||||
class="clearInputScore" />
|
class="clearInputScore" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -340,7 +341,7 @@
|
|||||||
import { addMember, queryMemberList, preferentialTemplates, queryStationList } from "@/api/member/memberGroup";
|
import { addMember, queryMemberList, preferentialTemplates, queryStationList } from "@/api/member/memberGroup";
|
||||||
import { listOrder } from "@/api/order/order";
|
import { listOrder } from "@/api/order/order";
|
||||||
import { getStationListByMerchantId } from "@/api/pile/station";
|
import { getStationListByMerchantId } from "@/api/pile/station";
|
||||||
import { queryStationBillingTemplateList, getTemplate } from "@/api/billing/template.js";
|
import { queryStationBillingTemplateList, getTemplate, queryStationPreferentialBillingTemplateList, updateBillingTemplate } from "@/api/billing/template.js";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'JsowellUiDetail',
|
name: 'JsowellUiDetail',
|
||||||
@@ -450,6 +451,8 @@ export default {
|
|||||||
servicePriceC: '',
|
servicePriceC: '',
|
||||||
electricityPriceD: '',
|
electricityPriceD: '',
|
||||||
servicePriceD: '',
|
servicePriceD: '',
|
||||||
|
},
|
||||||
|
exchangeRateB: {
|
||||||
modifyServiceA: '',
|
modifyServiceA: '',
|
||||||
modifyElectricityA: '',
|
modifyElectricityA: '',
|
||||||
modifyServiceB: '',
|
modifyServiceB: '',
|
||||||
@@ -494,7 +497,10 @@ export default {
|
|||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
groupCode: this.$route.params.groupCode.split('&')[0],
|
groupCode: this.$route.params.groupCode.split('&')[0],
|
||||||
},
|
},
|
||||||
stationTotal: 0
|
stationTotal: 0,
|
||||||
|
getDisabled: false,
|
||||||
|
getTitle: '',
|
||||||
|
stationBillingTemplate: null
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -551,14 +557,42 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
//添加站点
|
//添加站点
|
||||||
addasite() {
|
addasite(row) {
|
||||||
console.log(this.$route.params.groupCode.split('&')[1]);
|
console.log(this.$route.params.groupCode.split('&')[1], row);
|
||||||
|
// 判断是修改站点还是添加站点
|
||||||
|
if (row.stationName) {
|
||||||
|
this.selectSite = row.stationName;
|
||||||
|
this.getTitle = '修改站点'
|
||||||
|
this.getSite = true;
|
||||||
|
this.getDisabled = true;
|
||||||
|
this.queryInfo(row.stationId);
|
||||||
|
// 查询vip计费模板详情
|
||||||
|
queryStationPreferentialBillingTemplateList(row.stationId).then((response) => {
|
||||||
|
console.log("通过站点id查询vip计费模板 result: ", response.rows, response.rows[0].templateId);
|
||||||
|
this.stationBillingTemplate = response.rows[0].templateId;
|
||||||
|
getTemplate(response.rows[0].templateId).then((response) => {
|
||||||
|
console.log("查询vip计费模板详情", response);
|
||||||
|
this.exchangeRateB = {
|
||||||
|
modifyServiceA: response.data.electricityPriceA,
|
||||||
|
modifyElectricityA: response.data.servicePriceA,
|
||||||
|
modifyServiceB: response.data.electricityPriceB,
|
||||||
|
modifyElectricityB: response.data.servicePriceB,
|
||||||
|
modifyServiceC: response.data.electricityPriceC,
|
||||||
|
modifyElectricityC: response.data.servicePriceC,
|
||||||
|
modifyServiceD: response.data.electricityPriceD,
|
||||||
|
modifyElectricityD: response.data.servicePriceD,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
let value = this.$route.params.groupCode.split('&')[1]
|
let value = this.$route.params.groupCode.split('&')[1]
|
||||||
this.getSite = true
|
this.getTitle = '添加站点'
|
||||||
|
this.getSite = true;
|
||||||
getStationListByMerchantId(value).then((response) => {
|
getStationListByMerchantId(value).then((response) => {
|
||||||
console.log('站点', response);
|
console.log('站点', response);
|
||||||
this.stationList = response.data;
|
this.stationList = response.data;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 站点弹框取消重置
|
// 站点弹框取消重置
|
||||||
getCancel() {
|
getCancel() {
|
||||||
@@ -574,6 +608,8 @@ export default {
|
|||||||
servicePriceC: "",
|
servicePriceC: "",
|
||||||
electricityPriceD: "",
|
electricityPriceD: "",
|
||||||
servicePriceD: "",
|
servicePriceD: "",
|
||||||
|
};
|
||||||
|
this.exchangeRateB = {
|
||||||
modifyServiceA: "",
|
modifyServiceA: "",
|
||||||
modifyElectricityA: "",
|
modifyElectricityA: "",
|
||||||
modifyServiceB: "",
|
modifyServiceB: "",
|
||||||
@@ -582,32 +618,45 @@ export default {
|
|||||||
modifyElectricityC: "",
|
modifyElectricityC: "",
|
||||||
modifyServiceD: "",
|
modifyServiceD: "",
|
||||||
modifyElectricityD: "",
|
modifyElectricityD: "",
|
||||||
};
|
}
|
||||||
this.$refs["exchangeRate"].resetFields();
|
this.$refs["exchangeRateB"].resetFields();
|
||||||
|
this.getDisabled = false;
|
||||||
|
this.stationBillingTemplate = null;
|
||||||
},
|
},
|
||||||
// 站点弹框确认
|
// 站点弹框确认
|
||||||
siteConfirmation() {
|
siteConfirmation() {
|
||||||
this.$refs["exchangeRate"].validate(valid => {
|
this.$refs["exchangeRateB"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
let newOffers = {
|
let newOffers = {
|
||||||
|
billingTemplateId: this.stationBillingTemplate,
|
||||||
groupCode: this.$route.params.groupCode.split('&')[0],
|
groupCode: this.$route.params.groupCode.split('&')[0],
|
||||||
stationId: this.stationId,
|
stationId: this.stationId,
|
||||||
electricityPriceA: this.exchangeRate.modifyServiceA,
|
electricityPriceA: this.exchangeRateB.modifyServiceA,
|
||||||
servicePriceA: this.exchangeRate.modifyElectricityA,
|
servicePriceA: this.exchangeRateB.modifyElectricityA,
|
||||||
electricityPriceB: this.exchangeRate.modifyServiceB,
|
electricityPriceB: this.exchangeRateB.modifyServiceB,
|
||||||
servicePriceB: this.exchangeRate.modifyElectricityB,
|
servicePriceB: this.exchangeRateB.modifyElectricityB,
|
||||||
electricityPriceC: this.exchangeRate.modifyServiceC,
|
electricityPriceC: this.exchangeRateB.modifyServiceC,
|
||||||
servicePriceC: this.exchangeRate.modifyElectricityC,
|
servicePriceC: this.exchangeRateB.modifyElectricityC,
|
||||||
electricityPriceD: this.exchangeRate.modifyServiceD,
|
electricityPriceD: this.exchangeRateB.modifyServiceD,
|
||||||
servicePriceD: this.exchangeRate.modifyElectricityD,
|
servicePriceD: this.exchangeRateB.modifyElectricityD,
|
||||||
timeArray: this.exchangeRate.timeArray
|
timeArray: this.exchangeRate.timeArray
|
||||||
}
|
}
|
||||||
console.log('验证成功', newOffers);
|
console.log('验证成功', newOffers);
|
||||||
|
if (this.stationBillingTemplate) {
|
||||||
|
updateBillingTemplate(newOffers).then((response) => {
|
||||||
|
console.log("接口返回", response);
|
||||||
|
this.$message.success("修改成功");
|
||||||
|
this.getStationList();
|
||||||
|
this.getCancel() //重置
|
||||||
|
});
|
||||||
|
} else {
|
||||||
preferentialTemplates(newOffers).then((response) => {
|
preferentialTemplates(newOffers).then((response) => {
|
||||||
console.log("添加站点优惠模板", response);
|
console.log("添加站点优惠模板", response);
|
||||||
this.$modal.msgSuccess("添加成功");
|
this.$modal.msgSuccess("添加成功");
|
||||||
this.getCancel() //重置
|
this.getCancel() //重置
|
||||||
|
this.getStationList();
|
||||||
});
|
});
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log('验证失败');
|
console.log('验证失败');
|
||||||
}
|
}
|
||||||
@@ -616,16 +665,13 @@ export default {
|
|||||||
// 查计费模板详情
|
// 查计费模板详情
|
||||||
queryInfo(stationId) {
|
queryInfo(stationId) {
|
||||||
console.log(stationId);
|
console.log(stationId);
|
||||||
this.stationId = stationId
|
this.stationId = stationId;
|
||||||
queryStationBillingTemplateList(stationId).then((response) => {
|
queryStationBillingTemplateList(stationId).then((response) => {
|
||||||
console.log("通过站点id查询计费模板 result: ", response.rows, response.rows[0].templateId);
|
console.log("通过站点id查询计费模板 result: ", response.rows, response.rows[0].templateId);
|
||||||
this.stationBillingTemplate = response.rows;
|
|
||||||
getTemplate(response.rows[0].templateId).then((response) => {
|
getTemplate(response.rows[0].templateId).then((response) => {
|
||||||
console.log("查询计费模板详情", response);
|
console.log("查询计费模板详情", response);
|
||||||
this.exchangeRate = response.data;
|
this.exchangeRate = response.data;
|
||||||
this.dynamicTags();
|
this.dynamicTags();
|
||||||
// 重置验证
|
|
||||||
this.$refs["exchangeRate"].resetFields();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -667,7 +713,7 @@ export default {
|
|||||||
this.stationTotal = response.total;
|
this.stationTotal = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user