DetailRepair.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838
  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-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewBom()">备件BOM</a-button>
  8. <a-button v-if="$auth('repair-application-forms-finish')" style="margin-left: 16px" type="default" @ok="handleOk" @click="handleViewCheck()">维护项目</a-button>
  9. <a-button v-if="$auth('repair-application-forms-assign') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 16px" type="default" @click="handleAssign">派工</a-button>
  10. <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.REBACK === model.status)" title="是否要接收?" @confirm="receive">
  11. <a-button style="margin-left: 8px">接收</a-button>
  12. </a-popconfirm>
  13. <a-button v-if="$auth('repair-application-forms-deal') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status)" style="margin-left: 8px" @click="handleReject">拒单</a-button>
  14. <a-button v-if="$auth('repair-application-forms-out') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING >= model.status) && model.type != 2" style="margin-left: 8px" type="default" @click="handleOut">委外</a-button>
  15. <a-button v-if="$auth('repair-application-forms-dispatch') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status" style="margin-left: 8px" type="default" @click="handleDispatch">转派</a-button>
  16. <a-button v-if="$auth('repair-application-forms-transfer') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleTransfer">转派</a-button>
  17. <a-button v-if="$auth('repair-application-forms-finish') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleFinish()">完成</a-button>
  18. <a-button v-if="$auth('repair-application-forms-edit')" style="margin-left: 8px" type="default" @click="handleEdit()">修改</a-button>
  19. <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status" title="是否要提交审核该条数据?" @confirm="handleExamine">
  20. <a-button style="margin-left: 8px" type="default">提交审核</a-button>
  21. </a-popconfirm>
  22. <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
  23. </span>
  24. </a-col>
  25. </a-row>
  26. <a-layout>
  27. <a-layout-content style="background-color: rgb(255, 255, 255)">
  28. <a-divider orientation="left">报修详情</a-divider>
  29. <detail-list title="" :col="3">
  30. <detail-list-item term="报修单号">{{ model.no }}</detail-list-item>
  31. <detail-list-item term="设备编号">{{ model.sbNo }}</detail-list-item>
  32. <detail-list-item term="设备名称">{{ model.sbName }}</detail-list-item>
  33. <detail-list-item term="预留维修时间">{{ model.limitHours }}</detail-list-item>
  34. <detail-list-item term="使用位置">{{ model.sbCph }}</detail-list-item>
  35. <detail-list-item term="工单类别">{{ BaseTool.Object.getField(planFlagMap,model.category) }}</detail-list-item>
  36. <!-- <detail-list-item term="是否停机">{{ BaseTool.Object.getField(needStopMap,model.needStop) }}</detail-list-item>-->
  37. <detail-list-item term="报修人">{{ model.actualUser }}</detail-list-item>
  38. <!-- <detail-list-item term="报修来源">{{ BaseTool.Object.getField(this.sourceMap, model.source) }}</detail-list-item>
  39. <detail-list-item term="紧急等级"><badge :text="BaseTool.Object.getField(levelMap,model.level)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_LEVEL[model.applicationLevel]"/></detail-list-item>-->
  40. <detail-list-item term="报修时间">{{ model.applyTime }}</detail-list-item>
  41. <detail-list-item term="报修状态">
  42. <badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]" />
  43. </detail-list-item>
  44. <detail-list-item term="要求时间">{{ model.limitHours }}小时</detail-list-item>
  45. <detail-list-item term="要求日期">{{ model.limitDate }}</detail-list-item>
  46. </detail-list>
  47. <detail-list title="" :col="1">
  48. <!--<detail-list-item term="故障描述">{{ BaseTool.Object.getField(this.descripitionMap, model.content) }}</detail-list-item>-->
  49. <detail-list-item term="故障描述">{{ model.content }}</detail-list-item>
  50. </detail-list>
  51. <title-divider title="报修图片" width="90px"></title-divider>
  52. <detail-list title="" :col="1">
  53. <detail-list-item term="" v-if="model.applicationFileList != null && model.applicationFileList.length > 0">
  54. <viewer :images="model.applicationFileList" @inited="inited" ref="viewer" :index="1">
  55. <img v-for="item in model.applicationFileList" :src="item.url" :key="item.id" class="image">
  56. </viewer>
  57. </detail-list-item>
  58. <detail-list-item term="" v-if="model.applicationFileList == null || model.applicationFileList.length === 0">
  59. 暂无
  60. </detail-list-item>
  61. </detail-list>
  62. <a-divider orientation="left">维修详情</a-divider>
  63. <detail-list title="" :col="3">
  64. <!-- <detail-list-item term="故障类别">{{ model.repairErrorTypeName }}</detail-list-item>-->
  65. <detail-list-item term="维修开始时间">{{ model.repairStartTime }}</detail-list-item>
  66. <detail-list-item term="维修结束时间">{{ model.repairEndTime }}</detail-list-item>
  67. <detail-list-item term="维修耗时">{{ model.repairMinutes }}小时</detail-list-item>
  68. <detail-list-item term="维修人员">{{ model.repairUserName }}</detail-list-item>
  69. <!--<detail-list-item term="维修次数">{{ model.repairTimes }}</detail-list-item>-->
  70. </detail-list>
  71. <detail-list title="" :col="1">
  72. <detail-list-item term="维修描述">{{ model.repairContent }}</detail-list-item>
  73. </detail-list>
  74. <title-divider title="维修图片" width="90px"></title-divider>
  75. <detail-list title="" :col="1">
  76. <detail-list-item term="" v-if="model.repairFileList != null && model.repairFileList.length > 0">
  77. <viewer :images="model.repairFileList" @inited="inited" ref="viewer" :index="1">
  78. <img v-for="item in model.repairFileList" :src="item.url" :key="item.id" class="image">
  79. </viewer>
  80. </detail-list-item>
  81. <detail-list-item term="" v-if="model.repairFileList == null || model.repairFileList.length === 0">
  82. 暂无
  83. </detail-list-item>
  84. </detail-list>
  85. <a-divider v-if="dispatchList != null" orientation="left">转派详情</a-divider>
  86. <detail-list v-for="item in dispatchList" title="" :col="3">
  87. <detail-list-item term="转派人">{{ item.username }}</detail-list-item>
  88. <detail-list-item term="转派时间">{{ item.time }}</detail-list-item>
  89. <detail-list-item term="转派备注">{{ item.remark }}</detail-list-item>
  90. </detail-list>
  91. <a-divider orientation="left">审核详情</a-divider>
  92. <detail-list title="" :col="3">
  93. <detail-list-item term="审核开始时间">{{ model.checkStartTime }}</detail-list-item>
  94. <detail-list-item term="审核结束时间">{{ model.checkEndTime }}</detail-list-item>
  95. <detail-list-item term="审核人员">{{ model.checkUserName }}</detail-list-item>
  96. <detail-list-item term="审核描述">{{ model.checkContent }}</detail-list-item>
  97. </detail-list>
  98. <detail-list title="审核图片:" :col="6">
  99. <upload-image-detail :images-list="model.checkFileList" />
  100. </detail-list>
  101. </a-layout-content>
  102. <a-layout-sider style="background-color: rgb(255, 255, 255)">
  103. <div style="margin-top: 30px;margin-left: 30px;">
  104. <a-steps progress-dot :current="6" direction="vertical">
  105. <a-step title="报修时间:" :description="''+model.applyTime?model.applyTime:''" />
  106. <a-step title="维修开始时间:" :description="''+model.repairStartTime?model.repairStartTime:''" />
  107. <a-step title="维修结束时间:" :description="''+model.repairEndTime?model.repairEndTime:''" />
  108. <a-step title="审核开始时间:" :description="''+model.checkStartTime?model.checkStartTime:''" />
  109. <a-step title="审核结束时间:" :description="''+model.checkEndTime?model.checkEndTime:''" />
  110. </a-steps>
  111. </div>
  112. </a-layout-sider>
  113. </a-layout>
  114. <q-tabs :activeKey="activeKey" @change="changeTab">
  115. <q-tab-pane key="1" tab="备件清单">
  116. <div class="table-operator" v-if="$auth('repair-application-forms-finish')">
  117. <a-button type="primary" @click="handleSpareStoreSelect">
  118. <a-icon type="plus" />
  119. 添加
  120. </a-button>
  121. </div>
  122. <a-table :data-source="dataSpare" :columns="columnsSpare" :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" tableLayout="auto" rowKey="id">
  123. <span slot="actionSpare" slot-scope="record">
  124. <template>
  125. <a v-if="$auth('repair-application-forms-finish')" @click="handleEditSpare(record)">修改</a>
  126. <a-divider type="vertical" />
  127. <a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否要删除该条数据?" @confirm="batchDeleteSpare(record.id)">
  128. <a>删除</a>
  129. </a-popconfirm>
  130. </template>
  131. </span>
  132. </a-table>
  133. </q-tab-pane>
  134. <q-tab-pane key="2" tab="委外记录">
  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 @click="handleEditFee(record)">修改</operation-button>
  146. <operation-button title="确认删除该笔费用?" @confirm="batchDeleteFee(record.id)">删除</operation-button>
  147. </template>
  148. </span>
  149. </a-table>
  150. </q-tab-pane>
  151. <q-tab-pane key="3" tab="维修报告">
  152. <div class="table-operator" v-if="$auth('repair-application-forms-finish') && ((dataReason === null) || (dataReason.length===0))">
  153. <a-button type="primary" @click="handleAddReason">
  154. <a-icon type="plus" />
  155. 添加
  156. </a-button>
  157. </div>
  158. <a-table :data-source="dataReason" :columns="columnsReason" :scroll="{x: 1, y: BaseTool.Constant.scrollY }" rowKey="id">
  159. <span slot="action" slot-scope="record">
  160. <template>
  161. <a @click="handleViewReason(record)">查看</a>
  162. <operation-button @click="handleEditReason(record)">修改</operation-button>
  163. <!-- <operation-button
  164. 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)"
  165. @click="handleCopyReason(record)" >复制</operation-button>-->
  166. <operation-button :type="2" title="确认删除该记录?" @confirm="batchDeleteReason(record.id)">删除</operation-button>
  167. </template>
  168. </span>
  169. </a-table>
  170. </q-tab-pane>
  171. </q-tabs>
  172. <!-- <title-divider title="备件清单" width="90px"></title-divider>
  173. <title-divider title="费用清单" width="90px"></title-divider>
  174. <title-divider title="维修报告" width="90px"></title-divider>-->
  175. <!-- <q-tabs :activeKey="activeKey" @change="changeTab">
  176. <q-tab-pane key="a" tab="配件更换">
  177. <spare-part-used-select-table :type="2" :table-params="{sbId: model.sbId, modelId: model.modelId, repairId: model.id}" ref="sparePartUsedSelectTable"/>
  178. </q-tab-pane>
  179. <q-tab-pane key="b" tab="备件领用">
  180. <spare-pick-form-select-table :type="2" :table-params="{repairId: model.id, repairNo: model.no}" ref="sparePickFormSelectTable"/>
  181. </q-tab-pane>
  182. </q-tabs>-->
  183. </a-card>
  184. <check-form ref="checkForm" @ok="handleOk" />
  185. <base-out-form ref="outForm" @ok="handleOk" />
  186. <finish-form ref="finishForm" @ok="handleOk" />
  187. <dispatch-form ref="dispatchForm" @ok="handleCancel" />
  188. <assign-form ref="assignForm" @ok="handleCancel" />
  189. <spare-pick-base-form ref="baseModal" @ok="handleOk" />
  190. <base-form-for-repair ref="baseFormForRepair" @ok="handleOk" />
  191. <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected" />
  192. <fee-base-form ref="feeForm" @ok="handleOk" />
  193. <fee-detail ref="feeDetail" @ok="handleOk" />
  194. <reason-base-form ref="reasonForm" @ok="handleOk" />
  195. <reason-detail ref="reasonDetail" @ok="handleOk" />
  196. <detail-sb-bom ref="detailSbBomModal" @ok="handleOk" />
  197. <detail-sb-check ref="detailSbCheckModal" @ok="handleOk" />
  198. <base-form ref="baseRepairProjectModal" @ok="handleOk" />
  199. <detail ref="detailRepairProjectModal" />
  200. <edit-form ref="editForm" @ok="handleOk" />
  201. <RejectForm ref="rejectForm" @ok="handleOk" />
  202. <transfer-form ref="transferForm" @ok="handleOk" />
  203. </div>
  204. </template>
  205. <script>
  206. import DetailList from '@/components/tools/DetailList'
  207. import { fetchRepairApplicationForm, examine, approve, receive } from '@/api/repair/application-form'
  208. import CheckForm from './CheckForm'
  209. import RejectForm from './RejectForm'
  210. import BaseOutForm from './BaseOutForm'
  211. import FinishForm from './FinishForm'
  212. import EditForm from './EditForm'
  213. import DispatchForm from './DispatchForm'
  214. import TransferForm from './TransferForm'
  215. import AssignForm from './AssignForm'
  216. import SparePickBaseForm from '../../../store/sparepickform/modules/BaseForm'
  217. import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
  218. import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
  219. import RepairProjectSelectModal from '@/views/repair/repairproject/modules/RepairProjectSelectModal'
  220. import { queryRepairProject, fetchRepairProject, deleteRepairProjects } from '@/api/repair/repairproject'
  221. import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
  222. import BaseFormForRepair from '@/views/sqarepartmanage/sparepartused/modules/BaseFormForRepair'
  223. import {
  224. selectSparePartUsedListByRepairId,
  225. addSparePartUsedBatch,
  226. deleteSparePartUseds,
  227. } from '@/api/sqarepartmanage/sparepartused'
  228. import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModal'
  229. import BaseTool from '@/utils/tool'
  230. import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
  231. import FeeDetail from '@/views/repair/fee/modules/Detail'
  232. import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/fee'
  233. import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
  234. import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
  235. import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
  236. import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
  237. import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
  238. import { fetchSbInfo } from '@/api/sb/info'
  239. import BaseForm from '@/views/repair/repairproject/modules/BaseForm'
  240. import Detail from '@/views/repair/repairproject/modules/Detail'
  241. const DetailListItem = DetailList.Item
  242. export default {
  243. name: 'RepairApplicationFormDetail',
  244. components: {
  245. CheckForm,
  246. EditForm,
  247. DetailList,
  248. DetailSbCheck,
  249. DetailSbBom,
  250. ReasonBaseForm,
  251. ReasonDetail,
  252. DetailListItem,
  253. TransferForm,
  254. FinishForm,
  255. BaseOutForm,
  256. DispatchForm,
  257. FeeDetail,
  258. AssignForm,
  259. FeeBaseForm,
  260. SparePickBaseForm,
  261. SparePartUsedSelectTable,
  262. SparePickFormSelectTable,
  263. RepairProjectSelectModal,
  264. SparePartInfoSelectModal,
  265. BaseFormForRepair,
  266. SpareStoreSelectModal,
  267. BaseForm,
  268. Detail,
  269. RejectForm,
  270. },
  271. data() {
  272. return {
  273. confirmLoading: false,
  274. mdl: {},
  275. modalTitle: null,
  276. needStopMap: {},
  277. planFlagMap: {},
  278. dispatchList: [],
  279. visible: false,
  280. showSbFlag: false,
  281. sbInfo: {},
  282. // 下拉框map
  283. sourceMap: {},
  284. typeMap: {},
  285. levelMap: {},
  286. descripitionMap: {},
  287. selectedRowKeys: [],
  288. statusMap: {},
  289. repairProjectMap: {},
  290. repairTechnologyMap: {},
  291. activeKey: 'a',
  292. data: [],
  293. dataSpare: [],
  294. dataFee: [],
  295. dataReason: [],
  296. // 表头
  297. columns: [
  298. {
  299. title: '序号',
  300. dataIndex: 'index',
  301. customRender: (text, record, index) => {
  302. return `${index + 1}`
  303. },
  304. },
  305. {
  306. title: '维修内容',
  307. dataIndex: 'name',
  308. },
  309. {
  310. title: '操作',
  311. key: 'action',
  312. width: '200px',
  313. align: 'center',
  314. scopedSlots: { customRender: 'action' },
  315. },
  316. ],
  317. columnsSpare: [
  318. {
  319. title: '序号',
  320. dataIndex: 'index',
  321. customRender: (text, record, index) => {
  322. return `${index + 1}`
  323. },
  324. },
  325. {
  326. title: '备件名称',
  327. dataIndex: 'spareId',
  328. customRender: (text, record, index) => {
  329. return record.spareName
  330. },
  331. },
  332. {
  333. title: '数量',
  334. dataIndex: 'num',
  335. },
  336. {
  337. title: '价格',
  338. dataIndex: 'price',
  339. },
  340. {
  341. title: '总价',
  342. dataIndex: 'totalPrice',
  343. },
  344. {
  345. title: '更换日期',
  346. dataIndex: 'startDate',
  347. },
  348. {
  349. title: '操作',
  350. key: 'action',
  351. width: '200px',
  352. align: 'center',
  353. scopedSlots: { customRender: 'actionSpare' },
  354. },
  355. ],
  356. columnsFee: [
  357. {
  358. title: '序号',
  359. dataIndex: 'index',
  360. customRender: (text, record, index) => {
  361. return `${index + 1}`
  362. },
  363. },
  364. {
  365. title: '委外单位',
  366. dataIndex: 'outCompany',
  367. },
  368. // {
  369. // title: '费用金额',
  370. // dataIndex: 'fee',
  371. // customRender: (text, record, index) => {
  372. // return this.BaseTool.Amount.formatter(text)
  373. // },
  374. // },
  375. // {
  376. // title: '费用类别',
  377. // dataIndex: 'type',
  378. // customRender: (text, record, index) => {
  379. // return this.BaseTool.Object.getField(this.typeMap, text)
  380. // },
  381. // },
  382. {
  383. title: '委外日期',
  384. dataIndex: 'feeDate',
  385. },
  386. {
  387. title: '委外原因',
  388. dataIndex: 'reason',
  389. },
  390. // {
  391. // title: '费用描述',
  392. // dataIndex: 'descripition',
  393. // },
  394. {
  395. title: '备注',
  396. dataIndex: 'remark',
  397. },
  398. {
  399. title: '操作',
  400. key: 'action',
  401. width: '200px',
  402. align: 'center',
  403. scopedSlots: { customRender: 'action' },
  404. },
  405. ],
  406. columnsReason: [
  407. {
  408. title: '序号',
  409. dataIndex: 'index',
  410. width: '70px',
  411. customRender: (text, record, index) => {
  412. return `${index + 1}`
  413. },
  414. },
  415. {
  416. title: '分析时间',
  417. dataIndex: 'analyzeTime',
  418. width: '150px',
  419. },
  420. {
  421. title: '故障现象',
  422. dataIndex: 'problemDesc',
  423. ellipsis: true,
  424. width: '150px',
  425. },
  426. {
  427. title: '检查处理过程',
  428. dataIndex: 'checkProcess',
  429. ellipsis: true,
  430. width: '150px',
  431. },
  432. /* {
  433. title: '改进措施类别',
  434. dataIndex: 'type',
  435. ellipsis: true,
  436. width: '150px',
  437. customRender: (text, record, index) => {
  438. return this.BaseTool.Object.getField(this.typeReasonMap, text)
  439. },
  440. },*/
  441. {
  442. title: '原因分析',
  443. dataIndex: 'reasonAnalysis',
  444. ellipsis: true,
  445. width: '250px',
  446. },
  447. {
  448. title: '操作',
  449. key: 'action',
  450. width: '200px',
  451. align: 'center',
  452. scopedSlots: { customRender: 'action' },
  453. },
  454. ],
  455. typeReasonMap: {},
  456. model: {
  457. id: null,
  458. sbId: null,
  459. partId: null,
  460. repairUserId: null,
  461. needStop: null,
  462. category: null,
  463. no: null,
  464. source: null,
  465. applyTime: null,
  466. level: null,
  467. content: null,
  468. status: null,
  469. remark: null,
  470. updateTime: null,
  471. createdUserId: null,
  472. updateUserId: null,
  473. createdUserName: null,
  474. sbName: null,
  475. partName: null,
  476. limitHours: null,
  477. limitDate: null,
  478. updateUserName: null,
  479. repairFormVO: null,
  480. repairCheckVO: null,
  481. },
  482. }
  483. },
  484. created() {
  485. // 下拉框map
  486. this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
  487. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
  488. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
  489. this.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
  490. this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
  491. this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  492. this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
  493. this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
  494. this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIRE_ACTION)
  495. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
  496. this.typeReasonMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_TYPE)
  497. this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
  498. },
  499. methods: {
  500. base(record) {
  501. this.visible = true
  502. this.showSbFlag = false
  503. this.modalTitle = '详情'
  504. this.model = record
  505. this.activeKey = 'a'
  506. this.dispatchList = JSON.parse(record.repairDispatchList)
  507. const sbId = record.sbId
  508. if (sbId) {
  509. fetchSbInfo({ id: sbId }).then((res) => {
  510. this.sbInfo = res.data
  511. this.showSbFlag = true
  512. })
  513. }
  514. this.init()
  515. },
  516. init() {
  517. queryRepairProject({ repairId: this.model.id }).then((res) => {
  518. this.data = res.data
  519. })
  520. selectSparePartUsedListByRepairId({ id: this.model.id }).then((res) => {
  521. this.dataSpare = res.data
  522. })
  523. queryRepairFee({ repairId: this.model.id }).then((res) => {
  524. this.dataFee = res.data
  525. })
  526. queryRepairReason({ repairId: this.model.id }).then((res) => {
  527. this.dataReason = res.data
  528. })
  529. },
  530. handleViewBom(record) {
  531. this.visible = false
  532. const modal = this.$refs.detailSbBomModal
  533. modal.base(this.sbInfo)
  534. },
  535. handleViewCheck(record) {
  536. this.visible = false
  537. const modal = this.$refs.detailSbCheckModal
  538. modal.base(this.sbInfo)
  539. },
  540. handleCancel() {
  541. this.visible = false
  542. this.confirmLoading = false
  543. this.$emit('ok')
  544. },
  545. receive() {
  546. this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING
  547. receive(this.model).then(() => {
  548. // const modal = this.$refs.finishForm
  549. // modal.base(that.model)
  550. })
  551. },
  552. batchDeleteFee(id) {
  553. let ids = []
  554. if (this.BaseTool.String.isBlank(id)) {
  555. const length = this.selectedRows.length
  556. if (length === 0) {
  557. this.$message.info('请选择要删除的记录')
  558. return
  559. }
  560. ids = this.selectedRows.map((item) => item.id)
  561. } else {
  562. ids = [id]
  563. }
  564. deleteRepairFees(ids).then((res) => {
  565. this.$message.info('删除成功')
  566. this.handleOk()
  567. })
  568. },
  569. handleOut() {
  570. const modal = this.$refs.outForm
  571. modal.base(null, this.model)
  572. },
  573. handleAddFee() {
  574. const modal = this.$refs.feeForm
  575. modal.base(null, this.model)
  576. },
  577. handleEditFee(record) {
  578. fetchRepairFee({ id: record.id }).then((res) => {
  579. const modal = this.$refs.feeForm
  580. const data = res.data
  581. data.repairNo = this.model.no
  582. modal.base(data, this.model)
  583. })
  584. },
  585. handleViewFee(record) {
  586. fetchRepairFee({ id: record.id }).then((res) => {
  587. const modal = this.$refs.feeDetail
  588. modal.base(res.data)
  589. })
  590. },
  591. batchDeleteReason(id) {
  592. let ids = []
  593. if (this.BaseTool.String.isBlank(id)) {
  594. const length = this.selectedRows.length
  595. if (length === 0) {
  596. this.$message.info('请选择要删除的记录')
  597. return
  598. }
  599. ids = this.selectedRows.map((item) => item.id)
  600. } else {
  601. ids = [id]
  602. }
  603. deleteRepairReasons(ids).then((res) => {
  604. this.$message.info('删除成功')
  605. this.handleOk()
  606. this.$refs.table.clearSelected()
  607. })
  608. },
  609. handleAddReason() {
  610. const modal = this.$refs.reasonForm
  611. this.visible = false
  612. modal.base(null, this.model)
  613. },
  614. handleEditReason(record) {
  615. fetchRepairReason({ id: record.id }).then((res) => {
  616. const modal = this.$refs.reasonForm
  617. this.visible = false
  618. modal.base(res.data, this.model)
  619. })
  620. },
  621. handleCopyReason(record) {
  622. fetchRepairReason({ id: record.id }).then((res) => {
  623. const modal = this.$refs.reasonForm
  624. this.visible = false
  625. res.data.id = null
  626. modal.base(res.data, this.model)
  627. })
  628. },
  629. handleViewReason(record) {
  630. fetchRepairReason({ id: record.id }).then((res) => {
  631. const modal = this.$refs.reasonDetail
  632. modal.base(res.data)
  633. })
  634. },
  635. handleApprove() {
  636. approve(this.model).then(() => {
  637. this.$message.info('操作成功')
  638. this.handleOk()
  639. })
  640. },
  641. handleReturn() {
  642. const modal = this.$refs.checkForm
  643. modal.base(this.model)
  644. },
  645. handleReject() {
  646. const modal = this.$refs.rejectForm
  647. modal.base(this.model)
  648. },
  649. handleOk() {
  650. this.loading = true
  651. fetchRepairApplicationForm({ id: this.model.id }).then((res) => {
  652. this.loading = false
  653. this.model = res.data
  654. this.visible = true
  655. this.dispatchList = JSON.parse(this.model.repairDispatchList)
  656. })
  657. this.init()
  658. },
  659. handleFinish() {
  660. const modal = this.$refs.finishForm
  661. modal.base(this.model)
  662. },
  663. handleExamine() {
  664. examine({ id: this.model.id }).then((res) => {
  665. this.loading = false
  666. this.visible = true
  667. this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.EXAMINING
  668. this.$message.info('已提交,请等待审核')
  669. })
  670. this.init()
  671. },
  672. handleDispatch() {
  673. const modal = this.$refs.dispatchForm
  674. modal.base(this.model)
  675. },
  676. handleTransfer() {
  677. const modal = this.$refs.transferForm
  678. modal.base(this.model)
  679. },
  680. handleAssign() {
  681. const modal = this.$refs.assignForm
  682. modal.base(this.model)
  683. },
  684. handleSparePick() {
  685. const modal = this.$refs.baseModal
  686. modal.base(null, { repairId: this.model.id, repairNo: this.model.no, reason: '维修领用' })
  687. },
  688. changeTab(activeKey) {
  689. this.activeKey = activeKey
  690. if (this.activeKey === 'a' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
  691. const modal = this.$refs.sparePartUsedSelectTable
  692. modal.handleOk()
  693. return
  694. }
  695. if (this.activeKey === 'b' && this.BaseTool.Object.isNotBlank(this.$refs.sparePickFormSelectTable)) {
  696. const modal = this.$refs.sparePickFormSelectTable
  697. modal.handleOk()
  698. }
  699. },
  700. handleView(record) {
  701. fetchRepairProject({ id: record.id }).then((res) => {
  702. const modal = this.$refs.detailRepairProjectModal
  703. modal.base(res.data)
  704. })
  705. },
  706. handleEdit(record) {
  707. const modal = this.$refs.editForm
  708. modal.base(this.model)
  709. },
  710. handleRepairProjectAdd() {
  711. this.$refs.baseRepairProjectModal.base({ repairId: this.model.id })
  712. },
  713. batchDelete(id) {
  714. let ids = []
  715. if (this.BaseTool.String.isBlank(id)) {
  716. if (length === 0) {
  717. this.$message.info('请选择要删除的记录')
  718. return
  719. }
  720. ids = this.selectedRows.map((item) => item.id)
  721. } else {
  722. ids = [id]
  723. }
  724. deleteRepairProjects(ids).then((res) => {
  725. this.$message.info('删除成功')
  726. this.handleOk()
  727. })
  728. },
  729. handleSpareSelect() {
  730. this.$refs.spareSelectModal.base({}, { yt: 1 })
  731. },
  732. handleSpareSelected(record, keys, rows) {
  733. const data = []
  734. for (let i = 0; i < rows.length; i++) {
  735. data.push({
  736. sbId: this.model.sbId,
  737. spareId: rows[i].id,
  738. repairId: this.model.id,
  739. num: 1,
  740. price: rows[i].initialValue,
  741. totalPrice: rows[i].initialValue,
  742. })
  743. }
  744. addSparePartUsedBatch(data)
  745. .then((response) => {
  746. this.$message.info('添加成功')
  747. this.handleOk()
  748. })
  749. .catch(() => {
  750. this.confirmLoading = false
  751. })
  752. },
  753. batchDeleteSpare(id) {
  754. let ids = []
  755. if (this.BaseTool.String.isBlank(id)) {
  756. if (length === 0) {
  757. this.$message.info('请选择要删除的记录')
  758. return
  759. }
  760. ids = this.selectedRows.map((item) => item.id)
  761. } else {
  762. ids = [id]
  763. }
  764. deleteSparePartUseds(ids).then((res) => {
  765. this.$message.info('删除成功')
  766. this.handleOk()
  767. })
  768. },
  769. handleEditSpare(record) {
  770. const modal = this.$refs.baseFormForRepair
  771. modal.base(record)
  772. },
  773. handleSpareStoreSelect() {
  774. this.$refs.spareStoreSelectModal.base({}, { storeId: this.storeId })
  775. },
  776. handleSpareStoreSelected(record, keys, rows) {
  777. const data = []
  778. for (let i = 0; i < rows.length; i++) {
  779. data.push({
  780. sbId: this.model.sbId,
  781. spareId: rows[i].spareId,
  782. repairId: this.model.id,
  783. num: 1,
  784. price: rows[i].price,
  785. totalPrice: rows[i].price,
  786. startDate: BaseTool.Date.formatter(new Date(), BaseTool.Date.PICKER_NORM_DATE_PATTERN),
  787. })
  788. }
  789. addSparePartUsedBatch(data)
  790. .then((response) => {
  791. this.$message.info('添加成功')
  792. this.handleOk()
  793. })
  794. .catch(() => {
  795. this.confirmLoading = false
  796. })
  797. },
  798. onSelectChange(selectedRowKeys) {
  799. console.log('selectedRowKeys changed: ', selectedRowKeys)
  800. this.selectedRowKeys = selectedRowKeys
  801. },
  802. inited(viewer) {
  803. this.$viewer = viewer
  804. },
  805. },
  806. }
  807. </script>
  808. <style scoped>
  809. /* For demo */
  810. .ant-carousel {
  811. width: 300px;
  812. height: 300px;
  813. }
  814. .ant-carousel >>> .slick-slide {
  815. text-align: center;
  816. height: 300px;
  817. line-height: 300px;
  818. overflow: hidden;
  819. }
  820. .ant-carousel >>> .slick-slide h3 {
  821. color: #fff;
  822. }
  823. .image {
  824. width: calc(20% - 10px);
  825. cursor: pointer;
  826. margin: 5px;
  827. display: inline-block;
  828. }
  829. </style>