zhenggaijindu.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. import http from '../../base/httputil'
  2. const app = getApp()
  3. Page({
  4. onLoad(e) {
  5. this.setData({
  6. buslogId: e.buslogId,
  7. busInspectionId: e.busInspectionId
  8. })
  9. this.getZhenggaijindu(e.busInspectionId)
  10. },
  11. getZhenggaijindu(busInspectionId) {
  12. let obj = new Object();
  13. obj.busInspectionId = busInspectionId
  14. http.post("/system/AppZhenggaijinduController/getZhenggaijindu", obj, this.getZhenggaijinduSuccess);
  15. },
  16. getZhenggaijinduSuccess(res) {
  17. console.log("******jindu", res)
  18. this.data.pictureBasePath = res.pictureBasePath
  19. this.setData({
  20. pictureBasePath: res.pictureBasePath,
  21. zgjdList: res.zgjdList
  22. })
  23. },
  24. bindPickerChange: function (e) {
  25. //let nume=e.detail.value
  26. console.log('picker发送选择改变,携带值为',parseInt(nume)+1)
  27. let obj = new Object();
  28. obj.busInspectionId = this.data.busInspectionId
  29. obj.logId = this.data.buslogId
  30. obj.lat_day = parseInt(nume)+1
  31. http.send_post("/system/AppXunjianController/changeInspection", obj, this.getChangeSuccess);
  32. },
  33. getChangeSuccess(res) {
  34. console.log("&&&&", res)
  35. if (res.code == 200) {
  36. this.setData({
  37. index: e.detail.value,
  38. // isRefreshUP: true
  39. })
  40. this.getZhenggaijindu(this.data.busInspectionId)
  41. }
  42. },
  43. getChangeSuccess2(res) {
  44. console.log("&&&&", res)
  45. if (res.code == 200) {
  46. this.setData({
  47. //index: e.detail.value,
  48. isRefreshUP: true
  49. })
  50. this.getZhenggaijindu(this.data.busInspectionId)
  51. }
  52. },
  53. /**
  54. * 页面的初始数据
  55. */
  56. data: {
  57. host: app.globalData.host,
  58. pictureBasePath: null,
  59. zgjdList: null,
  60. isRefreshUP: false,
  61. buslogId: '',
  62. busInspectionId: '',
  63. processData: [{
  64. name: '提交工单',
  65. start: '#fff',
  66. end: '#EFF3F6',
  67. icon: '../../img/process_1.png'
  68. },
  69. {
  70. name: '已接单',
  71. start: '#EFF3F6',
  72. end: '#EFF3F6',
  73. icon: '../../img/process_1.png'
  74. },
  75. {
  76. name: '开始维修',
  77. start: '#EFF3F6',
  78. end: '#EFF3F6',
  79. icon: '../../img/process_1.png'
  80. },
  81. {
  82. name: '维修结束',
  83. start: '#EFF3F6',
  84. end: '#EFF3F6',
  85. icon: '../../img/process_1.png'
  86. },
  87. {
  88. name: '已确认',
  89. start: '#EFF3F6',
  90. end: '#fff',
  91. icon: '../../img/process_1.png'
  92. }
  93. ],
  94. array: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30'],
  95. index: 0,
  96. },
  97. //进度条的状态
  98. setPeocessIcon: function () {
  99. var index = 0 //记录状态为1的最后的位置
  100. var processArr = this.data.processData
  101. // console.log("progress", this.data.detailData.progress)
  102. for (var i = 0; i < this.data.detailData.progress.length; i++) {
  103. var item = this.data.detailData.progress[i]
  104. processArr[i].name = item.word
  105. if (item.state == 1) {
  106. index = i
  107. processArr[i].icon = "../../img/process_3.png"
  108. processArr[i].start = "#45B2FE"
  109. processArr[i].end = "#45B2FE"
  110. } else {
  111. processArr[i].icon = "../../img/process_1.png"
  112. processArr[i].start = "#EFF3F6"
  113. processArr[i].end = "#EFF3F6"
  114. }
  115. }
  116. processArr[index].icon = "../../img/process_2.png"
  117. processArr[index].end = "#EFF3F6"
  118. processArr[0].start = "#fff"
  119. processArr[this.data.detailData.progress.length - 1].end = "#fff"
  120. this.setData({
  121. processData: processArr
  122. })
  123. },
  124. onUnload() {
  125. let page = getCurrentPages();
  126. let prevPage = page[page.length - 2];
  127. prevPage.setData({
  128. isRefresh: this.data.isRefreshUP,
  129. });
  130. },
  131. bindFinish() {
  132. wx.showModal({
  133. title: '提示',
  134. content: '确认整改完成吗?',
  135. complete: (res) => {
  136. if (res.cancel) {
  137. }
  138. if (res.confirm) {
  139. let obj = new Object();
  140. obj.busInspectionId = this.data.busInspectionId
  141. obj.logId = this.data.buslogId
  142. obj.riskStatus = "risk_status_2"
  143. http.send_post("/system/AppXunjianController/changeInspection", obj, this.getChangeSuccess2);
  144. }
  145. }
  146. })
  147. },
  148. })