hz-zhhq-app/pages/malfunc-check/repair-record-wb.vue

830 lines
24 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="hzIndex">
<hzHeader title="维保管理"></hzHeader>
<view class="container hzContent">
<view class="main">
<view class="tab-box">
<view class="tab-item" :class="currentTabIndex == 0 ? 'active_tab' : ''"
@click="currentTabIndex = 0">待审核<view class="tabBottom" v-if="currentTabIndex == 0"></view>
</view>
<view class="tab-item" :class="currentTabIndex == 1 ? 'active_tab' : ''"
@click="currentTabIndex = 1">未通过<view class="tabBottom" v-if="currentTabIndex == 1"></view>
</view>
<view class="tab-item" :class="currentTabIndex == 2 ? 'active_tab' : ''"
@click="currentTabIndex = 2">已通过<view class="tabBottom" v-if="currentTabIndex == 2"></view>
</view>
</view>
<view class="search-box">
<view>
<lb-picker ref="picker1" v-model="repairCheckValue" mode="multiSelector" :props="myProps"
:list="repairItems" :level="2" :dataset="{ name: 'repairCheckName' }"
@confirm="handleConfirm">
</lb-picker>
</view>
<view class="form-item searchv">
<picker class="time-data" mode="date" @change="startDateChange">
<view class="">{{ startDate }}</view>
</picker>
<text class="timecenter">至</text>
<picker class="time-data" mode="date" @change="endDateChange">
<view class="">{{ endDate }}</view>
</picker>
<!-- <view class="search" style="height: 60upx;font-size: 26upx;margin-top: 7upx;" @click="searchYjList">搜索</view> -->
<!-- <image style="width: 5vh;height: 5vh;margin-left: 1vh;" @click="search" src="/static/icons/seach.png" mode=""></image>
-->
</view>
</view>
<view class="reservation-box" v-if="currentTabIndex == 0">
<view class="list-box" v-if="repair0.length > 0">
<view class="detail-box" v-for="(item, index) in repair0" :key="index">
<!-- @click="details(item)" -->
<view class="detail_header" @click="details(item)">
<image class="blueSign" src="@/static/haircut/bx.png" mode=""></image>
<text class="font-tilte" v-if="item.is_inspection==2">维保服务</text>
<text class="font-tilte" v-if="item.is_inspection==3">专项服务</text>
<text class="font-result"
style="background: #FFEFE3;color: #FB8107;">未审核</text><!-- statusred -->
</view>
<view class="detail_msg">
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保项目:</text>
<text v-if="item.is_inspection==3">服务项目:</text>
<text class="infoSpan">{{ item.repair_option_name}}</text>
</view>
<view v-if="item.repair_option_sub_name" class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保小项:</text>
<text v-if="item.is_inspection==3">服务小项:</text>
<text class="infoSpan">{{ item.repair_option_sub_name}}</text>
</view>
<view v-if="item.is_inspection==2&&item.repair_option_sub_name=='电梯维保'"
class="info-item" @click="details(item)">
<text>设备编号:</text>
<text class="infoSpan">{{ item.elevator_no}}</text>
</view>
<view v-if="item.is_inspection==2&&item.repair_option_sub_name=='电梯维保'"
class="info-item" @click="details(item)">
<text>设备位置:</text>
<text class="infoSpan">{{ item.repair_floor}}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保区域: </text>
<text v-if="item.is_inspection==3">服务区域: </text>
<text class="infoSpan">{{ item.repair_place }}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保类型: </text>
<text v-if="item.is_inspection==3">服务类型: </text>
<text class="infoSpan">{{ item.wb_types}}</text>
</view>
<view v-if="item.fault_detail" class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保内容: </text>
<text v-if="item.is_inspection==3">服务内容: </text>
<text class="infoSpan">{{item.fault_detail}}</text>
</view>
<view v-if="item.fault_proposal" class="info-item" @click="details(item)">
<text>更换配件: </text>
<text class="infoSpan">{{ item.fault_proposal }}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保时间: </text>
<text v-if="item.is_inspection==3">服务时间: </text>
<text class="infoSpan">{{item.repair_time}}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保人员: </text>
<text v-if="item.is_inspection==3">服务人员: </text>
<text class="infoSpan">{{item.repair_person_name}}</text>
</view>
</view>
</view>
</view>
<content-none v-if="!repair0.length > 0" :padTop="20"></content-none>
</view>
<!-- 维修中 -->
<view class="reservation-box" v-if="currentTabIndex == 1">
<view class="list-box" v-if="repair1.length > 0">
<view style="position: relative;" class="detail-box" v-for="(item, index) in repair1"
:key="index">
<view v-if="item.urgent==1"
style="position: absolute;top: 40%;left: 36%;transform:rotate(-60deg);">
<image src="../../static/imgs/jiaji2.png" style="height: 150upx;width: 150upx;"></image>
</view>
<view class="detail_header">
<image class="blueSign" src="@/static/haircut/bx.png" mode=""></image>
<text class="font-tilte" v-if="item.is_inspection==2">维保服务</text>
<text class="font-tilte" v-if="item.is_inspection==3">专项服务</text>
<text class="font-result" style="color: #ff9000">未通过</text><!-- statusred -->
</view>
<view class="detail_msg">
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保项目:</text>
<text v-if="item.is_inspection==3">服务项目:</text>
<text class="infoSpan">{{ item.repair_option_name}}</text>
</view>
<view v-if="item.repair_option_sub_name" class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保小项:</text>
<text v-if="item.is_inspection==3">服务小项:</text>
<text class="infoSpan">{{ item.repair_option_sub_name}}</text>
</view>
<view v-if="item.is_inspection==2&&item.repair_option_sub_name=='电梯维保'"
class="info-item" @click="details(item)">
<text>设备编号:</text>
<text class="infoSpan">{{ item.elevator_no}}</text>
</view>
<view v-if="item.is_inspection==2&&item.repair_option_sub_name=='电梯维保'"
class="info-item" @click="details(item)">
<text>设备位置:</text>
<text class="infoSpan">{{ item.repair_floor}}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保区域: </text>
<text v-if="item.is_inspection==3">服务区域: </text>
<text class="infoSpan">{{ item.repair_place }}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保类型: </text>
<text v-if="item.is_inspection==3">服务类型: </text>
<text class="infoSpan">{{ item.wb_types}}</text>
</view>
<view v-if="item.fault_detail" class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保内容: </text>
<text v-if="item.is_inspection==3">服务内容: </text>
<text class="infoSpan">{{item.fault_detail}}</text>
</view>
<view v-if="item.fault_proposal" class="info-item" @click="details(item)">
<text>更换配件: </text>
<text class="infoSpan">{{ item.fault_proposal }}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保时间: </text>
<text v-if="item.is_inspection==3">服务时间: </text>
<text class="infoSpan">{{item.repair_time}}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保人员: </text>
<text v-if="item.is_inspection==3">服务人员: </text>
<text class="infoSpan">{{item.repair_person_name}}</text>
</view>
</view>
</view>
</view>
<content-none v-else :padTop="20"></content-none>
</view>
<!-- 已办结 -->
<view class="reservation-box" v-if="currentTabIndex == 2">
<view class="list-box" v-if="repair2.length > 0">
<view style="position: relative;" class="detail-box" v-for="(item, index) in repair2"
:key="index">
<view v-if="item.urgent==1"
style="position: absolute;top: 40%;left: 36%;transform:rotate(-60deg);">
<image src="../../static/imgs/jiaji2.png" style="height: 150upx;width: 150upx;"></image>
</view>
<view class="detail_header">
<image class="blueSign" src="@/static/haircut/bx.png" mode=""></image>
<text class="font-tilte" v-if="item.is_inspection==2">维保服务</text>
<text class="font-tilte" v-if="item.is_inspection==3">专项服务</text>
<text class="font-result">已通过</text><!-- statusred -->
</view>
<view class="detail_msg">
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保项目:</text>
<text v-if="item.is_inspection==3">服务项目:</text>
<text class="infoSpan">{{ item.repair_option_name}}</text>
</view>
<view v-if="item.repair_option_sub_name" class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保小项:</text>
<text v-if="item.is_inspection==3">服务小项:</text>
<text class="infoSpan">{{ item.repair_option_sub_name}}</text>
</view>
<view v-if="item.is_inspection==2&&item.repair_option_sub_name=='电梯维保'"
class="info-item" @click="details(item)">
<text>设备编号:</text>
<text class="infoSpan">{{ item.elevator_no}}</text>
</view>
<view v-if="item.is_inspection==2&&item.repair_option_sub_name=='电梯维保'"
class="info-item" @click="details(item)">
<text>设备位置:</text>
<text class="infoSpan">{{ item.repair_floor}}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保区域: </text>
<text v-if="item.is_inspection==3">服务区域: </text>
<text class="infoSpan">{{ item.repair_place }}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保类型: </text>
<text v-if="item.is_inspection==3">服务类型: </text>
<text class="infoSpan">{{ item.wb_types}}</text>
</view>
<view v-if="item.fault_detail" class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保内容: </text>
<text v-if="item.is_inspection==3">服务内容: </text>
<text class="infoSpan">{{item.fault_detail}}</text>
</view>
<view v-if="item.fault_proposal" class="info-item" @click="details(item)">
<text>更换配件: </text>
<text class="infoSpan">{{ item.fault_proposal }}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保时间: </text>
<text v-if="item.is_inspection==3">服务时间: </text>
<text class="infoSpan">{{item.repair_time}}</text>
</view>
<view class="info-item" @click="details(item)">
<text v-if="item.is_inspection==2">维保人员: </text>
<text v-if="item.is_inspection==3">服务人员: </text>
<text class="infoSpan">{{item.repair_person_name}}</text>
</view>
</view>
</view>
</view>
<content-none v-else :padTop="20"></content-none>
</view>
<load-more v-if="currentTabIndex == 0" :loadingType="loadingType0"
:contentText="contentText"></load-more>
<load-more v-if="currentTabIndex == 1" :loadingType="loadingType1"
:contentText="contentText"></load-more>
<load-more v-if="currentTabIndex == 2" :loadingType="loadingType2"
:contentText="contentText"></load-more>
</view>
</view>
</view>
</template>
<script>
import {
getDate,
alertTip,
callbackRequest,
getStorage,
regPhone,
formatDate
} from '@/common/util.js';
import {
getAllDept,
getFaultListByReply,
submitUrgent
} from '@/common/api.js';
import loadMore from '@/components/loadMore.vue';
import contentNone from '@/components/contentNone.vue';
export default {
data() {
return {
page1: 1,
pageSize1: 10,
loadingType1: 0, //0-loading前1-loading中2-没有更多了
page2: 1,
pageSize2: 10,
loadingType2: 0, //0-loading前1-loading中2-没有更多了
page0: 1,
pageSize0: 10,
loadingType0: 0, //0-loading前1-loading中2-没有更多了
contentText: {
contentdown: '上拉加载更多',
contentrefresh: '正在加载...',
contentnomore: '没有更多数据了'
},
userId: getStorage('userInfo').id,
currentTabIndex: 0,
deptList: [], //部门列表
departmentIndex: 0, //选择的部门下标
formatDate: formatDate,
repair0: [],
repair1: [],
repair2: [],
pageTitle: ['报修', '报事'],
faultType: 0,
startDate: this.getDay(-7),
endDate: this.getDay(0),
};
},
components: {
loadMore,
contentNone
},
onLoad(option) {
this.currentTabIndex = option.currentTabIndex || 0;
this.faultType = option.faultType || 0;
},
onShow() {
if (this.currentTabIndex == 0) {
this.page0 = 1;
this.loadingType0 = 0;
this.initData();
} else if (this.currentTabIndex == 1) {
this.page1 = 1;
this.loadingType1 = 0;
this.initData();
} else if (this.currentTabIndex == 2) {
this.page2 = 1;
this.loadingType2 = 0;
this.initData();
}
},
watch: {
currentTabIndex: function(newVal, oldVal) {
if (newVal == 0) {
this.page0 = 1;
this.loadingType0 = 0;
this.initData();
} else if (newVal == 1) {
this.page1 = 1;
this.loadingType1 = 0;
this.initData();
} else if (newVal == 2) {
this.page2 = 1;
this.loadingType2 = 0;
this.initData();
}
}
},
methods: {
initData() {
let params = {};
if (this.currentTabIndex == 0) {
params = {
method: getFaultListByReply,
data: {
userId: this.userId,
replyFlag: "0",
pageNum: this.page0,
pageSize: this.pageSize0,
isInspection: 2,
startDate: this.startDate,
endDate: this.endDate
}
};
} else if (this.currentTabIndex == 1) {
params = {
method: getFaultListByReply,
data: {
userId: this.userId,
replyFlag: "1",
pageNum: this.page1,
pageSize: this.pageSize1,
isInspection: 2,
startDate: this.startDate,
endDate: this.endDate
}
};
} else if (this.currentTabIndex == 2) {
params = {
method: getFaultListByReply,
data: {
userId: this.userId,
replyFlag: "2",
pageNum: this.page2,
pageSize: this.pageSize2,
isInspection: 2,
startDate: this.startDate,
endDate: this.endDate
}
};
}
callbackRequest(params).then(res => {
res = res.data;
if (res.returnCode == 1) {
if (this.currentTabIndex == 0) {
if (this.page0 == 1) {
this.repair0 = res.returnData || [];
} else {
if (res.returnData.length > 0) {
this.repair0 = this.repair0.concat(res.returnData);
this.loadingType0 = 0;
} else {
this.loadingType0 = 2;
}
}
} else if (this.currentTabIndex == 1) {
if (this.page1 == 1) {
this.repair1 = res.returnData || [];
} else {
if (res.returnData.length > 0) {
this.repair1 = this.repair1.concat(res.returnData);
this.loadingType1 = 0;
} else {
this.loadingType1 = 2;
}
}
} else if (this.currentTabIndex == 2) {
if (this.page2 == 1) {
this.repair2 = res.returnData || [];
} else {
if (res.returnData.length > 0) {
this.repair2 = this.repair2.concat(res.returnData);
this.loadingType2 = 0;
} else {
this.loadingType2 = 2;
}
}
}
} else {
alertTip(res.returnMsg);
}
});
},
details: function(item) {
uni.navigateTo({
url: 'repair-details-wb?id=' + item.id
});
},
submitUrgent(item) {
let params = {
method: submitUrgent,
data: {
userId: this.userId,
id: item.id
}
};
callbackRequest(params).then(res => {
res = res.data;
if (res.returnCode == 1) {
var items = this.repair0;
for (var i = 0, lenI = items.length; i < lenI; ++i) {
const obj = items[i];
if (item.id == obj.id) {
this.$set(obj, 'urgent', 1);
}
}
alertTip(res.returnMsg);
} else {
alertTip(res.returnMsg);
}
});
},
startDateChange: function(e) {
// this.page = 1;
// this.loadingType = 0;
// this.repair=[];
this.startDate = e.target.value;
// this.dataList();
if (this.currentTabIndex == 0) {
this.page0 = 1;
this.loadingType0 = 0;
this.initData();
} else if (this.currentTabIndex == 1) {
this.page1 = 1;
this.loadingType1 = 0;
this.initData();
} else if (this.currentTabIndex == 2) {
this.page2 = 1;
this.loadingType2 = 0;
this.initData();
}
},
endDateChange: function(e) {
// this.page = 1;
// this.loadingType = 0;
// this.repair=[];
this.endDate = e.target.value;
// this.dataList();
if (this.currentTabIndex == 0) {
this.page0 = 1;
this.loadingType0 = 0;
this.initData();
} else if (this.currentTabIndex == 1) {
this.page1 = 1;
this.loadingType1 = 0;
this.initData();
} else if (this.currentTabIndex == 2) {
this.page2 = 1;
this.loadingType2 = 0;
this.initData();
}
},
getDay(i) {
var date1 = new Date(new Date().getTime() + i * 24 * 60 * 60 * 1000);
var year = date1.getFullYear();
var month = date1.getMonth() + 1;
if (month < 10) {
month = "0" + month;
}
var day = date1.getDate();
if (day < 10) {
day = "0" + day;
}
return year + '-' + month + '-' + day;
}
},
onReachBottom() {
if (this.currentTabIndex == 0) {
if (this.loadingType0 !== 0) {
return;
}
this.loadingType0 = 1;
this.page0 = this.page0 + 1;
this.initData();
} else if (this.currentTabIndex == 1) {
if (this.loadingType1 !== 0) {
return;
}
this.loadingType1 = 1;
this.page1 = this.page1 + 1;
this.initData();
} else if (this.currentTabIndex == 2) {
if (this.loadingType2 !== 0) {
return;
}
this.loadingType2 = 1;
this.page2 = this.page2 + 1;
this.initData();
}
}
};
</script>
<style lang="scss">
// @import '@/static/css/common.scss';
.search-box {
margin: 0 24upx;
margin-top: 36upx;
padding: 24upx;
background-color: #fff;
border-radius: 20upx;
}
.searchv {
text-align: center;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.timecenter {
display: inline-block;
font-size: 24upx;
margin-left: 10upx;
margin-right: 10upx;
color: #555555;
line-height: 30upx;
// margin-top: 15upx;
}
.time-data {
width: 300upx;
height: 60upx;
font-size: 28upx;
display: inline-block;
border: 1px solid #0DB0A7;
border-radius: 8upx;
color: #555555;
line-height: 60upx;
}
.tj-box {
margin-top: 28upx;
display: flex;
flex-direction: row;
align-items: center;
}
.container {
margin-top: 150upx;
.banner-box {
width: 100%;
height: 240upx;
position: absolute;
top: 0;
left: 0;
image {
width: 100%;
height: 100%;
}
}
.main {
.tab-box {
// width: 100%;
display: flex;
justify-content: space-around;
font-size: 32upx;
color: #555555;
// margin: 0 24upx;
.active_tab {
font-weight: 800;
}
.tab-item {
// width: 33%;
.tabBottom {
width: 80%;
height: 6upx;
border-radius: 5px;
background: linear-gradient(90deg, #64E182 0%, #1CA7B2 100%);
margin: 0 auto;
}
}
}
.form-box {
padding: 20upx 30upx 0upx;
margin-bottom: 20upx;
background: #fff;
.form-item {
overflow: hidden;
border-bottom: 1px solid #eee;
padding: 30upx 0;
.label {
float: left;
width: 150upx;
font-size: 28upx;
color: #333;
font-weight: bold;
line-height: 50upx;
}
.ipt-box {
margin-left: 160upx;
input {
width: 100%;
height: 50upx;
line-height: 50upx;
font-size: 26upx;
color: #666;
}
.pic {
width: 60upx;
height: 60upx;
line-height: 80upx;
}
}
.select {
.arrow {
float: right;
width: 16upx;
height: 29upx;
margin-top: 10upx;
}
input {
width: 70%;
}
}
.jian {
width: 50upx;
height: 50upx;
margin-left: 280upx;
}
.select {
.arrow {
float: right;
width: 16upx;
height: 29upx;
margin-top: 10upx;
}
.picker {
height: 50upx;
line-height: 50upx;
font-size: 26upx;
color: #666;
}
}
}
.sure-btn {
width: 100%;
height: 80upx;
font-size: 28upx;
color: #fff;
text-align: center;
line-height: 80upx;
border-radius: 8upx;
background: #0066cc;
background: linear-gradient(to right, #ffc200, #ff9000);
/*设置按钮为渐变颜色*/
margin-top: 50upx;
}
}
.reservation-box {
margin: 24upx;
.list-box {
margin-top: 24upx;
.detail-box {
// margin-top: 10upx;
margin-bottom: 24upx;
background: #ffffff;
border-radius: 20upx;
padding: 24upx;
}
.detail_header {
padding: 15upx 0upx;
border-bottom: 1px solid #eee;
display: flex;
flex-direction: row;
align-items: center;
position: relative;
}
.detail_header .blueSign {
width: 48upx;
height: 48upx;
}
.detail_header .font-tilte {
display: inline-block;
font-weight: bold;
font-size: 18px;
color: #333333;
margin-left: 16upx;
}
.detail_header .font-result {
display: inline-block;
position: absolute;
width: 80*2upx;
height: 28*2upx;
right: 0upx;
background: #C1EFEA;
border-radius: 15px 15px 15px 15px;
font-size: 28upx;
color: #0DB0A7;
text-align: center;
line-height: 28*2upx;
}
.detail_msg {
display: grid;
margin-top: 20upx;
}
.detail_msg .info-item {
font-size: 28upx;
color: #999999;
margin-bottom: 10upx;
font-size: 28upx;
line-height: 50upx;
text {
display: inline-block;
width: 140upx;
}
.infoSpan {
width: auto;
font-size: 28upx;
color: #666;
float: right;
}
}
// .detail_msg .info-item:nth-of-type(6) {
// padding-bottom: 24upx;
// border-bottom: 1px solid #EBEFF7;
// }
// .detail_msg .info-item:last-child {
// padding-bottom: 24upx;
// border-bottom: 0px solid #000;
// }
.comment-btn {
margin-top: 24upx;
width: 84*2upx;
height: 32*2upx;
border-radius: 16*2upx;
border: 1px solid #0DB0A7;
font-size: 28upx;
color: #0DB0A7;
line-height: 32*2upx;
text-align: center;
min-width: 140upx;
justify-self: end;
}
.bg-ccc {
border-color: #CACACA;
color: #CACACA;
background-color: #fff !important;
}
}
}
}
}
</style>