添加牌位-2
This commit is contained in:
parent
07040fed26
commit
fcc8c6c81d
|
|
@ -22,9 +22,19 @@
|
|||
|
||||
<!-- 显示SN和MAC信息 -->
|
||||
<view v-if="deviceInfo.sn || deviceInfo.mac" class="device-info">
|
||||
<view v-if="deviceInfo.name" class="info-item">
|
||||
<view class="info-label">设备名称:</view>
|
||||
<view class="info-value">{{ deviceInfo.name }}</view>
|
||||
<view v-if="deviceInfo.code" class="info-item">
|
||||
<view class="info-label">牌位编号:</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>
|
||||
|
|
@ -94,16 +104,14 @@ export default {
|
|||
deviceInfo: {
|
||||
sn: "",
|
||||
mac: "",
|
||||
name: "",
|
||||
code: "",
|
||||
id: "",
|
||||
},
|
||||
// 表单数据
|
||||
formData: {
|
||||
code: "",
|
||||
name: "",
|
||||
id: "",
|
||||
regionId: "",
|
||||
orderNum: "",
|
||||
remark: "",
|
||||
},
|
||||
// 区域相关数据
|
||||
regionList: [], // 区域树形数据
|
||||
|
|
@ -220,7 +228,7 @@ export default {
|
|||
this.deviceInfo = {
|
||||
sn: deviceData.sn || sn,
|
||||
mac: deviceData.mac || "",
|
||||
name: deviceData.name || "",
|
||||
code: deviceData.code || "",
|
||||
id: deviceData.id || "",
|
||||
};
|
||||
|
||||
|
|
@ -300,9 +308,7 @@ export default {
|
|||
onRegionConfirm(e) {
|
||||
console.log("区域选择结果:", e);
|
||||
if (e && e.length >= 2) {
|
||||
const [floorIndex, areaIndex] = e;
|
||||
const floor = this.regionList[floorIndex];
|
||||
const area = floor.children[areaIndex];
|
||||
const [floor, area] = e;
|
||||
|
||||
this.selectedRegion = {
|
||||
floorId: floor.value,
|
||||
|
|
@ -381,12 +387,7 @@ export default {
|
|||
const requestData = {
|
||||
id: this.deviceInfo.id, // 使用设备ID
|
||||
code: this.formData.code,
|
||||
name: this.formData.name,
|
||||
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);
|
||||
|
|
@ -439,17 +440,6 @@ export default {
|
|||
|
||||
return true;
|
||||
},
|
||||
|
||||
// 获取区域ID(根据实际业务逻辑调整)
|
||||
getRegionId(regionName) {
|
||||
const regionMap = {
|
||||
A区: "1",
|
||||
B区: "2",
|
||||
C区: "3",
|
||||
D区: "4",
|
||||
};
|
||||
return regionMap[regionName] || "1";
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user