添加牌位-2

This commit is contained in:
WindowBird 2025-10-17 09:04:21 +08:00
parent 07040fed26
commit fcc8c6c81d

View File

@ -22,9 +22,19 @@
<!-- 显示SN和MAC信息 --> <!-- 显示SN和MAC信息 -->
<view v-if="deviceInfo.sn || deviceInfo.mac" class="device-info"> <view v-if="deviceInfo.sn || deviceInfo.mac" class="device-info">
<view v-if="deviceInfo.name" class="info-item"> <view v-if="deviceInfo.code" class="info-item">
<view class="info-label">设备名称</view> <view class="info-label">牌位编号</view>
<view class="info-value">{{ deviceInfo.name }}</view> <view class="info-value"
>{{ deviceInfo.code }}(牌位已添加编号)
</view>
</view>
<view v-if="deviceInfo.mac" class="info-item">
<view class="info-label">mac</view>
<view class="info-value">{{ deviceInfo.mac }}</view>
</view>
<view v-if="deviceInfo.sn" class="info-item">
<view class="info-label">sn</view>
<view class="info-value">{{ deviceInfo.sn }}</view>
</view> </view>
</view> </view>
</view> </view>
@ -94,16 +104,14 @@ export default {
deviceInfo: { deviceInfo: {
sn: "", sn: "",
mac: "", mac: "",
name: "", code: "",
id: "", id: "",
}, },
// //
formData: { formData: {
code: "", code: "",
name: "", id: "",
regionId: "", regionId: "",
orderNum: "",
remark: "",
}, },
// //
regionList: [], // regionList: [], //
@ -220,7 +228,7 @@ export default {
this.deviceInfo = { this.deviceInfo = {
sn: deviceData.sn || sn, sn: deviceData.sn || sn,
mac: deviceData.mac || "", mac: deviceData.mac || "",
name: deviceData.name || "", code: deviceData.code || "",
id: deviceData.id || "", id: deviceData.id || "",
}; };
@ -300,9 +308,7 @@ export default {
onRegionConfirm(e) { onRegionConfirm(e) {
console.log("区域选择结果:", e); console.log("区域选择结果:", e);
if (e && e.length >= 2) { if (e && e.length >= 2) {
const [floorIndex, areaIndex] = e; const [floor, area] = e;
const floor = this.regionList[floorIndex];
const area = floor.children[areaIndex];
this.selectedRegion = { this.selectedRegion = {
floorId: floor.value, floorId: floor.value,
@ -381,12 +387,7 @@ export default {
const requestData = { const requestData = {
id: this.deviceInfo.id, // 使ID id: this.deviceInfo.id, // 使ID
code: this.formData.code, code: this.formData.code,
name: this.formData.name,
regionId: this.selectedRegion ? this.selectedRegion.areaId : "", regionId: this.selectedRegion ? this.selectedRegion.areaId : "",
orderNum: this.formData.orderNum || "1",
sn: this.deviceInfo.sn,
mac: this.deviceInfo.mac,
remark: this.formData.remark,
}; };
console.log("提交数据:", requestData); console.log("提交数据:", requestData);
@ -439,17 +440,6 @@ export default {
return true; return true;
}, },
// ID
getRegionId(regionName) {
const regionMap = {
A区: "1",
B区: "2",
C区: "3",
D区: "4",
};
return regionMap[regionName] || "1";
},
}, },
}; };
</script> </script>