DetailCheck.vue 24 KB

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