DetailRepair.vue 59 KB

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