update 更换站点

This commit is contained in:
2023-10-21 08:50:49 +08:00
parent 6d73005784
commit 7efa7fda8e

View File

@@ -44,8 +44,8 @@
plain plain
icon="el-icon-plus" icon="el-icon-plus"
size="mini" size="mini"
@click="click" @click="handleUpdate"
>批量修改站点 >修改充电桩
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"
@@ -54,7 +54,7 @@
size="mini" size="mini"
@click="handleAdd" @click="handleAdd"
v-hasPermi="['pile:basic:batchAdd']" v-hasPermi="['pile:basic:batchAdd']"
>批量新增 >新增充电桩
</el-button> </el-button>
</el-col> </el-col>
</el-row> </el-row>
@@ -123,9 +123,9 @@
/> />
<!-- 修改充电桩站点 --> <!-- 修改充电桩站点 -->
<!-- <el-dialog <el-dialog
:title="title" :title="title"
:visible.sync="open" :visible.sync="openUpdateDialog"
width="45%" width="45%"
append-to-body append-to-body
:before-close="handleClose" :before-close="handleClose"
@@ -211,46 +211,11 @@
<el-button type="primary" @click="batchUpdate"> </el-button> <el-button type="primary" @click="batchUpdate"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog>--> </el-dialog>
<!-- 添加或修改设备管理对话框 --> <!-- 添加或修改设备管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="50%" append-to-body> <el-dialog :title="title" :visible.sync="openAddDialog" width="50%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px"> <el-form ref="form" :model="form" :rules="rules" label-width="120px">
<!-- <el-row>
<el-col :span="12">
<el-form-item label="运营商" prop="merchantId">
<el-select
v-model="form.merchantId"
placeholder="请选择运营商"
@change="changeSelectMerchant(form.merchantId)"
>
<el-option
v-for="item in merchantList"
:key="item.merchantName"
:label="item.merchantName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="站点" prop="stationId">
<el-select
v-model="form.stationId"
filterable
placeholder="请选择站点"
>
<el-option
v-for="item in stationList"
:key="item.id"
:label="item.stationName"
:value="item.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>-->
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="软件协议" prop="softwareProtocol"> <el-form-item label="软件协议" prop="softwareProtocol">
@@ -408,7 +373,8 @@ export default {
// 选中数组 // 选中数组
ids: [], ids: [],
// 是否显示弹出层 // 是否显示弹出层
open: false, openAddDialog: false,
openUpdateDialog: false,
// 弹出层标题 // 弹出层标题
title: "", title: "",
// 充电站详情 // 充电站详情
@@ -487,7 +453,7 @@ export default {
this.getMerchantList(); this.getMerchantList();
this.queryStationInfo(); this.queryStationInfo();
this.title = "批量添加设备"; this.title = "批量添加设备";
this.open = true; this.openAddDialog = true;
this.getModelList(); this.getModelList();
}, },
/** 提交按钮 */ /** 提交按钮 */
@@ -498,13 +464,13 @@ export default {
if (this.form.id != null) { if (this.form.id != null) {
updateBasic(this.form).then((response) => { updateBasic(this.form).then((response) => {
this.$modal.msgSuccess("修改成功"); this.$modal.msgSuccess("修改成功");
this.open = false; this.openAddDialog = false;
this.getPileList(); this.getPileList();
}); });
} else { } else {
batchAddBasic(this.form).then((response) => { batchAddBasic(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.openAddDialog = false;
this.getPileList(); this.getPileList();
}); });
} }
@@ -559,7 +525,7 @@ export default {
// console.log(this.updateData.pileIdList); // console.log(this.updateData.pileIdList);
}, },
/** 按钮操作 */ /** 按钮操作 */
click() { handleUpdate() {
if (this.updateData.pileIdList.length === 0) { if (this.updateData.pileIdList.length === 0) {
return this.$message({ return this.$message({
message: "请选择充电桩", message: "请选择充电桩",
@@ -569,18 +535,20 @@ export default {
this.getMerchantList(); this.getMerchantList();
this.getModelList(); this.getModelList();
this.reset(); this.reset();
this.open = true; this.openUpdateDialog = true;
this.title = "更换站点"; this.title = "更换站点";
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false; this.openAddDialog = false;
this.openUpdateDialog = false;
this.reset(); this.reset();
this.stationList = []; this.stationList = [];
}, },
// 点击弹框右上角× // 点击弹框右上角×
handleClose() { handleClose() {
this.open = false; this.openAddDialog = false;
this.openUpdateDialog = false;
this.reset(); this.reset();
this.stationList = []; this.stationList = [];
}, },
@@ -612,7 +580,7 @@ export default {
message: "操作成功", message: "操作成功",
type: "success", type: "success",
}); });
this.open = false; this.openUpdateDialog = false;
this.getPileList(); this.getPileList();
this.stationList = []; this.stationList = [];
}) })