wangyx 1 month ago
parent
commit
6573f2ff59
  1. 120
      pagesA/sdPage/dfReport.vue
  2. 125
      pagesA/sdPage/sfReport.vue

120
pagesA/sdPage/dfReport.vue

@ -81,8 +81,9 @@
>
<text>电表号</text>
</view>
<u-input
<u--input
v-model="item.electricMeterNumber"
type="text"
placeholder="请输入电表号"
border="none"
:disabled="item.isSystemElectricMeterNumber"
@ -445,91 +446,66 @@ export default {
uni.showToast({ title: "请选择乐业社区", icon: "none" });
},
async bindMultiPickerColumnChange(e) {
if (!this.multiArray[0].length) return;
this.multiIndex[e.detail.column] = e.detail.value;
switch (e.detail.column) {
case 0:
{
const unitArray = await this.getListByParentId(
"3",
this.buildingOptions[e.detail.value].id
);
//
if (!unitArray || unitArray.length === 0) {
console.warn("未获取到单元信息");
return;
}
this.unitOptions = unitArray;
const unitNames = unitArray.map((item) => item.name);
this.blockForm.unitId = unitArray[0].id;
const houseArray = await this.getListByParentId(
"4",
unitArray[0].id
);
//
if (!houseArray || houseArray.length === 0) {
console.warn("未获取到户信息");
return;
}
if (!this.multiArray[0].length) return
this.houseOptions = houseArray;
const houseNames = houseArray.map((item) => item.name);
this.blockForm.houseId = houseArray[0].id;
this.blockForm.roomId = houseArray[0].roomId;
// 450 splice
this.multiIndex.splice(e.detail.column, 1, e.detail.value)
this.multiArray[1] = unitNames;
this.multiArray[2] = houseNames;
} //1
this.multiIndex.splice(1, 1, 0);
this.multiIndex.splice(2, 1, 0);
break;
case 1:
{
const houseArray = await this.getListByParentId(
"4",
this.unitOptions[e.detail.value].id
);
switch (e.detail.column) {
case 0: {
const unitArray = await this.getListByParentId('3', this.buildingOptions[e.detail.value].id)
if (!unitArray || unitArray.length === 0) return
this.unitOptions = unitArray
const unitNames = unitArray.map(item => item.name)
this.blockForm.unitId = unitArray[0].id
//
if (!houseArray || houseArray.length === 0) {
console.warn("未获取到户信息");
return;
}
const houseArray = await this.getListByParentId('4', unitArray[0].id)
if (!houseArray || houseArray.length === 0) return
this.houseOptions = houseArray
const houseNames = houseArray.map(item => item.name)
this.blockForm.houseId = houseArray[0].id
this.blockForm.roomId = houseArray[0].roomId
this.houseOptions = houseArray;
const houseNames = houseArray.map((item) => item.name);
this.blockForm.houseId = houseArray[0].id;
this.blockForm.roomId = houseArray[0].roomId;
this.multiArray[2] = houseNames;
} //2
this.multiIndex.splice(2, 1, 0);
// 485/486 $set
this.$set(this.multiArray, 1, unitNames)
this.$set(this.multiArray, 2, houseNames)
//
this.multiIndex.splice(1, 1, 0)
this.multiIndex.splice(2, 1, 0)
break
}
case 1: {
const houseArray = await this.getListByParentId('4', this.unitOptions[e.detail.value].id)
if (!houseArray || houseArray.length === 0) return
this.houseOptions = houseArray
const houseNames = houseArray.map(item => item.name)
this.blockForm.houseId = houseArray[0].id
this.blockForm.roomId = houseArray[0].roomId
break;
// 508 $set
this.$set(this.multiArray, 2, houseNames)
//
this.multiIndex.splice(2, 1, 0)
break
}
case 2: {
this.blockForm.houseId = this.houseOptions[e.detail.value].id;
this.blockForm.roomId = this.houseOptions[e.detail.value].roomId;
this.waterMeterConfig =
this.houseOptions[e.detail.value].waterMeterConfig;
this.energyMeterConfig =
this.houseOptions[e.detail.value].energyMeterConfig;
// splice
this.multiIndex.splice(2, 1, e.detail.value)
this.blockForm.houseId = this.houseOptions[e.detail.value].id
this.blockForm.roomId = this.houseOptions[e.detail.value].roomId
this.waterMeterConfig = this.houseOptions[e.detail.value].waterMeterConfig
this.energyMeterConfig = this.houseOptions[e.detail.value].energyMeterConfig
break
}
}
//
if (this.energyMeterConfig && this.blockForm.houseId) {
if (this.energyMeterConfig == 1) {
this.getHouseInfoBy(this.blockForm.houseId);
this.getHouseInfoBy(this.blockForm.houseId)
} else if (this.energyMeterConfig == 2) {
this.getRoomByHouseId(this.blockForm.houseId);
this.getRoomByHouseId(this.blockForm.houseId)
}
}
this.$forceUpdate();
},
onDelete(event, index) {
if (this.form[index] && Array.isArray(this.form[index].fileList)) {

125
pagesA/sdPage/sfReport.vue

@ -76,8 +76,9 @@
>
<text>水表号</text>
</view>
<u-input
<u--input
v-model="item.waterMeterNumber"
type="text"
placeholder="请输入水表号"
border="none"
:disabled="item.isSystemWaterMeterNumber"
@ -386,86 +387,66 @@ export default {
uni.showToast({ title: "请选择乐业社区", icon: "none" });
},
async bindMultiPickerColumnChange(e) {
if (!this.multiArray[0].length) return;
this.multiIndex[e.detail.column] = e.detail.value;
if (!this.multiArray[0].length) return
// splice this.multiIndex[e.detail.column] = e.detail.value
this.multiIndex.splice(e.detail.column, 1, e.detail.value)
switch (e.detail.column) {
case 0:
{
const unitArray = await this.getListByParentId(
"3",
this.buildingOptions[e.detail.value].id
);
//
if (!unitArray || unitArray.length === 0) {
console.warn("未获取到单元信息");
return;
}
this.unitOptions = unitArray;
const unitNames = unitArray.map((item) => item.name);
this.blockForm.unitId = unitArray[0].id;
case 0: {
const unitArray = await this.getListByParentId('3', this.buildingOptions[e.detail.value].id)
if (!unitArray || unitArray.length === 0) return
this.unitOptions = unitArray
const unitNames = unitArray.map(item => item.name)
this.blockForm.unitId = unitArray[0].id
const houseArray = await this.getListByParentId(
"4",
unitArray[0].id
);
//
if (!houseArray || houseArray.length === 0) {
console.warn("未获取到户信息");
return;
}
this.houseOptions = houseArray;
const houseNames = houseArray.map((item) => item.name);
this.blockForm.houseId = houseArray[0].id;
this.blockForm.roomId = houseArray[0].roomId;
this.multiArray[1] = unitNames;
this.multiArray[2] = houseNames;
}
this.multiIndex.splice(1, 1, 0);
this.multiIndex.splice(2, 1, 0);
break;
case 1:
{
const houseArray = await this.getListByParentId(
"4",
this.unitOptions[e.detail.value].id
);
//
if (!houseArray || houseArray.length === 0) {
console.warn("未获取到户信息");
return;
}
this.houseOptions = houseArray;
const houseNames = houseArray.map((item) => item.name);
this.blockForm.houseId = houseArray[0].id;
this.blockForm.roomId = houseArray[0].roomId;
this.multiArray[2] = houseNames;
}
this.multiIndex.splice(2, 1, 0);
break;
const houseArray = await this.getListByParentId('4', unitArray[0].id)
if (!houseArray || houseArray.length === 0) return
this.houseOptions = houseArray
const houseNames = houseArray.map(item => item.name)
this.blockForm.houseId = houseArray[0].id
this.blockForm.roomId = houseArray[0].roomId
//
this.$set(this.multiArray, 1, unitNames)
this.$set(this.multiArray, 2, houseNames)
//
this.multiIndex.splice(1, 1, 0)
this.multiIndex.splice(2, 1, 0)
break
}
case 1: {
const houseArray = await this.getListByParentId('4', this.unitOptions[e.detail.value].id)
if (!houseArray || houseArray.length === 0) return
this.houseOptions = houseArray
const houseNames = houseArray.map(item => item.name)
this.blockForm.houseId = houseArray[0].id
this.blockForm.roomId = houseArray[0].roomId
this.$set(this.multiArray, 2, houseNames)
//
this.multiIndex.splice(2, 1, 0)
break
}
case 2: {
this.blockForm.houseId = this.houseOptions[e.detail.value].id;
this.blockForm.roomId = this.houseOptions[e.detail.value].roomId;
this.waterMeterConfig =
this.houseOptions[e.detail.value].waterMeterConfig;
// splice
this.blockForm.houseId = this.houseOptions[e.detail.value].id
this.blockForm.roomId = this.houseOptions[e.detail.value].roomId
this.waterMeterConfig = this.houseOptions[e.detail.value].waterMeterConfig
break
}
}
//
//
if (this.waterMeterConfig && this.blockForm.houseId) {
if (this.waterMeterConfig == 1) {
this.getHouseInfoBy(this.blockForm.houseId);
this.getHouseInfoBy(this.blockForm.houseId)
} else if (this.waterMeterConfig == 2) {
this.getRoomByHouseId(this.blockForm.houseId);
this.getRoomByHouseId(this.blockForm.houseId)
}
}
this.$forceUpdate();
},
//
oversize(e) {
@ -598,6 +579,8 @@ export default {
}
return item;
});
console.log(this.form,"this.form11");
}
},
//

Loading…
Cancel
Save