index.vue 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  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>{{xjData.abnormalNum}}/{{xjData.normalNum}}</p>
  11. </div>
  12. <div class="right">
  13. <p>异常:<span>{{xjData.abnormalNum}}</span></p>
  14. <p>正常:<span>{{xjData.normalNum}}</span></p>
  15. </div>
  16. </div>
  17. <div class="bottom">
  18. <div class="jd" :style="{'width':xjWidth+'%'}"></div>
  19. </div>
  20. </div>
  21. <div class="pre">
  22. <div class="top">
  23. <div class="left">
  24. <p>故障工单</p>
  25. <p>{{gzData.normalNum}}/{{gzData.abnormalNum}}</p>
  26. </div>
  27. <div class="right">
  28. <p>已解决:<span>{{gzData.normalNum}}</span></p>
  29. <p>未解决:<span>{{gzData.abnormalNum}}</span></p>
  30. </div>
  31. </div>
  32. <div class="bottom">
  33. <div class="jd green" :style="{'width':gzWidth+'%'}"></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. xjData:{
  92. normalNum:0,
  93. abnormalNum:0
  94. },
  95. gzData:{
  96. normalNum:0,
  97. abnormalNum:0
  98. },
  99. xjWidth:0,
  100. gzWidth:0,
  101. isOver:false,
  102. params:{
  103. page:1,
  104. limit:2
  105. },
  106. dataList:[],
  107. typeList:[],
  108. }
  109. },
  110. onShow() {
  111. this.getNumsInfo();
  112. this.getTypeList();
  113. },
  114. methods:{
  115. turnPage(url){
  116. if(!url) return
  117. uni.navigateTo({ url })
  118. },
  119. getNumsInfo(){
  120. this.$api.get('/wms/order/operation/getOperationCountInfo').then(res=>{
  121. if(res.data.code===0){
  122. let xj = res.data.data.find(d=>d.type==1);
  123. let gz = res.data.data.find(d=>d.type==2);
  124. if(xj){
  125. this.xjData = xj;
  126. this.xjWidth = xj.abnormalNum/(xj.normalNum+xj.abnormalNum)*100;
  127. }
  128. if(gz){
  129. this.gzData = gz;
  130. this.gzWidth = gz.normalNum/(gz.normalNum+gz.abnormalNum)*100;
  131. }
  132. }else this.$showToast(res.data.msg)
  133. })
  134. },
  135. getTypeList(){
  136. this.$api.get('/sys/dict/data/getListByType/wms_operation_category').then(res=>{
  137. if(res.data.code===0){
  138. this.typeList = res.data.data;
  139. this.getDataList();
  140. }else this.$showToast(res.data.msg)
  141. })
  142. },
  143. getDataList(){
  144. this.$api.get('/wms/order/operation/page',{page:1,limit:2}).then(res=>{
  145. if(res.data.code===0){
  146. if(this.dataList.length<res.data.data.total){
  147. this.params.page++;
  148. this.dataList = [...this.dataList,...res.data.data.list];
  149. this.dataList.forEach(d=>{
  150. d.typeName = this.typeList.find(t=>t.dictValue==d.optCategory)?.dictLabel;
  151. })
  152. }else this.isOver = true
  153. }else this.$showModal(res.data.msg)
  154. });
  155. },
  156. toDetail(item){
  157. uni.navigateTo({
  158. url:'/pagesOperation/workorder/detail?id='+item?.id
  159. })
  160. }
  161. }
  162. }
  163. </script>
  164. <style scoped lang="less">
  165. .page{
  166. padding: 0 24rpx 40rpx;
  167. background: #F5F8FA;
  168. box-sizing: border-box;
  169. .topbg{
  170. width: 100%;
  171. position: fixed;
  172. top: 0;
  173. left: 0;
  174. z-index: 0;
  175. }
  176. .order{
  177. display: flex;
  178. justify-content: space-between;
  179. position: relative;
  180. margin-top: 218rpx;
  181. .pre{
  182. width: calc(50% - 9rpx);
  183. background: rgba(255,255,255,0.7);
  184. border-radius: 12rpx;
  185. border: 2rpx solid #FFFFFF;
  186. padding: 30rpx 20rpx;
  187. box-sizing: border-box;
  188. .top{
  189. display: flex;
  190. align-items: center;
  191. justify-content: space-between;
  192. .left{
  193. p{
  194. font-family: PingFangSC, PingFang SC;
  195. font-weight: 400;
  196. font-size: 24rpx;
  197. color: #657588;
  198. line-height: 24rpx;
  199. &:last-child{
  200. font-family: DINAlternate, DINAlternate;
  201. font-weight: bold;
  202. font-size: 36rpx;
  203. color: #333333;
  204. line-height: 36rpx;
  205. margin-top: 20rpx;
  206. }
  207. }
  208. }
  209. .right{
  210. p{
  211. font-family: PingFangSC, PingFang SC;
  212. font-weight: 400;
  213. font-size: 20rpx;
  214. color: #657588;
  215. position: relative;
  216. padding-left: 16rpx;
  217. &::before{
  218. content: '';
  219. width: 10rpx;
  220. height: 10rpx;
  221. background: #FEA400;
  222. border-radius: 50%;
  223. position: absolute;
  224. left: 0;
  225. top: 50%;
  226. margin-top: -5rpx;
  227. }
  228. &:last-child{
  229. margin-top: 20rpx;
  230. &::before{
  231. background: #DDE0E6;
  232. }
  233. }
  234. span{
  235. color: #1D2129;
  236. }
  237. }
  238. }
  239. }
  240. .bottom{
  241. width: 100%;
  242. height: 6rpx;
  243. background: #DFE5EE;
  244. border-radius: 3rpx;
  245. margin-top: 24rpx;
  246. position: relative;
  247. .jd{
  248. height: 6rpx;
  249. background: #FEA400;
  250. border-radius: 3rpx;
  251. position: absolute;
  252. left: 0;
  253. top: 0;
  254. &.green{
  255. background: #31D1D6;
  256. }
  257. }
  258. }
  259. }
  260. }
  261. .menu{
  262. padding: 38rpx 0;
  263. background: #FFFFFF;
  264. border-radius: 12rpx;
  265. margin-top: 20rpx;
  266. display: flex;
  267. position: relative;
  268. .pre{
  269. width: 25%;
  270. display: flex;
  271. flex-direction: column;
  272. align-items: center;
  273. image{
  274. width: 64rpx;
  275. height: 64rpx;
  276. }
  277. p{
  278. font-family: PingFangSC, PingFang SC;
  279. font-weight: 400;
  280. font-size: 24rpx;
  281. color: #4E5969;
  282. line-height: 30rpx;
  283. text-align: center;
  284. margin-top: 18rpx;
  285. }
  286. }
  287. }
  288. .list{
  289. margin-top: 49rpx;
  290. position: relative;
  291. .title{
  292. display: flex;
  293. align-items: center;
  294. justify-content: space-between;
  295. .left{
  296. font-family: PingFang-SC, PingFang-SC;
  297. font-weight: bold;
  298. font-size: 36rpx;
  299. color: #1D2129;
  300. line-height: 50rpx;
  301. }
  302. .right{
  303. display: flex;
  304. align-items: center;
  305. span{
  306. font-family: PingFangSC, PingFang SC;
  307. font-weight: 400;
  308. font-size: 26rpx;
  309. color: #86909C;
  310. line-height: 26rpx;
  311. }
  312. image{
  313. width: 24rpx;
  314. height: 24rpx;
  315. margin-left: 13rpx;
  316. }
  317. }
  318. }
  319. .boxs{
  320. margin-top: 36rpx;
  321. .item{
  322. background: #FFFFFF;
  323. box-shadow: inset 0rpx -1rpx 0rpx 0rpx #ECEEF5;
  324. padding: 36rpx 27rpx;
  325. display: flex;
  326. .left{
  327. width: calc(100% - 115rpx);
  328. padding-right: 20rpx;
  329. box-sizing: border-box;
  330. .name{
  331. font-family: PingFang-SC, PingFang-SC;
  332. font-weight: bold;
  333. font-size: 30rpx;
  334. color: #1D2129;
  335. line-height: 42rpx;
  336. text-align: left;
  337. white-space: nowrap;
  338. overflow: hidden;
  339. text-overflow: ellipsis;
  340. }
  341. p{
  342. margin-top: 36rpx;
  343. font-family: PingFangSC, PingFang SC;
  344. font-weight: 400;
  345. font-size: 26rpx;
  346. color: #86909C;
  347. line-height: 26rpx;
  348. span{
  349. color: #1D2129;
  350. margin-left: 64rpx;
  351. }
  352. }
  353. }
  354. .right{
  355. width: 115rpx;
  356. display: flex;
  357. flex-direction: column;
  358. justify-content: space-between;
  359. .top{
  360. width: 104rpx;
  361. height: 48rpx;
  362. border-radius: 6rpx;
  363. font-family: PingFangSC, PingFang SC;
  364. font-weight: 400;
  365. font-size: 26rpx;
  366. line-height: 48rpx;
  367. text-align: center;
  368. &.djj{
  369. color: #FEA400;
  370. background: rgba(254,164,0,0.08);
  371. }
  372. &.yjj{
  373. color: #05C17F;
  374. background: rgba(20,204,140,0.08);
  375. }
  376. }
  377. .bottom{
  378. width: 115rpx;
  379. height: 64rpx;
  380. background: #2E69EB;
  381. border-radius: 16rpx;
  382. font-family: PingFang-SC, PingFang-SC;
  383. font-weight: bold;
  384. font-size: 28rpx;
  385. color: #FFFFFF;
  386. line-height: 64rpx;
  387. text-align: center;
  388. }
  389. }
  390. }
  391. }
  392. }
  393. }
  394. </style>