DetailC.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  1. <template>
  2. <a-card v-show="visibleDetail" :title="modalTitle">
  3. <div v-show="visible">
  4. <div style="padding: 20px;">
  5. <a-row :gutter="48" slot="extra">
  6. <a-col :md="48" :sm="48">
  7. <span style="float: left">
  8. <a-badge :count="numChildSbInfo" title="子设备总数" :number-style="{ backgroundColor: '#52c41a' }">
  9. <a-button style="margin-left: 20px" type="default" @ok="handleOk" @click="handleViewChildSbInfo()">子设备</a-button>
  10. </a-badge>
  11. <a-badge :count="numPartInfo" title="设备部位总数" :number-style="{ backgroundColor: '#52c41a' }">
  12. <a-button style="margin-left: 20px" type="default" @ok="handleOk" @click="partInfoListView()">设备部位</a-button>
  13. </a-badge>
  14. <a-badge :count="numModelbom" title="备件总数" :number-style="{ backgroundColor: '#52c41a' }">
  15. <a-button style="margin-left: 20px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
  16. </a-badge>
  17. <a-badge :count="numCheckStandard" title="维护项目总数" :number-style="{ backgroundColor: '#52c41a' }">
  18. <a-button style="margin-left: 20px" type="default" @ok="handleOk" @click="handleViewCheck()">维护项目</a-button>
  19. </a-badge>
  20. <a-badge :count="numCheckjob" title="保养任务总数" :number-style="{ backgroundColor: '#52c41a' }">
  21. <a-button style="margin-left: 20px" type="default" @click="handleViewCheckJob()">保养任务</a-button>
  22. </a-badge>
  23. <a-button v-show="model.useType==4" style="margin-left: 8px" type="default" @click="handleMeasure()">检定记录</a-button>
  24. <a-button style="margin-left: 20px" type="error" @click="handleTuiCalendar(1)">保养日历</a-button>
  25. <a-button style="margin-left: 20px" type="default" @click="handleRepairReportSbInfo()">工单分析</a-button>
  26. <a-button style="margin-left: 20px" type="default" @click="handleRepairReportSbInfoFee()">费用分析</a-button>
  27. <a-button style="margin-left: 8px" type="default" @click="handleEdit()">修改</a-button>
  28. <a-button style="margin-left: 8px" type="default" :loading="confirmLoading" @click="handleOk()">刷新</a-button>
  29. <a-button style="margin-left: 20px" type="primary" @click="handleCancel()">返回</a-button>
  30. </span>
  31. </a-col>
  32. </a-row>
  33. </div>
  34. <a-layout>
  35. <a-layout-sider :width="335">
  36. <img-code
  37. style="border: 1px dashed #ccc"
  38. :src="model.qrCode"
  39. title="点击重新生成二维码"
  40. :code-id="model.id"
  41. :width="297"
  42. :height="297"></img-code>
  43. <a-divider style="background: #D6D6D6" />
  44. <a-row type="flex" justify="space-between" :gutter="[16,16]">
  45. <a-col :span="10">
  46. <a-button shape="round" @click="handleRouter(1)" block>
  47. 配件记录
  48. </a-button>
  49. </a-col>
  50. <a-col :span="10">
  51. <a-button shape="round" @click="handleRouter(2)" block>
  52. 保养记录
  53. </a-button>
  54. </a-col>
  55. <a-col :span="10">
  56. <a-button shape="round" @click="handleRouter(3)" block>
  57. 历史故障
  58. </a-button>
  59. </a-col>
  60. <a-col :span="10">
  61. <a-button shape="round" @click="handleRouter(4)" block>
  62. 历史费用
  63. </a-button>
  64. </a-col>
  65. <a-col :span="10">
  66. <a-button shape="round" @click="handleRouter(5)" block>
  67. 状态变更记录
  68. </a-button>
  69. </a-col>
  70. <a-col :span="10">
  71. <a-button shape="round" @click="handleRouter(6)" block>
  72. 停机记录
  73. </a-button>
  74. </a-col>
  75. </a-row>
  76. </a-layout-sider>
  77. <a-layout-content :style="{ background: '#fff',padding: '20px'}">
  78. <a-card >
  79. <div style="margin:0; padding:15px 30px; background:#EFEFFB;font-size:16px; color: #1890ff"><b>基本信息</b></div>
  80. <a-descriptions bordered :column="3">
  81. <a-descriptions-item label="设备编号">
  82. {{ model.no }}
  83. </a-descriptions-item>
  84. <a-descriptions-item label="设备(旧号)">
  85. {{ model.zbh }}
  86. </a-descriptions-item>
  87. <a-descriptions-item label="设备描述">
  88. {{ model.name }}
  89. </a-descriptions-item>
  90. <a-descriptions-item label="规格型号">
  91. {{ model.model }}
  92. </a-descriptions-item>
  93. <a-descriptions-item label="ABC 标识" >
  94. {{ BaseTool.Object.getField(levelMap,model.level) }}
  95. </a-descriptions-item>
  96. <a-descriptions-item label="设备类型">
  97. {{ model.typeName }}
  98. </a-descriptions-item>
  99. <a-descriptions-item label="自定义类型">
  100. {{ BaseTool.Object.getField(useTypeMap,model.useType) }}
  101. </a-descriptions-item>
  102. <a-descriptions-item label="生产商">
  103. {{ model.producerName }}
  104. </a-descriptions-item>
  105. <a-descriptions-item label="大小尺寸">
  106. {{ model.zz }}
  107. </a-descriptions-item>
  108. <a-descriptions-item label="出厂编号">{{ model.zzh }}</a-descriptions-item>
  109. <a-descriptions-item label="使用位置">{{ model.cph }}</a-descriptions-item>
  110. <a-descriptions-item label="设备位置">{{ model.positionName }}</a-descriptions-item>
  111. <a-descriptions-item label="使用寿命">{{ model.workYear }}</a-descriptions-item>
  112. <a-descriptions-item label="是否显示">{{ model.isShow?'显示':'不显示' }}</a-descriptions-item>
  113. <a-descriptions-item v-if="model.isChild == 1" label="是否子设备">子设备</a-descriptions-item>
  114. <a-descriptions-item v-else-if="model.isChild == 2" label="是否子设备">父设备</a-descriptions-item>
  115. <a-descriptions-item v-else-if="model.isChild == 3" label="是否子设备">独立设备</a-descriptions-item>
  116. <a-descriptions-item label="状态"><badge :status="DictCache.COLOR.SB_INFO_STATUS[model.status]" :text="statusMap[model.status]"></badge></a-descriptions-item>
  117. <a-descriptions-item label="备注">{{ model.remark }}</a-descriptions-item>
  118. </a-descriptions>
  119. </a-card>
  120. <br>
  121. <a-card >
  122. <div style="margin:0; padding:15px 30px; background:#EFEFFB;font-size:16px; color: #1890ff"><b>自定义参数</b></div>
  123. <a-descriptions bordered :column="3">
  124. <a-descriptions-item v-for="item in paramList" :key="item.name" :label="item.name">{{ item.content }}</a-descriptions-item>
  125. </a-descriptions>
  126. </a-card>
  127. <br>
  128. <a-card >
  129. <div style="margin:0; padding:15px 30px; background:#EFEFFB;font-size:16px; color: #1890ff"><b>资产编号</b></div>
  130. <a-descriptions bordered :column="3">
  131. <a-descriptions-item label="资产编号1">{{ model.financingNo }}</a-descriptions-item>
  132. <a-descriptions-item label="资产编号2">{{ model.financingNoTwo }}</a-descriptions-item>
  133. <a-descriptions-item label="资产编号3">{{ model.financingNoThird }}</a-descriptions-item>
  134. <a-descriptions-item label="资产编号4">{{ model.financingNoFour }}</a-descriptions-item>
  135. <a-descriptions-item label="资产编号5">{{ model.financingNoFive }}</a-descriptions-item>
  136. </a-descriptions>
  137. </a-card>
  138. <br>
  139. <a-card >
  140. <div style="margin:0; padding:15px 30px; background:#EFEFFB;font-size:16px; color: #1890ff"><b>人员信息</b></div>
  141. <a-descriptions bordered :column="3">
  142. <a-descriptions-item label="使用人">{{ model.saveUserName }}</a-descriptions-item>
  143. <a-descriptions-item label="第一维修人">{{ model.repairUserName }}</a-descriptions-item>
  144. <a-descriptions-item label="第二维修人">{{ model.repairUserNameSecond }}</a-descriptions-item>
  145. <a-descriptions-item label="购置日期">{{ model.buyDate }}</a-descriptions-item>
  146. <a-descriptions-item label="投用日期">{{ model.startDate }}</a-descriptions-item>
  147. </a-descriptions>
  148. </a-card>
  149. <br>
  150. <a-card v-show="model.useType == 5">
  151. <div style="margin:0; padding:15px 30px; background:#EFEFFB;font-size:16px; color: #1890ff"><b>特种信息</b></div>
  152. <a-descriptions bordered :column="3">
  153. <a-descriptions-item label="注册代码">{{ model.registerNo }}</a-descriptions-item>
  154. <a-descriptions-item label="介质属性">{{ model.characterType }}</a-descriptions-item>
  155. <a-descriptions-item label="使用登记证编号">{{ model.usedNo }}</a-descriptions-item>
  156. <a-descriptions-item label="维护供应商">{{ model.supplier }}</a-descriptions-item>
  157. <a-descriptions-item label="设备批号">{{ model.batchNo }}</a-descriptions-item>
  158. <a-descriptions-item label="设计到期年限">{{ model.retirementDate }}</a-descriptions-item>
  159. <a-descriptions-item label="登记日期">{{ model.registerDate }}</a-descriptions-item>
  160. </a-descriptions>
  161. </a-card>
  162. <br v-show="model.useType == 5">
  163. <a-card v-show="model.useType == 4" >
  164. <div style="margin:0; padding:15px 30px; background:#EFEFFB;font-size:16px; color: #1890ff"><b>计量信息</b></div>
  165. <a-descriptions bordered :column="3">
  166. <a-descriptions-item label="计量设备编号">{{ model.cardNo }}</a-descriptions-item>
  167. <a-descriptions-item label="准确度等级">{{ model.fdjxh }}</a-descriptions-item>
  168. <a-descriptions-item label="检定日期">{{ model.checkDate }}</a-descriptions-item>
  169. <a-descriptions-item label="检定周期">{{ model.checkPeriod }}</a-descriptions-item>
  170. <a-descriptions-item label="检定有效期">{{ model.nextCheckDate }}</a-descriptions-item>
  171. <a-descriptions-item label="检定单位">{{ model.dph }}</a-descriptions-item>
  172. <a-descriptions-item label="检定人">{{ model.zaiz }}</a-descriptions-item>
  173. <a-descriptions-item label="检定结论">{{ BaseTool.Object.getField(rlTypeMap,model.rlType) }}</a-descriptions-item>
  174. <a-descriptions-item label="是否周检查">{{ BaseTool.Object.getField(colorMap,model.color) }}</a-descriptions-item>
  175. <a-descriptions-item label="检定证书编号">{{ model.sbdh }}</a-descriptions-item>
  176. <a-descriptions-item label="预警天数">{{ model.seatNumber }}</a-descriptions-item>
  177. </a-descriptions>
  178. </a-card>
  179. <br v-show="model.useType == 4">
  180. <a-card >
  181. <div style="margin:0; padding:15px 30px; background:#EFEFFB;font-size:16px; color: #1890ff"><b>文件信息</b></div>
  182. <a-descriptions bordered :column="3">
  183. <a-descriptions-item label="维保手册">
  184. <a-upload
  185. :multiple="true"
  186. :fileList="BaseTool.UPLOAD.transImg(model.repairFileList)"
  187. >
  188. </a-upload>
  189. </a-descriptions-item>
  190. <a-descriptions-item label="使用手册">
  191. <a-upload
  192. :multiple="true"
  193. :fileList="BaseTool.UPLOAD.transImg(model.useFileList)"
  194. >
  195. </a-upload>
  196. </a-descriptions-item>
  197. <a-descriptions-item label="验收文件">
  198. <a-upload
  199. :multiple="true"
  200. :fileList="BaseTool.UPLOAD.transImg(model.recheckFileList)"
  201. >
  202. </a-upload>
  203. </a-descriptions-item>
  204. </a-descriptions>
  205. </a-card>
  206. <br>
  207. <a-card>
  208. <div style="margin:0; padding:15px 30px; background:#EFEFFB;font-size:16px; color: #1890ff"><b>图片信息</b></div>
  209. <br>
  210. <a-row v-if="model.sbFileList != null && model.sbFileList.length > 0" type="flex" justify="space-between" :gutter="[16,16]">
  211. <a-col >
  212. <img v-for="item in model.sbFileList" :src="item.url" :key="item.id" class="image">
  213. </a-col>
  214. </a-row>
  215. <div v-if="model.sbFileList == null || model.sbFileList.length === 0"> 暂无</div>
  216. </a-card>
  217. </a-layout-content>
  218. </a-layout>
  219. </div>
  220. <base-form ref="baseModal" @ok="handleOk"/>
  221. <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
  222. <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
  223. <detail-sb-check-job ref="detailSbCheckJobModal" @ok="handleOk"/>
  224. <detail-sb-measure ref="detailSbMeasureModal" @ok="handleOk"/>
  225. <detail-sb-info ref="detailSbInfoModal" @ok="handleOk"/>
  226. <part-info-list ref="partInfoList" />
  227. <repair-report-sb-info ref="repairReportSbInfo" :sb-id="model.id" @ok="handleOk"/>
  228. <repair-report-sb-info-fee ref="repairReportSbInfoFee" :sb-id="model.id" @ok="handleOk"/>
  229. </a-card>
  230. </template>
  231. <script>
  232. import BaseForm from './BaseForm'
  233. import DetailList from '@/components/tools/DetailList'
  234. import RepairApplicationFormTable from '@/views/repair/application-form/modules/RepairApplicationFormTable'
  235. import CheckJobTable from '@/views/check/checkjob/modules/CheckJobTable'
  236. import SbStatusLogTable from '@/views/sb/status-log/modules/SbStatusLogTable'
  237. import SbStopLogTable from '@/views/sb/stop-logs/modules/SbStopLogTable'
  238. import { fetchFirmProducer } from '@/api/firm/producer'
  239. import { queryNumCheckStandard } from '@/api/check/checkstandard'
  240. import { queryNumCheckjob, queryTuiCalendarIgnores } from '@/api/check/checkjob'
  241. import { queryNumRepairReason } from '@/api/repair/repair-reason'
  242. import { queryNumPartInfo } from '@/api/part/info'
  243. import { queryNumModelbom } from '@/api/sb/modelbom'
  244. import { fetchSbInfo, queryChildNumSbInfo } from '@/api/sb/info'
  245. import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
  246. // import SbOilPageTable from '@/views/sb/oil/modules/SbOilPageTable'
  247. import SbRunFillPageTable from '@/views/sb/run-fill/modules/SbRunFillPageTable'
  248. import SbInspectionFillPageTable from '@/views/sb/inspection-fill/modules/SbInspectionFillPageTable'
  249. import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
  250. import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
  251. import DetailSbCheckJob from '@/views/check/checkjob/modules/DetailSbCheckJob'
  252. import DetailSbMeasure from '@/views/sb/measurelog/modules/DetailSbCheck'
  253. import DetailSbInfo from '@/views/sb/info/modules/DetailSbInfo'
  254. import RepairFeeTable from '@/views/repair/fee/modules/RepairFeeTable'
  255. import RepairReportSbInfo from '@/views/dashboard/RepairReportSbInfo'
  256. import RepairReportSbInfoFee from '@/views/dashboard/RepairReportSbInfoFee'
  257. import PartInfoList from '@/views/part/info/modules/PartInfoList'
  258. const DetailListItem = DetailList.Item
  259. export default {
  260. name: 'SbInfoDetail',
  261. components: {
  262. BaseForm,
  263. DetailList,
  264. DetailListItem,
  265. RepairApplicationFormTable,
  266. CheckJobTable,
  267. SparePartUsedSelectTable,
  268. // SbOilPageTable,
  269. SbRunFillPageTable,
  270. SbInspectionFillPageTable,
  271. DetailSbBom,
  272. DetailSbCheck,
  273. DetailSbCheckJob,
  274. PartInfoList,
  275. DetailSbMeasure,
  276. DetailSbInfo,
  277. RepairFeeTable,
  278. SbStatusLogTable,
  279. SbStopLogTable,
  280. RepairReportSbInfo,
  281. RepairReportSbInfoFee
  282. },
  283. data () {
  284. return {
  285. confirmLoading: false,
  286. mdl: {},
  287. modalTitle: null,
  288. paramList: [],
  289. visible: false,
  290. visibleDetail: false,
  291. activeKey: '3',
  292. isChildMap: {},
  293. isShowMap: {},
  294. collapseActiveKey: '1',
  295. model: {
  296. 'no': null,
  297. 'financingNo': null,
  298. 'financingNoTwo': null,
  299. 'financingNoThird': null,
  300. 'financingNoFour': null,
  301. 'financingNoFive': null,
  302. 'name': null,
  303. 'modelId': null,
  304. 'typeId': null,
  305. 'isShow': null,
  306. 'isChild': null,
  307. 'paramList': null,
  308. 'parentId': null,
  309. 'level': null,
  310. 'useType': null,
  311. 'rate': null,
  312. 'month': null,
  313. 'usedMonth': null,
  314. 'initialValue': null,
  315. 'currentValue': null,
  316. 'cutValue': null,
  317. 'producerId': null,
  318. // 'sourceType': null,
  319. // 'sourceSbId': null,
  320. // 'parentId': null,
  321. 'unit': null,
  322. // 'position': null,
  323. // 'guigeId': null,
  324. 'useCompanyName': null,
  325. 'useProjectName': null,
  326. 'useDeptName': null,
  327. 'useGroupName': null,
  328. 'useUserName': null,
  329. 'saveDeptName': null,
  330. 'saveUserName': null,
  331. 'repairUserName': null,
  332. 'repairUserNameSecond': null,
  333. 'totalMiles': null,
  334. 'totalHours': null,
  335. // 'lastBaoyangTime': null,
  336. // 'lastBaoyangMiles': null,
  337. // 'lastBaoyangHours': null,
  338. // 'baoyangTimes': null,
  339. 'buyDate': null,
  340. 'startDate': null,
  341. // 'nextCheckDate': null,
  342. // 'guaranteeDate': null,
  343. // 'workYear': null,
  344. // 'retirementDate': null,
  345. // 'depreciationType': null,
  346. 'wbFile': null,
  347. 'useFile': null,
  348. 'checkFile': null,
  349. 'sbImage': null,
  350. 'sbFileList': null,
  351. 'qrCode': null,
  352. 'status': null,
  353. 'remark': null,
  354. 'parentName': null,
  355. 'createdUserName': null,
  356. 'typeName': null,
  357. 'producerName': null,
  358. 'zzh': null,
  359. 'fdjxh': null,
  360. 'fdjh': null,
  361. 'cph': null,
  362. 'positionId': null,
  363. 'positionName': null,
  364. 'dph': null,
  365. 'zz': null,
  366. 'rlType': null,
  367. 'color': null,
  368. 'seatNumber': null,
  369. 'registerNo': null,
  370. 'characterType': null,
  371. 'usedNo': null,
  372. 'supplier': null,
  373. 'repairUserSecond': null,
  374. 'batchNo': null,
  375. 'workYear': null,
  376. 'retirementDate': null,
  377. 'registerDate': null
  378. },
  379. numCheckStandard: 0,
  380. numCheckjob: 0,
  381. numRepairReason: 0,
  382. numModelbom: 0,
  383. numPartInfo: 0,
  384. numChildSbInfo: 0,
  385. firmProducerLevelMap: {},
  386. firmSupplier: {},
  387. firmProducer: {},
  388. statusMap: {},
  389. useTypeMap: {},
  390. levelMap: {},
  391. unitMap: {},
  392. colorMap: {},
  393. rlTypeMap: {},
  394. sourceTypeMap: {}
  395. }
  396. },
  397. created () {
  398. this.depreciationTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_DEPRECIATIONTYPE)
  399. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBINFO_LEVEL)
  400. this.firmProducerLevelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.FIRM_PRODUCER_LEVEL)
  401. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_INFO_STATUS)
  402. this.unitMap = this.DictCache.getRepairCheckFormLabelByValueMapByType(this.DictCache.TYPE.SBINFO_UNIT)
  403. this.colorMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_COLOR)
  404. this.rlTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.RANLIAO_TYPE)
  405. this.sourceTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SBTYPE_SOURCETYPE)
  406. this.useTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_USE_TYPE)
  407. this.isChildMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_CHILD)
  408. this.isShowMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.SB_IS_SHOW)
  409. },
  410. computed: {
  411. },
  412. methods: {
  413. inited (viewer) {
  414. this.$viewer = viewer
  415. },
  416. handleViewBom (record) {
  417. const routeUrl = this.$router.resolve({ path: '/sb/modelbom', query: { id: this.model.id } })
  418. window.open(routeUrl.href, '_blank')
  419. },
  420. handleViewChildSbInfo () {
  421. // this.visible = false
  422. // const modal = this.$refs.detailSbInfoModal
  423. console.log(this.model)
  424. // modal.base(this.model)
  425. const routeUrl = this.$router.resolve({ path: '/sb/info/company', query: { parentId: this.model.id, parentName: this.model.name } })
  426. // let routeUrl = this.$router.resolve(`/share/${96}`)
  427. window.open(routeUrl.href, '_blank')
  428. },
  429. handleViewCheck (record) {
  430. const routeUrl = this.$router.resolve({ path: '/check/polling-standard', query: { id: this.model.id } })
  431. // let routeUrl = this.$router.resolve(`/share/${96}`)
  432. window.open(routeUrl.href, '_blank')
  433. },
  434. handleViewCheckJob (record) {
  435. const routeUrl = this.$router.resolve({ path: '/check/polling-job', query: { id: this.model.id } })
  436. window.open(routeUrl.href, '_blank')
  437. },
  438. // 根据keyNum路由相关页面
  439. handleRouter (keyNum) {
  440. const id = this.model.id
  441. var routeUrl = ''
  442. if (keyNum === 1) {
  443. routeUrl = this.$router.resolve({ path: '/spare/used/record', query: { id: id } })
  444. }
  445. if (keyNum === 2) {
  446. routeUrl = this.$router.resolve({ path: '/check/polling-job/finish', query: { id: id } })
  447. }
  448. if (keyNum === 3) {
  449. routeUrl = this.$router.resolve({ path: '/repair/form', query: { id: id } })
  450. }
  451. if (keyNum === 4) {
  452. routeUrl = this.$router.resolve({ path: '/repair/form', query: { id: id } })
  453. }
  454. if (keyNum === 5) {
  455. routeUrl = this.$router.resolve({ path: '/status/log', query: { id: id } })
  456. }
  457. if (keyNum === 6) {
  458. routeUrl = this.$router.resolve({ path: '/stop/log', query: { id: id } })
  459. }
  460. window.open(routeUrl.href, '_blank')
  461. },
  462. handleMeasure (record) {
  463. this.visible = false
  464. const modal = this.$refs.detailSbMeasureModal
  465. modal.base(this.model)
  466. },
  467. handleRepairReportSbInfo () {
  468. this.visible = false
  469. const modal = this.$refs.repairReportSbInfo
  470. modal.base()
  471. },
  472. handleRepairReportSbInfoFee () {
  473. this.visible = false
  474. const modal = this.$refs.repairReportSbInfoFee
  475. modal.base()
  476. },
  477. base (record) {
  478. this.visible = true
  479. this.visibleDetail = true
  480. this.modalTitle = '详情'
  481. this.model = record
  482. this.activeKey = '1'
  483. this.collapseActiveKey = '0'
  484. this.paramList = JSON.parse(record.paramList)
  485. this.fetchNum()
  486. fetchFirmProducer({ id: this.model.producerId }).then(res => {
  487. this.firmProducer = res.data
  488. })
  489. },
  490. fetchNum () {
  491. Promise.all([
  492. queryNumPartInfo({ sbId: this.model.id }),
  493. queryNumModelbom({ sbId: this.model.id }),
  494. queryNumCheckStandard({ sbId: this.model.id }),
  495. queryNumCheckjob({ sbId: this.model.id }),
  496. queryNumRepairReason({ sbId: this.model.id })
  497. ])
  498. .then((values) => {
  499. this.numPartInfo = values[0].data
  500. this.numModelbom = values[1].data
  501. this.numCheckStandard = values[2].data
  502. this.numCheckjob = values[3].data
  503. this.numRepairReason = values[4].data
  504. })
  505. // 如果是父设备,则要获取子设备的数量,并点击后可以看到子设备的情况
  506. queryChildNumSbInfo({ parentId: this.model.id }).then(res => {
  507. this.numChildSbInfo = res.data
  508. })
  509. },
  510. changeTab (activeKey) {
  511. this.activeKey = activeKey
  512. if (this.activeKey === '2' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
  513. this.$refs.sparePartUsedSelectTable.handleOk()
  514. return
  515. }
  516. if (this.activeKey === '3' && this.BaseTool.Object.isNotBlank(this.$refs.spotJobTable)) {
  517. this.$refs.spotJobTable.handleOk()
  518. return
  519. }
  520. if (this.activeKey === '4' && this.BaseTool.Object.isNotBlank(this.$refs.repairApplicationFormTable)) {
  521. this.$refs.repairApplicationFormTable.handleOk()
  522. }
  523. if (this.activeKey === '5' && this.BaseTool.Object.isNotBlank(this.$refs.repairFeeTable)) {
  524. this.$refs.repairFeeTable.handleOk()
  525. }
  526. if (this.activeKey === '6' && this.BaseTool.Object.isNotBlank(this.$refs.sbStatusLogTable)) {
  527. this.$refs.sbStatusLogTable.handleOk()
  528. }
  529. if (this.activeKey === '7' && this.BaseTool.Object.isNotBlank(this.$refs.sbStopLogTable)) {
  530. this.$refs.sbStopLogTable.handleOk()
  531. }
  532. },
  533. getQrcodeSrc: (dom) => {
  534. console.log(11, 22)
  535. },
  536. handleCancel (values) {
  537. this.visible = false
  538. this.visibleDetail = false
  539. this.confirmLoading = false
  540. this.$emit('ok', values)
  541. },
  542. handleOk () {
  543. this.confirmLoading = true
  544. this.visible = true
  545. fetchSbInfo({ id: this.model.id }).then(res => {
  546. this.confirmLoading = false
  547. this.base(res.data)
  548. })
  549. },
  550. handleEdit () {
  551. fetchSbInfo({ id: this.model.id }).then(res => {
  552. this.visible = false
  553. const modal = this.$refs.baseModal
  554. modal.base(res.data)
  555. })
  556. },
  557. partInfoListView () {
  558. // const modal = this.$refs.partInfoList
  559. // modal.base({ sbId: this.model.id }, { sbId: this.model.id })
  560. const routeUrl = this.$router.resolve({ path: '/part/info', query: { id: this.model.id } })
  561. window.open(routeUrl.href, '_blank')
  562. },
  563. checkJobTableWaitDoListView () {
  564. const modal = this.$refs.checkJobTableWaitDo
  565. modal.base({ sbId: this.model.id }, { sbId: this.model.id, status: 1 })
  566. },
  567. handleTuiCalendar (level) {
  568. const that = this
  569. queryTuiCalendarIgnores({ sbId: this.model.id, type: 2 }).then(res => {
  570. const a = document.createElement('a')
  571. a.target = '_blank'
  572. a.href = '/tui-calendar/checkJobCalendar.html?'
  573. localStorage.setItem('calendarList', JSON.stringify(res.data.calendarList))
  574. var scheduleList = res.data.scheduleList
  575. scheduleList.forEach((item) => {
  576. item.start = that.BaseTool.Moment(item.start, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  577. item.end = that.BaseTool.Moment(item.end, this.BaseTool.Date.PICKER_NORM_DATE_PATTERN)
  578. })
  579. localStorage.setItem('scheduleList', JSON.stringify(scheduleList))
  580. a.click()
  581. })
  582. }
  583. }
  584. }
  585. </script>
  586. <style scoped>
  587. .ant-layout-sider {
  588. background: #fff !important;
  589. padding: 20px 16px !important;
  590. }
  591. .ant-card-body{
  592. padding: 0 !important;
  593. }
  594. </style>