DetailBak.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  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="numPartInfo" title="设备部位总数" :number-style="{ backgroundColor: '#52c41a' }">
  8. <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="partInfoListView()">设备部位</a-button>
  9. </a-badge>
  10. <a-badge :count="numModelbom" title="备件总数" :number-style="{ backgroundColor: '#52c41a' }">
  11. <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
  12. </a-badge>
  13. <a-badge :count="numCheckStandard" title="维护项目总数" :number-style="{ backgroundColor: '#52c41a' }">
  14. <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">维护项目</a-button>
  15. </a-badge>
  16. <!-- <a-badge :count="numNumCheckjob" title="待保养任务总数" :number-style="{ backgroundColor: '#52c41a' }">
  17. <a-button style="margin-left: 16px" type="default" @ok="handleOk" @click="checkJobTableWaitDoListView()">待保养任务</a-button>
  18. </a-badge>-->
  19. <a-button style="margin-left: 8px" type="primary" @click="handleCancel()">返回</a-button>
  20. </span>
  21. </a-col>
  22. </a-row>
  23. <a-descriptions bordered title="基本信息">
  24. <a-descriptions-item label="设备(新号)">{{ model.no }}</a-descriptions-item>
  25. <a-descriptions-item label="设备(旧号)">{{ model.zbh }}</a-descriptions-item>
  26. <a-descriptions-item label="设备描述">{{ model.name }}</a-descriptions-item>
  27. <a-descriptions-item label="型号">{{ model.model }}</a-descriptions-item>
  28. <a-descriptions-item label="ABC 标识">{{ BaseTool.Object.getField(levelMap,model.level) }}</a-descriptions-item>
  29. <a-descriptions-item label="设备类型">{{ model.typeName }}</a-descriptions-item>
  30. <a-descriptions-item label="自定义类型">{{ BaseTool.Object.getField(useTypeMap,model.useType) }}</a-descriptions-item>
  31. <a-descriptions-item label="生产商">{{ model.producerName }}</a-descriptions-item>
  32. <a-descriptions-item label="大小尺寸">{{ model.zz }}</a-descriptions-item>
  33. <a-descriptions-item label="系列号(出厂编号)">{{ model.zzh }}</a-descriptions-item>
  34. <a-descriptions-item label="使用人">{{ model.saveUserName }}</a-descriptions-item>
  35. <a-descriptions-item label="维修人">{{ model.repairUserName }}</a-descriptions-item>
  36. <a-descriptions-item label="第二维修人">{{ model.repairUserSecondName }}</a-descriptions-item>
  37. <a-descriptions-item label="购置日期">{{ model.buyDate }}</a-descriptions-item>
  38. <a-descriptions-item label="投用日期">{{ model.startDate }}</a-descriptions-item>
  39. <a-descriptions-item label="状态"><badge :status="DictCache.COLOR.SB_INFO_STATUS[model.status]" :text="statusMap[model.status]"></badge></a-descriptions-item>
  40. <a-descriptions-item label="备注">{{ model.remark }}</a-descriptions-item>
  41. <a-descriptions-item v-show="model.useType == 5" label="注册代码">{{ model.registerNo }}</a-descriptions-item>
  42. <a-descriptions-item label="介质属性">{{ model.characterType }}</a-descriptions-item>
  43. <a-descriptions-item label="使用登记证编号">{{ model.usedNo }}</a-descriptions-item>
  44. <a-descriptions-item label="维护供应商">{{ model.supplier }}</a-descriptions-item>
  45. <a-descriptions-item label="设备批号">{{ model.batchNo }}</a-descriptions-item>
  46. <a-descriptions-item label="预计工作年限">{{ model.workYear }}</a-descriptions-item>
  47. <a-descriptions-item label="设计到期年限">{{ model.retirementDate }}</a-descriptions-item>
  48. <a-descriptions-item label="登记日期">{{ model.registerDate }}</a-descriptions-item>
  49. </a-descriptions>
  50. <a-descriptions bordered v-show="model.useType == 4" title="计量信息">
  51. <a-descriptions-item label="测量设备编号">{{ model.cardNo }}</a-descriptions-item>
  52. <a-descriptions-item label="准确度等级">{{ model.fdjxh }}</a-descriptions-item>
  53. <a-descriptions-item label="检定日期">{{ model.checkDate }}</a-descriptions-item>
  54. <a-descriptions-item label="检定周期">{{ model.checkPeriod }}</a-descriptions-item>
  55. <a-descriptions-item label="检定有效期">{{ model.nextCheckDate }}</a-descriptions-item>
  56. <a-descriptions-item label="检定单位">{{ model.dph }}</a-descriptions-item>
  57. <a-descriptions-item label="检定人">{{ model.zaiz }}</a-descriptions-item>
  58. <a-descriptions-item label="检定结论">{{ BaseTool.Object.getField(rlTypeMap,model.rlType) }}</a-descriptions-item>
  59. <a-descriptions-item label="是否周检查">{{ BaseTool.Object.getField(colorMap,model.color) }}</a-descriptions-item>
  60. <a-descriptions-item label="检定证书编号">{{ model.sbdh }}</a-descriptions-item>
  61. <a-descriptions-item label="预警天数">{{ model.seatNumber }}</a-descriptions-item>
  62. </a-descriptions>
  63. <a-descriptions bordered title="文件信息">
  64. <a-descriptions-item label="维保手册">
  65. <a-upload
  66. :multiple="true"
  67. :fileList="BaseTool.UPLOAD.transImg(model.repairFileList)"
  68. >
  69. </a-upload>
  70. </a-descriptions-item>
  71. <a-descriptions-item label="使用手册">
  72. <a-upload
  73. :multiple="true"
  74. :fileList="BaseTool.UPLOAD.transImg(model.useFileList)"
  75. >
  76. </a-upload>
  77. </a-descriptions-item>
  78. <a-descriptions-item label="验收文件">
  79. <a-upload
  80. :multiple="true"
  81. :fileList="BaseTool.UPLOAD.transImg(model.recheckFileList)"
  82. >
  83. </a-upload>
  84. </a-descriptions-item>
  85. </a-descriptions>
  86. <title-divider title="相关数据" width="90px"></title-divider>
  87. <q-tabs :activeKey="activeKey" @change="changeTab">
  88. <q-tab-pane key="1" tab="报修记录">
  89. <repair-application-form-table :type="2" :table-params="{sbId: model.id, sbName: model.name}" ref="repairApplicationFormTable" />
  90. </q-tab-pane>
  91. <q-tab-pane key="2" tab="配件记录">
  92. <spare-part-used-select-table :type="2" :table-params="{sbId: model.id, modelId: model.modelId}" ref="sparePartUsedSelectTable"/>
  93. </q-tab-pane>
  94. <q-tab-pane key="3" tab="保养任务">
  95. <check-job-table :type="2" :check-type="2" :table-params="{sbId: model.id}" ref="spotJobTable" />
  96. </q-tab-pane>
  97. </q-tabs>
  98. </div>
  99. <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
  100. <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
  101. <part-info-list ref="partInfoList" />
  102. <!-- <check-job-table-wait-do :type="2" :check-type="2" ref="checkJobTableWaitDo" @ok="handleOk"/>-->
  103. </a-card>
  104. </template>
  105. <script>
  106. import DetailList from '@/components/tools/DetailList'
  107. import RepairApplicationFormTable from '@/views/repair/application-form/modules/RepairApplicationFormTable'
  108. import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
  109. // import CheckJobTableWaitDo from '@/views/check/checkjob/modules/CheckJobTableWaitDo'
  110. import { fetchFirmProducer } from '@/api/firm/producer'
  111. import { queryNumCheckStandard } from '@/api/check/checkstandard'
  112. import { queryNumCheckjob } from '@/api/check/checkjob'
  113. import { queryNumPartInfo } from '@/api/part/info'
  114. import { queryNumModelbom } from '@/api/sb/modelbom'
  115. import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
  116. import SbRunFillPageTable from '@/views/sb/run-fill/modules/SbRunFillPageTable'
  117. import SbInspectionFillPageTable from '@/views/sb/inspection-fill/modules/SbInspectionFillPageTable'
  118. import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
  119. import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
  120. import PartInfoList from '@/views/part/info/modules/PartInfoList'
  121. const DetailListItem = DetailList.Item
  122. export default {
  123. name: 'SbInfoDetail',
  124. components: {
  125. DetailList,
  126. DetailListItem,
  127. RepairApplicationFormTable,
  128. CheckJobTable,
  129. SparePartUsedSelectTable,
  130. SbRunFillPageTable,
  131. SbInspectionFillPageTable,
  132. DetailSbBom,
  133. DetailSbCheck,
  134. PartInfoList
  135. },
  136. data () {
  137. return {
  138. confirmLoading: false,
  139. mdl: {},
  140. modalTitle: null,
  141. visible: false,
  142. visibleDetail: false,
  143. activeKey: '3',
  144. collapseActiveKey: '1',
  145. model: {
  146. 'no': null,
  147. 'financingNo': null,
  148. 'name': null,
  149. 'modelId': null,
  150. 'typeId': null,
  151. 'isShow': null,
  152. 'isChild': null,
  153. 'parentId': null,
  154. 'level': null,
  155. 'useType': null,
  156. 'rate': null,
  157. 'month': null,
  158. 'usedMonth': null,
  159. 'initialValue': null,
  160. 'currentValue': null,
  161. 'cutValue': null,
  162. 'producerId': null,
  163. // 'sourceType': null,
  164. // 'sourceSbId': null,
  165. // 'parentId': null,
  166. 'unit': null,
  167. // 'position': null,
  168. // 'guigeId': null,
  169. 'useCompanyName': null,
  170. 'useProjectName': null,
  171. 'useDeptName': null,
  172. 'useGroupName': null,
  173. 'useUserName': null,
  174. 'saveDeptName': null,
  175. 'saveUserName': null,
  176. 'repairUserName': null,
  177. 'totalMiles': null,
  178. 'totalHours': null,
  179. // 'lastBaoyangTime': null,
  180. // 'lastBaoyangMiles': null,
  181. // 'lastBaoyangHours': null,
  182. // 'baoyangTimes': null,
  183. 'buyDate': null,
  184. 'startDate': null,
  185. // 'nextCheckDate': null,
  186. // 'guaranteeDate': null,
  187. // 'workYear': null,
  188. // 'retirementDate': null,
  189. // 'depreciationType': null,
  190. 'wbFile': null,
  191. 'useFile': null,
  192. 'checkFile': null,
  193. 'sbImage': null,
  194. 'sbFileList': null,
  195. 'qrCode': null,
  196. 'status': null,
  197. 'remark': null,
  198. 'parentName': null,
  199. 'createdUserName': null,
  200. 'typeName': null,
  201. 'producerName': null,
  202. 'zzh': null,
  203. 'fdjxh': null,
  204. 'fdjh': null,
  205. 'cph': null,
  206. 'dph': null,
  207. 'zz': null,
  208. 'rlType': null,
  209. 'color': null,
  210. 'seatNumber': null,
  211. 'registerNo': null,
  212. 'characterType': null,
  213. 'usedNo': null,
  214. 'supplier': null,
  215. 'repairUserSecond': null,
  216. 'batchNo': null,
  217. 'workYear': null,
  218. 'retirementDate': null,
  219. 'registerDate': null
  220. },
  221. numCheckStandard: 0,
  222. numNumCheckjob: 0,
  223. numModelbom: 0,
  224. numPartInfo: 0,
  225. firmProducerLevelMap: {},
  226. firmSupplier: {},
  227. firmProducer: {},
  228. statusMap: {},
  229. useTypeMap: {},
  230. levelMap: {},
  231. unitMap: {},
  232. colorMap: {},
  233. rlTypeMap: {},
  234. sourceTypeMap: {}
  235. }
  236. },
  237. created () {
  238. this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
  239. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
  240. this.firmProducerLevelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FIRM_PRODUCER_LEVEL)
  241. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
  242. this.unitMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
  243. this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
  244. this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
  245. this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
  246. this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
  247. },
  248. computed: {
  249. },
  250. methods: {
  251. handleViewBom (record) {
  252. this.visible = false
  253. const modal = this.$refs.detailSbBomModal
  254. modal.base(this.model)
  255. },
  256. handleViewCheck (record) {
  257. this.visible = false
  258. const modal = this.$refs.detailSbCheckModal
  259. modal.base(this.model)
  260. },
  261. base (record) {
  262. this.visible = true
  263. this.visibleDetail = true
  264. this.modalTitle = '详情'
  265. this.model = record
  266. this.activeKey = '1'
  267. this.collapseActiveKey = '0'
  268. this.fetchNum()
  269. fetchFirmProducer({ id: this.model.producerId }).then(res => {
  270. this.firmProducer = res.data
  271. })
  272. },
  273. fetchNum () {
  274. Promise.all([queryNumPartInfo({ sbId: this.model.id }), queryNumModelbom({ sbId: this.model.id }), queryNumCheckStandard({ sbId: this.model.id }), queryNumCheckjob({ sbId: this.model.id })])
  275. .then((values) => {
  276. this.numPartInfo = values[0].data
  277. this.numModelbom = values[1].data
  278. this.numCheckStandard = values[2].data
  279. this.numNumCheckjob = values[3].data
  280. })
  281. },
  282. changeTab (activeKey) {
  283. this.activeKey = activeKey
  284. if (this.activeKey === '1' && this.BaseTool.Object.isNotBlank(this.$refs.repairApplicationFormTable)) {
  285. this.$refs.repairApplicationFormTable.handleOk()
  286. return
  287. }
  288. if (this.activeKey === '2' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
  289. this.$refs.sparePartUsedSelectTable.handleOk()
  290. return
  291. }
  292. if (this.activeKey === '3' && this.BaseTool.Object.isNotBlank(this.$refs.spotJobTable)) {
  293. this.$refs.spotJobTable.handleOk()
  294. return
  295. }
  296. if (this.activeKey === '4' && this.BaseTool.Object.isNotBlank(this.$refs.pollingJobTable)) {
  297. this.$refs.pollingJobTable.handleOk()
  298. return
  299. }
  300. if (this.activeKey === '5' && this.BaseTool.Object.isNotBlank(this.$refs.spotCheckJobTable)) {
  301. this.$refs.spotCheckJobTable.handleOk()
  302. return
  303. }
  304. if (this.activeKey === '6' && this.BaseTool.Object.isNotBlank(this.$refs.spotCheckJobTable)) {
  305. this.$refs.spotCheckJobTable.handleOk()
  306. return
  307. }
  308. if (this.activeKey === '7' && this.BaseTool.Object.isNotBlank(this.$refs.sbOilPageTable)) {
  309. this.$refs.sbOilPageTable.handleOk()
  310. return
  311. }
  312. if (this.activeKey === '8' && this.BaseTool.Object.isNotBlank(this.$refs.sbInspectionFillPageTable)) {
  313. this.$refs.sbInspectionFillPageTable.handleOk()
  314. }
  315. },
  316. getQrcodeSrc: (dom) => {
  317. console.log(11, 22)
  318. },
  319. handleCancel (values) {
  320. this.visible = false
  321. this.visibleDetail = false
  322. this.confirmLoading = false
  323. this.$emit('ok', values)
  324. },
  325. handleOk () {
  326. this.visible = true
  327. this.fetchNum()
  328. },
  329. partInfoListView () {
  330. const modal = this.$refs.partInfoList
  331. modal.base({ sbId: this.model.id }, { sbId: this.model.id })
  332. },
  333. checkJobTableWaitDoListView () {
  334. const modal = this.$refs.checkJobTableWaitDo
  335. modal.base({ sbId: this.model.id }, { sbId: this.model.id, status: 1 })
  336. }
  337. }
  338. }
  339. </script>
  340. <style scoped>
  341. /* For demo */
  342. .ant-carousel {
  343. width: 300px;
  344. height: 300px;
  345. }
  346. .ant-carousel >>> .slick-slide {
  347. text-align: center;
  348. height: 300px;
  349. line-height: 300px;
  350. overflow: hidden;
  351. }
  352. .ant-carousel >>> .slick-slide h3 {
  353. color: #fff;
  354. }
  355. </style>