|
@ -8,23 +8,45 @@ |
|
|
<view class="room-title">{{ userInfo.roomNamePath }}</view> |
|
|
<view class="room-title">{{ userInfo.roomNamePath }}</view> |
|
|
<view class="status-text">待释放</view> |
|
|
<view class="status-text">待释放</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="checkout-date-row">退房日期:{{ userInfo.checkoutTime }}</view> |
|
|
<view class="checkout-date-row" |
|
|
|
|
|
>退房日期:{{ userInfo.checkoutTime }}</view |
|
|
|
|
|
> |
|
|
</view> |
|
|
</view> |
|
|
<view class="clean-card"> |
|
|
<view class="clean-card"> |
|
|
<text class="clean-label">房间卫生<text class="required">*</text></text> |
|
|
<text class="clean-label">房间卫生<text class="required">*</text></text> |
|
|
<u-radio-group v-model="cleaned" class="clean-radio-group"> |
|
|
<u-radio-group v-model="cleaned" class="clean-radio-group"> |
|
|
<u-radio v-for="item in cleanOptions" :key="item.value" :label="item.label" :name="item.value" |
|
|
<u-radio |
|
|
activeColor="#0DC6C6" :custom-style="'margin-right: 40rpx;'"></u-radio> |
|
|
v-for="item in cleanOptions" |
|
|
|
|
|
:key="item.value" |
|
|
|
|
|
:label="item.label" |
|
|
|
|
|
:name="item.value" |
|
|
|
|
|
activeColor="#0DC6C6" |
|
|
|
|
|
:custom-style="'margin-right: 40rpx;'" |
|
|
|
|
|
></u-radio> |
|
|
</u-radio-group> |
|
|
</u-radio-group> |
|
|
</view> |
|
|
</view> |
|
|
<!-- 设备检查 --> |
|
|
<!-- 设备检查 --> |
|
|
<view class="section-card"> |
|
|
<view class="section-card"> |
|
|
<view class="section-title">设备检查</view> |
|
|
<view class="section-title">设备检查</view> |
|
|
<view v-for="(item, idx) in roomDetail.facilitiesCheckResults" :key="item.name" class="device-row"> |
|
|
<view |
|
|
|
|
|
v-for="(item, idx) in roomDetail.facilitiesCheckResults" |
|
|
|
|
|
:key="item.name" |
|
|
|
|
|
class="device-row" |
|
|
|
|
|
> |
|
|
<text class="device-label">{{ item.facilityName }}</text> |
|
|
<text class="device-label">{{ item.facilityName }}</text> |
|
|
<u-radio-group v-model="item.checkResult" placement="row" @change="onDeviceChange(idx, $event)"> |
|
|
<u-radio-group |
|
|
<u-radio :custom-style="'margin-right:36rpx;'" activeColor="#0DC6C6" v-for="opt in statusOptions" |
|
|
v-model="item.checkResult" |
|
|
:key="opt.value" :label="opt.label" :name="opt.value"></u-radio> |
|
|
placement="row" |
|
|
|
|
|
@change="onDeviceChange(idx, $event)" |
|
|
|
|
|
> |
|
|
|
|
|
<u-radio |
|
|
|
|
|
:custom-style="'margin-right:36rpx;'" |
|
|
|
|
|
activeColor="#0DC6C6" |
|
|
|
|
|
v-for="opt in statusOptions" |
|
|
|
|
|
:key="opt.value" |
|
|
|
|
|
:label="opt.label" |
|
|
|
|
|
:name="opt.value" |
|
|
|
|
|
></u-radio> |
|
|
</u-radio-group> |
|
|
</u-radio-group> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
@ -32,40 +54,79 @@ |
|
|
<!-- 其他说明 --> |
|
|
<!-- 其他说明 --> |
|
|
<view class="section-card"> |
|
|
<view class="section-card"> |
|
|
<view class="section-title">其他说明</view> |
|
|
<view class="section-title">其他说明</view> |
|
|
<u-textarea v-model="value" :formatter="formatter" ref="textarea" placeholder="请输入内容(不超过500字)" maxlength="500" |
|
|
<u-textarea |
|
|
height="150" border="none" custom-style="background:#f7f7f7;border-radius:12rpx;padding:16rpx;"></u-textarea> |
|
|
v-model="value" |
|
|
|
|
|
:formatter="formatter" |
|
|
|
|
|
ref="textarea" |
|
|
|
|
|
placeholder="请输入内容(不超过500字)" |
|
|
|
|
|
maxlength="500" |
|
|
|
|
|
height="150" |
|
|
|
|
|
border="none" |
|
|
|
|
|
custom-style="background:#f7f7f7;border-radius:12rpx;padding:16rpx;" |
|
|
|
|
|
></u-textarea> |
|
|
</view> |
|
|
</view> |
|
|
<!-- 图片/视频上传区域 --> |
|
|
<!-- 图片/视频上传区域 --> |
|
|
<view class="section-card"> |
|
|
<view class="section-card"> |
|
|
<view class="section-title">图片/视频</view> |
|
|
<view class="section-title">图片/视频</view> |
|
|
<!-- #ifdef MP-WEIXIN --> |
|
|
<!-- #ifdef MP-WEIXIN --> |
|
|
<u-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="10" |
|
|
<u-upload |
|
|
uploadIconColor="#12c3c3" uploadText="点击上传" :previewImage="true" accept="media"> |
|
|
:fileList="fileList" |
|
|
|
|
|
@afterRead="afterRead" |
|
|
|
|
|
@delete="deletePic" |
|
|
|
|
|
multiple |
|
|
|
|
|
:maxCount="10" |
|
|
|
|
|
uploadIconColor="#12c3c3" |
|
|
|
|
|
uploadText="点击上传" |
|
|
|
|
|
:previewImage="true" |
|
|
|
|
|
accept="media" |
|
|
|
|
|
> |
|
|
</u-upload> |
|
|
</u-upload> |
|
|
<!-- #endif --> |
|
|
<!-- #endif --> |
|
|
<!-- #ifdef H5 --> |
|
|
<!-- #ifdef H5 --> |
|
|
<u-upload :fileList="fileList" @afterRead="afterRead" @delete="deletePic" multiple :maxCount="10" |
|
|
<u-upload |
|
|
uploadIconColor="#12c3c3" uploadText="点击上传" :previewImage="true" accept="image/*,video/*"> |
|
|
:fileList="fileList" |
|
|
|
|
|
@afterRead="afterRead" |
|
|
|
|
|
@delete="deletePic" |
|
|
|
|
|
multiple |
|
|
|
|
|
:maxCount="10" |
|
|
|
|
|
uploadIconColor="#12c3c3" |
|
|
|
|
|
:previewImage="true" |
|
|
|
|
|
accept="image/*,video/*" |
|
|
|
|
|
> |
|
|
|
|
|
<view class="custom-upload-btn"> |
|
|
|
|
|
<view class="icon-box"> |
|
|
|
|
|
<image |
|
|
|
|
|
class="camera-icon" |
|
|
|
|
|
src="/static/img/camera-icon.png" |
|
|
|
|
|
mode="aspectFill" |
|
|
|
|
|
></image> |
|
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="upload-tips">点击上传</view> |
|
|
|
|
|
</view> |
|
|
</u-upload> |
|
|
</u-upload> |
|
|
<!-- #endif --> |
|
|
<!-- #endif --> |
|
|
</view> |
|
|
</view> |
|
|
<!-- 提交按钮 --> |
|
|
<!-- 提交按钮 --> |
|
|
<view class="submit-btn-wrap"> |
|
|
<view class="submit-btn-wrap"> |
|
|
<u-button type="primary" :custom-style="btnStyle" shape="circle" @click="onSubmit">提交</u-button> |
|
|
<u-button |
|
|
|
|
|
type="primary" |
|
|
|
|
|
:custom-style="btnStyle" |
|
|
|
|
|
shape="circle" |
|
|
|
|
|
@click="onSubmit" |
|
|
|
|
|
>提交</u-button |
|
|
|
|
|
> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { getRoomCheckRecDetail, releaseRoom } from "../../../common/api" |
|
|
import { getRoomCheckRecDetail, releaseRoom } from "../../../common/api"; |
|
|
import { |
|
|
import { uploadImage } from "../../../pages/api"; |
|
|
uploadImage, |
|
|
|
|
|
} from "../../../pages/api" |
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
roomId: '', // 房间ID |
|
|
roomId: "", // 房间ID |
|
|
userInfo: {}, // 用户信息 |
|
|
userInfo: {}, // 用户信息 |
|
|
roomDetail: {}, // 房间详情 |
|
|
roomDetail: {}, // 房间详情 |
|
|
btnStyle: |
|
|
btnStyle: |
|
@ -79,13 +140,20 @@ export default { |
|
|
{ name: "茶几", status: "完好" }, |
|
|
{ name: "茶几", status: "完好" }, |
|
|
{ name: "桌椅", status: "完好" }, |
|
|
{ name: "桌椅", status: "完好" }, |
|
|
], |
|
|
], |
|
|
statusOptions: [{ label: "完好", value: 0 }, { label: "破损", value: 1 }, { label: "丢失", value: 2 }], |
|
|
statusOptions: [ |
|
|
|
|
|
{ label: "完好", value: 0 }, |
|
|
|
|
|
{ label: "破损", value: 1 }, |
|
|
|
|
|
{ label: "丢失", value: 2 }, |
|
|
|
|
|
], |
|
|
waterMeter: 3245.1, |
|
|
waterMeter: 3245.1, |
|
|
electricMeter: 2672.6, |
|
|
electricMeter: 2672.6, |
|
|
remark: "", |
|
|
remark: "", |
|
|
value: "", // 其他说明的文本内容 |
|
|
value: "", // 其他说明的文本内容 |
|
|
fileList: [], |
|
|
fileList: [], |
|
|
cleanOptions: [{ label: "已打扫", value: "1" }, { label: "未打扫", value: "0" }], |
|
|
cleanOptions: [ |
|
|
|
|
|
{ label: "已打扫", value: "1" }, |
|
|
|
|
|
{ label: "未打扫", value: "0" }, |
|
|
|
|
|
], |
|
|
cleaned: "1", |
|
|
cleaned: "1", |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
@ -99,7 +167,7 @@ export default { |
|
|
try { |
|
|
try { |
|
|
this.userInfo = JSON.parse(options.userInfo); |
|
|
this.userInfo = JSON.parse(options.userInfo); |
|
|
} catch (e) { |
|
|
} catch (e) { |
|
|
console.error('解析userInfo失败:', e); |
|
|
console.error("解析userInfo失败:", e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -146,17 +214,21 @@ export default { |
|
|
} |
|
|
} |
|
|
console.log(this.fileList); |
|
|
console.log(this.fileList); |
|
|
|
|
|
|
|
|
this.fileList = this.fileList.map(v => ({ url: v.url, name: v.name, type: v.type })); |
|
|
this.fileList = this.fileList.map((v) => ({ |
|
|
|
|
|
url: v.url, |
|
|
|
|
|
name: v.name, |
|
|
|
|
|
type: v.type, |
|
|
|
|
|
})); |
|
|
}, |
|
|
}, |
|
|
// 获取房间详情 |
|
|
// 获取房间详情 |
|
|
async getRoomDetail() { |
|
|
async getRoomDetail() { |
|
|
try { |
|
|
try { |
|
|
uni.showLoading({ |
|
|
uni.showLoading({ |
|
|
title: '加载中...' |
|
|
title: "加载中...", |
|
|
}); |
|
|
}); |
|
|
console.log(this.roomId); |
|
|
console.log(this.roomId); |
|
|
const res = await getRoomCheckRecDetail({ |
|
|
const res = await getRoomCheckRecDetail({ |
|
|
roomId: this.roomId |
|
|
roomId: this.roomId, |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (res && res.code === 200) { |
|
|
if (res && res.code === 200) { |
|
@ -165,15 +237,15 @@ export default { |
|
|
this.updatePageData(); |
|
|
this.updatePageData(); |
|
|
} else { |
|
|
} else { |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: res?.msg || '获取房间详情失败', |
|
|
title: res?.msg || "获取房间详情失败", |
|
|
icon: 'none' |
|
|
icon: "none", |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.error('获取房间详情失败:', error); |
|
|
console.error("获取房间详情失败:", error); |
|
|
uni.showToast({ |
|
|
uni.showToast({ |
|
|
title: '获取房间详情失败', |
|
|
title: "获取房间详情失败", |
|
|
icon: 'none' |
|
|
icon: "none", |
|
|
}); |
|
|
}); |
|
|
} finally { |
|
|
} finally { |
|
|
uni.hideLoading(); |
|
|
uni.hideLoading(); |
|
@ -210,44 +282,44 @@ export default { |
|
|
uni.showToast({ title: "请选择房间卫生状态", icon: "none" }); |
|
|
uni.showToast({ title: "请选择房间卫生状态", icon: "none" }); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// if (!this.roomDetail.facilitiesCheckResults || this.roomDetail.facilitiesCheckResults.length === 0) { |
|
|
// if (!this.roomDetail.facilitiesCheckResults || this.roomDetail.facilitiesCheckResults.length === 0) { |
|
|
// uni.showToast({ title: "请完成设备检查", icon: "none" }); |
|
|
// uni.showToast({ title: "请完成设备检查", icon: "none" }); |
|
|
// return; |
|
|
// return; |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
// 检查设备检查是否都已完成 |
|
|
// 检查设备检查是否都已完成 |
|
|
// const unfinishedDevices = this.roomDetail.facilitiesCheckResults.filter(item => |
|
|
// const unfinishedDevices = this.roomDetail.facilitiesCheckResults.filter(item => |
|
|
// item.checkResult === undefined || item.checkResult === null |
|
|
// item.checkResult === undefined || item.checkResult === null |
|
|
// ); |
|
|
// ); |
|
|
// if (unfinishedDevices.length > 0) { |
|
|
// if (unfinishedDevices.length > 0) { |
|
|
// uni.showToast({ title: "请完成所有设备检查", icon: "none" }); |
|
|
// uni.showToast({ title: "请完成所有设备检查", icon: "none" }); |
|
|
// return; |
|
|
// return; |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
// if (!this.value || this.value.trim() === '') { |
|
|
// if (!this.value || this.value.trim() === '') { |
|
|
// uni.showToast({ title: "请输入其他说明", icon: "none" }); |
|
|
// uni.showToast({ title: "请输入其他说明", icon: "none" }); |
|
|
// return; |
|
|
// return; |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
// if (!this.fileList || this.fileList.length === 0) { |
|
|
// if (!this.fileList || this.fileList.length === 0) { |
|
|
// uni.showToast({ title: "请上传图片或视频", icon: "none" }); |
|
|
// uni.showToast({ title: "请上传图片或视频", icon: "none" }); |
|
|
// return; |
|
|
// return; |
|
|
// } |
|
|
// } |
|
|
|
|
|
|
|
|
let parm = { |
|
|
let parm = { |
|
|
roomId: this.roomId, |
|
|
roomId: this.roomId, |
|
|
facilitiesCheckResults: this.roomDetail.facilitiesCheckResults, |
|
|
facilitiesCheckResults: this.roomDetail.facilitiesCheckResults, |
|
|
cleaned: this.cleaned, |
|
|
cleaned: this.cleaned, |
|
|
facilitiesCheckDesc: this.value, |
|
|
facilitiesCheckDesc: this.value, |
|
|
facilitiesCheckImages: this.fileList, |
|
|
facilitiesCheckImages: this.fileList, |
|
|
} |
|
|
}; |
|
|
|
|
|
|
|
|
const res = await releaseRoom(parm) |
|
|
const res = await releaseRoom(parm); |
|
|
if (res.code === 200) { |
|
|
if (res.code === 200) { |
|
|
uni.showToast({ title: "提交成功", icon: "success" }); |
|
|
uni.showToast({ title: "提交成功", icon: "success" }); |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
uni.navigateBack() |
|
|
uni.navigateBack(); |
|
|
}, 1000); |
|
|
}, 1000); |
|
|
} else { |
|
|
} else { |
|
|
uni.showToast({ title: res.msg, icon: "none" }); |
|
|
uni.showToast({ title: res.msg, icon: "none" }); |
|
@ -360,15 +432,27 @@ export default { |
|
|
width: 160rpx; |
|
|
width: 160rpx; |
|
|
height: 160rpx; |
|
|
height: 160rpx; |
|
|
background: #fafafa; |
|
|
background: #fafafa; |
|
|
border: 2rpx dashed #e5e5e5; |
|
|
border: 2rpx solid #f0f0f0; |
|
|
border-radius: 16rpx; |
|
|
border-radius: 16rpx; |
|
|
display: flex; |
|
|
display: flex; |
|
|
flex-direction: column; |
|
|
flex-direction: column; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
justify-content: center; |
|
|
justify-content: center; |
|
|
margin: 0 16rpx 0 0; |
|
|
margin: 20rpx 16rpx 0 0; |
|
|
|
|
|
} |
|
|
|
|
|
.icon-box { |
|
|
|
|
|
width: 60rpx; |
|
|
|
|
|
height: 60rpx; |
|
|
|
|
|
background: #ceeced; |
|
|
|
|
|
border-radius: 50%; |
|
|
|
|
|
display: flex; |
|
|
|
|
|
align-items: center; |
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
} |
|
|
|
|
|
.camera-icon { |
|
|
|
|
|
width: 36rpx; |
|
|
|
|
|
height: 36rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.upload-tips { |
|
|
.upload-tips { |
|
|
color: #bbb; |
|
|
color: #bbb; |
|
|
font-size: 24rpx; |
|
|
font-size: 24rpx; |
|
|