This commit is contained in:
邱贞招 2024-09-14 10:16:36 +08:00
parent c29fd7f110
commit 319328c50b

View File

@ -80,6 +80,17 @@
<el-table-column label="亏电电压(V)" align="center" prop="lowVoltage" />
<el-table-column label="满电续航(km)" align="center" prop="fullEndurance" />
<el-table-column label="骑行低电量提醒(%)" align="center" prop="lowBatteryReminder" />
<!-- 新增低电量提醒开关 -->
<el-table-column label="低电量提醒开关" align="center">
<template slot-scope="scope">
<el-switch
v-model="scope.row.lowBatteryReminderSwitch"
:active-value="true"
:inactive-value="false"
@change="handleLowBatteryReminderSwitchChange(scope.row)"
></el-switch>
</template>
</el-table-column>
<el-table-column label="已投放车辆" align="center" prop="deviceNum" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
@ -275,6 +286,25 @@ export default {
},
},
methods: {
handleLowBatteryReminderSwitchChange(row) {
//
let text = row.lowBatteryReminderSwitch ? "启用低电量提醒" : "关闭低电量提醒";
this.$modal.confirm(`确认要"${text}"吗?`).then(() => {
//
const updateData = {
...row, //
lowBatteryReminderSwitch: row.lowBatteryReminderSwitch //
};
// updateModel
return updateModel(updateData).then(response => {
this.$modal.msgSuccess(`${text}成功`);
this.getList(); //
}).catch(() => {
//
row.lowBatteryReminderSwitch = !row.lowBatteryReminderSwitch;
});
});
},
/** 当选择代理商时 根据代理商id获取运营区和型号 */
fetchData2(deptId,oldVal) {
console.log("deptId1111",deptId)