water_sh/components/reportHome/index.js

109 lines
2.1 KiB
JavaScript
Raw Permalink 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.

// components/repair/index.js
var myRequest = require("../../utils/api.js");
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
//工单状态1待接单 2待签到 3待反馈 4待完工 5待结算 6已完成
data: {
list: [],
// 是否显示加载更多的loading
showLoading: false,
isTriggered:false,
orderStatus: {
1: {
label: '待接单',
type: 'warning'
},
2: {
label: '已接单',
type: 'warning'
},
3: {
label: '待维修',
type: 'warning'
},
4: {
label: '待评价',
type: 'warning'
},
5: {
label: '待结算',
type: 'warning'
},
6: {
label: '已完成',
type: 'success'
},
}
},
attached() {
this.getlist()
},
/**
* 组件的方法列表
*/
methods: {
// 刷新函数
refresh: function () {
// 请求数据
this.getlist();
},
// 加载更多函数
loadMore: function () {
// 判断是否正在加载
if (this.data.showLoading ) {
return;
}
// 显示加载更多的loading
this.setData({
showLoading: true
});
// 请求数据
this.getlist();
},
addReport() {
wx.navigateTo({
url: '../../pages/report/index',
})
},
itemDetail(e) {
console.log(e)
let data = e.currentTarget.dataset.item
wx.navigateTo({
url: '../../pages/customFlow/index?orderId=' + data.orderId,
})
},
getlist() {
myRequest.myRequest('deviceRepairOrder/customer/list', {
createBy: wx.getStorageSync('userInfo').createBy,
isAsc: 'desc',
orderByColumn: 'createTime'
}, 'get').then(res => {
console.log('1111')
wx.stopPullDownRefresh();
this.setData({
list: res.rows,
isTriggered:false,
showLoading: false
})
})
}
}
})