DetailRepair.vue 61 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634
  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]" :sub-title="item.realUserName" :description="BaseTool.Date.formatter(item.createdTime , BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2) " />
  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.positionNo }}</a-descriptions-item>
  77. <a-descriptions-item label="设备名称">{{ model.sbName }}</a-descriptions-item>
  78. <a-descriptions-item label="报修车间">{{ model.sbPositionName }}</a-descriptions-item>
  79. <a-descriptions-item label="车间具体位置">{{ model.sbCph }}</a-descriptions-item>
  80. <a-descriptions-item label="工单类别">{{ BaseTool.Object.getField(planFlagMap,model.category) }}</a-descriptions-item>
  81. <a-descriptions-item label="报修状态"><badge :text="BaseTool.Object.getField(statusMap,model.status)" :status="DictCache.COLOR.REPAIR_APPLICATION_FORM_STATUS[model.status]"/></a-descriptions-item>
  82. <a-descriptions-item label="报修时间">{{ BaseTool.Date.formatter(model.applyTime, BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2) }}</a-descriptions-item>
  83. <a-descriptions-item label="报修人">{{ model.actualUser }}</a-descriptions-item>
  84. <a-descriptions-item v-if="model.category!==1" label="工作优选权">{{ BaseTool.Object.getField(levelMap,model.level) }}</a-descriptions-item>
  85. <a-descriptions-item v-else label="计划性维修级别">{{ model.repairPlanLevel }}</a-descriptions-item>
  86. <a-descriptions-item label="送修部门">{{ model.name }}</a-descriptions-item>
  87. <a-descriptions-item label="维修工程师" >{{ model.checkUserName }}</a-descriptions-item>
  88. <a-descriptions-item v-if="model.category===2 && model.verifyRepairUserId != null && model.verifyRepairUserId != ''" label="报修审批人" >{{ userRepairList.find(item=>item.userId==model.verifyRepairUserId).realName }}</a-descriptions-item>
  89. <a-descriptions-item label="报修类型" >{{ repairFormTypeMap[model.repairFormType] }}</a-descriptions-item>
  90. <a-descriptions-item label="委托内容描述" :span="3"> <span v-html="model.content "></span><a-divider type="vertical" /><a @click="handleEdit(model)">编辑</a> </a-descriptions-item>
  91. <a-descriptions-item label="报修图片" :span="3">
  92. <div v-if="model.applicationFileList != null && model.applicationFileList.length > 0">
  93. <viewer :images="model.applicationFileList" @inited="inited" ref="viewer" :index="1" >
  94. <img
  95. v-for="item in model.applicationFileList"
  96. :src="item.url"
  97. :key="item.id"
  98. class="image"
  99. width="200px"
  100. style="margin:10px;">
  101. </viewer></div>
  102. <div v-if="model.applicationFileList == null || model.applicationFileList.length === 0"> 暂无</div>
  103. </a-descriptions-item>
  104. <a-descriptions-item label="报修文件">
  105. <a v-for="item in model.reportFileList" :key="item.id" :href="item.url" target="downloadFile" :download="item.name">{{ item.name }}</a>
  106. </a-descriptions-item>
  107. </a-descriptions>
  108. </div>
  109. </div>
  110. <div class="main gutter-color" v-show="current == 1">
  111. <div class="title">维修数据</div>
  112. <div>
  113. <a-descriptions :column="2" bordered>
  114. <a-descriptions-item label="维修开始时间">{{ BaseTool.Date.formatter(model.repairStartTime, BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2) }}</a-descriptions-item>
  115. <a-descriptions-item label="维修结束时间">{{ BaseTool.Date.formatter(model.repairEndTime, BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2) }}</a-descriptions-item>
  116. <a-descriptions-item label="维修耗时">{{ model.repairMinutes }}小时</a-descriptions-item>
  117. <a-descriptions-item label="当前维修人">{{ model.repairUserName }}</a-descriptions-item>
  118. </a-descriptions>
  119. </div>
  120. </div>
  121. <div class="main gutter-color" v-show="current == 2">
  122. <div class="title">审核记录</div>
  123. <a-table
  124. :data-source="dataVerifyRecord"
  125. :columns="columnsVerifyRecord"
  126. tableLayout="auto"
  127. rowKey="id">
  128. <span slot="action" slot-scope="record">
  129. <template>
  130. <a @click="handleVerifyRecord(record)">审核详情</a>
  131. </template>
  132. </span>
  133. </a-table>
  134. </div>
  135. <div class="main gutter-color" v-show="current == 3">
  136. <a-tabs default-active-key="1" @change="callback">
  137. <a-tab-pane key="1" tab="维修记录">
  138. <a-table
  139. :data-source="dataRecord"
  140. :columns="columnsRecord"
  141. tableLayout="auto"
  142. rowKey="id">
  143. <span slot="action" slot-scope="record">
  144. <template>
  145. <a @click="handleViewRecord(record)">维修详情</a>
  146. <operation-button @click="handleEditRecord(record)" >编辑</operation-button>
  147. </template>
  148. </span>
  149. </a-table>
  150. </a-tab-pane>
  151. <a-tab-pane key="2" tab="转派记录">
  152. <a-table
  153. :data-source="redeployRecord"
  154. :columns="redeploycolumnsRecord"
  155. tableLayout="auto"
  156. rowKey="id">
  157. </a-table>
  158. </a-tab-pane>
  159. </a-tabs>
  160. </div>
  161. <div class="main gutter-color" v-show="current == 4">
  162. <div class="title">备件清单</div>
  163. <div style="margin:20px;margin-left: 40%;" class="table-operator" v-if="$auth('repair-application-forms-finish')">
  164. <!-- <a-button type="primary" @click="updateLongYanSpare(1)">
  165. <a-icon type="plus"/>
  166. 更换关联备件
  167. </a-button> -->
  168. <a-divider type="vertical" />
  169. <a-button type="primary" @click="handleOutStroe(2)">
  170. <a-icon type="plus"/>
  171. 备件BOM出库
  172. </a-button>
  173. <!-- <a-divider type="vertical" />
  174. <a-button type="primary" @click="handleAddSpare()">
  175. <a-icon type="plus"/>
  176. 添加专用备件
  177. </a-button>-->
  178. <a-divider type="vertical" />
  179. <a-button type="primary" @click="handleOutStroe(0)">
  180. <a-icon type="plus"/>
  181. 仓库领料
  182. </a-button>
  183. </div>
  184. <a-table
  185. :data-source="dataSpare"
  186. :columns="columnsOutStore"
  187. tableLayout="auto"
  188. rowKey="id">
  189. <span slot="status" slot-scope="text">
  190. <badge
  191. :status="DictCache.COLOR.OUT_STORE_FORM_STATUS[text]"
  192. :text="outStoreStatusMap[text]" />
  193. </span>
  194. <span slot="actionSpare" slot-scope="record">
  195. <template>
  196. <a-popconfirm v-if=" userInfo.realName===record.createdUserName&& record.status==0" title="是否提交审核?" @confirm="updateStore(record.id)">
  197. <a>提交审核</a>
  198. </a-popconfirm>
  199. </template>
  200. </span>
  201. <div slot="expandedRowRender" slot-scope="record" style="margin: 0">
  202. <a-table
  203. :data-source="record.detailList"
  204. :columns="columnsSpare"
  205. tableLayout="auto"
  206. :pagination="false"
  207. rowKey="id">
  208. </a-table>
  209. </div>
  210. </a-table>
  211. </div>
  212. <div class="main gutter-color" v-show="current == 5">
  213. <div class="title">费用清单</div>
  214. <div style="margin:20px;margin-left:45%;" class="table-operator" v-if="$auth('repair-application-forms-finish')">
  215. <a-button type="primary" @click="handleAddFee">
  216. <a-icon type="plus"/>
  217. 费用单
  218. </a-button>
  219. </div>
  220. <a-table
  221. :data-source="dataFee"
  222. :columns="columnsFee"
  223. tableLayout="auto"
  224. rowKey="id">
  225. <span slot="action" slot-scope="record">
  226. <template>
  227. <a @click="handleViewFee(record)">查看</a>
  228. <operation-button
  229. @click="handleEditFee(record)" >修改</operation-button>
  230. <operation-button
  231. title="确认删除该笔费用?"
  232. @confirm="batchDeleteFee(record.id)" >删除</operation-button>
  233. </template>
  234. </span>
  235. </a-table>
  236. </div>
  237. <div class="main gutter-color" v-show="current == 6">
  238. <div class="title">维修报告</div>
  239. <div style="margin:20px;margin-left:45%;" class="table-operator" v-if="$auth('repair-application-forms-finish') && ((dataReason === null) || (dataReason.length===0))">
  240. <a-button type="primary" @click="handleAddReason">
  241. <a-icon type="plus"/>
  242. 维修报告
  243. </a-button>
  244. </div>
  245. <a-table
  246. :data-source="dataReason"
  247. :columns="columnsReason"
  248. :scroll="{x: 1, y: BaseTool.Constant.scrollY }"
  249. rowKey="id">
  250. <span slot="action" slot-scope="record">
  251. <template>
  252. <a @click="handleViewReason(record)">查看</a>
  253. <operation-button
  254. @click="handleEditReason(record)" >修改</operation-button>
  255. <!-- <operation-button
  256. 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)"
  257. @click="handleCopyReason(record)" >复制</operation-button>-->
  258. <operation-button
  259. :type="2"
  260. title="确认删除该记录?"
  261. @confirm="batchDeleteReason(record.id)" >删除</operation-button>
  262. </template>
  263. </span>
  264. </a-table>
  265. </div>
  266. <div class="main gutter-color" v-show="current == 7">
  267. <div class="title">维修方案</div>
  268. <div style="margin:20px;margin-left:45%;" class="table-operator" >
  269. <a-button v-if="$auth('repair-repairs-add')" type="primary" @click="handleAddRepairResolve">
  270. <a-icon type="plus"/>
  271. 添加方案
  272. </a-button>
  273. <a-button style="margin-left:30px;" v-if="$auth('repair-repairs-add')" type="primary" @click="handleAddRepairResolves">
  274. <a-icon type="read" />
  275. 方案库
  276. </a-button>
  277. </div>
  278. <a-table
  279. :data-source="dataRepairResolve"
  280. :columns="columnsRepairResolve"
  281. tableLayout="auto"
  282. rowKey="id">
  283. <span slot="action" slot-scope="record">
  284. <template>
  285. <a @click="handleViewRepairResolve(record)">方案详情</a>
  286. <operation-button
  287. @click="handleEditRepairResolve(record)" >修改</operation-button>
  288. </template>
  289. </span>
  290. </a-table>
  291. </div>
  292. </div>
  293. <div class="btn" v-if="model.category!==1">
  294. <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ALLOCATED === model.status " title="是否要接单?" @confirm="receiveRepair">
  295. <a-button style="margin-left: 8px" type="default">接单</a-button>
  296. </a-popconfirm>
  297. <a-button
  298. v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.RECEIVED === model.status ||
  299. DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.HANG_UP === model.status || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.REPAIR_FAIL === model.status ||
  300. DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.DISPATCH_REPAIR === model.status "
  301. style="margin-left: 8px"
  302. type="default"
  303. @click="nonPlanToPlan">转计划维修</a-button>
  304. <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>
  305. <a-button v-if="(DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status )" style="margin-left: 16px" type="default" @click="reportRepair">维修上报</a-button>
  306. <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>
  307. <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 || DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.MM_REPAIR_FAIL === model.status)" style="margin-left: 8px" type="default" @click="handleTransfer()">转派</a-button>
  308. <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>
  309. <a-button v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleViewTicket()">维修票证</a-button>
  310. <a-popconfirm v-if="$auth('repair-application-forms-finish') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status)" title="是否要结单?" @confirm="handleExamine">
  311. <a-button style="margin-left: 8px" type="default">结单</a-button>
  312. </a-popconfirm>
  313. <a-popconfirm v-if="$auth('repair-application-forms-approve') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" title="是否要接受?" @confirm="handleApprove">
  314. <a-button :loading="confirmLoading" style="margin-left: 8px" type="default">接受</a-button>
  315. </a-popconfirm>
  316. <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.FINISHED === model.status" title="是否要关闭工单?" @confirm="handleClose">
  317. <a-button :loading="confirmLoading" style="margin-left: 8px" type="default">关闭工单</a-button>
  318. </a-popconfirm>
  319. <a-popconfirm v-if="$auth('repair-application-forms-reback') && DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.NOT_ACCEPTANCE === model.status" title="是否要拒绝?" @confirm="handleReturn">
  320. <a-button style="margin-left: 8px" type="error">拒绝</a-button>
  321. </a-popconfirm>
  322. <a-button v-show=" model.status===10" style="margin-left: 8px" type="primary" @click="recoverPause">挂起解除</a-button>
  323. <a-button v-show="model.level!==6 && model.status!==6 && model.status!==14 && model.status!==21&& model.status!==23" style="margin-left: 8px" type="primary" @click="handleBigRepair">转大修</a-button>
  324. <a-button v-show="model.status===21" style="margin-left: 8px" type="primary" @click="handleCheckBigRepair">大修审核</a-button>
  325. <a-button v-show="model.status===23" style="margin-left: 8px" type="primary" @click="handleAgain">再次报修</a-button>
  326. <a-popconfirm
  327. v-show=" model.status===1||model.status===9"
  328. title="确定撤回?"
  329. ok-text="是"
  330. cancel-text="否"
  331. @confirm="handleRepairCancel"
  332. style="margin-left: 8px"
  333. >
  334. <a-button type="primary" >撤回</a-button>
  335. </a-popconfirm>
  336. <a-button v-show=" model.status===24" style="margin-left: 8px" type="primary" @click="repairCheck">报修审核</a-button>
  337. <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
  338. </div>
  339. <div class="btn" v-else>
  340. <a-button style="margin-left: 8px" type="primary" @click="handleCancel">返回</a-button>
  341. <a-button v-show="model.status===15 || model.status===17 || model.status === 19 " style="margin-left: 8px" type="primary" @click="handleCheck">审核</a-button>
  342. <a-button v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.CALLER_REPAIR_VERIFY_SUCCESS_THREE === model.status " style="margin-left: 16px" type="default" @click="handleAssign">派单</a-button>
  343. <a-button v-show="model.status===20" style="margin-left: 8px" type="primary" @click="handleCheck">再次发起审核</a-button>
  344. <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>
  345. <a-button v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING === model.status" style="margin-left: 8px" type="default" @click="handleViewTicket()">维修票证</a-button>
  346. <a-popconfirm v-if="$auth('repair-application-forms-finish') && (DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.WAIT_SUBMIT === model.status)" title="是否要结单?" @confirm="handleExamine">
  347. <a-button style="margin-left: 8px" type="default">结单</a-button>
  348. </a-popconfirm>
  349. <a-popconfirm v-if="DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.FINISHED === model.status" title="是否要关闭工单?" @confirm="handleClose">
  350. <a-button :loading="confirmLoading" style="margin-left: 8px" type="default">关闭工单</a-button>
  351. </a-popconfirm>
  352. </div>
  353. </div>
  354. <check-form ref="checkForm" @ok="handleOk" />
  355. <base-out-form ref="outForm" @ok="handleCancel" />
  356. <finish-form ref="finishForm" @ok="handleRepairRecordOk" />
  357. <dispatch-form ref="dispatchForm" @ok="handleCancel" />
  358. <assign-form ref="assignForm" @ok="handleCancel" />
  359. <spare-pick-base-form ref="baseModal" @ok="handleOk"/>
  360. <base-form-for-repair ref="baseFormForRepair" @ok="handleOk" />
  361. <spare-store-select-modal ref="spareStoreSelectModal" @selected="handleSpareStoreSelected"/>
  362. <fee-base-form ref="feeForm" @ok="handleOk" />
  363. <fee-detail ref="feeDetail" @ok="handleOk" />
  364. <reason-base-form ref="reasonForm" @ok="handleOk" />
  365. <reason-detail ref="reasonDetail" @ok="handleOk" />
  366. <detail-sb-bom ref="detailSbBomModal" @ok="handleOk"/>
  367. <detail-sb-check ref="detailSbCheckModal" @ok="handleOk"/>
  368. <base-form ref="baseRepairProjectModal" @ok="handleOk"/>
  369. <detail ref="detailRepairProjectModal"/>
  370. <edit-form ref="editForm" @okEdit="handleOk" />
  371. <resolve-base-form ref="resolveBaseForm" @ok="handleResolveOk"/>
  372. <resolve-detail ref="resolveDetail" @ok="handleResolveOk"/>
  373. <detail-repair-record ref="detailRepairRecord" @ok="handleRepairRecordOk"/>
  374. <transfer-form ref="transferForm" @ok="handleOk"/>
  375. <detail-check-new ref="detailCheckNew" @ok="handleVerifyRecordOk"/>
  376. <repair-record-form ref="repairRecordForm" @ok="handleRepairRecordOk" />
  377. <report-up-form ref="reportUpForm" @ok="handleOk" @okk="handleOk" />
  378. <ticket-form ref="ticketForm" @ok="handleOk" />
  379. <longYanSelectSpareForm ref="longYanSelectSpareForm" @ok="handleOk"/>
  380. <scheme-library ref="schemeLibrary" @ok="handleOk"/>
  381. <PlanCheckForm ref="planCheckForm" @ok="handleOk"/>
  382. <OutStroeForm ref="outStroeForm" @ok="handleOk" />
  383. <ReportPauseForm ref="reportPauseForm" @ok="handleOk" />
  384. <BigRepairForm ref="bigRepairForm" @ok="handleOk" />
  385. <CheckBigRepairForm ref="checkBigRepairForm" @ok="handleOk" />
  386. <ToPlanForm ref="toPlanForm" @ok="handleOk" />
  387. <AddForm ref="addForm" @ok="handleOk"/>
  388. <AuditFrom2 ref="auditFrom2" @ok="handleOk"/>
  389. </div>
  390. </template>
  391. <script>
  392. // import { stringify } from 'qs'
  393. import DetailList from '@/components/tools/DetailList'
  394. import { fetchRepairApplicationForm, approve, receive, receiveRepair, closeRepair, repairCancel } from '@/api/repair/application-form'
  395. import CheckForm from './CheckForm'
  396. import ToPlanForm from './ToPlanForm'
  397. import BaseOutForm from './BaseOutForm'
  398. import FinishForm from './FinishForm'
  399. import PlanCheckForm from './PlanCheckForm'
  400. import CheckBigRepairForm from './CheckBigRepairForm'
  401. import EditForm from './RemarkForm'
  402. import DispatchForm from './DispatchForm'
  403. import AssignForm from './AssignForm'
  404. import SchemeLibrary from './SchemeLibrary'
  405. import SparePickBaseForm from '../../../store/sparepickform/modules/BaseForm'
  406. import SparePartUsedSelectTable from '@/views/sqarepartmanage/sparepartused/modules/SparePartUsedSelectTable'
  407. import SparePickFormSelectTable from '@/views/store/sparepickform/modules/SparePickFormSelectTable'
  408. import RepairProjectSelectModal from '@/views/repair/repairproject/modules/RepairProjectSelectModal'
  409. import { queryRepairProject, fetchRepairProject, deleteRepairProjects } from '@/api/repair/repairproject'
  410. import SparePartInfoSelectModal from '@/views/sqarepartmanage/sparepartinfo/modules/SparePartInfoSelectModal'
  411. import BaseFormForRepair from '@/views/sqarepartmanage/sparepartused/modules/BaseFormForRepair'
  412. import { selectSparePartUsedListBySbId, addSparePartUsedBatch, deleteSparePartUseds, updateSpare, selectLongYanListByRepairId } from '@/api/sqarepartmanage/sparepartused'
  413. import SpareStoreSelectModal from '@/views/store/sparestore/modules/SpareStoreSelectModal'
  414. import BaseTool from '@/utils/tool'
  415. import FeeBaseForm from '@/views/repair/fee/modules/BaseForm'
  416. import FeeDetail from '@/views/repair/fee/modules/Detail'
  417. import { deleteRepairFees, fetchRepairFee, queryRepairFee } from '@/api/repair/fee'
  418. import { getSelfRole } from '@/api/upms/role'
  419. import ReasonBaseForm from '@/views/repair/repair-reason/modules/BaseForm'
  420. import ReasonDetail from '@/views/repair/repair-reason/modules/Detail'
  421. import { deleteRepairReasons, fetchRepairReason, queryRepairReason } from '@/api/repair/repair-reason'
  422. import { queryRepairRecord, fetchCustomDataForRepairRecord, fetchRepairTicketRecord, getSpareList } from '@/api/customize/fieldTemplateData'
  423. import DetailSbBom from '@/views/sb/modelbom/modules/DetailSbBom'
  424. import DetailSbCheck from '@/views/check/checkstandard/modules/DetailSbCheck'
  425. import { fetchSbInfo } from '@/api/sb/info'
  426. import { getRepairSchemePage, fetchRepairScheme, getRepairSpare } from '@/api/repair/repair'
  427. import BaseForm from '@/views/repair/repairproject/modules/BaseForm'
  428. import Detail from '@/views/repair/repairproject/modules/Detail'
  429. import ResolveBaseForm from '@/views/repair/repair/modules/BaseForm'
  430. import ResolveDetail from '@/views/repair/repair/modules/Detail'
  431. import DetailRepairRecord from './DetailRepairRecord'
  432. import TransferForm from './TransferForm'
  433. import DetailCheckNew from './DetailCheckNew'
  434. import RepairRecordForm from './RepairRecordForm'
  435. import ReportUpForm from './ReportUpForm'
  436. import TicketForm from './TicketForm'
  437. import LongYanSelectSpareForm from './LongYanSelectSpareForm'
  438. import ReportPauseForm from './ReportPauseForm'
  439. import BigRepairForm from './BigRepairForm'
  440. import { startSbInfoScrap } from '@/api/activiti/activiti-sb-scrap'
  441. import AuditFrom2 from './AuditFrom2.vue'
  442. import AddForm from './BaseForm.vue'
  443. import OutStroeForm from '@/views/store/outstoreform/modules/BaseFormYY.vue'
  444. import { queryRepairUser } from '@/api/upms/user'
  445. const DetailListItem = DetailList.Item
  446. export default {
  447. name: 'RepairApplicationFormDetail',
  448. components: {
  449. CheckForm,
  450. SchemeLibrary,
  451. EditForm,
  452. DetailList,
  453. DetailSbCheck,
  454. DetailSbBom,
  455. ReasonBaseForm,
  456. ReasonDetail,
  457. DetailListItem,
  458. FinishForm,
  459. PlanCheckForm,
  460. BaseOutForm,
  461. DispatchForm,
  462. FeeDetail,
  463. AssignForm,
  464. FeeBaseForm,
  465. SparePickBaseForm,
  466. SparePartUsedSelectTable,
  467. SparePickFormSelectTable,
  468. RepairProjectSelectModal,
  469. SparePartInfoSelectModal,
  470. BaseFormForRepair,
  471. SpareStoreSelectModal,
  472. BaseForm,
  473. Detail,
  474. ResolveBaseForm,
  475. ResolveDetail,
  476. DetailRepairRecord,
  477. TransferForm,
  478. DetailCheckNew,
  479. RepairRecordForm,
  480. ReportUpForm,
  481. TicketForm,
  482. LongYanSelectSpareForm,
  483. OutStroeForm,
  484. ReportPauseForm,
  485. BigRepairForm,
  486. CheckBigRepairForm,
  487. ToPlanForm,
  488. AddForm,
  489. AuditFrom2
  490. },
  491. data () {
  492. return {
  493. confirmLoading: false,
  494. mdl: {},
  495. current: 0,
  496. modalTitle: null,
  497. needStopMap: {},
  498. userInfo: this.$store.getters.userInfo,
  499. planFlagMap: {},
  500. dispatchList: [],
  501. visible: false,
  502. showSbFlag: false,
  503. sbInfo: {},
  504. // 下拉框map
  505. sourceMap: {},
  506. typeMap: {},
  507. outStoreMap: {},
  508. repairStatus: [],
  509. userRepairList: [],
  510. levelMap: {},
  511. descripitionMap: {},
  512. repairFormTypeMap: {},
  513. selectedRowKeys: [],
  514. statusMap: {},
  515. outStoreStatusMap: {},
  516. repairProjectMap: {},
  517. repairTechnologyMap: {},
  518. activeKey: 'a',
  519. data: [],
  520. dataSpare: [],
  521. dataFee: [],
  522. dataReason: [],
  523. dataRepairResolve: [],
  524. dataRecord: [],
  525. redeployRecord: [],
  526. dataVerifyRecord: [],
  527. // 表头
  528. columns: [
  529. {
  530. title: '序号',
  531. dataIndex: 'index',
  532. customRender: (text, record, index) => {
  533. return `${index + 1}`
  534. }
  535. },
  536. {
  537. title: '维修内容',
  538. dataIndex: 'name'
  539. },
  540. {
  541. title: '操作',
  542. key: 'action',
  543. width: '200px',
  544. align: 'center',
  545. scopedSlots: { customRender: 'action' }
  546. }
  547. ],
  548. columnsSpare: [
  549. // {
  550. // title: '序号',
  551. // dataIndex: 'index',
  552. // customRender: (text, record, index) => {
  553. // return index + 1
  554. // }
  555. // },
  556. {
  557. title: '名称',
  558. dataIndex: 'spareName'
  559. },
  560. // {
  561. // title: '编号',
  562. // dataIndex: 'no'
  563. // },
  564. {
  565. title: '规格',
  566. dataIndex: 'ggxh'
  567. },
  568. // {
  569. // title: '批次',
  570. // dataIndex: 'cbatch'
  571. // },
  572. {
  573. title: '数量',
  574. dataIndex: 'num'
  575. },
  576. // {
  577. // title: '库存',
  578. // dataIndex: 'storeNum',
  579. // width: 150
  580. // },
  581. {
  582. title: '单位',
  583. dataIndex: 'unit'
  584. },
  585. {
  586. title: '仓库',
  587. dataIndex: 'storeName'
  588. },
  589. {
  590. title: '货架号',
  591. dataIndex: 'storePosition'
  592. },
  593. {
  594. title: '备注',
  595. dataIndex: 'remark',
  596. width: 150
  597. }
  598. ],
  599. columnsOutStore: [
  600. {
  601. title: '序号',
  602. dataIndex: 'index',
  603. customRender: (text, record, index) => {
  604. return `${index + 1}`
  605. }
  606. },
  607. {
  608. title: '出库单号',
  609. dataIndex: 'outNo'
  610. },
  611. {
  612. title: '用友单号',
  613. dataIndex: 'yyId'
  614. },
  615. {
  616. title: '出库类型',
  617. dataIndex: 'type',
  618. customRender: (text, record, index) => {
  619. return this.BaseTool.Object.getField(this.outStoreMap, text)
  620. }
  621. },
  622. {
  623. title: '状态',
  624. dataIndex: 'status',
  625. scopedSlots: { customRender: 'status' }
  626. },
  627. {
  628. title: '领用日期',
  629. dataIndex: 'createdTime'
  630. },
  631. {
  632. title: '领用人',
  633. dataIndex: 'createdUserName'
  634. },
  635. {
  636. title: '仓库',
  637. dataIndex: 'storeName'
  638. },
  639. {
  640. title: '操作',
  641. key: 'action',
  642. width: '200px',
  643. align: 'center',
  644. scopedSlots: { customRender: 'actionSpare' }
  645. }
  646. ],
  647. columnsFee: [
  648. {
  649. title: '序号',
  650. dataIndex: 'index',
  651. customRender: (text, record, index) => {
  652. return `${index + 1}`
  653. }
  654. },
  655. {
  656. title: '费用金额',
  657. dataIndex: 'fee',
  658. customRender: (text, record, index) => {
  659. return this.BaseTool.Amount.formatter(text)
  660. }
  661. },
  662. {
  663. title: '费用类别',
  664. dataIndex: 'type',
  665. customRender: (text, record, index) => {
  666. return this.BaseTool.Object.getField(this.typeMap, text)
  667. }
  668. },
  669. {
  670. title: '费用原因',
  671. dataIndex: 'reason'
  672. },
  673. {
  674. title: '费用描述',
  675. dataIndex: 'descripition'
  676. },
  677. {
  678. title: '备注',
  679. dataIndex: 'remark'
  680. },
  681. {
  682. title: '操作',
  683. key: 'action',
  684. width: '200px',
  685. align: 'center',
  686. scopedSlots: { customRender: 'action' }
  687. }
  688. ],
  689. columnsVerifyRecord: [
  690. {
  691. title: '序号',
  692. dataIndex: 'index',
  693. width: '70px',
  694. customRender: (text, record, index) => {
  695. return `${index + 1}`
  696. }
  697. },
  698. {
  699. title: '审核人',
  700. dataIndex: 'createdUserName',
  701. width: '100px'
  702. },
  703. {
  704. title: '审核时间',
  705. dataIndex: 'createdTime',
  706. width: '150px',
  707. customRender: (text, record, index) => {
  708. return this.BaseTool.Date.formatter(text, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2)
  709. }
  710. },
  711. {
  712. title: '审核类别',
  713. dataIndex: 'type',
  714. ellipsis: true,
  715. width: '100px',
  716. customRender: (text, record, index) => {
  717. if (text === 1 || text == 3) {
  718. return '维修审核'
  719. } else if (text === 2) {
  720. return '报修审核'
  721. }
  722. }
  723. },
  724. {
  725. title: '审核状态',
  726. dataIndex: 'status',
  727. ellipsis: true,
  728. width: '100px',
  729. customRender: (text, record, index) => {
  730. if (text === 1) {
  731. return '审核通过'
  732. } else if (text === 2) {
  733. return '审核拒绝'
  734. }
  735. }
  736. },
  737. {
  738. title: '审核意见',
  739. dataIndex: 'dataRemark',
  740. ellipsis: true,
  741. width: '150px'
  742. },
  743. {
  744. title: '操作',
  745. key: 'action',
  746. width: '200px',
  747. align: 'center',
  748. scopedSlots: { customRender: 'action' }
  749. }
  750. ],
  751. redeploycolumnsRecord: [
  752. {
  753. title: '序号',
  754. dataIndex: 'index',
  755. width: '70px',
  756. customRender: (text, record, index) => {
  757. return `${index + 1}`
  758. }
  759. },
  760. {
  761. title: '转派人',
  762. dataIndex: 'createdUserName',
  763. ellipsis: true,
  764. width: '150px'
  765. },
  766. {
  767. title: '转派时间',
  768. dataIndex: 'createdTime',
  769. width: '150px',
  770. customRender: (text, record, index) => {
  771. return this.BaseTool.Date.formatter(text, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2)
  772. }
  773. },
  774. {
  775. title: '转派备注',
  776. dataIndex: 'dataRemark',
  777. ellipsis: true,
  778. width: '150px'
  779. }
  780. ],
  781. columnsRecord: [
  782. {
  783. title: '序号',
  784. dataIndex: 'index',
  785. width: '70px',
  786. customRender: (text, record, index) => {
  787. return `${index + 1}`
  788. }
  789. },
  790. {
  791. title: '维修人',
  792. dataIndex: 'createdUserName',
  793. ellipsis: true,
  794. width: '150px'
  795. },
  796. {
  797. title: '维修时间',
  798. dataIndex: 'createdTime',
  799. width: '150px',
  800. customRender: (text, record, index) => {
  801. return this.BaseTool.Date.formatter(text, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2)
  802. }
  803. },
  804. {
  805. title: '结束时间',
  806. dataIndex: 'updateTime',
  807. width: '150px',
  808. customRender: (text, record, index) => {
  809. return this.BaseTool.Date.formatter(text, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2)
  810. }
  811. },
  812. {
  813. title: '维修时长',
  814. dataIndex: 'repairHours',
  815. ellipsis: true,
  816. width: '100px'
  817. },
  818. /* {
  819. title: '维修建议',
  820. dataIndex: 'opinion',
  821. ellipsis: true,
  822. width: '150px'
  823. },
  824. {
  825. title: '维修描述',
  826. dataIndex: 'dataRemark',
  827. ellipsis: true,
  828. width: '150px'
  829. }, */
  830. {
  831. title: '操作',
  832. key: 'action',
  833. width: '200px',
  834. align: 'center',
  835. scopedSlots: { customRender: 'action' }
  836. }
  837. ],
  838. columnsRepairResolve: [
  839. {
  840. title: '序号',
  841. dataIndex: 'index',
  842. width: '70px',
  843. customRender: (text, record, index) => {
  844. return `${index + 1}`
  845. }
  846. },
  847. {
  848. title: '维修建议',
  849. dataIndex: 'opinion',
  850. width: '200px'
  851. },
  852. {
  853. title: '方案提供者',
  854. dataIndex: 'createdUserName',
  855. width: '120px'
  856. },
  857. {
  858. title: '方案提供时间',
  859. dataIndex: 'createdTime',
  860. ellipsis: true,
  861. width: '150px',
  862. customRender: (text, record, index) => {
  863. return this.BaseTool.Date.formatter(text, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2)
  864. }
  865. },
  866. {
  867. title: '操作',
  868. key: 'action',
  869. width: '200px',
  870. align: 'center',
  871. scopedSlots: { customRender: 'action' }
  872. }
  873. ],
  874. columnsReason: [
  875. {
  876. title: '序号',
  877. dataIndex: 'index',
  878. width: '70px',
  879. customRender: (text, record, index) => {
  880. return `${index + 1}`
  881. }
  882. },
  883. {
  884. title: '分析时间',
  885. dataIndex: 'analyzeTime',
  886. width: '150px',
  887. customRender: (text, record, index) => {
  888. return this.BaseTool.Date.formatter(text, this.BaseTool.Date.PICKER_NORM_DATETIME_PATTERN2)
  889. }
  890. },
  891. {
  892. title: '故障部位',
  893. dataIndex: 'sbPartId',
  894. width: '150px'
  895. },
  896. {
  897. title: '故障现象',
  898. dataIndex: 'problemDesc',
  899. ellipsis: true,
  900. width: '150px'
  901. },
  902. {
  903. title: '检查处理过程',
  904. dataIndex: 'checkProcess',
  905. ellipsis: true,
  906. width: '150px'
  907. },
  908. {
  909. title: '改进措施类别',
  910. dataIndex: 'type',
  911. ellipsis: true,
  912. width: '150px',
  913. customRender: (text, record, index) => {
  914. return this.BaseTool.Object.getField(this.typeReasonMap, text)
  915. }
  916. },
  917. {
  918. title: '改进内容',
  919. dataIndex: 'changeRepairPlanContent',
  920. ellipsis: true,
  921. width: '250px'
  922. },
  923. {
  924. title: '操作',
  925. key: 'action',
  926. width: '200px',
  927. align: 'center',
  928. scopedSlots: { customRender: 'action' }
  929. }
  930. ],
  931. typeReasonMap: {},
  932. model: {
  933. 'id': null,
  934. 'sbId': null,
  935. 'partId': null,
  936. 'repairUserId': null,
  937. 'needStop': null,
  938. 'category': null,
  939. 'no': null,
  940. 'source': null,
  941. 'applyTime': null,
  942. 'level': null,
  943. 'content': null,
  944. 'status': null,
  945. 'remark': null,
  946. 'updateTime': null,
  947. 'createdUserId': null,
  948. 'updateUserId': null,
  949. 'createdUserName': null,
  950. 'sbName': null,
  951. 'partName': null,
  952. 'limitHours': null,
  953. 'limitDate': null,
  954. 'updateUserName': null,
  955. 'repairFormVO': null,
  956. 'repairCheckVO': null,
  957. 'checkUserName': null,
  958. 'remarkTwo': null,
  959. 'repairMinutes': null,
  960. 'repairDeptId': null,
  961. 'userId': null,
  962. 'sbCph': null,
  963. 'actualUser': null,
  964. 'dispatchUserId': null,
  965. 'parentSbNo': null,
  966. 'sbPositionName': null,
  967. 'selfParentNo': null,
  968. 'positionNo': null
  969. }
  970. }
  971. },
  972. created () {
  973. // 下拉框map
  974. this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.LEVEL_TYPE)
  975. this.repairFormTypeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_TYPE)
  976. this.sourceMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_SOURCE)
  977. // this.levelMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_LEVEL)
  978. this.statusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_STATUS)
  979. this.statusRepairMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FORM_STATUS)
  980. this.statusCheckMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_CHECK_STATUS)
  981. this.needStopMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.YES_NO)
  982. this.repairProjectMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_PROJECT_TYPE)
  983. this.repairTechnologyMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_TECHNOLOGY_TYPE)
  984. this.descripitionMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIRE_ACTION)
  985. this.typeMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_FEE_TYPE)
  986. this.typeReasonMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_REASON_TYPE)
  987. this.planFlagMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.REPAIR_APPLICATION_FORM_CATEGORY)
  988. this.outStoreMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_TYPE)
  989. this.outStoreStatusMap = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.OUT_STORE_FORM_STATUS)
  990. queryRepairUser({ roleType: 3 }).then(res => {
  991. this.userRepairList = res.data
  992. })
  993. this.tableOption()
  994. },
  995. methods: {
  996. base (record) {
  997. this.visible = true
  998. this.showSbFlag = false
  999. this.modalTitle = '详情'
  1000. this.model = record
  1001. this.activeKey = 'a'
  1002. const sbId = record.sbId
  1003. console.log(2222222, this.userRepairList)
  1004. if (sbId) {
  1005. fetchSbInfo({ id: sbId }).then(res => {
  1006. this.sbInfo = res.data
  1007. this.showSbFlag = true
  1008. })
  1009. }
  1010. if (record.repairMinutes === null) {
  1011. this.model.repairMinutes = '?'
  1012. }
  1013. this.init()
  1014. },
  1015. init () {
  1016. queryRepairProject({ repairId: this.model.id }).then(res => {
  1017. this.data = res.data
  1018. })
  1019. // selectLongYanListByRepairId({ id: this.model.id }).then(res => {
  1020. // this.dataSpare = res.data
  1021. // })
  1022. getRepairSpare({ id: this.model.id }).then(res => {
  1023. console.log(res)
  1024. console.log(this.userInfo)
  1025. this.dataSpare = res.data
  1026. })
  1027. queryRepairFee({ repairId: this.model.id }).then(res => {
  1028. this.dataFee = res.data
  1029. })
  1030. queryRepairReason({ repairId: this.model.id }).then(res => {
  1031. this.dataReason = res.data // 维修报告
  1032. })
  1033. queryRepairRecord({ objId: this.model.id, remark: 'repair_record' }).then(res => {
  1034. this.dataRecord = res.data.rows
  1035. })
  1036. queryRepairRecord({ objId: this.model.id, remark: 'dispatch_record' }).then(res => {
  1037. this.redeployRecord = res.data.rows
  1038. })
  1039. queryRepairRecord({ objId: this.model.id, pageSize: 20, remark: 'repair_status_record' }).then(res => {
  1040. this.repairStatus = res.data.rows
  1041. })
  1042. queryRepairRecord({ objId: this.model.id, remark: 'repair_verify_record' }).then(res => {
  1043. this.dataVerifyRecord = res.data.rows
  1044. })
  1045. getRepairSchemePage({ repairId: this.model.id }).then(res => {
  1046. this.dataRepairResolve = res.data.rows // 维修方案
  1047. })
  1048. },
  1049. handleViewBom (record) {
  1050. this.visible = false
  1051. const modal = this.$refs.detailSbBomModal
  1052. modal.base(this.sbInfo)
  1053. },
  1054. handleViewCheck (record) {
  1055. this.visible = false
  1056. const modal = this.$refs.detailSbCheckModal
  1057. modal.base(this.sbInfo)
  1058. },
  1059. handleCancel () {
  1060. this.visible = false
  1061. this.current = 0
  1062. this.confirmLoading = false
  1063. this.$emit('ok')
  1064. },
  1065. handleOkUp (num) {
  1066. if (num === 1) {
  1067. this.handleOk()
  1068. } else {
  1069. this.handleCancel()
  1070. }
  1071. },
  1072. handleAddSpare () {
  1073. const id = this.model.sbId
  1074. const routeUrl = this.$router.resolve({ path: '/spare/used/record', query: { id: id } })
  1075. window.open(routeUrl.href, '_blank')
  1076. },
  1077. receive () {
  1078. this.model.status = this.DictCache.VALUE.REPAIR_APPLICATION_FORM_STATUS.PROCESSING
  1079. receive(this.model).then(() => {
  1080. })
  1081. },
  1082. nonPlanToPlan () {
  1083. const modal = this.$refs.toPlanForm
  1084. modal.base(this.model)
  1085. },
  1086. handleClose () {
  1087. // 判断是否具备关闭工单条件
  1088. if (this.dataReason.length === 0 || this.dataRepairResolve.length === 0) {
  1089. this.$message.error('维修方案或维修报告不能为空')
  1090. return
  1091. }
  1092. const params = { id: this.model.id, category: this.model.category }
  1093. closeRepair(params).then(res => {
  1094. this.$message.info('操作成功')
  1095. this.handleOk()
  1096. })
  1097. },
  1098. batchDeleteFee (id) {
  1099. let ids = []
  1100. if (this.BaseTool.String.isBlank(id)) {
  1101. const length = this.selectedRows.length
  1102. if (length === 0) {
  1103. this.$message.info('请选择要删除的记录')
  1104. return
  1105. }
  1106. ids = this.selectedRows.map(item => item.id)
  1107. } else {
  1108. ids = [id]
  1109. }
  1110. deleteRepairFees(ids).then(res => {
  1111. this.$message.info('删除成功')
  1112. this.handleOk()
  1113. })
  1114. },
  1115. handleOut () {
  1116. const modal = this.$refs.outForm
  1117. modal.base(null, this.model)
  1118. },
  1119. handleTransfer () {
  1120. getSelfRole().then(res => {
  1121. const modal = this.$refs.transferForm
  1122. modal.base(this.model, res.data)
  1123. })
  1124. },
  1125. handleAddFee () {
  1126. const modal = this.$refs.feeForm
  1127. modal.base(null, this.model)
  1128. },
  1129. handleEditFee (record) {
  1130. fetchRepairFee({ id: record.id }).then(res => {
  1131. const modal = this.$refs.feeForm
  1132. const data = res.data
  1133. data.repairNo = this.model.no
  1134. modal.base(data, this.model)
  1135. })
  1136. },
  1137. handleViewFee (record) {
  1138. fetchRepairFee({ id: record.id }).then(res => {
  1139. const modal = this.$refs.feeDetail
  1140. modal.base(res.data)
  1141. })
  1142. },
  1143. handleAddRepairResolve () {
  1144. const modal = this.$refs.resolveBaseForm
  1145. modal.base({ repairId: this.model.id, repairNo: this.model.no, errorContent: this.model.content, sbId: this.model.sbId })
  1146. },
  1147. recoverPause () {
  1148. getSelfRole().then(res => {
  1149. const modal = this.$refs.reportPauseForm
  1150. modal.base(this.model, res.data)
  1151. })
  1152. },
  1153. handleAddRepairResolves () {
  1154. const modal = this.$refs.schemeLibrary
  1155. modal.base(this.model)
  1156. },
  1157. handleViewRepairResolve (record) {
  1158. this.visible = false
  1159. fetchRepairScheme({ id: record.id }).then(res => {
  1160. const modal = this.$refs.resolveDetail
  1161. modal.base(res.data)
  1162. })
  1163. },
  1164. handleEditRepairResolve (record) {
  1165. fetchRepairScheme({ id: record.id }).then(res => {
  1166. const modal = this.$refs.resolveBaseForm
  1167. const data = res.data
  1168. modal.base(data)
  1169. })
  1170. },
  1171. handleViewRecord (record) {
  1172. this.visible = false
  1173. fetchCustomDataForRepairRecord({ id: record.id }).then(res => {
  1174. getSpareList({ repairFormId: this.model.id, createdUserId: record.createdUserId }).then(response => {
  1175. const modal = this.$refs.detailRepairRecord
  1176. modal.base(res.data, response.data)
  1177. })
  1178. })
  1179. },
  1180. handleViewTicket () {
  1181. this.visible = false
  1182. fetchRepairTicketRecord({ id: this.model.id }).then(res => {
  1183. const modal = this.$refs.ticketForm
  1184. modal.base(res.data, this.model.id)
  1185. })
  1186. },
  1187. handleVerifyRecord (record) {
  1188. this.visible = false
  1189. fetchCustomDataForRepairRecord({ id: record.id }).then(res => {
  1190. const modal = this.$refs.detailCheckNew
  1191. modal.base(res.data)
  1192. })
  1193. },
  1194. batchDeleteReason (id) {
  1195. let ids = []
  1196. if (this.BaseTool.String.isBlank(id)) {
  1197. const length = this.selectedRows.length
  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. deleteRepairReasons(ids).then(res => {
  1207. this.$message.info('删除成功')
  1208. this.handleOk()
  1209. this.$refs.table.clearSelected()
  1210. })
  1211. },
  1212. handleAddReason () {
  1213. const modal = this.$refs.reasonForm
  1214. this.visible = false
  1215. modal.base(null, this.model)
  1216. },
  1217. handleBigRepair () {
  1218. const modal = this.$refs.bigRepairForm
  1219. modal.base(this.model)
  1220. },
  1221. handleCheckBigRepair () {
  1222. const modal = this.$refs.checkBigRepairForm
  1223. modal.base(this.model)
  1224. },
  1225. handleEditReason (record) {
  1226. fetchRepairReason({ id: record.id }).then(res => {
  1227. const modal = this.$refs.reasonForm
  1228. this.visible = false
  1229. modal.base(res.data, this.model)
  1230. })
  1231. },
  1232. handleCopyReason (record) {
  1233. fetchRepairReason({ id: record.id }).then(res => {
  1234. const modal = this.$refs.reasonForm
  1235. this.visible = false
  1236. res.data.id = null
  1237. modal.base(res.data, this.model)
  1238. })
  1239. },
  1240. handleViewReason (record) {
  1241. fetchRepairReason({ id: record.id }).then(res => {
  1242. const modal = this.$refs.reasonDetail
  1243. modal.base(res.data)
  1244. })
  1245. },
  1246. handleApprove () {
  1247. approve(this.model).then(() => {
  1248. this.$message.info('操作成功')
  1249. this.handleOk()
  1250. })
  1251. },
  1252. receiveRepair () {
  1253. const params = {}
  1254. params.id = this.model.id
  1255. params.repairDeptId = this.model.repairDeptId
  1256. params.applyTime = this.model.applyTime
  1257. params.userId = this.model.userId
  1258. params.no = this.model.no
  1259. params.category = this.model.category
  1260. receiveRepair(params).then(() => {
  1261. this.$message.info('接单成功')
  1262. this.handleOk()
  1263. })
  1264. },
  1265. reportRepair () {
  1266. const params = {}
  1267. params.id = this.model.id
  1268. params.repairDeptId = this.model.repairDeptId
  1269. params.applyTime = this.model.applyTime
  1270. params.userId = this.model.userId
  1271. params.no = this.model.no
  1272. params.sbId = this.model.sbId
  1273. params.sbCph = this.model.sbCph
  1274. params.actualUser = this.model.actualUser
  1275. params.content = this.model.content
  1276. params.category = this.model.category
  1277. params.repairUserId = this.model.repairUserId
  1278. params.remark = this.model.remark
  1279. params.reportHandleType = 2 // 维修上报
  1280. getSelfRole().then(res => {
  1281. const modal = this.$refs.reportUpForm
  1282. params.roleType = res.data
  1283. modal.base(params)
  1284. })
  1285. },
  1286. handleReportRepair () {
  1287. const params = {}
  1288. params.id = this.model.id
  1289. params.repairDeptId = this.model.repairDeptId
  1290. params.applyTime = this.model.applyTime
  1291. params.userId = this.model.userId
  1292. params.no = this.model.no
  1293. params.sbId = this.model.sbId
  1294. params.sbCph = this.model.sbCph
  1295. params.actualUser = this.model.actualUser
  1296. params.content = this.model.content
  1297. params.category = this.model.category
  1298. params.repairUserId = this.model.repairUserId
  1299. params.remark = this.model.remarkTwo
  1300. params.reportHandleType = 1 // 处理维修上报
  1301. getSelfRole().then(res => {
  1302. const modal = this.$refs.reportUpForm
  1303. params.roleType = res.data
  1304. modal.base(params)
  1305. })
  1306. },
  1307. handleEditRecord (record) {
  1308. this.visible = false
  1309. fetchCustomDataForRepairRecord({ id: record.id }).then(res => {
  1310. const modal = this.$refs.repairRecordForm
  1311. modal.base(res.data)
  1312. })
  1313. },
  1314. handleReturn () {
  1315. const modal = this.$refs.checkForm
  1316. modal.base(this.model, 1)
  1317. },
  1318. handleOutStroe (type) {
  1319. this.visible = false
  1320. const modal = this.$refs.outStroeForm
  1321. modal.base({ outFlag: 1 }, this.model, type)
  1322. },
  1323. handleOk () {
  1324. this.loading = true
  1325. fetchRepairApplicationForm({ id: this.model.id }).then(res => {
  1326. this.loading = false
  1327. this.model = res.data
  1328. this.visible = true
  1329. })
  1330. this.init()
  1331. },
  1332. okEdit (val) {
  1333. this.loading = true
  1334. this.model.content = val
  1335. },
  1336. handleResolveOk () {
  1337. this.loading = true
  1338. this.visible = true
  1339. getRepairSchemePage({ repairId: this.model.id }).then(res => {
  1340. this.loading = false
  1341. this.dataRepairResolve = res.data.rows
  1342. })
  1343. },
  1344. handleRepairRecordOk () {
  1345. this.loading = true
  1346. this.visible = true
  1347. queryRepairRecord({ objId: this.model.id, remark: 'repair_record' }).then(res => {
  1348. this.loading = false
  1349. this.dataRecord = res.data.rows
  1350. })
  1351. fetchRepairApplicationForm({ id: this.model.id }).then(res => {
  1352. this.model = res.data
  1353. })
  1354. },
  1355. handleVerifyRecordOk () {
  1356. this.loading = true
  1357. this.visible = true
  1358. queryRepairRecord({ objId: this.model.id, remark: 'repair_verify_record' }).then(res => {
  1359. this.loading = false
  1360. this.dataVerifyRecord = res.data.rows
  1361. })
  1362. },
  1363. handleFinish () {
  1364. const modal = this.$refs.finishForm
  1365. modal.base(this.model)
  1366. },
  1367. handleExamine () {
  1368. const modal = this.$refs.checkForm
  1369. modal.base(this.model, 2)
  1370. },
  1371. handleDispatch () {
  1372. const modal = this.$refs.dispatchForm
  1373. modal.base(this.model)
  1374. },
  1375. handleAssign () {
  1376. getSelfRole().then(res => {
  1377. const roleType = res.data // 获取当前用户的角色
  1378. if (roleType === 4) {
  1379. const modal = this.$refs.reportUpForm
  1380. const params = {}
  1381. params.id = this.model.id
  1382. params.repairDeptId = this.model.repairDeptId
  1383. params.applyTime = this.model.applyTime
  1384. params.userId = this.model.userId
  1385. params.no = this.model.no
  1386. params.sbId = this.model.sbId
  1387. params.sbCph = this.model.sbCph
  1388. params.actualUser = this.model.actualUser
  1389. params.content = this.model.content
  1390. params.repairUserId = this.model.repairUserId
  1391. params.remark = this.model.remarkTwo
  1392. params.category = this.model.category
  1393. params.reportHandleType = 1 // 处理维修上报
  1394. params.roleType = 4
  1395. modal.base(params)
  1396. } else {
  1397. const modal = this.$refs.assignForm
  1398. modal.base(this.model)
  1399. }
  1400. })
  1401. },
  1402. handleSparePick () {
  1403. const modal = this.$refs.baseModal
  1404. modal.base(null, { repairId: this.model.id, repairNo: this.model.no, reason: '维修领用' })
  1405. },
  1406. changeTab (activeKey) {
  1407. this.activeKey = activeKey
  1408. if (this.activeKey === 'a' && this.BaseTool.Object.isNotBlank(this.$refs.sparePartUsedSelectTable)) {
  1409. const modal = this.$refs.sparePartUsedSelectTable
  1410. modal.handleOk()
  1411. return
  1412. }
  1413. if (this.activeKey === 'b' && this.BaseTool.Object.isNotBlank(this.$refs.sparePickFormSelectTable)) {
  1414. const modal = this.$refs.sparePickFormSelectTable
  1415. modal.handleOk()
  1416. }
  1417. },
  1418. handleView (record) {
  1419. fetchRepairProject({ id: record.id }).then(res => {
  1420. const modal = this.$refs.detailRepairProjectModal
  1421. modal.base(res.data)
  1422. })
  1423. },
  1424. handleEdit (record) {
  1425. const modal = this.$refs.editForm
  1426. modal.base(this.model)
  1427. },
  1428. handleRepairProjectAdd () {
  1429. this.$refs.baseRepairProjectModal.base({ repairId: this.model.id })
  1430. },
  1431. batchDelete (id) {
  1432. let ids = []
  1433. if (this.BaseTool.String.isBlank(id)) {
  1434. if (length === 0) {
  1435. this.$message.info('请选择要删除的记录')
  1436. return
  1437. }
  1438. ids = this.selectedRows.map(item => item.id)
  1439. } else {
  1440. ids = [id]
  1441. }
  1442. deleteRepairProjects(ids).then(res => {
  1443. this.$message.info('删除成功')
  1444. this.handleOk()
  1445. })
  1446. },
  1447. handleSpareSelect () {
  1448. this.$refs.spareSelectModal.base({}, { yt: 1 })
  1449. },
  1450. updateLongYanSpare (num) {
  1451. this.$refs.longYanSelectSpareForm.base({ isSpecial: num }, this.model)
  1452. },
  1453. /* handleSpareLongYanSelect (num) {
  1454. this.$refs.spareLongYanSelectModal.base({ isSpecial: num }, { isSpecial: num })
  1455. },
  1456. handleSpareLongYanSelected (record, keys, rows) {
  1457. const data = []
  1458. for (let i = 0; i < rows.length; i++) {
  1459. 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 })
  1460. }
  1461. addLongYanSparePartUsedBatch(data)
  1462. .then((response) => {
  1463. this.$message.info('更换成功')
  1464. this.handleOk()
  1465. }).catch(() => {
  1466. this.confirmLoading = false
  1467. })
  1468. }, */
  1469. handleSpareSelected (record, keys, rows) {
  1470. const data = []
  1471. for (let i = 0; i < rows.length; i++) {
  1472. data.push({ sbId: this.model.sbId, spareId: rows[i].id, repairId: this.model.id, num: 1, price: rows[i].initialValue, totalPrice: rows[i].initialValue })
  1473. }
  1474. addSparePartUsedBatch(data)
  1475. .then((response) => {
  1476. this.$message.info('添加成功')
  1477. this.handleOk()
  1478. }).catch(() => {
  1479. this.confirmLoading = false
  1480. })
  1481. },
  1482. batchDeleteSpare (id) {
  1483. let ids = []
  1484. if (this.BaseTool.String.isBlank(id)) {
  1485. if (length === 0) {
  1486. this.$message.info('请选择要删除的记录')
  1487. return
  1488. }
  1489. ids = this.selectedRows.map(item => item.id)
  1490. } else {
  1491. ids = [id]
  1492. }
  1493. deleteSparePartUseds(ids).then(res => {
  1494. this.$message.info('删除成功')
  1495. this.handleOk()
  1496. })
  1497. },
  1498. handleEditSpare (record) {
  1499. const modal = this.$refs.baseFormForRepair
  1500. modal.base(record)
  1501. },
  1502. updateSpare (record) {
  1503. updateSpare(record).then(res => {
  1504. this.$message.info('更换成功')
  1505. selectSparePartUsedListBySbId({ id: this.model.sbId }).then(res => {
  1506. this.dataSpare = res.data
  1507. })
  1508. })
  1509. },
  1510. handleSpareStoreSelect (isSpecial) {
  1511. this.$refs.spareStoreSelectModal.base({}, { repairFlag: 1, storeId: this.storeId, isSpecial: isSpecial, sbId: this.model.sbId })
  1512. },
  1513. handleSpareStoreSelected (record, keys, rows) {
  1514. const data = []
  1515. for (let i = 0; i < rows.length; i++) {
  1516. 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) })
  1517. }
  1518. if (record.isSpecial === 1) {
  1519. updateSpare(data)
  1520. .then((response) => {
  1521. this.$message.info('更换成功')
  1522. this.handleOk()
  1523. }).catch(() => {
  1524. this.confirmLoading = false
  1525. })
  1526. } else {
  1527. addSparePartUsedBatch(data)
  1528. .then((response) => {
  1529. this.$message.info('更换成功')
  1530. this.handleOk()
  1531. }).catch(() => {
  1532. this.confirmLoading = false
  1533. })
  1534. }
  1535. },
  1536. onSelectChange (selectedRowKeys) {
  1537. console.log('selectedRowKeys changed: ', selectedRowKeys)
  1538. this.selectedRowKeys = selectedRowKeys
  1539. },
  1540. inited (viewer) {
  1541. this.$viewer = viewer
  1542. },
  1543. handleCheck () {
  1544. const modal = this.$refs.planCheckForm
  1545. modal.base(this.model, this.model.status)
  1546. },
  1547. handleRepairCancel () {
  1548. repairCancel({ id: this.model.id }).then(res => {
  1549. this.$message.info('操作成功!')
  1550. this.handleCancel()
  1551. })
  1552. },
  1553. updateStore (id) {
  1554. const params = {}
  1555. params.id = id
  1556. params.processInstanceId = ''
  1557. params.auditModelName = '仓库审批'
  1558. params.auditModelKey = 'out_store_back'
  1559. startSbInfoScrap(params).then(res => {
  1560. this.$message.info('已提交,请等待主管审核')
  1561. getRepairSpare({ id: this.model.id }).then(res => {
  1562. console.log(res)
  1563. this.dataSpare = res.data
  1564. })
  1565. })
  1566. },
  1567. handleAgain () {
  1568. this.$refs.addForm.base(this.model)
  1569. },
  1570. repairCheck () {
  1571. this.$refs.auditFrom2.base(this.model)
  1572. }
  1573. }
  1574. }
  1575. </script>
  1576. <style lang="less" scoped>
  1577. .gutter-box{
  1578. height: 350px;
  1579. }
  1580. .gutter-color{
  1581. background: #fff;
  1582. border: 1px solid #DDDDDD;
  1583. }
  1584. .gutter-btn{
  1585. height: 165px;
  1586. display: flex;
  1587. flex-direction: column;
  1588. justify-content: center;
  1589. align-items: center;
  1590. font-size: 50px;
  1591. color:#333;
  1592. &:hover{
  1593. cursor: pointer;
  1594. }
  1595. }
  1596. .act{
  1597. color:#3462FD;
  1598. }
  1599. .main{
  1600. margin-top:30px;
  1601. }
  1602. .title{
  1603. font-size: 28px;
  1604. font-family: PingFang SC;
  1605. font-weight: 500;
  1606. color: #3462FD;
  1607. padding:10px 42px;
  1608. border-bottom: 1px solid #DDDDDD;
  1609. }
  1610. .btn{
  1611. position: fixed;
  1612. bottom: 50px;
  1613. width: 100%;
  1614. display: flex;
  1615. justify-content: center;
  1616. }
  1617. .center{
  1618. display: flex;
  1619. justify-content: center;
  1620. align-items: center;
  1621. }
  1622. ::-webkit-scrollbar { width: 0; height: 0; color: transparent; }
  1623. </style>