equipment-detail.vue 18 KB

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