list modify done

This commit is contained in:
unknown 2020-03-24 00:37:04 +08:00
parent e9d69ada1d
commit 2479b19629

View File

@ -13,14 +13,32 @@
<view class="margin-top" v-if="state=='10001'"> <view class="margin-top" v-if="state=='10001'">
<view class="cu-list menu-avatar"> <view class="cu-list menu-avatar">
<view class="cu-item arrow" v-for="(item,index) in myOrders" :key="index" @tap="_toAuditComplaintOrder(item)"> <view class="cu-item arrow" v-for="(item,index) in myOrders" :key="index" @tap="_toModifyMyOrder(item)">
<view class="cu-avatar round lg" :style="'background-image:url('+orderImg+');'"> <view class="cu-avatar round lg" :style="'background-image:url('+orderImg+');'">
</view> </view>
<view class="content"> <view class="content">
<view class="text-grey">{{item.complaintId}}</view> <view class="text-grey">{{item.repairId}}</view>
<view class="text-gray text-sm flex"> <view class="text-gray text-sm flex">
<view class="text-cut"> <view class="text-cut">
{{item.complaintName}} {{item.repairTypeName}}
</view> </view>
</view>
<view class="action">
<view class="text-grey text-xs">{{item.createTime}}</view>
</view>
</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="_toModifyHistoryOrder(item)">
<view class="cu-avatar round lg" :style="'background-image:url('+orderImg+');'">
</view>
<view class="content">
<view class="text-grey">{{item.repairId}}</view>
<view class="text-gray text-sm flex">
<view class="text-cut">
{{item.repairTypeName}}
</view> </view> </view> </view>
</view> </view>
<view class="action"> <view class="action">
@ -39,7 +57,8 @@
return { return {
state:'10001', state:'10001',
orderImg:this.java110Constant.url.baseUrl + 'img/order.png', orderImg:this.java110Constant.url.baseUrl + 'img/order.png',
myOrders:[] myOrders:[],
orders:[]
} }
}, },
methods: { methods: {
@ -51,19 +70,22 @@
this._loadMyModify(); this._loadMyModify();
} }
}, },
__loadMyModify:function(){ _loadMyModify:function(){
//
let _that = this; let _that = this;
let _userInfo = this.java110Context.getUserInfo(); let _userInfo = this.java110Context.getUserInfo();
let storeId = _userInfo.storeId; let storeId = _userInfo.storeId;
let _objData = { let _objData = {
page: 1, page: 1,
row: 15, row: 15,
storeId: storeId, // storeId: storeId,
userId: _userInfo.userId, // userId: _userInfo.userId,
// process:'AUDIT',
communityId:_that.java110Context.getCurrentCommunity().communityId communityId:_that.java110Context.getCurrentCommunity().communityId
}; };
this.java110Context.request({ this.java110Context.request({
url: _that.java110Constant.url.listComplaints, url: _that.java110Constant.url.listOwnerRepairs,
header: _that.java110Context.getHeaders(), header: _that.java110Context.getHeaders(),
method: "GET", method: "GET",
data: _objData, // data: _objData, //
@ -76,15 +98,19 @@
}); });
return; return;
} }
console.debug("res.data=",res.data);
let _data = res.data; let _data = res.data;
_that.myOrders = _data.complaints; _that.myOrders = [];
_data.ownerRepairs.forEach(function(item){
_data.complaints.forEach(function(item){ let dateStr = item.appointmentTime;
let dateStr = item.createTime; let _startTime = dateStr.replace(/\-/g, "/")
console.log(dateStr); let _date=new Date(_startTime);
let _date=new Date(dateStr);
item.createTime = (_date.getMonth()+1) +'-'+_date.getDate(); item.createTime = (_date.getMonth()+1) +'-'+_date.getDate();
if (item.state == "1100"){
_that.myOrders.push(item);
}
}); });
// _that.orders = _data.ownerRepairs;
}, },
fail: function(e) { fail: function(e) {
wx.showToast({ wx.showToast({
@ -125,13 +151,17 @@
} }
console.debug("res.data=",res.data); console.debug("res.data=",res.data);
let _data = res.data; let _data = res.data;
_data.complaints.forEach(function(item){ _that.orders = [];
let dateStr = item.createTime; _data.ownerRepairs.forEach(function(item){
let dateStr = item.appointmentTime;
let _startTime = dateStr.replace(/\-/g, "/") let _startTime = dateStr.replace(/\-/g, "/")
let _date=new Date(_startTime); let _date=new Date(_startTime);
item.createTime = (_date.getMonth()+1) +'-'+_date.getDate(); item.createTime = (_date.getMonth()+1) +'-'+_date.getDate();
if (item.state == "1200"){
_that.orders.push(item);
}
}); });
_that.orders = _data.complaints; // _that.orders = _data.ownerRepairs;
}, },
fail: function(e) { fail: function(e) {
wx.showToast({ wx.showToast({
@ -142,14 +172,14 @@
} }
}); });
}, },
_toAuditComplaintOrder:function(_item){ _toModifyMyOrder:function(_item){
console.log('_item',_item); console.log('_item',_item);
wx.setStorageSync("_auditComplaint_"+_item.complaintId, _item); wx.setStorageSync("_auditComplaint_"+_item.complaintId, _item);
uni.navigateTo({ uni.navigateTo({
url:"/pages/auditComplaintOrder/auditComplaintOrder?complaintId="+_item.complaintId url:"/pages/auditComplaintOrder/auditComplaintOrder?complaintId="+_item.complaintId
}); });
}, },
_toAuditComplaintHistoryOrder:function(_item){ _toModifyHistoryOrder:function(_item){
console.log('_item',_item); console.log('_item',_item);
uni.setStorageSync("_complaintOrderDetail_"+_item.complaintId, _item); uni.setStorageSync("_complaintOrderDetail_"+_item.complaintId, _item);
uni.navigateTo({ uni.navigateTo({