|
|
@ -9,9 +9,10 @@ |
|
|
|
<uv-icon name="arrow-right"></uv-icon> |
|
|
|
</template> |
|
|
|
</uv-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<uv-form-item label="维修项目" prop="project" borderBottom @click="projectPickerOpen"> |
|
|
|
<uv-input v-model="form.project" placeholder="请填写维修物品的名称" readonly :fontSize="30" border="none"></uv-input> |
|
|
|
<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> |
|
|
@ -59,8 +60,8 @@ |
|
|
|
@confirm="roomConfirm"></uv-picker> --> |
|
|
|
|
|
|
|
<!-- 维修项目选择 --> |
|
|
|
<uv-picker ref="projectPicker" :columns="projectList" :itemHeight="100" :round="20" keyName="name" title="选择维修项目" |
|
|
|
@confirm="projectConfirm"></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"> |
|
|
@ -155,10 +156,14 @@ |
|
|
|
currentIndex: undefined, //当前操作的图片索引 |
|
|
|
floorList: [], //楼栋列表 |
|
|
|
// roomNumberList: [], //室号列表 |
|
|
|
projectList : [], //项目列表 |
|
|
|
projectList: [], //项目列表 |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
//用户没有登录 |
|
|
|
if (!this.userInfo.id) { |
|
|
|
this.logout() |
|
|
|
} |
|
|
|
if (wx.onNeedPrivacyAuthorization) { |
|
|
|
wx.onNeedPrivacyAuthorization(resolve => { |
|
|
|
this.resolvePrivacyAuthorization = resolve |
|
|
@ -166,7 +171,7 @@ |
|
|
|
}) |
|
|
|
} |
|
|
|
if (this.floorList.length < 1) this.getActorGoList() |
|
|
|
if(this.projectList.length < 1) this.getProjectList() |
|
|
|
if (this.projectList.length < 1) this.getProjectList() |
|
|
|
}, |
|
|
|
onReady() { |
|
|
|
this.$refs.form.setRules(this.rules); |
|
|
@ -224,8 +229,11 @@ |
|
|
|
|
|
|
|
//打开选择楼栋 |
|
|
|
floorPickerOpen() { |
|
|
|
if(this.floorList.length == 0){ |
|
|
|
return uni.showToast({ icon: 'none' , title: '暂无楼栋供用户选择' }) |
|
|
|
if (this.floorList.length == 0) { |
|
|
|
return uni.showToast({ |
|
|
|
icon: 'none', |
|
|
|
title: '暂无楼栋供用户选择' |
|
|
|
}) |
|
|
|
} |
|
|
|
this.$refs.floorPicker.open(); |
|
|
|
}, |
|
|
@ -245,16 +253,19 @@ |
|
|
|
// } |
|
|
|
// this.$refs.roomPicker.open(); |
|
|
|
// }, |
|
|
|
|
|
|
|
|
|
|
|
//用户选择了项目 |
|
|
|
projectConfirm(project) { |
|
|
|
this.form.project = project.value[0].name |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//打开选择项目 |
|
|
|
projectPickerOpen() { |
|
|
|
if(this.projectList.length == 0){ |
|
|
|
return uni.showToast({ icon: 'none' , title: '暂无项目供用户选择' }) |
|
|
|
if (this.projectList.length == 0) { |
|
|
|
return uni.showToast({ |
|
|
|
icon: 'none', |
|
|
|
title: '暂无项目供用户选择' |
|
|
|
}) |
|
|
|
} |
|
|
|
this.$refs.projectPicker.open(); |
|
|
|
}, |
|
|
@ -264,8 +275,11 @@ |
|
|
|
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.cleanfrom() //清空表单内容 |
|
|
|
return uni.showToast({ |
|
|
|
icon: 'none', |
|
|
|
title: '维修员不能主动提交报修' |
|
|
|
}) |
|
|
|
} |
|
|
|
this.$api('addSchoolOrder', { |
|
|
|
...this.form, |
|
|
@ -327,9 +341,18 @@ |
|
|
|
this.$api('getRepairList', res => { |
|
|
|
this.getRepairList = [] |
|
|
|
this.projectList.push(res.result) |
|
|
|
console.log(this.projectList); |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//退出登录 |
|
|
|
logout() { |
|
|
|
uni.reLaunch({ |
|
|
|
url: '/pages/login/studentLogin' |
|
|
|
}) |
|
|
|
uni.removeStorageSync('token'); |
|
|
|
uni.removeStorageSync('userInfo'); |
|
|
|
this.$store.commit('setUserInfo', {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
...mapState(['userInfo']), |
|
|
|