|
@ -21,7 +21,7 @@ import { detail } from '@/api/mz/contract'; |
|
|
><text class="label">联系电话</text>{{ info.telephone }}</view |
|
|
><text class="label">联系电话</text>{{ info.telephone }}</view |
|
|
> |
|
|
> |
|
|
<view class="info-row" |
|
|
<view class="info-row" |
|
|
><text class="label">居住日期</text>{{ info.startDate }}至{{ |
|
|
><text class="label">居住日期</text>{{ info.checkInDate }}至{{ |
|
|
info.checkOutDate |
|
|
info.checkOutDate |
|
|
}}</view |
|
|
}}</view |
|
|
> |
|
|
> |
|
@ -36,17 +36,17 @@ import { detail } from '@/api/mz/contract'; |
|
|
> |
|
|
> |
|
|
<text class="device-label">{{ item.name }}</text> |
|
|
<text class="device-label">{{ item.name }}</text> |
|
|
<u-radio-group |
|
|
<u-radio-group |
|
|
v-model="item.status" |
|
|
|
|
|
placement="row" |
|
|
placement="row" |
|
|
@change="onDeviceChange(idx, $event)" |
|
|
@change="onDeviceChange(idx, $event)" |
|
|
|
|
|
v-model="checkStatus[idx]" |
|
|
> |
|
|
> |
|
|
<u-radio |
|
|
<u-radio |
|
|
:custom-style="'margin-right:36rpx;'" |
|
|
:custom-style="'margin-right:36rpx;'" |
|
|
activeColor="#0DC6C6" |
|
|
activeColor="#0DC6C6" |
|
|
v-for="opt in statusOptions" |
|
|
v-for="opt in statusOptions" |
|
|
:key="opt" |
|
|
:key="opt.value" |
|
|
:label="opt" |
|
|
:label="opt.label" |
|
|
:name="opt" |
|
|
:name="opt.value" |
|
|
></u-radio> |
|
|
></u-radio> |
|
|
</u-radio-group> |
|
|
</u-radio-group> |
|
|
</view> |
|
|
</view> |
|
@ -78,7 +78,6 @@ import { detail } from '@/api/mz/contract'; |
|
|
<view class="section-title">其他说明</view> |
|
|
<view class="section-title">其他说明</view> |
|
|
<u-textarea |
|
|
<u-textarea |
|
|
v-model="facilitiesCheckDesc" |
|
|
v-model="facilitiesCheckDesc" |
|
|
|
|
|
|
|
|
ref="textarea" |
|
|
ref="textarea" |
|
|
placeholder="请输入内容(不超过500字)" |
|
|
placeholder="请输入内容(不超过500字)" |
|
|
maxlength="500" |
|
|
maxlength="500" |
|
@ -96,9 +95,9 @@ import { detail } from '@/api/mz/contract'; |
|
|
@delete="deletePic" |
|
|
@delete="deletePic" |
|
|
multiple |
|
|
multiple |
|
|
:maxCount="10" |
|
|
:maxCount="10" |
|
|
accept="image,video" |
|
|
|
|
|
uploadIconColor="#12c3c3" |
|
|
uploadIconColor="#12c3c3" |
|
|
uploadText="点击上传" |
|
|
uploadText="点击上传" |
|
|
|
|
|
:previewImage="true" |
|
|
> |
|
|
> |
|
|
</u-upload> |
|
|
</u-upload> |
|
|
</view> |
|
|
</view> |
|
@ -116,19 +115,52 @@ import { detail } from '@/api/mz/contract'; |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import { getRoomFacilities,submitCheckout } from "../../../pages/api"; |
|
|
import { |
|
|
|
|
|
getRoomFacilities, |
|
|
|
|
|
submitCheckout, |
|
|
|
|
|
uploadImage, |
|
|
|
|
|
tempSaveCheckOut, |
|
|
|
|
|
} from "../../../pages/api"; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
btnStyle: |
|
|
btnStyle: |
|
|
"background:linear-gradient(90deg,#0DC6C6 0%,#13C2C2 100%);font-size:36rpx;border-radius:48rpx;width:60vw;height:80rpx;", |
|
|
"background:linear-gradient(90deg,#0DC6C6 0%,#13C2C2 100%);font-size:36rpx;border-radius:48rpx;width:60vw;height:80rpx;", |
|
|
deviceList: [ ], |
|
|
deviceList: [], |
|
|
statusOptions: ["完好", "破损", "丢失"], |
|
|
statusOptions: [ |
|
|
waterMeterValue: '', |
|
|
{ |
|
|
energyMeterValue: '', |
|
|
label: "完好", |
|
|
|
|
|
value: "0", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: "破损", |
|
|
|
|
|
value: "1", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: "丢失", |
|
|
|
|
|
value: "2", |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
waterMeterValue: "", |
|
|
|
|
|
energyMeterValue: "", |
|
|
|
|
|
checkStatus: [ |
|
|
|
|
|
{ |
|
|
|
|
|
label: "完好", |
|
|
|
|
|
value: "0", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: "破损", |
|
|
|
|
|
value: "1", |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: "丢失", |
|
|
|
|
|
value: "2", |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
remark: "", |
|
|
remark: "", |
|
|
fileList: [], |
|
|
fileList: [], |
|
|
|
|
|
img1: [], |
|
|
info: {}, |
|
|
info: {}, |
|
|
facilitiesCheckDesc: "", |
|
|
facilitiesCheckDesc: "", |
|
|
}; |
|
|
}; |
|
@ -149,25 +181,80 @@ export default { |
|
|
onDeviceChange(idx, val) { |
|
|
onDeviceChange(idx, val) { |
|
|
this.deviceList[idx].status = val; |
|
|
this.deviceList[idx].status = val; |
|
|
}, |
|
|
}, |
|
|
afterRead(event) { |
|
|
beforeRead(event) { |
|
|
let files = Array.isArray(event.file) ? event.file : [event.file]; |
|
|
console.log("event", event); |
|
|
this.fileList = this.fileList.concat(files); |
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 选择文件后上传 |
|
|
|
|
|
async afterRead(event) { |
|
|
|
|
|
let lists = [].concat(event.file); |
|
|
|
|
|
let fileListLen = this[`fileList${event.name}`].length; |
|
|
|
|
|
lists.map((item) => { |
|
|
|
|
|
this[`fileList${event.name}`].push({ |
|
|
|
|
|
...item, |
|
|
|
|
|
status: "uploading", |
|
|
|
|
|
message: "上传中", |
|
|
|
|
|
}); |
|
|
|
|
|
}); |
|
|
|
|
|
for (let i = 0; i < lists.length; i++) { |
|
|
|
|
|
const result = await uploadImage(lists[i].url); |
|
|
|
|
|
let item = this[`fileList${event.name}`][fileListLen]; |
|
|
|
|
|
|
|
|
|
|
|
this[`fileList${event.name}`].splice( |
|
|
|
|
|
fileListLen, |
|
|
|
|
|
1, |
|
|
|
|
|
Object.assign(item, { |
|
|
|
|
|
status: "success", |
|
|
|
|
|
message: "", |
|
|
|
|
|
url: result.url, |
|
|
|
|
|
}) |
|
|
|
|
|
); |
|
|
|
|
|
fileListLen++; |
|
|
|
|
|
} |
|
|
|
|
|
var arry = []; |
|
|
|
|
|
this.fileList.filter((v, i) => { |
|
|
|
|
|
arry.push(v.url); |
|
|
|
|
|
}); |
|
|
|
|
|
this.img1 = arry; |
|
|
|
|
|
}, |
|
|
|
|
|
// 删除文件 |
|
|
deletePic(event) { |
|
|
deletePic(event) { |
|
|
this.fileList.splice(event.index, 1); |
|
|
this[`fileList${event.name}`].splice(event.index, 1); |
|
|
|
|
|
var arry = []; |
|
|
|
|
|
this.fileList.filter((v, i) => { |
|
|
|
|
|
arry.push(v.url); |
|
|
|
|
|
}); |
|
|
|
|
|
this.img1 = arry; |
|
|
|
|
|
}, |
|
|
|
|
|
// 暂存提交 |
|
|
|
|
|
handleTempSave(formData) { |
|
|
|
|
|
tempSaveCheckOut(formData).then((res) => { |
|
|
|
|
|
if (res.code === 200) { |
|
|
|
|
|
uni.showToast({ title: res.msg, icon: "success" }); |
|
|
|
|
|
uni.navigateTo({ |
|
|
|
|
|
url: `/pagesA/checkout/list/list`, |
|
|
|
|
|
}); |
|
|
|
|
|
} else { |
|
|
|
|
|
uni.showToast({ title: res.msg, icon: "warning" }); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
}, |
|
|
}, |
|
|
onSubmit() { |
|
|
onSubmit() { |
|
|
let data = { |
|
|
const facilitiesCheckResults = this.deviceList.map((item, index) => ({ |
|
|
checkOutRecId: this.info.checkOutRecId, |
|
|
facilityId: item.id, |
|
|
houseId: this.info.houseId, |
|
|
checkResult: this.checkStatus[index], |
|
|
roomId: this.info.roomId, |
|
|
})); |
|
|
graduateId: this.info.graduateId, |
|
|
console.log(facilitiesCheckResults, "facilitiesCheckResults"); |
|
|
graduateName: this.info.graduateName, |
|
|
const params = { |
|
|
startDate: this.info.startDate, |
|
|
idCard: this.info.idCard, |
|
|
checkOutDate: this.info.checkOutDate, |
|
|
checkOutType: 0, //正常退房 |
|
|
waterMeterValue: this.waterMeterValue, |
|
|
facilitiesCheckDesc: this.facilitiesCheckDesc, |
|
|
} |
|
|
facilitiesCheckImages: this.fileList, |
|
|
|
|
|
facilitiesCheckResults: facilitiesCheckResults, |
|
|
|
|
|
waterMeterValue: this.waterMeterValue || "", |
|
|
|
|
|
energyMeterValue: this.energyMeterValue || "", |
|
|
|
|
|
}; |
|
|
|
|
|
this.handleTempSave(params); |
|
|
uni.showToast({ title: "提交成功", icon: "success" }); |
|
|
uni.showToast({ title: "提交成功", icon: "success" }); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|