提交 c3c176e7 authored 作者: 宋雄's avatar 宋雄

完成设备管理员切换

上级 04516444
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
repairPhoto: [] repairPhoto: []
}, },
complaintInfo: { complaintInfo: {
// complaintThem: '', // complaintTheme: '',
// userName: '', // userName: '',
// userPhone: '', // userPhone: '',
// problemDesc: '', // problemDesc: '',
......
...@@ -262,11 +262,15 @@ export const updateStatusApi = (params, config = {})=> { ...@@ -262,11 +262,15 @@ export const updateStatusApi = (params, config = {})=> {
} }
// 维修上报列表 // 维修上报列表
export const getCommunityRepairListApi = (params, config = {})=> { export const getCommunityRepairListApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> { return new Promise((resolve, reject)=> {
http.get('/property-community/wechat/communityRepair/list', http.get('/property-community/wechat/communityRepair/list',
{ {
data: { ...params}, data: {
...params,
ownerId: uni.getStorageSync('openid'),
platformCode: uni.getStorageSync('platform_code')
},
...config ...config
}) })
.then(res=> { resolve(res) }) .then(res=> { resolve(res) })
...@@ -279,7 +283,11 @@ export const getCommunityRepairDetailApi = (params, config = {})=> { ...@@ -279,7 +283,11 @@ export const getCommunityRepairDetailApi = (params, config = {})=> {
return new Promise((resolve, reject)=> { return new Promise((resolve, reject)=> {
http.get('/property-community/wechat/communityRepair/queryById', http.get('/property-community/wechat/communityRepair/queryById',
{ {
data: { ...params}, data: {
...params,
ownerId: uni.getStorageSync('openid'),
platformCode: uni.getStorageSync('platform_code')
},
...config ...config
}) })
.then(res=> { resolve(res) }) .then(res=> { resolve(res) })
...@@ -288,10 +296,14 @@ export const getCommunityRepairDetailApi = (params, config = {})=> { ...@@ -288,10 +296,14 @@ export const getCommunityRepairDetailApi = (params, config = {})=> {
} }
// 新增维修上报 // 新增维修上报
export const addCommunityRepairApi = (params, config = {})=> { export const addCommunityRepairApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> { return new Promise((resolve, reject)=> {
http.post('/property-community/wechat/communityRepair/add', http.post('/property-community/wechat/communityRepair/add',
{ ...params }, {
...params,
ownerId: uni.getStorageSync('openid'),
platformCode: uni.getStorageSync('platform_code')
},
{ ...config }) { ...config })
.then(res=> { resolve(res) }) .then(res=> { resolve(res) })
.catch(err=> { reject(err) }) .catch(err=> { reject(err) })
...@@ -299,10 +311,14 @@ export const addCommunityRepairApi = (params, config = {})=> { ...@@ -299,10 +311,14 @@ export const addCommunityRepairApi = (params, config = {})=> {
} }
// 修改维修上报 // 修改维修上报
export const editCommunityRepairApi = (params, config = {})=> { export const editCommunityRepairApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> { return new Promise((resolve, reject)=> {
http.post('/property-community/wechat/communityRepair/edit', http.post('/property-community/wechat/communityRepair/edit',
{ ...params }, {
...params,
ownerId: uni.getStorageSync('openid'),
platformCode: uni.getStorageSync('platform_code')
},
{ ...config }) { ...config })
.then(res=> { resolve(res) }) .then(res=> { resolve(res) })
.catch(err=> { reject(err) }) .catch(err=> { reject(err) })
...@@ -323,11 +339,15 @@ export const deleteCommunityRepairApi = (params, config = {})=> { ...@@ -323,11 +339,15 @@ export const deleteCommunityRepairApi = (params, config = {})=> {
} }
// 投诉列表 // 投诉列表
export const getCommunityComplaintListApi = (params, config = {})=> { export const getCommunityComplaintListApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> { return new Promise((resolve, reject)=> {
http.get('/property-community/wechat/communityComplaint/list', http.get('/property-community/wechat/communityComplaint/list',
{ {
data: { ...params}, data: {
...params,
userId: uni.getStorageSync('openid'),
platformCode: uni.getStorageSync('platform_code')
},
...config ...config
}) })
.then(res=> { resolve(res) }) .then(res=> { resolve(res) })
...@@ -349,10 +369,14 @@ export const getCommunityComplaintDetailApi = (params, config = {})=> { ...@@ -349,10 +369,14 @@ export const getCommunityComplaintDetailApi = (params, config = {})=> {
} }
// 新增投诉 // 新增投诉
export const addCommunityComplaintApi = (params, config = {})=> { export const addCommunityComplaintApi = (params = {}, config = {})=> {
return new Promise((resolve, reject)=> { return new Promise((resolve, reject)=> {
http.post('/property-community/wechat/communityComplaint/add', http.post('/property-community/wechat/communityComplaint/add',
{ ...params }, {
...params,
userId: uni.getStorageSync('openid'),
platformCode: uni.getStorageSync('platform_code')
},
{ ...config }) { ...config })
.then(res=> { resolve(res) }) .then(res=> { resolve(res) })
.catch(err=> { reject(err) }) .catch(err=> { reject(err) })
......
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
* 接口参数 * 接口参数
*/ */
const serverConfig = { const serverConfig = {
baseURL: "http://192.168.0.118:9999", baseURL: "http://192.168.0.100:9999",
// baseURL: "http://192.168.0.118:9999",
// baseURL: "http://220.203.25.212:9999", /* 根域名 */ // baseURL: "http://220.203.25.212:9999", /* 根域名 */
// baseURL: "http://114.67.111.37:8001" /* 根域名 */ // baseURL: "http://114.67.111.37:8001" /* 根域名 */
} }
......
...@@ -4,10 +4,7 @@ ...@@ -4,10 +4,7 @@
<view class="search"> <view class="search">
<uni-search-bar placeholder="请输入您的小区名" bgColor="#EEEEEE" @confirm="search" /> <uni-search-bar placeholder="请输入您的小区名" bgColor="#EEEEEE" @confirm="search" />
<view class="list"> <view class="list">
<view class="item">汉江之星小区</view> <view class="item" :class="{'active': item.platformCode === currentHouseCode}" @click="onChangeHouse(item)" v-for="item in houseList" :key="item.platformCode">{{item.platformName}}</view>
<view class="item">南航碧桂园小区</view>
<view class="item">阳光花园小区</view>
<view class="item">天河彩虹城</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -18,22 +15,32 @@ ...@@ -18,22 +15,32 @@
export default { export default {
data() { data() {
return { return {
houseList: [],
currentHouseCode: ''
} }
}, },
methods: { methods: {
toDetails() { onChangeHouse(item) {
uni.navigateTo({ if(item.platformCode === this.currentHouseCode) return
url: '/pages/announcementDetails/index', uni.setStorageSync('platform_code', item.platformCode)
}); uni.reLaunch({
url: '/pages/home/index'
})
},
search(value) {
console.log(value)
} }
}, },
onLoad() { onLoad() {
this.currentHouseCode = uni.getStorageSync('platform_code')
}, let userType = uni.getStorageSync('user_type')
onShow() { if(userType === '1') {
let data = uni.getStorageSync('user_house_list')
this.houseList = JSON.parse(data)
} else {
let data = uni.getStorageSync('employee_house_list')
this.houseList = JSON.parse(data)
}
} }
} }
</script> </script>
...@@ -53,6 +60,9 @@ ...@@ -53,6 +60,9 @@
height: 84rpx; height: 84rpx;
line-height: 84rpx; line-height: 84rpx;
border-bottom: 1px solid #F8F6F9; border-bottom: 1px solid #F8F6F9;
&.active {
color: #6A59F2;
}
} }
} }
} }
......
<template> <template>
<view class="container"> <view class="container">
<view class="page"> <view class="page">
<view class="complaints"> <view class="complaints" v-if="maintenanceList.length !== 0">
<view class="information" v-for="item in maintenanceList" :key="item.id" @click="toDetail(item.id)"> <view class="information" v-for="item in maintenanceList" :key="item.id" @click="toDetail(item.id)">
<view class="title" :class="item.handleStatus === 'finish' ? 'gray' : 'yellow'">{{item.complaintTheme}}<view class="tag">{{item.statusName}}</view> <view class="title" :class="item.handleStatus === 'finish' ? 'gray' : 'yellow'">{{item.complaintTheme}}<view class="tag">{{item.statusName}}</view>
</view> </view>
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
</view> </view>
</view> </view>
</view> </view>
<no-data :show="maintenanceList.length === 0" text="暂无投诉信息"></no-data>
</view> </view>
<view class="form-submit-fixed"> <view class="form-submit-fixed">
<view class="form-submit" @click="toEditor()">新增投诉</view> <view class="form-submit" @click="toEditor()">新增投诉</view>
...@@ -29,11 +30,14 @@ ...@@ -29,11 +30,14 @@
getCommunityComplaintListApi, getCommunityComplaintListApi,
} from '@/config/api.js' } from '@/config/api.js'
import {Moment} from '@/utils/moment.js' import {Moment} from '@/utils/moment.js'
import noData from '@/components/no-data/no-data'
const handleStatus = { const handleStatus = {
waitPending: '待处理', waitPending: '待处理',
pending: '处理中',
finish: '处理完成' finish: '处理完成'
} }
export default { export default {
components: {noData},
data() { data() {
return { return {
maintenanceList: [] maintenanceList: []
...@@ -51,7 +55,7 @@ ...@@ -51,7 +55,7 @@
}); });
}, },
async getList() { async getList() {
let {result} = await getCommunityComplaintListApi({userId: getApp().globalData.houseInfo.id}) let {result} = await getCommunityComplaintListApi()
this.maintenanceList = result.records.map(item=> { this.maintenanceList = result.records.map(item=> {
return { return {
...item, ...item,
...@@ -75,13 +79,9 @@ ...@@ -75,13 +79,9 @@
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.page { .complaints {
padding: 30rpx 30rpx 90rpx; padding: 30rpx 30rpx 90rpx;
background-color: #F8F6F9; background-color: #F8F6F9;
}
.complaints {
.information { .information {
background-color: #ffffff; background-color: #ffffff;
border-radius: 16rpx; border-radius: 16rpx;
......
...@@ -69,28 +69,27 @@ ...@@ -69,28 +69,27 @@
}, },
methods: { methods: {
async toAudit() { async toAudit() {
// let complaintImg = this.formData.complaintImg.map(item=>item.url).join(',') let complaintImg = this.formData.complaintImg.map(item=>item.url).join(',')
// let data =await addCommunityComplaintApi({ let data = await addCommunityComplaintApi({
// ...this.formData, ...this.formData,
// complaintImg, complaintImg
// userId: getApp().globalData.houseInfo.id })
// }) getApp().globalData.complaintInfo = {
// getApp().globalData.complaintInfo = { ...this.formData,
// ...this.formData, complaintImg,
// complaintImg, repairStatus: 'waitAudit'
// repairStatus: 'waitAudit' }
// } setTimeout(()=> {
// setTimeout(()=> { uni.showToast({
// uni.showToast({ title: '提交成功!',
// title: '提交成功!', icon: 'none'
// icon: 'none' });
// }); setTimeout(()=> {
// setTimeout(()=> {
uni.navigateTo({ uni.navigateTo({
url: '/pages/complaintsDetail/index', url: '/pages/complaintsDetail/index',
}); });
// }, 1500) }, 1500)
// }, 30) }, 30)
}, },
uploadImage(path) { uploadImage(path) {
return new Promise((resolve, reject)=> { return new Promise((resolve, reject)=> {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<view class="page"> <view class="page">
<view class="complaints"> <view class="complaints">
<view class="information"> <view class="information">
<view class="title">{{complaintsDetail.complaintThem || ''}}</view> <view class="title">{{complaintsDetail.complaintTheme || ''}}</view>
<view class="content"> <view class="content">
<view class="item"> <view class="item">
<view class="name">投诉人</view> <view class="name">投诉人</view>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
data() { data() {
return { return {
complaintsDetail: { complaintsDetail: {
complaintThem: '', complaintTheme: '',
userName: '', userName: '',
userPhone: '', userPhone: '',
problemDesc: '', problemDesc: '',
......
差异被折叠。
<template> <template>
<view class="container"> <view class="container">
<view class="page"> <view class="page">
<view class="maintenance"> <view class="maintenance" v-if="maintenanceList.length !== 0">
<view class="information" v-for="item in maintenanceList" :key="item.id" @click="onDetail(item.id)"> <view class="information" v-for="item in maintenanceList" :key="item.id" @click="onDetail(item.id)">
<view class="title" :class="item.color">{{item.repairTitle}}<view class="tag">{{item.statusName}}</view> <view class="title" :class="item.color">{{item.repairTitle}}<view class="tag">{{item.statusName}}</view>
</view> </view>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="information" @click="toDetails()"> <!-- <view class="information" @click="toDetails()">
<view class="title gray">浴霸不出水了<view class="tag">已评价</view><view class="tag">已完成</view> <view class="title gray">浴霸不出水了<view class="tag">已评价</view><view class="tag">已完成</view>
</view> </view>
<view class="content"> <view class="content">
...@@ -49,8 +49,9 @@ ...@@ -49,8 +49,9 @@
<view class="detail"><uni-rate :value="4" :size="20" /></view> <view class="detail"><uni-rate :value="4" :size="20" /></view>
</view> </view>
</view> </view>
</view> </view> -->
</view> </view>
<no-data :show="maintenanceList.length === 0" text="暂无报修信息"></no-data>
</view> </view>
<view class="form-submit-fixed"> <view class="form-submit-fixed">
<view class="form-submit" @click="toEditor()">维修上报</view> <view class="form-submit" @click="toEditor()">维修上报</view>
...@@ -59,32 +60,21 @@ ...@@ -59,32 +60,21 @@
</template> </template>
<script> <script>
import { import { getCommunityRepairListApi } from '@/config/api.js'
getCommunityRepairListApi, import noData from '@/components/no-data/no-data'
} from '@/config/api.js'
let statusList = { let statusList = {
waitAudit: { initiateWaitAudit: { name: '待维修', color: 'green' },
name: '待审核', waitDispatch: { name: '待维修', color: 'green' },
color: 'green' waitReceive: { name: '待维修', color: 'green' },
}, initiateRefuse: { name: '已驳回', color: 'red' },
waitDispatch: { finishRefuse: { name: '已驳回', color: 'red' },
name: '待派单', inRepair: { name: '维修中', color: 'blue' },
color: 'yellow' finishWaitAudit: { name: '维修中', color: 'blue' },
}, finishAuditPass: { name: '已完成', color: 'gray' }
inRepair: { // waitDispatch: { name: '待派单', color: 'yellow' }
name: '维修中',
color: 'blue'
},
finish: {
name: '已完成',
color: 'gray'
},
refuse: {
name: '审核驳回',
color: 'red'
}
} }
export default { export default {
components: {noData},
data() { data() {
return { return {
maintenanceList: [] maintenanceList: []
...@@ -97,7 +87,7 @@ export default { ...@@ -97,7 +87,7 @@ export default {
}); });
}, },
async getList() { async getList() {
let {result} = await getCommunityRepairListApi({ownerId: getApp().globalData.houseInfo.id}) let {result} = await getCommunityRepairListApi()
this.maintenanceList = result.records.map(item=> { this.maintenanceList = result.records.map(item=> {
return { return {
...item, ...item,
...@@ -126,13 +116,9 @@ export default { ...@@ -126,13 +116,9 @@ export default {
} }
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.page { .maintenance {
padding: 30rpx 30rpx 90rpx; padding: 30rpx 30rpx 90rpx;
background-color: #F8F6F9; background-color: #F8F6F9;
}
.maintenance {
.information { .information {
background-color: #ffffff; background-color: #ffffff;
......
...@@ -6,26 +6,26 @@ ...@@ -6,26 +6,26 @@
<uni-forms> <uni-forms>
<view class="form-item"> <view class="form-item">
<view class="form-item-fl"> <view class="form-item-fl">
<view class="asterisk">*</view>报修位置 <view class="asterisk"></view>标题
</view> </view>
<view class="form-item-fr"> <view class="form-item-fr">
<input class="form-item-tit" v-model="formData.repairAddress" focus placeholder="请输入报修位置" /> <input class="form-item-tit" v-model="formData.repairTitle" placeholder="请输入标题" />
</view> </view>
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-item-fl"> <view class="form-item-fl">
<view class="asterisk">*</view>报修物品 <view class="asterisk">*</view>报修位置
</view> </view>
<view class="form-item-fr"> <view class="form-item-fr">
<input class="form-item-tit" v-model="formData.repairArticle" placeholder="请输入报修物品" /> <input class="form-item-tit" v-model="formData.repairAddress" focus placeholder="请输入报修位置" />
</view> </view>
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-item-fl"> <view class="form-item-fl">
<view class="asterisk"></view>标题 <view class="asterisk">*</view>报修物品
</view> </view>
<view class="form-item-fr"> <view class="form-item-fr">
<input class="form-item-tit" v-model="formData.repairTitle" placeholder="请输入标题" /> <input class="form-item-tit" v-model="formData.repairArticle" placeholder="请输入报修物品" />
</view> </view>
</view> </view>
<!-- <view class="form-item"> <!-- <view class="form-item">
...@@ -87,26 +87,23 @@ ...@@ -87,26 +87,23 @@
return { return {
isPageEdit: false, isPageEdit: false,
formData: { formData: {
repairAddress: '', repairTitle: '上报小区垃圾桶太少',
repairArticle: '', repairAddress: '10栋一单元101',
repairTitle: '', repairArticle: '垃圾桶',
ownerPhone: '',
reservationTime: '', reservationTime: '',
repairDesc: '', ownerPhone: '13109890986',
repairDesc: '啥都好说SDK房价是SDK积分是',
repairPhoto: [] repairPhoto: []
}, },
} }
}, },
methods: { methods: {
async toAudit() { async toAudit() {
console.log(new Moment(this.formData.reservationTime, 'YYYY-MM-DD HH-mm'))
return
let repairPhoto = this.formData.repairPhoto.map(item=>item.url).join(',') let repairPhoto = this.formData.repairPhoto.map(item=>item.url).join(',')
if(this.isPageEdit) { // 编辑 if(this.isPageEdit) { // 编辑
let data =await editCommunityRepairApi({ let data = await editCommunityRepairApi({
...this.formData, ...this.formData,
repairPhoto, repairPhoto
ownerId: getApp().globalData.houseInfo.id
}) })
// getApp().globalData.maintenanceInfo = { // getApp().globalData.maintenanceInfo = {
// ...this.formData, // ...this.formData,
...@@ -126,10 +123,9 @@ ...@@ -126,10 +123,9 @@
// }, 1500) // }, 1500)
// }, 30) // }, 30)
} else { } else {
let data =await addCommunityRepairApi({ let data = await addCommunityRepairApi({
...this.formData, ...this.formData,
repairPhoto, repairPhoto
ownerId: getApp().globalData.houseInfo.id
}) })
// getApp().globalData.maintenanceInfo = { // getApp().globalData.maintenanceInfo = {
// ...this.formData, // ...this.formData,
......
<template> <template>
<view class="container"> <view class="container">
<view class="page"> <view class="page">
<view class="user" style="background-image: url('../../static/images/bg_mine.png');"> <!-- <view class="user" style="background-image: url('../../static/images/bg_mine.png');"> -->
<view class="user">
<image src="../../static/images/img01.png" class="icon"></image> <image src="../../static/images/img01.png" class="icon"></image>
<view class="name">林二</view> <view class="name">{{userName}}</view>
<view class="phone">15245214563</view> <view class="phone">{{userPhone}}</view>
</view> </view>
<view class="service"> <view class="service">
<view class="item" @click="quickEntry(1)"> <view class="item" @click="quickEntry(1)">
...@@ -49,14 +50,14 @@ ...@@ -49,14 +50,14 @@
</view> </view>
<image src="../../static/images/icon_more.png" class="arrow"></image> <image src="../../static/images/icon_more.png" class="arrow"></image>
</view> </view>
<view class="item" @click="quickEntry(7)"> <view v-if="isUser && userType === '2'" class="item" @click="quickEntry(7)">
<view class="left"> <view class="left">
<image src="../../static/images/user07.png" class="icon"></image> <image src="../../static/images/user07.png" class="icon"></image>
<div class="title">切换物业公司</div> <div class="title">切换业主</div>
</view> </view>
<image src="../../static/images/icon_more.png" class="arrow"></image> <image src="../../static/images/icon_more.png" class="arrow"></image>
</view> </view>
<view class="item" @click="quickEntry(8)"> <view v-if="isEmployee && userType === '1'" class="item" @click="quickEntry(8)">
<view class="left"> <view class="left">
<image src="../../static/images/user08.png" class="icon"></image> <image src="../../static/images/user08.png" class="icon"></image>
<div class="title">维修员</div> <div class="title">维修员</div>
...@@ -72,7 +73,17 @@ ...@@ -72,7 +73,17 @@
export default { export default {
data() { data() {
return { return {
userType: '0',
userName: '',
userPhone: '',
}
},
computed: {
isUser() {
return !!uni.getStorageSync('user_house_list')
},
isEmployee() {
return !!uni.getStorageSync('employee_house_list')
} }
}, },
methods: { methods: {
...@@ -105,14 +116,50 @@ ...@@ -105,14 +116,50 @@
url: '/pages/myReceipt/index', url: '/pages/myReceipt/index',
}); });
} else if (type == 7) { } else if (type == 7) {
uni.navigateTo({ const that = this
url: '/pages/community/index', uni.showModal({
title: '提示',
content: '确认切换到业主吗?',
success: function (res) {
if (res.confirm) {
that.onChangeEmployee('1')
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
} else {
const that = this
uni.showModal({
title: '提示',
content: '确认切换到维修员吗?',
success: function (res) {
if (res.confirm) {
that.onChangeEmployee('2')
} else if (res.cancel) {
console.log('用户点击取消');
}
}
}); });
} }
}, },
onChangeEmployee(type) {
let data = JSON.parse(uni.getStorageSync('employee_house_list'))
uni.setStorageSync('platform_code', data[0].platformCode)
uni.setStorageSync('user_type', type)
uni.reLaunch({
url: '/pages/home/index'
})
}
}, },
onLoad() { onLoad() {
this.userType = uni.getStorageSync('user_type')
this.userPhone = uni.getStorageSync('user_phone')
if(this.userType === '1') {
this.userName = uni.getStorageSync('user_name')
} else {
this.userName = uni.getStorageSync('employee_name')
}
}, },
onShow() { onShow() {
...@@ -130,6 +177,7 @@ ...@@ -130,6 +177,7 @@
} }
.user { .user {
background-image: url('http://192.168.0.118:9999/sys/common/static/scott/pic/bg_mine_1686729855474.png');
background-position: top center; background-position: top center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: cover; background-size: cover;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论