DetailRepair.vue 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311
  1. <template>
  2. <div>
  3. <div v-show="visible">
  4. <a-row :gutter="40">
  5. <a-col :span="6">
  6. <div class="gutter-box gutter-color center">
  7. <div style=" overflow: auto;height: 300px;">
  8. <a-steps :current="repairStatus.length-1" direction="vertical" >
  9. <a-step v-for="item in repairStatus" :key="item.id" :title="DictCache.COLOR.REPAIR_STATUS[item.status]" :description="item.createdTime" />
  10. </a-steps>
  11. </div>
  12. </div>
  13. </a-col>
  14. <a-col :span="18" class="gutter-box">
  15. <a-row :gutter="[20,20]">
  16. <a-col :span="6">
  17. <div class="gutter-btn gutter-color" :class="{'act':current===0}" @click="current=0">
  18. <my-icon type="icon-weixiu1" />
  19. <div style="font-size:25px">报修数据</div>
  20. </div>
  21. </a-col>
  22. <a-col :span="6" >
  23. <div class="gutter-btn gutter-color" :class="{'act':current===1}" @click="current=1">
  24. <my-icon type="icon-weixiubaoxiu" />
  25. <div style="font-size:25px; ">维修数据</div>
  26. </div>
  27. </a-col>
  28. <a-col :span="6">
  29. <div class="gutter-btn gutter-color" :class="{'act':current===7}" @click="current=7">
  30. <my-icon type="icon-weixiu" />
  31. <div style="font-size:25px; ">维修方案</div>
  32. </div>
  33. </a-col>
  34. <a-col :span="6">
  35. <div class="gutter-btn gutter-color" @click="current=3" :class="{'act':current===3}">
  36. <img v-if="current==3" src="@/assets/icons/jilu.png" width="50px"/>
  37. <my-icon v-else class="act" type="icon-xinzengyugengxinhuopindangan" />
  38. <div style="font-size:25px;">维修记录</div>
  39. </div>
  40. </a-col>
  41. <a-col :span="6">
  42. <div class="gutter-btn gutter-color" @click="current=4" :class="{'act':current===4}">
  43. <img v-if="current==4" src="@/assets/icons/beijian.png" width="50px"/>
  44. <my-icon v-else class="act" type="icon-shouhoubeijianjijingpinjianjiageshenqingbiao-06" />
  45. <div style="font-size:25px; ">备件清单</div>
  46. </div>
  47. </a-col>
  48. <a-col :span="6" >
  49. <div class="gutter-btn gutter-color" :class="{'act':current===5}" @click="current=5">
  50. <my-icon type="icon-qitafeiyong" />
  51. <div style="font-size:25px;">费用清单</div>
  52. </div>
  53. </a-col>
  54. <a-col :span="6">
  55. <div class="gutter-btn gutter-color" :class="{'act':current===6}" @click="current=6">
  56. <my-icon type="icon-zhengzaiweixiudegongdan" />
  57. <div style="font-size:25px; ">维修报告</div>
  58. </div>
  59. </a-col>
  60. <a-col :span="6">
  61. <div class="gutter-btn gutter-color" @click="current=2" :class="{'act':current===2}">
  62. <img v-if="current==2" src="@/assets/icons/shenhe.png" width="50px"/>
  63. <my-icon v-else class="act" type="icon-fapiaoshenhe" />
  64. <div style="font-size:25px; ">审核详情</div>
  65. </div>
  66. </a-col>
  67. </a-row>
  68. </a-col>
  69. </a-row>
  70. <div>
  71. <div class="main gutter-color" v-show="current == 0">
  72. <div class="title">报修数据</div>
  73. <div>
  74. <a-descriptions :column="3" bordered>
  75. <a-descriptions-item label="报修单号">{{ model.no }}</a-descriptions-item>
  76. <a-descriptions-item label="设备编号">{{ model.sbNo }}</a-descriptions-item>
  77. <a-descriptions-item label="设备名称">{{ model.sbName }}</a-descriptions-item>
  78. <a-descriptions-item label="使用位置">{{ model.sbCph }}</a-descriptions-item>
  79. <a-descriptions-item label="工单类别">{{ BaseTool.Object.getField(planFlagMap,model.category) }}</a-descriptions-item>
  80. <a-descriptions-item label="报修状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]"/></a-descriptions-item>
  81. <a-descriptions-item label="报修时间">{{ model.applyTime }}</a-descriptions-item>
  82. <a-descriptions-item label="报修人">{{ model.actualUser }}</a-descriptions-item>
  83. <a-descriptions-item label="要求时间">{{ model.limitHours }}小时</a-descriptions-item>
  84. <a-descriptions-item label="送修部门">{{ model.name }}</a-descriptions-item>
  85. <a-descriptions-item label="维修工程师" >{{ model.checkUserName }}</a-descriptions-item>
  86. <a-descriptions-item label="故障描述" :span="3"> <span v-html="model.content "></span> </a-descriptions-item>
  87. <a-descriptions-item label="报修图片" :span="3">
  88. <div v-if="model.applicationFileList != null && model.applicationFileList.length > 0">
  89. <viewer :images="model.applicationFileList" @inited="inited" ref="viewer" :index="1" >
  90. <img
  91. v-for="item in model.applicationFileList"
  92. :src="item.url"
  93. :key="item.id"
  94. class="image"
  95. width="200px"
  96. style="margin:10px;">
  97. </viewer></div>
  98. <div v-if="model.applicationFileList == null || model.applicationFileList.length === 0"> 暂无</div>
  99. </a-descriptions-item>
  100. </a-descriptions>
  101. </div>
  102. </div>
  103. <div class="main gutter-color" v-show="current == 1">
  104. <div class="title">维修数据</div>
  105. <div>
  106. <a-descriptions :column="2" bordered>
  107. <a-descriptions-item label="维修开始时间">{{ model.repairStartTime }}</a-descriptions-item>
  108. <a-descriptions-item label="维修结束时间">{{ model.repairEndTime }}</a-descriptions-item>
  109. <a-descriptions-item label="维修耗时">{{ model.repairMinutes }}小时</a-descriptions-item>
  110. <a-descriptions-item label="当前维修人">{{ model.repairUserName }}</a-descriptions-item>
  111. </a-descriptions>
  112. </div>
  113. </div>
  114. <div class="main gutter-color" v-show="current == 2">
  115. <div class="title">审核记录</div>
  116. <a-table
  117. :data-source="dataVerifyRecord"
  118. :columns="columnsVerifyRecord"
  119. tableLayout="auto"
  120. rowKey="id">
  121. <span slot="action" slot-scope="record">
  122. <template>
  123. <a @click="handleVerifyRecord(record)">审核详情</a>
  124. </template>
  125. </span>
  126. </a-table>
  127. </div>
  128. <div class="main gutter-color" v-show="current == 3">
  129. <div class="title">维修记录</div>
  130. <a-table
  131. :data-source="dataRecord"
  132. :columns="columnsRecord"
  133. tableLayout="auto"
  134. rowKey="id">
  135. <span slot="action" slot-scope="record">
  136. <template>
  137. <a @click="handleViewRecord(record)">维修详情</a>
  138. <operation-button @click="handleEditRecord(record)" >编辑</operation-button>
  139. </template>
  140. </span>
  141. </a-table>
  142. </div>
  143. <div class="main gutter-color" v-show="current == 4">
  144. <div class="title">备件清单</div>
  145. <div style="margin:20px;margin-left: 33%;" class="table-operator" v-if="$auth('repair-application-forms-finish')">
  146. <a-button type="primary" @click="updateLongYanSpare(1)">
  147. <a-icon type="plus"/>
  148. 更换关联备件
  149. </a-button>
  150. <a-divider type="vertical" />
  151. <a-button type="primary" @click="updateLongYanSpare(0)">
  152. <a-icon type="plus"/>
  153. 更换常用备件
  154. </a-button>
  155. <!-- <a-divider type="vertical" />
  156. <a-button type="primary" @click="handleAddSpare()">
  157. <a-icon type="plus"/>
  158. 添加专用备件
  159. </a-button>-->
  160. </div>
  161. <a-table
  162. :data-source="dataSpare"
  163. :columns="columnsSpare"
  164. :row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
  165. tableLayout="auto"
  166. rowKey="id">
  167. <span slot="actionSpare" slot-scope="record">
  168. <template>
  169. <a v-if="$auth('repair-application-forms-finish') && record.isSpecial === 0" @click="handleEditSpare(record)">修改</a>
  170. <a-divider type="vertical" />
  171. <a-popconfirm v-if="$auth('repair-application-forms-finish')" title="是否要删除该条数据?" @confirm="batchDeleteSpare(record.id)">
  172. <a>删除</a>
  173. </a-popconfirm>
  174. </template>
  175. </span>
  176. </a-table>
  177. </div>
  178. <div class="main gutter-color" v-show="current == 5">
  179. <div class="title">费用清单</div>
  180. <div style="margin:20px;margin-left:45%;" class="table-operator" v-if="$auth('repair-application-forms-finish')">
  181. <a-button type="primary" @click="handleAddFee">
  182. <a-icon type="plus"/>
  183. 费用单
  184. </a-button>
  185. </div>
  186. <a-table
  187. :data-source="dataFee"
  188. :columns="columnsFee"
  189. tableLayout="auto"
  190. rowKey="id">
  191. <span slot="action" slot-scope="record">
  192. <template>
  193. <a @click="handleViewFee(record)">查看</a>
  194. <operation-button
  195. @click="handleEditFee(record)" >修改</operation-button>
  196. <operation-button
  197. title="确认删除该笔费用?"
  198. @confirm="batchDeleteFee(record.id)" >删除</operation-button>
  199. </template>
  200. </span>
  201. </a-table>
  202. </div>
  203. <div class="main gutter-color" v-show="current == 6">
  204. <div class="title">维修报告</div>
  205. <div style="margin:20px;margin-left:45%;" class="table-operator" v-if="$auth('repair-application-forms-finish') && ((dataReason === null) || (dataReason.length===0))">
  206. <a-button type="primary" @click="handleAddReason">
  207. <a-icon type="plus"/>
  208. 维修报告
  209. </a-button>
  210. </div>
  211. <a-table
  212. :data-source="dataReason"
  213. :columns="columnsReason"
  214. :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
  215. rowKey="id">
  216. <span slot="action" slot-scope="record">
  217. <template>
  218. <a @click="handleViewReason(record)">查看</a>
  219. <operation-button
  220. @click="handleEditReason(record)" >修改</operation-button>
  221. <!-- <operation-button
  222. 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)"
  223. @click="handleCopyReason(record)" >复制</operation-button>-->
  224. <operation-button
  225. :type="2"
  226. title="确认删除该记录?"
  227. @confirm="batchDeleteReason(record.id)" >删除</operation-button>
  228. </template>
  229. </span>
  230. </a-table>
  231. </div>
  232. <div class="main gutter-color" v-show="current == 7">
  233. <div class="title">维修方案</div>
  234. <div style="margin:20px;margin-left:45%;" class="table-operator" >
  235. <a-button v-if="$auth('repair-repairs-add')" type="primary" @click="handleAddRepairResolve">
  236. <a-icon type="plus"/>
  237. 添加方案
  238. </a-button>
  239. <a-button style="margin-left:30px;" v-if="$auth('repair-repairs-add')" type="primary" @click="handleAddRepairResolves">
  240. <a-icon type="read" />
  241. 方案库
  242. </a-button>
  243. </div>
  244. <a-table
  245. :data-source="dataRepairResolve"
  246. :columns="columnsRepairResolve"
  247. tableLayout="auto"
  248. rowKey="id">
  249. <span slot="action" slot-scope="record">
  250. <template>
  251. <a @click="handleViewRepairResolve(record)">方案详情</a>
  252. <operation-button
  253. @click="handleEditRepairResolve(record)" >修改</operation-button>
  254. </template>
  255. </span>
  256. </a-table>
  257. </div>
  258. </div>
  259. <div class="btn">
  260. <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status " title="是否要接单?" @confirm="receiveRepair">
  261. <a-button style="margin-left: 8px" type="default">接单</a-button>
  262. </a-popconfirm>
  263. <a-button v-if="$auth('repair-application-forms-dispatch') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.RECEIVED === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REBACK === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.MM_DISPATCH === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.DISPATCH_REPAIR === model.status)" style="margin-left: 16px" type="default" @click="handleAssign">派单</a-button>
  264. <a-button v-if="(DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REPAIR_FAIL === model.status)" style="margin-left: 16px" type="default" @click="reportRepair">维修上报</a-button>
  265. <a-button v-if="(DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REPAIR_FAIL === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.MM_REPAIR_FAIL === model.status)" style="margin-left: 16px" type="default" @click="handleReportRepair">处理维修上报</a-button>
  266. <a-button v-if="$auth('repair-application-forms-finish') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REPAIR_FAIL === model.status)" style="margin-left: 8px" type="default" @click="handleTransfer()">转派</a-button>
  267. <a-button v-if="$auth('repair-application-forms-examine') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleFinish()">完成维修</a-button>
  268. <a-button v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleViewTicket()">维修票证</a-button>
  269. <a-popconfirm v-if="$auth('repair-application-forms-finish') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status)" title="是否要结单?" @confirm="handleExamine">
  270. <a-button style="margin-left: 8px" type="default">结单</a-button>
  271. </a-popconfirm>
  272. <a-popconfirm v-if="$auth('repair-application-forms-approve') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" title="是否要接受?" @confirm="handleApprove">
  273. <a-button :loading="confirmLoading" style="margin-left: 8px" type="default">接受</a-button>
  274. </a-popconfirm>
  275. <a-popconfirm v-if="$auth('repair-application-forms-reback') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" title="是否要拒绝?" @confirm="handleReturn">
  276. <a-button style="margin-left: 8px" type="error">拒绝</a-button>
  277. </a-popconfirm>
  278. <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
  279. </div>
  280. </div>
  281. <check-form ref="checkForm" @ok="handleOk" />
  282. <base-out-form ref="outForm" @ok="handleCancel" />
  283. <finish-form ref="finishForm" @ok="handleRepairRecordOk" />
  284. <dispatch-form ref="dispatchForm" @ok="handleCancel" />
  285. <assign-form ref="assignForm" @ok="handleCancel" />
  286. <spare-pick-base-form ref="baseModal" @ok="handleOk"/>
  287. <base-form-for-repair ref="baseFormForRepair" @ok="handleOk" />
  288. <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
  289. <fee-base-form ref="feeForm" @ok="handleOk" />
  290. <fee-detail ref="feeDetail" @ok="handleOk" />
  291. <reason-base-form ref="reasonForm" @ok="handleOk" />
  292. <reason-detail ref="reasonDetail" @ok="handleOk" />
  293. <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
  294. <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
  295. <base-form ref="baseRepairProjectModal" @ok="handleOk"/>
  296. <detail ref="detailRepairProjectModal"/>
  297. <edit-form ref="editForm" @ok="handleOk" />
  298. <resolve-base-form ref="resolveBaseForm" @ok="handleResolveOk"/>
  299. <resolve-detail ref="resolveDetail" @ok="handleResolveOk"/>
  300. <detail-repair-record ref="detailRepairRecord" @ok="handleRepairRecordOk"/>
  301. <transfer-form ref="transferForm" @ok="handleOk"/>
  302. <detail-check-new ref="detailCheckNew" @ok="handleVerifyRecordOk"/>
  303. <repair-record-form ref="repairRecordForm" @ok="handleRepairRecordOk" />
  304. <report-up-form ref="reportUpForm" @ok="handleOk" @okk="handleCancel" />
  305. <ticket-form ref="ticketForm" @ok="handleOk" />
  306. <longYanSelectSpareForm ref="longYanSelectSpareForm" @ok="handleOk"/>
  307. <scheme-library ref="schemeLibrary" @ok="handleOk"/>
  308. </div>
  309. </template>
  310. <script>
  311. // import { stringify } from 'qs'
  312. import DetailList from '@/components/tools/DetailList'
  313. import { fetchRepairApplicationForm, approve, receive, receiveRepair } from '@/api/repair/application-form'
  314. import CheckForm from './CheckForm'
  315. import BaseOutForm from './BaseOutForm'
  316. import FinishForm from './FinishForm'
  317. import EditForm from './EditForm'
  318. import DispatchForm from './DispatchForm'
  319. import AssignForm from './AssignForm'
  320. import SchemeLibrary from './SchemeLibrary'
  321. import SparePickBaseForm from '../../../store/sparepickform/modules/BaseForm'
  322. import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
  323. import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
  324. import RepairProjectSelectModal from '@/views/repair/repairproject/modules/RepairProjectSelectModal'
  325. import { queryRepairProject, fetchRepairProject, deleteRepairProjects } from '@/api/repair/repairproject'
  326. import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
  327. import BaseFormForRepair from '@/views/sqarepartmanage/sparepartused/modules/BaseFormForRepair'
  328. import { selectSparePartUsedListBySbId, addSparePartUsedBatch, deleteSparePartUseds, updateSpare, selectLongYanListByRepairId } from '@/api/sqarepartmanage/sparepartused'
  329. import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModal'
  330. import BaseTool from '@/utils/tool'
  331. import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
  332. import FeeDetail from '@/views/repair/fee/modules/Detail'
  333. import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/fee'
  334. import { getSelfRole } from '@/api/upms/role'
  335. import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
  336. import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
  337. import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
  338. import { queryRepairRecord, fetchCustomDataForRepairRecord, fetchRepairTicketRecord } from '@/api/customize/fieldTemplateData'
  339. import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
  340. import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
  341. import { fetchSbInfo } from '@/api/sb/info'
  342. import { getRepairSchemePage, fetchRepairScheme } from '@/api/repair/repair'
  343. import BaseForm from '@/views/repair/repairproject/modules/BaseForm'
  344. import Detail from '@/views/repair/repairproject/modules/Detail'
  345. import ResolveBaseForm from '@/views/repair/repair/modules/BaseForm'
  346. import ResolveDetail from '@/views/repair/repair/modules/Detail'
  347. import DetailRepairRecord from './DetailRepairRecord'
  348. import TransferForm from './TransferForm'
  349. import DetailCheckNew from './DetailCheckNew'
  350. import RepairRecordForm from './RepairRecordForm'
  351. import ReportUpForm from './ReportUpForm'
  352. import TicketForm from './TicketForm'
  353. import LongYanSelectSpareForm from './LongYanSelectSpareForm'
  354. const DetailListItem = DetailList.Item
  355. export default {
  356. name: 'RepairApplicationFormDetail',
  357. components: {
  358. CheckForm,
  359. SchemeLibrary,
  360. EditForm,
  361. DetailList,
  362. DetailSbCheck,
  363. DetailSbBom,
  364. ReasonBaseForm,
  365. ReasonDetail,
  366. DetailListItem,
  367. FinishForm,
  368. BaseOutForm,
  369. DispatchForm,
  370. FeeDetail,
  371. AssignForm,
  372. FeeBaseForm,
  373. SparePickBaseForm,
  374. SparePartUsedSelectTable,
  375. SparePickFormSelectTable,
  376. RepairProjectSelectModal,
  377. SparePartInfoSelectModal,
  378. BaseFormForRepair,
  379. SpareStoreSelectModal,
  380. BaseForm,
  381. Detail,
  382. ResolveBaseForm,
  383. ResolveDetail,
  384. DetailRepairRecord,
  385. TransferForm,
  386. DetailCheckNew,
  387. RepairRecordForm,
  388. ReportUpForm,
  389. TicketForm,
  390. LongYanSelectSpareForm
  391. },
  392. data () {
  393. return {
  394. confirmLoading: false,
  395. mdl: {},
  396. current: 0,
  397. modalTitle: null,
  398. needStopMap: {},
  399. planFlagMap: {},
  400. dispatchList: [],
  401. visible: false,
  402. showSbFlag: false,
  403. sbInfo: {},
  404. // 下拉框map
  405. sourceMap: {},
  406. typeMap: {},
  407. repairStatus: [],
  408. levelMap: {},
  409. descripitionMap: {},
  410. selectedRowKeys: [],
  411. statusMap: {},
  412. repairProjectMap: {},
  413. repairTechnologyMap: {},
  414. activeKey: 'a',
  415. data: [],
  416. dataSpare: [],
  417. dataFee: [],
  418. dataReason: [],
  419. dataRepairResolve: [],
  420. dataRecord: [],
  421. dataVerifyRecord: [],
  422. // 表头
  423. columns: [
  424. {
  425. title: '序号',
  426. dataIndex: 'index',
  427. customRender: (text, record, index) => {
  428. return `${index + 1}`
  429. }
  430. },
  431. {
  432. title: '维修内容',
  433. dataIndex: 'name'
  434. },
  435. {
  436. title: '操作',
  437. key: 'action',
  438. width: '200px',
  439. align: 'center',
  440. scopedSlots: { customRender: 'action' }
  441. }
  442. ],
  443. columnsSpare: [
  444. {
  445. title: '序号',
  446. dataIndex: 'index',
  447. customRender: (text, record, index) => {
  448. return `${index + 1}`
  449. }
  450. },
  451. {
  452. title: '备件名称',
  453. dataIndex: 'spareName'
  454. },
  455. {
  456. title: '备件编码',
  457. dataIndex: 'spareId'
  458. },
  459. {
  460. title: '规格型号',
  461. dataIndex: 'ggxh'
  462. },
  463. {
  464. title: '更换数量',
  465. dataIndex: 'num'
  466. },
  467. {
  468. title: '更换日期',
  469. dataIndex: 'startDate'
  470. },
  471. /* {
  472. title: '下次更换日期',
  473. dataIndex: 'startDate'
  474. }, */
  475. {
  476. title: '更换备注',
  477. dataIndex: 'remark'
  478. },
  479. {
  480. title: '是否关联设备',
  481. dataIndex: 'isSpecial',
  482. checked: true,
  483. customRender: (text, record, index) => {
  484. if (text === 1) {
  485. return '是'
  486. } else {
  487. return '否'
  488. }
  489. }
  490. }
  491. /*
  492. {
  493. title: '操作',
  494. key: 'action',
  495. width: '200px',
  496. align: 'center',
  497. scopedSlots: { customRender: 'actionSpare' }
  498. } */
  499. ],
  500. columnsFee: [
  501. {
  502. title: '序号',
  503. dataIndex: 'index',
  504. customRender: (text, record, index) => {
  505. return `${index + 1}`
  506. }
  507. },
  508. {
  509. title: '费用金额',
  510. dataIndex: 'fee',
  511. customRender: (text, record, index) => {
  512. return this.BaseTool.Amount.formatter(text)
  513. }
  514. },
  515. {
  516. title: '费用类别',
  517. dataIndex: 'type',
  518. customRender: (text, record, index) => {
  519. return this.BaseTool.Object.getField(this.typeMap, text)
  520. }
  521. },
  522. {
  523. title: '费用原因',
  524. dataIndex: 'reason'
  525. },
  526. {
  527. title: '费用描述',
  528. dataIndex: 'descripition'
  529. },
  530. {
  531. title: '备注',
  532. dataIndex: 'remark'
  533. },
  534. {
  535. title: '操作',
  536. key: 'action',
  537. width: '200px',
  538. align: 'center',
  539. scopedSlots: { customRender: 'action' }
  540. }
  541. ],
  542. columnsVerifyRecord: [
  543. {
  544. title: '序号',
  545. dataIndex: 'index',
  546. width: '70px',
  547. customRender: (text, record, index) => {
  548. return `${index + 1}`
  549. }
  550. },
  551. {
  552. title: '审核人',
  553. dataIndex: 'createdUserName',
  554. width: '100px'
  555. },
  556. {
  557. title: '审核时间',
  558. dataIndex: 'createdTime',
  559. width: '150px'
  560. },
  561. {
  562. title: '审核类别',
  563. dataIndex: 'type',
  564. ellipsis: true,
  565. width: '100px',
  566. customRender: (text, record, index) => {
  567. if (text === 1) {
  568. return '维修审核'
  569. } else if (text === 2) {
  570. return '报修审核'
  571. }
  572. }
  573. },
  574. {
  575. title: '审核状态',
  576. dataIndex: 'status',
  577. ellipsis: true,
  578. width: '100px',
  579. customRender: (text, record, index) => {
  580. if (text === 1) {
  581. return '审核通过'
  582. } else if (text === 2) {
  583. return '审核拒绝'
  584. }
  585. }
  586. },
  587. {
  588. title: '审核意见',
  589. dataIndex: 'dataRemark',
  590. ellipsis: true,
  591. width: '150px'
  592. },
  593. {
  594. title: '操作',
  595. key: 'action',
  596. width: '200px',
  597. align: 'center',
  598. scopedSlots: { customRender: 'action' }
  599. }
  600. ],
  601. columnsRecord: [
  602. {
  603. title: '序号',
  604. dataIndex: 'index',
  605. width: '70px',
  606. customRender: (text, record, index) => {
  607. return `${index + 1}`
  608. }
  609. },
  610. {
  611. title: '维修人',
  612. dataIndex: 'createdUserName',
  613. ellipsis: true,
  614. width: '150px'
  615. },
  616. {
  617. title: '维修时间',
  618. dataIndex: 'createdTime',
  619. width: '150px'
  620. },
  621. {
  622. title: '结束时间',
  623. dataIndex: 'updateTime',
  624. width: '150px'
  625. },
  626. {
  627. title: '维修时长',
  628. dataIndex: 'repairHours',
  629. ellipsis: true,
  630. width: '100px'
  631. },
  632. /* {
  633. title: '维修建议',
  634. dataIndex: 'opinion',
  635. ellipsis: true,
  636. width: '150px'
  637. },
  638. {
  639. title: '维修描述',
  640. dataIndex: 'dataRemark',
  641. ellipsis: true,
  642. width: '150px'
  643. }, */
  644. {
  645. title: '操作',
  646. key: 'action',
  647. width: '200px',
  648. align: 'center',
  649. scopedSlots: { customRender: 'action' }
  650. }
  651. ],
  652. columnsRepairResolve: [
  653. {
  654. title: '序号',
  655. dataIndex: 'index',
  656. width: '70px',
  657. customRender: (text, record, index) => {
  658. return `${index + 1}`
  659. }
  660. },
  661. {
  662. title: '维修建议',
  663. dataIndex: 'opinion',
  664. width: '200px'
  665. },
  666. {
  667. title: '方案提供者',
  668. dataIndex: 'createdUserName',
  669. width: '120px'
  670. },
  671. {
  672. title: '方案提供时间',
  673. dataIndex: 'createdTime',
  674. ellipsis: true,
  675. width: '150px'
  676. },
  677. {
  678. title: '操作',
  679. key: 'action',
  680. width: '200px',
  681. align: 'center',
  682. scopedSlots: { customRender: 'action' }
  683. }
  684. ],
  685. columnsReason: [
  686. {
  687. title: '序号',
  688. dataIndex: 'index',
  689. width: '70px',
  690. customRender: (text, record, index) => {
  691. return `${index + 1}`
  692. }
  693. },
  694. {
  695. title: '分析时间',
  696. dataIndex: 'analyzeTime',
  697. width: '150px'
  698. },
  699. {
  700. title: '故障现象',
  701. dataIndex: 'problemDesc',
  702. ellipsis: true,
  703. width: '150px'
  704. },
  705. {
  706. title: '检查处理过程',
  707. dataIndex: 'checkProcess',
  708. ellipsis: true,
  709. width: '150px'
  710. },
  711. {
  712. title: '改进措施类别',
  713. dataIndex: 'type',
  714. ellipsis: true,
  715. width: '150px',
  716. customRender: (text, record, index) => {
  717. return this.BaseTool.Object.getField(this.typeReasonMap, text)
  718. }
  719. },
  720. {
  721. title: '改进内容',
  722. dataIndex: 'changeRepairPlanContent',
  723. ellipsis: true,
  724. width: '250px'
  725. },
  726. {
  727. title: '操作',
  728. key: 'action',
  729. width: '200px',
  730. align: 'center',
  731. scopedSlots: { customRender: 'action' }
  732. }
  733. ],
  734. typeReasonMap: {},
  735. model: {
  736. 'id': null,
  737. 'sbId': null,
  738. 'partId': null,
  739. 'repairUserId': null,
  740. 'needStop': null,
  741. 'category': null,
  742. 'no': null,
  743. 'source': null,
  744. 'applyTime': null,
  745. 'level': null,
  746. 'content': null,
  747. 'status': null,
  748. 'remark': null,
  749. 'updateTime': null,
  750. 'createdUserId': null,
  751. 'updateUserId': null,
  752. 'createdUserName': null,
  753. 'sbName': null,
  754. 'partName': null,
  755. 'limitHours': null,
  756. 'limitDate': null,
  757. 'updateUserName': null,
  758. 'repairFormVO': null,
  759. 'repairCheckVO': null,
  760. 'checkUserName': null,
  761. 'remarkTwo': null,
  762. 'repairMinutes': null,
  763. 'repairDeptId': null,
  764. 'userId': null,
  765. 'sbCph': null,
  766. 'actualUser': null,
  767. 'dispatchUserId': null
  768. }
  769. }
  770. },
  771. created () {
  772. // 下拉框map
  773. this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
  774. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
  775. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
  776. this.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
  777. this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
  778. this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  779. this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
  780. this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
  781. this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIRE_ACTION)
  782. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
  783. this.typeReasonMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_TYPE)
  784. this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
  785. },
  786. methods: {
  787. base (record) {
  788. this.visible = true
  789. this.showSbFlag = false
  790. this.modalTitle = '详情'
  791. this.model = record
  792. this.activeKey = 'a'
  793. const sbId = record.sbId
  794. if (sbId) {
  795. fetchSbInfo({ id: sbId }).then(res => {
  796. this.sbInfo = res.data
  797. this.showSbFlag = true
  798. })
  799. }
  800. if (record.repairMinutes === null) {
  801. this.model.repairMinutes = '?'
  802. }
  803. this.init()
  804. },
  805. init () {
  806. queryRepairProject({ repairId: this.model.id }).then(res => {
  807. this.data = res.data
  808. })
  809. selectLongYanListByRepairId({ id: this.model.id }).then(res => {
  810. this.dataSpare = res.data
  811. })
  812. queryRepairFee({ repairId: this.model.id }).then(res => {
  813. this.dataFee = res.data
  814. })
  815. queryRepairReason({ repairId: this.model.id }).then(res => {
  816. this.dataReason = res.data
  817. })
  818. queryRepairRecord({ objId: this.model.id, remark: 'repair_record' }).then(res => {
  819. this.dataRecord = res.data.rows
  820. })
  821. queryRepairRecord({ objId: this.model.id, pageSize: 20, remark: 'repair_status_record' }).then(res => {
  822. this.repairStatus = res.data.rows
  823. })
  824. queryRepairRecord({ objId: this.model.id, remark: 'repair_verify_record' }).then(res => {
  825. this.dataVerifyRecord = res.data.rows
  826. })
  827. getRepairSchemePage({ repairId: this.model.id }).then(res => {
  828. this.dataRepairResolve = res.data.rows
  829. })
  830. },
  831. handleViewBom (record) {
  832. this.visible = false
  833. const modal = this.$refs.detailSbBomModal
  834. modal.base(this.sbInfo)
  835. },
  836. handleViewCheck (record) {
  837. this.visible = false
  838. const modal = this.$refs.detailSbCheckModal
  839. modal.base(this.sbInfo)
  840. },
  841. handleCancel () {
  842. this.visible = false
  843. this.current = 0
  844. this.confirmLoading = false
  845. this.$emit('ok')
  846. },
  847. handleOkUp (num) {
  848. if (num === 1) {
  849. this.handleOk()
  850. } else {
  851. this.handleCancel()
  852. }
  853. },
  854. handleAddSpare () {
  855. const id = this.model.sbId
  856. const routeUrl = this.$router.resolve({ path: '/spare/used/record', query: { id: id } })
  857. window.open(routeUrl.href, '_blank')
  858. },
  859. receive () {
  860. this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING
  861. receive(this.model).then(() => {
  862. })
  863. },
  864. batchDeleteFee (id) {
  865. let ids = []
  866. if (this.BaseTool.String.isBlank(id)) {
  867. const length = this.selectedRows.length
  868. if (length === 0) {
  869. this.$message.info('请选择要删除的记录')
  870. return
  871. }
  872. ids = this.selectedRows.map(item => item.id)
  873. } else {
  874. ids = [id]
  875. }
  876. deleteRepairFees(ids).then(res => {
  877. this.$message.info('删除成功')
  878. this.handleOk()
  879. })
  880. },
  881. handleOut () {
  882. const modal = this.$refs.outForm
  883. modal.base(null, this.model)
  884. },
  885. handleTransfer () {
  886. const modal = this.$refs.transferForm
  887. modal.base(this.model)
  888. },
  889. handleAddFee () {
  890. const modal = this.$refs.feeForm
  891. modal.base(null, this.model)
  892. },
  893. handleEditFee (record) {
  894. fetchRepairFee({ id: record.id }).then(res => {
  895. const modal = this.$refs.feeForm
  896. const data = res.data
  897. data.repairNo = this.model.no
  898. modal.base(data, this.model)
  899. })
  900. },
  901. handleViewFee (record) {
  902. fetchRepairFee({ id: record.id }).then(res => {
  903. const modal = this.$refs.feeDetail
  904. modal.base(res.data)
  905. })
  906. },
  907. handleAddRepairResolve () {
  908. const modal = this.$refs.resolveBaseForm
  909. modal.base({ repairId: this.model.id, repairNo: this.model.no, errorContent: this.model.content, sbId: this.model.sbId })
  910. },
  911. handleAddRepairResolves () {
  912. const modal = this.$refs.schemeLibrary
  913. modal.base(this.model)
  914. },
  915. handleViewRepairResolve (record) {
  916. this.visible = false
  917. fetchRepairScheme({ id: record.id }).then(res => {
  918. const modal = this.$refs.resolveDetail
  919. modal.base(res.data)
  920. })
  921. },
  922. handleEditRepairResolve (record) {
  923. fetchRepairScheme({ id: record.id }).then(res => {
  924. const modal = this.$refs.resolveBaseForm
  925. const data = res.data
  926. modal.base(data)
  927. })
  928. },
  929. handleViewRecord (record) {
  930. this.visible = false
  931. fetchCustomDataForRepairRecord({ id: record.id }).then(res => {
  932. const modal = this.$refs.detailRepairRecord
  933. modal.base(res.data)
  934. })
  935. },
  936. handleViewTicket () {
  937. this.visible = false
  938. fetchRepairTicketRecord({ id: this.model.id }).then(res => {
  939. const modal = this.$refs.ticketForm
  940. modal.base(res.data)
  941. })
  942. },
  943. handleVerifyRecord (record) {
  944. this.visible = false
  945. fetchCustomDataForRepairRecord({ id: record.id }).then(res => {
  946. const modal = this.$refs.detailCheckNew
  947. modal.base(res.data)
  948. })
  949. },
  950. batchDeleteReason (id) {
  951. let ids = []
  952. if (this.BaseTool.String.isBlank(id)) {
  953. const length = this.selectedRows.length
  954. if (length === 0) {
  955. this.$message.info('请选择要删除的记录')
  956. return
  957. }
  958. ids = this.selectedRows.map(item => item.id)
  959. } else {
  960. ids = [id]
  961. }
  962. deleteRepairReasons(ids).then(res => {
  963. this.$message.info('删除成功')
  964. this.handleOk()
  965. this.$refs.table.clearSelected()
  966. })
  967. },
  968. handleAddReason () {
  969. const modal = this.$refs.reasonForm
  970. this.visible = false
  971. modal.base(null, this.model)
  972. },
  973. handleEditReason (record) {
  974. fetchRepairReason({ id: record.id }).then(res => {
  975. const modal = this.$refs.reasonForm
  976. this.visible = false
  977. modal.base(res.data, this.model)
  978. })
  979. },
  980. handleCopyReason (record) {
  981. fetchRepairReason({ id: record.id }).then(res => {
  982. const modal = this.$refs.reasonForm
  983. this.visible = false
  984. res.data.id = null
  985. modal.base(res.data, this.model)
  986. })
  987. },
  988. handleViewReason (record) {
  989. fetchRepairReason({ id: record.id }).then(res => {
  990. const modal = this.$refs.reasonDetail
  991. modal.base(res.data)
  992. })
  993. },
  994. handleApprove () {
  995. approve(this.model).then(() => {
  996. this.$message.info('操作成功')
  997. this.handleOk()
  998. })
  999. },
  1000. receiveRepair () {
  1001. const params = {}
  1002. params.id = this.model.id
  1003. params.repairDeptId = this.model.repairDeptId
  1004. params.applyTime = this.model.applyTime
  1005. params.userId = this.model.userId
  1006. params.no = this.model.no
  1007. receiveRepair(params).then(() => {
  1008. this.$message.info('接单成功')
  1009. this.handleOk()
  1010. })
  1011. },
  1012. reportRepair () {
  1013. const params = {}
  1014. params.id = this.model.id
  1015. params.repairDeptId = this.model.repairDeptId
  1016. params.applyTime = this.model.applyTime
  1017. params.userId = this.model.userId
  1018. params.no = this.model.no
  1019. params.sbId = this.model.sbId
  1020. params.sbCph = this.model.sbCph
  1021. params.actualUser = this.model.actualUser
  1022. params.content = this.model.content
  1023. params.repairUserId = this.model.repairUserId
  1024. params.remark = this.model.remark
  1025. params.reportHandleType = 2 // 维修上报
  1026. getSelfRole().then(res => {
  1027. const modal = this.$refs.reportUpForm
  1028. params.roleType = res.data
  1029. modal.base(params)
  1030. })
  1031. },
  1032. handleReportRepair () {
  1033. const params = {}
  1034. params.id = this.model.id
  1035. params.repairDeptId = this.model.repairDeptId
  1036. params.applyTime = this.model.applyTime
  1037. params.userId = this.model.userId
  1038. params.no = this.model.no
  1039. params.sbId = this.model.sbId
  1040. params.sbCph = this.model.sbCph
  1041. params.actualUser = this.model.actualUser
  1042. params.content = this.model.content
  1043. params.repairUserId = this.model.repairUserId
  1044. params.remark = this.model.remarkTwo
  1045. params.reportHandleType = 1 // 处理维修上报
  1046. getSelfRole().then(res => {
  1047. const modal = this.$refs.reportUpForm
  1048. params.roleType = res.data
  1049. modal.base(params)
  1050. })
  1051. },
  1052. handleEditRecord (record) {
  1053. this.visible = false
  1054. fetchCustomDataForRepairRecord({ id: record.id }).then(res => {
  1055. const modal = this.$refs.repairRecordForm
  1056. modal.base(res.data)
  1057. })
  1058. },
  1059. handleReturn () {
  1060. const modal = this.$refs.checkForm
  1061. modal.base(this.model, 1)
  1062. },
  1063. handleOk () {
  1064. this.loading = true
  1065. fetchRepairApplicationForm({ id: this.model.id }).then(res => {
  1066. this.loading = false
  1067. this.model = res.data
  1068. this.visible = true
  1069. })
  1070. this.init()
  1071. },
  1072. handleResolveOk () {
  1073. this.loading = true
  1074. this.visible = true
  1075. getRepairSchemePage({ repairId: this.model.id }).then(res => {
  1076. this.loading = false
  1077. this.dataRepairResolve = res.data.rows
  1078. })
  1079. },
  1080. handleRepairRecordOk () {
  1081. this.loading = true
  1082. this.visible = true
  1083. queryRepairRecord({ objId: this.model.id, remark: 'repair_record' }).then(res => {
  1084. this.loading = false
  1085. this.dataRecord = res.data.rows
  1086. })
  1087. fetchRepairApplicationForm({ id: this.model.id }).then(res => {
  1088. this.model = res.data
  1089. })
  1090. },
  1091. handleVerifyRecordOk () {
  1092. this.loading = true
  1093. this.visible = true
  1094. queryRepairRecord({ objId: this.model.id, remark: 'repair_verify_record' }).then(res => {
  1095. this.loading = false
  1096. this.dataVerifyRecord = res.data.rows
  1097. })
  1098. },
  1099. handleFinish () {
  1100. const modal = this.$refs.finishForm
  1101. modal.base(this.model)
  1102. },
  1103. handleExamine () {
  1104. const modal = this.$refs.checkForm
  1105. modal.base(this.model, 2)
  1106. },
  1107. handleDispatch () {
  1108. const modal = this.$refs.dispatchForm
  1109. modal.base(this.model)
  1110. },
  1111. handleAssign () {
  1112. const modal = this.$refs.assignForm
  1113. modal.base(this.model)
  1114. },
  1115. handleSparePick () {
  1116. const modal = this.$refs.baseModal
  1117. modal.base(null, { repairId: this.model.id, repairNo: this.model.no, reason: '维修领用' })
  1118. },
  1119. changeTab (activeKey) {
  1120. this.activeKey = activeKey
  1121. if (this.activeKey === 'a' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
  1122. const modal = this.$refs.sparePartUsedSelectTable
  1123. modal.handleOk()
  1124. return
  1125. }
  1126. if (this.activeKey === 'b' && this.BaseTool.Object.isNotBlank(this.$refs.sparePickFormSelectTable)) {
  1127. const modal = this.$refs.sparePickFormSelectTable
  1128. modal.handleOk()
  1129. }
  1130. },
  1131. handleView (record) {
  1132. fetchRepairProject({ id: record.id }).then(res => {
  1133. const modal = this.$refs.detailRepairProjectModal
  1134. modal.base(res.data)
  1135. })
  1136. },
  1137. handleEdit (record) {
  1138. const modal = this.$refs.editForm
  1139. modal.base(this.model)
  1140. },
  1141. handleRepairProjectAdd () {
  1142. this.$refs.baseRepairProjectModal.base({ repairId: this.model.id })
  1143. },
  1144. batchDelete (id) {
  1145. let ids = []
  1146. if (this.BaseTool.String.isBlank(id)) {
  1147. if (length === 0) {
  1148. this.$message.info('请选择要删除的记录')
  1149. return
  1150. }
  1151. ids = this.selectedRows.map(item => item.id)
  1152. } else {
  1153. ids = [id]
  1154. }
  1155. deleteRepairProjects(ids).then(res => {
  1156. this.$message.info('删除成功')
  1157. this.handleOk()
  1158. })
  1159. },
  1160. handleSpareSelect () {
  1161. this.$refs.spareSelectModal.base({}, { yt: 1 })
  1162. },
  1163. updateLongYanSpare (num) {
  1164. this.$refs.longYanSelectSpareForm.base({ isSpecial: num }, this.model)
  1165. },
  1166. /* handleSpareLongYanSelect (num) {
  1167. this.$refs.spareLongYanSelectModal.base({ isSpecial: num }, { isSpecial: num })
  1168. },
  1169. handleSpareLongYanSelected (record, keys, rows) {
  1170. const data = []
  1171. for (let i = 0; i < rows.length; i++) {
  1172. data.push({ sparePeriod: rows[i].sparePeriod, isSpecial: record.isSpecial, sbId: this.model.sbId, spareId: rows[i].id, repairId: this.model.id, num: 1, spareName: rows[i].spareName, ggxh: rows[i].ggxh })
  1173. }
  1174. addLongYanSparePartUsedBatch(data)
  1175. .then((response) => {
  1176. this.$message.info('更换成功')
  1177. this.handleOk()
  1178. }).catch(() => {
  1179. this.confirmLoading = false
  1180. })
  1181. }, */
  1182. handleSpareSelected (record, keys, rows) {
  1183. const data = []
  1184. for (let i = 0; i < rows.length; i++) {
  1185. data.push({ sbId: this.model.sbId, spareId: rows[i].id, repairId: this.model.id, num: 1, price: rows[i].initialValue, totalPrice: rows[i].initialValue })
  1186. }
  1187. addSparePartUsedBatch(data)
  1188. .then((response) => {
  1189. this.$message.info('添加成功')
  1190. this.handleOk()
  1191. }).catch(() => {
  1192. this.confirmLoading = false
  1193. })
  1194. },
  1195. batchDeleteSpare (id) {
  1196. let ids = []
  1197. if (this.BaseTool.String.isBlank(id)) {
  1198. if (length === 0) {
  1199. this.$message.info('请选择要删除的记录')
  1200. return
  1201. }
  1202. ids = this.selectedRows.map(item => item.id)
  1203. } else {
  1204. ids = [id]
  1205. }
  1206. deleteSparePartUseds(ids).then(res => {
  1207. this.$message.info('删除成功')
  1208. this.handleOk()
  1209. })
  1210. },
  1211. handleEditSpare (record) {
  1212. const modal = this.$refs.baseFormForRepair
  1213. modal.base(record)
  1214. },
  1215. updateSpare (record) {
  1216. updateSpare(record).then(res => {
  1217. this.$message.info('更换成功')
  1218. selectSparePartUsedListBySbId({ id: this.model.sbId }).then(res => {
  1219. this.dataSpare = res.data
  1220. })
  1221. })
  1222. },
  1223. handleSpareStoreSelect (isSpecial) {
  1224. this.$refs.spareStoreSelectModal.base({}, { repairFlag: 1, storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
  1225. },
  1226. handleSpareStoreSelected (record, keys, rows) {
  1227. const data = []
  1228. for (let i = 0; i < rows.length; i++) {
  1229. data.push({ isSpecial: record.isSpecial, sbId: this.model.sbId, spareId: rows[i].spareId, repairNo: this.model.no, repairId: this.model.id, num: 1, price: rows[i].price, totalPrice: rows[i].price, startDate: BaseTool.Date.formatter(new Date(), BaseTool.Date.PICKER_NORM_DATE_PATTERN) })
  1230. }
  1231. if (record.isSpecial === 1) {
  1232. updateSpare(data)
  1233. .then((response) => {
  1234. this.$message.info('更换成功')
  1235. this.handleOk()
  1236. }).catch(() => {
  1237. this.confirmLoading = false
  1238. })
  1239. } else {
  1240. addSparePartUsedBatch(data)
  1241. .then((response) => {
  1242. this.$message.info('更换成功')
  1243. this.handleOk()
  1244. }).catch(() => {
  1245. this.confirmLoading = false
  1246. })
  1247. }
  1248. },
  1249. onSelectChange (selectedRowKeys) {
  1250. console.log('selectedRowKeys changed: ', selectedRowKeys)
  1251. this.selectedRowKeys = selectedRowKeys
  1252. },
  1253. inited (viewer) {
  1254. this.$viewer = viewer
  1255. }
  1256. }
  1257. }
  1258. </script>
  1259. <style lang="less" scoped>
  1260. .gutter-box{
  1261. height: 350px;
  1262. }
  1263. .gutter-color{
  1264. background: #fff;
  1265. border: 1px solid #DDDDDD;
  1266. }
  1267. .gutter-btn{
  1268. height: 165px;
  1269. display: flex;
  1270. flex-direction: column;
  1271. justify-content: center;
  1272. align-items: center;
  1273. font-size: 50px;
  1274. color:#333;
  1275. &:hover{
  1276. cursor: pointer;
  1277. }
  1278. }
  1279. .act{
  1280. color:#3462FD;
  1281. }
  1282. .main{
  1283. margin-top:30px;
  1284. }
  1285. .title{
  1286. font-size: 28px;
  1287. font-family: PingFang SC;
  1288. font-weight: 500;
  1289. color: #3462FD;
  1290. padding:10px 42px;
  1291. border-bottom: 1px solid #DDDDDD;
  1292. }
  1293. .btn{
  1294. position: fixed;
  1295. bottom: 50px;
  1296. width: 100%;
  1297. display: flex;
  1298. justify-content: center;
  1299. }
  1300. .center{
  1301. display: flex;
  1302. justify-content: center;
  1303. align-items: center;
  1304. }
  1305. ::-webkit-scrollbar { width: 0; height: 0; color: transparent; }
  1306. </style>