Browse Source

数据回显

master
wangyx 3 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,
});
}
// 退房-房间检查回显
export function loadCheckOutDetail(query) {
return request({
url: `/apartment/manager/loadCheckOutDetail?idCard=${query.idCard}`,
method: "get",
});
}
export function getResidentInfo(query) {
return request({
url: "/apartment/manager/resideInfoByIdCard",
@ -200,4 +208,4 @@ export function handleRepair(data) {
method: "post",
data: data,
});
}
}

62
pagesA/checkout/detail/detail.vue

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

Loading…
Cancel
Save