添加牌位-2
This commit is contained in:
parent
07040fed26
commit
fcc8c6c81d
|
|
@ -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>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user