Browse Source

无房屋选不了

dev
wangyx 1 month ago
parent
commit
121db33bf3
  1. 31
      pagesA/sdPage/dfReport.vue
  2. 43
      pagesA/sdPage/sfReport.vue

31
pagesA/sdPage/dfReport.vue

@ -52,11 +52,7 @@
:value="multiIndex"
:range="multiArray"
>
<view class="uni-input">{{
multiArray[0][multiIndex[0]] +
multiArray[1][multiIndex[1]] +
multiArray[2][multiIndex[2]]
}}</view>
<view class="uni-input">{{pickerDisplay}}</view>
</picker>
</view>
<view v-else @click="handleShowToast" style="color: #cbcbcb"
@ -87,7 +83,6 @@
</view>
<u-input
v-model="item.electricMeterNumber"
type="digit"
placeholder="请输入电表号"
border="none"
:disabled="item.isSystemElectricMeterNumber"
@ -278,6 +273,14 @@ export default {
this.getTree();
// this.initMeterReadingTime();
},
computed: {
pickerDisplay() {
const a = this.multiArray?.[0]?.[this.multiIndex?.[0]] || ''
const b = this.multiArray?.[1]?.[this.multiIndex?.[1]] || ''
const c = (this.multiArray?.[2]?.length > 0) ? (this.multiArray[2][this.multiIndex?.[2]] || '') : ''
return [a, b, c].filter(Boolean).join('')
}
},
methods: {
//
initMeterReadingTime() {
@ -388,10 +391,12 @@ export default {
const houseArray = await this.getListByParentId("4", unitArray[0].id);
//
if (!houseArray || houseArray.length === 0) {
console.warn("未获取到户信息");
return;
}
// if (!houseArray || houseArray.length === 0) {
// console.warn("");
// return;
// }
if(houseArray.length > 0 && houseArray[0]){
this.houseOptions = houseArray;
const houseNames = houseArray.map((item) => item.name);
this.blockForm.houseId = houseArray[0].id;
@ -407,7 +412,11 @@ export default {
// fileList: [],
// });
// }
this.multiArray = [buildingNames, unitNames, houseNames];
this.multiArray = [buildingNames, unitNames, houseNames];
}else {
this.houseOptions = [];
this.multiArray = [buildingNames, unitNames, []];
}
if (this.energyMeterConfig == 1) {
this.getHouseInfoBy(this.blockForm.houseId);
} else if (this.energyMeterConfig == 2) {

43
pagesA/sdPage/sfReport.vue

@ -52,11 +52,7 @@
:value="multiIndex"
:range="multiArray"
>
<view class="uni-input">{{
multiArray[0][multiIndex[0]] +
multiArray[1][multiIndex[1]] +
multiArray[2][multiIndex[2]]
}}</view>
<view class="uni-input">{{pickerDisplay}}</view>
</picker>
</view>
<view v-else @click="handleShowToast" style="color: #cbcbcb"
@ -82,7 +78,6 @@
</view>
<u-input
v-model="item.waterMeterNumber"
type="digit"
placeholder="请输入水表号"
border="none"
:disabled="item.isSystemWaterMeterNumber"
@ -260,6 +255,14 @@ export default {
immediate: true,
},
},
computed: {
pickerDisplay() {
const a = this.multiArray?.[0]?.[this.multiIndex?.[0]] || ''
const b = this.multiArray?.[1]?.[this.multiIndex?.[1]] || ''
const c = (this.multiArray?.[2]?.length > 0) ? (this.multiArray[2][this.multiIndex?.[2]] || '') : ''
return [a, b, c].filter(Boolean).join('')
}
},
onLoad() {
this.getTree();
},
@ -330,13 +333,13 @@ export default {
//
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);
// if (!houseArray || houseArray.length === 0) {
// console.warn("");
// return;
// }
if(houseArray.length > 0 && houseArray[0]){
this.houseOptions = houseArray;
const houseNames = houseArray.map((item) => item.name);
this.blockForm.houseId = houseArray[0].id;
this.waterMeterConfig = houseArray[0].waterMeterConfig;
@ -344,6 +347,13 @@ export default {
let house = houseArray[0];
this.multiArray = [buildingNames, unitNames, houseNames];
}else {
this.houseOptions = [];
this.multiArray = [buildingNames, unitNames, []];
}
console.log(this.multiArray,"this.multiArray11");
if (this.waterMeterConfig == 1) {
this.getHouseInfoBy(this.blockForm.houseId);
} else if (this.waterMeterConfig == 2) {
@ -371,6 +381,8 @@ export default {
}
},
handleShowToast() {
console.log(this.multiArray,"this.multiArray");
uni.showToast({ title: "请选择乐业社区", icon: "none" });
},
async bindMultiPickerColumnChange(e) {
@ -575,11 +587,12 @@ export default {
(m) => String(m.roomId) === String(item.id)
);
if (meter) {
const hasMeterNum = !!(meter.meterNumber && meter.meterNumber.trim() !== '');
return {
...item,
lastMeterReading: meter.thisMeterReading || 0,
waterMeterNumber: meter.meterNumber || "",
isSystemWaterMeterNumber: !!(meter.meterNumber && meter.meterNumber.trim() !== ''),
waterMeterNumber: meter.meterNumber || '',
isSystemWaterMeterNumber: hasMeterNum, //
meterReadingTime: item.meterReadingTime || this.formatDateTime(new Date()), //
};
}

Loading…
Cancel
Save