equipment-detail.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <template>
  2. <view>
  3. <u-toast ref="uToast" />
  4. <view class="d-flex px3 py2">
  5. <view class="top d-flex a-center bg-color-white flex1 one-ellipsis">
  6. <view class="img" style="cursor:pointer">
  7. <image
  8. :src="
  9. imgSrc
  10. ? imgSrc
  11. : $BaseTool.UserUtil.getFileUrl(infoData.qrCode)
  12. "
  13. mode="widthFix"
  14. ></image>
  15. </view>
  16. <view class="pl-3">
  17. <view class="f-size-36 text-color-3 one-ellipsis">{{
  18. infoData.name
  19. }}</view>
  20. <view
  21. class="d-flex f-size-28 f-weight-6 f-wrap"
  22. style="margin: 20rpx 0"
  23. >
  24. </view>
  25. <view class="d-flex">
  26. <text class="f-size-26 mr-3 state-r main-color-bg text-color-white">{{ statusMap[infoData.status] }}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="divider"></view>
  32. <!-- 基本信息 -->
  33. <view class="mt-3 px3">
  34. <view
  35. class="f-size-30 f-weight-bold py2 border-bottom"
  36. >基本信息</view
  37. >
  38. <view
  39. class="mx3 my2 p3 bg-color-white"
  40. style="border-radius: 16rpx; border: 1px solid #eee"
  41. >
  42. <equipment-line title="设备编号" :content="infoData.no" />
  43. <!-- <equipment-line title="财务编码" :content="infoData.financingNo"/>-->
  44. <equipment-line title="设备类型" :content="infoData.typeName" />
  45. <equipment-line title="规格型号" :content="infoData.model" />
  46. <equipment-line title="使用位置" :content="infoData.cph" />
  47. </view>
  48. <!-- <view class="mt-3">
  49. <view class="d-flex mb-2">
  50. <view class="col2 d-flex">
  51. <view class="mr-2 text-color-6">设备编号</view>
  52. <view class="one-ellipsis">{{ infoData.no }}</view>
  53. </view>
  54. <view class="col2 d-flex">
  55. <view class="mr-2 text-color-6">财务编码</view>
  56. <view>{{ infoData.financingNo }}</view>
  57. </view>
  58. </view>
  59. <view class="d-flex mb-2">
  60. <view class="col2 d-flex">
  61. <view class="mr-2 text-color-6">卡片编号</view>
  62. <view>{{ infoData.cardNo }}</view>
  63. </view>
  64. </view>
  65. <view class="d-flex">
  66. <view class="mr-2 text-color-6">制造号(车架号)</view>
  67. <view>{{ infoData.zzh }}</view>
  68. </view>
  69. <view class="d-flex mb-2">
  70. <view class="col2 d-flex">
  71. <view class="mr-2 text-color-6">发动机型号</view>
  72. <view>{{ infoData.fdjxh }}</view>
  73. </view>
  74. <view class="col2 d-flex">
  75. <view class="mr-2 text-color-6">发动机号</view>
  76. <view>{{ infoData.fdjh }}</view>
  77. </view>
  78. </view>
  79. <view class="d-flex mb-2">
  80. <view class="col2 d-flex">
  81. <view class="mr-2 text-color-6">车牌号</view>
  82. <view>{{ infoData.cph }}</view>
  83. </view>
  84. <view class="col2 d-flex">
  85. <view class="mr-2 text-color-6">底盘号</view>
  86. <view>{{ infoData.dph }}</view>
  87. </view>
  88. </view>
  89. <view class="d-flex mb-2">
  90. <view class="col2 d-flex">
  91. <view class="mr-2 text-color-6">自重</view>
  92. <view>{{ infoData.zz }}</view>
  93. </view>
  94. <view class="col2 d-flex">
  95. <view class="mr-2 text-color-6">燃料类别</view>
  96. <view>{{
  97. $BaseTool.Object.getField(rlTypeMap, infoData.rlType)
  98. }}</view>
  99. </view>
  100. </view>
  101. <view class="d-flex mb-2">
  102. <view class="col2 d-flex">
  103. <view class="mr-2 text-color-6">颜色</view>
  104. <view>{{
  105. $BaseTool.Object.getField(colorMap, infoData.color)
  106. }}</view>
  107. </view>
  108. <view class="col2 d-flex">
  109. <view class="mr-2 text-color-6">座位数</view>
  110. <view>{{ infoData.seatNumber }}</view>
  111. </view>
  112. </view>
  113. <view class="d-flex mb-2">
  114. <view class="col2 d-flex">
  115. <view class="mr-2 text-color-6">助记码</view>
  116. <view>{{ infoData.zjm }}</view>
  117. </view>
  118. <view class="col2 d-flex">
  119. <view class="mr-2 ">状态</view>
  120. <view>
  121. <my-badge
  122. :text="statusMap[infoData.status]"
  123. :status="$DictCache.COLOR.SB_INFO_STATUS[infoData.status]"
  124. />
  125. </view>
  126. </view>
  127. </view>
  128. <view class="d-flex mb-2">
  129. <view class="col2 d-flex">
  130. <view class="mr-2 text-color-6">备注</view>
  131. <view>{{ infoData.remark }}</view>
  132. </view>
  133. </view>
  134. </view> -->
  135. </view>
  136. <view class="divider"></view>
  137. <view class="px3">
  138. <view
  139. class="f-size-30 f-weight-bold py2 border-bottom"
  140. >常用操作</view
  141. >
  142. <u-grid :col="3" :border="false">
  143. <u-grid-item @tap="handleAdd(1)">
  144. <view
  145. class="iconfont icon-baoxiu"
  146. style="color: #0f6fb9"
  147. ></view>
  148. <view class="grid-text">报修</view>
  149. </u-grid-item>
  150. <!-- <u-grid-item @tap="handleAdd(2)">
  151. <view
  152. class="iconfont icon-icon-GIS_yunhangguanli main-color-text"
  153. ></view>
  154. <view class="grid-text">运行填报</view>
  155. </u-grid-item>
  156. <u-grid-item @tap="handleAdd(3)">
  157. <view
  158. class="iconfont icon-xunjianguanli main-color-text"
  159. ></view>
  160. <view class="grid-text">巡检填报</view>
  161. </u-grid-item>-->
  162. <u-grid-item v-if="infoData.status != 2" @tap="handleStart()">
  163. <view class="iconfont icon-start main-color-text"></view>
  164. <view class="grid-text">启用</view>
  165. </u-grid-item>
  166. <u-grid-item v-if="infoData.status != 7" @tap="handleStop()">
  167. <view class="iconfont icon-stop1 main-color-text"></view>
  168. <view class="grid-text">停用</view>
  169. </u-grid-item>
  170. </u-grid>
  171. </view>
  172. <view class="divider"></view>
  173. <view class="px3">
  174. <my-card
  175. title="设备图片"
  176. @handleLubrication="handleImg"
  177. ></my-card>
  178. </view>
  179. <!-- <view class="divider"></view>
  180. <view class="px3">
  181. <my-card
  182. title="设备型号信息"
  183. @handleLubrication="handleModel"
  184. ></my-card>
  185. <my-card
  186. title="设备使用信息"
  187. @handleLubrication="handleUse"
  188. ></my-card>
  189. <my-card
  190. title="厂商信息"
  191. @handleLubrication="handleInsure"
  192. ></my-card>
  193. <my-card title="日期信息" @handleLubrication="handleDate"></my-card>
  194. </view>-->
  195. <view class="divider"></view>
  196. <view class="px3">
  197. <!-- <my-card
  198. icon="icon-tubiaozhizuomoban-135"
  199. title="今日现场保养任务"
  200. :tipNum="gatherTask.lubricationTask"
  201. @handleLubrication="handleMaintain(1)"
  202. ></my-card>
  203. <my-card
  204. icon="icon-tubiaozhizuomoban-135"
  205. title="本周保养任务"
  206. :tipNum="gatherTask.lubricationTaskWeek"
  207. @handleLubrication="handleMaintain(2)"
  208. ></my-card> -->
  209. <my-card
  210. icon="icon-tubiaozhizuomoban-135"
  211. title="本月保养任务"
  212. :tipNum="gatherTask.lubricationTaskMonth"
  213. @handleLubrication="handleMaintain(3)"
  214. ></my-card>
  215. <!-- <my-card-->
  216. <!-- v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"-->
  217. <!-- icon="icon-tubiaozhizuomoban-135"-->
  218. <!-- title="今日保养任务"-->
  219. <!-- :tipNum="gatherTask.lubricationTaskMyDay"-->
  220. <!-- @handleLubrication="handleMaintainAll(0,1)"-->
  221. <!-- ></my-card>-->
  222. <!-- <my-card-->
  223. <!-- v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"-->
  224. <!-- icon="icon-tubiaozhizuomoban-135"-->
  225. <!-- title="本周保养任务"-->
  226. <!-- :tipNum="gatherTask.lubricationTaskMyDay"-->
  227. <!-- @handleLubrication="handleMaintainAll(0,2)"-->
  228. <!-- ></my-card>-->
  229. <!-- <my-card-->
  230. <!-- v-show="$BaseTool.UserUtil.getUserInfo() != null && ($BaseTool.UserUtil.isRepairRole() || $BaseTool.UserUtil.isManagerRole())"-->
  231. <!-- icon="icon-tubiaozhizuomoban-135"-->
  232. <!-- title="本月保养任务"-->
  233. <!-- :tipNum="gatherTask.lubricationTaskMyDay"-->
  234. <!-- @handleLubrication="handleMaintainAll(0,3)"-->
  235. <!-- ></my-card>-->
  236. <my-card
  237. icon="icon-weixiu"
  238. title="维修任务"
  239. :tipNum="gatherTask.repairTask"
  240. @handleLubrication="handleService"
  241. ></my-card>
  242. <!-- <my-card
  243. icon="icon-runhuaguanli"
  244. title="点检任务"
  245. @handleLubrication="handleLubrication"
  246. ></my-card>
  247. <my-card
  248. icon="icon-jiayou"
  249. title="加油任务"
  250. @handleLubrication="handleOiling"
  251. iColor="#F1650C"
  252. ></my-card>-->
  253. </view>
  254. </view>
  255. </template>
  256. <script>
  257. import DictCache from '@/utils/dict';
  258. export default {
  259. data() {
  260. return {
  261. list: [
  262. {
  263. name: '维修记录'
  264. },
  265. {
  266. name: '运行记录'
  267. },
  268. {
  269. name: '巡检记录'
  270. }
  271. ],
  272. current: 0,
  273. detailId: '',
  274. infoData: {},
  275. statusMap: {},
  276. rlTypeMap: null,
  277. colorMap: null,
  278. imgSrc: '',
  279. gatherTask: {
  280. checkTask: 0,
  281. maintainTask: 0,
  282. lubricationTask: 0,
  283. lubricationTaskWeek: 0,
  284. lubricationTaskMonth: 0,
  285. oilTask: 0,
  286. repairTask: 0,
  287. repairCheckTask: 0
  288. }
  289. };
  290. },
  291. onLoad(options) {
  292. // 获取词典
  293. this.detailId = options.detailId;
  294. this.$Http.getDictData().then(response => {
  295. uni.setStorage({
  296. key: DictCache.BASE_DATA_CACHE,
  297. data: response.data,
  298. success: function () {}
  299. });
  300. this.statusMap = this.$DictCache.getLabelByValueMapByType(
  301. this.$DictCache.TYPE.SB_INFO_STATUS
  302. );
  303. this.rlTypeMap = this.$DictCache.getLabelByValueMapByType(
  304. this.$DictCache.TYPE.RANLIAO_TYPE
  305. );
  306. this.colorMap = this.$DictCache.getLabelByValueMapByType(
  307. this.$DictCache.TYPE.SB_COLOR
  308. );
  309. this.$Http
  310. .fetchSbInfoIgnores({
  311. id: this.detailId
  312. })
  313. .then((res) => {
  314. this.infoData = res.data;
  315. if (this.infoData.sbFileList != null && this.infoData.sbFileList.length > 0) {
  316. this.imgSrc = this.$BaseTool.UserUtil.getFileUrl(this.infoData.sbFileList[0].url)
  317. } else {
  318. this.imgSrc = this.$BaseTool.UserUtil.getFileUrl(this.infoData.qrCode)
  319. }
  320. uni.setNavigationBarTitle({
  321. title: this.infoData.name
  322. });
  323. });
  324. this.$Http.getSbTaskIgnores({
  325. id: this.detailId
  326. }).then((res) => {
  327. this.gatherTask = res.data;
  328. });
  329. if (this.$BaseTool.UserUtil.getUserInfo() != null && (this.$BaseTool.UserUtil.isRepairRole() || this.$BaseTool.UserUtil.isManagerRole())) {
  330. this.$Http.getGatherTaskRole(this.detailId).then((res) => {
  331. this.gatherTask = res.data;
  332. });
  333. } else {
  334. this.$Http.getSbTaskIgnores({ id: this.detailId }).then((res) => {
  335. this.gatherTask = res.data;
  336. });
  337. }
  338. });
  339. },
  340. onShow() {
  341. },
  342. methods: {
  343. // 文件
  344. handleImg() {
  345. uni.navigateTo({
  346. url:
  347. '/pages/equipment-file/equipment-img?detailId=' +
  348. this.detailId
  349. });
  350. },
  351. // 文件
  352. handleFile() {
  353. uni.navigateTo({
  354. url:
  355. '/pages/equipment-file/equipment-file?detailId=' +
  356. this.detailId
  357. });
  358. },
  359. // 日期
  360. handleDate() {
  361. uni.navigateTo({
  362. url:
  363. '/pages/equipment-date/equipment-date?detailId=' +
  364. this.detailId
  365. });
  366. },
  367. // 厂商
  368. handleInsure() {
  369. uni.navigateTo({
  370. url:
  371. '/pages/equipment-insure/equipment-insure?detailId=' +
  372. this.infoData.producerId
  373. });
  374. },
  375. // 设备使用信息
  376. handleUse() {
  377. uni.navigateTo({
  378. url:
  379. '/pages/equipment-use/equipment-use?detailId=' +
  380. this.detailId
  381. });
  382. },
  383. // 设备型号信息
  384. handleModel() {
  385. uni.navigateTo({
  386. url:
  387. '/pages/equipment-model/equipment-model?detailId=' +
  388. this.detailId
  389. });
  390. },
  391. // 相关任务跳转
  392. // 维修任务
  393. handleService() {
  394. uni.navigateTo({
  395. url: '/pages/service/service?sbId=' + this.detailId
  396. });
  397. },
  398. // 加油任务
  399. handleOiling() {
  400. uni.navigateTo({
  401. url: '/pages/oiling/oiling?sbId=' + this.detailId
  402. });
  403. },
  404. // 当日现场保养任务
  405. handleMaintain(searchType) {
  406. uni.navigateTo({
  407. url: '/pages/maintain/maintain-ignore?sbId=' + this.detailId + '&filter=2&searchType='+searchType
  408. });
  409. },
  410. // 我的保养任务:今日
  411. handleMaintainMy() {
  412. uni.navigateTo({
  413. url: '/pages/maintain/maintain?sbId=' + this.detailId + '&filter=0&searchType=1'
  414. });
  415. },
  416. // 所有保养任务:今日
  417. handleMaintainAll(filter, searchType) {
  418. uni.navigateTo({
  419. url: '/pages/maintain/maintain?sbId=' + this.detailId + '&searchType=1&filter=' + filter
  420. });
  421. },
  422. // 点检任务
  423. handleLubrication(e) {
  424. uni.navigateTo({
  425. url: '/pages/check/check?sbId=' + this.infoData.id
  426. });
  427. },
  428. // 常用操作跳转
  429. handleAdd(index) {
  430. if (index === 1) {
  431. uni.navigateTo({
  432. url:
  433. '/pages/repair-add/repair-add?detailId=' +
  434. this.detailId
  435. });
  436. } else if (index === 2) {
  437. uni.navigateTo({
  438. url: '/pages/running/running-edit?sbId=' + this.detailId
  439. });
  440. } else if (index === 3) {
  441. uni.navigateTo({
  442. url:
  443. '/pages/inspection/inspection-edit?sbId=' +
  444. this.detailId
  445. });
  446. }
  447. },
  448. change(index) {
  449. this.current = index;
  450. },
  451. handleStart() {
  452. // this.infoData.status = 2;
  453. var that = this;
  454. uni.navigateTo({
  455. url:
  456. '/pages/equipment-detail/equipment-status?sbId=' +
  457. this.detailId + '&sbNo=' + this.infoData.no +
  458. '&sbName=' + this.infoData.name +
  459. '&preStatus=' + this.infoData.status +
  460. '&afterStatus=' + 2
  461. });
  462. /* this.$Http.updateSbInfo(this.infoData).then((res) => {
  463. that.$refs.uToast.show({
  464. title: '已启用',
  465. type: 'default',
  466. icon: false
  467. });
  468. }); */
  469. },
  470. handleStop() {
  471. this.infoData.status = 7;
  472. var that = this;
  473. this.$Http.updateSbInfo(this.infoData).then((res) => {
  474. that.$refs.uToast.show({
  475. title: '已停用',
  476. type: 'default',
  477. icon: false
  478. });
  479. });
  480. }
  481. }
  482. };
  483. </script>
  484. <style lang="less">
  485. .iconfont {
  486. font-size: 50rpx;
  487. }
  488. .col2 view:first-child {
  489. // width: 130rpx;
  490. }
  491. .col2 view:last-child {
  492. flex: 1;
  493. }
  494. .top {
  495. .img {
  496. width: 168rpx;
  497. height: 168rpx;
  498. border-radius: 50%;
  499. image {
  500. width: 168rpx;
  501. height: 168rpx;
  502. border-radius: 50%;
  503. background-color: #eee;
  504. }
  505. }
  506. }
  507. .d-flex.mb-2 {
  508. align-items: center;
  509. }
  510. .state-r {
  511. padding: 8rpx 20rpx;
  512. border-radius: 30rpx;
  513. }
  514. .state-g {
  515. padding: 8rpx 20rpx;
  516. border-radius: 30rpx;
  517. background-color: #e7e8f2;
  518. color: #949dad;
  519. }
  520. </style>