DetailRepairOut.vue 20 KB

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