修改家庭组号
This commit is contained in:
parent
73804519e4
commit
ed421f94fc
@ -11,6 +11,7 @@ export interface DeviceuserVO {
|
|||||||
updateby: string // 更新人
|
updateby: string // 更新人
|
||||||
username: string // 用户姓名
|
username: string // 用户姓名
|
||||||
devicetype: string // 设备类型
|
devicetype: string // 设备类型
|
||||||
|
familyid: string // 家庭组号
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设备人员关联 API
|
// 设备人员关联 API
|
||||||
|
@ -55,13 +55,14 @@
|
|||||||
<el-table
|
<el-table
|
||||||
v-loading="boundLoading"
|
v-loading="boundLoading"
|
||||||
:data="boundList"
|
:data="boundList"
|
||||||
style="height: 100%"
|
style="height: 400px"
|
||||||
|
max-height="400px"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="设备名称"
|
label="设备名称"
|
||||||
align="center"
|
align="center"
|
||||||
prop="devicename"
|
prop="devicename"
|
||||||
width="100"
|
width="110"
|
||||||
/>
|
/>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="设备编号"
|
label="设备编号"
|
||||||
@ -148,7 +149,8 @@
|
|||||||
<el-table
|
<el-table
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="list"
|
:data="list"
|
||||||
style="height: 100%"
|
style="height: 400px"
|
||||||
|
max-height="400px"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="设备名称"
|
label="设备名称"
|
||||||
@ -229,6 +231,7 @@ const list = ref<DeviceVO[]>([])
|
|||||||
const boundList = ref<DeviceVO[]>([])
|
const boundList = ref<DeviceVO[]>([])
|
||||||
const personId = ref<number>()
|
const personId = ref<number>()
|
||||||
const personName = ref<string>()
|
const personName = ref<string>()
|
||||||
|
const familyId = ref<string>()
|
||||||
|
|
||||||
const queryParams = reactive({
|
const queryParams = reactive({
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
@ -278,7 +281,8 @@ const getBoundList = async () => {
|
|||||||
const deviceInfo = await DeviceApi.getDeviceId(item.deviceid)
|
const deviceInfo = await DeviceApi.getDeviceId(item.deviceid)
|
||||||
return {
|
return {
|
||||||
...deviceInfo,
|
...deviceInfo,
|
||||||
devicecode: item.deviceid // 确保devicecode字段存在
|
devicecode: item.deviceid, // 确保devicecode字段存在
|
||||||
|
familyid: item.familyid // 添加familyid字段
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
boundList.value = await Promise.all(devicePromises)
|
boundList.value = await Promise.all(devicePromises)
|
||||||
@ -345,7 +349,7 @@ const handleBind = async (row: DeviceVO) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 检查是否已经绑定
|
// 检查是否已经绑定
|
||||||
const bindData = await DeviceuserApi.getDeviceuserByDeviceId(row.id)
|
const bindData = await DeviceuserApi.getDeviceuserByDeviceId(row.devicecode)
|
||||||
if (bindData && bindData.some((item: DeviceuserVO) => item.userid === personId.value)) {
|
if (bindData && bindData.some((item: DeviceuserVO) => item.userid === personId.value)) {
|
||||||
message.error('该设备已经绑定过此用户')
|
message.error('该设备已经绑定过此用户')
|
||||||
return
|
return
|
||||||
@ -358,6 +362,7 @@ const handleBind = async (row: DeviceVO) => {
|
|||||||
devicetype: row.devicetype,
|
devicetype: row.devicetype,
|
||||||
userid: personId.value,
|
userid: personId.value,
|
||||||
username: personName.value || '',
|
username: personName.value || '',
|
||||||
|
familyid: familyId.value || '',
|
||||||
createtime: datetime,
|
createtime: datetime,
|
||||||
updatetime: datetime,
|
updatetime: datetime,
|
||||||
createby: userProfile.value.nickname,
|
createby: userProfile.value.nickname,
|
||||||
@ -398,9 +403,10 @@ const handleUnbind = async (row: DeviceVO) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = (id: number, name: string) => {
|
const open = (id: number, name: string, familyid: string) => {
|
||||||
personId.value = id
|
personId.value = id
|
||||||
personName.value = name
|
personName.value = name
|
||||||
|
familyId.value = familyid
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
getList()
|
getList()
|
||||||
getBoundList()
|
getBoundList()
|
||||||
|
@ -224,7 +224,8 @@ const memberRef = ref()
|
|||||||
const deviceBindRef = ref()
|
const deviceBindRef = ref()
|
||||||
const openForm = (type: string, id?: number, name?: string) => {
|
const openForm = (type: string, id?: number, name?: string) => {
|
||||||
if (type === 'bind') {
|
if (type === 'bind') {
|
||||||
deviceBindRef.value?.open(id, name)
|
const row = list.value.find(item => item.id === id)
|
||||||
|
deviceBindRef.value?.open(id, name, row?.familyid)
|
||||||
} else {
|
} else {
|
||||||
formRef.value?.open(type, id,userProfile.value)
|
formRef.value?.open(type, id,userProfile.value)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user