index.vue 45 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166
  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="unit">
  14. <el-input
  15. v-model="queryParams.unit"
  16. :placeholder="$t('请输入') + $t('单元')"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  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="success"
  41. size="mini"
  42. :disabled="multiple"
  43. @click="approveHandle('')"
  44. >{{ $t('申请报告') }}
  45. </el-button>
  46. </el-col>
  47. <el-col :span="1.5">
  48. <el-button
  49. type="danger"
  50. size="mini"
  51. @click="syncData"
  52. >{{ $t('同步数据') }}
  53. </el-button>
  54. </el-col>
  55. <el-col :span="1.5">
  56. <el-button
  57. type="warning"
  58. size="mini"
  59. @click="dialogVisible = true"
  60. >{{ $t('批量') + $t('下载') + $t('历史报告') }}
  61. </el-button>
  62. </el-col>
  63. <el-col :span="1.5">
  64. <el-button
  65. type="info"
  66. icon="el-icon-upload2"
  67. size="mini"
  68. @click="handleImport"
  69. v-hasPermi="['sems:reportYlgd:edit']"
  70. >导入更新数据
  71. </el-button>
  72. </el-col>
  73. <el-col :span="1.5">
  74. <el-button
  75. type="warning"
  76. icon="el-icon-download"
  77. size="mini"
  78. @click="handleExport"
  79. v-hasPermi="['sems:reportYlgd:export']"
  80. >{{ $t('导出') }}</el-button>
  81. </el-col>
  82. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  83. </el-row>
  84. <el-table v-loading="loading" ref="reportTable" :data="reportYlgdList" @selection-change="handleSelectionChange"
  85. :height="clientHeight" border>
  86. <el-table-column type="selection" width="55" align="center"/>
  87. <el-table-column :label="$t('装置名称')" align="center" fixed="left" prop="plantCode" :show-overflow-tooltip="true"/>
  88. <el-table-column :label="$t('单元')" align="center" fixed="left" prop="unit" :show-overflow-tooltip="true"/>
  89. <el-table-column :label="$t('管道名称')" align="center" fixed="left" prop="devname" :show-overflow-tooltip="true"/>
  90. <el-table-column :label="$t('管道编号')" align="center" fixed="left" prop="devno" :show-overflow-tooltip="true"/>
  91. <el-table-column :label="$t('申请状态')" align="center" fixed="left" prop="approveStatus"
  92. :formatter="approveStatusFormat" :show-overflow-tooltip="true"/>
  93. <el-table-column :label="$t('管道级别')" align="center" prop="grade" :show-overflow-tooltip="true"/>
  94. <el-table-column :label="$t('介质')" align="center" prop="medium" :show-overflow-tooltip="true">
  95. <template slot-scope="scope">
  96. <el-input v-if="scope.row.isEdit" v-model="scope.row.medium" :placeholder="$t('请输入')+$t('介质')"/>
  97. <span v-else>{{ scope.row.medium }}</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column :label="$t('设计压力')" align="center" prop="desPressure" :show-overflow-tooltip="true">
  101. <template slot-scope="scope">
  102. <el-input v-if="scope.row.isEdit" v-model="scope.row.desPressure" :placeholder="$t('请输入')+$t('设计压力')"/>
  103. <span v-else>{{ scope.row.desPressure }}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column :label="$t('设计温度')" align="center" prop="desTemp" :show-overflow-tooltip="true">
  107. <template slot-scope="scope">
  108. <el-input v-if="scope.row.isEdit" v-model="scope.row.desTemp" :placeholder="$t('请输入')+$t('设计温度')"/>
  109. <span v-else>{{ scope.row.desTemp }}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column :label="$t('操作压力')" align="center" prop="optPressure" :show-overflow-tooltip="true">
  113. <template slot-scope="scope">
  114. <el-input v-if="scope.row.isEdit" v-model="scope.row.optPressure" :placeholder="$t('请输入')+$t('操作压力')"/>
  115. <span v-else>{{ scope.row.optPressure }}</span>
  116. </template>
  117. </el-table-column>
  118. <el-table-column :label="$t('操作温度')" align="center" prop="optTemp" :show-overflow-tooltip="true">
  119. <template slot-scope="scope">
  120. <el-input v-if="scope.row.isEdit" v-model="scope.row.optTemp" :placeholder="$t('请输入')+$t('操作温度')"/>
  121. <span v-else>{{ scope.row.optTemp }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column :label="$t('安全状况等级')" align="center" prop="safeClass" :show-overflow-tooltip="true"/>
  125. <el-table-column :label="$t('下次定期检验日期')" align="center" prop="yearWarnDate" width="100">
  126. <template slot-scope="scope">
  127. <span>{{ parseTime(scope.row.yearWarnDate, '{y}-{m}-{d}') }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column :label="$t('年检报告编号')" align="center" prop="yearReportNo" :show-overflow-tooltip="true">
  131. <template slot-scope="scope">
  132. <el-input v-if="scope.row.isEdit" v-model="scope.row.yearReportNo" :placeholder="$t('请输入')+$t('年检报告编号')"/>
  133. <span v-else>{{ scope.row.yearReportNo }}</span>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="1" align="center" prop="pj1" :render-header="renderHeader">
  137. <template slot-scope="scope">
  138. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj1" :placeholder="$t('请选择')">
  139. <el-option
  140. v-for="dict in pj1Options"
  141. :key="dict.dictValue"
  142. :label="dict.dictLabel"
  143. :value="dict.dictValue"
  144. ></el-option>
  145. </el-select>
  146. <span v-if="scope.row.isEdit === false && scope.row.pj1 != null">{{ pj1Format(scope.row) }}</span>
  147. </template>
  148. </el-table-column>
  149. <el-table-column label="2" align="center" prop="pj2" :render-header="renderHeader">
  150. <template slot-scope="scope">
  151. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj2" :placeholder="$t('请选择')">
  152. <el-option
  153. v-for="dict in pj2Options"
  154. :key="dict.dictValue"
  155. :label="dict.dictLabel"
  156. :value="dict.dictValue"
  157. ></el-option>
  158. </el-select>
  159. <span v-if="scope.row.isEdit === false && scope.row.pj2 != null">{{ pj2Format(scope.row) }}</span>
  160. </template>
  161. </el-table-column>
  162. <el-table-column label="3" align="center" prop="pj3" :render-header="renderHeader">
  163. <template slot-scope="scope">
  164. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj3" :placeholder="$t('请选择')">
  165. <el-option
  166. v-for="dict in pj3Options"
  167. :key="dict.dictValue"
  168. :label="dict.dictLabel"
  169. :value="dict.dictValue"
  170. ></el-option>
  171. </el-select>
  172. <span v-if="scope.row.isEdit === false && scope.row.pj3 != null">{{ pj3Format(scope.row) }}</span>
  173. </template>
  174. </el-table-column>
  175. <el-table-column label="4" align="center" prop="pj4" :render-header="renderHeader">
  176. <template slot-scope="scope">
  177. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj4" :placeholder="$t('请选择')">
  178. <el-option
  179. v-for="dict in pj4Options"
  180. :key="dict.dictValue"
  181. :label="dict.dictLabel"
  182. :value="dict.dictValue"
  183. ></el-option>
  184. </el-select>
  185. <span v-if="scope.row.isEdit === false && scope.row.pj4 != null">{{ pj4Format(scope.row) }}</span>
  186. </template>
  187. </el-table-column>
  188. <el-table-column label="5" align="center" prop="pj5" :render-header="renderHeader">
  189. <template slot-scope="scope">
  190. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj5" :placeholder="$t('请选择')">
  191. <el-option
  192. v-for="dict in pj5Options"
  193. :key="dict.dictValue"
  194. :label="dict.dictLabel"
  195. :value="dict.dictValue"
  196. ></el-option>
  197. </el-select>
  198. <span v-if="scope.row.isEdit === false && scope.row.pj5 != null">{{ pj5Format(scope.row) }}</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column :label="$t('安全附件仪表及检查情况')" align="center">
  202. <el-table-column label="6" align="center" prop="pj6" :render-header="renderHeader">
  203. <template slot-scope="scope">
  204. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj6" :placeholder="$t('请选择')">
  205. <el-option
  206. v-for="dict in pj6Options"
  207. :key="dict.dictValue"
  208. :label="dict.dictLabel"
  209. :value="dict.dictValue"
  210. ></el-option>
  211. </el-select>
  212. <span v-if="scope.row.isEdit === false && scope.row.pj6 != null">{{ pj6Format(scope.row) }}</span>
  213. </template>
  214. </el-table-column>
  215. <el-table-column label="7" align="center" prop="pj7" :render-header="renderHeader">
  216. <template slot-scope="scope">
  217. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj7" :placeholder="$t('请选择')">
  218. <el-option
  219. v-for="dict in pj7Options"
  220. :key="dict.dictValue"
  221. :label="dict.dictLabel"
  222. :value="dict.dictValue"
  223. ></el-option>
  224. </el-select>
  225. <span v-if="scope.row.isEdit === false && scope.row.pj7 != null">{{ pj7Format(scope.row) }}</span>
  226. </template>
  227. </el-table-column>
  228. <el-table-column label="8" align="center" prop="pj8" :render-header="renderHeader">
  229. <template slot-scope="scope">
  230. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj8" :placeholder="$t('请选择')">
  231. <el-option
  232. v-for="dict in pj8Options"
  233. :key="dict.dictValue"
  234. :label="dict.dictLabel"
  235. :value="dict.dictValue"
  236. ></el-option>
  237. </el-select>
  238. <span v-if="scope.row.isEdit === false && scope.row.pj8 != null">{{ pj8Format(scope.row) }}</span>
  239. </template>
  240. </el-table-column>
  241. <el-table-column label="9" align="center" prop="pj9" :render-header="renderHeader">
  242. <template slot-scope="scope">
  243. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj9" :placeholder="$t('请选择')">
  244. <el-option
  245. v-for="dict in pj9Options"
  246. :key="dict.dictValue"
  247. :label="dict.dictLabel"
  248. :value="dict.dictValue"
  249. ></el-option>
  250. </el-select>
  251. <span v-if="scope.row.isEdit === false && scope.row.pj9 != null">{{ pj9Format(scope.row) }}</span>
  252. </template>
  253. </el-table-column>
  254. <el-table-column label="10" align="center" prop="pj10" :render-header="renderHeader">
  255. <template slot-scope="scope">
  256. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj10" :placeholder="$t('请选择')">
  257. <el-option
  258. v-for="dict in pj10Options"
  259. :key="dict.dictValue"
  260. :label="dict.dictLabel"
  261. :value="dict.dictValue"
  262. ></el-option>
  263. </el-select>
  264. <span v-if="scope.row.isEdit === false && scope.row.pj10 != null">{{ pj10Format(scope.row) }}</span>
  265. </template>
  266. </el-table-column>
  267. <el-table-column label="11" align="center" prop="pj11" :render-header="renderHeader">
  268. <template slot-scope="scope">
  269. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj11" :placeholder="$t('请选择')">
  270. <el-option
  271. v-for="dict in pj11Options"
  272. :key="dict.dictValue"
  273. :label="dict.dictLabel"
  274. :value="dict.dictValue"
  275. ></el-option>
  276. </el-select>
  277. <span v-if="scope.row.isEdit === false && scope.row.pj11 != null">{{ pj11Format(scope.row) }}</span>
  278. </template>
  279. </el-table-column>
  280. </el-table-column>
  281. <el-table-column label="12" align="center" prop="pj12" :render-header="renderHeader">
  282. <template slot-scope="scope">
  283. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj12" :placeholder="$t('请选择')">
  284. <el-option
  285. v-for="dict in pj12Options"
  286. :key="dict.dictValue"
  287. :label="dict.dictLabel"
  288. :value="dict.dictValue"
  289. ></el-option>
  290. </el-select>
  291. <span v-if="scope.row.isEdit === false && scope.row.pj12 != null">{{ pj12Format(scope.row) }}</span>
  292. </template>
  293. </el-table-column>
  294. <el-table-column label="13" align="center" prop="pj13" :render-header="renderHeader">
  295. <template slot-scope="scope">
  296. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj13" :placeholder="$t('请选择')">
  297. <el-option
  298. v-for="dict in pj13Options"
  299. :key="dict.dictValue"
  300. :label="dict.dictLabel"
  301. :value="dict.dictValue"
  302. ></el-option>
  303. </el-select>
  304. <span v-if="scope.row.isEdit === false && scope.row.pj13 != null">{{ pj13Format(scope.row) }}</span>
  305. </template>
  306. </el-table-column>
  307. <el-table-column label="14" align="center" prop="pj14" :render-header="renderHeader">
  308. <template slot-scope="scope">
  309. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj14" :placeholder="$t('请选择')">
  310. <el-option
  311. v-for="dict in pj14Options"
  312. :key="dict.dictValue"
  313. :label="dict.dictLabel"
  314. :value="dict.dictValue"
  315. ></el-option>
  316. </el-select>
  317. <span v-if="scope.row.isEdit === false && scope.row.pj14 != null">{{ pj14Format(scope.row) }}</span>
  318. </template>
  319. </el-table-column>
  320. <el-table-column label="15" align="center" prop="pj15" :render-header="renderHeader">
  321. <template slot-scope="scope">
  322. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj15" :placeholder="$t('请选择')">
  323. <el-option
  324. v-for="dict in pj15Options"
  325. :key="dict.dictValue"
  326. :label="dict.dictLabel"
  327. :value="dict.dictValue"
  328. ></el-option>
  329. </el-select>
  330. <span v-if="scope.row.isEdit === false && scope.row.pj15 != null">{{ pj15Format(scope.row) }}</span>
  331. </template>
  332. </el-table-column>
  333. <el-table-column label="16" align="center" prop="pj16" :render-header="renderHeader">
  334. <template slot-scope="scope">
  335. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj16" :placeholder="$t('请选择')">
  336. <el-option
  337. v-for="dict in pj16Options"
  338. :key="dict.dictValue"
  339. :label="dict.dictLabel"
  340. :value="dict.dictValue"
  341. ></el-option>
  342. </el-select>
  343. <span v-if="scope.row.isEdit === false && scope.row.pj16 != null">{{ pj16Format(scope.row) }}</span>
  344. </template>
  345. </el-table-column>
  346. <el-table-column label="17" align="center" prop="pj17" :render-header="renderHeader">
  347. <template slot-scope="scope">
  348. <el-select v-if="scope.row.isEdit" v-model="scope.row.pj17" :placeholder="$t('请选择')">
  349. <el-option
  350. v-for="dict in pj17Options"
  351. :key="dict.dictValue"
  352. :label="dict.dictLabel"
  353. :value="dict.dictValue"
  354. ></el-option>
  355. </el-select>
  356. <span v-if="scope.row.isEdit === false && scope.row.pj17 != null">{{ pj17Format(scope.row) }}</span>
  357. </template>
  358. </el-table-column>
  359. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true">
  360. <template slot-scope="scope">
  361. <el-input v-if="scope.row.isEdit" v-model="scope.row.remarks" :placeholder="$t('请输入')+$t('备注')"/>
  362. <span v-else>{{ scope.row.remarks }}</span>
  363. </template>
  364. </el-table-column>
  365. <el-table-column :label="$t('检查日期')" align="center" prop="checkDate" width="100">
  366. <template slot-scope="scope">
  367. <el-date-picker clearable size="small" style="width: 200px"
  368. v-model="scope.row.checkDate"
  369. type="date"
  370. v-if="scope.row.isEdit"
  371. value-format="yyyy-MM-dd"
  372. :placeholder="$t('请选择')+$t('检查日期')">
  373. </el-date-picker>
  374. <span v-else>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
  375. </template>
  376. </el-table-column>
  377. <el-table-column :label="$t('下次年度检查日期')" align="center" prop="nextCheckDate" width="100">
  378. <template slot-scope="scope">
  379. <el-date-picker clearable size="small" style="width: 200px"
  380. v-model="scope.row.nextCheckDate"
  381. type="date"
  382. v-if="scope.row.isEdit"
  383. value-format="yyyy-MM-dd"
  384. :placeholder="$t('请选择')+$t('下次年度检查日期')">
  385. </el-date-picker>
  386. <span v-else>{{ parseTime(scope.row.nextCheckDate, '{y}-{m}-{d}') }}</span>
  387. </template>
  388. </el-table-column>
  389. <el-table-column :label="$t('问题及处理')" align="center" prop="problem" :show-overflow-tooltip="true">
  390. <template slot-scope="scope">
  391. <el-input v-if="scope.row.isEdit" v-model="scope.row.problem" :placeholder="$t('请输入')+$t('问题及处理')"/>
  392. <span v-else>{{ scope.row.problem }}</span>
  393. </template>
  394. </el-table-column>
  395. <el-table-column :label="$t('检查结论')" align="center" prop="con" :formatter="conFormat">
  396. <template slot-scope="scope">
  397. <el-select v-if="scope.row.isEdit" v-model="scope.row.con" :placeholder="$t('请选择')+$t('检查结论')">
  398. <el-option
  399. v-for="dict in conOptions"
  400. :key="dict.dictValue"
  401. :label="dict.dictLabel"
  402. :value="dict.dictValue"
  403. ></el-option>
  404. </el-select>
  405. <span v-if="scope.row.isEdit === false && scope.row.con != null">{{ conFormat(scope.row) }}</span>
  406. </template>
  407. </el-table-column>
  408. <el-table-column :label="$t('操作')" align="center" fixed="right" width="200"
  409. class-name="small-padding fixed-width">
  410. <template slot-scope="scope">
  411. <el-button
  412. size="mini"
  413. type="text"
  414. icon="el-icon-edit"
  415. @click="handleUpdate(scope.row)"
  416. v-if="!scope.row.isEdit"
  417. v-hasPermi="['sems:reportYlgd:edit']"
  418. >{{ $t('修改') }}
  419. </el-button>
  420. <el-button
  421. size="mini"
  422. type="text"
  423. icon="el-icon-tickets"
  424. @click="handleHistory(scope.row)"
  425. v-if="!scope.row.isEdit"
  426. v-hasPermi="['sems:reportYlgd:edit']"
  427. >{{ $t('历史报告') }}
  428. </el-button>
  429. <el-button
  430. size="mini"
  431. type="text"
  432. icon="el-icon-delete"
  433. @click="handleDelete(scope.row)"
  434. v-if="!scope.row.isEdit"
  435. v-hasPermi="['sems:reportYlgd:remove']"
  436. >{{ $t('删除') }}
  437. </el-button>
  438. <el-button
  439. v-hasPermi="['sems:reportYlgd:edit']"
  440. type="text"
  441. size="mini"
  442. v-if="scope.row.isEdit"
  443. @click="handleSave(scope.row)"
  444. >{{ $t('保存') }}
  445. </el-button>
  446. <el-button
  447. type="text"
  448. size="small"
  449. v-if="scope.row.isEdit"
  450. @click="handleCancel(scope.row, scope.$index)"
  451. >{{ $t('取消') }}
  452. </el-button>
  453. </template>
  454. </el-table-column>
  455. </el-table>
  456. <pagination
  457. v-show="total>0"
  458. :total="total"
  459. :page.sync="queryParams.pageNum"
  460. :limit.sync="queryParams.pageSize"
  461. @pagination="getList"
  462. />
  463. <!-- 历史报告对话框 -->
  464. <el-dialog v-dialogDrag :title="title" :visible.sync="open" width="1800px" append-to-body>
  465. <el-table :data="historyYlgdList" border>
  466. <el-table-column :label="$t('生成时间')" align="center" prop="buildDate" fixed="left" width="100">
  467. <template slot-scope="scope">
  468. <span>{{ parseTime(scope.row.buildDate, '{y}-{m}-{d}') }}</span>
  469. </template>
  470. </el-table-column>
  471. <el-table-column :label="$t('装置名称')" align="center" prop="plantCode" :show-overflow-tooltip="true"/>
  472. <el-table-column :label="$t('单元')" align="center" prop="unit" :show-overflow-tooltip="true"/>
  473. <el-table-column :label="$t('管道名称')" align="center" prop="devname" :show-overflow-tooltip="true"/>
  474. <el-table-column :label="$t('管道编号')" align="center" prop="devno" :show-overflow-tooltip="true"/>
  475. <el-table-column :label="$t('管道级别')" align="center" prop="grade" :show-overflow-tooltip="true"/>
  476. <el-table-column :label="$t('介质')" align="center" prop="medium" :show-overflow-tooltip="true"/>
  477. <el-table-column :label="$t('设计压力')" align="center" prop="desPressure" :show-overflow-tooltip="true"/>
  478. <el-table-column :label="$t('设计温度')" align="center" prop="desTemp" :show-overflow-tooltip="true"/>
  479. <el-table-column :label="$t('操作压力')" align="center" prop="optPressure" :show-overflow-tooltip="true"/>
  480. <el-table-column :label="$t('操作温度')" align="center" prop="optTemp" :show-overflow-tooltip="true"/>
  481. <el-table-column :label="$t('安全状况等级')" align="center" prop="safeClass" :show-overflow-tooltip="true"/>
  482. <el-table-column :label="$t('下次定期检验日期')" align="center" prop="nextWarnDate" width="100">
  483. <template slot-scope="scope">
  484. <span>{{ parseTime(scope.row.nextWarnDate, '{y}-{m}-{d}') }}</span>
  485. </template>
  486. </el-table-column>
  487. <el-table-column :label="$t('年检报告编号')" align="center" prop="yearReportNo" :show-overflow-tooltip="true"/>
  488. <el-table-column label="1" align="center" prop="pj1" :render-header="renderHeader" :formatter="pj1Format"/>
  489. <el-table-column label="2" align="center" prop="pj2" :render-header="renderHeader" :formatter="pj2Format"/>
  490. <el-table-column label="3" align="center" prop="pj3" :render-header="renderHeader" :formatter="pj3Format"/>
  491. <el-table-column label="4" align="center" prop="pj4" :render-header="renderHeader" :formatter="pj4Format"/>
  492. <el-table-column label="5" align="center" prop="pj5" :render-header="renderHeader" :formatter="pj5Format"/>
  493. <el-table-column :label="$t('安全附件仪表及检查情况')" align="center">
  494. <el-table-column label="6" align="center" prop="pj6" :render-header="renderHeader" :formatter="pj6Format"/>
  495. <el-table-column label="7" align="center" prop="pj7" :render-header="renderHeader" :formatter="pj7Format"/>
  496. <el-table-column label="8" align="center" prop="pj8" :render-header="renderHeader" :formatter="pj8Format"/>
  497. <el-table-column label="9" align="center" prop="pj9" :render-header="renderHeader" :formatter="pj9Format"/>
  498. <el-table-column label="10" align="center" prop="pj10" :render-header="renderHeader" :formatter="pj10Format"/>
  499. <el-table-column label="11" align="center" prop="pj11" :render-header="renderHeader" :formatter="pj11Format"/>
  500. </el-table-column>
  501. <el-table-column label="12" align="center" prop="pj12" :render-header="renderHeader" :formatter="pj12Format"/>
  502. <el-table-column label="13" align="center" prop="pj13" :render-header="renderHeader" :formatter="pj13Format"/>
  503. <el-table-column label="14" align="center" prop="pj14" :render-header="renderHeader" :formatter="pj14Format"/>
  504. <el-table-column label="15" align="center" prop="pj15" :render-header="renderHeader" :formatter="pj15Format"/>
  505. <el-table-column label="16" align="center" prop="pj16" :render-header="renderHeader" :formatter="pj16Format"/>
  506. <el-table-column label="17" align="center" prop="pj17" :render-header="renderHeader" :formatter="pj17Format"/>
  507. <el-table-column :label="$t('备注')" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  508. <el-table-column :label="$t('检查日期')" align="center" prop="checkDate" width="100">
  509. <template slot-scope="scope">
  510. <span>{{ parseTime(scope.row.checkDate, '{y}-{m}-{d}') }}</span>
  511. </template>
  512. </el-table-column>
  513. <el-table-column :label="$t('下次年度检查日期')" align="center" prop="nextCheckDate" width="100">
  514. <template slot-scope="scope">
  515. <span>{{ parseTime(scope.row.nextCheckDate, '{y}-{m}-{d}') }}</span>
  516. </template>
  517. </el-table-column>
  518. <el-table-column :label="$t('问题及处理')" align="center" prop="problem" :show-overflow-tooltip="true"/>
  519. <el-table-column :label="$t('检查结论')" align="center" prop="con" :formatter="conFormat"/>
  520. <el-table-column :label="$t('操作')" align="center" fixed="right" width="120"
  521. class-name="small-padding fixed-width">
  522. <template slot-scope="scope">
  523. <el-button v-hasPermi="['sems:historyYlgd:export']" type="text" size="small"
  524. @click="downloadReport(scope.row)">{{ $t('下载报告') }}
  525. </el-button>
  526. </template>
  527. </el-table-column>
  528. </el-table>
  529. <form ref="downloadForm" :action="downloadAction" target="FORMSUBMIT">
  530. <input name="id" v-model="downloadForm.id" hidden/>
  531. </form>
  532. </el-dialog>
  533. <year-approve v-if="approveVisible" ref="yearApprove" @refreshDataList="getList"></year-approve>
  534. <form ref="downloadForm2" :action="downloadAction2" target="FORMSUBMIT">
  535. <input name="year" v-model="downloadForm2.year" hidden/>
  536. </form>
  537. <!-- 批量导出年检报告的历史报告 -->
  538. <el-dialog
  539. title="选择需要导出的历史报告年份"
  540. :visible.sync="dialogVisible"
  541. width="20%">
  542. <el-date-picker
  543. v-model="exportCheckYear"
  544. type="year"
  545. placeholder="选择需要导出的历史报告年份">
  546. </el-date-picker>
  547. <span slot="footer" class="dialog-footer">
  548. <el-button @click="dialogVisible = false">取 消</el-button>
  549. <el-button type="primary" @click="exportDataForYear">确 定</el-button>
  550. </span>
  551. </el-dialog>
  552. <!-- 用户导入对话框 -->
  553. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  554. <el-upload
  555. ref="upload"
  556. :limit="1"
  557. accept=".xlsx, .xls"
  558. :headers="upload.headers"
  559. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  560. :disabled="upload.isUploading"
  561. :on-progress="handleFileUploadProgress"
  562. :on-success="handleFileSuccess"
  563. :auto-upload="false"
  564. drag
  565. >
  566. <i class="el-icon-upload"></i>
  567. <div class="el-upload__text">
  568. 将文件拖到此处,或
  569. <em>点击上传</em>
  570. </div>
  571. <div class="el-upload__tip" slot="tip">
  572. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  573. </div>
  574. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  575. </el-upload>
  576. <div slot="footer" class="dialog-footer">
  577. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  578. <el-button @click="upload.open = false">取 消</el-button>
  579. </div>
  580. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  581. <input name="type" :value="upload.type" hidden/>
  582. </form>
  583. </el-dialog>
  584. </div>
  585. </template>
  586. <script>
  587. import {
  588. listReportYlgd,
  589. getReportYlgd,
  590. delReportYlgd,
  591. addReportYlgd,
  592. updateReportYlgd,
  593. exportReportYlgd,
  594. importTemplate,
  595. syncReportYlgd
  596. } from "@/api/sems/reportYlgd";
  597. import {listHistoryYlgd} from "@/api/sems/historyYlgd";
  598. import {treeselect} from "@/api/system/dept";
  599. import {getToken} from "@/utils/auth";
  600. import Treeselect from "@riophae/vue-treeselect";
  601. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  602. import YearApprove from './yearapprove'
  603. import {exportSpecGl} from "@/api/sems/specGl";
  604. export default {
  605. name: "ReportYlgd",
  606. components: {Treeselect, YearApprove},
  607. data() {
  608. return {
  609. // 用户导入参数
  610. upload: {
  611. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  612. type: "reportYlgd",
  613. // 是否显示弹出层(用户导入)
  614. open: false,
  615. // 弹出层标题(用户导入)
  616. title: "",
  617. // 是否禁用上传
  618. isUploading: false,
  619. // 是否更新已经存在的用户数据
  620. updateSupport: 0,
  621. // 设置上传的请求头部
  622. headers: {Authorization: "Bearer " + getToken()},
  623. // 上传的地址
  624. url: process.env.VUE_APP_BASE_API + "/sems/reportYlgd/importForUpdate"
  625. },
  626. exportCheckYear: null,
  627. dialogVisible: false,
  628. // 遮罩层
  629. loading: true,
  630. approveVisible: false,
  631. // 选中数组
  632. ids: [],
  633. dataListSelections: [],
  634. // 非单个禁用
  635. single: true,
  636. // 非多个禁用
  637. multiple: true,
  638. // 显示搜索条件
  639. showSearch: false,
  640. // 总条数
  641. total: 0,
  642. // 压力管道年检报告表格数据
  643. reportYlgdList: [],
  644. // 压力管道报告历史表格数据
  645. historyYlgdList: [],
  646. // 弹出层标题
  647. title: "",
  648. // 部门树选项
  649. deptOptions: undefined,
  650. clientHeight: 300,
  651. // 是否显示弹出层
  652. open: false,
  653. // 1字典
  654. pj1Options: [],
  655. // 2字典
  656. pj2Options: [],
  657. // 3字典
  658. pj3Options: [],
  659. // 4字典
  660. pj4Options: [],
  661. // 5字典
  662. pj5Options: [],
  663. // 6字典
  664. pj6Options: [],
  665. // 7字典
  666. pj7Options: [],
  667. // 8字典
  668. pj8Options: [],
  669. // 9字典
  670. pj9Options: [],
  671. // 10字典
  672. pj10Options: [],
  673. // 11字典
  674. pj11Options: [],
  675. // 12字典
  676. pj12Options: [],
  677. // 13字典
  678. pj13Options: [],
  679. // 14字典
  680. pj14Options: [],
  681. // 15字典
  682. pj15Options: [],
  683. // 16字典
  684. pj16Options: [],
  685. // 17字典
  686. pj17Options: [],
  687. // 检查结论字典
  688. conOptions: [],
  689. approveStatusOptions: [],
  690. // 查询参数
  691. queryParams: {
  692. plantCode: null,
  693. unit: null,
  694. approveStatus: null,
  695. pageNum: 1,
  696. pageSize: 20,
  697. },
  698. // 查询历史报告参数
  699. queryHistoryParams: {
  700. pageNum: 1,
  701. pageSize: 20,
  702. reportId: null,
  703. },
  704. // 表单参数
  705. form: {},
  706. //下载参数
  707. downloadForm: {
  708. id: ''
  709. },
  710. downloadForm2: {
  711. year: '',
  712. },
  713. downloadAction: process.env.VUE_APP_BASE_API + '/sems/historyYlgd/exportPDF',
  714. downloadAction2: process.env.VUE_APP_BASE_API + '/sems/historyYlgd/exportPDFForYear',
  715. // 表单校验
  716. rules: {
  717. devId: [
  718. {required: true, message: this.$t('设备id') + this.$t('不能为空'), trigger: "blur"}
  719. ],
  720. }
  721. };
  722. },
  723. watch: {
  724. // 根据名称筛选部门树
  725. deptName(val) {
  726. this.$refs.tree.filter(val);
  727. }
  728. },
  729. created() {
  730. //设置表格高度对应屏幕高度
  731. this.$nextTick(() => {
  732. this.clientHeight = document.body.clientHeight - 250
  733. })
  734. this.getList();
  735. this.getTreeselect();
  736. this.getDicts("spec_approve_status").then(response => {
  737. this.approveStatusOptions = response.data;
  738. });
  739. this.getDicts("TEST_RESULT").then(response => {
  740. this.pj1Options = response.data;
  741. });
  742. this.getDicts("TEST_RESULT").then(response => {
  743. this.pj2Options = response.data;
  744. });
  745. this.getDicts("TEST_RESULT").then(response => {
  746. this.pj3Options = response.data;
  747. });
  748. this.getDicts("TEST_RESULT").then(response => {
  749. this.pj4Options = response.data;
  750. });
  751. this.getDicts("TEST_RESULT").then(response => {
  752. this.pj5Options = response.data;
  753. });
  754. this.getDicts("TEST_RESULT").then(response => {
  755. this.pj6Options = response.data;
  756. });
  757. this.getDicts("TEST_RESULT").then(response => {
  758. this.pj7Options = response.data;
  759. });
  760. this.getDicts("TEST_RESULT").then(response => {
  761. this.pj8Options = response.data;
  762. });
  763. this.getDicts("TEST_RESULT").then(response => {
  764. this.pj9Options = response.data;
  765. });
  766. this.getDicts("TEST_RESULT").then(response => {
  767. this.pj10Options = response.data;
  768. });
  769. this.getDicts("TEST_RESULT").then(response => {
  770. this.pj11Options = response.data;
  771. });
  772. this.getDicts("TEST_RESULT").then(response => {
  773. this.pj12Options = response.data;
  774. });
  775. this.getDicts("TEST_RESULT").then(response => {
  776. this.pj13Options = response.data;
  777. });
  778. this.getDicts("TEST_RESULT").then(response => {
  779. this.pj14Options = response.data;
  780. });
  781. this.getDicts("TEST_RESULT").then(response => {
  782. this.pj15Options = response.data;
  783. });
  784. this.getDicts("TEST_RESULT").then(response => {
  785. this.pj16Options = response.data;
  786. });
  787. this.getDicts("TEST_RESULT").then(response => {
  788. this.pj17Options = response.data;
  789. });
  790. this.getDicts("REPORT_CON").then(response => {
  791. this.conOptions = response.data;
  792. });
  793. },
  794. methods: {
  795. /** 查询压力管道年检报告列表 */
  796. getList() {
  797. this.loading = true;
  798. listReportYlgd(this.queryParams).then(response => {
  799. response.rows.forEach(element => {
  800. element["isEdit"] = false
  801. });
  802. this.reportYlgdList = response.rows;
  803. this.total = response.total;
  804. this.$nextTick(() => {
  805. this.$refs.reportTable.doLayout(); // 解决表格错位
  806. });
  807. this.loading = false;
  808. });
  809. },
  810. /** 查询部门下拉树结构 */
  811. getTreeselect() {
  812. treeselect().then(response => {
  813. this.deptOptions = response.data;
  814. });
  815. },
  816. // 申请状态字典翻译
  817. approveStatusFormat(row, column) {
  818. return this.selectDictLabel(this.approveStatusOptions, row.approveStatus);
  819. },
  820. // 1字典翻译
  821. pj1Format(row, column) {
  822. return this.selectDictLabel(this.pj1Options, row.pj1);
  823. },
  824. // 2字典翻译
  825. pj2Format(row, column) {
  826. return this.selectDictLabel(this.pj2Options, row.pj2);
  827. },
  828. // 3字典翻译
  829. pj3Format(row, column) {
  830. return this.selectDictLabel(this.pj3Options, row.pj3);
  831. },
  832. // 4字典翻译
  833. pj4Format(row, column) {
  834. return this.selectDictLabel(this.pj4Options, row.pj4);
  835. },
  836. // 5字典翻译
  837. pj5Format(row, column) {
  838. return this.selectDictLabel(this.pj5Options, row.pj5);
  839. },
  840. // 6字典翻译
  841. pj6Format(row, column) {
  842. return this.selectDictLabel(this.pj6Options, row.pj6);
  843. },
  844. // 7字典翻译
  845. pj7Format(row, column) {
  846. return this.selectDictLabel(this.pj7Options, row.pj7);
  847. },
  848. // 8字典翻译
  849. pj8Format(row, column) {
  850. return this.selectDictLabel(this.pj8Options, row.pj8);
  851. },
  852. // 9字典翻译
  853. pj9Format(row, column) {
  854. return this.selectDictLabel(this.pj9Options, row.pj9);
  855. },
  856. // 10字典翻译
  857. pj10Format(row, column) {
  858. return this.selectDictLabel(this.pj10Options, row.pj10);
  859. },
  860. // 11字典翻译
  861. pj11Format(row, column) {
  862. return this.selectDictLabel(this.pj11Options, row.pj11);
  863. },
  864. // 12字典翻译
  865. pj12Format(row, column) {
  866. return this.selectDictLabel(this.pj12Options, row.pj12);
  867. },
  868. // 13字典翻译
  869. pj13Format(row, column) {
  870. return this.selectDictLabel(this.pj13Options, row.pj13);
  871. },
  872. // 14字典翻译
  873. pj14Format(row, column) {
  874. return this.selectDictLabel(this.pj14Options, row.pj14);
  875. },
  876. // 15字典翻译
  877. pj15Format(row, column) {
  878. return this.selectDictLabel(this.pj15Options, row.pj15);
  879. },
  880. // 16字典翻译
  881. pj16Format(row, column) {
  882. return this.selectDictLabel(this.pj16Options, row.pj16);
  883. },
  884. // 17字典翻译
  885. pj17Format(row, column) {
  886. return this.selectDictLabel(this.pj17Options, row.pj17);
  887. },
  888. // 检查结论字典翻译
  889. conFormat(row, column) {
  890. return this.selectDictLabel(this.conOptions, row.con);
  891. },
  892. // 表单重置
  893. reset() {
  894. this.form = {
  895. id: null,
  896. devId: null,
  897. medium: null,
  898. desPressure: null,
  899. desTemp: null,
  900. optPressure: null,
  901. optTemp: null,
  902. yearReportNo: null,
  903. pj1: null,
  904. pj2: null,
  905. pj3: null,
  906. pj4: null,
  907. pj5: null,
  908. pj6: null,
  909. pj7: null,
  910. pj8: null,
  911. pj9: null,
  912. pj10: null,
  913. pj11: null,
  914. pj12: null,
  915. pj13: null,
  916. pj14: null,
  917. pj15: null,
  918. pj16: null,
  919. pj17: null,
  920. remarks: null,
  921. checkDate: null,
  922. nextCheckDate: null,
  923. problem: null,
  924. con: null,
  925. approveStatus: 0,
  926. approveTime: null,
  927. deptId: null,
  928. delFlag: null,
  929. createrCode: null,
  930. createdate: null,
  931. updaterCode: null,
  932. updatedate: null
  933. };
  934. this.resetForm("form");
  935. },
  936. /** 搜索按钮操作 */
  937. handleQuery() {
  938. this.queryParams.pageNum = 1;
  939. this.getList();
  940. },
  941. /** 重置按钮操作 */
  942. resetQuery() {
  943. this.resetForm("queryForm");
  944. this.handleQuery();
  945. },
  946. // 多选框选中数据
  947. handleSelectionChange(selection) {
  948. this.ids = selection.map(item => item.id)
  949. this.single = selection.length !== 1
  950. this.multiple = !selection.length
  951. this.dataListSelections = selection
  952. },
  953. /** 历史报告按钮操作 */
  954. handleHistory(row) {
  955. this.queryHistoryParams.reportId = row.id;
  956. listHistoryYlgd(this.queryHistoryParams).then(response => {
  957. this.historyYlgdList = response.rows;
  958. this.open = true;
  959. this.title = row.devno + this.$t('空格') + this.$t('历史报告');
  960. });
  961. },
  962. /** 修改按钮操作 */
  963. handleUpdate(row) {
  964. // 备份原始数据
  965. row['oldRow'] = JSON.parse(JSON.stringify(row));
  966. this.$nextTick(() => {
  967. row.isEdit = true;
  968. })
  969. },
  970. /** 保存按钮操作 */
  971. handleSave(row) {
  972. row.isEdit = false;
  973. this.loading = true;
  974. this.form = row;
  975. updateReportYlgd(this.form).then(response => {
  976. this.msgSuccess(this.$t('修改成功'));
  977. this.getList();
  978. });
  979. },
  980. /** 取消按钮操作 */
  981. handleCancel(row, index) {
  982. // 还原数据
  983. for (const i in row.oldRow) {
  984. row[i] = row.oldRow[i]
  985. }
  986. row.isEdit = false
  987. },
  988. /** 删除按钮操作 */
  989. handleDelete(row) {
  990. const ids = row.id || this.ids;
  991. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  992. confirmButtonText: this.$t('确定'),
  993. cancelButtonText: this.$t('取消'),
  994. type: "warning"
  995. }).then(function () {
  996. return delReportYlgd(ids);
  997. }).then(() => {
  998. this.getList();
  999. this.msgSuccess(this.$t('删除成功'));
  1000. })
  1001. },
  1002. //提交报告
  1003. approveHandle(row) {
  1004. var rows = this.dataListSelections.map(item => {
  1005. return item
  1006. })
  1007. for (let i = 0; i < rows.length; i++) {
  1008. if (rows[i].approveStatus != 0) {
  1009. this.$alert(this.$t('当前设备正在申请中,无法重复申请'), this.$t('提示'), {
  1010. type: 'warning'
  1011. })
  1012. return
  1013. }
  1014. }
  1015. this.approveVisible = true
  1016. this.$nextTick(() => {
  1017. this.$refs.yearApprove.init(rows)
  1018. })
  1019. },
  1020. // 根据压力管道台账数据进行同步
  1021. syncData() {
  1022. syncReportYlgd().then(response => {
  1023. this.$message({
  1024. message: response.msg,
  1025. type: 'success'
  1026. });
  1027. this.getList();
  1028. })
  1029. },
  1030. //结论备注
  1031. renderHeader(h, {column, $index}) {
  1032. return [
  1033. column.label,
  1034. h(
  1035. "el-tooltip",
  1036. {
  1037. props: {
  1038. content: (function () {
  1039. if (column.label == 1) {
  1040. return `安全管理情况`
  1041. } else if (column.label == 2) {
  1042. return `设计图纸文档、维修记录、质量证明等资料`
  1043. } else if (column.label == 3) {
  1044. return `作业人员定期培训情况`
  1045. } else if (column.label == 4) {
  1046. return `管道本体及支架`
  1047. } else if (column.label == 5) {
  1048. return `管道运行情况`
  1049. } else if (column.label == 6) {
  1050. return `安全阀`
  1051. } else if (column.label == 7) {
  1052. return `爆破片装置`
  1053. } else if (column.label == 8) {
  1054. return `阻火器装置`
  1055. } else if (column.label == 9) {
  1056. return `紧急切断阀`
  1057. } else if (column.label == 10) {
  1058. return `压力表`
  1059. } else if (column.label == 11) {
  1060. return `测温仪表`
  1061. } else if (column.label == 12) {
  1062. return `电阻值测量`
  1063. } else if (column.label == 13) {
  1064. return `壁厚测定`
  1065. } else if (column.label == 14) {
  1066. return ``
  1067. } else if (column.label == 15) {
  1068. return ``
  1069. } else if (column.label == 16) {
  1070. return ``
  1071. } else if (column.label == 17) {
  1072. return ``
  1073. } else {
  1074. return ` `
  1075. }
  1076. })(),
  1077. placement: "top"
  1078. }
  1079. },
  1080. [
  1081. h("span", {
  1082. class: {
  1083. "el-icon-question": true,
  1084. "report-headerTips": true
  1085. }
  1086. })
  1087. ]
  1088. )
  1089. ]
  1090. },
  1091. //下载报告
  1092. downloadReport(row) {
  1093. this.downloadForm.id = row.id;
  1094. this.$nextTick(() => {
  1095. this.$refs['downloadForm'].submit()
  1096. })
  1097. },
  1098. //批量下载某年份的历史报告
  1099. exportDataForYear() {
  1100. //将控件时间转为年,如果未选中年份,默认当前年
  1101. if (this.exportCheckYear == null) {
  1102. this.exportCheckYear = Date.now();
  1103. }
  1104. var date = new Date(this.exportCheckYear)
  1105. this.downloadForm2.year = date.getFullYear();
  1106. this.$nextTick(() => {
  1107. this.$refs['downloadForm2'].submit()
  1108. })
  1109. //下载完成后关闭弹窗
  1110. this.dialogVisible = false;
  1111. },
  1112. /** 导入按钮操作 */
  1113. handleImport() {
  1114. this.upload.title = "用户导入";
  1115. this.upload.open = true;
  1116. },
  1117. /** 下载模板操作 */
  1118. importTemplate() {
  1119. this.$refs['downloadFileForm'].submit()
  1120. },
  1121. // 文件上传中处理
  1122. handleFileUploadProgress(event, file, fileList) {
  1123. this.upload.isUploading = true;
  1124. },
  1125. // 文件上传成功处理
  1126. handleFileSuccess(response, file, fileList) {
  1127. this.upload.open = false;
  1128. this.upload.isUploading = false;
  1129. this.$refs.upload.clearFiles();
  1130. if (response.data.length > 0) {
  1131. let failrow = ''
  1132. for (let i = 0; i < response.data.length; i++) {
  1133. failrow += response.data[i] + ','
  1134. }
  1135. this.$alert(this.$t('导入成功条数:') + response.msg + '<br>' + this.$t('失败行数:') + failrow, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  1136. } else {
  1137. this.$alert(this.$t('导入成功条数:') + response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  1138. }
  1139. this.getList();
  1140. },
  1141. // 提交上传文件
  1142. submitFileForm() {
  1143. this.$refs.upload.submit();
  1144. },
  1145. /** 导出按钮操作 */
  1146. handleExport() {
  1147. const queryParams = this.queryParams;
  1148. this.$confirm(this.$t('是否确认导出所有特种设备压力管道年检报告数据项?'), this.$t('警告'), {
  1149. confirmButtonText: this.$t('确定'),
  1150. cancelButtonText: this.$t('取消'),
  1151. type: "warning"
  1152. }).then(function() {
  1153. return exportReportYlgd(queryParams);
  1154. }).then(response => {
  1155. this.download(response.msg);
  1156. })
  1157. },
  1158. }
  1159. };
  1160. </script>