index.vue 48 KB

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