index.vue 7.0 KB

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