menc 2 anos atrás
pai
commit
7518cfbb13

+ 1 - 1
base/httputil.js

@@ -71,7 +71,7 @@ function getSysUserInfo(info) {
 function loginSuccess(res) {
   if (res.data.code != 200) {
     wx.showToast({
-      title: res.data.msg,
+      title: res.data.msg != null ? res.data.msg : '',
       icon: "none"
     })
   } else {

+ 3 - 14
pages/details/details.js

@@ -89,7 +89,8 @@ Page({
   //巡检跳转
   bindViewXunJian() {
     wx.navigateTo({
-      url: '../xunjian/xunjian?busEnterpriseId='+this.data.busEnterpriseId,
+      url: '../xunjian/xunjian?busEnterpriseId='+this.data.busEnterpriseId
+      +"&isBeforeBack=true",
     })
   },
   //巡检跳转
@@ -105,18 +106,6 @@ Page({
     wx.navigateTo({
       url: '../qiyexqtable/qiyexqtable?busEnterpriseId='+this.data.busEnterpriseId,
     })
-  },
-
-
-
-
-
-
-
-
-
-
-
-
+    },
 
 })

+ 1 - 1
pages/qiye/qiye.js

@@ -48,7 +48,7 @@ Page({
   //企业表单详细
   bindViewQiYeMore() {
     wx.navigateTo({
-      url: '../qiyemore/qiyemore'
+      url: '../qiyemore/qiyemore',
     })
   },
 

+ 28 - 19
pages/xunjian/xunjian.js

@@ -33,9 +33,10 @@ Page({
         listid: "1"
       },
     ],
+    isBeforeBack:false,
+    isAfterBack:false,
   },
 
-
   takePicture: function (e) {
     // 拍照
     let jibie = e.currentTarget.dataset.jibie
@@ -116,15 +117,6 @@ Page({
     })
   },
 
-
-
-
-
-
-
-
-
-
   changeme: function (e) {
     let that = this
     let checked = e.detail.value;
@@ -229,17 +221,34 @@ Page({
   },
   //上传图片
   onLoad: function (options) {
+    console.log("TAG","onLoad_"+options.isBeforeBack);
+    this.data.isBeforeBack=options.isBeforeBack;
     this.pictureAuthSetting()
     this.data.busEnterpriseId = options.busEnterpriseId
-    this.getXunjianItems()
+    // this.getXunjianItems()
     this.setData({
       //通过bind(this)将函数绑定到this上,以后函数内的this就是指全局页面
       //setdata以后,这两个函数就可以传递给mp-uploader了
       selectFile: this.selectFile.bind(this),
-      uplaodFile: this.uplaodFile.bind(this)
+      uplaodFile: this.uplaodFile.bind(this),
     })
   },
-
+  onShow:function(){
+    let pages = getCurrentPages();
+    let currPage = pages[pages.length-1];
+    this.data.isAfterBack=currPage.data.isAfterBack;
+    // this.data.busEnterpriseId = options.busEnterpriseId
+    // console.log("TAG","onShow_before_"+this.data.isBeforeBack);
+    // console.log("TAG","onShow_after_"+this.data.isAfterBack);
+    if(this.data.isBeforeBack){
+      this.getXunjianItems()
+      this.data.isBeforeBack=false
+    }
+    if(this.data.isAfterBack){
+      this.getXunjianItems()
+      this.data.isAfterBack=false
+    }
+  },
   //mpuploader选择图片时的过滤函数,返回true表示图片有效
   selectFile(files) {
     wx.showLoading({
@@ -297,7 +306,7 @@ Page({
     console.log('upload success', e.detail)
     this.data.files = this.data.files.concat(e.detail.url)
     this.setData({
-      files: this.data.files
+      files: this.data.files,
     })
     wx.hideLoading()
   },
@@ -308,7 +317,9 @@ Page({
   },
 
   getXunjianItems() {
+    // console.log("TAG","getXunjianItems")
     var obj = new Object()
+    
     obj.busEnterpriseId = this.data.busEnterpriseId
     http.post("/system/AppXunjianController/getXunjianItems", obj, this.getXunjianItemsSuccess)
   },
@@ -339,12 +350,12 @@ Page({
     if (res.code == 200) {
       if (res.data.haveXQZG == true) {
         //有限期整改的东西,去通知书页面
-        wx.navigateTo({
+        wx.navigateBack({
           url: '../xqzggzs2/xqzggzs2?logId=' + res.data.logId + "&busEnterpriseId=" + this.data.busEnterpriseId,
         })
       } else {
         // 直接返回详情页
-        wx.navigateTo({
+        wx.navigateBack({
           url: '../details/details?busEnterpriseId=' + this.data.busEnterpriseId,
         })
       }
@@ -436,9 +447,7 @@ Page({
     }
     clearInterval(interval); // 清除setInterval 
     time = 0;
-  },
-
-
+  }, 
 
 })
 

+ 26 - 7
pages/xunjiancz/xunjiancz.js

@@ -16,7 +16,7 @@ Page({
     chooseItems: null,
     totalItems: 0,
     //
-    isFolded: true,
+    isFolded: false,
     hui: "block",
     currentIndex: 0,
     child2: [],
@@ -275,14 +275,19 @@ Page({
     obj.busEnterpriseId = this.data.busEnterpriseId
     obj.chooseItems = this.data.chooseItems;
     http.send_post("/system/AppXunjianController/saveXunjianItems", obj, this.saveXunjianItemsSuccess)
+    this.updown();
   },
   saveXunjianItemsSuccess(res) {
     console.log(res)
     if (res.data.code == 200) {
-      wx.navigateTo({
-        url: '../xunjiancz/xunjiancz?busEnterpriseId=' + this.data.busEnterpriseId,
-      })
+      // wx.navigateTo({
+        // url: '../xunjiancz/xunjiancz?busEnterpriseId=' + this.data.busEnterpriseId,
+      // })
+      let e = new Object()
+      e.busEnterpriseId = this.data.busEnterpriseId
+     this.onLoad(e);
     }
+    
   },
 
   deleteItem(e) {
@@ -306,11 +311,15 @@ Page({
   },
   deleteItemSuccess(res) {
     let that = this
+    
     if(res.code ==200){
       this.data.xunjianItems[res.data.jibie][1].forEach(function (it,idx) {
         console.log(it.listid,"======",res.data.busItemsId)
         if(it.listid == res.data.busItemsId){
           that.data.xunjianItems[res.data.jibie][1].splice(idx,1)
+          if(that.data.xunjianItems[res.data.jibie][1].length==0){
+            delete that.data.xunjianItems[res.data.jibie]
+          }
           that.setData({
             xunjianItems : that.data.xunjianItems
           })
@@ -319,9 +328,19 @@ Page({
     }
   },
   bindViewXunJian(){
-    wx.navigateTo({
-      url: '../xunjian/xunjian?busEnterpriseId='+this.data.busEnterpriseId,
-    })
+    let page = getCurrentPages();
+        let prevPage = page[page.length - 2];
+        prevPage.setData({
+          isAfterBack :true,
+        });
+    wx.navigateBack()
+  },
+  onUnload:function(){
+    let page = getCurrentPages();
+    let prevPage = page[page.length - 2];
+    prevPage.setData({
+      isAfterBack :true,
+    });
   },
 
   change_color_3(e) {

+ 28 - 31
pages/xunjiancz/xunjiancz.wxml

@@ -1,21 +1,20 @@
 <!--pages/xunjiancz/xunjiancz.wxml-->
 <wxs src="../../base/subutil.wxs" module="tools" />
 <view class="container">
-  <view wx:for="{{xunjianItems}}" wx:for-item="value">
-    <view class="xj_nav">
-      <text class="nav_text1">{{value[0][0]}}</text>
-      <text class="iconfont icon-dian"></text>
-      <text class="nav_text2">{{value[0][1]}}</text>
-    </view>
-    <view class="txt_vi">
-      <view class="txt" wx:for="{{value[1]}}" wx:key="{{item.listid}}">
-        <text class="{{hui}}">{{item.info}}</text>
-        <view bindtap="deleteItem" data-busitemid="{{item.listid}}" 
-        data-busiteminfo="{{item.info}}" data-jibie="{{item.jibie}}"
-        class="iconfont icon-pinleishanchu"></view>
+      <view wx:for="{{xunjianItems}}" wx:for-item="value">
+        <view class="xj_nav">
+          <text class="nav_text1">{{value[0][0]}}</text>
+          <text class="iconfont icon-dian"></text>
+          <text class="nav_text2">{{value[0][1]}}</text>
+        </view> 
+        <view class="txt_vi">
+          <view class="txt" wx:for="{{value[1]}}" wx:key="{{item.listid}}">
+            <text class="{{hui}}">{{item.info}}</text>
+            <view bindtap="deleteItem" data-busitemid="{{item.listid}}" data-busiteminfo="{{item.info}}" data-jibie="{{item.jibie}}" class="iconfont icon-pinleishanchu"></view>
+          </view>
+        </view>
       </view>
-    </view>
-  </view>
+    
   <!--底部菜单-->
   <view class="nav_bottom {{isFolded?'':'hide'}}">
     <view class="nav_tit">
@@ -54,20 +53,15 @@
         </swiper-item>
         <swiper-item class='swiperTtemBox' data-swiper="3">
           <view class="tab_vi">
-           
-              <label style="display: flex; padding:30rpx; border-bottom: 1rpx solid white;" 
-              wx:for="{{items_third}}" wx:key="{{item.value}}"
-              bindtap="checkThirdItem"  
-              data-busitemsid="{{item.busItemsId}}" value="{{item.busItemsId}}"
-              >
-                <view class="weui-cell__hd">
-                  <checkbox
-                  checked="{{item.checked}}">
-                  </checkbox>
-                </view>
-                <view class="{{myclick3==item.busItemsId?selt:noselt}}">{{item.busItemsName}}</view>
-              </label>
-            
+
+            <label style="display: flex; padding:30rpx; border-bottom: 1rpx solid white;" wx:for="{{items_third}}" wx:key="{{item.value}}" bindtap="checkThirdItem" data-busitemsid="{{item.busItemsId}}" value="{{item.busItemsId}}">
+              <view class="weui-cell__hd">
+                <checkbox checked="{{item.checked}}">
+                </checkbox>
+              </view>
+              <view class="{{myclick3==item.busItemsId?selt:noselt}}">{{item.busItemsName}}</view>
+            </label>
+
             <view class="weui-cells weui-cells_after-title">
 
             </view>
@@ -76,7 +70,10 @@
       </swiper>
 
     </view>
-  </view>
-  <!-- <view class="float_btn iconfont" bindtap="saveXunjianItems">确定</view> -->
-  <view class="float_btn iconfont icon-gongju-" style="bottom: 280rpx;" bindtap="bindViewXunJian"></view>
+ 
+</view>
+ <!-- <view class="float_btn iconfont" bindtap="saveXunjianItems">确定</view> -->
+ <!-- <view class="float_btn iconfont icon-gongju-" style="bottom: 280rpx;" bindtap="bindViewXunJian"></view> -->
+ <view class="float_btn" style="bottom: 280rpx;" bindtap="bindViewXunJian">检</view>
+
 </view>

+ 4 - 2
pages/xunjiancz/xunjiancz.wxss

@@ -86,10 +86,12 @@
 
 /* 底部导航 */
 .nav_bottom{
-  position: absolute;
+  position: fixed;
   bottom: 0rpx;
   width: 100%;
+  height: 65vh;
   transition: all  .25s  ease-in;
+  z-index: 10000000000;
 }
 .nav_tit{
   display: flex;
@@ -204,6 +206,6 @@
 
 
 .hide{
-  bottom:-900rpx;
+  bottom:-57vh;
   transition: all  .25s  ease-in;
 }