index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='巡检记录'></cus-header>
  4. <div class="query">
  5. <div class="pre" @tap="selectQuery(1)">
  6. <span>{{statusText}}</span>
  7. <u-icon name="arrow-down-fill" color="#C0C4CC" size="20rpx"></u-icon>
  8. </div>
  9. <div class="pre" @tap="selectQuery(2)">
  10. <span>{{timeText}}</span>
  11. <u-icon name="arrow-down-fill" color="#C0C4CC" size="20rpx"></u-icon>
  12. </div>
  13. <div class="pre" @tap="selectQuery(3)">
  14. <span>{{placeText}}</span>
  15. <u-icon name="arrow-down-fill" color="#C0C4CC" size="20rpx"></u-icon>
  16. </div>
  17. </div>
  18. <div class="boxs" v-if="list.length">
  19. <div class="box" v-for="(item,index) in list" :key="index" @tap="toDetail(item)">
  20. <div class="top">
  21. <div class="left">{{'长鑫科技集团股份有限公司'}}</div>
  22. <div class="right">
  23. <div class="status" :class="{'zc':index===0,'yc':index===1}">{{index===0?'正常':'异常'}}</div>
  24. <image :src="imgBase+'operation/arrow_right.png'" mode="widthFix"></image>
  25. </div>
  26. </div>
  27. <div class="text">
  28. <div class="left">巡检时间</div>
  29. <p>{{'2025-03-28'}}</p>
  30. </div>
  31. <div class="text">
  32. <div class="left">巡检负责人</div>
  33. <p>{{'王安宇'}}</p>
  34. </div>
  35. </div>
  36. </div>
  37. <template v-else>
  38. <page-empty :height="'calc(100vh - 200px)'"></page-empty>
  39. </template>
  40. <div class="bottom">
  41. <div class="btn" @tap="addRecord">添加巡检记录</div>
  42. </div>
  43. <u-picker :itemHeight="88" :show="show1" :columns="columns1" keyName="label" title="巡检状态"
  44. @cancel="show1=false" @confirm="e=>confirm(e,1)" :immediateChange="true"></u-picker>
  45. <u-datetime-picker :itemHeight="88" :show="show2" v-model="queryParams.month" mode="year-month" title="巡检时间"
  46. @cancel="show2=false" @confirm="e=>confirm(e,2)" :immediateChange="true" :minDate="minDate" :maxDate="maxDate"></u-datetime-picker>
  47. <u-picker :itemHeight="88" :show="show3" :columns="columns3" keyName="label" title="巡检地点"
  48. @cancel="show3=false" @confirm="e=>confirm(e,3)" :immediateChange="true"></u-picker>
  49. </view>
  50. </template>
  51. <script>
  52. import pageEmpty from '@/components/pageEmpty/index.vue'
  53. export default {
  54. components:{
  55. pageEmpty
  56. },
  57. data(){
  58. return {
  59. statusText:'巡检状态',
  60. timeText:'巡检时间',
  61. placeText:'巡检地点',
  62. queryParams:{
  63. status:'',
  64. month:'',
  65. place:''
  66. },
  67. show1:false,
  68. show2:false,
  69. show3:false,
  70. columns1:[[
  71. {value:0,label:'正常'},
  72. {value:1,label:'异常'}
  73. ]],
  74. columns3:[[
  75. {value:1,label:'长鑫科技集团股份有限公司'},
  76. {value:2,label:'峻凌电子(合肥)有限公司'}
  77. ]],
  78. minDate:'',
  79. maxDate:'',
  80. page:1,
  81. limit:10,
  82. isOver:false,
  83. list:[]
  84. }
  85. },
  86. onReachBottom() {
  87. if(this.isOver) return
  88. this.getList();
  89. },
  90. onLoad() {
  91. let d = new Date();
  92. this.minDate = new Date(d.getFullYear()-3,d.getMonth()+1,d.getDate()).getTime();
  93. this.maxDate = new Date().getTime();
  94. this.getList();
  95. },
  96. methods:{
  97. getList(){
  98. this.list = [1,2]
  99. },
  100. selectQuery(type){
  101. if(type==1) this.show1 = true;
  102. else if(type==2) this.show2 = true;
  103. else if(type==3) this.show3 = true;
  104. },
  105. confirm(e,type){
  106. if(type==1){
  107. this.statusText = e.value[0].label;
  108. this.queryParams.status = e.value[0].value;
  109. this.show1 = false;
  110. }else if(type==2){
  111. this.timeText = new Date(e.value).Format('yyyy-MM');
  112. this.queryParams.month = new Date(e.value).Format('yyyy-MM');
  113. this.show2 = false;
  114. }else if(type==3){
  115. this.placeText = e.value[0].label;
  116. this.queryParams.place = e.value[0].value;
  117. this.show3 = false;
  118. }
  119. },
  120. addRecord(){
  121. uni.navigateTo({
  122. url:'/pagesOperation/record/add'
  123. })
  124. },
  125. toDetail(item){
  126. uni.navigateTo({
  127. url:'/pagesOperation/record/detail'
  128. })
  129. }
  130. }
  131. }
  132. </script>
  133. <style scoped lang="less">
  134. .page{
  135. padding-bottom: 168rpx;
  136. background: #F4F8FB;
  137. .query{
  138. width: 100%;
  139. height: 88rpx;
  140. background: #FFFFFF;
  141. display: flex;
  142. .pre{
  143. width: calc(100% / 3);
  144. height: 88rpx;
  145. display: flex;
  146. align-items: center;
  147. justify-content: center;
  148. span{
  149. font-family: PingFangSC, PingFang SC;
  150. font-weight: 400;
  151. font-size: 26rpx;
  152. color: #86909C;
  153. line-height: 26rpx;
  154. margin-right: 12rpx;
  155. }
  156. }
  157. }
  158. .boxs{
  159. padding: 0 24rpx;
  160. .box{
  161. background: #FFFFFF;
  162. border-radius: 16rpx;
  163. margin-top: 20rpx;
  164. padding: 36rpx 24rpx;
  165. .top{
  166. display: flex;
  167. align-items: center;
  168. justify-content: space-between;
  169. .left{
  170. width: calc(100% - 146rpx);
  171. padding-right: 20rpx;
  172. font-family: PingFang-SC, PingFang-SC;
  173. font-weight: bold;
  174. font-size: 30rpx;
  175. color: #1D2129;
  176. line-height: 30rpx;
  177. overflow: hidden;
  178. white-space: nowrap;
  179. text-overflow: ellipsis;
  180. }
  181. .right{
  182. display: flex;
  183. align-items: center;
  184. .status{
  185. width: 88rpx;
  186. height: 42rpx;
  187. border-radius: 6rpx;
  188. font-family: PingFang-SC, PingFang-SC;
  189. font-weight: bold;
  190. font-size: 26rpx;
  191. color: #FFFFFF;
  192. line-height: 42rpx;
  193. text-align: center;
  194. &.zc{
  195. background: #14CC8C;
  196. }
  197. &.yc{
  198. background: #FF4141;
  199. }
  200. }
  201. image{
  202. width: 24rpx;
  203. height: 24rpx;
  204. margin-left: 10rpx;
  205. }
  206. }
  207. }
  208. .text{
  209. margin-top: 36rpx;
  210. display: flex;
  211. align-items: center;
  212. .left{
  213. width: 168rpx;
  214. font-family: PingFangSC, PingFang SC;
  215. font-weight: 400;
  216. font-size: 26rpx;
  217. color: #86909C;
  218. line-height: 26rpx;
  219. }
  220. p{
  221. font-family: PingFangSC, PingFang SC;
  222. font-weight: 400;
  223. font-size: 26rpx;
  224. color: #1D2129;
  225. line-height: 26rpx;
  226. }
  227. }
  228. }
  229. }
  230. .bottom{
  231. width: 100%;
  232. height: 148rpx;
  233. padding: 20rpx 48rpx;
  234. box-sizing: border-box;
  235. background: #FFFFFF;
  236. position: fixed;
  237. bottom: 0;
  238. left: 0;
  239. z-index: 9;
  240. .btn{
  241. width: 100%;
  242. height: 88rpx;
  243. background: #2E69EB;
  244. border-radius: 16rpx;
  245. font-family: PingFang-SC, PingFang-SC;
  246. font-weight: bold;
  247. font-size: 32rpx;
  248. color: #FFFFFF;
  249. line-height: 88rpx;
  250. text-align: center;
  251. }
  252. }
  253. }
  254. </style>