update 修改批量建桩按钮

This commit is contained in:
2023-10-10 16:48:45 +08:00
parent f6e5d90702
commit fbf2f03058

View File

@@ -360,7 +360,7 @@
<script> <script>
import {batchAddBasic, batchUpdatePileList, listBasic, updateBasic} from "@/api/pile/basic"; import {batchAddBasic, batchUpdatePileList, listBasic, updateBasic} from "@/api/pile/basic";
import {getMerchantList} from "@/api/pile/merchant"; import {getMerchantList} from "@/api/pile/merchant";
import {getStationListByMerchantId} from "@/api/pile/station"; import {getStationInfo, getStationListByMerchantId} from "@/api/pile/station";
import {listModel} from "@/api/pile/model"; import {listModel} from "@/api/pile/model";
export default { export default {
@@ -410,6 +410,8 @@ export default {
open: false, open: false,
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 充电站详情
stationDetail: {},
// 运营商列表 // 运营商列表
merchantList: [], merchantList: [],
// 站点列表 // 站点列表
@@ -482,6 +484,7 @@ export default {
handleAdd() { handleAdd() {
this.reset(); this.reset();
this.getMerchantList(); this.getMerchantList();
this.queryStationInfo();
this.title = "批量添加设备"; this.title = "批量添加设备";
this.open = true; this.open = true;
this.getModelList(); this.getModelList();
@@ -495,13 +498,13 @@ export default {
updateBasic(this.form).then((response) => { updateBasic(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.open = false;
this.getList(); this.getPileList();
}); });
} else { } else {
batchAddBasic(this.form).then((response) => { batchAddBasic(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
this.getList(); this.getPileList();
}); });
} }
} }
@@ -531,6 +534,15 @@ export default {
this.merchantList = response.rows; this.merchantList = response.rows;
}); });
}, },
// 查询站点信息
queryStationInfo() {
getStationInfo(this.stationId).then((res) => {
console.log("查询站点信息:", res);
this.stationDetail = res.data;
this.form.merchantId = this.stationDetail.merchantId;
this.form.stationId = this.stationDetail.id;
});
},
changeSelectMerchant(value) { changeSelectMerchant(value) {
console.log(value); console.log(value);
// 通过接口查 // 通过接口查