123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604 |
- <template>
- <div class="dyn_box">
- <div class="dyn_title">
- <!-- <div class="dyn_item" @click="studentXuan"> -->
- <div class="souew">
- <img src="@/static/icon_lsjl_ss.png" alt="" class="iconfr">
- <input type="text" v-model="nhese" class="injue" placeholder="请输入要查询的查询码">
- <button class="nhye" @click="seache" >搜索</button>
- </div>
-
- <!-- <van-search
- :value="value"
- shape="round"
- background="#4fc08d"
- placeholder="请输入搜索关键词"
- /> -->
- <!-- </div> -->
- <!-- <div class="dyn_item" @click="riqu">
- <span>{{titlerid}}</span>
- <img src="@/static/icon_xsdt_sx_xl@2x.png" alt="" class="icon">
- </div> -->
- </div>
-
- <div>
- <scroll-view scroll-y class="scroll-view" upper-threshold="40" lower-threshold="40" @scrolltolower="bot_btn">
- <div class="byes" v-for="(item,index) in list" :key="index" @click="nhje(item)">
- <p>{{item.reportNumber}}</p>
- <p>{{item.createTime}}</p>
- </div>
- <div class="shax" v-show="listShow">
- {{wtdt}}
- </div>
- </scroll-view>
- <div class="zanwu " v-show="!listShow"><span>暂无数据</span></div>
- </div>
-
-
-
- <!-- <table>
- <thead>
- <tr>
- <th style="width: 130upx;text-align: center;">姓名</th>
- <th style="width: 60upx; text-align: center;">性别</th>
- <th style="width: 100upx; text-align: center;">班级</th>
- <th style="width: 100upx; text-align: center;">扫码时间</th>
- <th style="width: 100upx; text-align: center;">温度(℃)</th>
- <th style="width: 60upx; text-align: center;">详细信息</th>
- </tr>
- </thead>
- <tbody>
-
- </tbody>
- </table> -->
- <!-- //时间选择 -->
- <!-- <van-popup :show="showtime" @close="onClosetime" position="bottom">
- <van-datetime-picker
- type="date"
- :value="currentDate"
- :min-date="minDate"
- :max-date="maxDate"
- :formatter="formatter"
- @input="onInput"
- @confirm = "timeone"
- @cancel = "itemcel"
- />
- </van-popup> -->
- <!-- //选择学生 -->
- <!-- <van-popup :show="stushow" @close="stuonClose" position="bottom">
- <van-picker :columns="columns" @change="stuonChange" show-toolbar
- title="信息" @cancel="stuCancel" @confirm="stuConfirm"/>
- </van-popup> -->
-
- </div>
- </template>
- <script>
- export default{
- data() {
- return {
- showtime:false,
- currentDate: 0,
- titlerid:'扫码日期',
- studentseL:'选择学生',
- value:'',
- minDate:0,
- maxDate:0,
- minHour: 10,
- maxHour: 20,
- columns:[],
- stushow:false,
- phone:0,
- listShow: true, //判断是否有数据 true 有
- haveMore: true,
- timeujyu:'',
- wtdt: '上拉加载更多',
- params: { //上拉刷新
- pageSize: 20,
- pageNum: 1,
- // parentPhone: '', //查询
- // // complate: '',
- // // classId:'',
- // reportNumber: undefined
- },
- list:[],
- nhese:''
- }
- },
- onLoad() {
- this.phone = uni.getStorageSync('phone')
- this.params.queryPhone = uni.getStorageSync('phone')
- console.log(uni.getStorageSync('phone'),34)
- // this.params.parentPhone = 15855353281
- let token = uni.getStorageSync('phone')
- if(!token){
- uni.redirectTo({
- url: '/pages/login/login'
- })
- return false
- }
- // this.bingeList()
- this.lists(this.params)
- },
- onShow() {
- // let iutem = new Date().getFullYear() + 1
- this.maxDate = new Date(2020,12,1).getTime()
- this.minDate= new Date(2017, 10, 1).getTime()
- // this.currentDate = new Date().getTime()
- // console.log(new Date().getFullYear() + 1 , new Date(2019, 10, 1).getTime() )
- },
- //下拉刷新
- onPullDownRefresh() {
-
- console.log(234)
- wx.showNavigationBarLoading()
- // uni.showLoading({
- // title: '刷新中...',
- // })
- // this.currentTab = 0
- this.params.pageNum = 1
- // this.tehu = '请选择班级'
- this.params = { //上拉刷新
- pageSize: 20,
- pageNum: 1,
- // searchValue: '', //查询
- // // // classId:'',
- // reportNumber:undefined
- }, //查询
- // this.paramstwo = {
- // searchValue: '', //查询
- // // complate: '',
- // // classId:'',
- // deptId: ''
- // }
- this.nhese = ''
- this.titlerid = '扫码日期'
- this.studentseL="选择学生"
- // this.params.parentPhone = uni.getStorageSync('phone')
- this.params.queryPhone = uni.getStorageSync('phone')
- this.list = []
- // this.studentnum(this.paramstwo)
- // this.terd = ''
- this.lists(this.params)
- // uni.stopPullDownRefresh()
- // self.getNewList()
- // self.getLun()
- },
- methods:{
- //获取学生信息接口
- bingeList(){
- const _this = this
- this.$http.post("gateway/query/miniProgramQueryLog" + this.phone).then(res => {
- console.log(res)
- if(res.code == 200){
- console.log(res.data.length)
-
-
- this.lkeiLIst = res.data
- this.lkeiLIst.filter(router => {
- this.columns.push(router.name)
- })
-
- console.log(this.lkeiLIst)
- console.log(this.columns)
-
-
- }else {
- uni.showToast({
- title: res.msg,
- duration: 1000,
- icon: 'none'
- });
- }
- // console.log(this.studenList)
- })
- },
- //查询列表
- lists(params) {
- var str='?pageSize='+params.pageSize+'&pageNum='+params.pageNum+'&queryPhone='+params.queryPhone;
- if(params.reportNumber){
- str=str+"&reportNumber="+params.reportNumber
- }
- this.$http.post("gateway/query/miniProgramQueryLog"+str).then(res => {
- //停止下拉加载
- uni.hideNavigationBarLoading()
- uni.stopPullDownRefresh()
- if (res.code == 200) {
- if (res.rows.length < params.pageSize) {
- this.listShow = false
- this.haveMore = false
- } else {
- var num=parseInt(res.rows.length)+parseInt(params.pageSize)*parseInt(params.pageNum-1)
- if(num<res.total){
- this.listShow = true
- this.haveMore = true
- }else{
- this.listShow = false
- this.haveMore = false
- }
- }
- if(params.pageSize==1){
- this.list = res.rows
- }else{
- this.list = this.list.concat(res.rows)
- }
- // this.shoue = true
- // if(res.data.current != res.data.pageNum) {
- // if(res.data.pageNum == 0){
- // this.list = res.rows
- // }
- // this.list = this.list.concat(res.rows)
- // this.list.filter(route => {
- // console.log(route,98)
- // if(route.sex == 1){
- // route.sex = '女'
- // }else if(route.sex == 0){
- // route.sex = '男'
- // }
- // //采集判断
- // if(route.picture == ''){ //未采集
- // this.Collected = true
- // }else {
- // this.Collected = false
- // }
-
-
- // // console.log(this.Collected)
-
- // })
- // this.params.pageNum +=1
- // this.haveMore = true
- // } else {
- // if(this.params.pageNum !==1){
- // this.list = this.list.concat(res.rows)
- // }else {
- // this.list = res.rows
- // }
-
- // this.list.filter(route => {
- // console.log(route,98)
- // if(route.sex == 1){
- // route.sex = '女'
- // }else if(route.sex == 0){
- // route.sex = '男'
- // }
- // //采集判断
- // if(route.picture == ''){
- // //未采集
- // this.Collected = true
-
- // }else {
- // this.Collected = false
- // }
- // // console.log(this.Collected)
-
- // })
- // // console.log(111)
- // this.haveMore = false
- // this.shoue = true
- // this.wtdt = '暂无更多数据'
- // }
- } else {
- uni.showToast({
- title: res.msg,
- duration: 1000,
- icon: 'none'
- });
-
-
- }
-
-
- })
- },
- // 搜索
- seache(){
- this.params.reportNumber= this.nhese
- this.params.pageNum = 1
- this.list = []
- this.lists(this.params)
- console.log(this.params.reportNumber , this.nhese)
- },
- // 点击查看详情
- nhje(id){
- // id.reportNumber = 'NO:ASJ(0000)QG —001号'
- const _this = this
- this.$http.posta("gateway/query/queryReportNum" , {reportNumber:id.reportNumber}).then(res => {
- console.log(res)
- if(res.code == 200){
- console.log(res.data.length)
- let hjees = JSON.stringify(res.data)
- wx.navigateTo({
- url: '/pages/home/recordtwo?code=' + hjees
- })
-
- }else {
- uni.showToast({
- title: res.msg,
- duration: 1000,
- icon: 'none'
- });
- }
- // console.log(this.studenList)
- })
- },
- look_btn(item) {
- console.log(item)
- let liy = JSON.stringify(item)
-
- uni.navigateTo({
- url: '/pages/parents/par_dynamic_dec?iju=' +liy
- })
- uni.setStorageSync('item', item)
- },
- riqu(){
- this.showtime = true
- console.log(234)
- },
- onClosetime(){
- this.showtime = false
- },
- stuonClose(){
- this.stushow = false
- },
- onInput(event) {
- // console.log(event)
- this.currentDate = event.detail
- },
- itemcel(){
- this.showtime = false
- },
- timeone(event){
- console.log(event)
- this.formatDateTime(event.detail,0)
- this.showtime = false
- },
- onChange(event){
- console.log(event.detail)
- },
- //刷新
- bot_btn() {
- if (this.haveMore) {
- this.params.pageNum++
- this.lists(this.params)
- }
- },
- stuonChange(){
-
- },
- studentXuan(){
- this.stushow = true
- },
- stuConfirm(event){
- this.studentseL = event.detail.value
- console.log(event.detail)
- console.log(this.lkeiLIst[event.detail.index].pid)
- this.params.pageNum = 1
- this.params.pid = this.lkeiLIst[event.detail.index].pid
- this.list=[]
- this.lists(this.params)
- this.stushow = false
- },
- stuCancel(){
- this.stushow = false
- },
- formatter(type, value){
- if (type === 'year') {
- return `${value}年`;
- } else if (type === 'month') {
- return `${value}月`;
- }
- return value;
- },
- // 时间格式化
- formatDateTime(inputTime) {
- var date = new Date(inputTime);
- var y = date.getFullYear();
- var m = date.getMonth() + 1;
- m = m < 10 ? ('0' + m) : m;
- var d = date.getDate();
- d = d < 10 ? ('0' + d) : d;
- var h = date.getHours();
- h = h < 10 ? ('0' + h) : h;
- var s = date.getSeconds();
- s = s < 10 ? ('0' + s) : s;
- var minute = date.getMinutes();
- var second = date.getSeconds();
- minute = minute < 10 ? ('0' + minute) : minute;
- second = second < 10 ? ('0' + second) : second;
- console.log(second)
- this.titlerid = y + '-' + m + '-' + d
- this.timeujyu = y +'' + m +'' + d
- this.params.dateYYYYMMDD = this.timeujyu
- console.log(this.timeujyu)
- this.params.pageNum = 1
- this.list=[]
- this.lists(this.params)
- // if(this.shougeflei == 0){
- // // 收割开始时间
- // this.xmGrowersRelationList[this.shougenum].harvestStartTime = y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + '00'
- // console.log(this.xmGrowersRelationList[this.shougenum].harvestStartTime)
- // }else if(this.shougeflei == 1){
- // //收割结束时间
- // this.xmGrowersRelationList[this.shougeendnum].harvestEndTime = y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + '00'
- // }else if(this.shougeflei == 2){
- // // 施肥开始时间
- // this.xmGrowersFertilizateList[this.ertili].fertilizationTime = y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + '00'
- // }else if(this.shougeflei == 3){
- // this.xmGrowersMedicineList[this.lication].medicineTime = y + '-' + m + '-' + d + ' ' + h + ':' + minute+ ':' + '00'
- // }
-
- // return this.shoutime
- }
- }
- }
- </script>
- <style lang="scss">
- .byes{
- border-bottom: 1px solid #D4D4D4;
- padding: 33upx;
- p{
- font-size: 28upx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #1E1E1E;
- }
- p:nth-child(2){
- font-family: PingFang SC;
- font-weight: 400;
- color: #1E1E1E;
- margin: 17upx 0;
- }
- p:nth-child(3){
- font-size: 22upx;
- font-family: PingFang SC;
- font-weight: 400;
- color: #737373;
- }
- }
- .souew{
- display: flex;
- width: 100%;
- position: relative;
- justify-content: space-between;
- margin-top: 20upx;
- .iconfr{
- position: absolute;
- top:50%;
- transform: translateY(-50%);
- left: 30upx;
- width: 33upx;
- height: 33upx;
- }
- .injue{
- width: 75%;
- height: 69upx;
- background-color: #eee;
- border-radius: 69upx;
- padding-left: 70upx;
- box-sizing: border-box;
- }
- .nhye{
- width: 20%;
- background-color: #2C60F1;
- height: 69upx;
- line-height: 69upx;
- color: #fff;
- font-size: 24upx;
- }
-
- }
-
- //暂无数据
- .zanwu {
- text-align: center;
- padding-top: 20upx;
-
- span {
- font-size: 24upx;
- }
- }
- .scroll-view {
- max-height: calc(100vh - 100upx);
- }
- .shax {
- // height: 83upx;
- font-size: 25upx;
- color: #666;
- text-align: center;
- }
- .dyn_box{
- .dyn_title{
- height: 98upx;
- display: flex;
- padding: 0 34upx;
- align-items: center;
- .dyn_item{
- margin-right: 69upx;
- display: flex;
- align-items: center;
- font-size: 25upx;
- color: #666666;
- span{
- margin-right: 15upx;
- }
- img{
- width: 21upx;
- height: 13upx;
- }
- }
- }
- table{
- thead{
- tr{
- background: #fff;
- color: #333333;
- font-weight: bold;
- }
- }
- tr{
- height: 83upx;
- display: flex;
- background: #fff;
- }
- .b{
- background: #fff;
- }
- .l{
- background: #F6F9FC;
- }
- th,td{
- flex: 1;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: 21upx;
- &:nth-of-type(4){
- flex: 2;
- }
- }
- tbody{
- td{
- &:nth-of-type(6){
- color: #32B16C;
- }
- }
-
- }
- }
- }
- .two_tr {
- display: flex;
- // padding: 0 50upx;
- box-sizing: border-box;
- justify-content: space-between;
-
- td {
- // flex: 1;
-
- font-size: 24upx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- line-height: 83upx;
- height: 83upx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-
- }
-
- .tdse {
- color: #E60012 !important;
- }
-
- .coiu {
- color: #32B16C;
- }
- }
-
- .two_trtwo {
- background-color: #F6F9FC !important;
- }
- </style>
|