index.vue 9.6 KB

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