index.vue 49 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327
  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('锅炉')+$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. this.approveStatusOptions = response.data;
  772. });
  773. let plantParams = {
  774. pType: 1
  775. }
  776. mylistPlant(plantParams).then(response => {
  777. this.plantOptions = response.data;
  778. });
  779. },
  780. methods: {
  781. /** 查询月度检查列表 */
  782. getList() {
  783. this.loading = true;
  784. listMonth(this.queryParams).then(response => {
  785. this.monthList = response.rows;
  786. this.total = response.total;
  787. this.loading = false;
  788. });
  789. },
  790. handleCommand(plantIds) {
  791. this.plantIds = []
  792. this.plantIds.push(plantIds)
  793. this.getUnitList()
  794. },
  795. //获取账号对应单元
  796. getUnitList() {
  797. let unitParams = {
  798. plantIds: this.plantIds
  799. }
  800. listUnit(unitParams).then(response => {
  801. this.unitOptions = response;
  802. });
  803. },
  804. /** 查询部门下拉树结构 */
  805. getTreeselect() {
  806. treeselect().then(response => {
  807. this.deptOptions = response.data;
  808. });
  809. },
  810. // 容器本体字典翻译
  811. rqSelfFormat(row, column) {
  812. return this.selectDictLabel(this.rqSelfOptions, row.rqSelf);
  813. },
  814. // 安全附件字典翻译
  815. rqSafeFormat(row, column) {
  816. return this.selectDictLabel(this.rqSafeOptions, row.rqSafe);
  817. },
  818. // 安全保护装置字典翻译
  819. rqProtectFormat(row, column) {
  820. return this.selectDictLabel(this.rqProtectOptions, row.rqProtect);
  821. },
  822. // 测量调控装置,紧急切断阀字典翻译
  823. rqControlFormat(row, column) {
  824. return this.selectDictLabel(this.rqControlOptions, row.rqControl);
  825. },
  826. // 附属仪器仪表字典翻译
  827. rqInsFormat(row, column) {
  828. return this.selectDictLabel(this.rqInsOptions, row.rqIns);
  829. },
  830. // 有无泄漏字典翻译
  831. rqOutFormat(row, column) {
  832. return this.selectDictLabel(this.rqOutOptions, row.rqOut);
  833. },
  834. // 管道宏观字典翻译
  835. gdSelfFormat(row, column) {
  836. return this.selectDictLabel(this.gdSelfOptions, row.gdSelf);
  837. },
  838. // 安全附件字典翻译
  839. gdSafeFormat(row, column) {
  840. return this.selectDictLabel(this.gdSafeOptions, row.gdSafe);
  841. },
  842. // 测量调控装置字典翻译
  843. gdControlFormat(row, column) {
  844. return this.selectDictLabel(this.gdControlOptions, row.gdControl);
  845. },
  846. // 附属仪器仪表字典翻译
  847. gdInsFormat(row, column) {
  848. return this.selectDictLabel(this.gdInsOptions, row.gdIns);
  849. },
  850. // 有无泄漏字典翻译
  851. gdOutFormat(row, column) {
  852. return this.selectDictLabel(this.gdOutOptions, row.gdOut);
  853. },
  854. // 承压部件字典翻译
  855. glPressureFormat(row, column) {
  856. return this.selectDictLabel(this.glPressureOptions, row.glPressure);
  857. },
  858. // 安全附件字典翻译
  859. glSafeFormat(row, column) {
  860. return this.selectDictLabel(this.glSafeOptions, row.glSafe);
  861. },
  862. // 仪表及联锁保护装置字典翻译
  863. glInsFormat(row, column) {
  864. return this.selectDictLabel(this.glInsOptions, row.glIns);
  865. },
  866. // 燃烧器字典翻译
  867. glBurnFormat(row, column) {
  868. return this.selectDictLabel(this.glBurnOptions, row.glBurn);
  869. },
  870. // 人员证书字典翻译
  871. glCerFormat(row, column) {
  872. return this.selectDictLabel(this.glCerOptions, row.glCer);
  873. },
  874. // 水质化验字典翻译
  875. glWaterFormat(row, column) {
  876. return this.selectDictLabel(this.glWaterOptions, row.glWater);
  877. },
  878. // 申请状态字典翻译
  879. approveStatusFormat(row, column) {
  880. return this.selectDictLabel(this.approveStatusOptions, row.approveStatus);
  881. },
  882. // 取消按钮
  883. cancel() {
  884. this.open = false;
  885. this.reset();
  886. },
  887. // 表单重置
  888. reset() {
  889. this.form = {
  890. id: null,
  891. plantCode: null,
  892. approveStatus: 0,
  893. checkMonth: null,
  894. rqUnit: null,
  895. rqSelf: null,
  896. rqSafe: null,
  897. rqProtect: null,
  898. rqControl: null,
  899. rqIns: null,
  900. rqOut: null,
  901. rqOther: null,
  902. gdUnit: null,
  903. gdSelf: null,
  904. gdSafe: null,
  905. gdControl: null,
  906. gdIns: null,
  907. gdOut: null,
  908. gdOther: null,
  909. glPressure: null,
  910. glSafe: null,
  911. glIns: null,
  912. glBurn: null,
  913. glCer: null,
  914. glWater: null,
  915. glOther: null,
  916. approveTime: null,
  917. buildDate: null,
  918. approveId: null,
  919. rqRemark: null,
  920. gdRemark: null,
  921. glRemark: null,
  922. glUnit: null,
  923. remarks: null,
  924. deptId: null,
  925. delFlag: null,
  926. createrCode: null,
  927. createdate: null,
  928. updaterCode: null,
  929. updatedate: null
  930. };
  931. this.resetForm("form");
  932. },
  933. // 巡检记录表单重置
  934. recordReset() {
  935. this.recordForm = {
  936. id: null,
  937. reportId: null,
  938. devno: null,
  939. startDate: null,
  940. endDate: null,
  941. problem: null,
  942. inspector: null,
  943. approach: null,
  944. dealUnit: null,
  945. remarks: null,
  946. delFlag: null,
  947. createrCode: null,
  948. createdate: null,
  949. updaterCode: null,
  950. updatedate: null
  951. };
  952. this.resetForm("recordForm");
  953. },
  954. /** 搜索按钮操作 */
  955. handleQuery() {
  956. this.queryParams.pageNum = 1;
  957. this.getList();
  958. },
  959. /** 重置按钮操作 */
  960. resetQuery() {
  961. this.resetForm("queryForm");
  962. this.handleQuery();
  963. },
  964. // 多选框选中数据
  965. handleSelectionChange(selection) {
  966. this.ids = selection.map(item => item.id)
  967. this.single = selection.length !== 1
  968. this.multiple = !selection.length
  969. this.dataListSelections = selection
  970. },
  971. /** 新增按钮操作 */
  972. handleAdd() {
  973. this.reset();
  974. this.activeNames = [];
  975. this.open = true;
  976. this.title = this.$t('添加') + this.$t('月度检查');
  977. },
  978. /** 修改按钮操作 */
  979. handleUpdate(row) {
  980. this.reset();
  981. var rows = row ? [row] : this.dataListSelections.map(item => {
  982. return item
  983. })
  984. for (let i = 0; i <rows.length ; i++) {
  985. if (rows[i].approveStatus != 0) {
  986. this.$alert(this.$t('当前设备正在申请中,无法修改'), this.$t('提示'), {
  987. type: 'warning'
  988. })
  989. return
  990. }
  991. }
  992. this.resetCheckBox();
  993. this.activeNames = [];
  994. const id = row.id || this.ids
  995. getMonth(id).then(response => {
  996. this.form = response.data;
  997. this.open = true;
  998. this.title = this.$t('修改') + this.$t('月度检查');
  999. this.judgeShowCheckBox();
  1000. });
  1001. },
  1002. /** 提交按钮 */
  1003. submitForm() {
  1004. this.$refs["form"].validate(valid => {
  1005. if (valid) {
  1006. if (this.form.id != null) {
  1007. updateMonth(this.form).then(response => {
  1008. this.msgSuccess(this.$t('修改成功'));
  1009. this.open = false;
  1010. this.getList();
  1011. });
  1012. } else {
  1013. addMonth(this.form).then(response => {
  1014. this.msgSuccess(this.$t('新增成功'));
  1015. this.open = false;
  1016. this.getList();
  1017. });
  1018. }
  1019. }
  1020. });
  1021. },
  1022. /** 删除按钮操作 */
  1023. handleDelete(row) {
  1024. const ids = row.id || this.ids;
  1025. var rows = this.dataListSelections.map(item => {
  1026. return item
  1027. })
  1028. for (let i = 0; i <rows.length ; i++) {
  1029. if (rows[i].approveStatus != 0) {
  1030. this.$alert(this.$t('当前设备正在申请中,无法删除'), this.$t('提示'), {
  1031. type: 'warning'
  1032. })
  1033. return
  1034. }
  1035. }
  1036. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1037. confirmButtonText: this.$t('确定'),
  1038. cancelButtonText: this.$t('取消'),
  1039. type: "warning"
  1040. }).then(function () {
  1041. return delMonth(ids);
  1042. }).then(() => {
  1043. this.getList();
  1044. this.msgSuccess(this.$t('删除成功'));
  1045. })
  1046. },
  1047. /** 导出按钮操作 */
  1048. handleExport() {
  1049. const queryParams = this.queryParams;
  1050. this.$confirm(this.$t('是否确认导出所有月度检查数据项?'), this.$t('警告'), {
  1051. confirmButtonText: this.$t('确定'),
  1052. cancelButtonText: this.$t('取消'),
  1053. type: "warning"
  1054. }).then(function () {
  1055. return exportMonth(queryParams);
  1056. }).then(response => {
  1057. this.download(response.msg);
  1058. })
  1059. },
  1060. /** 导入按钮操作 */
  1061. handleImport() {
  1062. this.upload.title = this.$t('用户导入');
  1063. this.upload.open = true;
  1064. },
  1065. /** 巡检记录按钮操作 */
  1066. handleRecord(row) {
  1067. this.recordReset();
  1068. this.recordLoading = true;
  1069. this.recordQueryParams.reportId = row.id
  1070. listPatrol(this.recordQueryParams).then(response => {
  1071. response.rows.forEach(element => {
  1072. element["isEdit"] = false
  1073. });
  1074. response.rows.forEach(element => {
  1075. element["isAdd"] = false
  1076. });
  1077. this.patrolList = response.rows;
  1078. this.recordLoading = false;
  1079. this.recordOpen = true;
  1080. this.recordTitle = this.$t('巡检记录');
  1081. });
  1082. },
  1083. /** 新增巡检记录按钮操作 */
  1084. addRecord() {
  1085. this.patrolList.push({
  1086. reportId: this.recordQueryParams.reportId,
  1087. devno: '',
  1088. startDate: '',
  1089. endDate: '',
  1090. problem: '',
  1091. inspector: '',
  1092. approach: '',
  1093. dealUnit: '',
  1094. remarks: '',
  1095. isEdit: true,
  1096. isAdd: true
  1097. });
  1098. },
  1099. /** 保存巡检记录按钮操作 */
  1100. saveRecord(row) {
  1101. row.isEdit = false;
  1102. var that = this;
  1103. that.recordLoading = true;
  1104. this.recordForm = row;
  1105. this.recordForm.reportId = this.recordQueryParams.reportId;
  1106. if (row.isAdd == true) {
  1107. addPatrol(this.recordForm).then(response => {
  1108. this.msgSuccess(this.$t('新增成功'));
  1109. this.recordOpen = false;
  1110. this.getList();
  1111. });
  1112. } else {
  1113. updatePatrol(this.recordForm).then(response => {
  1114. this.msgSuccess(this.$t('修改成功'));
  1115. this.recordOpen = false;
  1116. this.getList();
  1117. });
  1118. }
  1119. },
  1120. /** 取消巡检记录按钮操作 */
  1121. cancelRecord(row, index) {
  1122. // 如果是新增的数据
  1123. if (row.isAdd) {
  1124. this.patrolList.splice(index, 1)
  1125. } else {
  1126. // 不是新增的数据 还原数据
  1127. for (const i in row.oldRow) {
  1128. row[i] = row.oldRow[i]
  1129. }
  1130. row.isEdit = false
  1131. }
  1132. },
  1133. /** 修改巡检记录按钮操作 */
  1134. editRecord(row) {
  1135. // 备份原始数据
  1136. row['oldRow'] = JSON.parse(JSON.stringify(row));
  1137. this.$nextTick(() => {
  1138. row.isEdit = true;
  1139. })
  1140. },
  1141. /** 删除巡检记录按钮操作 */
  1142. deleteRecord(row) {
  1143. const ids = row.id || this.ids;
  1144. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1145. confirmButtonText: this.$t('确定'),
  1146. cancelButtonText: this.$t('取消'),
  1147. type: "warning"
  1148. }).then(function () {
  1149. return delPatrol(ids);
  1150. }).then(() => {
  1151. this.recordOpen = false;
  1152. this.getList();
  1153. this.msgSuccess(this.$t('删除成功'));
  1154. })
  1155. },
  1156. //下载月度检查记录
  1157. downloadHandle(row) {
  1158. this.downloadForm.id = row.id;
  1159. this.downloadForm.approveId = row.approveId;
  1160. this.$nextTick(() => {
  1161. this.$refs['downloadForm'].submit()
  1162. })
  1163. },
  1164. /** 下载模板操作 */
  1165. importTemplate() {
  1166. importTemplate().then(response => {
  1167. this.download(response.msg);
  1168. });
  1169. },
  1170. // 文件上传中处理
  1171. handleFileUploadProgress(event, file, fileList) {
  1172. this.upload.isUploading = true;
  1173. },
  1174. // 文件上传成功处理
  1175. handleFileSuccess(response, file, fileList) {
  1176. this.upload.open = false;
  1177. this.upload.isUploading = false;
  1178. this.$refs.upload.clearFiles();
  1179. this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  1180. this.getList();
  1181. },
  1182. // 提交上传文件
  1183. submitFileForm() {
  1184. this.$refs.upload.submit();
  1185. },
  1186. //提交报告
  1187. approveHandle(row) {
  1188. var rows = this.dataListSelections.map(item => {
  1189. return item
  1190. })
  1191. for (let i = 0; i < rows.length; i++) {
  1192. if (rows[i].approveStatus != 0) {
  1193. this.$alert(this.$t('当前设备正在申请中,无法重复申请'), this.$t('提示'), {
  1194. type: 'warning'
  1195. })
  1196. return
  1197. }
  1198. }
  1199. this.approveVisible = true
  1200. this.$nextTick(() => {
  1201. this.$refs.monthApprove.init(rows)
  1202. })
  1203. },
  1204. //判断修改时多选框是否选中
  1205. judgeShowCheckBox() {
  1206. if (this.form.rqUnit != null ||
  1207. this.form.rqSelf != null ||
  1208. this.form.rqSafe != null ||
  1209. this.form.rqProtect != null ||
  1210. this.form.rqControl != null ||
  1211. this.form.rqIns != null ||
  1212. this.form.rqOut != null ||
  1213. this.form.rqOther != null ||
  1214. this.form.rqRemark != null) {
  1215. this.showYlrq = 'block';
  1216. this.ylrq = true;
  1217. }
  1218. if (this.form.gdUnit != null ||
  1219. this.form.gdSelf != null ||
  1220. this.form.gdSafe != null ||
  1221. this.form.gdControl != null ||
  1222. this.form.gdIns != null ||
  1223. this.form.gdOut != null ||
  1224. this.form.gdOther != null ||
  1225. this.form.gdRemark != null) {
  1226. this.showYlgd = 'block';
  1227. this.ylgd = true;
  1228. }
  1229. if (this.form.glPressure != null ||
  1230. this.form.glSafe != null ||
  1231. this.form.glIns != null ||
  1232. this.form.glBurn != null ||
  1233. this.form.glCer != null ||
  1234. this.form.glWater != null ||
  1235. this.form.glOther != null ||
  1236. this.form.glRemark != null ||
  1237. this.form.glUnit != null) {
  1238. this.showGl = 'block';
  1239. this.gl = true;
  1240. }
  1241. },
  1242. resetCheckBox() {
  1243. this.showGl = 'none';
  1244. this.gl = false;
  1245. this.showYlgd = 'none';
  1246. this.ylgd = false;
  1247. this.showYlrq = 'none';
  1248. this.ylrq = false;
  1249. },
  1250. ylrqChange() {
  1251. if (this.ylrq == true) {
  1252. //显示折叠面板
  1253. this.showYlrq = 'block';
  1254. } else {
  1255. this.showYlrq = 'none';
  1256. //关闭时清除折叠面板数据
  1257. this.resetYlrq();
  1258. }
  1259. },
  1260. ylgdChange() {
  1261. if (this.ylgd == true) {
  1262. this.showYlgd = 'block';
  1263. } else {
  1264. this.showYlgd = 'none';
  1265. this.resetYlgd();
  1266. }
  1267. },
  1268. glChange() {
  1269. if (this.gl == true) {
  1270. this.showGl = 'block';
  1271. } else {
  1272. this.showGl = 'none';
  1273. this.resetGl();
  1274. }
  1275. },
  1276. //重置压力容器数据
  1277. resetYlrq() {
  1278. this.form.rqUnit = null;
  1279. this.form.rqSelf = null;
  1280. this.form.rqSafe = null;
  1281. this.form.rqProtect = null;
  1282. this.form.rqControl = null;
  1283. this.form.rqIns = null;
  1284. this.form.rqOut = null;
  1285. this.form.rqOther = null;
  1286. this.form.rqRemark = null;
  1287. },
  1288. resetYlgd() {
  1289. this.form.gdUnit = null;
  1290. this.form.gdSelf = null;
  1291. this.form.gdSafe = null;
  1292. this.form.gdControl = null;
  1293. this.form.gdIns = null;
  1294. this.form.gdOut = null;
  1295. this.form.gdOther = null;
  1296. this.form.gdRemark = null;
  1297. },
  1298. resetGl() {
  1299. this.form.glPressure = null;
  1300. this.form.glSafe = null;
  1301. this.form.glIns = null;
  1302. this.form.glBurn = null;
  1303. this.form.glCer = null;
  1304. this.form.glWater = null;
  1305. this.form.glOther = null;
  1306. this.form.glRemark = null;
  1307. this.form.glUnit = null;
  1308. }
  1309. }
  1310. };
  1311. </script>
  1312. <style>
  1313. .el-collapse-item__header {
  1314. font-weight: bolder;
  1315. }
  1316. </style>