Detail.vue 30 KB

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