Browse Source

数据回显

master
wangyx 4 weeks ago
parent
commit
01e068538e
  1. 10
      pages/api.js
  2. 62
      pagesA/checkout/detail/detail.vue
  3. 6
      pagesA/checkout/list/list.vue
  4. 5
      pagesA/release/detail/detail.vue

10
pages/api.js

@ -89,6 +89,14 @@ export function tempSaveCheckOut(data) {
data: data, data: data,
}); });
} }
// 退房-房间检查回显
export function loadCheckOutDetail(query) {
return request({
url: `/apartment/manager/loadCheckOutDetail?idCard=${query.idCard}`,
method: "get",
});
}
export function getResidentInfo(query) { export function getResidentInfo(query) {
return request({ return request({
url: "/apartment/manager/resideInfoByIdCard", url: "/apartment/manager/resideInfoByIdCard",
@ -200,4 +208,4 @@ export function handleRepair(data) {
method: "post", method: "post",
data: data, data: data,
}); });
} }

62
pagesA/checkout/detail/detail.vue

@ -125,13 +125,17 @@
</text> </text>
</checkbox-group> --> </checkbox-group> -->
<checkbox-group @change="checkboxChange"> <checkbox-group @change="checkboxChange">
<label> <label>
<checkbox value="isChecked" :checked="isChecked" style="transform:scale(0.7)" />确认以上信息无误生成房屋交割单由毕业生在微信小程序端签字确认 <checkbox
</label> value="isChecked"
</checkbox-group> :checked="isChecked"
style="transform: scale(0.7)"
/>
</label>
</checkbox-group>
</view> </view>
<view class="btn" @click="onSubmit">提交</view> <view class="btn" @click="onSubmit">提交</view>
<!-- <view class="submit-btn-wrap"> <!-- <view class="submit-btn-wrap">
<u-button <u-button
type="primary" type="primary"
@ -150,7 +154,8 @@ import {
submitCheckout, submitCheckout,
uploadImage, uploadImage,
tempSaveCheckOut, tempSaveCheckOut,
} from "../../../pages/api"; loadCheckOutDetail,
} from "@/pages/api";
export default { export default {
data() { data() {
@ -185,14 +190,28 @@ export default {
}, },
onLoad(options) { onLoad(options) {
console.log("options", options); console.log("options", options);
const detail = uni.getStorageSync("checkoutDetail"); const detail = uni.getStorageSync("checkoutDetail");
this.info = detail; this.info = detail;
loadCheckOutDetail({ idCard: options.idCard }).then((res) => {
this.deviceList = res.data.facilitiesCheckResults.map((v) => ({
name: v.facilityName,
id: v.facilityId,
facilityStatus: v.checkResult,
}));
console.log("dev", this.deviceList);
this.checkStatus = this.deviceList.map((v) =>
v.facilityStatus.toString()
);
this.waterMeterValue = res.data.waterMeterValue;
this.energyMeterValue = res.data.energyMeterValue;
this.facilitiesCheckDesc = res.data.facilitiesCheckDesc;
this.fileList = res.data.facilitiesCheckImages;
});
this.getFacilities(options.houseId); this.getFacilities(options.houseId);
}, },
methods: { methods: {
checkboxChange(event) { checkboxChange(event) {
this.isChecked = !this.isChecked this.isChecked = !this.isChecked;
}, },
maskPhoneNumber(phoneNumber) { maskPhoneNumber(phoneNumber) {
if (!phoneNumber || phoneNumber.length !== 11) { if (!phoneNumber || phoneNumber.length !== 11) {
@ -286,9 +305,14 @@ export default {
handleTempSave(formData) { handleTempSave(formData) {
tempSaveCheckOut(formData).then((res) => { tempSaveCheckOut(formData).then((res) => {
if (res.code === 200) { if (res.code === 200) {
uni.showToast({ title: res.msg, icon: "success" }); uni.showToast({ title: "提交成功", icon: "success" });
uni.navigateTo({ setTimeout(() => {
url: `/pagesA/checkout/list/list`, uni.navigateTo(
{
url: `/pagesA/checkout/list/list`,
},
1000
);
}); });
} else { } else {
uni.showToast({ title: res.msg, icon: "warning" }); uni.showToast({ title: res.msg, icon: "warning" });
@ -297,7 +321,7 @@ export default {
}, },
onSubmit() { onSubmit() {
console.log(this.isChecked); console.log(this.isChecked);
if (!this.isChecked) { if (!this.isChecked) {
uni.showToast({ uni.showToast({
title: "请先确认信息无误并勾选", title: "请先确认信息无误并勾选",
@ -321,9 +345,7 @@ export default {
}); });
return; return;
} }
if (!String(this.waterMeterValue).trim()) {
//
if (!this.waterMeterValue || this.waterMeterValue.trim() === "") {
uni.showToast({ uni.showToast({
title: "请输入水表数", title: "请输入水表数",
icon: "none", icon: "none",
@ -332,7 +354,7 @@ export default {
return; return;
} }
if (!this.energyMeterValue || this.energyMeterValue.trim() === "") { if (!String(this.energyMeterValue).trim()) {
uni.showToast({ uni.showToast({
title: "请输入电表数", title: "请输入电表数",
icon: "none", icon: "none",
@ -340,12 +362,10 @@ export default {
}); });
return; return;
} }
const facilitiesCheckResults = this.deviceList.map((item, index) => ({ const facilitiesCheckResults = this.deviceList.map((item, index) => ({
facilityId: item.id, facilityId: item.id,
checkResult: this.checkStatus[index], checkResult: this.checkStatus[index],
})); }));
console.log(facilitiesCheckResults, "facilitiesCheckResults");
const params = { const params = {
idCard: this.info.idCard, idCard: this.info.idCard,
checkOutType: 0, //退 checkOutType: 0, //退
@ -356,10 +376,6 @@ export default {
energyMeterValue: this.energyMeterValue || "", energyMeterValue: this.energyMeterValue || "",
}; };
this.handleTempSave(params); this.handleTempSave(params);
uni.switchTab({
url: "/pages/tabBar/work/index",
});
uni.showToast({ title: "提交成功", icon: "success" });
}, },
}, },
}; };

6
pagesA/checkout/list/list.vue

@ -24,9 +24,7 @@
<text class="gender">{{ item.gender == 1 ? "男" : "女" }}</text> <text class="gender">{{ item.gender == 1 ? "男" : "女" }}</text>
<text class="phone">{{ maskPhoneNumber(item.telephone) }}</text> <text class="phone">{{ maskPhoneNumber(item.telephone) }}</text>
</view> </view>
<view class="room-date" <view class="room-date">{{ item.checkInDate }}{{ item.checkOutDate }}</view>
>{{ item.checkInDate }}{{ item.checkOutDate }}</view
>
</view> </view>
</view> </view>
</view> </view>
@ -121,7 +119,7 @@ export default {
houseTypeCoverImg: item.coverImg, houseTypeCoverImg: item.coverImg,
}); });
uni.navigateTo({ uni.navigateTo({
url: `/pagesA/checkout/detail/detail?houseId=${item.houseId}`, url: `/pagesA/checkout/detail/detail?houseId=${item.houseId}&idCard=${item.graduateIdCard}`,
}); });
}, },
}, },

5
pagesA/release/detail/detail.vue

@ -245,6 +245,7 @@ export default {
if (res && res.code === 200) { if (res && res.code === 200) {
this.roomDetail = res.data || {}; this.roomDetail = res.data || {};
this.value = res.data.facilitiesCheckDesc
// //
this.updatePageData(); this.updatePageData();
} else { } else {
@ -338,7 +339,9 @@ export default {
if (res.code === 200) { if (res.code === 200) {
uni.showToast({ title: "提交成功", icon: "success" }); uni.showToast({ title: "提交成功", icon: "success" });
setTimeout(() => { setTimeout(() => {
uni.navigateBack(); uni.navigateTo({
url: '/pages/tabBar/work/index'
});
}, 1000); }, 1000);
} else { } else {
uni.showToast({ title: res.msg, icon: "none" }); uni.showToast({ title: res.msg, icon: "none" });

Loading…
Cancel
Save