123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- import http from '../../base/httputil'
- const app = getApp()
- Page({
- onLoad(e) {
- this.setData({
- buslogId: e.buslogId,
- busInspectionId: e.busInspectionId
- })
- this.getZhenggaijindu(e.busInspectionId)
- },
- getZhenggaijindu(busInspectionId) {
- let obj = new Object();
- obj.busInspectionId = busInspectionId
- http.post("/system/AppZhenggaijinduController/getZhenggaijindu", obj, this.getZhenggaijinduSuccess);
- },
- getZhenggaijinduSuccess(res) {
- console.log("******jindu", res)
- this.data.pictureBasePath = res.pictureBasePath
- this.setData({
- pictureBasePath: res.pictureBasePath,
- zgjdList: res.zgjdList
- })
- if (res.zgjdList.length > 0 && res.zgjdList[0].riskStatus == "risk_status_2") {
- this.setData({
- hidden: false
- })
- }
- },
- bindPickerChange: function (e) {
- let nume = e.detail.value
- console.log('picker发送选择改变,携带值为', parseInt(nume) + 1)
- let obj = new Object();
- obj.busInspectionId = this.data.busInspectionId
- obj.logId = this.data.buslogId
- obj.lat_day = parseInt(nume) + 1
- http.send_post("/system/AppXunjianController/changeInspection", obj, this.getChangeSuccess);
- },
- getChangeSuccess(res) {
- console.log("&&&&", res)
- if (res.code == 200) {
- this.setData({
- //index: e.detail.value,
- isRefreshUP: true
- })
- this.getZhenggaijindu(this.data.busInspectionId)
- }
- },
- /**
- * 页面的初始数据
- */
- data: {
- host: app.globalData.host,
- hidden: true,
- pictureBasePath: null,
- zgjdList: null,
- isRefreshUP: false,
- buslogId: '',
- busInspectionId: '',
- processData: [{
- name: '提交工单',
- start: '#fff',
- end: '#EFF3F6',
- icon: '../../img/process_1.png'
- },
- {
- name: '已接单',
- start: '#EFF3F6',
- end: '#EFF3F6',
- icon: '../../img/process_1.png'
- },
- {
- name: '开始维修',
- start: '#EFF3F6',
- end: '#EFF3F6',
- icon: '../../img/process_1.png'
- },
- {
- name: '维修结束',
- start: '#EFF3F6',
- end: '#EFF3F6',
- icon: '../../img/process_1.png'
- },
- {
- name: '已确认',
- start: '#EFF3F6',
- end: '#fff',
- icon: '../../img/process_1.png'
- }
- ],
- 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'],
- index: 0,
- },
- //进度条的状态
- setPeocessIcon: function () {
- var index = 0 //记录状态为1的最后的位置
- var processArr = this.data.processData
- // console.log("progress", this.data.detailData.progress)
- for (var i = 0; i < this.data.detailData.progress.length; i++) {
- var item = this.data.detailData.progress[i]
- processArr[i].name = item.word
- if (item.state == 1) {
- index = i
- processArr[i].icon = "../../img/process_3.png"
- processArr[i].start = "#45B2FE"
- processArr[i].end = "#45B2FE"
- } else {
- processArr[i].icon = "../../img/process_1.png"
- processArr[i].start = "#EFF3F6"
- processArr[i].end = "#EFF3F6"
- }
- }
- processArr[index].icon = "../../img/process_2.png"
- processArr[index].end = "#EFF3F6"
- processArr[0].start = "#fff"
- processArr[this.data.detailData.progress.length - 1].end = "#fff"
- this.setData({
- processData: processArr
- })
- },
- onUnload() {
- let page = getCurrentPages();
- let prevPage = page[page.length - 2];
- prevPage.setData({
- isRefresh: this.data.isRefreshUP,
- });
- },
- bindFinish() {
- wx.showModal({
- title: '提示',
- content: '确认整改完成吗?',
- complete: (res) => {
- if (res.cancel) {
- }
- if (res.confirm) {
- let obj = new Object();
- obj.busInspectionId = this.data.busInspectionId
- obj.logId = this.data.buslogId
- obj.riskStatus = "risk_status_2"
- http.send_post("/system/AppXunjianController/changeInspection", obj, this.getChangeSuccess);
- }
- }
- })
- },
- })
|