集团添加优惠站点

This commit is contained in:
BOOL\25024
2024-01-31 15:53:39 +08:00
parent 61c117bff6
commit ad2ecbe20b
3 changed files with 74 additions and 4 deletions

View File

@@ -60,4 +60,12 @@ export function queryMemberList(data) {
data: data
})
}
// 创建优惠计费模板
export function preferentialTemplates(data) {
console.log("创建优惠计费模板", JSON.stringify(data));
return request({
method: "post",
url: "/billing/template/createPreferentialBillingTemplate",
data,
});
}

View File

@@ -241,6 +241,14 @@
</el-form-item>
</el-col>
</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>
<div slot="footer" class="dialog-footer">
<el-button @click="getCancel"> </el-button>
@@ -251,7 +259,7 @@
</template>
<script>
import { addMember, queryMemberList } from "@/api/member/memberGroup";
import { addMember, queryMemberList, preferentialTemplates } from "@/api/member/memberGroup";
import { listOrder } from "@/api/order/order";
import { getStationListByMerchantId } from "@/api/pile/station";
import { queryStationBillingTemplateList, getTemplate } from "@/api/billing/template.js";
@@ -397,6 +405,8 @@ export default {
],
},
sitesList: [],//站点列表
stationId: '',//站点id
tagsTime: []
};
},
@@ -405,7 +415,9 @@ export default {
this.getMemberList();
this.getOrderList();
},
computed: {
},
methods: {
handleAddMember() {
this.openAddMember = true
@@ -465,6 +477,7 @@ export default {
getCancel() {
this.getSite = false;
this.selectSite = '';
this.tagsTime = [];
this.exchangeRate = {
electricityPriceA: "",
servicePriceA: "",
@@ -489,7 +502,24 @@ export default {
siteConfirmation() {
this.$refs["exchangeRate"].validate(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 {
console.log('验证失败');
}
@@ -498,17 +528,48 @@ export default {
// 查计费模板详情
queryInfo(stationId) {
console.log(stationId);
this.stationId = stationId
queryStationBillingTemplateList(stationId).then((response) => {
console.log("通过站点id查询计费模板 result: ", response.rows, response.rows[0].templateId);
this.stationBillingTemplate = response.rows;
getTemplate(response.rows[0].templateId).then((response) => {
console.log("查询计费模板详情", response);
this.exchangeRate = response.data;
this.dynamicTags();
// 重置验证
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>

View File

@@ -35,9 +35,10 @@ module.exports = {
proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
target: `http://localhost:8080`,
// target: `http://localhost:8080`,
// 更改代理为本地地址
// target: `http://192.168.2.6:8080`,
target: `https://api.jsowellcloud.com`,
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",