DetailCheck.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <template>
  2. <div>
  3. <a-card :bordered="false" :loading="loading" v-show="visible" class="card" :title="modalTitle">
  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-button v-if="$auth('repair-application-forms-approve') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" style="margin-left: 8px" type="primary" @click="handleApprove()">接受</a-button>
  8. <a-button v-if="$auth('repair-application-forms-reback') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" style="margin-left: 8px" type="danger" @click="handleReturn()">拒绝</a-button>
  9. <a-button style="margin-left: 8px" @click="handleCancel">返回</a-button>
  10. </span>
  11. </a-col>
  12. </a-row>
  13. <a-layout>
  14. <a-layout-content style="background-color: rgb(255, 255, 255)">
  15. <a-divider orientation="left">报修详情</a-divider>
  16. <detail-list title="" :col="3">
  17. <detail-list-item term="报修单号">{{ model.no }}</detail-list-item>
  18. <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
  19. <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
  20. <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
  21. <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
  22. <!--<detail-list-item term="部件名称">{{ model.partName }}</detail-list-item>-->
  23. <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>
  24. <detail-list-item term="报修人">{{ model.actualUser }}</detail-list-item>
  25. <detail-list-item term="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source) }}</detail-list-item>
  26. <detail-list-item term="紧急等级"><badge :text="BaseTool.Object.getField(levelMap,model.level)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[model.applicationLevel]"/></detail-list-item>
  27. <detail-list-item term="报修时间">{{ model.applyTime }}</detail-list-item>
  28. <detail-list-item term="报修状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]"/></detail-list-item>
  29. </detail-list>
  30. <detail-list title="" :col="1">
  31. <!--<detail-list-item term="故障描述">{{ BaseTool.Object.getField(this.descripitionMap, model.content) }}</detail-list-item>-->
  32. <detail-list-item term="故障描述">{{ model.content }}</detail-list-item>
  33. </detail-list>
  34. <detail-list title="报修图片:" :col="6">
  35. <upload-image-detail :images-list="model.applicationFileList"/>
  36. </detail-list>
  37. <a-divider orientation="left">维修详情</a-divider>
  38. <detail-list title="" :col="3">
  39. <detail-list-item term="故障类别">{{ model.repairErrorTypeName }}</detail-list-item>
  40. <detail-list-item term="维修开始时间">{{ model.repairStartTime }}</detail-list-item>
  41. <detail-list-item term="维修结束时间">{{ model.repairEndTime }}</detail-list-item>
  42. <detail-list-item term="维修耗时">{{ model.repairMinutes }}</detail-list-item>
  43. <detail-list-item term="维修人员">{{ model.repairUserName }}</detail-list-item>
  44. <!--<detail-list-item term="维修次数">{{ model.repairTimes }}</detail-list-item>-->
  45. </detail-list>
  46. <detail-list title="" :col="1">
  47. <detail-list-item term="维修描述">{{ model.repairContent }}</detail-list-item>
  48. </detail-list>
  49. <detail-list title="维修图片:" :col="6">
  50. <upload-image-detail :images-list="model.repairFileList"/>
  51. </detail-list>
  52. <a-divider v-if="dispatchList != null" orientation="left">转派详情</a-divider>
  53. <detail-list v-for="item in dispatchList" title="" :col="3">
  54. <detail-list-item term="转派人">{{ item.username }}</detail-list-item>
  55. <detail-list-item term="转派时间">{{ item.time }}</detail-list-item>
  56. <detail-list-item term="转派备注">{{ item.remark }}</detail-list-item>
  57. </detail-list>
  58. <a-divider orientation="left">审核详情</a-divider>
  59. <detail-list title="" :col="3">
  60. <detail-list-item term="审核开始时间">{{ model.checkStartTime }}</detail-list-item>
  61. <detail-list-item term="审核结束时间">{{ model.checkEndTime }}</detail-list-item>
  62. <detail-list-item term="审核人员">{{ model.checkUserName }}</detail-list-item>
  63. <detail-list-item term="审核描述">{{ model.checkContent }}</detail-list-item>
  64. </detail-list>
  65. <detail-list title="审核图片:" :col="6">
  66. <upload-image-detail :images-list="model.checkFileList"/>
  67. </detail-list>
  68. </a-layout-content>
  69. <a-layout-sider style="background-color: rgb(255, 255, 255)">
  70. <div style="margin-top: 30px;margin-left: 30px;">
  71. <a-steps progress-dot :current="6" direction="vertical" >
  72. <a-step title="报修时间:" :description="''+model.applyTime?model.applyTime:''" />
  73. <a-step title="维修开始时间:" :description="''+model.repairStartTime?model.repairStartTime:''" />
  74. <a-step title="维修结束时间:" :description="''+model.repairEndTime?model.repairEndTime:''" />
  75. <a-step title="审核开始时间:" :description="''+model.checkStartTime?model.checkStartTime:''" />
  76. <a-step title="审核结束时间:" :description="''+model.checkEndTime?model.checkEndTime:''" />
  77. </a-steps>
  78. </div>
  79. </a-layout-sider>
  80. </a-layout>
  81. <title-divider title="配件清单" width="90px"></title-divider>
  82. <div class="table-operator" v-if="$auth('repair-application-forms-finish')">
  83. <a-button type="primary" @click="handleSpareSelect">
  84. <a-icon type="plus"/>
  85. 添加
  86. </a-button>
  87. </div>
  88. <a-table
  89. :data-source="dataSpare"
  90. :columns="columnsSpare"
  91. tableLayout="auto"
  92. rowKey="id">
  93. </a-table>
  94. <title-divider title="费用清单" width="90px"></title-divider>
  95. <div class="table-operator" v-if="$auth('repair-application-forms-finish') ">
  96. <a-button type="primary" @click="handleAddFee">
  97. <a-icon type="plus"/>
  98. 添加
  99. </a-button>
  100. </div>
  101. <a-table
  102. :data-source="dataFee"
  103. :columns="columnsFee"
  104. tableLayout="auto"
  105. rowKey="id">
  106. <span slot="action" slot-scope="record">
  107. <template>
  108. <a @click="handleViewFee(record)">查看</a>
  109. <operation-button
  110. v-if="$auth('repair-application-forms-finish')"
  111. @click="handleEditFee(record)" >修改</operation-button>
  112. <operation-button
  113. v-if="$auth('repair-application-forms-finish')"
  114. :type="2"
  115. title="确认删除该笔费用?"
  116. @confirm="batchDeleteFee(record.id)" >删除</operation-button>
  117. </template>
  118. </span>
  119. </a-table>
  120. <title-divider title="原因分析" width="90px"></title-divider>
  121. <div class="table-operator" >
  122. <a-button type="primary" @click="handleAddReason">
  123. <a-icon type="plus"/>
  124. </a-button>-
  125. </div>
  126. <a-table
  127. :data-source="dataReason"
  128. :columns="columnsReason"
  129. tableLayout="fixed"
  130. rowKey="id">
  131. <span slot="action" slot-scope="record">
  132. <template>
  133. <a @click="handleViewReason(record)">查看</a>
  134. <operation-button
  135. v-if="$auth('repair-application-forms-finish')"
  136. @click="handleEditReason(record)" >修改</operation-button>
  137. <operation-button
  138. v-if="$auth('repair-application-forms-finish')"
  139. :type="2"
  140. title="确认删除该记录?"
  141. @confirm="batchDeleteReason(record.id)" >删除</operation-button>
  142. </template>
  143. </span>
  144. </a-table>
  145. </a-card>
  146. <check-form ref="checkForm" @ok="handleOk" />
  147. <fee-base-form ref="feeForm" @ok="handleOk" />
  148. <reason-base-form ref="reasonForm" @ok="handleOk" />
  149. <finish-form ref="finishForm" @ok="handleOk" />
  150. <dispatch-form ref="dispatchForm" @ok="handleCancel" />
  151. <fee-detail ref="feeDetail" @ok="handleOk" />
  152. <reason-detail ref="reasonDetail" @ok="handleOk" />
  153. </div>
  154. </template>
  155. <script>
  156. import DetailList from '@/components/tools/DetailList'
  157. import { fetchRepairApplicationForm, approve, receive } from '@/api/repair/application-form'
  158. import CheckForm from './CheckForm'
  159. import FinishForm from './FinishForm'
  160. import DispatchForm from './DispatchForm'
  161. import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
  162. import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
  163. import { selectSparePartUsedListByRepairId } from '@/api/sqarepartmanage/sparepartused'
  164. import { selectRepairProjectListByRepairId } from '@/api/repair/repairprojectrelation'
  165. import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
  166. import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
  167. import FeeDetail from '@/views/repair/fee/modules/Detail'
  168. import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
  169. import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/fee'
  170. import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
  171. const DetailListItem = DetailList.Item
  172. export default {
  173. name: 'RepairApplicationFormDetail',
  174. components: {
  175. CheckForm,
  176. DetailList,
  177. DetailListItem,
  178. FinishForm,
  179. FeeDetail,
  180. ReasonDetail,
  181. FeeBaseForm,
  182. ReasonBaseForm,
  183. DispatchForm,
  184. SparePartUsedSelectTable,
  185. SparePickFormSelectTable
  186. },
  187. data () {
  188. return {
  189. confirmLoading: false,
  190. mdl: {},
  191. modalTitle: null,
  192. needStopMap: {},
  193. dispatchList: [],
  194. activeKey: 'a',
  195. visible: false,
  196. loading: false,
  197. // 下拉框map
  198. sourceMap: {},
  199. levelMap: {},
  200. descripitionMap: {},
  201. statusMap: {},
  202. typeMap: {},
  203. repairProjectMap: {},
  204. repairTechnologyMap: {},
  205. data: [],
  206. dataSpare: [],
  207. dataFee: [],
  208. dataReason: [],
  209. // 表头
  210. columns: [
  211. {
  212. title: '序号',
  213. dataIndex: 'index',
  214. customRender: (text, record, index) => {
  215. return `${index + 1}`
  216. }
  217. },
  218. {
  219. title: '编码',
  220. dataIndex: 'no'
  221. },
  222. {
  223. title: '名称',
  224. dataIndex: 'name'
  225. },
  226. {
  227. title: '维修类别',
  228. dataIndex: 'type',
  229. customRender: (text, record, index) => {
  230. return this.BaseTool.Object.getField(this.repairProjectMap, text)
  231. }
  232. },
  233. {
  234. title: '维修工艺',
  235. dataIndex: 'technology',
  236. customRender: (text, record, index) => {
  237. return this.BaseTool.Object.getField(this.repairTechnologyMap, text)
  238. }
  239. },
  240. {
  241. title: '标准工时',
  242. dataIndex: 'standardHours'
  243. },
  244. {
  245. title: '标准费用',
  246. dataIndex: 'standardMoney'
  247. },
  248. {
  249. title: '考核工时',
  250. dataIndex: 'checkHours'
  251. }
  252. ],
  253. columnsSpare: [
  254. {
  255. title: '序号',
  256. dataIndex: 'index',
  257. customRender: (text, record, index) => {
  258. return `${index + 1}`
  259. }
  260. },
  261. {
  262. title: '备件名称',
  263. dataIndex: 'spareId',
  264. customRender: (text, record, index) => {
  265. return record.spareName
  266. }
  267. },
  268. {
  269. title: '数量',
  270. dataIndex: 'num'
  271. },
  272. {
  273. title: '价格',
  274. dataIndex: 'price'
  275. },
  276. {
  277. title: '总价',
  278. dataIndex: 'totalPrice'
  279. }
  280. ],
  281. columnsFee: [
  282. {
  283. title: '序号',
  284. dataIndex: 'index',
  285. customRender: (text, record, index) => {
  286. return `${index + 1}`
  287. }
  288. },
  289. {
  290. title: '费用金额',
  291. dataIndex: 'fee',
  292. customRender: (text, record, index) => {
  293. return this.BaseTool.Amount.formatter(text)
  294. }
  295. },
  296. {
  297. title: '费用类别',
  298. dataIndex: 'type',
  299. customRender: (text, record, index) => {
  300. return this.BaseTool.Object.getField(this.typeMap, text)
  301. }
  302. },
  303. {
  304. title: '费用原因',
  305. dataIndex: 'reason'
  306. },
  307. {
  308. title: '费用描述',
  309. dataIndex: 'descripition'
  310. },
  311. {
  312. title: '备注',
  313. dataIndex: 'remark'
  314. }
  315. ],
  316. columnsReason: [
  317. {
  318. title: '序号',
  319. dataIndex: 'index',
  320. width: '70',
  321. customRender: (text, record, index) => {
  322. return `${index + 1}`
  323. }
  324. },
  325. {
  326. title: '分析时间',
  327. dataIndex: 'analyzeTime',
  328. width: '200px'
  329. },
  330. {
  331. title: '问题描述',
  332. dataIndex: 'problemDesc',
  333. ellipsis: true,
  334. width: '200px'
  335. },
  336. {
  337. title: '原因分析',
  338. dataIndex: 'reasonAnalysis',
  339. ellipsis: true,
  340. width: '200px'
  341. },
  342. {
  343. title: '改进措施',
  344. dataIndex: 'improveMeasure',
  345. ellipsis: true,
  346. width: '200px'
  347. },
  348. {
  349. title: '操作',
  350. key: 'action',
  351. width: '200px',
  352. align: 'center',
  353. scopedSlots: { customRender: 'action' }
  354. }
  355. ],
  356. model: {
  357. 'id': null,
  358. 'sbId': null,
  359. 'partId': null,
  360. 'repairUserId': null,
  361. 'needStop': null,
  362. 'no': null,
  363. 'source': null,
  364. 'applyTime': null,
  365. 'level': null,
  366. 'content': null,
  367. 'status': null,
  368. 'remark': null,
  369. 'updateTime': null,
  370. 'createdUserId': null,
  371. 'updateUserId': null,
  372. 'createdUserName': null,
  373. 'sbName': null,
  374. 'partName': null,
  375. 'updateUserName': null,
  376. 'repairFormVO': null,
  377. 'repairCheckVO': null
  378. }
  379. }
  380. },
  381. created () {
  382. // 下拉框map
  383. this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
  384. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
  385. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
  386. this.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
  387. this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
  388. this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  389. this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
  390. this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
  391. this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
  392. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
  393. },
  394. methods: {
  395. base (record) {
  396. this.visible = true
  397. this.modalTitle = '详情'
  398. this.model = record
  399. this.dispatchList = JSON.parse(record.repairDispatchList)
  400. this.init()
  401. },
  402. init () {
  403. selectRepairProjectListByRepairId({ id: this.model.id }).then(res => {
  404. this.data = res.data
  405. })
  406. selectSparePartUsedListByRepairId({ id: this.model.id }).then(res => {
  407. this.dataSpare = res.data
  408. })
  409. queryRepairFee({ repairId: this.model.id }).then(res => {
  410. this.dataFee = res.data
  411. })
  412. queryRepairReason({ repairId: this.model.id }).then(res => {
  413. this.dataReason = res.data
  414. })
  415. },
  416. handleCancel () {
  417. this.visible = false
  418. this.confirmLoading = false
  419. this.$emit('ok')
  420. },
  421. receive () {
  422. receive(this.model).then(() => {
  423. this.$message.info('任务接收成功,请及时维修')
  424. this.handleOk()
  425. })
  426. },
  427. batchDeleteFee (id) {
  428. let ids = []
  429. if (this.BaseTool.String.isBlank(id)) {
  430. const length = this.selectedRows.length
  431. if (length === 0) {
  432. this.$message.info('请选择要删除的记录')
  433. return
  434. }
  435. ids = this.selectedRows.map(item => item.id)
  436. } else {
  437. ids = [id]
  438. }
  439. deleteRepairFees(ids).then(res => {
  440. this.$message.info('删除成功')
  441. this.handleOk()
  442. this.$refs.table.clearSelected()
  443. })
  444. },
  445. handleAddFee () {
  446. const modal = this.$refs.feeForm
  447. modal.base(null, this.model)
  448. },
  449. handleEditFee (record) {
  450. fetchRepairFee({ id: record.id }).then(res => {
  451. const modal = this.$refs.feeForm
  452. modal.base(res.data, this.model)
  453. })
  454. },
  455. handleViewFee (record) {
  456. fetchRepairFee({ id: record.id }).then(res => {
  457. const modal = this.$refs.feeDetail
  458. modal.base(res.data)
  459. })
  460. },
  461. batchDeleteReason (id) {
  462. let ids = []
  463. if (this.BaseTool.String.isBlank(id)) {
  464. const length = this.selectedRows.length
  465. if (length === 0) {
  466. this.$message.info('请选择要删除的记录')
  467. return
  468. }
  469. ids = this.selectedRows.map(item => item.id)
  470. } else {
  471. ids = [id]
  472. }
  473. deleteRepairReasons(ids).then(res => {
  474. this.$message.info('删除成功')
  475. this.handleOk()
  476. this.$refs.table.clearSelected()
  477. })
  478. },
  479. handleAddReason () {
  480. const modal = this.$refs.reasonForm
  481. this.visible = false
  482. modal.base(null, this.model)
  483. },
  484. handleEditReason (record) {
  485. fetchRepairReason({ id: record.id }).then(res => {
  486. const modal = this.$refs.reasonForm
  487. this.visible = false
  488. modal.base(res.data, this.model)
  489. })
  490. },
  491. handleViewReason (record) {
  492. fetchRepairReason({ id: record.id }).then(res => {
  493. const modal = this.$refs.reasonDetail
  494. modal.base(res.data)
  495. })
  496. },
  497. handleApprove () {
  498. approve(this.model).then(() => {
  499. this.$message.info('操作成功')
  500. this.handleOk()
  501. })
  502. },
  503. handleReturn () {
  504. const modal = this.$refs.checkForm
  505. modal.base(this.model)
  506. },
  507. handleOk () {
  508. this.loading = true
  509. fetchRepairApplicationForm({ id: this.model.id }).then(res => {
  510. this.loading = false
  511. this.model = res.data
  512. this.visible = true
  513. this.dispatchList = JSON.parse(this.model.repairDispatchList)
  514. this.init()
  515. })
  516. },
  517. handleFinish () {
  518. const modal = this.$refs.finishForm
  519. modal.base(this.model)
  520. },
  521. handleSpareSelect () {
  522. this.$refs.spareSelectModal.base()
  523. },
  524. handleDispatch () {
  525. const modal = this.$refs.dispatchForm
  526. modal.base(this.model)
  527. },
  528. changeTab (activeKey) {
  529. this.activeKey = activeKey
  530. if (this.activeKey === 'a' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
  531. const modal = this.$refs.sparePartUsedSelectTable
  532. modal.handleOk()
  533. return
  534. }
  535. if (this.activeKey === 'b' && this.BaseTool.Object.isNotBlank(this.$refs.sparePickFormSelectTable)) {
  536. const modal = this.$refs.sparePickFormSelectTable
  537. modal.handleOk()
  538. }
  539. }
  540. }
  541. }
  542. </script>