DetailExamine.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  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.EXAMINING === 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.EXAMINING === 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') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)">-->
  83. <!-- <a-button type="primary" @click="handleRepairProjectSelect">-->
  84. <!-- <a-icon type="plus"/>-->
  85. <!-- 添加-->
  86. <!-- </a-button>-->
  87. <!-- </div>-->
  88. <!-- <a-table-->
  89. <!-- :data-source="data"-->
  90. <!-- :columns="columns"-->
  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') && ( DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)">-->
  96. <!-- <a-button type="primary" @click="handleSpareSelect">-->
  97. <!-- <a-icon type="plus"/>-->
  98. <!-- 添加-->
  99. <!-- </a-button>-->
  100. <!-- </div>-->
  101. <a-table
  102. :data-source="dataSpare"
  103. :columns="columnsSpare"
  104. tableLayout="auto"
  105. rowKey="id">
  106. </a-table>
  107. <title-divider title="费用清单" width="90px"></title-divider>
  108. <!-- <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)">-->
  109. <!-- <a-button type="primary" @click="handleAddFee">-->
  110. <!-- <a-icon type="plus"/>-->
  111. <!-- 添加-->
  112. <!-- </a-button>-->
  113. <!-- </div>-->
  114. <a-table
  115. :data-source="dataFee"
  116. :columns="columnsFee"
  117. tableLayout="auto"
  118. rowKey="id">
  119. <!-- <span slot="action" slot-scope="record">-->
  120. <!-- <template>-->
  121. <!-- <a @click="handleViewFee(record)">查看</a>-->
  122. <!-- <operation-button-->
  123. <!-- 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)"-->
  124. <!-- @click="handleEditFee(record)" >修改</operation-button>-->
  125. <!-- <operation-button-->
  126. <!-- 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)"-->
  127. <!-- :type="2"-->
  128. <!-- title="确认删除该笔费用?"-->
  129. <!-- @confirm="batchDeleteFee(record.id)" >删除</operation-button>-->
  130. <!-- </template>-->
  131. <!-- </span>-->
  132. </a-table>
  133. <!--<q-tabs :activeKey="activeKey" @change="changeTab">
  134. <q-tab-pane key="a" tab="配件更换">
  135. <spare-part-used-select-table :type="1" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
  136. </q-tab-pane>
  137. <q-tab-pane key="b" tab="备件领用">
  138. <spare-pick-form-select-table :type="1" :table-params="{repairId: model.id, repairNo: model.no}" ref="sparePickFormSelectTable"/>
  139. </q-tab-pane>
  140. </q-tabs>-->
  141. <title-divider title="原因分析" width="90px"></title-divider>
  142. <!-- <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)">-->
  143. <!-- <a-button type="primary" @click="handleAddReason">-->
  144. <!-- <a-icon type="plus"/>-->
  145. <!-- 添加-->
  146. <!-- </a-button>-->
  147. <!-- </div>-->
  148. <a-table
  149. :data-source="dataReason"
  150. :columns="columnsReason"
  151. tableLayout="fixed"
  152. rowKey="id">
  153. <span slot="action" slot-scope="record">
  154. <template>
  155. <a @click="handleViewReason(record)">查看</a>
  156. <!-- <operation-button-->
  157. <!-- 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)"-->
  158. <!-- @click="handleEditReason(record)" >修改</operation-button>-->
  159. <!-- <operation-button-->
  160. <!-- 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)"-->
  161. <!-- :type="2"-->
  162. <!-- title="确认删除该记录?"-->
  163. <!-- @confirm="batchDeleteReason(record.id)" >删除</operation-button>-->
  164. </template>
  165. </span>
  166. </a-table>
  167. </a-card>
  168. <examine-form ref="examineForm" @ok="handleOk" />
  169. <fee-base-form ref="feeForm" @ok="handleOk" />
  170. <reason-base-form ref="reasonForm" @ok="handleOk" />
  171. <finish-form ref="finishForm" @ok="handleOk" />
  172. <dispatch-form ref="dispatchForm" @ok="handleCancel" />
  173. <fee-detail ref="feeDetail" @ok="handleOk" />
  174. <reason-detail ref="reasonDetail" @ok="handleOk" />
  175. </div>
  176. </template>
  177. <script>
  178. import DetailList from '@/components/tools/DetailList'
  179. import { fetchRepairApplicationForm, examineOk } from '@/api/repair/application-form'
  180. import ExamineForm from './ExamineForm'
  181. import FinishForm from './FinishForm'
  182. import DispatchForm from './DispatchForm'
  183. import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
  184. import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
  185. import { selectSparePartUsedListByRepairId } from '@/api/sqarepartmanage/sparepartused'
  186. import { selectRepairProjectListByRepairId } from '@/api/repair/repairprojectrelation'
  187. import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
  188. import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
  189. import FeeDetail from '@/views/repair/fee/modules/Detail'
  190. import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
  191. import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/fee'
  192. import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
  193. const DetailListItem = DetailList.Item
  194. export default {
  195. name: 'RepairApplicationFormDetail',
  196. components: {
  197. ExamineForm,
  198. DetailList,
  199. DetailListItem,
  200. FinishForm,
  201. FeeDetail,
  202. ReasonDetail,
  203. FeeBaseForm,
  204. ReasonBaseForm,
  205. DispatchForm,
  206. SparePartUsedSelectTable,
  207. SparePickFormSelectTable
  208. },
  209. data () {
  210. return {
  211. confirmLoading: false,
  212. mdl: {},
  213. modalTitle: null,
  214. needStopMap: {},
  215. dispatchList: [],
  216. activeKey: 'a',
  217. visible: false,
  218. loading: false,
  219. // 下拉框map
  220. sourceMap: {},
  221. levelMap: {},
  222. descripitionMap: {},
  223. statusMap: {},
  224. typeMap: {},
  225. repairProjectMap: {},
  226. repairTechnologyMap: {},
  227. data: [],
  228. dataSpare: [],
  229. dataFee: [],
  230. dataReason: [],
  231. // 表头
  232. columns: [
  233. {
  234. title: '序号',
  235. dataIndex: 'index',
  236. customRender: (text, record, index) => {
  237. return `${index + 1}`
  238. }
  239. },
  240. {
  241. title: '编码',
  242. dataIndex: 'no'
  243. },
  244. {
  245. title: '名称',
  246. dataIndex: 'name'
  247. },
  248. {
  249. title: '维修类别',
  250. dataIndex: 'type',
  251. customRender: (text, record, index) => {
  252. return this.BaseTool.Object.getField(this.repairProjectMap, text)
  253. }
  254. },
  255. {
  256. title: '维修工艺',
  257. dataIndex: 'technology',
  258. customRender: (text, record, index) => {
  259. return this.BaseTool.Object.getField(this.repairTechnologyMap, text)
  260. }
  261. },
  262. {
  263. title: '标准工时',
  264. dataIndex: 'standardHours'
  265. },
  266. {
  267. title: '标准费用',
  268. dataIndex: 'standardMoney'
  269. },
  270. {
  271. title: '考核工时',
  272. dataIndex: 'checkHours'
  273. }
  274. ],
  275. columnsSpare: [
  276. {
  277. title: '序号',
  278. dataIndex: 'index',
  279. customRender: (text, record, index) => {
  280. return `${index + 1}`
  281. }
  282. },
  283. {
  284. title: '备件名称',
  285. dataIndex: 'spareId',
  286. customRender: (text, record, index) => {
  287. return record.spareName
  288. }
  289. },
  290. {
  291. title: '数量',
  292. dataIndex: 'num'
  293. },
  294. {
  295. title: '价格',
  296. dataIndex: 'price'
  297. },
  298. {
  299. title: '总价',
  300. dataIndex: 'totalPrice'
  301. }
  302. ],
  303. columnsFee: [
  304. {
  305. title: '序号',
  306. dataIndex: 'index',
  307. customRender: (text, record, index) => {
  308. return `${index + 1}`
  309. }
  310. },
  311. {
  312. title: '费用金额',
  313. dataIndex: 'fee',
  314. customRender: (text, record, index) => {
  315. return this.BaseTool.Amount.formatter(text)
  316. }
  317. },
  318. {
  319. title: '费用类别',
  320. dataIndex: 'type',
  321. customRender: (text, record, index) => {
  322. return this.BaseTool.Object.getField(this.typeMap, text)
  323. }
  324. },
  325. {
  326. title: '费用原因',
  327. dataIndex: 'reason'
  328. },
  329. {
  330. title: '费用描述',
  331. dataIndex: 'descripition'
  332. },
  333. {
  334. title: '备注',
  335. dataIndex: 'remark'
  336. }
  337. ],
  338. columnsReason: [
  339. {
  340. title: '序号',
  341. dataIndex: 'index',
  342. width: '70',
  343. customRender: (text, record, index) => {
  344. return `${index + 1}`
  345. }
  346. },
  347. {
  348. title: '分析时间',
  349. dataIndex: 'analyzeTime',
  350. width: '200px'
  351. },
  352. {
  353. title: '问题描述',
  354. dataIndex: 'problemDesc',
  355. ellipsis: true,
  356. width: '200px'
  357. },
  358. {
  359. title: '原因分析',
  360. dataIndex: 'reasonAnalysis',
  361. ellipsis: true,
  362. width: '200px'
  363. },
  364. {
  365. title: '改进措施',
  366. dataIndex: 'improveMeasure',
  367. ellipsis: true,
  368. width: '200px'
  369. },
  370. {
  371. title: '操作',
  372. key: 'action',
  373. width: '200px',
  374. align: 'center',
  375. scopedSlots: { customRender: 'action' }
  376. }
  377. ],
  378. model: {
  379. 'id': null,
  380. 'sbId': null,
  381. 'partId': null,
  382. 'repairUserId': null,
  383. 'needStop': null,
  384. 'no': null,
  385. 'source': null,
  386. 'applyTime': null,
  387. 'level': null,
  388. 'content': null,
  389. 'status': null,
  390. 'remark': null,
  391. 'updateTime': null,
  392. 'createdUserId': null,
  393. 'updateUserId': null,
  394. 'createdUserName': null,
  395. 'sbName': null,
  396. 'partName': null,
  397. 'updateUserName': null,
  398. 'repairFormVO': null,
  399. 'repairCheckVO': null
  400. }
  401. }
  402. },
  403. created () {
  404. // 下拉框map
  405. this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
  406. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
  407. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
  408. this.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
  409. this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
  410. this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  411. this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
  412. this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
  413. this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_QUESTION)
  414. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
  415. },
  416. methods: {
  417. base (record) {
  418. this.visible = true
  419. this.modalTitle = '详情'
  420. this.model = record
  421. this.dispatchList = JSON.parse(record.repairDispatchList)
  422. this.init()
  423. },
  424. init () {
  425. selectRepairProjectListByRepairId({ id: this.model.id }).then(res => {
  426. this.data = res.data
  427. })
  428. selectSparePartUsedListByRepairId({ id: this.model.id }).then(res => {
  429. this.dataSpare = res.data
  430. })
  431. queryRepairFee({ repairId: this.model.id }).then(res => {
  432. this.dataFee = res.data
  433. })
  434. queryRepairReason({ repairId: this.model.id }).then(res => {
  435. this.dataReason = res.data
  436. })
  437. },
  438. handleCancel () {
  439. this.visible = false
  440. this.confirmLoading = false
  441. this.$emit('ok')
  442. },
  443. receive () {
  444. receive(this.model).then(() => {
  445. this.$message.info('任务接收成功,请及时维修')
  446. this.handleOk()
  447. })
  448. },
  449. batchDeleteFee (id) {
  450. let ids = []
  451. if (this.BaseTool.String.isBlank(id)) {
  452. const length = this.selectedRows.length
  453. if (length === 0) {
  454. this.$message.info('请选择要删除的记录')
  455. return
  456. }
  457. ids = this.selectedRows.map(item => item.id)
  458. } else {
  459. ids = [id]
  460. }
  461. deleteRepairFees(ids).then(res => {
  462. this.$message.info('删除成功')
  463. this.handleOk()
  464. this.$refs.table.clearSelected()
  465. })
  466. },
  467. handleAddFee () {
  468. const modal = this.$refs.feeForm
  469. modal.base(null, this.model)
  470. },
  471. handleEditFee (record) {
  472. fetchRepairFee({ id: record.id }).then(res => {
  473. const modal = this.$refs.feeForm
  474. modal.base(res.data, this.model)
  475. })
  476. },
  477. handleViewFee (record) {
  478. fetchRepairFee({ id: record.id }).then(res => {
  479. const modal = this.$refs.feeDetail
  480. modal.base(res.data)
  481. })
  482. },
  483. batchDeleteReason (id) {
  484. let ids = []
  485. if (this.BaseTool.String.isBlank(id)) {
  486. const length = this.selectedRows.length
  487. if (length === 0) {
  488. this.$message.info('请选择要删除的记录')
  489. return
  490. }
  491. ids = this.selectedRows.map(item => item.id)
  492. } else {
  493. ids = [id]
  494. }
  495. deleteRepairReasons(ids).then(res => {
  496. this.$message.info('删除成功')
  497. this.handleOk()
  498. this.$refs.table.clearSelected()
  499. })
  500. },
  501. handleAddReason () {
  502. const modal = this.$refs.reasonForm
  503. this.visible = false
  504. modal.base(null, this.model)
  505. },
  506. handleEditReason (record) {
  507. fetchRepairReason({ id: record.id }).then(res => {
  508. const modal = this.$refs.reasonForm
  509. this.visible = false
  510. modal.base(res.data, this.model)
  511. })
  512. },
  513. handleViewReason (record) {
  514. fetchRepairReason({ id: record.id }).then(res => {
  515. const modal = this.$refs.reasonDetail
  516. modal.base(res.data)
  517. })
  518. },
  519. handleApprove () {
  520. examineOk(1, this.model).then(() => {
  521. this.$message.info('审批成功,维修单已关闭')
  522. this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINED
  523. this.handleOk()
  524. })
  525. },
  526. handleReturn () {
  527. const modal = this.$refs.examineForm
  528. modal.base(this.model)
  529. },
  530. handleOk () {
  531. this.loading = true
  532. fetchRepairApplicationForm({ id: this.model.id }).then(res => {
  533. this.loading = false
  534. this.model = res.data
  535. this.visible = true
  536. this.dispatchList = JSON.parse(this.model.repairDispatchList)
  537. this.init()
  538. })
  539. },
  540. handleFinish () {
  541. const modal = this.$refs.finishForm
  542. modal.base(this.model)
  543. },
  544. handleSpareSelect () {
  545. this.$refs.spareSelectModal.base()
  546. },
  547. handleDispatch () {
  548. const modal = this.$refs.dispatchForm
  549. modal.base(this.model)
  550. },
  551. changeTab (activeKey) {
  552. this.activeKey = activeKey
  553. if (this.activeKey === 'a' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
  554. const modal = this.$refs.sparePartUsedSelectTable
  555. modal.handleOk()
  556. return
  557. }
  558. if (this.activeKey === 'b' && this.BaseTool.Object.isNotBlank(this.$refs.sparePickFormSelectTable)) {
  559. const modal = this.$refs.sparePickFormSelectTable
  560. modal.handleOk()
  561. }
  562. }
  563. }
  564. }
  565. </script>