index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view>
  3. <view style="box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);margin-bottom: 20rpx">
  4. <u-tabs :list="list" :is-scroll="false" :current="current" @change="changetwo"></u-tabs>
  5. </view>
  6. <view v-for="(item,index) in dataList" :key="index"
  7. style="box-shadow: 0px 0px 8px 0px rgba(165, 189, 251, 0.4);width: 96%;border-top-right-radius: 10rpx;margin: 10rpx auto;padding-top: 10rpx;">
  8. <span
  9. style="width: 10rpx;height: 40rpx;background-color: #2979ff;display: block;float: left;margin-top: 10rpx;"></span>
  10. <h4 style="width: 140rpx;border-radius: 200rpx;text-align: center;color: #2979ff;border: 2rpx solid #1785FF;float: right;margin-right: 10rpx;margin-top: 10rpx;">{{item.fInspectorName}}</h4>
  11. <view style="width: 90%;margin: 0 auto;margin: 0 auto;">
  12. <view
  13. style="display: flex;justify-content: space-between;height: 60rpx;line-height: 60rpx;border-bottom: 1rpx solid #eff4ff;">
  14. <h4>{{item.fWarehouseName}}</h4>
  15. </view>
  16. <view>
  17. <view style="width: 100%;height: 60rpx;line-height: 60rpx;">
  18. <view style="float: left;">计划日期</view>
  19. <view style="float: right;">{{item.fInspectionDatetime}}</view>
  20. </view>
  21. <view style="width: 100%;height: 60rpx;line-height: 60rpx;">
  22. <view style="float: left;">最新巡查日期</view>
  23. <view style="float: right;">{{item.fUpdateTime}}</view>
  24. </view>
  25. <view style="width: 100%;height: 60rpx;line-height: 60rpx;">
  26. <view style="float: left;">备注</view>
  27. <view style="float: right;">{{item.remark}}</view>
  28. </view>
  29. </view>
  30. <view style="width: 100%;margin: 0 auto;height: 80rpx;margin: 0 auto;line-height: 80rpx;border-top: 1rpx solid #eff4ff;"
  31. @click="expenseDetails(item)">
  32. <view style="float: left;">
  33. <h3>立即巡检</h3>
  34. </view>
  35. <view style="float: right;">
  36. <u-icon name="arrow-right"></u-icon>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. <u-loadmore :status="status" :icon-type="iconType" :load-text="loadText" />
  42. <u-calendar :closeable="false" v-model="show" mode="date" @change="change" :mask-close-able="false"></u-calendar>
  43. <u-action-sheet :list="warehouseList" @click="click" @close="close" :mask-close-able="false" v-model="warehouse"></u-action-sheet>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. show: false,
  51. status: 'loadmore',
  52. warehouseList:[],
  53. warehouse:false,
  54. loadText: {
  55. loadmore: '轻轻上拉',
  56. loading: '努力加载中',
  57. nomore: '实在没有了'
  58. },
  59. iconType: 'flower',
  60. dataList: [],
  61. list: [{
  62. name: '全部'
  63. }, {
  64. name: '仓库'
  65. }, {
  66. name: '计划日期'
  67. }, {
  68. name: '今日计划'
  69. }],
  70. form: {
  71. pageNum: 1,
  72. pageSize: 10,
  73. fInspectionDatetime: new Date().toLocaleDateString().replace(/\//g,"-")
  74. },
  75. current: 3,
  76. total: 0,
  77. }
  78. },
  79. created() {
  80. this.query()
  81. this.$u.get('/warehouse/check/selectTWarehouseListInCheck').then(res=>{
  82. console.log(res)
  83. for(let item in res.rows){
  84. this.warehouseList.push({
  85. text:res.rows[item].fName,
  86. fId:res.rows[item].fId
  87. })
  88. }
  89. console.log(this.warehouseList)
  90. })
  91. },
  92. onReachBottom() {
  93. this.status = 'loading'
  94. if (this.dataList.length < this.total) {
  95. this.form.pageNum++
  96. this.query()
  97. } else {
  98. this.status = 'nomore'
  99. }
  100. },
  101. methods: {
  102. close(){
  103. this.current = null
  104. },
  105. click(index){
  106. console.log(index)
  107. this.form.fWarehouseFid = this.warehouseList[index].fId
  108. this.dataList = []
  109. this.current = null
  110. this.query()
  111. },
  112. query() {
  113. // this.current = null
  114. this.$u.get('/warehouse/checkitems/listByUser', this.form).then(res => {
  115. this.dataList = this.dataList.concat(res.rows)
  116. this.total = res.total
  117. if (res.total === 0) this.status = 'nomore'
  118. })
  119. },
  120. change(e) {
  121. // console.log(e)
  122. this.current = null
  123. this.form.fInspectionDatetime = e.result
  124. this.dataList = []
  125. this.query()
  126. },
  127. changetwo(index) {
  128. console.log(index)
  129. if (index === 1) this.warehouse = true
  130. if (index === 2) this.show = true
  131. if (index === 3){
  132. this.form.fInspectionDatetime = new Date().toLocaleDateString().replace(/\//g,"-")
  133. this.dataList = []
  134. this.query()
  135. }
  136. if (index === 0) {
  137. this.form = {
  138. pageNum: 1,
  139. pageSize: 10
  140. }
  141. this.query()
  142. }
  143. this.current = index;
  144. },
  145. expenseDetails(item) {
  146. this.$u.route('/pages/home/patrolInspection/patrolDetails', {
  147. form: JSON.stringify(item)
  148. });
  149. },
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .wrap {
  155. padding: 24rpx;
  156. }
  157. .item {
  158. padding: 24rpx 0;
  159. color: $u-content-color;
  160. font-size: 28rpx;
  161. }
  162. </style>