index.vue 49 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item :label="$t('装置名称')" prop="plantCode">
  5. <el-input
  6. v-model="queryParams.plantCode"
  7. :placeholder="$t('请输入') + $t('装置名称')"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item :label="$t('检查年月')" prop="checkMonth">
  14. <el-date-picker
  15. v-model="queryParams.checkMonth"
  16. type="month"
  17. placeholder="选择日期"
  18. value-format="yyyy-MM"
  19. @keyup.enter.native="handleQuery">
  20. </el-date-picker>
  21. </el-form-item>
  22. <el-form-item :label="$t('审核结果')" prop="approveStatus">
  23. <el-select v-model="queryParams.approveStatus" :placeholder="$t('请选择') + $t('审核结果')" clearable size="small">
  24. <el-option
  25. v-for="dict in approveStatusOptions"
  26. :key="dict.dictValue"
  27. :label="dict.dictLabel"
  28. :value="dict.dictValue"
  29. />
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('搜索') }}</el-button>
  34. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('重置') }}</el-button>
  35. </el-form-item>
  36. </el-form>
  37. <el-row :gutter="10" class="mb8">
  38. <el-col :span="1.5">
  39. <el-button
  40. type="primary"
  41. icon="el-icon-plus"
  42. size="mini"
  43. @click="handleAdd"
  44. v-hasPermi="['sems:month:add']"
  45. >{{ $t('新增') }}
  46. </el-button>
  47. </el-col>
  48. <el-col :span="1.5">
  49. <el-button
  50. type="success"
  51. icon="el-icon-edit"
  52. size="mini"
  53. :disabled="single"
  54. @click="handleUpdate"
  55. v-hasPermi="['sems:month:edit']"
  56. >{{ $t('修改') }}
  57. </el-button>
  58. </el-col>
  59. <el-col :span="1.5">
  60. <el-button
  61. type="danger"
  62. icon="el-icon-delete"
  63. size="mini"
  64. :disabled="multiple"
  65. @click="handleDelete"
  66. v-hasPermi="['sems:month:remove']"
  67. >{{ $t('删除') }}
  68. </el-button>
  69. </el-col>
  70. <!-- <el-col :span="1.5">-->
  71. <!-- <el-button-->
  72. <!-- type="info"-->
  73. <!-- icon="el-icon-upload2"-->
  74. <!-- size="mini"-->
  75. <!-- @click="handleImport"-->
  76. <!-- v-hasPermi="['sems:month:edit']"-->
  77. <!-- >{{ $t('导入') }}</el-button>-->
  78. <!-- </el-col>-->
  79. <!-- <el-col :span="1.5">-->
  80. <!-- <el-button-->
  81. <!-- type="warning"-->
  82. <!-- icon="el-icon-download"-->
  83. <!-- size="mini"-->
  84. <!-- @click="handleExport"-->
  85. <!-- v-hasPermi="['sems:month:export']"-->
  86. <!-- >{{ $t('导出') }}</el-button>-->
  87. <!-- </el-col>-->
  88. <el-col :span="1.5">
  89. <el-button
  90. type="success"
  91. size="mini"
  92. :disabled="multiple"
  93. @click="approveHandle('')"
  94. >{{ $t('申请报告') }}</el-button>
  95. </el-col>
  96. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  97. </el-row>
  98. <el-table v-loading="loading" :data="monthList" @selection-change="handleSelectionChange" :height="clientHeight"
  99. border>
  100. <el-table-column type="selection" width="55" align="center"/>
  101. <el-table-column :label="$t('装置名称')" align="center" prop="plantCode" :show-overflow-tooltip="true"/>
  102. <el-table-column :label="$t('申请状态')" align="center" prop="approveStatus" :formatter="approveStatusFormat"
  103. :show-overflow-tooltip="true"/>
  104. <el-table-column :label="$t('检查年月')" align="center" prop="checkMonth" width="100">
  105. </el-table-column>
  106. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  107. <el-table-column header-align="center" align="center" :label="$t('压力容器')">
  108. <el-table-column :label="$t('容器单元')" align="center" prop="rqUnit" :show-overflow-tooltip="true"/>
  109. <el-table-column :label="$t('容器本体')" align="center" prop="rqSelf" :formatter="rqSelfFormat"/>
  110. <el-table-column :label="$t('安全附件')" align="center" prop="rqSafe" :formatter="rqSafeFormat"/>
  111. <el-table-column :label="$t('安全保护装置')" align="center" prop="rqProtect" :formatter="rqProtectFormat"/>
  112. <el-table-column :label="$t('测量调控装置,紧急切断阀')" align="center" prop="rqControl" :formatter="rqControlFormat"/>
  113. <el-table-column :label="$t('附属仪器仪表')" align="center" prop="rqIns" :formatter="rqInsFormat"/>
  114. <el-table-column :label="$t('有无泄漏')" align="center" prop="rqOut" :formatter="rqOutFormat"/>
  115. <el-table-column :label="$t('其它异常情况描述')" align="center" prop="rqOther" :show-overflow-tooltip="true"/>
  116. <el-table-column :label="$t('容器备注')" align="center" prop="rqRemark" :show-overflow-tooltip="true"/>
  117. </el-table-column>
  118. <el-table-column header-align="center" align="center" :label="$t('压力管道')">
  119. <el-table-column :label="$t('管道区域/单元')" align="center" prop="gdUnit" :show-overflow-tooltip="true"/>
  120. <el-table-column :label="$t('管道宏观')" align="center" prop="gdSelf" :formatter="gdSelfFormat"/>
  121. <el-table-column :label="$t('安全附件')" align="center" prop="gdSafe" :formatter="gdSafeFormat"/>
  122. <el-table-column :label="$t('测量调控装置')" align="center" prop="gdControl" :formatter="gdControlFormat"/>
  123. <el-table-column :label="$t('附属仪器仪表')" align="center" prop="gdIns" :formatter="gdInsFormat"/>
  124. <el-table-column :label="$t('有无泄漏')" align="center" prop="gdOut" :formatter="gdOutFormat"/>
  125. <el-table-column :label="$t('其它异常情况描述')" align="center" prop="gdOther" :show-overflow-tooltip="true"/>
  126. <el-table-column :label="$t('管道备注')" align="center" prop="gdRemark" :show-overflow-tooltip="true"/>
  127. </el-table-column>
  128. <el-table-column header-align="center" align="center" :label="$t('锅炉')">
  129. <el-table-column :label="$t('锅炉区域/单元')" align="center" prop="glUnit" :show-overflow-tooltip="true"/>
  130. <el-table-column :label="$t('承压部件')" align="center" prop="glPressure" :formatter="glPressureFormat"/>
  131. <el-table-column :label="$t('安全附件')" align="center" prop="glSafe" :formatter="glSafeFormat"/>
  132. <el-table-column :label="$t('仪表及联锁保护装置')" align="center" prop="glIns" :formatter="glInsFormat"/>
  133. <el-table-column :label="$t('燃烧器')" align="center" prop="glBurn" :formatter="glBurnFormat"/>
  134. <el-table-column :label="$t('人员')+$t('证书')" align="center" prop="glCer" :formatter="glCerFormat"/>
  135. <el-table-column :label="$t('水质化验')" align="center" prop="glWater" :formatter="glWaterFormat"/>
  136. <el-table-column :label="$t('其它异常情况描述')" align="center" prop="glOther" :show-overflow-tooltip="true"/>
  137. <el-table-column :label="$t('备注')" align="center" prop="glRemark" :show-overflow-tooltip="true"/>
  138. </el-table-column>
  139. <el-table-column :label="$t('操作')" align="center" fixed="right" width="260"
  140. class-name="small-padding fixed-width">
  141. <template slot-scope="scope">
  142. <el-button
  143. size="mini"
  144. type="text"
  145. icon="el-icon-edit"
  146. @click="handleUpdate(scope.row)"
  147. v-hasPermi="['sems:month:edit']"
  148. >{{ $t('修改') }}
  149. </el-button>
  150. <el-button
  151. size="mini"
  152. type="text"
  153. icon="el-icon-document"
  154. @click="handleRecord(scope.row)"
  155. v-hasPermi="['sems:month:edit']"
  156. >{{ $t('巡检记录') }}
  157. </el-button>
  158. <el-button
  159. size="mini"
  160. type="text"
  161. icon="el-icon-download"
  162. v-if="scope.row.approveStatus == 8"
  163. @click="downloadHandle(scope.row)"
  164. >{{ $t('下载月度检查记录') }}</el-button>
  165. <!-- <el-button type="text" size="mini" v-else @click="approveHandle(scope.row)">-->
  166. <!-- 申请生成报告</el-button>-->
  167. <!-- <el-button-->
  168. <!-- size="mini"-->
  169. <!-- type="text"-->
  170. <!-- icon="el-icon-delete"-->
  171. <!-- @click="handleDelete(scope.row)"-->
  172. <!-- v-hasPermi="['sems:month:remove']"-->
  173. <!-- >{{ $t('删除') }}</el-button>-->
  174. </template>
  175. </el-table-column>
  176. </el-table>
  177. <form ref="downloadForm" :action="downloadAction" target="FORMSUBMIT">
  178. <input name="id" v-model="downloadForm.id" hidden/>
  179. <input name="approveId" v-model="downloadForm.approveId" hidden/>
  180. </form>
  181. <pagination
  182. v-show="total>0"
  183. :total="total"
  184. :page.sync="queryParams.pageNum"
  185. :limit.sync="queryParams.pageSize"
  186. @pagination="getList"
  187. />
  188. <!-- 添加或修改月度检查对话框 -->
  189. <el-dialog :title="title" :visible.sync="open" width="900px" append-to-body>
  190. <el-form ref="form" :model="form" :rules="rules" label-width="130px">
  191. <el-form-item :label="$t('装置名称')" prop="plantCode">
  192. <el-select v-model="form.plantCode" :placeholder="$t('请选择')+ $t('装置')" filterable clearable @change="handleCommand" size="small">
  193. <el-option
  194. v-for="dict in plantOptions"
  195. :key="dict.name"
  196. :label="dict.name"
  197. :value="dict.name"
  198. />
  199. </el-select>
  200. </el-form-item>
  201. <el-form-item :label="$t('检查年月')" prop="checkMonth">
  202. <el-date-picker clearable size="small" style="width: 200px"
  203. v-model="form.checkMonth"
  204. type="month"
  205. value-format="yyyy-MM"
  206. :placeholder="$t('请选择') + $t('检查年月')">
  207. </el-date-picker>
  208. </el-form-item>
  209. <el-checkbox v-model="ylrq" @change="ylrqChange" style="padding-left: 70px">{{ $t('压力容器') }}</el-checkbox>
  210. <el-checkbox v-model="ylgd" @change="ylgdChange">{{ $t('压力管道') }}</el-checkbox>
  211. <el-checkbox v-model="gl" @change="glChange">{{ $t('锅炉') }}</el-checkbox>
  212. <el-collapse v-model="activeNames">
  213. <el-collapse-item :title="$t('压力容器')" name="1" :style="{display:showYlrq}">
  214. <el-form-item :label="$t('容器单元')" prop="rqUnit">
  215. <el-select v-model="form.rqUnit" :placeholder="$t('请选择')+ $t('容器单元')" filterable clearable size="small">
  216. <el-option
  217. v-for="dict in unitOptions"
  218. :key="dict.name"
  219. :label="dict.name"
  220. :value="dict.name"
  221. />
  222. </el-select>
  223. </el-form-item>
  224. <el-form-item :label="$t('容器本体')" prop="rqSelf">
  225. <el-select v-model="form.rqSelf" :placeholder="$t('请选择') + $t('容器本体')">
  226. <el-option
  227. v-for="dict in rqSelfOptions"
  228. :key="dict.dictValue"
  229. :label="dict.dictLabel"
  230. :value="dict.dictValue"
  231. ></el-option>
  232. </el-select>
  233. </el-form-item>
  234. <el-form-item :label="$t('安全附件')" prop="rqSafe">
  235. <el-select v-model="form.rqSafe" :placeholder="$t('请选择') + $t('安全附件')">
  236. <el-option
  237. v-for="dict in rqSafeOptions"
  238. :key="dict.dictValue"
  239. :label="dict.dictLabel"
  240. :value="dict.dictValue"
  241. ></el-option>
  242. </el-select>
  243. </el-form-item>
  244. <el-form-item :label="$t('安全保护装置')" prop="rqProtect">
  245. <el-select v-model="form.rqProtect" :placeholder="$t('请选择') + $t('安全保护装置')">
  246. <el-option
  247. v-for="dict in rqProtectOptions"
  248. :key="dict.dictValue"
  249. :label="dict.dictLabel"
  250. :value="dict.dictValue"
  251. ></el-option>
  252. </el-select>
  253. </el-form-item>
  254. <el-form-item :label="$t('测量调控装置,紧急切断阀')" label-width="200px" prop="rqControl">
  255. <el-select v-model="form.rqControl" :placeholder="$t('请选择') + $t('测量调控装置,紧急切断阀')">
  256. <el-option
  257. v-for="dict in rqControlOptions"
  258. :key="dict.dictValue"
  259. :label="dict.dictLabel"
  260. :value="dict.dictValue"
  261. ></el-option>
  262. </el-select>
  263. </el-form-item>
  264. <el-form-item :label="$t('附属仪器仪表')" prop="rqIns">
  265. <el-select v-model="form.rqIns" :placeholder="$t('请选择') + $t('附属仪器仪表')">
  266. <el-option
  267. v-for="dict in rqInsOptions"
  268. :key="dict.dictValue"
  269. :label="dict.dictLabel"
  270. :value="dict.dictValue"
  271. ></el-option>
  272. </el-select>
  273. </el-form-item>
  274. <el-form-item :label="$t('有无泄漏')" prop="rqOut">
  275. <el-select v-model="form.rqOut" :placeholder="$t('请选择') + $t('有无泄漏')">
  276. <el-option
  277. v-for="dict in rqOutOptions"
  278. :key="dict.dictValue"
  279. :label="dict.dictLabel"
  280. :value="dict.dictValue"
  281. ></el-option>
  282. </el-select>
  283. </el-form-item>
  284. <el-form-item :label="$t('其它异常情况描述')" prop="rqOther">
  285. <el-input v-model="form.rqOther" :placeholder="$t('请输入') + $t('其它异常情况描述')"/>
  286. </el-form-item>
  287. <el-form-item :label="$t('容器备注')" prop="rqRemark">
  288. <el-input v-model="form.rqRemark" :placeholder="$t('请输入') + $t('容器备注')"/>
  289. </el-form-item>
  290. </el-collapse-item>
  291. <el-collapse-item :title="$t('压力管道')" name="2" :style="{display:showYlgd}">
  292. <el-form-item :label="$t('管道区域/单元')" prop="gdUnit">
  293. <el-select v-model="form.gdUnit" :placeholder="$t('请选择')+ $t('管道区域/单元')" filterable clearable size="small">
  294. <el-option
  295. v-for="dict in unitOptions"
  296. :key="dict.name"
  297. :label="dict.name"
  298. :value="dict.name"
  299. />
  300. </el-select>
  301. </el-form-item>
  302. <el-form-item :label="$t('管道宏观')" prop="gdSelf">
  303. <el-select v-model="form.gdSelf" :placeholder="$t('请选择') + $t('管道宏观')">
  304. <el-option
  305. v-for="dict in gdSelfOptions"
  306. :key="dict.dictValue"
  307. :label="dict.dictLabel"
  308. :value="dict.dictValue"
  309. ></el-option>
  310. </el-select>
  311. </el-form-item>
  312. <el-form-item :label="$t('安全附件')" prop="gdSafe">
  313. <el-select v-model="form.gdSafe" :placeholder="$t('请选择') + $t('安全附件')">
  314. <el-option
  315. v-for="dict in gdSafeOptions"
  316. :key="dict.dictValue"
  317. :label="dict.dictLabel"
  318. :value="dict.dictValue"
  319. ></el-option>
  320. </el-select>
  321. </el-form-item>
  322. <el-form-item :label="$t('测量调控装置')" prop="gdControl">
  323. <el-select v-model="form.gdControl" :placeholder="$t('请选择') + $t('测量调控装置')">
  324. <el-option
  325. v-for="dict in gdControlOptions"
  326. :key="dict.dictValue"
  327. :label="dict.dictLabel"
  328. :value="dict.dictValue"
  329. ></el-option>
  330. </el-select>
  331. </el-form-item>
  332. <el-form-item :label="$t('附属仪器仪表')" prop="gdIns">
  333. <el-select v-model="form.gdIns" :placeholder="$t('请选择') + $t('附属仪器仪表')">
  334. <el-option
  335. v-for="dict in gdInsOptions"
  336. :key="dict.dictValue"
  337. :label="dict.dictLabel"
  338. :value="dict.dictValue"
  339. ></el-option>
  340. </el-select>
  341. </el-form-item>
  342. <el-form-item :label="$t('有无泄漏')" prop="gdOut">
  343. <el-select v-model="form.gdOut" :placeholder="$t('请选择') + $t('有无泄漏')">
  344. <el-option
  345. v-for="dict in gdOutOptions"
  346. :key="dict.dictValue"
  347. :label="dict.dictLabel"
  348. :value="dict.dictValue"
  349. ></el-option>
  350. </el-select>
  351. </el-form-item>
  352. <el-form-item :label="$t('其它异常情况描述')" prop="gdOther">
  353. <el-input v-model="form.gdOther" :placeholder="$t('请输入') + $t('其它异常情况描述')"/>
  354. </el-form-item>
  355. <el-form-item :label="$t('管道备注')" prop="gdRemark">
  356. <el-input v-model="form.gdRemark" :placeholder="$t('请输入') + $t('管道备注')"/>
  357. </el-form-item>
  358. </el-collapse-item>
  359. <el-collapse-item :title="$t('锅炉')" name="3" :style="{display:showGl}">
  360. <el-form-item :label="$t('锅炉区域/单元')" prop="glUnit">
  361. <el-select v-model="form.glUnit" :placeholder="$t('请选择')+ $t('锅炉区域/单元')" filterable clearable size="small">
  362. <el-option
  363. v-for="dict in unitOptions"
  364. :key="dict.name"
  365. :label="dict.name"
  366. :value="dict.name"
  367. />
  368. </el-select>
  369. </el-form-item>
  370. <el-form-item :label="$t('承压部件')" prop="glPressure">
  371. <el-select v-model="form.glPressure" :placeholder="$t('请选择') + $t('承压部件')">
  372. <el-option
  373. v-for="dict in glPressureOptions"
  374. :key="dict.dictValue"
  375. :label="dict.dictLabel"
  376. :value="dict.dictValue"
  377. ></el-option>
  378. </el-select>
  379. </el-form-item>
  380. <el-form-item :label="$t('安全附件')" prop="glSafe">
  381. <el-select v-model="form.glSafe" :placeholder="$t('请选择') + $t('安全附件')">
  382. <el-option
  383. v-for="dict in glSafeOptions"
  384. :key="dict.dictValue"
  385. :label="dict.dictLabel"
  386. :value="dict.dictValue"
  387. ></el-option>
  388. </el-select>
  389. </el-form-item>
  390. <el-form-item :label="$t('仪表及联锁保护装置')" prop="glIns">
  391. <el-select v-model="form.glIns" :placeholder="$t('请选择') + $t('仪表及联锁保护装置')">
  392. <el-option
  393. v-for="dict in glInsOptions"
  394. :key="dict.dictValue"
  395. :label="dict.dictLabel"
  396. :value="dict.dictValue"
  397. ></el-option>
  398. </el-select>
  399. </el-form-item>
  400. <el-form-item :label="$t('燃烧器')" prop="glBurn">
  401. <el-select v-model="form.glBurn" :placeholder="$t('请选择') + $t('燃烧器')">
  402. <el-option
  403. v-for="dict in glBurnOptions"
  404. :key="dict.dictValue"
  405. :label="dict.dictLabel"
  406. :value="dict.dictValue"
  407. ></el-option>
  408. </el-select>
  409. </el-form-item>
  410. <el-form-item :label="$t('人员')+$t('证书')" prop="glCer">
  411. <el-select v-model="form.glCer" :placeholder="$t('请选择') + $t('人员')+ $t('证书')">
  412. <el-option
  413. v-for="dict in glCerOptions"
  414. :key="dict.dictValue"
  415. :label="dict.dictLabel"
  416. :value="dict.dictValue"
  417. ></el-option>
  418. </el-select>
  419. </el-form-item>
  420. <el-form-item :label="$t('水质化验')" prop="glWater">
  421. <el-select v-model="form.glWater" :placeholder="$t('请选择') + $t('水质化验')">
  422. <el-option
  423. v-for="dict in glWaterOptions"
  424. :key="dict.dictValue"
  425. :label="dict.dictLabel"
  426. :value="dict.dictValue"
  427. ></el-option>
  428. </el-select>
  429. </el-form-item>
  430. <el-form-item :label="$t('其它异常情况描述')" prop="glOther">
  431. <el-input v-model="form.glOther" :placeholder="$t('请输入') + $t('其它异常情况描述')"/>
  432. </el-form-item>
  433. <el-form-item :label="$t('锅炉')+$t('备注')" prop="glRemark">
  434. <el-input v-model="form.glRemark" :placeholder="$t('请输入') + $t('锅炉')+ $t('备注')"/>
  435. </el-form-item>
  436. </el-collapse-item>
  437. </el-collapse>
  438. <el-form-item :label="$t('备注')" prop="remarks">
  439. <el-input v-model="form.remarks" :placeholder="$t('请输入') + $t('备注')"/>
  440. </el-form-item>
  441. <el-form-item :label="$t('归属部门')" prop="deptId">
  442. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true"
  443. :placeholder="$t('请选择') + $t('归属部门')"/>
  444. </el-form-item>
  445. </el-form>
  446. <div slot="footer" class="dialog-footer">
  447. <el-button type="primary" @click="submitForm">{{ $t('确 定') }}</el-button>
  448. <el-button @click="cancel">{{ $t('取 消') }}</el-button>
  449. </div>
  450. </el-dialog>
  451. <!-- 用户导入对话框 -->
  452. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  453. <el-upload
  454. ref="upload"
  455. :limit="1"
  456. accept=".xlsx, .xls"
  457. :headers="upload.headers"
  458. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  459. :disabled="upload.isUploading"
  460. :on-progress="handleFileUploadProgress"
  461. :on-success="handleFileSuccess"
  462. :auto-upload="false"
  463. drag
  464. >
  465. <i class="el-icon-upload"></i>
  466. <div class="el-upload__text">
  467. {{ $t('将文件拖到此处,或') }}
  468. <em>{{ $t('点击上传') }}</em>
  469. </div>
  470. <div class="el-upload__tip" slot="tip">
  471. <el-checkbox v-model="upload.updateSupport"/>
  472. {{ $t('是否更新已经存在的用户数据') }}
  473. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  474. </div>
  475. <div class="el-upload__tip" style="color:#ff0000" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  476. </el-upload>
  477. <div slot="footer" class="dialog-footer">
  478. <el-button type="primary" @click="submitFileForm">{{ $t('确定') }}</el-button>
  479. <el-button @click="upload.open = false">{{ $t('取消') }}</el-button>
  480. </div>
  481. </el-dialog>
  482. <!-- 巡检记录对话框 -->
  483. <el-dialog v-dialogDrag :title="recordTitle" :visible.sync="recordOpen" width="1000px" append-to-body>
  484. <el-form :inline="true" :model="recordQueryParams">
  485. <el-form-item>
  486. <el-button type="primary" @click="addRecord()">{{ $t('新增') }}</el-button>
  487. </el-form-item>
  488. </el-form>
  489. <el-table v-loading="recordLoading" :data="patrolList" border>
  490. <el-table-column :label="$t('设备位号')" align="center" prop="devno" :show-overflow-tooltip="true">
  491. <template slot-scope="scope">
  492. <el-input v-if="scope.row.isEdit" v-model="scope.row.devno" :placeholder="$t('请输入')+ $t('设备位号')"/>
  493. <span v-else>{{ scope.row.devno }}</span>
  494. </template>
  495. </el-table-column>
  496. <el-table-column :label="$t('日期')" align="center" prop="startDate" width="100">
  497. <template slot-scope="scope">
  498. <el-date-picker
  499. clearable size="small" style="width: 200px"
  500. v-if="scope.row.isEdit"
  501. v-model="scope.row.startDate"
  502. type="date"
  503. value-format="yyyy-MM-dd"
  504. :placeholder="$t('请选择')+ $t('日期')">
  505. </el-date-picker>
  506. <span v-else>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
  507. </template>
  508. </el-table-column>
  509. <el-table-column :label="$t('关闭日期')" align="center" prop="endDate" width="100">
  510. <template slot-scope="scope">
  511. <el-date-picker
  512. clearable size="small" style="width: 200px"
  513. v-if="scope.row.isEdit"
  514. v-model="scope.row.endDate"
  515. type="date"
  516. value-format="yyyy-MM-dd"
  517. :placeholder="$t('请选择')+ $t('关闭日期')">
  518. </el-date-picker>
  519. <span v-else>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
  520. </template>
  521. </el-table-column>
  522. <el-table-column :label="$t('巡检问题描述')" align="center" prop="problem" :show-overflow-tooltip="true">
  523. <template slot-scope="scope">
  524. <el-input v-if="scope.row.isEdit" v-model="scope.row.problem" :placeholder="$t('请输入')+ $t('巡检问题描述')"/>
  525. <span v-else>{{ scope.row.problem }}</span>
  526. </template>
  527. </el-table-column>
  528. <el-table-column :label="$t('巡检人')" align="center" prop="inspector" :show-overflow-tooltip="true">
  529. <template slot-scope="scope">
  530. <el-input v-if="scope.row.isEdit" v-model="scope.row.inspector" :placeholder="$t('请输入')+ $t('巡检人')"/>
  531. <span v-else>{{ scope.row.inspector }}</span>
  532. </template>
  533. </el-table-column>
  534. <el-table-column :label="$t('处理方法')" align="center" prop="approach" :show-overflow-tooltip="true">
  535. <template slot-scope="scope">
  536. <el-input v-if="scope.row.isEdit" v-model="scope.row.approach" :placeholder="$t('请输入')+ $t('处理方法')"/>
  537. <span v-else>{{ scope.row.approach }}</span>
  538. </template>
  539. </el-table-column>
  540. <el-table-column :label="$t('处理单位')" align="center" prop="dealUnit" :show-overflow-tooltip="true">
  541. <template slot-scope="scope">
  542. <el-input v-if="scope.row.isEdit" v-model="scope.row.dealUnit" :placeholder="$t('请输入')+ $t('处理单位')"/>
  543. <span v-else>{{ scope.row.dealUnit }}</span>
  544. </template>
  545. </el-table-column>
  546. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true">
  547. <template slot-scope="scope">
  548. <el-input v-if="scope.row.isEdit" v-model="scope.row.remarks" :placeholder="$t('请输入')+ $t('备注')"/>
  549. <span v-else>{{ scope.row.remarks }}</span>
  550. </template>
  551. </el-table-column>
  552. <el-table-column :label="$t('操作')" align="center" fixed="right" width="120"
  553. class-name="small-padding fixed-width">
  554. <template slot-scope="scope">
  555. <el-button type="text" size="small" v-if="scope.row.isEdit" @click="saveRecord(scope.row)">{{
  556. $t('保存')
  557. }}
  558. </el-button>
  559. <el-button type="text" size="small" v-if="scope.row.isEdit" @click="cancelRecord(scope.row, scope.$index)">
  560. {{ $t('取消') }}
  561. </el-button>
  562. <el-button v-if="!scope.row.isEdit" @click="editRecord(scope.row)" type="text" size="mini">{{
  563. $t('编辑')
  564. }}
  565. </el-button>
  566. <el-button v-if="!scope.row.isEdit" type="text" size="small" @click="deleteRecord(scope.row)">{{
  567. $t('删除')
  568. }}
  569. </el-button>
  570. </template>
  571. </el-table-column>
  572. </el-table>
  573. </el-dialog>
  574. <month-approve v-if="approveVisible" ref="monthApprove" @refreshDataList="getList"></month-approve>
  575. </div>
  576. </template>
  577. <script>
  578. import {listMonth, getMonth, delMonth, addMonth, updateMonth, exportMonth, importTemplate} from "@/api/sems/month";
  579. import {listPatrol, getPatrol, delPatrol, addPatrol, updatePatrol} from "@/api/sems/patrol";
  580. import {treeselect} from "@/api/system/dept";
  581. import {getToken} from "@/utils/auth";
  582. import Treeselect from "@riophae/vue-treeselect";
  583. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  584. import {listUnit, mylistPlant} from "@/api/system/plant";
  585. import MonthApprove from "./monthapprove";
  586. export default {
  587. name: "Month",
  588. components: {Treeselect, MonthApprove},
  589. data() {
  590. return {
  591. // 遮罩层
  592. loading: true,
  593. recordLoading: true,
  594. approveVisible: false,
  595. showYlrq: 'none',
  596. showYlgd: 'none',
  597. showGl: 'none',
  598. ylrq: false,
  599. ylgd: false,
  600. gl: false,
  601. // 选中数组
  602. ids: [],
  603. dataListSelections: [],
  604. // 非单个禁用
  605. single: true,
  606. // 非多个禁用
  607. multiple: true,
  608. // 显示搜索条件
  609. showSearch: false,
  610. // 总条数
  611. total: 0,
  612. // 月度检查表格数据
  613. monthList: [],
  614. // 月度检查巡检记录表格数据
  615. patrolList: [],
  616. // 弹出层标题
  617. title: "",
  618. recordTitle: "",
  619. // 部门树选项
  620. deptOptions: undefined,
  621. clientHeight: 300,
  622. // 是否显示弹出层
  623. open: false,
  624. recordOpen: false,
  625. // 容器本体字典
  626. rqSelfOptions: [],
  627. // 安全附件字典
  628. rqSafeOptions: [],
  629. // 安全保护装置字典
  630. rqProtectOptions: [],
  631. // 测量调控装置,紧急切断阀字典
  632. rqControlOptions: [],
  633. // 附属仪器仪表字典
  634. rqInsOptions: [],
  635. // 有无泄漏字典
  636. rqOutOptions: [],
  637. // 管道宏观字典
  638. gdSelfOptions: [],
  639. // 安全附件字典
  640. gdSafeOptions: [],
  641. // 测量调控装置字典
  642. gdControlOptions: [],
  643. // 附属仪器仪表字典
  644. gdInsOptions: [],
  645. // 有无泄漏字典
  646. gdOutOptions: [],
  647. // 承压部件字典
  648. glPressureOptions: [],
  649. // 安全附件字典
  650. glSafeOptions: [],
  651. // 仪表及联锁保护装置字典
  652. glInsOptions: [],
  653. // 燃烧器字典
  654. glBurnOptions: [],
  655. // 人员证书字典
  656. glCerOptions: [],
  657. // 水质化验字典
  658. glWaterOptions: [],
  659. plantOptions: [],
  660. unitOptions: [],
  661. plantIds: [],
  662. approveStatusOptions: [],
  663. // 用户导入参数
  664. upload: {
  665. // 是否显示弹出层(用户导入)
  666. open: false,
  667. // 弹出层标题(用户导入)
  668. title: "",
  669. // 是否禁用上传
  670. isUploading: false,
  671. // 是否更新已经存在的用户数据
  672. updateSupport: 0,
  673. // 设置上传的请求头部
  674. headers: {Authorization: "Bearer " + getToken()},
  675. // 上传的地址
  676. url: process.env.VUE_APP_BASE_API + "/sems/month/importData"
  677. },
  678. // 查询参数
  679. queryParams: {
  680. plantCode:null,
  681. checkMonth:null,
  682. approveStatus:null,
  683. pageNum: 1,
  684. pageSize: 20,
  685. },
  686. // 查询巡检记录参数
  687. recordQueryParams: {
  688. pageNum: 1,
  689. pageSize: 20,
  690. reportId: null
  691. },
  692. // 表单参数
  693. form: {},
  694. recordForm: {},
  695. //下载参数
  696. downloadForm: {
  697. id: ''
  698. },
  699. downloadAction: process.env.VUE_APP_BASE_API + '/sems/month/exportPDF',
  700. // 表单校验
  701. rules: {},
  702. //新增修改窗口内容是否展开
  703. activeNames: [],
  704. };
  705. },
  706. watch: {
  707. // 根据名称筛选部门树
  708. deptName(val) {
  709. this.$refs.tree.filter(val);
  710. }
  711. },
  712. created() {
  713. //设置表格高度对应屏幕高度
  714. this.$nextTick(() => {
  715. this.clientHeight = document.body.clientHeight - 250
  716. })
  717. this.getList();
  718. this.getTreeselect();
  719. this.getDicts("ABNORMALITY").then(response => {
  720. this.rqSelfOptions = response.data;
  721. });
  722. this.getDicts("CONFORM").then(response => {
  723. this.rqSafeOptions = response.data;
  724. });
  725. this.getDicts("CONFORM").then(response => {
  726. this.rqProtectOptions = response.data;
  727. });
  728. this.getDicts("INTACT").then(response => {
  729. this.rqControlOptions = response.data;
  730. });
  731. this.getDicts("INTACT").then(response => {
  732. this.rqInsOptions = response.data;
  733. });
  734. this.getDicts("WITH_WITHOUT").then(response => {
  735. this.rqOutOptions = response.data;
  736. });
  737. this.getDicts("ABNORMALITY").then(response => {
  738. this.gdSelfOptions = response.data;
  739. });
  740. this.getDicts("CONFORM").then(response => {
  741. this.gdSafeOptions = response.data;
  742. });
  743. this.getDicts("CONFORM").then(response => {
  744. this.gdControlOptions = response.data;
  745. });
  746. this.getDicts("INTACT").then(response => {
  747. this.gdInsOptions = response.data;
  748. });
  749. this.getDicts("WITH_WITHOUT").then(response => {
  750. this.gdOutOptions = response.data;
  751. });
  752. this.getDicts("ABNORMALITY").then(response => {
  753. this.glPressureOptions = response.data;
  754. });
  755. this.getDicts("CONFORM").then(response => {
  756. this.glSafeOptions = response.data;
  757. });
  758. this.getDicts("CONFORM").then(response => {
  759. this.glInsOptions = response.data;
  760. });
  761. this.getDicts("INTACT").then(response => {
  762. this.glBurnOptions = response.data;
  763. });
  764. this.getDicts("CONFORM").then(response => {
  765. this.glCerOptions = response.data;
  766. });
  767. this.getDicts("CONFORM").then(response => {
  768. this.glWaterOptions = response.data;
  769. });
  770. this.getDicts("spec_approve_status").then(response => {
  771. for (let i = 0; i < response.data.length; i++) {
  772. if ( ["0","7","8"].includes(response.data[i].dictValue)){
  773. this.approveStatusOptions.push(response.data[i])
  774. }
  775. }
  776. });
  777. let plantParams = {
  778. pType: 1
  779. }
  780. mylistPlant(plantParams).then(response => {
  781. this.plantOptions = response.data;
  782. });
  783. },
  784. methods: {
  785. /** 查询月度检查列表 */
  786. getList() {
  787. this.loading = true;
  788. listMonth(this.queryParams).then(response => {
  789. this.monthList = response.rows;
  790. this.total = response.total;
  791. this.loading = false;
  792. });
  793. },
  794. handleCommand(plantIds) {
  795. this.plantIds = []
  796. this.plantIds.push(plantIds)
  797. this.getUnitList()
  798. },
  799. //获取账号对应单元
  800. getUnitList() {
  801. let unitParams = {
  802. plantIds: this.plantIds
  803. }
  804. listUnit(unitParams).then(response => {
  805. this.unitOptions = response;
  806. });
  807. },
  808. /** 查询部门下拉树结构 */
  809. getTreeselect() {
  810. treeselect().then(response => {
  811. this.deptOptions = response.data;
  812. });
  813. },
  814. // 容器本体字典翻译
  815. rqSelfFormat(row, column) {
  816. return this.selectDictLabel(this.rqSelfOptions, row.rqSelf);
  817. },
  818. // 安全附件字典翻译
  819. rqSafeFormat(row, column) {
  820. return this.selectDictLabel(this.rqSafeOptions, row.rqSafe);
  821. },
  822. // 安全保护装置字典翻译
  823. rqProtectFormat(row, column) {
  824. return this.selectDictLabel(this.rqProtectOptions, row.rqProtect);
  825. },
  826. // 测量调控装置,紧急切断阀字典翻译
  827. rqControlFormat(row, column) {
  828. return this.selectDictLabel(this.rqControlOptions, row.rqControl);
  829. },
  830. // 附属仪器仪表字典翻译
  831. rqInsFormat(row, column) {
  832. return this.selectDictLabel(this.rqInsOptions, row.rqIns);
  833. },
  834. // 有无泄漏字典翻译
  835. rqOutFormat(row, column) {
  836. return this.selectDictLabel(this.rqOutOptions, row.rqOut);
  837. },
  838. // 管道宏观字典翻译
  839. gdSelfFormat(row, column) {
  840. return this.selectDictLabel(this.gdSelfOptions, row.gdSelf);
  841. },
  842. // 安全附件字典翻译
  843. gdSafeFormat(row, column) {
  844. return this.selectDictLabel(this.gdSafeOptions, row.gdSafe);
  845. },
  846. // 测量调控装置字典翻译
  847. gdControlFormat(row, column) {
  848. return this.selectDictLabel(this.gdControlOptions, row.gdControl);
  849. },
  850. // 附属仪器仪表字典翻译
  851. gdInsFormat(row, column) {
  852. return this.selectDictLabel(this.gdInsOptions, row.gdIns);
  853. },
  854. // 有无泄漏字典翻译
  855. gdOutFormat(row, column) {
  856. return this.selectDictLabel(this.gdOutOptions, row.gdOut);
  857. },
  858. // 承压部件字典翻译
  859. glPressureFormat(row, column) {
  860. return this.selectDictLabel(this.glPressureOptions, row.glPressure);
  861. },
  862. // 安全附件字典翻译
  863. glSafeFormat(row, column) {
  864. return this.selectDictLabel(this.glSafeOptions, row.glSafe);
  865. },
  866. // 仪表及联锁保护装置字典翻译
  867. glInsFormat(row, column) {
  868. return this.selectDictLabel(this.glInsOptions, row.glIns);
  869. },
  870. // 燃烧器字典翻译
  871. glBurnFormat(row, column) {
  872. return this.selectDictLabel(this.glBurnOptions, row.glBurn);
  873. },
  874. // 人员证书字典翻译
  875. glCerFormat(row, column) {
  876. return this.selectDictLabel(this.glCerOptions, row.glCer);
  877. },
  878. // 水质化验字典翻译
  879. glWaterFormat(row, column) {
  880. return this.selectDictLabel(this.glWaterOptions, row.glWater);
  881. },
  882. // 申请状态字典翻译
  883. approveStatusFormat(row, column) {
  884. return this.selectDictLabel(this.approveStatusOptions, row.approveStatus);
  885. },
  886. // 取消按钮
  887. cancel() {
  888. this.open = false;
  889. this.reset();
  890. },
  891. // 表单重置
  892. reset() {
  893. this.form = {
  894. id: null,
  895. plantCode: null,
  896. approveStatus: 0,
  897. checkMonth: null,
  898. rqUnit: null,
  899. rqSelf: null,
  900. rqSafe: null,
  901. rqProtect: null,
  902. rqControl: null,
  903. rqIns: null,
  904. rqOut: null,
  905. rqOther: null,
  906. gdUnit: null,
  907. gdSelf: null,
  908. gdSafe: null,
  909. gdControl: null,
  910. gdIns: null,
  911. gdOut: null,
  912. gdOther: null,
  913. glPressure: null,
  914. glSafe: null,
  915. glIns: null,
  916. glBurn: null,
  917. glCer: null,
  918. glWater: null,
  919. glOther: null,
  920. approveTime: null,
  921. buildDate: null,
  922. approveId: null,
  923. rqRemark: null,
  924. gdRemark: null,
  925. glRemark: null,
  926. glUnit: null,
  927. remarks: null,
  928. deptId: null,
  929. delFlag: null,
  930. createrCode: null,
  931. createdate: null,
  932. updaterCode: null,
  933. updatedate: null
  934. };
  935. this.resetForm("form");
  936. },
  937. // 巡检记录表单重置
  938. recordReset() {
  939. this.recordForm = {
  940. id: null,
  941. reportId: null,
  942. devno: null,
  943. startDate: null,
  944. endDate: null,
  945. problem: null,
  946. inspector: null,
  947. approach: null,
  948. dealUnit: null,
  949. remarks: null,
  950. delFlag: null,
  951. createrCode: null,
  952. createdate: null,
  953. updaterCode: null,
  954. updatedate: null
  955. };
  956. this.resetForm("recordForm");
  957. },
  958. /** 搜索按钮操作 */
  959. handleQuery() {
  960. this.queryParams.pageNum = 1;
  961. this.getList();
  962. },
  963. /** 重置按钮操作 */
  964. resetQuery() {
  965. this.resetForm("queryForm");
  966. this.handleQuery();
  967. },
  968. // 多选框选中数据
  969. handleSelectionChange(selection) {
  970. this.ids = selection.map(item => item.id)
  971. this.single = selection.length !== 1
  972. this.multiple = !selection.length
  973. this.dataListSelections = selection
  974. },
  975. /** 新增按钮操作 */
  976. handleAdd() {
  977. this.reset();
  978. this.activeNames = [];
  979. this.open = true;
  980. this.title = this.$t('添加') + this.$t('月度检查');
  981. },
  982. /** 修改按钮操作 */
  983. handleUpdate(row) {
  984. this.reset();
  985. var rows = row ? [row] : this.dataListSelections.map(item => {
  986. return item
  987. })
  988. for (let i = 0; i <rows.length ; i++) {
  989. if (rows[i].approveStatus != 0) {
  990. this.$alert(this.$t('当前设备正在申请中,无法修改'), this.$t('提示'), {
  991. type: 'warning'
  992. })
  993. return
  994. }
  995. }
  996. this.resetCheckBox();
  997. this.activeNames = [];
  998. const id = row.id || this.ids
  999. getMonth(id).then(response => {
  1000. this.form = response.data;
  1001. this.open = true;
  1002. this.title = this.$t('修改') + this.$t('月度检查');
  1003. this.judgeShowCheckBox();
  1004. });
  1005. },
  1006. /** 提交按钮 */
  1007. submitForm() {
  1008. this.$refs["form"].validate(valid => {
  1009. if (valid) {
  1010. if (this.form.id != null) {
  1011. updateMonth(this.form).then(response => {
  1012. this.msgSuccess(this.$t('修改成功'));
  1013. this.open = false;
  1014. this.getList();
  1015. });
  1016. } else {
  1017. addMonth(this.form).then(response => {
  1018. this.msgSuccess(this.$t('新增成功'));
  1019. this.open = false;
  1020. this.getList();
  1021. });
  1022. }
  1023. }
  1024. });
  1025. },
  1026. /** 删除按钮操作 */
  1027. handleDelete(row) {
  1028. const ids = row.id || this.ids;
  1029. var rows = this.dataListSelections.map(item => {
  1030. return item
  1031. })
  1032. for (let i = 0; i <rows.length ; i++) {
  1033. if (rows[i].approveStatus != 0) {
  1034. this.$alert(this.$t('当前设备正在申请中,无法删除'), this.$t('提示'), {
  1035. type: 'warning'
  1036. })
  1037. return
  1038. }
  1039. }
  1040. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1041. confirmButtonText: this.$t('确定'),
  1042. cancelButtonText: this.$t('取消'),
  1043. type: "warning"
  1044. }).then(function () {
  1045. return delMonth(ids);
  1046. }).then(() => {
  1047. this.getList();
  1048. this.msgSuccess(this.$t('删除成功'));
  1049. })
  1050. },
  1051. /** 导出按钮操作 */
  1052. handleExport() {
  1053. const queryParams = this.queryParams;
  1054. this.$confirm(this.$t('是否确认导出所有月度检查数据项?'), this.$t('警告'), {
  1055. confirmButtonText: this.$t('确定'),
  1056. cancelButtonText: this.$t('取消'),
  1057. type: "warning"
  1058. }).then(function () {
  1059. return exportMonth(queryParams);
  1060. }).then(response => {
  1061. this.download(response.msg);
  1062. })
  1063. },
  1064. /** 导入按钮操作 */
  1065. handleImport() {
  1066. this.upload.title = this.$t('用户导入');
  1067. this.upload.open = true;
  1068. },
  1069. /** 巡检记录按钮操作 */
  1070. handleRecord(row) {
  1071. this.recordReset();
  1072. this.recordLoading = true;
  1073. this.recordQueryParams.reportId = row.id
  1074. listPatrol(this.recordQueryParams).then(response => {
  1075. response.rows.forEach(element => {
  1076. element["isEdit"] = false
  1077. });
  1078. response.rows.forEach(element => {
  1079. element["isAdd"] = false
  1080. });
  1081. this.patrolList = response.rows;
  1082. this.recordLoading = false;
  1083. this.recordOpen = true;
  1084. this.recordTitle = this.$t('巡检记录');
  1085. });
  1086. },
  1087. /** 新增巡检记录按钮操作 */
  1088. addRecord() {
  1089. this.patrolList.push({
  1090. reportId: this.recordQueryParams.reportId,
  1091. devno: '',
  1092. startDate: '',
  1093. endDate: '',
  1094. problem: '',
  1095. inspector: '',
  1096. approach: '',
  1097. dealUnit: '',
  1098. remarks: '',
  1099. isEdit: true,
  1100. isAdd: true
  1101. });
  1102. },
  1103. /** 保存巡检记录按钮操作 */
  1104. saveRecord(row) {
  1105. row.isEdit = false;
  1106. var that = this;
  1107. that.recordLoading = true;
  1108. this.recordForm = row;
  1109. this.recordForm.reportId = this.recordQueryParams.reportId;
  1110. if (row.isAdd == true) {
  1111. addPatrol(this.recordForm).then(response => {
  1112. this.msgSuccess(this.$t('新增成功'));
  1113. this.recordOpen = false;
  1114. this.getList();
  1115. });
  1116. } else {
  1117. updatePatrol(this.recordForm).then(response => {
  1118. this.msgSuccess(this.$t('修改成功'));
  1119. this.recordOpen = false;
  1120. this.getList();
  1121. });
  1122. }
  1123. },
  1124. /** 取消巡检记录按钮操作 */
  1125. cancelRecord(row, index) {
  1126. // 如果是新增的数据
  1127. if (row.isAdd) {
  1128. this.patrolList.splice(index, 1)
  1129. } else {
  1130. // 不是新增的数据 还原数据
  1131. for (const i in row.oldRow) {
  1132. row[i] = row.oldRow[i]
  1133. }
  1134. row.isEdit = false
  1135. }
  1136. },
  1137. /** 修改巡检记录按钮操作 */
  1138. editRecord(row) {
  1139. // 备份原始数据
  1140. row['oldRow'] = JSON.parse(JSON.stringify(row));
  1141. this.$nextTick(() => {
  1142. row.isEdit = true;
  1143. })
  1144. },
  1145. /** 删除巡检记录按钮操作 */
  1146. deleteRecord(row) {
  1147. const ids = row.id || this.ids;
  1148. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1149. confirmButtonText: this.$t('确定'),
  1150. cancelButtonText: this.$t('取消'),
  1151. type: "warning"
  1152. }).then(function () {
  1153. return delPatrol(ids);
  1154. }).then(() => {
  1155. this.recordOpen = false;
  1156. this.getList();
  1157. this.msgSuccess(this.$t('删除成功'));
  1158. })
  1159. },
  1160. //下载月度检查记录
  1161. downloadHandle(row) {
  1162. this.downloadForm.id = row.id;
  1163. this.downloadForm.approveId = row.approveId;
  1164. this.$nextTick(() => {
  1165. this.$refs['downloadForm'].submit()
  1166. })
  1167. },
  1168. /** 下载模板操作 */
  1169. importTemplate() {
  1170. importTemplate().then(response => {
  1171. this.download(response.msg);
  1172. });
  1173. },
  1174. // 文件上传中处理
  1175. handleFileUploadProgress(event, file, fileList) {
  1176. this.upload.isUploading = true;
  1177. },
  1178. // 文件上传成功处理
  1179. handleFileSuccess(response, file, fileList) {
  1180. this.upload.open = false;
  1181. this.upload.isUploading = false;
  1182. this.$refs.upload.clearFiles();
  1183. this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  1184. this.getList();
  1185. },
  1186. // 提交上传文件
  1187. submitFileForm() {
  1188. this.$refs.upload.submit();
  1189. },
  1190. //提交报告
  1191. approveHandle(row) {
  1192. var rows = this.dataListSelections.map(item => {
  1193. return item
  1194. })
  1195. for (let i = 0; i < rows.length; i++) {
  1196. if (rows[i].approveStatus != 0) {
  1197. this.$alert(this.$t('当前设备正在申请中,无法重复申请'), this.$t('提示'), {
  1198. type: 'warning'
  1199. })
  1200. return
  1201. }
  1202. }
  1203. this.approveVisible = true
  1204. this.$nextTick(() => {
  1205. this.$refs.monthApprove.init(rows)
  1206. })
  1207. },
  1208. //判断修改时多选框是否选中
  1209. judgeShowCheckBox() {
  1210. if (this.form.rqUnit != null ||
  1211. this.form.rqSelf != null ||
  1212. this.form.rqSafe != null ||
  1213. this.form.rqProtect != null ||
  1214. this.form.rqControl != null ||
  1215. this.form.rqIns != null ||
  1216. this.form.rqOut != null ||
  1217. this.form.rqOther != null ||
  1218. this.form.rqRemark != null) {
  1219. this.showYlrq = 'block';
  1220. this.ylrq = true;
  1221. }
  1222. if (this.form.gdUnit != null ||
  1223. this.form.gdSelf != null ||
  1224. this.form.gdSafe != null ||
  1225. this.form.gdControl != null ||
  1226. this.form.gdIns != null ||
  1227. this.form.gdOut != null ||
  1228. this.form.gdOther != null ||
  1229. this.form.gdRemark != null) {
  1230. this.showYlgd = 'block';
  1231. this.ylgd = true;
  1232. }
  1233. if (this.form.glPressure != null ||
  1234. this.form.glSafe != null ||
  1235. this.form.glIns != null ||
  1236. this.form.glBurn != null ||
  1237. this.form.glCer != null ||
  1238. this.form.glWater != null ||
  1239. this.form.glOther != null ||
  1240. this.form.glRemark != null ||
  1241. this.form.glUnit != null) {
  1242. this.showGl = 'block';
  1243. this.gl = true;
  1244. }
  1245. },
  1246. resetCheckBox() {
  1247. this.showGl = 'none';
  1248. this.gl = false;
  1249. this.showYlgd = 'none';
  1250. this.ylgd = false;
  1251. this.showYlrq = 'none';
  1252. this.ylrq = false;
  1253. },
  1254. ylrqChange() {
  1255. if (this.ylrq == true) {
  1256. //显示折叠面板
  1257. this.showYlrq = 'block';
  1258. } else {
  1259. this.showYlrq = 'none';
  1260. //关闭时清除折叠面板数据
  1261. this.resetYlrq();
  1262. }
  1263. },
  1264. ylgdChange() {
  1265. if (this.ylgd == true) {
  1266. this.showYlgd = 'block';
  1267. } else {
  1268. this.showYlgd = 'none';
  1269. this.resetYlgd();
  1270. }
  1271. },
  1272. glChange() {
  1273. if (this.gl == true) {
  1274. this.showGl = 'block';
  1275. } else {
  1276. this.showGl = 'none';
  1277. this.resetGl();
  1278. }
  1279. },
  1280. //重置压力容器数据
  1281. resetYlrq() {
  1282. this.form.rqUnit = null;
  1283. this.form.rqSelf = null;
  1284. this.form.rqSafe = null;
  1285. this.form.rqProtect = null;
  1286. this.form.rqControl = null;
  1287. this.form.rqIns = null;
  1288. this.form.rqOut = null;
  1289. this.form.rqOther = null;
  1290. this.form.rqRemark = null;
  1291. },
  1292. resetYlgd() {
  1293. this.form.gdUnit = null;
  1294. this.form.gdSelf = null;
  1295. this.form.gdSafe = null;
  1296. this.form.gdControl = null;
  1297. this.form.gdIns = null;
  1298. this.form.gdOut = null;
  1299. this.form.gdOther = null;
  1300. this.form.gdRemark = null;
  1301. },
  1302. resetGl() {
  1303. this.form.glPressure = null;
  1304. this.form.glSafe = null;
  1305. this.form.glIns = null;
  1306. this.form.glBurn = null;
  1307. this.form.glCer = null;
  1308. this.form.glWater = null;
  1309. this.form.glOther = null;
  1310. this.form.glRemark = null;
  1311. this.form.glUnit = null;
  1312. }
  1313. }
  1314. };
  1315. </script>
  1316. <style>
  1317. .el-collapse-item__header {
  1318. font-weight: bolder;
  1319. }
  1320. </style>