Browse Source

水电

fenbao
wangyx 1 month ago
parent
commit
67f124067d
  1. 10
      pages/tabBar/work/index.vue
  2. 71
      pagesA/sdPage/dfReport.vue

10
pages/tabBar/work/index.vue

@ -22,7 +22,7 @@
</view>
</view>
<view class="conItem" style="display: none;">
<view class="conItem" >
<view class="conItem-title">水电</view>
<view class="conItem-cont">
<view class="conItem-cont-item" v-for="(item, index) in sdList" :key="index" @click="handelSdClick(item)">
@ -70,10 +70,10 @@ export default {
{ image: '/static/img/巡查.png', text: '巡检上报' },
{ image: '/static/img/记录.png', text: '巡检记录' },
],
// sdList: [
// { image: '/static/img/.png', text: '' },
// { image: '/static/img/.png', text: '' },
// ],
sdList: [
{ image: '/static/img/水费.png', text: '水量上报' },
{ image: '/static/img/电费.png', text: '电量上报' },
],
// bxList: [
// { image: '/static/img/.png', text: '' },
// { image: '/static/img/.png', text: '' },

71
pagesA/sdPage/dfReport.vue

@ -51,7 +51,7 @@
:value="multiIndex"
:range="multiArray"
>
<view class="uni-input">{{
<view class="uni-input">{{multiIndex[0]?'请选择':
multiArray[0][multiIndex[0]] +
multiArray[1][multiIndex[1]] +
multiArray[2][multiIndex[2]]
@ -115,7 +115,7 @@
:maxSize="10 * 1024 * 1024"
@oversize="oversize"
>
<view class="custom-upload-btn">
<view class="custom-upload-btn" @click.stop="chooseMedia">
<view class="icon-box">
<image
class="camera-icon"
@ -159,7 +159,7 @@ export default {
houseOptions: [],
currentHouse: {},
multiArray: [[], [], []],
multiIndex: [0, 0, 0],
multiIndex: [-1, -1, -1],
form: {
apartmentId: "",
apartmentName: "",
@ -174,17 +174,18 @@ export default {
watch: {
"form.apartmentId": {
handler(newVal, oldVal) {
console.log("newVal", newVal);
this.form.buildingId = null;
this.form.unitId = null;
this.form.houseId = null;
this.buildingOptions = [];
this.unitOptions = [];
this.houseOptions = [];
if (newVal !== oldVal) {
this.form.buildingId = null;
this.form.unitId = null;
this.form.houseId = null;
this.buildingOptions = [];
this.unitOptions = [];
this.houseOptions = [];
}
},
deep: true,
immediate: true,
apartmentList:[]
apartmentList: [],
},
},
onLoad() {
@ -208,9 +209,9 @@ export default {
// const deptInfo = this.deptOptions[0].children.filter(
// (item) => item.deptName == ""
// )[0];
const newArr = this.deptOptions.map(item => ({
const newArr = this.deptOptions.map((item) => ({
name: item.deptName,
}))
}));
// this.deptOptions = newArr
// this.deptOptions = await this.getListByParentId("1", deptInfo.deptId);
// const array = JSON.parse(JSON.stringify(this.deptOptions));
@ -222,8 +223,7 @@ export default {
return new Promise((resolve, reject) => {
queryDeptDropdownList({ type, id }).then((res) => {
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);
const apartmentInfo = this.deptOptions[e.detail.value];
console.log('社区信息',apartmentInfo);
console.log('社区信息11',this.deptOptions);
console.log("社区信息", apartmentInfo);
console.log("社区信息11", this.deptOptions);
this.form.apartmentName = apartmentInfo.deptName;
this.form.apartmentId = apartmentInfo.deptId;
@ -243,7 +243,7 @@ export default {
apartmentInfo.deptId
);
this.buildingOptions = buildingArray;
console.log('楼信息',buildingArray);
console.log("楼信息", buildingArray);
const buildingNames = buildingArray.map((item) => item.name);
console.log("buildingNames:", buildingNames);
@ -369,6 +369,41 @@ export default {
// this.form.waterMeters[index].fileList.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) {
const params = {

Loading…
Cancel
Save