equipment-detail.vue 18 KB

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