|
|
|
|
@ -10,7 +10,7 @@
|
|
|
|
|
<!-- />-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="设备名称" prop="deviceCode">
|
|
|
|
|
<el-select v-model="form.deviceCode" placeholder="请选择设备名称" clearable>
|
|
|
|
|
<el-select v-model="queryParams.deviceCode" placeholder="请选择设备名称" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="item in deviceLedgerList"
|
|
|
|
|
:key="item.deviceCode"
|
|
|
|
|
@ -280,8 +280,26 @@ export default {
|
|
|
|
|
getDeviceLedgerList().then(response => {
|
|
|
|
|
this.deviceLedgerList = response.data
|
|
|
|
|
})
|
|
|
|
|
// 从路由参数获取设备编号
|
|
|
|
|
const deviceCode = this.$route.query.deviceCode;
|
|
|
|
|
if (deviceCode) {
|
|
|
|
|
this.queryParams.deviceCode = deviceCode;
|
|
|
|
|
}
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
// 监听路由变化,重新获取参数并查询
|
|
|
|
|
'$route.query.deviceCode': {
|
|
|
|
|
handler(newVal, oldVal) {
|
|
|
|
|
// 只在值真正变化且新值存在时才查询(避免重置时重复查询)
|
|
|
|
|
if (newVal && newVal !== this.queryParams.deviceCode) {
|
|
|
|
|
this.queryParams.deviceCode = newVal;
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
this.getList();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
/** 查询设备参数列表 */
|
|
|
|
|
getList() {
|
|
|
|
|
@ -324,6 +342,11 @@ export default {
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
|
resetQuery() {
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.queryParams.deviceCode = null;
|
|
|
|
|
// 清除路由中的 deviceCode 参数
|
|
|
|
|
if (this.$route.query.deviceCode) {
|
|
|
|
|
this.$router.replace({ path: this.$route.path });
|
|
|
|
|
}
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
|