index.vue 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='运维服务' bgColor="transparent" :showback="false"></cus-header>
  4. <image class="topbg" :src="imgBase+'operation/top_bg.png'" mode="widthFix"></image>
  5. <div class="order">
  6. <div class="pre">
  7. <div class="top">
  8. <div class="left">
  9. <p>本月巡检次数</p>
  10. <p>{{5}}/{{40}}</p>
  11. </div>
  12. <div class="right">
  13. <p>异常:<span>{{0}}</span></p>
  14. <p>正常:<span>{{40}}</span></p>
  15. </div>
  16. </div>
  17. <div class="bottom">
  18. <div class="jd" :style="{'width':10+'%'}"></div>
  19. </div>
  20. </div>
  21. <div class="pre">
  22. <div class="top">
  23. <div class="left">
  24. <p>故障工单</p>
  25. <p>{{14}}/{{28}}</p>
  26. </div>
  27. <div class="right">
  28. <p>已解决:<span>{{5}}</span></p>
  29. <p>未解决:<span>{{40}}</span></p>
  30. </div>
  31. </div>
  32. <div class="bottom">
  33. <div class="jd green" :style="{'width':50+'%'}"></div>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="menu">
  38. <div class="pre" @tap="turnPage('/pagesOperation/record/add')">
  39. <image :src="imgBase+'operation/menu_xjtd.png'" mode="widthFix"></image>
  40. <p>巡检提单</p>
  41. </div>
  42. <div class="pre" @tap="turnPage('/pagesOperation/record/index')">
  43. <image :src="imgBase+'operation/menu_xjjl.png'" mode="widthFix"></image>
  44. <p>巡检记录</p>
  45. </div>
  46. <div class="pre" @tap="turnPage('/pagesOperation/repair/index')">
  47. <image :src="imgBase+'operation/menu_gzbx.png'" mode="widthFix"></image>
  48. <p>故障报修</p>
  49. </div>
  50. <div class="pre" @tap="turnPage('/pagesOperation/workorder/index')">
  51. <image :src="imgBase+'operation/menu_gzgd.png'" mode="widthFix"></image>
  52. <p>故障工单</p>
  53. </div>
  54. </div>
  55. <div class="list">
  56. <div class="title">
  57. <div class="left">故障工单</div>
  58. <div class="right" @tap="turnPage('/pagesOperation/workorder/index')">
  59. <span>更多</span>
  60. <image :src="imgBase+'operation/arrow_right.png'" mode="widthFix"></image>
  61. </div>
  62. </div>
  63. <div class="boxs" v-if="dataList.length">
  64. <div class="item" v-for="(item,index) in dataList" :key="index">
  65. <div class="left">
  66. <div class="name">{{item.customer||''}}</div>
  67. <p>故障类型<span>{{item.typeName}}</span></p>
  68. <p>故障描述<span>{{item.description||''}}</span></p>
  69. <p>故障时间<span>{{item.happenDate||''}}</span></p>
  70. </div>
  71. <div class="right">
  72. <div class="top" :class="{'djj':item.status===0,'yjj':item.status===1}">{{item.status===0?'待解决':'已解决'}}</div>
  73. <div class="bottom" @tap="toDetail(item)">查看</div>
  74. </div>
  75. </div>
  76. </div>
  77. <template v-else>
  78. <page-empty :height="'calc(100vh - 200px)'"></page-empty>
  79. </template>
  80. </div>
  81. </view>
  82. </template>
  83. <script>
  84. import pageEmpty from '../../components/pageEmpty/index.vue'
  85. export default {
  86. components:{
  87. pageEmpty
  88. },
  89. data(){
  90. return {
  91. isOver:false,
  92. params:{
  93. page:1,
  94. limit:2
  95. },
  96. dataList:[],
  97. typeList:[],
  98. }
  99. },
  100. onShow() {
  101. this.getTypeList();
  102. },
  103. methods:{
  104. turnPage(url){
  105. if(!url) return
  106. uni.navigateTo({ url })
  107. },
  108. getTypeList(){
  109. this.$api.get('/sys/dict/data/getListByType/wms_operation_category').then(res=>{
  110. if(res.data.code===0){
  111. this.typeList = res.data.data;
  112. this.getDataList();
  113. }else this.$showToast(res.data.msg)
  114. })
  115. },
  116. getDataList(){
  117. this.$api.get('/wms/order/operation/page',{page:1,limit:2}).then(res=>{
  118. if(res.data.code===0){
  119. if(this.dataList.length<res.data.data.total){
  120. this.params.page++;
  121. this.dataList = [...this.dataList,...res.data.data.list];
  122. this.dataList.forEach(d=>{
  123. d.typeName = this.typeList.find(t=>t.dictValue==d.optCategory)?.dictLabel;
  124. })
  125. }else this.isOver = true
  126. }else this.$showModal(res.data.msg)
  127. });
  128. },
  129. toDetail(item){
  130. uni.navigateTo({
  131. url:'/pagesOperation/workorder/detail?id='+item?.id
  132. })
  133. }
  134. }
  135. }
  136. </script>
  137. <style scoped lang="less">
  138. .page{
  139. padding: 0 24rpx 40rpx;
  140. background: #F5F8FA;
  141. box-sizing: border-box;
  142. .topbg{
  143. width: 100%;
  144. position: fixed;
  145. top: 0;
  146. left: 0;
  147. z-index: 0;
  148. }
  149. .order{
  150. display: flex;
  151. justify-content: space-between;
  152. position: relative;
  153. margin-top: 218rpx;
  154. .pre{
  155. width: calc(50% - 9rpx);
  156. background: rgba(255,255,255,0.7);
  157. border-radius: 12rpx;
  158. border: 2rpx solid #FFFFFF;
  159. padding: 30rpx 20rpx;
  160. box-sizing: border-box;
  161. .top{
  162. display: flex;
  163. align-items: center;
  164. justify-content: space-between;
  165. .left{
  166. p{
  167. font-family: PingFangSC, PingFang SC;
  168. font-weight: 400;
  169. font-size: 24rpx;
  170. color: #657588;
  171. line-height: 24rpx;
  172. &:last-child{
  173. font-family: DINAlternate, DINAlternate;
  174. font-weight: bold;
  175. font-size: 36rpx;
  176. color: #333333;
  177. line-height: 36rpx;
  178. margin-top: 20rpx;
  179. }
  180. }
  181. }
  182. .right{
  183. p{
  184. font-family: PingFangSC, PingFang SC;
  185. font-weight: 400;
  186. font-size: 20rpx;
  187. color: #657588;
  188. position: relative;
  189. padding-left: 16rpx;
  190. &::before{
  191. content: '';
  192. width: 10rpx;
  193. height: 10rpx;
  194. background: #FEA400;
  195. border-radius: 50%;
  196. position: absolute;
  197. left: 0;
  198. top: 50%;
  199. margin-top: -5rpx;
  200. }
  201. &:last-child{
  202. margin-top: 20rpx;
  203. &::before{
  204. background: #DDE0E6;
  205. }
  206. }
  207. span{
  208. color: #1D2129;
  209. }
  210. }
  211. }
  212. }
  213. .bottom{
  214. width: 100%;
  215. height: 6rpx;
  216. background: #DFE5EE;
  217. border-radius: 3rpx;
  218. margin-top: 24rpx;
  219. position: relative;
  220. .jd{
  221. height: 6rpx;
  222. background: #FEA400;
  223. border-radius: 3rpx;
  224. position: absolute;
  225. left: 0;
  226. top: 0;
  227. &.green{
  228. background: #31D1D6;
  229. }
  230. }
  231. }
  232. }
  233. }
  234. .menu{
  235. padding: 38rpx 0;
  236. background: #FFFFFF;
  237. border-radius: 12rpx;
  238. margin-top: 20rpx;
  239. display: flex;
  240. position: relative;
  241. .pre{
  242. width: 25%;
  243. display: flex;
  244. flex-direction: column;
  245. align-items: center;
  246. image{
  247. width: 64rpx;
  248. height: 64rpx;
  249. }
  250. p{
  251. font-family: PingFangSC, PingFang SC;
  252. font-weight: 400;
  253. font-size: 24rpx;
  254. color: #4E5969;
  255. line-height: 30rpx;
  256. text-align: center;
  257. margin-top: 18rpx;
  258. }
  259. }
  260. }
  261. .list{
  262. margin-top: 49rpx;
  263. .title{
  264. display: flex;
  265. align-items: center;
  266. justify-content: space-between;
  267. .left{
  268. font-family: PingFang-SC, PingFang-SC;
  269. font-weight: bold;
  270. font-size: 36rpx;
  271. color: #1D2129;
  272. line-height: 50rpx;
  273. }
  274. .right{
  275. display: flex;
  276. align-items: center;
  277. span{
  278. font-family: PingFangSC, PingFang SC;
  279. font-weight: 400;
  280. font-size: 26rpx;
  281. color: #86909C;
  282. line-height: 26rpx;
  283. }
  284. image{
  285. width: 24rpx;
  286. height: 24rpx;
  287. margin-left: 13rpx;
  288. }
  289. }
  290. }
  291. .boxs{
  292. margin-top: 36rpx;
  293. .item{
  294. background: #FFFFFF;
  295. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECEEF5;
  296. padding: 36rpx 27rpx;
  297. display: flex;
  298. .left{
  299. width: calc(100% - 115rpx);
  300. padding-right: 20rpx;
  301. box-sizing: border-box;
  302. .name{
  303. font-family: PingFang-SC, PingFang-SC;
  304. font-weight: bold;
  305. font-size: 30rpx;
  306. color: #1D2129;
  307. line-height: 42rpx;
  308. text-align: left;
  309. white-space: nowrap;
  310. overflow: hidden;
  311. text-overflow: ellipsis;
  312. }
  313. p{
  314. margin-top: 36rpx;
  315. font-family: PingFangSC, PingFang SC;
  316. font-weight: 400;
  317. font-size: 26rpx;
  318. color: #86909C;
  319. line-height: 26rpx;
  320. span{
  321. color: #1D2129;
  322. margin-left: 64rpx;
  323. }
  324. }
  325. }
  326. .right{
  327. width: 115rpx;
  328. display: flex;
  329. flex-direction: column;
  330. justify-content: space-between;
  331. .top{
  332. width: 104rpx;
  333. height: 48rpx;
  334. border-radius: 6rpx;
  335. font-family: PingFangSC, PingFang SC;
  336. font-weight: 400;
  337. font-size: 26rpx;
  338. line-height: 48rpx;
  339. text-align: center;
  340. &.djj{
  341. color: #FEA400;
  342. background: rgba(254,164,0,0.08);
  343. }
  344. &.yjj{
  345. color: #05C17F;
  346. background: rgba(20,204,140,0.08);
  347. }
  348. }
  349. .bottom{
  350. width: 115rpx;
  351. height: 64rpx;
  352. background: #2E69EB;
  353. border-radius: 16rpx;
  354. font-family: PingFang-SC, PingFang-SC;
  355. font-weight: bold;
  356. font-size: 28rpx;
  357. color: #FFFFFF;
  358. line-height: 64rpx;
  359. text-align: center;
  360. }
  361. }
  362. }
  363. }
  364. }
  365. }
  366. </style>