hz-zhhq-app/pages/malfunc-repair/repair-dispose.vue

266 lines
6.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="container">
<view v-if="repair.length > 0">
<view class="details" v-for="(item,i) in repair" :key="i" @click="details(item)">
<view class="detail_header">
<text class="blueSign"></text>
<text class="font-tilte">服务报修</text>
<text :class="item.statusCode == 11 ? 'statusgr':'statusred'">{{item.status}}</text>
</view>
<view class="detail_msg"> <!-- -->
<!-- <view class="footer-btn footer-btn-two" v-if="item.statusCode == '11' && item.person_id ">
<view class="btn btn-col1" style="width: 100%; border-radius: 10rpx;" @click="dispose()">处理完成</view>
</view> -->
<view>
<text>报修人: </text>
<text class="infoSpan">{{item.userName}}</text>
</view>
<view>
<text>报修选项: </text>
<text class="infoSpan">{{item.opt > 0 ? fixList[item.opt-1].title:''}} </text>
</view>
<view>
<text>报修位置: </text>
<text class="infoSpan">{{item.repairAddr}}</text>
</view>
<view>
<text>报修描述: </text>
<text class="infoSpan">{{item.faultDetail}}</text>
</view>
<view class="info-item">
<text class="label">报修时间: </text>
<text class="infoSpan">{{formatDate(item.apply_time, 'dateTime')}}</text>
</view>
</view>
</view>
</view>
<content-none v-else :padTop="32"></content-none>
<load-more :loadingType="loadingType" :contentText="contentText"></load-more>
</view>
</template>
<script>
import {
getDisposeList,
dispose,
} from '@/common/api.js';
import {
callbackRequest,
getStorage,
alertTip,
formatDate
} from '@/common/util.js';
import loadMore from '@/components/loadMore.vue';
import contentNone from '@/components/contentNone.vue';
export default {
components: {
loadMore,
contentNone
},
data() {
return {
formatDate:formatDate,
//分页
page: 1,
pageSize: 10,
loadingType: 0, //0-loading前1-loading中2-没有更多了
contentText: {
contentdown: "上拉加载更多",
contentrefresh: "正在加载...",
contentnomore: "没有更多数据了"
},
userInfo:getStorage("userInfo"),
repair: [
{userName:"刘晓明",repairAddr:"邮政大楼",opt:"3",faultDetail:"漏水",apply_time:"2019-09-09 09:09",status:"待处理",statusCode:"11",person_id:"1"},
{userName:"刘晓明",repairAddr:"邮政大楼",opt:"3",faultDetail:"漏电",apply_time:"2019-09-09 09:09",status:"已处理",statusCode:"12",person_id:"2"},
{userName:"刘晓明",repairAddr:"邮政大楼",opt:"3",faultDetail:"老化",apply_time:"2019-09-09 09:09",status:"已处理",statusCode:"13",person_id:"3"},
{userName:"刘晓明",repairAddr:"邮政大楼",opt:"3",faultDetail:"漏水",apply_time:"2019-09-09 09:09",status:"待处理",statusCode:"11",person_id:"4"}
],
fixList: [{
title: "空调",
more: "风系统"
},
{
title: "给排水",
more: "饮水、清洁、排水"
},
{
title: "电",
more: "照明、办公、生产"
},
{
title: "木",
more: "办公桌、椅、门等"
},
{
title: "安保",
more: "门禁、监控等"
},
{
title: "电梯",
more: "货运、人员等"
},
{
title: "消防",
more: "报警、逃生、灭火器"
},
{
title: "其它",
more: ""
},
],
}
},
onShow() {
this.page = 1;
this.loadData();
},
methods: {
details: function(item) {
uni.navigateTo({
url: 'repair-details2?item=' + encodeURIComponent(JSON.stringify(item)),
})
},
dispose: function(){
sureAlterTip('提示',"确定已修缮?",true)
.then(res =>{
if (res === 200){
let params = {
"method": dispose,
"data":{
userId: this.userInfo.id,
id: this.item.id
}
};
console.log("params:",params);
// callbackRequest(params).then(res => {
// res = res.data;
// alertTip(res.returnMsg);
// if ( res.returnCode === "1"){
// alertTip(res.returnMsg);
// // 跳回列表页
// setTimeout(function() {
// // uni.redirectTo({
// // url:'/pages/repair-record/repair-record'
// // })
// uni.navigateBack({
// delta:1
// })
// }, 1500);
// }
// })
}
})
},
loadData() {
// let cur = this;
// let params = {
// "method": getDisposeList,
// "data": {
// userId: this.userInfo.id,
// pageNum: this.page,
// pageSize: this.pageSize
// }
// };
// callbackRequest(params).then(res => {
// res = res.data;
// if (res.returnCode == "1") {
// if (cur.page == 1) {
// cur.repair = res.returnData || [];
// } else {
// if (res.returnData.length > 0) {
// cur.repair = cur.repair.concat(res.returnData);
// // console.log(cur.repair);
// this.loadingType = 0;
// } else {
// this.loadingType = 2;
// }
// }
// }
// })
}
},
onReachBottom() {
if (this.loadingType !== 0) {
return;
}
this.loadingType = 1;
this.page = this.page + 1;
this.loadData();
},
}
</script>
<style lang="scss">
@import '@/static/css/common.scss';
.nolist {
font-size: 30upx;
color: #797979;
text-align: center;
padding-top: 20upx;
}
.container {
min-height: 100vh;
background: #f8f8f8;
font-size: 28upx;
.details {
height: 400upx;
background: white;
margin: 15upx;
border-radius: 15upx;
.detail_header {
border-bottom: #f8f8f8 5upx solid;
height: 90upx;
line-height: 90upx;
margin: 15upx;
border-radius: 10upx;
.blueSign {
height: 28upx;
width: 5upx;
background: #00c277;
display: inline-block;
margin-left: 20upx;
vertical-align: middle;
}
.font-tilte {
font-weight: bold;
margin-left: 20upx;
vertical-align: middle;
}
}
.statusgr {
float: right;
margin-right: 30upx;
color: #00c277;
}
.statusred {
float: right;
margin-right: 30upx;
color: red;
}
.detail_msg {
margin-left: 20upx;
border-radius: 10upx;
view {
height: 60upx;
line-height: 60upx;
}
}
}
}
</style>