Commit bcd98cac authored by lei's avatar lei

fix:排水系统弹窗控制修复

parent ea56db5b
...@@ -33,14 +33,14 @@ ...@@ -33,14 +33,14 @@
<div <div
class="button on" class="button on"
:class="item.status == 1 ? 'active' : ''" :class="item.status == 1 ? 'active' : ''"
@click="openWaterPump(item)" @click="openWaterPump(item, 1)"
> >
开启 开启
</div> </div>
<div <div
class="button off" class="button off"
:class="item.status == 0 ? 'active' : ''" :class="item.status == 0 ? 'active' : ''"
@click="closeWaterPump(item)" @click="closeWaterPump(item, 0)"
> >
关闭 关闭
</div> </div>
...@@ -94,8 +94,8 @@ ...@@ -94,8 +94,8 @@
<el-input placeholder="" v-model="password" show-password></el-input> <el-input placeholder="" v-model="password" show-password></el-input>
</div> </div>
<div> <div>
<div class="button close" @click="submitPumpPassword(0)">关闭</div> <div class="button close" @click="upWindowShow = false">取消</div>
<div class="button" @click="submitPumpPassword(1)">开启</div> <div class="button" @click="submitPumpPassword()">确认</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -120,6 +120,7 @@ export default { ...@@ -120,6 +120,7 @@ export default {
], ],
sumpData: [], sumpData: [],
pumpList: [], pumpList: [],
pumpStatus: 0, //水泵状态
}; };
}, },
created() { created() {
...@@ -139,34 +140,39 @@ export default { ...@@ -139,34 +140,39 @@ export default {
}); });
}, },
// 水泵开启按钮 // 水泵开启按钮
openWaterPump(item) { openWaterPump(item, status) {
this.upWindowShow = true; this.upWindowShow = true;
// this.submitPumpPassword(pumpId, this.password, 0); // this.submitPumpPassword(pumpId, this.password, 0);
this.pumpId = item.pumpId; this.pumpId = item.pumpId;
this.pumpStatus = status;
}, },
// 水泵关闭按钮 // 水泵关闭按钮
closeWaterPump(item) { closeWaterPump(item, status) {
this.upWindowShow = true; this.upWindowShow = true;
this.pumpId = item.pumpId; this.pumpId = item.pumpId;
this.pumpStatus = status;
this.password = ""; this.password = "";
}, },
//提交水泵密码 //提交水泵密码
submitPumpPassword(status) { submitPumpPassword() {
let pumpId = this.pumpId; let pumpId = this.pumpId;
let password = this.password; let password = this.password;
if (!password) { if (!password) {
return this.$modal.msgError("请输入密码"); return this.$modal.msgError("请输入密码");
} }
updatePumpSwitch({ pumpId, password, status }).then((res) => { updatePumpSwitch({ pumpId, password, status: this.pumpStatus }).then(
if (res.code === 200) { (res) => {
this.upWindowShow = false; if (res.code === 200) {
this.password = ""; this.upWindowShow = false;
this.$modal.msgSuccess(res.msg); this.password = "";
this.initPumpList(); this.$modal.msgSuccess(res.msg);
} else { this.initPumpList();
this.$modal.msgError(res.msg); } else {
this.$modal.msgError(res.msg);
}
} }
}); );
}, },
}, },
filters: { filters: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment