zhanghongrui 2 éve
szülő
commit
19e6a0977d

+ 50 - 34
pages/xunjianmore/xunjianmore.js

@@ -7,62 +7,78 @@ Page({
    * 页面的初始数据
    */
 
-   
+
   data: {
     host: app.globalData.host,
     buslogid: null,
-    mapdata : null,
-    pictureBasePath : null,
-    hiddenName:true,
-    isHave_xqzgtzs:false,
-    isHave_fcyjtzs:false,
-    isRefresh:false,
+    mapdata: null,
+    pictureBasePath: null,
+    hiddenName: true,
+    isHave_xqzgtzs: false,
+    isHave_fcyjtzs: false,
+    isRefresh: false,
   },
   onLoad(e) {
     this.initData(e)
   },
-  onShow(){
-    console.log("!!!!",this.data.buslogid)
+  onShow() {
+    console.log("!!!!", this.data.buslogid)
     let pages = getCurrentPages();
-    let currPage = pages[pages.length-1];
-    this.data.isAfterBack=currPage.data.isAfterBack;
-    console.log("!@!@!@",this.data.isRefresh)
+    let currPage = pages[pages.length - 1];
+    this.data.isRefresh = currPage.data.isRefresh;
+    console.log("!@!@!@", this.data.isRefresh)
+    if (this.data.isRefresh) {
+
+      this.setData({
+        mapdata: null,
+        pictureBasePath: null,
+        hiddenName: true,
+        isHave_xqzgtzs: false,
+        isHave_fcyjtzs: false,
+        isRefresh: false,
+      })
+      let obj = new Object()
+      obj.busLogId = this.data.buslogid
+      http.post("/system/AppXunjianimgController/getXunjianimgList", obj, this.getXunjianMoreListSuccess)
+    }
   },
-  initData(e){
-     let buslogid = e.buslogid
-     this.data.buslogid = buslogid
-    console.log("####",this.data.buslogid)
+  initData(e) {
+    let buslogid = e.buslogid
+    this.data.buslogid = buslogid
+    console.log("####", this.data.buslogid)
 
     let obj = new Object()
-    obj.busLogId = this.data.buslogid 
-    http.post("/system/AppXunjianimgController/getXunjianimgList",obj,this.getXunjianMoreListSuccess)
+    obj.busLogId = this.data.buslogid
+    http.post("/system/AppXunjianimgController/getXunjianimgList", obj, this.getXunjianMoreListSuccess)
   },
-  getXunjianMoreListSuccess(res){
-    console.log("@@@@@",res)
+  getXunjianMoreListSuccess(res) {
+    console.log("@@@@@", res)
     this.setData({
-      pictureBasePath : res.data.pictureBasePath+"/",
-      mapdata : res.data.xunjianimgMap,
-      isHave_xqzgtzs:res.data.isHave_xqzgtzs,
-      isHave_fcyjtzs:res.data.isHave_fcyjtzs,
+      pictureBasePath: res.data.pictureBasePath + "/",
+      mapdata: res.data.xunjianimgMap,
+      isHave_xqzgtzs: res.data.isHave_xqzgtzs,
+      isHave_fcyjtzs: res.data.isHave_fcyjtzs,
     })
   },
-  bindViewZhengGaiJinDu(e){
+  bindViewZhengGaiJinDu(e) {
     let businspectionid = e.currentTarget.dataset.businspectionid
-   
+
+    console.log("more:", businspectionid)
+    console.log("more:", this.data.buslogid)
     wx.navigateTo({
-      url: '../zhenggaijindu/zhenggaijindu?busInspectionId='+businspectionid,
+      url: '../zhenggaijindu/zhenggaijindu?busInspectionId=' + businspectionid + "&buslogId=" + this.data.buslogid,
     })
   },
-    // 按钮显示隐藏
-    shghnn:function(){
-      this.setData({
-          hiddenName:!this.data.hiddenName
-      })
+  // 按钮显示隐藏
+  shghnn: function () {
+    this.setData({
+      hiddenName: !this.data.hiddenName
+    })
   },
   // 跳转整改进度
-  bindViewXqZgGzS(){
+  bindViewXqZgGzS() {
     wx.navigateTo({
-      url: '../xqzggzs/xqzggzs?logId='+this.data.buslogid,
+      url: '../xqzggzs/xqzggzs?logId=' + this.data.buslogid,
     })
   },
 })

+ 65 - 53
pages/zhenggaijindu/zhenggaijindu.js

@@ -4,6 +4,10 @@ Page({
 
   onLoad(e) {
 
+    this.setData({
+      buslogId: e.buslogId,
+      busInspectionId: e.busInspectionId
+    })
     this.getZhenggaijindu(e.busInspectionId)
   },
 
@@ -13,14 +17,47 @@ Page({
     http.post("/system/AppZhenggaijinduController/getZhenggaijindu", obj, this.getZhenggaijinduSuccess);
   },
   getZhenggaijinduSuccess(res) {
-    console.log(res)
+    console.log("******jindu", res)
     this.data.pictureBasePath = res.pictureBasePath
     this.setData({
-      pictureBasePath : res.pictureBasePath,
+      pictureBasePath: res.pictureBasePath,
       zgjdList: res.zgjdList
     })
   },
 
+  bindPickerChange: function (e) {
+    console.log('picker发送选择改变,携带值为', e.detail.value+1)
+
+    let obj = new Object();
+    obj.busInspectionId = this.data.busInspectionId
+    obj.logId = this.data.buslogId
+    obj.lat_day = e.detail.value+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)
+
+    }
+  },
+  getChangeSuccess2(res) {
+    console.log("&&&&", res)
+    if (res.code == 200) {
+      this.setData({
+        //index: e.detail.value,
+        isRefreshUP: true
+      })
+
+      this.getZhenggaijindu(this.data.busInspectionId)
+
+    }
+  },
   /**
    * 页面的初始数据
    */
@@ -28,7 +65,10 @@ Page({
     host: app.globalData.host,
     pictureBasePath: null,
     zgjdList: null,
-    isRefreshUP:true,
+    isRefreshUP: false,
+    buslogId: '',
+    busInspectionId: '',
+
     processData: [{
         name: '提交工单',
         start: '#fff',
@@ -60,9 +100,8 @@ Page({
         icon: '../../img/process_1.png'
       }
     ],
-     // 期限按钮
-    buttons: [{ id: 1, name: "一天" }, { id: 2, name: "两天" }, { id: 3, name:"三天" }]
-
+    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 () {
@@ -92,60 +131,33 @@ Page({
     })
   },
 
-<<<<<<< HEAD
-
-  onUnload(){
+  onUnload() {
     let page = getCurrentPages();
     let prevPage = page[page.length - 2];
     prevPage.setData({
-      isRefresh :this.data.isRefreshUP,
+      isRefresh: this.data.isRefreshUP,
     });
-  }
-=======
-  // 期限按钮
-  onLoad: function (options) {
-    this.data.buttons[0].checked = true;
-    this.setData({
-      buttons: this.data.buttons,
-    })
-  },
-  radioButtonTap: function (e) {
-    console.log(e)
-    let id = e.currentTarget.dataset.id
-    console.log(id)
-    for (let i = 0; i < this.data.buttons.length; i++) {
-      if (this.data.buttons[i].id == id) {
-        //当前点击的位置为true即选中
-        this.data.buttons[i].checked = true;
-      }
-      else {
-        //其他的位置为false
-        this.data.buttons[i].checked = false;
-      }
-    }
-    this.setData({
-      buttons: this.data.buttons,
-      msg: "id:"+id
-    })
   },
-  checkButtonTap:function(e){
-    console.log(e)
-    let id = e.currentTarget.dataset.id
-    console.log(id)
-    for (let i = 0; i < this.data.buttons.length; i++) {
-      if (this.data.buttons[i].id == id) {
-        if (this.data.buttons[i].checked == true) {
-          this.data.buttons[i].checked = false;
-         
-        } else {
-          this.data.buttons[i].checked = true;
-          
+  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.getChangeSuccess2);
         }
       }
-    }
-    
-  },
+    })
 
+  },
 
->>>>>>> 57f7980a209c37c9f7735fbe7e3a57926d779ed2
 })

+ 8 - 5
pages/zhenggaijindu/zhenggaijindu.wxml

@@ -18,13 +18,16 @@
   </view>
   <view class="btm_btn">
     <view class="time_qx">
-      <text>期限:</text>
+    
       <view class="ttbtn">
-        <block wx:for="{{buttons}}" wx:key="buttons">
-  <button size="mini" class="{{item.checked?'checked_button':'normal_button'}}" data-id="{{item.id}}" bindtap="radioButtonTap">{{item.name}}</button>
-  </block>
+        <view class="section__title">期限:</view>
+        <picker bindchange="bindPickerChange" value="{{index}}" range="{{array}}">
+        <view class="picker">
+          <text>{{array[index]}}</text> 天
+        </view>
+  </picker>
       </view>
     </view>
-    <button type="primary" class="succ_btn">完成</button>
+    <button type="primary" class="succ_btn" size="mini" bindtap="bindFinish">整改完成</button>
   </view>
 </view>

+ 20 - 24
pages/zhenggaijindu/zhenggaijindu.wxss

@@ -101,46 +101,42 @@ margin-top: 40rpx;
   display: flex;
   flex-direction: row;
   position: fixed;
-  width: 100%;
+  width: 80%;
   background-color: rgb(255, 255, 255);
   bottom: 0px;
-  padding: 40rpx 20rpx;
+  padding: 40rpx 10%;
   left: 0;
   border-top: 1px solid rgb(233, 233, 233);
   box-shadow: 0px 0px 10px #ccc;
-}
-.btm_btn text{
-  font-size: 32rpx;
-  color: #444;
+  justify-content:space-between ;
+  
 }
 .time_qx{
   display: flex;
   flex-direction: row;
   align-items: center;
+ 
+}
+.section__title{
+  padding-right: 4rpx;
 }
 .ttbtn{
   display: flex;
   flex-direction: row;
-  
-}
-.ttbtn button{
-padding: 0rpx 30rpx!important;
-font-size: 28rpx!important;
-border-radius: 100rpx!important;
-margin-right: 16rpx;
-font-weight: normal!important;
-border: 1px solid rgb(209, 209, 209);
-}
-.checked_button{
-  background: rgb(248, 89, 41);
-  border: 1px solid #fff!important;
-  color: #fff;
-}
-.normal_button{
-  background: rgb(250, 250, 250);
+  border: 1px solid rgb(230, 230, 230);
+  padding: 16rpx 30rpx;
+  border-radius: 100rpx;
+  background: rgb(230, 230, 230);
+  color: #444;
 }
 .succ_btn{
   width: auto!important;
 padding: 10rpx 26px!important;
-font-size: 28rpx!important;
+font-size: 30rpx!important;
+font-weight: normal!important;
+margin: 0!important;
+}
+picker text{
+  font-weight: 500;
+  color: rgb(235, 98, 19)!important;
 }