|
@ -51,7 +51,7 @@ |
|
|
:value="multiIndex" |
|
|
:value="multiIndex" |
|
|
:range="multiArray" |
|
|
:range="multiArray" |
|
|
> |
|
|
> |
|
|
<view class="uni-input">{{ |
|
|
<view class="uni-input">{{multiIndex[0]?'请选择': |
|
|
multiArray[0][multiIndex[0]] + |
|
|
multiArray[0][multiIndex[0]] + |
|
|
multiArray[1][multiIndex[1]] + |
|
|
multiArray[1][multiIndex[1]] + |
|
|
multiArray[2][multiIndex[2]] |
|
|
multiArray[2][multiIndex[2]] |
|
@ -115,7 +115,7 @@ |
|
|
:maxSize="10 * 1024 * 1024" |
|
|
:maxSize="10 * 1024 * 1024" |
|
|
@oversize="oversize" |
|
|
@oversize="oversize" |
|
|
> |
|
|
> |
|
|
<view class="custom-upload-btn"> |
|
|
<view class="custom-upload-btn" @click.stop="chooseMedia"> |
|
|
<view class="icon-box"> |
|
|
<view class="icon-box"> |
|
|
<image |
|
|
<image |
|
|
class="camera-icon" |
|
|
class="camera-icon" |
|
@ -159,7 +159,7 @@ export default { |
|
|
houseOptions: [], |
|
|
houseOptions: [], |
|
|
currentHouse: {}, |
|
|
currentHouse: {}, |
|
|
multiArray: [[], [], []], |
|
|
multiArray: [[], [], []], |
|
|
multiIndex: [0, 0, 0], |
|
|
multiIndex: [-1, -1, -1], |
|
|
form: { |
|
|
form: { |
|
|
apartmentId: "", |
|
|
apartmentId: "", |
|
|
apartmentName: "", |
|
|
apartmentName: "", |
|
@ -174,17 +174,18 @@ export default { |
|
|
watch: { |
|
|
watch: { |
|
|
"form.apartmentId": { |
|
|
"form.apartmentId": { |
|
|
handler(newVal, oldVal) { |
|
|
handler(newVal, oldVal) { |
|
|
console.log("newVal", newVal); |
|
|
if (newVal !== oldVal) { |
|
|
this.form.buildingId = null; |
|
|
this.form.buildingId = null; |
|
|
this.form.unitId = null; |
|
|
this.form.unitId = null; |
|
|
this.form.houseId = null; |
|
|
this.form.houseId = null; |
|
|
this.buildingOptions = []; |
|
|
this.buildingOptions = []; |
|
|
this.unitOptions = []; |
|
|
this.unitOptions = []; |
|
|
this.houseOptions = []; |
|
|
this.houseOptions = []; |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
deep: true, |
|
|
deep: true, |
|
|
immediate: true, |
|
|
immediate: true, |
|
|
apartmentList:[] |
|
|
apartmentList: [], |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
onLoad() { |
|
|
onLoad() { |
|
@ -208,9 +209,9 @@ export default { |
|
|
// const deptInfo = this.deptOptions[0].children.filter( |
|
|
// const deptInfo = this.deptOptions[0].children.filter( |
|
|
// (item) => item.deptName == "城阳区" |
|
|
// (item) => item.deptName == "城阳区" |
|
|
// )[0]; |
|
|
// )[0]; |
|
|
const newArr = this.deptOptions.map(item => ({ |
|
|
const newArr = this.deptOptions.map((item) => ({ |
|
|
name: item.deptName, |
|
|
name: item.deptName, |
|
|
})) |
|
|
})); |
|
|
// this.deptOptions = newArr |
|
|
// this.deptOptions = newArr |
|
|
// this.deptOptions = await this.getListByParentId("1", deptInfo.deptId); |
|
|
// this.deptOptions = await this.getListByParentId("1", deptInfo.deptId); |
|
|
// const array = JSON.parse(JSON.stringify(this.deptOptions)); |
|
|
// const array = JSON.parse(JSON.stringify(this.deptOptions)); |
|
@ -222,8 +223,7 @@ export default { |
|
|
return new Promise((resolve, reject) => { |
|
|
return new Promise((resolve, reject) => { |
|
|
queryDeptDropdownList({ type, id }).then((res) => { |
|
|
queryDeptDropdownList({ type, id }).then((res) => { |
|
|
resolve(res.data); |
|
|
resolve(res.data); |
|
|
console.log(res.data,'res.data'); |
|
|
console.log(res.data, "res.data"); |
|
|
|
|
|
|
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
@ -232,8 +232,8 @@ export default { |
|
|
console.log("e", e); |
|
|
console.log("e", e); |
|
|
|
|
|
|
|
|
const apartmentInfo = this.deptOptions[e.detail.value]; |
|
|
const apartmentInfo = this.deptOptions[e.detail.value]; |
|
|
console.log('社区信息',apartmentInfo); |
|
|
console.log("社区信息", apartmentInfo); |
|
|
console.log('社区信息11',this.deptOptions); |
|
|
console.log("社区信息11", this.deptOptions); |
|
|
|
|
|
|
|
|
this.form.apartmentName = apartmentInfo.deptName; |
|
|
this.form.apartmentName = apartmentInfo.deptName; |
|
|
this.form.apartmentId = apartmentInfo.deptId; |
|
|
this.form.apartmentId = apartmentInfo.deptId; |
|
@ -243,7 +243,7 @@ export default { |
|
|
apartmentInfo.deptId |
|
|
apartmentInfo.deptId |
|
|
); |
|
|
); |
|
|
this.buildingOptions = buildingArray; |
|
|
this.buildingOptions = buildingArray; |
|
|
console.log('楼信息',buildingArray); |
|
|
console.log("楼信息", buildingArray); |
|
|
const buildingNames = buildingArray.map((item) => item.name); |
|
|
const buildingNames = buildingArray.map((item) => item.name); |
|
|
console.log("buildingNames:", buildingNames); |
|
|
console.log("buildingNames:", buildingNames); |
|
|
|
|
|
|
|
@ -369,6 +369,41 @@ export default { |
|
|
// this.form.waterMeters[index].fileList.splice(event.index, 1); |
|
|
// this.form.waterMeters[index].fileList.splice(event.index, 1); |
|
|
// this.form.waterMeters[index].imageList.splice(event.index, 1); |
|
|
// this.form.waterMeters[index].imageList.splice(event.index, 1); |
|
|
}, |
|
|
}, |
|
|
|
|
|
chooseMedia() { |
|
|
|
|
|
uni.chooseMedia({ |
|
|
|
|
|
count: 10 - this.fileList.length, |
|
|
|
|
|
mediaType: ["image", "video"], |
|
|
|
|
|
sourceType: ["album", "camera"], |
|
|
|
|
|
maxDuration: 60, |
|
|
|
|
|
camera: "back", |
|
|
|
|
|
success: async (res) => { |
|
|
|
|
|
uni.showLoading({ title: "上传中...", mask: true }); |
|
|
|
|
|
try { |
|
|
|
|
|
const files = res.tempFiles; |
|
|
|
|
|
for (let i = 0; i < files.length; i++) { |
|
|
|
|
|
const file = files[i]; |
|
|
|
|
|
const filePath = file.tempFilePath; |
|
|
|
|
|
const type = file.fileType || (filePath.match(/\.(mp4|mov|avi|wmv|flv|mkv)$/i) ? "video" : "image"); |
|
|
|
|
|
// 上传 |
|
|
|
|
|
const uploadRes = await uploadImage(filePath); |
|
|
|
|
|
this.fileList.push({ |
|
|
|
|
|
url: uploadRes.data?.url || uploadRes.url || uploadRes.path, |
|
|
|
|
|
name: uploadRes.data?.name || uploadRes.name || "", |
|
|
|
|
|
type: type, |
|
|
|
|
|
status: "success", |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (e) { |
|
|
|
|
|
uni.showToast({ title: "上传失败", icon: "none" }); |
|
|
|
|
|
} finally { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
fail: () => { |
|
|
|
|
|
uni.hideLoading(); |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
// 获取上次抄表 |
|
|
// 获取上次抄表 |
|
|
async getLastMeter(item) { |
|
|
async getLastMeter(item) { |
|
|
const params = { |
|
|
const params = { |
|
|