Detail.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455
  1. <template xmlns:v-slot="http://www.w3.org/1999/XSL/Transform">
  2. <a-card :bordered="false" v-show="visibleDetail" class="card" :title="modalTitle">
  3. <div v-show="visible">
  4. <a-row :gutter="48" slot="extra">
  5. <a-col :md="48" :sm="48">
  6. <span class="table-page-search-submitButtons" style="float: right">
  7. <a-badge :count="numChildSbInfo" title="子设备总数" :number-style="{ backgroundColor: '#52c41a' }">
  8. <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewChildSbInfo()">子设备</a-button>
  9. </a-badge>
  10. <a-badge :count="numPartInfo" title="设备部位总数" :number-style="{ backgroundColor: '#52c41a' }">
  11. <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="partInfoListView()">设备部位</a-button>
  12. </a-badge>
  13. <a-badge :count="numModelbom" title="备件总数" :number-style="{ backgroundColor: '#52c41a' }">
  14. <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
  15. </a-badge>
  16. <a-badge :count="numCheckStandard" title="保养项目总数" :number-style="{ backgroundColor: '#52c41a' }">
  17. <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">保养项目</a-button>
  18. </a-badge>
  19. <a-badge :count="numCheckjob" title="待保养项目总数" :number-style="{ backgroundColor: '#52c41a' }">
  20. <a-button style="margin-left: 8px" type="default" @click="handleViewCheckJob()">保养任务</a-button>
  21. </a-badge>
  22. <a-button v-show="model.useType==4" style="margin-left: 8px" type="default" @click="handleMeasure()">检定记录</a-button>
  23. <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
  24. </span>
  25. </a-col>
  26. </a-row>
  27. <detail-list title="" :col="3">
  28. <!-- <detail-list-item v-for="item in model.sbFileList" term="">
  29. <img :src="BaseTool.Constant.FILE_URL + item.url" width="200px" height="200px"/>
  30. </detail-list-item>-->
  31. <detail-list-item>
  32. <img-code :src="model.qrCode" title="点击重新生成二维码" :code-id="model.id" :width="200"></img-code>
  33. </detail-list-item>
  34. </detail-list>
  35. <title-divider title="基本信息" width="90px"></title-divider>
  36. <detail-list title="" :col="3">
  37. <detail-list-item term="设备(新号)">{{ model.no }}</detail-list-item>
  38. <detail-list-item term="设备(旧号)">{{ model.zbh }}</detail-list-item>
  39. <detail-list-item term="设备描述">{{ model.name }}</detail-list-item>
  40. <detail-list-item term="规格型号">{{ model.model }}</detail-list-item>
  41. <detail-list-item term="ABC 标识">{{ BaseTool.Object.getField(levelMap,model.level) }}</detail-list-item>
  42. <detail-list-item term="设备类型">{{ model.typeName }}</detail-list-item>
  43. <detail-list-item term="自定义类型">{{ BaseTool.Object.getField(useTypeMap,model.useType) }}</detail-list-item>
  44. <detail-list-item term="生产商">{{ model.producerName }}</detail-list-item>
  45. <detail-list-item term="大小尺寸">{{ model.zz }}</detail-list-item>
  46. <detail-list-item term="系列号(出厂编号)">{{ model.zzh }}</detail-list-item>
  47. <detail-list-item term="使用寿命">{{ model.workYear }}</detail-list-item>
  48. <detail-list-item term="是否显示">{{ model.isShow?'显示':'不显示' }}</detail-list-item>
  49. <detail-list-item v-show="model.isChild == 1" term="是否子设备">子设备</detail-list-item>
  50. <detail-list-item v-show="model.isChild == 2" term="是否子设备">父设备</detail-list-item>
  51. <detail-list-item v-show="model.isChild == 3" term="是否子设备">独立设备</detail-list-item>
  52. <detail-list-item term="状态"><badge :status="DictCache.COLOR.SB_INFO_STATUS[model.status]" :text="statusMap[model.status]"></badge></detail-list-item>
  53. <detail-list-item term="备注">{{ model.remark }}</detail-list-item>
  54. </detail-list>
  55. <title-divider title="资产编号" width="90px"></title-divider>
  56. <detail-list title="" :col="3">
  57. <detail-list-item term="资产编号1">{{ model.financingNo }}</detail-list-item>
  58. <detail-list-item term="资产编号2">{{ model.financingNoTwo }}</detail-list-item>
  59. <detail-list-item term="资产编号3">{{ model.financingNoThird }}</detail-list-item>
  60. <detail-list-item term="资产编号4">{{ model.financingNoFour }}</detail-list-item>
  61. <detail-list-item term="资产编号5">{{ model.financingNoFive }}</detail-list-item>
  62. </detail-list>
  63. <title-divider title="人员信息" width="90px"></title-divider>
  64. <detail-list title="" :col="3">
  65. <detail-list-item term="使用人">{{ model.saveUserName }}</detail-list-item>
  66. <detail-list-item term="第一维修人">{{ model.repairUserName }}</detail-list-item>
  67. <detail-list-item term="第二维修人">{{ model.repairUserNameSecond }}</detail-list-item>
  68. </detail-list>
  69. <detail-list title="" :col="3">
  70. <detail-list-item term="购置日期">{{ model.buyDate }}</detail-list-item>
  71. <detail-list-item term="投用日期">{{ model.startDate }}</detail-list-item>
  72. </detail-list>
  73. <title-divider v-show="model.useType == 5" title="特种信息" width="90px"></title-divider>
  74. <detail-list v-show="model.useType == 5" title="" :col="3">
  75. <detail-list-item term="注册代码">{{ model.registerNo }}</detail-list-item>
  76. <detail-list-item term="介质属性">{{ model.characterType }}</detail-list-item>
  77. <detail-list-item term="使用登记证编号">{{ model.usedNo }}</detail-list-item>
  78. <detail-list-item term="维护供应商">{{ model.supplier }}</detail-list-item>
  79. <detail-list-item term="设备批号">{{ model.batchNo }}</detail-list-item>
  80. <detail-list-item term="设计到期年限">{{ model.retirementDate }}</detail-list-item>
  81. <detail-list-item term="登记日期">{{ model.registerDate }}</detail-list-item>
  82. </detail-list>
  83. <title-divider v-show="model.useType == 4" title="计量信息" width="90px"></title-divider>
  84. <detail-list v-show="model.useType == 4" title="" :col="3">
  85. <detail-list-item term="测量设备编号">{{ model.cardNo }}</detail-list-item>
  86. <detail-list-item term="准确度等级">{{ model.fdjxh }}</detail-list-item>
  87. <detail-list-item term="检定日期">{{ model.checkDate }}</detail-list-item>
  88. <detail-list-item term="检定周期">{{ model.checkPeriod }}</detail-list-item>
  89. <detail-list-item term="检定有效期">{{ model.nextCheckDate }}</detail-list-item>
  90. <detail-list-item term="检定单位">{{ model.dph }}</detail-list-item>
  91. <detail-list-item term="检定人">{{ model.zaiz }}</detail-list-item>
  92. <detail-list-item term="检定结论">{{ BaseTool.Object.getField(rlTypeMap,model.rlType) }}</detail-list-item>
  93. <detail-list-item term="是否周检查">{{ BaseTool.Object.getField(colorMap,model.color) }}</detail-list-item>
  94. <detail-list-item term="检定证书编号">{{ model.sbdh }}</detail-list-item>
  95. <detail-list-item term="预警天数">{{ model.seatNumber }}</detail-list-item>
  96. </detail-list>
  97. <title-divider title="图片信息" width="90px"></title-divider>
  98. <detail-list title="" :col="1">
  99. <detail-list-item term="" v-if="model.sbFileList != null && model.sbFileList.length > 0">
  100. <viewer :images="model.sbFileList" @inited="inited" ref="viewer" :index="1" >
  101. <img v-for="item in model.sbFileList" :src="item.url" :key="item.id" class="image">
  102. </viewer>
  103. </detail-list-item>
  104. <detail-list-item term="" v-if="model.sbFileList == null || model.sbFileList.length === 0">
  105. 暂无
  106. </detail-list-item>
  107. </detail-list>
  108. <title-divider title="文件信息" width="90px"></title-divider>
  109. <detail-list title="" :col="4">
  110. <detail-list-item term="维保手册">
  111. <a-upload
  112. :multiple="true"
  113. :fileList="BaseTool.UPLOAD.transImg(model.repairFileList)"
  114. >
  115. </a-upload>
  116. </detail-list-item>
  117. <detail-list-item term="使用手册">
  118. <a-upload
  119. :multiple="true"
  120. :fileList="BaseTool.UPLOAD.transImg(model.useFileList)"
  121. >
  122. </a-upload>
  123. </detail-list-item>
  124. <detail-list-item term="验收文件">
  125. <a-upload
  126. :multiple="true"
  127. :fileList="BaseTool.UPLOAD.transImg(model.recheckFileList)"
  128. >
  129. </a-upload>
  130. </detail-list-item>
  131. </detail-list>
  132. <title-divider title="相关数据" width="90px"></title-divider>
  133. <q-tabs :activeKey="activeKey" @change="changeTab">
  134. <q-tab-pane key="2" tab="配件记录">
  135. <spare-part-used-select-table :type="2" :table-params="{sbId: model.id, modelId: model.modelId}" ref="sparePartUsedSelectTable"/>
  136. </q-tab-pane>
  137. <q-tab-pane key="3" tab="保养任务">
  138. <check-job-table :type="2" :check-type="2" :table-params="{sbId: model.id}" ref="spotJobTable" />
  139. </q-tab-pane>
  140. <q-tab-pane key="4" tab="历史故障">
  141. <repair-application-form-table :type="2" :table-params="{sbId: model.id, sbName: model.name}" ref="repairApplicationFormTable" />
  142. </q-tab-pane>
  143. <q-tab-pane key="5" tab="历史费用">
  144. <repair-fee-table :table-params="{sbId: model.id}" ref="repairFeeTable" />
  145. </q-tab-pane>
  146. </q-tabs>
  147. </div>
  148. <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
  149. <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
  150. <detail-sb-check-job ref="detailSbCheckJobModal" @ok="handleOk"/>
  151. <detail-sb-measure ref="detailSbMeasureModal" @ok="handleOk"/>
  152. <detail-sb-info ref="detailSbInfoModal" @ok="handleOk"/>
  153. <part-info-list ref="partInfoList" />
  154. <!-- <check-job-table-wait-do :type="2" :check-type="2" ref="checkJobTableWaitDo" @ok="handleOk"/>-->
  155. </a-card>
  156. </template>
  157. <script>
  158. import DetailList from '@/components/tools/DetailList'
  159. import RepairApplicationFormTable from '@/views/repair/application-form/modules/RepairApplicationFormTable'
  160. import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
  161. // import CheckJobTableWaitDo from '@/views/check/checkjob/modules/CheckJobTableWaitDo'
  162. import { fetchFirmProducer } from '@/api/firm/producer'
  163. import { queryNumCheckStandard } from '@/api/check/checkstandard'
  164. import { queryNumCheckjob } from '@/api/check/checkjob'
  165. import { queryNumRepairReason } from '@/api/repair/repair-reason'
  166. import { queryNumPartInfo } from '@/api/part/info'
  167. import { queryNumModelbom } from '@/api/sb/modelbom'
  168. import { queryChildNumSbInfo } from '@/api/sb/info'
  169. import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
  170. import SbOilPageTable from '@/views/sb/oil/modules/SbOilPageTable'
  171. import SbRunFillPageTable from '@/views/sb/run-fill/modules/SbRunFillPageTable'
  172. import SbInspectionFillPageTable from '@/views/sb/inspection-fill/modules/SbInspectionFillPageTable'
  173. import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
  174. import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
  175. import DetailSbCheckJob from '@/views/check/checkjob/modules/DetailSbCheckJob'
  176. import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheck'
  177. import DetailSbInfo from '@/views/sb/info/modules/DetailSbInfo'
  178. import RepairFeeTable from '@/views/repair/fee/modules/RepairFeeTable'
  179. import PartInfoList from '@/views/part/info/modules/PartInfoList'
  180. const DetailListItem = DetailList.Item
  181. export default {
  182. name: 'SbInfoDetail',
  183. components: {
  184. DetailList,
  185. DetailListItem,
  186. RepairApplicationFormTable,
  187. CheckJobTable,
  188. SparePartUsedSelectTable,
  189. SbOilPageTable,
  190. SbRunFillPageTable,
  191. SbInspectionFillPageTable,
  192. DetailSbBom,
  193. DetailSbCheck,
  194. DetailSbCheckJob,
  195. PartInfoList,
  196. DetailSbMeasure,
  197. DetailSbInfo,
  198. RepairFeeTable
  199. },
  200. data () {
  201. return {
  202. confirmLoading: false,
  203. mdl: {},
  204. modalTitle: null,
  205. visible: false,
  206. visibleDetail: false,
  207. activeKey: '3',
  208. isChildMap: {},
  209. isShowMap: {},
  210. collapseActiveKey: '1',
  211. model: {
  212. 'no': null,
  213. 'financingNo': null,
  214. 'financingNoTwo': null,
  215. 'financingNoThird': null,
  216. 'financingNoFour': null,
  217. 'financingNoFive': null,
  218. 'name': null,
  219. 'modelId': null,
  220. 'typeId': null,
  221. 'isShow': null,
  222. 'isChild': null,
  223. 'parentId': null,
  224. 'level': null,
  225. 'useType': null,
  226. 'rate': null,
  227. 'month': null,
  228. 'usedMonth': null,
  229. 'initialValue': null,
  230. 'currentValue': null,
  231. 'cutValue': null,
  232. 'producerId': null,
  233. // 'sourceType': null,
  234. // 'sourceSbId': null,
  235. // 'parentId': null,
  236. 'unit': null,
  237. // 'position': null,
  238. // 'guigeId': null,
  239. 'useCompanyName': null,
  240. 'useProjectName': null,
  241. 'useDeptName': null,
  242. 'useGroupName': null,
  243. 'useUserName': null,
  244. 'saveDeptName': null,
  245. 'saveUserName': null,
  246. 'repairUserName': null,
  247. 'repairUserNameSecond': null,
  248. 'totalMiles': null,
  249. 'totalHours': null,
  250. // 'lastBaoyangTime': null,
  251. // 'lastBaoyangMiles': null,
  252. // 'lastBaoyangHours': null,
  253. // 'baoyangTimes': null,
  254. 'buyDate': null,
  255. 'startDate': null,
  256. // 'nextCheckDate': null,
  257. // 'guaranteeDate': null,
  258. // 'workYear': null,
  259. // 'retirementDate': null,
  260. // 'depreciationType': null,
  261. 'wbFile': null,
  262. 'useFile': null,
  263. 'checkFile': null,
  264. 'sbImage': null,
  265. 'sbFileList': null,
  266. 'qrCode': null,
  267. 'status': null,
  268. 'remark': null,
  269. 'parentName': null,
  270. 'createdUserName': null,
  271. 'typeName': null,
  272. 'producerName': null,
  273. 'zzh': null,
  274. 'fdjxh': null,
  275. 'fdjh': null,
  276. 'cph': null,
  277. 'dph': null,
  278. 'zz': null,
  279. 'rlType': null,
  280. 'color': null,
  281. 'seatNumber': null,
  282. 'registerNo': null,
  283. 'characterType': null,
  284. 'usedNo': null,
  285. 'supplier': null,
  286. 'repairUserSecond': null,
  287. 'batchNo': null,
  288. 'workYear': null,
  289. 'retirementDate': null,
  290. 'registerDate': null
  291. },
  292. numCheckStandard: 0,
  293. numCheckjob: 0,
  294. numRepairReason: 0,
  295. numModelbom: 0,
  296. numPartInfo: 0,
  297. numChildSbInfo: 0,
  298. firmProducerLevelMap: {},
  299. firmSupplier: {},
  300. firmProducer: {},
  301. statusMap: {},
  302. useTypeMap: {},
  303. levelMap: {},
  304. unitMap: {},
  305. colorMap: {},
  306. rlTypeMap: {},
  307. sourceTypeMap: {}
  308. }
  309. },
  310. created () {
  311. this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
  312. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
  313. this.firmProducerLevelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FIRM_PRODUCER_LEVEL)
  314. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
  315. this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
  316. this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
  317. this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
  318. this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
  319. this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
  320. this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
  321. this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
  322. },
  323. computed: {
  324. },
  325. methods: {
  326. inited (viewer) {
  327. this.$viewer = viewer
  328. },
  329. handleViewBom (record) {
  330. this.visible = false
  331. const modal = this.$refs.detailSbBomModal
  332. modal.base(this.model)
  333. },
  334. handleViewChildSbInfo () {
  335. this.visible = false
  336. const modal = this.$refs.detailSbInfoModal
  337. modal.base(this.model)
  338. },
  339. handleViewCheck (record) {
  340. this.visible = false
  341. const modal = this.$refs.detailSbCheckModal
  342. modal.base(this.model)
  343. },
  344. handleViewCheckJob (record) {
  345. this.visible = false
  346. const modal = this.$refs.detailSbCheckJobModal
  347. modal.base(this.model)
  348. },
  349. handleMeasure (record) {
  350. this.visible = false
  351. const modal = this.$refs.detailSbMeasureModal
  352. modal.base(this.model)
  353. },
  354. base (record) {
  355. this.visible = true
  356. this.visibleDetail = true
  357. this.modalTitle = '详情'
  358. this.model = record
  359. this.activeKey = '1'
  360. this.collapseActiveKey = '0'
  361. this.fetchNum()
  362. fetchFirmProducer({ id: this.model.producerId }).then(res => {
  363. this.firmProducer = res.data
  364. })
  365. },
  366. fetchNum () {
  367. Promise.all([
  368. queryNumPartInfo({ sbId: this.model.id }),
  369. queryNumModelbom({ sbId: this.model.id }),
  370. queryNumCheckStandard({ sbId: this.model.id }),
  371. queryNumCheckjob({ sbId: this.model.id, status: this.DictCache.VALUE.CHECK_JOB_STATUS.NOT_EXECUTE }),
  372. queryNumRepairReason({ sbId: this.model.id })
  373. ])
  374. .then((values) => {
  375. this.numPartInfo = values[0].data
  376. this.numModelbom = values[1].data
  377. this.numCheckStandard = values[2].data
  378. this.numCheckjob = values[3].data
  379. this.numRepairReason = values[4].data
  380. })
  381. // 如果是父设备,则要获取子设备的数量,并点击后可以看到子设备的情况
  382. queryChildNumSbInfo({ parentId: this.model.id }).then(res => {
  383. this.numChildSbInfo = res.data
  384. })
  385. },
  386. changeTab (activeKey) {
  387. this.activeKey = activeKey
  388. if (this.activeKey === '2' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
  389. this.$refs.sparePartUsedSelectTable.handleOk()
  390. return
  391. }
  392. if (this.activeKey === '3' && this.BaseTool.Object.isNotBlank(this.$refs.spotJobTable)) {
  393. this.$refs.spotJobTable.handleOk()
  394. return
  395. }
  396. if (this.activeKey === '4' && this.BaseTool.Object.isNotBlank(this.$refs.repairApplicationFormTable)) {
  397. this.$refs.repairApplicationFormTable.handleOk()
  398. }
  399. if (this.activeKey === '5' && this.BaseTool.Object.isNotBlank(this.$refs.repairFeeTable)) {
  400. this.$refs.repairFeeTable.handleOk()
  401. }
  402. },
  403. getQrcodeSrc: (dom) => {
  404. console.log(11, 22)
  405. },
  406. handleCancel (values) {
  407. this.visible = false
  408. this.visibleDetail = false
  409. this.confirmLoading = false
  410. this.$emit('ok', values)
  411. },
  412. handleOk () {
  413. this.visible = true
  414. this.fetchNum()
  415. },
  416. partInfoListView () {
  417. const modal = this.$refs.partInfoList
  418. modal.base({ sbId: this.model.id }, { sbId: this.model.id })
  419. },
  420. checkJobTableWaitDoListView () {
  421. const modal = this.$refs.checkJobTableWaitDo
  422. modal.base({ sbId: this.model.id }, { sbId: this.model.id, status: 1 })
  423. }
  424. }
  425. }
  426. </script>
  427. <style scoped>
  428. /* For demo */
  429. .ant-carousel {
  430. width: 300px;
  431. height: 300px;
  432. }
  433. .ant-carousel >>> .slick-slide {
  434. text-align: center;
  435. height: 300px;
  436. line-height: 300px;
  437. overflow: hidden;
  438. }
  439. .ant-carousel >>> .slick-slide h3 {
  440. color: #fff;
  441. }
  442. .image {
  443. width: calc(20% - 10px);
  444. cursor: pointer;
  445. margin: 5px;
  446. display: inline-block;
  447. }
  448. </style>