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

完成设备管理员切换

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