mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-10 04:50:11 +08:00
集团添加优惠站点
This commit is contained in:
@@ -60,4 +60,12 @@ export function queryMemberList(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 创建优惠计费模板
|
||||||
|
export function preferentialTemplates(data) {
|
||||||
|
console.log("创建优惠计费模板", JSON.stringify(data));
|
||||||
|
return request({
|
||||||
|
method: "post",
|
||||||
|
url: "/billing/template/createPreferentialBillingTemplate",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -241,6 +241,14 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<span>24小时尖峰平谷分布设置</span>
|
||||||
|
<div>
|
||||||
|
<el-tag v-for="item in tagsTime" :key="item.label" :type="item.type"
|
||||||
|
style="margin: 10px 10px 10px 0; width: 160px; height: 30px line-height:30px;text-align: center;"
|
||||||
|
effect="dark">
|
||||||
|
{{ item.label }}
|
||||||
|
</el-tag>
|
||||||
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="getCancel">取 消</el-button>
|
<el-button @click="getCancel">取 消</el-button>
|
||||||
@@ -251,7 +259,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { addMember, queryMemberList } from "@/api/member/memberGroup";
|
import { addMember, queryMemberList, preferentialTemplates } 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 } from "@/api/billing/template.js";
|
||||||
@@ -397,6 +405,8 @@ export default {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
sitesList: [],//站点列表
|
sitesList: [],//站点列表
|
||||||
|
stationId: '',//站点id
|
||||||
|
tagsTime: []
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -405,7 +415,9 @@ export default {
|
|||||||
this.getMemberList();
|
this.getMemberList();
|
||||||
this.getOrderList();
|
this.getOrderList();
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleAddMember() {
|
handleAddMember() {
|
||||||
this.openAddMember = true
|
this.openAddMember = true
|
||||||
@@ -465,6 +477,7 @@ export default {
|
|||||||
getCancel() {
|
getCancel() {
|
||||||
this.getSite = false;
|
this.getSite = false;
|
||||||
this.selectSite = '';
|
this.selectSite = '';
|
||||||
|
this.tagsTime = [];
|
||||||
this.exchangeRate = {
|
this.exchangeRate = {
|
||||||
electricityPriceA: "",
|
electricityPriceA: "",
|
||||||
servicePriceA: "",
|
servicePriceA: "",
|
||||||
@@ -489,7 +502,24 @@ export default {
|
|||||||
siteConfirmation() {
|
siteConfirmation() {
|
||||||
this.$refs["exchangeRate"].validate(valid => {
|
this.$refs["exchangeRate"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
console.log('验证成功');
|
let newOffers = {
|
||||||
|
stationId: this.stationId,
|
||||||
|
electricityPriceA: this.exchangeRate.modifyServiceA,
|
||||||
|
servicePriceA: this.exchangeRate.modifyElectricityA,
|
||||||
|
electricityPriceB: this.exchangeRate.modifyServiceB,
|
||||||
|
servicePriceB: this.exchangeRate.modifyElectricityB,
|
||||||
|
electricityPriceC: this.exchangeRate.modifyServiceC,
|
||||||
|
servicePriceC: this.exchangeRate.modifyElectricityC,
|
||||||
|
electricityPriceD: this.exchangeRate.modifyServiceD,
|
||||||
|
servicePriceD: this.exchangeRate.modifyElectricityD,
|
||||||
|
timeArray: this.exchangeRate.timeArray
|
||||||
|
}
|
||||||
|
console.log('验证成功', newOffers);
|
||||||
|
preferentialTemplates(newOffers).then((response) => {
|
||||||
|
console.log("添加站点优惠模板", response);
|
||||||
|
this.$modal.msgSuccess("添加成功");
|
||||||
|
this.getCancel() //重置
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('验证失败');
|
console.log('验证失败');
|
||||||
}
|
}
|
||||||
@@ -498,17 +528,48 @@ export default {
|
|||||||
// 查计费模板详情
|
// 查计费模板详情
|
||||||
queryInfo(stationId) {
|
queryInfo(stationId) {
|
||||||
console.log(stationId);
|
console.log(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;
|
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.$refs["exchangeRate"].resetFields();
|
this.$refs["exchangeRate"].resetFields();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
dynamicTags() {
|
||||||
|
let tags = [];
|
||||||
|
this.exchangeRate.timeArray.map((x) => {
|
||||||
|
// console.log(x.type);
|
||||||
|
let type;
|
||||||
|
let desc;
|
||||||
|
if (x.type === "1") {
|
||||||
|
type = "danger";
|
||||||
|
desc = "尖";
|
||||||
|
} else if (x.type === "2") {
|
||||||
|
type = "warning";
|
||||||
|
desc = "峰";
|
||||||
|
} else if (x.type === "3") {
|
||||||
|
type = "success";
|
||||||
|
desc = "平";
|
||||||
|
} else {
|
||||||
|
type = "info";
|
||||||
|
desc = "谷";
|
||||||
|
}
|
||||||
|
let label = desc + " - " + x.startTime + " - " + x.endTime;
|
||||||
|
let tag = {
|
||||||
|
type: type,
|
||||||
|
label: label,
|
||||||
|
};
|
||||||
|
tags.push(tag);
|
||||||
|
});
|
||||||
|
this.tagsTime = tags
|
||||||
|
console.log(this.tagsTime);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -35,9 +35,10 @@ module.exports = {
|
|||||||
proxy: {
|
proxy: {
|
||||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||||
[process.env.VUE_APP_BASE_API]: {
|
[process.env.VUE_APP_BASE_API]: {
|
||||||
target: `http://localhost:8080`,
|
// target: `http://localhost:8080`,
|
||||||
// 更改代理为本地地址
|
// 更改代理为本地地址
|
||||||
// target: `http://192.168.2.6:8080`,
|
// target: `http://192.168.2.6:8080`,
|
||||||
|
target: `https://api.jsowellcloud.com`,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: {
|
pathRewrite: {
|
||||||
["^" + process.env.VUE_APP_BASE_API]: "",
|
["^" + process.env.VUE_APP_BASE_API]: "",
|
||||||
|
|||||||
Reference in New Issue
Block a user