投诉待办处理

This commit is contained in:
java110 2020-07-27 14:22:44 +08:00
parent 054ecbf25d
commit 2b62df2325
2 changed files with 68 additions and 89 deletions

View File

@ -0,0 +1,25 @@
import url from '../../constant/url.js';
/**
* 查询投诉待办
* @param {Object} _that 上下文对象
* @param {Object} _data 请求报文
*/
export function loadTodoCompaint(_that,_data){
return new Promise(function(reslove,reject){
_that.context.get({
url: url.listAuditComplaints,
data:_data,
success: function(res) {
reslove(res);
},
fail: function(e) {
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
})
}
})
});
}

View File

@ -1,53 +1,32 @@
<template>
<view>
<scroll-view scroll-x class="bg-white nav" scroll-with-animation :scroll-left="scrollLeft">
<view class="flex text-center">
<view class="cu-item flex-sub" :class="state=='10001'?'text-green cur':''" @tap="_tabSelect('10001')">
待处理单
</view>
<view class="cu-item flex-sub" :class="state=='10002'?'text-green cur':''" @tap="_tabSelect('10002')">
历史单
</view>
<view v-for="(item,index) in orders" :key="index" class="bg-white margin-top margin-right-xs radius margin-left-xs padding">
<view class="flex padding-bottom-xs solid-bottom justify-between">
<view>{{item.complaintId}}</view>
<view class="text-gray">{{item.tel}}</view>
</view>
</scroll-view>
<view class="margin-top" v-if="state=='10001'">
<view class="cu-list menu-avatar">
<view class="cu-item arrow" v-for="(item,index) in auditOrders" :key="index" @tap="_toAuditComplaintOrder(item)">
<view class="cu-avatar round lg" :style="'background-image:url('+orderImg+');'">
</view>
<view class="content">
<view class="text-grey">{{item.complaintId}}</view>
<view class="text-gray text-sm flex">
<view class="text-cut">
{{item.complaintName}}
</view> </view>
</view>
<view class="action">
<view class="text-grey text-xs">{{item.createTime}}</view>
</view>
</view>
<view class="flex margin-top justify-between">
<view class="text-gray">投诉类型</view>
<view class="text-gray">{{item.typeCdName}}</view>
</view>
</view>
<view class="margin-top" v-if="state=='10002'">
<view class="cu-list menu-avatar">
<view class="cu-item arrow" v-for="(item,index) in orders" :key="index" @tap="_toAuditComplaintHistoryOrder(item)">
<view class="cu-avatar round lg" :style="'background-image:url('+orderImg+');'">
</view>
<view class="content">
<view class="text-grey">{{item.complaintId}}</view>
<view class="text-gray text-sm flex">
<view class="text-cut">
{{item.complaintName}}
</view> </view>
</view>
<view class="action">
<view class="text-grey text-xs">{{item.createTime}}</view>
</view>
</view>
<view class="flex margin-top-xs justify-between">
<view class="text-gray">投诉人</view>
<view class="text-gray">{{item.complaintName}}</view>
</view>
<view class="flex margin-top-xs justify-between">
<view class="text-gray">房间</view>
<view class="text-gray">{{item.floorNum}}{{item.unitNum}}单元{{item.roomNum}}</view>
</view>
<view class="flex margin-top-xs justify-between">
<view class="text-gray">投诉时间</view>
<view class="text-gray">{{item.createTime }}</view>
</view>
<view class="flex margin-top-xs justify-between">
<view class="text-gray">投诉内容</view>
<view class="text-gray">{{item.context}}</view>
</view>
<view class="solid-top flex justify-end margin-top padding-top-sm ">
<button class="cu-btn sm line-gray" @click="repairDetail(item)">详情</button>
</view>
</view>
@ -55,12 +34,12 @@
</template>
<script>
import {loadTodoCompaint} from '../../api/complaint/complaint.js'
export default {
data() {
return {
state: '10001',
orderImg:this.java110Constant.url.baseUrl + 'img/order.png',
auditOrders:[],
orders:[]
}
},
@ -71,17 +50,6 @@
this._loadComplaintOrder();
},
methods: {
_tabSelect: function(_state) {
this.state = _state;
if(_state == '10002'){
this._loadOrder();
}else{
this._loadComplaintOrder();
}
},
_loadComplaintOrder:function(){
//
let _that = this;
@ -95,39 +63,25 @@
communityId:_that.java110Context.getCurrentCommunity().communityId
};
this.java110Context.request({
url: _that.java110Constant.url.listAuditComplaints,
header: _that.java110Context.getHeaders(),
method: "GET",
data: _objData, //
success: function(res) {
console.log("请求返回信息:", res);
if (res.statusCode != 200) {
uni.showToast({
icon:'none',
title:res.data
});
return;
}
let _data = res.data;
_that.auditOrders = _data.complaints;
_data.complaints.forEach(function(item){
let dateStr = item.createTime;
let _startTime = dateStr.replace(/\-/g, "/")
let _date=new Date(_startTime);
item.createTime = (_date.getMonth()+1) +'-'+_date.getDate();
});
},
fail: function(e) {
wx.showToast({
title: "服务器异常了",
icon: 'none',
duration: 2000
loadTodoCompaint(this,_objData)
.then(function(res){
console.log("请求返回信息:", res);
if (res.statusCode != 200) {
uni.showToast({
icon:'none',
title:res.data
});
return;
}
});
let _data = res.data;
_that.orders = _data.complaints;
_that.orders.forEach(function(item){
let dateStr = item.createTime;
let _startTime = dateStr.replace(/\-/g, "/")
let _date=new Date(_startTime);
item.createTime = (_date.getMonth()+1) +'-'+_date.getDate();
});
})
},
_loadOrder:function(){
//