|
|
@ -9,19 +9,18 @@ |
|
|
|
<uv-icon name="arrow-right"></uv-icon> |
|
|
|
</template> |
|
|
|
</uv-form-item> |
|
|
|
|
|
|
|
<uv-form-item label="室号" prop="room" borderBottom @click="roomPickerOpen"> |
|
|
|
<uv-input placeholder="请选择室号" v-model="form.room" border="none" readonly :fontSize="30"></uv-input> |
|
|
|
|
|
|
|
<uv-form-item label="维修项目" prop="project" borderBottom @click="projectPickerOpen"> |
|
|
|
<uv-input v-model="form.project" placeholder="请填写维修物品的名称" readonly :fontSize="30" border="none"></uv-input> |
|
|
|
<template v-slot:right> |
|
|
|
<uv-icon name="arrow-right"></uv-icon> |
|
|
|
</template> |
|
|
|
</uv-form-item> |
|
|
|
|
|
|
|
<uv-form-item label="维修物品" prop="project" borderBottom> |
|
|
|
<uv-input v-model="form.project" placeholder="请填写维修物品的名称" :fontSize="30" border="none"></uv-input> |
|
|
|
<uv-form-item label="室号" prop="room" borderBottom> |
|
|
|
<uv-input placeholder="请选择室号" v-model="form.room" border="none" :fontSize="30"></uv-input> |
|
|
|
</uv-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<uv-form-item label="你的姓名" prop="name" borderBottom> |
|
|
|
<uv-input v-model="form.name" placeholder="请填写姓名" :fontSize="30" border="none"></uv-input> |
|
|
|
</uv-form-item> |
|
|
@ -56,12 +55,16 @@ |
|
|
|
@confirm="floorConfirm"></uv-picker> |
|
|
|
|
|
|
|
<!-- 报修地址选择(室号) --> |
|
|
|
<uv-picker ref="roomPicker" :columns="roomNumberList" :itemHeight="100" :round="20" keyName="name" title="选择室号" |
|
|
|
@confirm="roomConfirm"></uv-picker> |
|
|
|
<!-- <uv-picker ref="roomPicker" :columns="roomNumberList" :itemHeight="100" :round="20" keyName="name" title="选择室号" |
|
|
|
@confirm="roomConfirm"></uv-picker> --> |
|
|
|
|
|
|
|
<!-- 维修项目选择 --> |
|
|
|
<uv-picker ref="projectPicker" :columns="projectList" :itemHeight="100" :round="20" keyName="name" title="选择维修项目" |
|
|
|
@confirm="projectConfirm"></uv-picker> |
|
|
|
|
|
|
|
<!-- 图片操作菜单 --> |
|
|
|
<uv-action-sheet ref="actionSheet" :actions="list" :round="20" safeAreaInsetBottom |
|
|
|
@select="selectImageSheet"> </uv-action-sheet> |
|
|
|
<uv-action-sheet ref="actionSheet" :actions="list" :round="20" safeAreaInsetBottom @select="selectImageSheet"> |
|
|
|
</uv-action-sheet> |
|
|
|
|
|
|
|
<!-- 隐私政策 --> |
|
|
|
<PrivacyAgreementPoup ref="showPrivacy"></PrivacyAgreementPoup> |
|
|
@ -69,6 +72,9 @@ |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
mapState |
|
|
|
} from 'vuex' |
|
|
|
import PrivacyAgreementPoup from "@/components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue"; |
|
|
|
export default { |
|
|
|
name: 'Repair', |
|
|
@ -148,7 +154,8 @@ |
|
|
|
], |
|
|
|
currentIndex: undefined, //当前操作的图片索引 |
|
|
|
floorList: [], //楼栋列表 |
|
|
|
roomNumberList: [], //室号列表 |
|
|
|
// roomNumberList: [], //室号列表 |
|
|
|
projectList : [], //项目列表 |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
@ -160,9 +167,8 @@ |
|
|
|
this.$refs.showPrivacy.init(resolve) |
|
|
|
}) |
|
|
|
} |
|
|
|
if(this.floorList.length < 1){ |
|
|
|
this.getActorGoList() |
|
|
|
} |
|
|
|
if (this.floorList.length < 1) this.getActorGoList() |
|
|
|
if(this.projectList.length < 1) this.getProjectList() |
|
|
|
}, |
|
|
|
onReady() { |
|
|
|
this.$refs.form.setRules(this.rules); |
|
|
@ -186,7 +192,9 @@ |
|
|
|
|
|
|
|
//用户选择了图片操作选项 |
|
|
|
selectImageSheet(imageSheet) { |
|
|
|
let { id } = imageSheet |
|
|
|
let { |
|
|
|
id |
|
|
|
} = imageSheet |
|
|
|
if (id) { |
|
|
|
this.deleteImageAsList() |
|
|
|
} else { |
|
|
@ -212,34 +220,55 @@ |
|
|
|
//用户选择了楼栋 |
|
|
|
floorConfirm(floor) { |
|
|
|
this.form.building = floor.value[0].name |
|
|
|
this.getFloorList(floor.value[0].id) |
|
|
|
//获取楼栋对应的室号信息 |
|
|
|
// this.getFloorList(floor.value[0].id) |
|
|
|
}, |
|
|
|
|
|
|
|
//打开选择楼栋 |
|
|
|
floorPickerOpen() { |
|
|
|
if(this.floorList.length == 0){ |
|
|
|
return uni.showToast({ icon: 'none' , title: '暂无楼栋供用户选择' }) |
|
|
|
} |
|
|
|
this.$refs.floorPicker.open(); |
|
|
|
}, |
|
|
|
|
|
|
|
//用户选择了室号 |
|
|
|
roomConfirm(floor) { |
|
|
|
this.form.room = floor.value[0].name |
|
|
|
// //用户选择了室号 |
|
|
|
// roomConfirm(floor) { |
|
|
|
// this.form.room = floor.value[0].name |
|
|
|
// }, |
|
|
|
|
|
|
|
// //打开选择室号 |
|
|
|
// roomPickerOpen() { |
|
|
|
// if (!this.form.building) { |
|
|
|
// return uni.showToast({ |
|
|
|
// icon: 'none', |
|
|
|
// title: '请先选择楼栋信息' |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// this.$refs.roomPicker.open(); |
|
|
|
// }, |
|
|
|
|
|
|
|
//用户选择了项目 |
|
|
|
projectConfirm(project) { |
|
|
|
this.form.project = project.value[0].name |
|
|
|
}, |
|
|
|
|
|
|
|
//打开选择室号 |
|
|
|
roomPickerOpen() { |
|
|
|
if(!this.form.building){ |
|
|
|
return uni.showToast({ |
|
|
|
icon : 'none', |
|
|
|
title: '请先选择楼栋信息' |
|
|
|
}) |
|
|
|
|
|
|
|
//打开选择项目 |
|
|
|
projectPickerOpen() { |
|
|
|
if(this.projectList.length == 0){ |
|
|
|
return uni.showToast({ icon: 'none' , title: '暂无项目供用户选择' }) |
|
|
|
} |
|
|
|
this.$refs.roomPicker.open(); |
|
|
|
this.$refs.projectPicker.open(); |
|
|
|
}, |
|
|
|
|
|
|
|
//提交报修 |
|
|
|
submitRepair() { |
|
|
|
this.$refs.form.validate().then(res => { |
|
|
|
let images = this.form.image.join() |
|
|
|
if (this.userInfo && this.userInfo.isDai == '1') { |
|
|
|
this.cleanfrom() //清空表单内容 |
|
|
|
return uni.showToast({ icon: 'none' , title: '维修员不能主动提交报修' }) |
|
|
|
} |
|
|
|
this.$api('addSchoolOrder', { |
|
|
|
...this.form, |
|
|
|
image: images |
|
|
@ -285,14 +314,28 @@ |
|
|
|
}, |
|
|
|
|
|
|
|
//获取室号列表 |
|
|
|
getFloorList(id) { |
|
|
|
this.$api('getActorGoList',{id},res => { |
|
|
|
this.roomNumberList = [] |
|
|
|
if(res.result.length > 0 && this.form.room) this.form.room = res.result[0].name |
|
|
|
this.roomNumberList.push(res.result) |
|
|
|
// getFloorList(id) { |
|
|
|
// this.$api('getActorGoList', { |
|
|
|
// id |
|
|
|
// }, res => { |
|
|
|
// this.roomNumberList = [] |
|
|
|
// if (res.result.length > 0 && this.form.room) this.form.room = res.result[0].name |
|
|
|
// this.roomNumberList.push(res.result) |
|
|
|
// }) |
|
|
|
// } |
|
|
|
|
|
|
|
//获取项目列表 |
|
|
|
getProjectList() { |
|
|
|
this.$api('getRepairList', res => { |
|
|
|
this.getRepairList = [] |
|
|
|
this.projectList.push(res.result) |
|
|
|
console.log(this.projectList); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapState(['userInfo']), |
|
|
|
}, |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
@ -341,8 +384,8 @@ |
|
|
|
.image-item image { |
|
|
|
width: 100%; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/deep/ .uv-safe-area-inset-bottom { |
|
|
|
padding-bottom: 0 !important |
|
|
|
padding-bottom: 0 !important |
|
|
|
} |
|
|
|
</style> |