progress.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. const _Http = getApp().globalData.http;
  2. Page({
  3. data: {
  4. type: "default",
  5. "id": 2026020515100102,
  6. "content": {
  7. "nocache": true,
  8. "pageNumber": 1,
  9. "pageSize": 20,
  10. "isManage": false, //服务申请管理,申请单管理 是传 true
  11. "where": {
  12. "condition": "",
  13. }
  14. },
  15. tabColorS: {
  16. 售前: {
  17. bgColor: "#E1EAFE",
  18. color: "#3874F6"
  19. },
  20. 售中: {
  21. bgColor: "#FEF0E1",
  22. color: "#F69E38"
  23. },
  24. 售后: {
  25. bgColor: "#FCE4E4",
  26. color: "#ED4949"
  27. },
  28. 紧急: {
  29. bgColor: "#FCE4E4",
  30. color: "#ED4949"
  31. },
  32. 历史售后: {
  33. bgColor: "#eeeeee",
  34. color: "#888888"
  35. }
  36. },
  37. filtratelist: []
  38. },
  39. async onLoad(options) {
  40. getApp().globalData.Language.getLanguagePackage(this, '进度');
  41. this.getList()
  42. },
  43. getList(init = false) {
  44. _Http.init(this.data.content, init).then(content => {
  45. _Http.basic({
  46. id: this.data.id,
  47. content
  48. }).then(res => {
  49. console.log("服务申请单列表", res)
  50. this.selectComponent('#ListBox').RefreshToComplete();
  51. if (res.code != '1') return wx.showToast({
  52. title: res.msg,
  53. icon: "none"
  54. })
  55. this.setData({
  56. content: _Http.paging(content, res),
  57. list: res.pageNumber == 1 ? res.data : this.data.list.concat(res.data)
  58. })
  59. })
  60. })
  61. },
  62. /* 开始搜索 */
  63. startSearch({
  64. detail
  65. }) {
  66. let condition = this.data.content ? this.data.content.where.condition : this.data.params.content.where.condition;
  67. if (detail == condition) return;
  68. this.setData({
  69. 'content.where.condition': detail,
  70. 'params.content.where.condition': detail
  71. });
  72. this.getList(true);
  73. },
  74. /* 取消搜索 */
  75. onClear() {
  76. this.setData({
  77. 'content.where.condition': "",
  78. 'params.content.where.condition': ""
  79. });
  80. this.getList(true);
  81. },
  82. onChangeTab({
  83. detail
  84. }) {
  85. this.setData({
  86. 'content.where.status': [detail.title]
  87. })
  88. this.getList(true)
  89. },
  90. })