Browse Source

物资 仓库 队伍 搜索

zhanghongrui 2 years ago
parent
commit
84acd790ff

+ 4 - 1
app.json

@@ -30,7 +30,10 @@
     "pages/teamlist/teamlist",
     "pages/teamlist/details/team_details",
     "pages/warehouselist/warehouselist",
-    "pages/warehouselist/details/warehouse_details"
+    "pages/warehouselist/details/warehouse_details",
+    "pages/material/serch/material_serch",
+    "pages/warehouselist/serch/warehouse_serch",
+    "pages/teamlist/serch/team_serch"
  
   
   ],

+ 68 - 63
pages/material/material.js

@@ -28,7 +28,7 @@ Page({
     let obj = new Object()
     obj.pageNum = this.data.pageNum
     obj.pageSize = 10
-    obj.reasonable= false
+    obj.reasonable = false
     http.send_get("/system/AppMaterialController/geMaterialList", obj, this.getQiyeEnterpriseListSuccess)
 
 
@@ -36,59 +36,59 @@ Page({
 
   getQiyeEnterpriseListSuccess(res) {
 
-console.log("@@@@",res)
-if(res.code==200){
-     // 显示加载图标
-     wx.showLoading({
-      title: '玩命加载中',
-    })
-    var that = this
-
-    if(res.data.rows.length==0){
-      wx.showToast({
-        title: '暂无更多数据',
-        icon:"none"
-      })
-    }
-    if (this.data.isRefresh) {
-      this.setData({
-        enterpriseList: res.data.rows,
-        total: res.data.total
+    console.log("@@@@", res)
+    if (res.code == 200) {
+      // 显示加载图标
+      wx.showLoading({
+        title: '玩命加载中',
       })
-
-
-
-      // 隐藏导航栏加载框
-      setTimeout(function () {
-        that.setData({
-          loadingData: false
-        });
-        wx.hideNavigationBarLoading();
-        // 停止下拉动作
-        wx.stopPullDownRefresh();
-        wx.hideLoading()
-
-      }, 1000)
-
+      var that = this
+
+      if (res.data.rows.length == 0) {
+        wx.showToast({
+          title: '暂无更多数据',
+          icon: "none"
+        })
+      }
+      if (this.data.isRefresh) {
+        this.setData({
+          enterpriseList: res.data.rows,
+          total: res.data.total
+        })
+
+
+
+        // 隐藏导航栏加载框
+        setTimeout(function () {
+          that.setData({
+            loadingData: false
+          });
+          wx.hideNavigationBarLoading();
+          // 停止下拉动作
+          wx.stopPullDownRefresh();
+          wx.hideLoading()
+
+        }, 1000)
+
+      } else {
+        this.setData({
+          enterpriseList: this.data.enterpriseList.concat(res.data.rows)
+        })
+        // 隐藏加载框
+
+        setTimeout(function () {
+          that.setData({
+            hidden: true,
+            loadingData: false
+          });
+
+          wx.hideLoading();
+        }, 1000)
+
+      }
     } else {
-      this.setData({
-        enterpriseList: this.data.enterpriseList.concat(res.data.rows)
-      })
-      // 隐藏加载框
-
-      setTimeout(function () {
-        that.setData({
-          hidden: true,
-          loadingData: false
-        });
-
-        wx.hideLoading();
-      }, 1000)
-
+      console.log("@@!", "请求失败")
     }
-  }else{
-    console.log("@@!","请求失败")
-  }
   },
   onPullDownRefresh: function () {
     // 显示顶部刷新图标
@@ -110,7 +110,7 @@ if(res.code==200){
   onReachBottom: function () {
     let that = this
     var loadingData = that.data.loadingData
-   
+
     var hidden = that.data.hidden
     // 页数+1
     that.setData({
@@ -131,13 +131,13 @@ if(res.code==200){
       loadingData: true
     });
 
-    
+
     //console.log("@@@@"+Math.ceil(this.data.total/10))
-   // if(Math.ceil(that.data.total/10)>=that.data.pageNum){
-      that.loadData();
-  
+    // if(Math.ceil(that.data.total/10)>=that.data.pageNum){
+    that.loadData();
+
     // }else{
-     
+
     //   setTimeout(function () {
     //     that.setData({
     //       hidden: true,
@@ -146,18 +146,23 @@ if(res.code==200){
     //   }, 2000)
     // }
 
-   
-  },
 
+  },
 
+  // 搜索结果跳页
+  bindViewSearchEnd() {
+    wx.navigateTo({
+      url: '../material/serch/material_serch'
+    })
+  },
   bindViewDetails(e) {
     let material_details = e.currentTarget.dataset.index
-   
- 
 
- 
+
+
+
     wx.navigateTo({
-      url: '../material/details/material_details?details='+JSON.stringify(material_details)
+      url: '../material/details/material_details?details=' + JSON.stringify(material_details)
     })
   }
 })

+ 1 - 1
pages/material/material.wxml

@@ -20,7 +20,7 @@
       
       <view class="li_tit">{{item.materialName}}</view>
       <view class="li_time">
-      <text>{{item.connector}}</text>
+      <text>所属仓库:{{item.warehouseName}}</text>
       </view>
       </view>
   

+ 49 - 0
pages/material/serch/material_serch.js

@@ -0,0 +1,49 @@
+import http from '../../../base/httputil'
+const app = getApp()
+Page({
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    host: app.globalData.host,
+    materialList: [],
+  },
+  onLoad() {
+   // this.list(null)
+  },
+  // 搜索结果跳页
+  bindViewSearchEnd() {
+    // wx.navigateTo({
+      // url: '../search/search'
+    // })
+  },
+  // 物资详情页
+  bindViewDetails(e) {
+    let material_details = e.currentTarget.dataset.index
+
+    wx.navigateTo({
+      url: '../details/material_details?details=' + JSON.stringify(material_details)
+    })
+  },
+
+  searchEnterprise(e) {
+    var obj = new Object()
+    obj.materialName = e.detail.value
+    
+    this.list(obj)
+  },
+
+  list(data) {
+    http.send_get("/system/AppMaterialController/geMaterialList", data, this.getMaterListSuccess)
+  },
+
+  getMaterListSuccess(res) {
+    console.log("!!!!",res.data.rows.length)
+    this.setData({
+      materialList: res.data.rows
+    })
+
+
+  }
+
+})

+ 6 - 0
pages/material/serch/material_serch.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {},
+  "navigationBarBackgroundColor": "#f94b0e",
+    "navigationBarTextStyle": "white",
+    "navigationBarTitleText": "搜索结果"
+}

+ 33 - 0
pages/material/serch/material_serch.wxml

@@ -0,0 +1,33 @@
+<view class="container">
+  <!-- 搜索 -->
+  <view class="search-container">
+    <view class="search-left">
+      <input type="text" bindinput="searchEnterprise" placeholder="搜索" />
+    </view>
+    <button bindtap="bindViewSearchEnd" class="search-right">
+      <text class="iconfont icon-sousuo"></text>
+    </button>
+  </view>
+
+  <!-- 列表 -->
+  <view class="list_vi">
+    <view class="list_li3" catchtap="bindViewDetails" wx:for="{{materialList}}" wx:key="index" data-index="{{item}}">
+      <!-- <i class="list_icon iconfont icon-queding" wx:if="{{item.riskCount == 0}}"></i>
+      <i class="list_icon iconfont icon-yingjipingtai" wx:if="{{item.riskCount > 0}}"></i> -->
+      <i class="iconfont icon-wuzichubei"></i>
+      <view class="notice_li">
+      
+      <view class="li_tit">{{item.materialName}}</view>
+      <view class="li_time">
+      <text>{{item.connector}}</text>
+      </view>
+      </view>
+  
+      <i class="iconfont icon-xiangyou list_right"></i>
+    </view>
+</view>
+
+
+
+
+</view>

+ 1 - 0
pages/material/serch/material_serch.wxss

@@ -0,0 +1 @@
+/* pages/material/serch/material_serch.wxss */

+ 2 - 2
pages/notice/notice.wxml

@@ -12,8 +12,8 @@
       
       <view class="li_tit">{{item.noticeTitle}}</view>
       <view class="li_time">
-      <text>发布</text>
-      <text>2022年12月11日</text>
+      <text>发布人:{{item.createBy}}</text>
+      <text>{{item.createTime}}</text>
       </view>
       </view>
   

+ 50 - 0
pages/teamlist/serch/team_serch.js

@@ -0,0 +1,50 @@
+import http from '../../../base/httputil'
+const app = getApp()
+Page({
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    host: app.globalData.host,
+    teamList: [],
+  },
+  onLoad() {
+   // this.list(null)
+  },
+  // 搜索结果跳页
+  bindViewSearchEnd() {
+    // wx.navigateTo({
+      // url: '../search/search'
+    // })
+  },
+  // 企业详细页
+  bindViewDetails(e) {
+    let warehouse_details = e.currentTarget.dataset.index
+
+    wx.navigateTo({
+      url: '../details/team_details?details=' + JSON.stringify(warehouse_details)
+    })
+  },
+
+  searchEnterprise(e) {
+    var obj = new Object()
+    obj.teamName = e.detail.value
+    
+    this.list(obj)
+  },
+
+  list(data) {
+    http.send_get("/system/AppTeamController/getTeamList", data, this.getTeamListSuccess)
+  },
+
+  getTeamListSuccess(res) {
+  
+    console.log("$$$",res)
+    this.setData({
+      teamList: res.data.rows
+    })
+
+
+  }
+
+})

+ 6 - 0
pages/teamlist/serch/team_serch.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {},
+  "navigationBarBackgroundColor": "#f94b0e",
+    "navigationBarTextStyle": "white",
+    "navigationBarTitleText": "搜索结果"
+}

+ 33 - 0
pages/teamlist/serch/team_serch.wxml

@@ -0,0 +1,33 @@
+<view class="container">
+  <!-- 搜索 -->
+  <view class="search-container">
+    <view class="search-left">
+      <input type="text" bindinput="searchEnterprise" placeholder="搜索" />
+    </view>
+    <button bindtap="bindViewSearchEnd" class="search-right">
+      <text class="iconfont icon-sousuo"></text>
+    </button>
+  </view>
+
+  <!-- 列表 -->
+  <view class="list_vi">
+    <view class="list_li3" catchtap="bindViewDetails" wx:for="{{teamList}}" wx:key="index" data-index="{{item}}">
+      <!-- <i class="list_icon iconfont icon-queding" wx:if="{{item.riskCount == 0}}"></i>
+      <i class="list_icon iconfont icon-yingjipingtai" wx:if="{{item.riskCount > 0}}"></i> -->
+      <i class="iconfont icon-dangjian_duiwujianshe"></i>
+      <view class="notice_li">
+      
+      <view class="li_tit">{{item.teamName}}</view>
+      <view class="li_time">
+      <text>负责人:{{item.charger}}</text>
+      </view>
+      </view>
+  
+      <i class="iconfont icon-xiangyou list_right"></i>
+    </view>
+</view>
+
+
+
+
+</view>

+ 1 - 0
pages/teamlist/serch/team_serch.wxss

@@ -0,0 +1 @@
+/* pages/material/serch/material_serch.wxss */

+ 8 - 4
pages/teamlist/teamlist.js

@@ -155,11 +155,15 @@ if(res.code==200){
   bindViewDetails(e) {
     let teamlist_details = e.currentTarget.dataset.index
    
- 
-
- 
     wx.navigateTo({
       url: '../teamlist/details/team_details?details='+JSON.stringify(teamlist_details)
     })
-  }
+  },
+   // 搜索结果跳页
+   bindViewSearchEnd() {
+    wx.navigateTo({
+      url:'../teamlist/serch/team_serch'
+   
+    })
+  },
 })

+ 1 - 1
pages/teamlist/teamlist.wxml

@@ -20,7 +20,7 @@
       
       <view class="li_tit">{{item.teamName}}</view>
       <view class="li_time">
-      <text>111111</text>
+      <text>负责人:{{item.charger}}</text>
       </view>
       </view>
   

+ 7 - 6
pages/warehouselist/details/warehouse_details.js

@@ -50,16 +50,17 @@ markers: [{
 
   },
  //导航
- navRoad(event) {
-  console.log(event)
+ navRoad() {
+ // console.log("%%%",event)
+  let that=this
   wx.getLocation({ //获取当前经纬度
     type: 'wgs84', //返回可以用于wx.openLocation的经纬度,
     success: function (res) {
       wx.openLocation({ //​使用微信内置地图查看位置。
-        latitude: event.currentTarget.dataset.marker.latitude, //要去的纬度-地址
-        longitude: event.currentTarget.dataset.marker.longitude, //要去的经度-地址
-        name: event.currentTarget.dataset.marker.name,
-        address: event.currentTarget.dataset.marker.address
+        latitude: Number(that.data.latitude), //要去的纬度-地址
+        longitude: Number(that.data.longitude), //要去的经度-地址
+        name: that.data.warehouseName,
+        address: that.data.warehouseName
       })
     }
   })

+ 2 - 2
pages/warehouselist/details/warehouse_details.wxml

@@ -1,7 +1,7 @@
 <!-- 企业详情页面 -->
 <view class="container">
   <view class="map">
-    <map longitude="{{longitude}}" latitude="{{latitude}}" scale="17" markers="{{markers}}" bindmarkertap="navRoad" data-marker="{{markers[0]}}" show-location />
+    <map longitude="{{longitude}}" latitude="{{latitude}}" scale="17" markers="{{markers}}" data-marker="{{markers[0]}}" show-location />
 
     <!-- <view class="map_btn">
     <text class="iconfont icon-wenjianguanli" bindtap="bindViewXunChaJiLu"></text>
@@ -39,6 +39,6 @@
   </view>
   </view>
 
-  <view class="float_btn" style="bottom: 280rpx;" bindtap="bindViewXunJian"><i class="iconfont icon-route-fill"></i></view>
+  <view class="float_btn" style="bottom: 280rpx;" bindtap="navRoad"><i class="iconfont icon-route-fill"></i></view>
 
 </view>

+ 49 - 0
pages/warehouselist/serch/warehouse_serch.js

@@ -0,0 +1,49 @@
+import http from '../../../base/httputil'
+const app = getApp()
+Page({
+  /**
+   * 组件的初始数据
+   */
+  data: {
+    host: app.globalData.host,
+    warehouseList: [],
+  },
+  onLoad() {
+   // this.list(null)
+  },
+  // 搜索结果跳页
+  bindViewSearchEnd() {
+    // wx.navigateTo({
+      // url: '../search/search'
+    // })
+  },
+  // 企业详细页
+  bindViewDetails(e) {
+    let warehouse_details = e.currentTarget.dataset.index
+
+    wx.navigateTo({
+      url: '../details/warehouse_details?details=' + JSON.stringify(warehouse_details)
+    })
+  },
+
+  searchEnterprise(e) {
+    var obj = new Object()
+    obj.warehouseName = e.detail.value
+    
+    this.list(obj)
+  },
+
+  list(data) {
+    http.send_get("/system/AppWarehouseController/getWarehouseList", data, this.getWareHouseListSuccess)
+  },
+
+  getWareHouseListSuccess(res) {
+  
+    this.setData({
+      warehouseList: res.data.rows
+    })
+
+
+  }
+
+})

+ 6 - 0
pages/warehouselist/serch/warehouse_serch.json

@@ -0,0 +1,6 @@
+{
+  "usingComponents": {},
+  "navigationBarBackgroundColor": "#f94b0e",
+    "navigationBarTextStyle": "white",
+    "navigationBarTitleText": "搜索结果"
+}

+ 32 - 0
pages/warehouselist/serch/warehouse_serch.wxml

@@ -0,0 +1,32 @@
+<view class="container">
+  <!-- 搜索 -->
+  <view class="search-container">
+    <view class="search-left">
+      <input type="text" bindinput="searchEnterprise" placeholder="搜索" />
+    </view>
+    <button bindtap="bindViewSearchEnd" class="search-right">
+      <text class="iconfont icon-sousuo"></text>
+    </button>
+  </view>
+
+  <!-- 列表 -->
+  <view class="list_vi">
+    <view class="list_li3" catchtap="bindViewDetails" wx:for="{{warehouseList}}" wx:key="index" data-index="{{item}}">
+      <!-- <i class="list_icon iconfont icon-queding" wx:if="{{item.riskCount == 0}}"></i>
+      <i class="list_icon iconfont icon-yingjipingtai" wx:if="{{item.riskCount > 0}}"></i> -->
+      <i class="iconfont icon-cangkukucun"></i>
+      <view class="notice_li">
+      
+      <view class="li_tit">{{item.warehouseName}}</view>
+      <view class="li_time">
+      <text>部门名称:{{item.deptName}}</text>
+      </view>
+      </view>
+      <i class="iconfont icon-xiangyou list_right"></i>
+    </view>
+</view>
+
+
+
+
+</view>

+ 1 - 0
pages/warehouselist/serch/warehouse_serch.wxss

@@ -0,0 +1 @@
+/* pages/material/serch/material_serch.wxss */

+ 8 - 1
pages/warehouselist/warehouselist.js

@@ -161,5 +161,12 @@ if(res.code==200){
     wx.navigateTo({
       url: '../warehouselist/details/warehouse_details?details='+JSON.stringify(teamlist_details)
     })
-  }
+  },
+   // 搜索结果跳页
+   bindViewSearchEnd() {
+    wx.navigateTo({
+      url:'../warehouselist/serch/warehouse_serch'
+   
+    })
+  },
 })

+ 1 - 1
pages/warehouselist/warehouselist.json

@@ -9,6 +9,6 @@
   "enablePullDownRefresh": true,
   "onPullDownRefresh": true,
   "onReachBottom": true,
-  "navigationBarTitleText": "救援队伍"
+  "navigationBarTitleText": "仓库"
 
 }

+ 1 - 1
pages/warehouselist/warehouselist.wxml

@@ -20,7 +20,7 @@
       
       <view class="li_tit">{{item.warehouseName}}</view>
       <view class="li_time">
-      <text>111111</text>
+      <text>部门名称:{{item.deptName}}</text>
       </view>
       </view>
       <i class="iconfont icon-xiangyou list_right"></i>