par_dynamic.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <template>
  2. <div class="dyn_box">
  3. <div class="dyn_title">
  4. <!-- <div class="dyn_item" @click="studentXuan"> -->
  5. <div class="souew">
  6. <img src="@/static/icon_lsjl_ss.png" alt="" class="iconfr">
  7. <input type="text" v-model="nhese" class="injue" placeholder="请输入要查询的查询码">
  8. <button class="nhye" @click="seache" >搜索</button>
  9. </div>
  10. <!-- <van-search
  11. :value="value"
  12. shape="round"
  13. background="#4fc08d"
  14. placeholder="请输入搜索关键词"
  15. /> -->
  16. <!-- </div> -->
  17. <!-- <div class="dyn_item" @click="riqu">
  18. <span>{{titlerid}}</span>
  19. <img src="@/static/icon_xsdt_sx_xl@2x.png" alt="" class="icon">
  20. </div> -->
  21. </div>
  22. <div>
  23. <scroll-view scroll-y class="scroll-view" upper-threshold="40" lower-threshold="40" @scrolltolower="bot_btn">
  24. <div class="byes" v-for="(item,index) in list" :key="index" @click="nhje(item)">
  25. <p>{{item.reportNumber}}</p>
  26. <p>{{item.createTime}}</p>
  27. </div>
  28. <div class="shax" v-show="listShow">
  29. {{wtdt}}
  30. </div>
  31. </scroll-view>
  32. <div class="zanwu " v-show="!listShow"><span>暂无数据</span></div>
  33. </div>
  34. <!-- <table>
  35. <thead>
  36. <tr>
  37. <th style="width: 130upx;text-align: center;">姓名</th>
  38. <th style="width: 60upx; text-align: center;">性别</th>
  39. <th style="width: 100upx; text-align: center;">班级</th>
  40. <th style="width: 100upx; text-align: center;">扫码时间</th>
  41. <th style="width: 100upx; text-align: center;">温度(℃)</th>
  42. <th style="width: 60upx; text-align: center;">详细信息</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. </tbody>
  47. </table> -->
  48. <!-- //时间选择 -->
  49. <!-- <van-popup :show="showtime" @close="onClosetime" position="bottom">
  50. <van-datetime-picker
  51. type="date"
  52. :value="currentDate"
  53. :min-date="minDate"
  54. :max-date="maxDate"
  55. :formatter="formatter"
  56. @input="onInput"
  57. @confirm = "timeone"
  58. @cancel = "itemcel"
  59. />
  60. </van-popup> -->
  61. <!-- //选择学生 -->
  62. <!-- <van-popup :show="stushow" @close="stuonClose" position="bottom">
  63. <van-picker :columns="columns" @change="stuonChange" show-toolbar
  64. title="信息" @cancel="stuCancel" @confirm="stuConfirm"/>
  65. </van-popup> -->
  66. </div>
  67. </template>
  68. <script>
  69. export default{
  70. data() {
  71. return {
  72. showtime:false,
  73. currentDate: 0,
  74. titlerid:'扫码日期',
  75. studentseL:'选择学生',
  76. value:'',
  77. minDate:0,
  78. maxDate:0,
  79. minHour: 10,
  80. maxHour: 20,
  81. columns:[],
  82. stushow:false,
  83. phone:0,
  84. listShow: true, //判断是否有数据 true 有
  85. haveMore: true,
  86. timeujyu:'',
  87. wtdt: '上拉加载更多',
  88. params: { //上拉刷新
  89. pageSize: 20,
  90. pageNum: 1,
  91. // parentPhone: '', //查询
  92. // // complate: '',
  93. // // classId:'',
  94. // reportNumber: undefined
  95. },
  96. list:[],
  97. nhese:''
  98. }
  99. },
  100. onLoad() {
  101. this.phone = uni.getStorageSync('phone')
  102. this.params.queryPhone = uni.getStorageSync('phone')
  103. console.log(uni.getStorageSync('phone'),34)
  104. // this.params.parentPhone = 15855353281
  105. let token = uni.getStorageSync('phone')
  106. if(!token){
  107. uni.redirectTo({
  108. url: '/pages/login/login'
  109. })
  110. return false
  111. }
  112. // this.bingeList()
  113. this.lists(this.params)
  114. },
  115. onShow() {
  116. // let iutem = new Date().getFullYear() + 1
  117. this.maxDate = new Date(2020,12,1).getTime()
  118. this.minDate= new Date(2017, 10, 1).getTime()
  119. // this.currentDate = new Date().getTime()
  120. // console.log(new Date().getFullYear() + 1 , new Date(2019, 10, 1).getTime() )
  121. },
  122. //下拉刷新
  123. onPullDownRefresh() {
  124. console.log(234)
  125. wx.showNavigationBarLoading()
  126. // uni.showLoading({
  127. // title: '刷新中...',
  128. // })
  129. // this.currentTab = 0
  130. this.params.pageNum = 1
  131. // this.tehu = '请选择班级'
  132. this.params = { //上拉刷新
  133. pageSize: 20,
  134. pageNum: 1,
  135. // searchValue: '', //查询
  136. // // // classId:'',
  137. // reportNumber:undefined
  138. }, //查询
  139. // this.paramstwo = {
  140. // searchValue: '', //查询
  141. // // complate: '',
  142. // // classId:'',
  143. // deptId: ''
  144. // }
  145. this.nhese = ''
  146. this.titlerid = '扫码日期'
  147. this.studentseL="选择学生"
  148. // this.params.parentPhone = uni.getStorageSync('phone')
  149. this.params.queryPhone = uni.getStorageSync('phone')
  150. this.list = []
  151. // this.studentnum(this.paramstwo)
  152. // this.terd = ''
  153. this.lists(this.params)
  154. // uni.stopPullDownRefresh()
  155. // self.getNewList()
  156. // self.getLun()
  157. },
  158. methods:{
  159. //获取学生信息接口
  160. bingeList(){
  161. const _this = this
  162. this.$http.post("gateway/query/miniProgramQueryLog" + this.phone).then(res => {
  163. console.log(res)
  164. if(res.code == 200){
  165. console.log(res.data.length)
  166. this.lkeiLIst = res.data
  167. this.lkeiLIst.filter(router => {
  168. this.columns.push(router.name)
  169. })
  170. console.log(this.lkeiLIst)
  171. console.log(this.columns)
  172. }else {
  173. uni.showToast({
  174. title: res.msg,
  175. duration: 1000,
  176. icon: 'none'
  177. });
  178. }
  179. // console.log(this.studenList)
  180. })
  181. },
  182. //查询列表
  183. lists(params) {
  184. var str='?pageSize='+params.pageSize+'&pageNum='+params.pageNum+'&queryPhone='+params.queryPhone;
  185. if(params.reportNumber){
  186. str=str+"&reportNumber="+params.reportNumber
  187. }
  188. this.$http.post("gateway/query/miniProgramQueryLog"+str).then(res => {
  189. //停止下拉加载
  190. uni.hideNavigationBarLoading()
  191. uni.stopPullDownRefresh()
  192. if (res.code == 200) {
  193. if (res.rows.length < params.pageSize) {
  194. this.listShow = false
  195. this.haveMore = false
  196. } else {
  197. var num=parseInt(res.rows.length)+parseInt(params.pageSize)*parseInt(params.pageNum-1)
  198. if(num<res.total){
  199. this.listShow = true
  200. this.haveMore = true
  201. }else{
  202. this.listShow = false
  203. this.haveMore = false
  204. }
  205. }
  206. if(params.pageSize==1){
  207. this.list = res.rows
  208. }else{
  209. this.list = this.list.concat(res.rows)
  210. }
  211. // this.shoue = true
  212. // if(res.data.current != res.data.pageNum) {
  213. // if(res.data.pageNum == 0){
  214. // this.list = res.rows
  215. // }
  216. // this.list = this.list.concat(res.rows)
  217. // this.list.filter(route => {
  218. // console.log(route,98)
  219. // if(route.sex == 1){
  220. // route.sex = '女'
  221. // }else if(route.sex == 0){
  222. // route.sex = '男'
  223. // }
  224. // //采集判断
  225. // if(route.picture == ''){ //未采集
  226. // this.Collected = true
  227. // }else {
  228. // this.Collected = false
  229. // }
  230. // // console.log(this.Collected)
  231. // })
  232. // this.params.pageNum +=1
  233. // this.haveMore = true
  234. // } else {
  235. // if(this.params.pageNum !==1){
  236. // this.list = this.list.concat(res.rows)
  237. // }else {
  238. // this.list = res.rows
  239. // }
  240. // this.list.filter(route => {
  241. // console.log(route,98)
  242. // if(route.sex == 1){
  243. // route.sex = '女'
  244. // }else if(route.sex == 0){
  245. // route.sex = '男'
  246. // }
  247. // //采集判断
  248. // if(route.picture == ''){
  249. // //未采集
  250. // this.Collected = true
  251. // }else {
  252. // this.Collected = false
  253. // }
  254. // // console.log(this.Collected)
  255. // })
  256. // // console.log(111)
  257. // this.haveMore = false
  258. // this.shoue = true
  259. // this.wtdt = '暂无更多数据'
  260. // }
  261. } else {
  262. uni.showToast({
  263. title: res.msg,
  264. duration: 1000,
  265. icon: 'none'
  266. });
  267. }
  268. })
  269. },
  270. // 搜索
  271. seache(){
  272. this.params.reportNumber= this.nhese
  273. this.params.pageNum = 1
  274. this.list = []
  275. this.lists(this.params)
  276. console.log(this.params.reportNumber , this.nhese)
  277. },
  278. // 点击查看详情
  279. nhje(id){
  280. // id.reportNumber = 'NO:ASJ(0000)QG —001号'
  281. const _this = this
  282. this.$http.posta("gateway/query/queryReportNum" , {reportNumber:id.reportNumber}).then(res => {
  283. console.log(res)
  284. if(res.code == 200){
  285. console.log(res.data.length)
  286. let hjees = JSON.stringify(res.data)
  287. wx.navigateTo({
  288. url: '/pages/home/recordtwo?code=' + hjees
  289. })
  290. }else {
  291. uni.showToast({
  292. title: res.msg,
  293. duration: 1000,
  294. icon: 'none'
  295. });
  296. }
  297. // console.log(this.studenList)
  298. })
  299. },
  300. look_btn(item) {
  301. console.log(item)
  302. let liy = JSON.stringify(item)
  303. uni.navigateTo({
  304. url: '/pages/parents/par_dynamic_dec?iju=' +liy
  305. })
  306. uni.setStorageSync('item', item)
  307. },
  308. riqu(){
  309. this.showtime = true
  310. console.log(234)
  311. },
  312. onClosetime(){
  313. this.showtime = false
  314. },
  315. stuonClose(){
  316. this.stushow = false
  317. },
  318. onInput(event) {
  319. // console.log(event)
  320. this.currentDate = event.detail
  321. },
  322. itemcel(){
  323. this.showtime = false
  324. },
  325. timeone(event){
  326. console.log(event)
  327. this.formatDateTime(event.detail,0)
  328. this.showtime = false
  329. },
  330. onChange(event){
  331. console.log(event.detail)
  332. },
  333. //刷新
  334. bot_btn() {
  335. if (this.haveMore) {
  336. this.params.pageNum++
  337. this.lists(this.params)
  338. }
  339. },
  340. stuonChange(){
  341. },
  342. studentXuan(){
  343. this.stushow = true
  344. },
  345. stuConfirm(event){
  346. this.studentseL = event.detail.value
  347. console.log(event.detail)
  348. console.log(this.lkeiLIst[event.detail.index].pid)
  349. this.params.pageNum = 1
  350. this.params.pid = this.lkeiLIst[event.detail.index].pid
  351. this.list=[]
  352. this.lists(this.params)
  353. this.stushow = false
  354. },
  355. stuCancel(){
  356. this.stushow = false
  357. },
  358. formatter(type, value){
  359. if (type === 'year') {
  360. return `${value}年`;
  361. } else if (type === 'month') {
  362. return `${value}月`;
  363. }
  364. return value;
  365. },
  366. // 时间格式化
  367. formatDateTime(inputTime) {
  368. var date = new Date(inputTime);
  369. var y = date.getFullYear();
  370. var m = date.getMonth() + 1;
  371. m = m < 10 ? ('0' + m) : m;
  372. var d = date.getDate();
  373. d = d < 10 ? ('0' + d) : d;
  374. var h = date.getHours();
  375. h = h < 10 ? ('0' + h) : h;
  376. var s = date.getSeconds();
  377. s = s < 10 ? ('0' + s) : s;
  378. var minute = date.getMinutes();
  379. var second = date.getSeconds();
  380. minute = minute < 10 ? ('0' + minute) : minute;
  381. second = second < 10 ? ('0' + second) : second;
  382. console.log(second)
  383. this.titlerid = y + '-' + m + '-' + d
  384. this.timeujyu = y +'' + m +'' + d
  385. this.params.dateYYYYMMDD = this.timeujyu
  386. console.log(this.timeujyu)
  387. this.params.pageNum = 1
  388. this.list=[]
  389. this.lists(this.params)
  390. // if(this.shougeflei == 0){
  391. // // 收割开始时间
  392. // this.xmGrowersRelationList[this.shougenum].harvestStartTime = y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + '00'
  393. // console.log(this.xmGrowersRelationList[this.shougenum].harvestStartTime)
  394. // }else if(this.shougeflei == 1){
  395. // //收割结束时间
  396. // this.xmGrowersRelationList[this.shougeendnum].harvestEndTime = y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + '00'
  397. // }else if(this.shougeflei == 2){
  398. // // 施肥开始时间
  399. // this.xmGrowersFertilizateList[this.ertili].fertilizationTime = y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + '00'
  400. // }else if(this.shougeflei == 3){
  401. // this.xmGrowersMedicineList[this.lication].medicineTime = y + '-' + m + '-' + d + ' ' + h + ':' + minute+ ':' + '00'
  402. // }
  403. // return this.shoutime
  404. }
  405. }
  406. }
  407. </script>
  408. <style lang="scss">
  409. .byes{
  410. border-bottom: 1px solid #D4D4D4;
  411. padding: 33upx;
  412. p{
  413. font-size: 28upx;
  414. font-family: PingFang SC;
  415. font-weight: bold;
  416. color: #1E1E1E;
  417. }
  418. p:nth-child(2){
  419. font-family: PingFang SC;
  420. font-weight: 400;
  421. color: #1E1E1E;
  422. margin: 17upx 0;
  423. }
  424. p:nth-child(3){
  425. font-size: 22upx;
  426. font-family: PingFang SC;
  427. font-weight: 400;
  428. color: #737373;
  429. }
  430. }
  431. .souew{
  432. display: flex;
  433. width: 100%;
  434. position: relative;
  435. justify-content: space-between;
  436. margin-top: 20upx;
  437. .iconfr{
  438. position: absolute;
  439. top:50%;
  440. transform: translateY(-50%);
  441. left: 30upx;
  442. width: 33upx;
  443. height: 33upx;
  444. }
  445. .injue{
  446. width: 75%;
  447. height: 69upx;
  448. background-color: #eee;
  449. border-radius: 69upx;
  450. padding-left: 70upx;
  451. box-sizing: border-box;
  452. }
  453. .nhye{
  454. width: 20%;
  455. background-color: #2C60F1;
  456. height: 69upx;
  457. line-height: 69upx;
  458. color: #fff;
  459. font-size: 24upx;
  460. }
  461. }
  462. //暂无数据
  463. .zanwu {
  464. text-align: center;
  465. padding-top: 20upx;
  466. span {
  467. font-size: 24upx;
  468. }
  469. }
  470. .scroll-view {
  471. max-height: calc(100vh - 100upx);
  472. }
  473. .shax {
  474. // height: 83upx;
  475. font-size: 25upx;
  476. color: #666;
  477. text-align: center;
  478. }
  479. .dyn_box{
  480. .dyn_title{
  481. height: 98upx;
  482. display: flex;
  483. padding: 0 34upx;
  484. align-items: center;
  485. .dyn_item{
  486. margin-right: 69upx;
  487. display: flex;
  488. align-items: center;
  489. font-size: 25upx;
  490. color: #666666;
  491. span{
  492. margin-right: 15upx;
  493. }
  494. img{
  495. width: 21upx;
  496. height: 13upx;
  497. }
  498. }
  499. }
  500. table{
  501. thead{
  502. tr{
  503. background: #fff;
  504. color: #333333;
  505. font-weight: bold;
  506. }
  507. }
  508. tr{
  509. height: 83upx;
  510. display: flex;
  511. background: #fff;
  512. }
  513. .b{
  514. background: #fff;
  515. }
  516. .l{
  517. background: #F6F9FC;
  518. }
  519. th,td{
  520. flex: 1;
  521. display: flex;
  522. align-items: center;
  523. justify-content: center;
  524. font-size: 21upx;
  525. &:nth-of-type(4){
  526. flex: 2;
  527. }
  528. }
  529. tbody{
  530. td{
  531. &:nth-of-type(6){
  532. color: #32B16C;
  533. }
  534. }
  535. }
  536. }
  537. }
  538. .two_tr {
  539. display: flex;
  540. // padding: 0 50upx;
  541. box-sizing: border-box;
  542. justify-content: space-between;
  543. td {
  544. // flex: 1;
  545. font-size: 24upx;
  546. font-family: PingFang SC;
  547. font-weight: 500;
  548. color: #333333;
  549. line-height: 83upx;
  550. height: 83upx;
  551. overflow: hidden;
  552. text-overflow: ellipsis;
  553. white-space: nowrap;
  554. }
  555. .tdse {
  556. color: #E60012 !important;
  557. }
  558. .coiu {
  559. color: #32B16C;
  560. }
  561. }
  562. .two_trtwo {
  563. background-color: #F6F9FC !important;
  564. }
  565. </style>