equipment.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  1. <template>
  2. <view class="equipment">
  3. <commons-header :isBack="false"></commons-header>
  4. <div>刷新</div>
  5. <!-- <view v-if="!isJinbian" class="search-warp">
  6. <view class="left-select" @click="openSelectQd(2)">
  7. <span class="icon">&#xe6c4;</span>
  8. <span style="margin:0 10rpx">1号生产线</span>
  9. <span class="icon">&#xe6b9;</span>
  10. </view>
  11. <view class="right-select" @click="openSelectQd(1)">
  12. <span class="icon">&#xe6c3;</span>
  13. <span style="margin: 0 10rpx;">{{$t('equipment.stat')}}</span>
  14. <span class="icon">&#xe6b9;</span>
  15. </view>
  16. </view> -->
  17. <view class="content" style="margin-top:128rpx">
  18. <ul>
  19. <li v-for="i in listData" :key="i.id">
  20. <!-- v-if="i.type == 1" -->
  21. <view class="list-warp" @click="toDtl(i.equipmentNo,i.type)" v-if="i.type == 1 || i.type == 2 || i.type == 3 || i.type == 4 || i.type == 5 || i.type == 7">
  22. <view class="list-main-info">
  23. <view class="img">
  24. <image src="../../static/images/icon_bzj@2x.png" mode=""></image>
  25. </view>
  26. <view class="text">
  27. <view class="list-main-title">
  28. {{i.name}}
  29. <!-- {{$t('injection.name')}} -->
  30. <span class="commons-close">{{offLine}}</span>
  31. </view>
  32. <view class="list-main-model">
  33. {{$t('equipment.model')}}:{{i.equipmentNo}}
  34. </view>
  35. </view>
  36. <view class="more">
  37. <span class="iconfont">&#xe6bb;</span>
  38. </view>
  39. </view>
  40. <!-- <view class="tag">
  41. <view class="tag-box">
  42. 自动模式
  43. </view>
  44. <view class="tag-box">
  45. 检测系统
  46. </view>
  47. </view> -->
  48. </view>
  49. <!-- <view class="list-warp" @click="toDtl3">
  50. <view class="list-main-info">
  51. <view class="img">
  52. <image src="../../static/images/icon_bzj@2x.png" mode=""></image>
  53. </view>
  54. <view class="text">
  55. <view class="list-main-title">
  56. 注塑机
  57. <span class="standby commons-close">{{offLine}}</span>
  58. </view>
  59. <view class="list-main-model">
  60. {{$t('equipment.model')}}:SMT-1029
  61. </view>
  62. </view>
  63. <view class="more">
  64. <i class="iconfont">&#xe6bb;</i>
  65. </view>
  66. </view>
  67. <view class="list-title">
  68. {{$t('equipment.auxiliaryMachine')}}
  69. </view>
  70. <view class="auxiliary-warp">
  71. <view class="auxiliary-list-box">
  72. <view class="auxiliary-img">
  73. <image src="../../static/images/icon_xlj@2x.png" mode=""></image>
  74. </view>
  75. <view class="auxiliary-text">
  76. <view class="auxiliary-text-title">
  77. 下料机
  78. </view>
  79. <view class="model">
  80. {{$t('equipment.model')}}:SMT-2071
  81. </view>
  82. </view>
  83. <view class="auxiliary-before commons-close">
  84. {{offLine}}
  85. </view>
  86. </view>
  87. </view>
  88. </view> -->
  89. </li>
  90. <!-- v-if="i.type === 8" -->
  91. <li @click="toDtl5" v-for="i in listData" :key="i.id" v-if="i.type === 9">
  92. <view class="list-warp">
  93. <view class="list-main-info">
  94. <view class="img">
  95. <image src="../../static/images/icon_bzj@2x.png" mode=""></image>
  96. </view>
  97. <view class="text">
  98. <view class="list-main-title">
  99. {{$t('packer.name')}}
  100. <span class="commons-close">{{offLine}}</span>
  101. </view>
  102. <view class="list-main-model">
  103. {{$t('equipment.model')}}:{{i.equipmentNo}}
  104. <span style="margin-left: 30rpx;">{{$t('equipment.yield')}}:200 pcs/min</span>
  105. </view>
  106. </view>
  107. <view class="more">
  108. <span class="iconfont">&#xe6bb;</span>
  109. </view>
  110. </view>
  111. </view>
  112. </li>
  113. <li @click="toDtl2" v-for="i in listData" :key="i.id" v-if="i.type == 8">
  114. <view class="list-warp">
  115. <view class="list-main-info">
  116. <view class="img">
  117. <image src="~@/static/images/icon_mjg@2x.png" mode=""></image>
  118. </view>
  119. <view class="text">
  120. <view class="list-main-title">
  121. {{$t('sterilization.name')}}
  122. <span>{{running}}</span>
  123. </view>
  124. <view class="list-main-model">
  125. {{$t('equipment.model')}}:{{i.equipmentNo}}
  126. </view>
  127. </view>
  128. <view class="more">
  129. <span class="iconfont">&#xe6bb;</span>
  130. </view>
  131. </view>
  132. <view class="tag">
  133. <view class="tag-box">
  134. {{$t('equipment.temperature')}}:67.5℃
  135. </view>
  136. <view class="tag-box">
  137. {{$t('equipment.humidity')}}:67.5%RH
  138. </view>
  139. </view>
  140. </view>
  141. </li>
  142. </ul>
  143. </view>
  144. <uni-popup v-if="!isJinbian" ref="popup2" type="bottom">
  145. <view class="search-box">
  146. <ul>
  147. <li @click="selectMaterialList()">
  148. 一号生产线
  149. </li>
  150. </ul>
  151. </view>
  152. </uni-popup>
  153. <uni-popup v-if="!isJinbian" ref="popup1" type="bottom">
  154. <view class="search-box">
  155. <ul>
  156. <li @click="selectMaterialList()">
  157. {{running}}
  158. </li>
  159. <li @click="selectMaterialList()">
  160. {{standby}}
  161. </li>
  162. <li @click="selectMaterialList()">
  163. {{offLine}}
  164. </li>
  165. </ul>
  166. </view>
  167. </uni-popup>
  168. <ul class="jinbian-list">
  169. <li class="jinbian-list-box" v-for="i in listData" :key="i.id" v-if="i.type == 6">
  170. <!-- <view class="list-title">
  171. 分组1 <i class="iconfont">&#xe71b;</i>
  172. </view> -->
  173. <view class="list-content">
  174. <view class="equ-list" @click="toDtl(i.equipmentNo,i.type)">
  175. <view class="state" :style="!i.swichType ? 'background:#999' : ''">
  176. {{i.swichType ? running : offLine}}
  177. </view>
  178. <view class="img-or-text">
  179. <image src="../../static/jinbian/icon_jbj.png" mode=""></image>
  180. <view class="text">
  181. <h3>设备1</h3>
  182. <p>{{$t('equipment.model')}}:{{i.equipmentNo}} <span>{{$t('equipment.yield')}}:200</span></p>
  183. </view>
  184. </view>
  185. <view class="tags">
  186. <view class="tag-box">
  187. <view class="tag-icon-box">
  188. <i class="iconfont">&#xe735;</i>
  189. </view>
  190. EBC
  191. </view>
  192. <view class="tag-box">
  193. <view class="tag-icon-box">
  194. <i class="iconfont">&#xe733;</i>
  195. </view>
  196. <!-- {{$t('warpKnitting.jaca')}} -->
  197. 贾卡
  198. </view>
  199. <view class="tag-box">
  200. <view class="tag-icon-box">
  201. <i class="iconfont">&#xe734;</i>
  202. </view>
  203. 横移
  204. </view>
  205. </view>
  206. </view>
  207. </view>
  208. </li>
  209. </ul>
  210. </view>
  211. </template>
  212. <script>
  213. import {
  214. getInfo
  215. } from "@/util/api.js";
  216. import Vue from 'vue'
  217. import commonsHeader from '../../components/commons-header/index.vue'
  218. export default {
  219. components:{
  220. commonsHeader
  221. },
  222. data() {
  223. return {
  224. offLine:this.$t('equipment.offLine'),
  225. standby:this.$t('equipment.standby'),
  226. running:this.$t('equipment.running'),
  227. userInfoData: [],
  228. notificationData:[],
  229. isJinbian:false,//控制是否是经编
  230. listData:[],
  231. }
  232. },
  233. created() {
  234. const v = this
  235. v.getList()
  236. },
  237. methods: {
  238. getList(){
  239. const v = this
  240. v.$post('/api/syringe-production/factoryProduct/list',{}).then(res => {
  241. for (var i = 0; i < res.data.length; i++) {
  242. res.data[i].swichType = false
  243. v.getDtl(res.data[i].equipmentNo,i)
  244. }
  245. v.listData = res.data
  246. setTimeout(()=>{
  247. v.getList()
  248. },20000)
  249. })
  250. },
  251. getDtl(_id, _index) {
  252. const v = this
  253. v.$post('/api/syringe-production/factoryProduct/getData', {
  254. equipmentNo: _id
  255. }).then(res => {
  256. const time1 = new Date(res.data.eventTime).getTime()
  257. const time2 = new Date().getTime()
  258. if (time1 + 600000 > time2) {
  259. v.listData[_index].swichType = true
  260. } else {
  261. v.listData[_index].swichType = false
  262. }
  263. })
  264. },
  265. selectMaterialList(){
  266. this.$refs.popup1.close()
  267. this.$refs.popup2.close()
  268. },
  269. openSelectQd(_type){
  270. if(_type == 1){
  271. this.$refs.popup1.open('top')
  272. }else{
  273. this.$refs.popup2.open('top')
  274. }
  275. },
  276. toDtl3(){
  277. uni.showToast({
  278. icon:"none",
  279. title: '该设备待机中,暂无数据!'
  280. })
  281. },
  282. toDtl5(){
  283. uni.navigateTo({
  284. url: '/pages/equipment/packingMachine'
  285. })
  286. },
  287. toDtl4(){
  288. console.log(123123)
  289. uni.navigateTo({
  290. url: '/pages/equipment/warpKnitting'
  291. })
  292. },
  293. toDtl2(){
  294. uni.navigateTo({
  295. url: '/pages/equipment/sterilization'
  296. })
  297. },
  298. toDtl(_id,_type){
  299. const equipmentObj = {
  300. 1:'injectionMolding',
  301. 2:'rollPrinter',
  302. 3:'assemblyMachine',
  303. 4:'threadedHead',
  304. 5:'injectionNeedle',
  305. 6:'warpKnitting',
  306. 7:'clothInspecting',
  307. }
  308. // 1 注塑机 2 滚印机 3 组装机 4 螺纹头 5 注射针 6经编机 7验布机
  309. uni.navigateTo({
  310. url: '/pages/equipment/'+ equipmentObj[_type] +'?id=' + _id
  311. })
  312. },
  313. toRouter(j) {
  314. console.log(j)
  315. uni.navigateTo({
  316. url: '/pages/' + j.menuKey + '/' + j.menuKey
  317. })
  318. },
  319. },
  320. }
  321. </script>
  322. <style lang="less">
  323. .jinbian-list{
  324. .jinbian-list-box{
  325. margin-bottom: 24rpx;
  326. background-color: #fff;
  327. .list-title{
  328. height: 100rpx;
  329. line-height: 100rpx;
  330. display: flex;
  331. justify-content: space-between;
  332. padding: 0 24rpx;
  333. border-bottom: 2rpx solid #DDDDDD;
  334. span{
  335. color: #999;
  336. line-height: 100rpx;
  337. }
  338. }
  339. .list-content{
  340. padding: 16rpx 24rpx 40rpx;
  341. .equ-list{
  342. margin-top: 24rpx;
  343. background-color: #F1F1F1;
  344. border-radius: 10rpx;
  345. padding: 40rpx 24rpx;
  346. position: relative;
  347. .state{
  348. position: absolute;
  349. top: 0;
  350. right: 0;
  351. width: 120rpx;
  352. height: 40rpx;
  353. color: #fff;
  354. background: #FF655B;
  355. font-size: 24rpx;
  356. border-top-right-radius: 10rpx;
  357. border-bottom-left-radius: 10rpx;
  358. text-align: center;
  359. }
  360. .tags{
  361. display: flex;
  362. margin-top: 20rpx;
  363. .tag-box{
  364. background-color: #fff;
  365. height: 64rpx;
  366. width: 31%;
  367. margin: 1.1%;
  368. color: #333333;
  369. line-height: 64rpx;
  370. text-align: center;
  371. font-size: 24rpx;
  372. border-radius: 8rpx;
  373. display:flex;
  374. justify-content: center;
  375. .tag-icon-box{
  376. height: 40rpx;
  377. width: 40rpx;
  378. background-color: #84C418;
  379. line-height: 40rpx;
  380. text-align: center;
  381. margin-top: 12rpx;
  382. margin-right: 16rpx;
  383. border-radius: 8rpx;
  384. i{
  385. line-height: 40rpx;
  386. font-size: 22rpx;
  387. color: #fff;
  388. }
  389. }
  390. }
  391. }
  392. .img-or-text{
  393. display: flex;
  394. line-height: 40rpx;
  395. .text{
  396. padding: 10rpx 24rpx;
  397. }
  398. h3{
  399. color: #333333;
  400. font-size: 32rpx;
  401. }
  402. p{
  403. color: #666;
  404. font-size: 24rpx;
  405. span{
  406. margin-left: 40rpx;
  407. }
  408. }
  409. image{
  410. width: 100rpx;
  411. height: 100rpx;
  412. }
  413. }
  414. }
  415. }
  416. }
  417. }
  418. .search-box{
  419. background-color: #fff;
  420. padding-top: 100rpx;
  421. ul{
  422. li{
  423. padding: 25rpx 30rpx;
  424. border-bottom: 1rpx solid #dcdcdc;
  425. }
  426. }
  427. }
  428. .equipment{
  429. background-color: #f0f0f0;
  430. min-height: 100vh;
  431. .search-warp{
  432. height: 90rpx;
  433. line-height: 90rpx;
  434. background-color: #fff;
  435. display: flex;
  436. justify-content: space-between;
  437. padding: 0 24rpx;
  438. margin-bottom: 24rpx;
  439. margin-top: 128rpx;
  440. }
  441. .content{
  442. ul{
  443. li{
  444. box-shadow: 0px 3rpx 20rpx 0px rgba(0,0,0,0.10);
  445. background-color: #ffffff;
  446. margin-bottom:24rpx;
  447. padding: 0rpx 24rpx;
  448. .list-warp{
  449. padding: 24rpx 0;
  450. border-bottom: 14rpx solid #f0f0f0;
  451. }
  452. .list-warp:last-child{
  453. border:none;
  454. }
  455. .auxiliary-warp{
  456. display: flex;
  457. justify-content: space-between;
  458. flex-wrap: wrap;
  459. .auxiliary-list-box{
  460. width: 342rpx;
  461. padding: 24rpx 20rpx;
  462. border-radius: 10rpx;
  463. border: 1rpx solid #ddd;
  464. background-color: #fff;
  465. display: flex;
  466. position: relative;
  467. box-sizing: border-box;
  468. font-size: 24rpx;
  469. margin-top: 24rpx;
  470. .auxiliary-before{
  471. position: absolute;
  472. right: 0;
  473. top: 0;
  474. width: 120rpx;
  475. height: 40rpx;
  476. line-height: 40rpx;
  477. text-align: center;
  478. border-radius: 2px 2px 2px 10px;
  479. }
  480. .auxiliary-img{
  481. width: 60rpx;
  482. height: 60rpx;
  483. margin-right: 10rpx;
  484. image{
  485. width: 100%;
  486. height: 100%;
  487. }
  488. }
  489. }
  490. }
  491. .list-title{
  492. margin-top: 30rpx;
  493. color: #333;
  494. font-size: 28rpx;
  495. }
  496. .tag{
  497. margin-top: 32rpx;
  498. .tag-box{
  499. height: 48rpx;
  500. line-height: 48rpx;
  501. text-align: center;
  502. padding: 0 22rpx;
  503. display: inline-block;
  504. background-color: #F1F1F1;
  505. font-size: 24rpx;
  506. color: #666666;
  507. margin-left: 20rpx;
  508. }
  509. }
  510. .list-main-info{
  511. display: flex;
  512. justify-content: space-between;
  513. .img{
  514. width: 100rpx;
  515. height: 100rpx;
  516. image{
  517. width: 100rpx;
  518. height: 100rpx;
  519. }
  520. }
  521. .text{
  522. width: calc(~ '100% - 140rpx');
  523. margin-top: 10rpx;
  524. padding: 0 24rpx;
  525. .list-main-title{
  526. font-size: 28rpx;
  527. color: #333333;
  528. span{
  529. background: rgba(63,191,49,0.20);
  530. padding: 3rpx 24rpx;
  531. color: #34C724;
  532. border-radius: 40rpx;
  533. margin-left: 24rpx;
  534. }
  535. .standby{
  536. background-color: rgba(153, 153, 153, 0.20);
  537. color:#FF8800;
  538. }
  539. }
  540. .list-main-model{
  541. margin-top: 10rpx;
  542. font-size: 24rpx;
  543. color: #333333;
  544. }
  545. }
  546. }
  547. }
  548. }
  549. }
  550. }
  551. </style>