warranty.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="car">
  3. <view class="cartop">
  4. <!-- <view class="topa flexc">
  5. <image :src="reset" class="resetimg" @click="getReset"></image>
  6. <picker mode="date" @change='bindDateChangea'>
  7. <view class="chekt flexc">
  8. <view>{{cxrq|| "选择日期"}}</view>
  9. <image :src="up"></image>
  10. </view>
  11. </picker>
  12. <view class="search flexc">
  13. <image :src="search"></image>
  14. <input placeholder="请输入房号进行搜索" v-model="text"/>
  15. <view class="btn" @click="getConfirm">搜索</view>
  16. </view>
  17. </view> -->
  18. <view class="tabtop flexc">
  19. <view class="tabt" :class="ttopval==ite.val?'act':''" v-for="(ite,idx) in ttoplist" :key="idx" @click="getTabtop(ite.val)">{{ite.tit}}</view>
  20. </view>
  21. </view>
  22. <!-- 列表 -->
  23. <view class="carlists">
  24. <box-list :datainfo="list" :topval="ttopval" :wtdt="wtdt" type='warranty' @getDetail="getDetail"></box-list>
  25. </view>
  26. <view class="rfbtn" @click="getAddFn">我要报修</view>
  27. <loading></loading>
  28. </view>
  29. </template>
  30. <script>
  31. import config from '@/config'
  32. const baseUrl = config.baseUrl
  33. import boxList from "@/work/components/box/list.vue"
  34. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  35. export default{
  36. components:{boxList},
  37. data(){
  38. return{
  39. // reset:require('@/work/static/car/reset.png'),
  40. // search:require('@/work/static/car/search.png'),
  41. // up:require('@/work/static/car/up.png'),
  42. cxrq:"",
  43. text:'',
  44. list:[{tit:'皖A IC520',type:1},{tit:'晋E KD783',type:2},],
  45. pageSize: 10,
  46. pageNum: 1,
  47. reachflag: true,
  48. wtdt:'',
  49. ttopval:'0',
  50. ttoplist:[{tit:'全部报修',val:0},{tit:'待指派',val:1},{tit:'处理中',val:2},{tit:'已完成',val:2}]
  51. }
  52. },
  53. onLoad: function() {
  54. },
  55. // 上拉触底加载更多触发事件
  56. onReachBottom() {
  57. if (this.reachflag) {
  58. this.pageNum++
  59. this.getDataFn()
  60. }
  61. },
  62. methods:{
  63. checkPermi, checkRole,
  64. getDetail(){
  65. this.$tab.navigateTo("/work/pages/service/warrantydetail")
  66. },
  67. getAddFn(){
  68. this.$tab.navigateTo("/work/pages/service/warrantyadd")
  69. },
  70. getTabtop(val){
  71. this.ttopval=val
  72. },
  73. getConfirm(){
  74. this.getrefreshData()
  75. },
  76. getReset(){
  77. this.cxrq='';
  78. this.text='';
  79. this.getrefreshData()
  80. },
  81. getrefreshData(){
  82. this.pageNum=1;
  83. this.list=[];
  84. this.reachflag=true;
  85. this.getDataFn()
  86. },
  87. getTabFn(val){
  88. this.tabval=val
  89. },
  90. bindDateChangea(e){
  91. var val=e.detail.value;
  92. this.cxrq=val;
  93. },
  94. getDataFn(){
  95. var params={
  96. pageSize:this.pageSize,
  97. pageNum: this.pageNum,
  98. }
  99. params.noticeType=this.tabidx
  100. getNoticeList(params).then(res=>{
  101. if(res.code==200){
  102. if (res.rows.length < this.pageSize) {
  103. this.reachflag = false
  104. this.wtdt = '到底了~';
  105. } else {
  106. var num = parseInt(res.rows.length) + parseInt(this.pageSize) * parseInt(this.pageNum - 1)
  107. if (num < res.total) {
  108. this.reachflag = true
  109. this.wtdt = ''
  110. } else {
  111. this.reachflag = false
  112. this.wtdt = '到底了~';
  113. }
  114. }
  115. if (this.pageNum == 1) {
  116. this.list = res.rows;
  117. } else {
  118. this.list = this.list.concat(res.rows)
  119. }
  120. }else{
  121. this.$toast(res.msg)
  122. }
  123. })
  124. },
  125. }
  126. }
  127. </script>
  128. <style>
  129. page{background: #F3F3F0;}
  130. </style>
  131. <style lang="scss" scoped>
  132. .car{padding: 146rpx 0 110rpx;}
  133. .cartop{position: fixed;left: 0;right: 0;top: 0;background-color: #ffffff;z-index: 2;
  134. .topa{padding: 20rpx ;
  135. .resetimg{width: 36rpx;height: 36rpx;margin-right: 24rpx;flex: 0 0 auto;}
  136. .chekt{min-width: 180rpx;
  137. view{font-weight: 500;font-size: 26rpx;color: #272727;flex: 1;}
  138. image{width: 24rpx;height: 16rpx;margin-left: 18rpx;flex: 0 0 auto;}
  139. }
  140. .search{flex: 1;margin-left: 16rpx;height: 64rpx;background: #EEEEEE;border-radius: 32rpx;border: 2rpx solid #E6E6E6;padding-left: 24rpx;box-sizing: border-box;
  141. image{width: 32rpx;height: 34rpx;margin-right: 22rpx;flex: 0 0 auto;}
  142. input{flex: 1;font-size: 26rpx;color: #272727;}
  143. .btn{width: 100rpx;height: 64rpx;background: #3565ED;border-radius: 32rpx;flex: 0 0 auto;font-weight: bold;text-align: center;line-height: 64rpx;
  144. font-size: 26rpx;
  145. color: #FFFFFF;}
  146. }
  147. }
  148. .tabtop{padding-bottom: 40rpx;padding-top: 26rpx;
  149. .tabt{font-weight: 500;font-size: 32rpx;color: #666666;position: relative;line-height: 56rpx;padding: 0 40rpx;
  150. &.act{font-weight: bold;font-size: 32rpx;color: #272727;
  151. &::after{content: '';width: 40rpx;height: 10rpx;background: #0156FE;border-radius: 6rpx;position: absolute;left: 50%;margin-left: -20rpx;bottom: -10rpx;}
  152. }
  153. }
  154. }
  155. }
  156. .carlists{padding: 0 18rpx;}
  157. </style>