bf.vue 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028
  1. <template>
  2. <div class="app-container">
  3. <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px">
  4. <el-form-item label="装置" prop="plantCode">
  5. <el-input
  6. v-model="queryParams.plantCode"
  7. placeholder="请输入装置"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="全局搜索" prop="fuzzy">
  14. <el-input
  15. v-model="queryParams.fuzzy"
  16. clearable
  17. placeholder="请输入要查询的值"
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery"> 搜索 </el-button>
  24. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"> 重置 </el-button>
  25. </el-form-item>
  26. </el-form>
  27. <el-row :gutter="10" class="mb8">
  28. <el-col :span="1.5">
  29. <el-button
  30. v-hasPermi="['sems:specYlgd:add']"
  31. icon="el-icon-plus"
  32. size="mini"
  33. type="primary"
  34. @click="handleAdd"
  35. > 新增
  36. </el-button>
  37. </el-col>
  38. <el-col :span="1.5">
  39. <el-button
  40. v-hasPermi="['sems:specYlgd:edit']"
  41. :disabled="single"
  42. icon="el-icon-edit"
  43. size="mini"
  44. type="success"
  45. @click="handleUpdate"
  46. > 修改
  47. </el-button>
  48. </el-col>
  49. <el-col :span="1.5">
  50. <el-button
  51. v-hasPermi="['sems:specYlgd:remove']"
  52. :disabled="multiple"
  53. icon="el-icon-delete"
  54. size="mini"
  55. type="danger"
  56. @click="handleDelete"
  57. > 删除
  58. </el-button>
  59. </el-col>
  60. <el-col :span="1.5">
  61. <el-button
  62. v-hasPermi="['sems:specYlgd:edit']"
  63. icon="el-icon-upload2"
  64. size="mini"
  65. type="info"
  66. @click="handleImport"
  67. > 导入
  68. </el-button>
  69. </el-col>
  70. <el-col :span="1.5">
  71. <el-button
  72. v-hasPermi="['sems:specYlgd:export']"
  73. icon="el-icon-download"
  74. size="mini"
  75. type="warning"
  76. @click="handleExport"
  77. > 导出
  78. </el-button>
  79. </el-col>
  80. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  81. </el-row>
  82. <el-table ref="deviceTable" v-loading="loading" :cell-style="tableCellStyle" :data="specYlgdList"
  83. :height="clientHeight"
  84. border @selection-change="handleSelectionChange" @sort-change="sortList">
  85. <el-table-column align="center" fixed="left" type="selection" width="55"/>
  86. <el-table-column label="装置" :show-overflow-tooltip="true" align="center" fixed="left" prop="plantCode"/>
  87. <el-table-column label="管道名称" :show-overflow-tooltip="true" align="center" fixed="left"
  88. prop="devname"/>
  89. <el-table-column label="P&ID号" :show-overflow-tooltip="true" align="center" fixed="left" prop="pidNo"/>
  90. <el-table-column label="管道编号" :show-overflow-tooltip="true" align="center" fixed="left" prop="devno"/>
  91. <el-table-column label="ISO图纸" :show-overflow-tooltip="true" align="center" prop="isoPicUrl">
  92. <template slot-scope="scope">
  93. <el-button
  94. v-if="scope.row.isoPicUrl"
  95. icon="el-icon-view"
  96. size="mini"
  97. type="text"
  98. @click="handleSee(scope.row)"
  99. > 预览
  100. </el-button>
  101. <span v-else>NA</span>
  102. </template>
  103. </el-table-column>
  104. <el-table-column label="下次检验日期" align="center" prop="nextWarnDate" sortable="custom" width="180">
  105. <template slot-scope="scope">
  106. <span>{{ parseTime(scope.row.nextWarnDate, '{y}-{m}-{d}') }}</span>
  107. </template>
  108. </el-table-column>
  109. <el-table-column label="最近一次检验日期" align="center" prop="warnDate" width="180">
  110. <template slot-scope="scope">
  111. <span>{{ parseTime(scope.row.warnDate, '{y}-{m}-{d}') }}</span>
  112. </template>
  113. </el-table-column>
  114. <el-table-column label="起点" :show-overflow-tooltip="true" align="center" prop="starting"/>
  115. <el-table-column label="终点" :show-overflow-tooltip="true" align="center" prop="ending"/>
  116. <el-table-column label="安全阀" :show-overflow-tooltip="true" align="center" prop="reliefValve"/>
  117. <el-table-column label="管件数量" :show-overflow-tooltip="true" align="center" prop="fitNumber"/>
  118. <el-table-column label="对接焊缝数量" :show-overflow-tooltip="true" align="center" prop="weldNumber" width="120"/>
  119. <el-table-column label="管道级别" :show-overflow-tooltip="true" align="center" prop="grade"/>
  120. <el-table-column label="设计单位" :show-overflow-tooltip="true" align="center" prop="designer"/>
  121. <el-table-column label="安装单位" :show-overflow-tooltip="true" align="center" prop="installer"/>
  122. <el-table-column label="安装年月" align="center" prop="installDate" width="100">
  123. <template slot-scope="scope">
  124. <span>{{ parseTime(scope.row.installDate, '{y}-{m}-{d}') }}</span>
  125. </template>
  126. </el-table-column>
  127. <el-table-column label="投用年月" align="center" prop="submitdate" width="100">
  128. <template slot-scope="scope">
  129. <span>{{ parseTime(scope.row.submitdate, '{y}-{m}-{d}') }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="公称直径+'(DN)'" :show-overflow-tooltip="true" align="center" prop="dia" width="120"/>
  133. <el-table-column label="壁厚(mm)" :show-overflow-tooltip="true" align="center" prop="scheduleNo" width="120"/>
  134. <el-table-column label="管道长度+'(m)'" :show-overflow-tooltip="true" align="center" prop="length" width="120"/>
  135. <el-table-column label="材质" :show-overflow-tooltip="true" align="center" prop="material"/>
  136. <!-- <el-table-column label="敷设方式" align="center" prop="layingMethod" :show-overflow-tooltip="true"/>-->
  137. <el-table-column label="保温" :show-overflow-tooltip="true" align="center" prop="heatPreservation"/>
  138. <el-table-column label="厚度" :show-overflow-tooltip="true" align="center" prop="thickness"/>
  139. <el-table-column label="设计压力+'(MPa)'" :show-overflow-tooltip="true" align="center" prop="desPressure" width="120"/>
  140. <el-table-column label="工作压力+'(MPa)'" :show-overflow-tooltip="true" align="center" prop="optPressure" width="120"/>
  141. <el-table-column label="设计温度+'(℃)'" :show-overflow-tooltip="true" align="center" prop="desTemp" width="120"/>
  142. <el-table-column label="工作温度+'(℃)'" :show-overflow-tooltip="true" align="center" prop="optTemp" width="120"/>
  143. <el-table-column label="介质" :show-overflow-tooltip="true" align="center" prop="medium"/>
  144. <el-table-column label="检验结论" :show-overflow-tooltip="true" align="center" prop="checkConclusion"/>
  145. <el-table-column label="检验机构名称" :show-overflow-tooltip="true" align="center" prop="checkUnit" width="120"/>
  146. <el-table-column label="报告编号" :show-overflow-tooltip="true" align="center" prop="reportNo"/>
  147. <el-table-column :formatter="statusFormat" label="状态" align="center" prop="status"/>
  148. <el-table-column label="检验状态" align="center" prop="checkStatus"/>
  149. <el-table-column label="备注" :show-overflow-tooltip="true" align="center" prop="remarks"/>
  150. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right"
  151. width="140">
  152. <template slot-scope="scope">
  153. <el-button
  154. v-hasPermi="['sems:specYlgd:edit']"
  155. icon="el-icon-edit"
  156. size="mini"
  157. type="text"
  158. @click="handleUpdate(scope.row)"
  159. >修改
  160. </el-button>
  161. </template>
  162. </el-table-column>
  163. </el-table>
  164. <pagination
  165. v-show="total>0"
  166. :limit.sync="queryParams.pageSize"
  167. :page-sizes="[20,100,300,500]"
  168. :page.sync="queryParams.pageNum"
  169. :total="total"
  170. @pagination="getList"
  171. />
  172. <!-- 添加或修改特种设备压力管道台账对话框 -->
  173. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" append-to-body width="1200px">
  174. <el-form ref="form" :model="form" :rules="rules" label-width="130px">
  175. <el-row>
  176. <el-col :span="12">
  177. <el-form-item label="装置" prop="plantCode">
  178. <el-input v-model="form.plantCode" placeholder="请输入装置"/>
  179. </el-form-item>
  180. </el-col>
  181. <el-col :span="12">
  182. <el-form-item label="P&ID号" prop="pidNo">
  183. <el-input v-model="form.pidNo" placeholder="请输入P&ID号"/>
  184. </el-form-item>
  185. </el-col>
  186. </el-row>
  187. <el-row>
  188. <el-col :span="12">
  189. <el-form-item label="管道名称" prop="devname">
  190. <el-input v-model="form.devname" placeholder="请输入管道名称"/>
  191. </el-form-item>
  192. </el-col>
  193. <el-col :span="12">
  194. <el-form-item label="管道编号" prop="devno">
  195. <el-input v-model="form.devno" placeholder="请输入管道编号"/>
  196. </el-form-item>
  197. </el-col>
  198. </el-row>
  199. <el-row>
  200. <el-col :span="12">
  201. <el-form-item label="管道级别" prop="grade">
  202. <el-input v-model="form.grade" placeholder="请输入管道级别"/>
  203. </el-form-item>
  204. </el-col>
  205. <el-col :span="12">
  206. <el-form-item label="设计单位" prop="designer">
  207. <el-input v-model="form.designer" placeholder="请输入设计单位"/>
  208. </el-form-item>
  209. </el-col>
  210. </el-row>
  211. <el-row>
  212. <el-col :span="12">
  213. <el-form-item label="安装单位" prop="installer">
  214. <el-input v-model="form.installer" placeholder="请输入安装单位"/>
  215. </el-form-item>
  216. </el-col>
  217. <el-col :span="12">
  218. <el-form-item label="安装年月" prop="installDate">
  219. <el-date-picker v-model="form.installDate" placeholder="请选择+ 安装年月" clearable
  220. size="small"
  221. style="width: 100%"
  222. type="date"
  223. value-format="yyyy-MM-dd">
  224. </el-date-picker>
  225. </el-form-item>
  226. </el-col>
  227. </el-row>
  228. <el-row>
  229. <el-col :span="12">
  230. <el-form-item label="投用年月" prop="submitdate">
  231. <el-date-picker v-model="form.submitdate" placeholder="请选择+ 投用年月" clearable
  232. size="small"
  233. style="width: 100%"
  234. type="date"
  235. value-format="yyyy-MM-dd">
  236. </el-date-picker>
  237. </el-form-item>
  238. </el-col>
  239. <el-col :span="12">
  240. <el-form-item label="材质" prop="material">
  241. <el-input v-model="form.material" placeholder="请输入材质"/>
  242. </el-form-item>
  243. </el-col>
  244. </el-row>
  245. <el-row>
  246. <el-col :span="12">
  247. <el-form-item label="保温" prop="heatPreservation">
  248. <el-input v-model="form.heatPreservation" placeholder="请输入保温"/>
  249. </el-form-item>
  250. </el-col>
  251. <el-col :span="12">
  252. <el-form-item label="厚度" prop="thickness">
  253. <el-input v-model="form.thickness" placeholder="请输入厚度"/>
  254. </el-form-item>
  255. </el-col>
  256. </el-row>
  257. <el-row>
  258. <el-col :span="12">
  259. <el-form-item label="公称直径(DN)" prop="dia">
  260. <el-input v-model="form.dia" placeholder="请输入公称直径(DN)"/>
  261. </el-form-item>
  262. </el-col>
  263. <el-col :span="12">
  264. <el-form-item label="壁厚(mm)" prop="scheduleNo">
  265. <el-input v-model="form.scheduleNo" placeholder="请输入壁厚(mm)"/>
  266. </el-form-item>
  267. </el-col>
  268. </el-row>
  269. <el-row>
  270. <el-col :span="12">
  271. <el-form-item label="管道长度+'(m)'" prop="length">
  272. <el-input v-model="form.length" placeholder="请输入管道长度"/>
  273. </el-form-item>
  274. </el-col>
  275. <el-col :span="12">
  276. <el-form-item label="对接焊缝数量" prop="weldNumber">
  277. <el-input v-model="form.weldNumber" placeholder="请输入对接焊缝数量"/>
  278. </el-form-item>
  279. </el-col>
  280. </el-row>
  281. <el-row>
  282. <el-col :span="12">
  283. <el-form-item label="起点" prop="starting">
  284. <el-input v-model="form.starting" placeholder="请输入起点"/>
  285. </el-form-item>
  286. </el-col>
  287. <el-col :span="12">
  288. <el-form-item label="终点" prop="ending">
  289. <el-input v-model="form.ending" placeholder="请输入终点"/>
  290. </el-form-item>
  291. </el-col>
  292. </el-row>
  293. <el-row>
  294. <el-col :span="12">
  295. <el-form-item label="管件数量" prop="fitNumber">
  296. <el-input v-model="form.fitNumber" placeholder="请输入管件数量"/>
  297. </el-form-item>
  298. </el-col>
  299. <el-col :span="12">
  300. <el-form-item label="介质" prop="medium">
  301. <el-input v-model="form.medium" placeholder="请输入介质"/>
  302. </el-form-item>
  303. </el-col>
  304. </el-row>
  305. <el-row>
  306. <el-col :span="12">
  307. <el-form-item label="设计压力+'(MPa)'" prop="desPressure">
  308. <el-input v-model="form.desPressure" placeholder="请输入设计压力"/>
  309. </el-form-item>
  310. </el-col>
  311. <el-col :span="12">
  312. <el-form-item label="工作压力+'(MPa)'" prop="optPressure">
  313. <el-input v-model="form.optPressure" placeholder="请输入工作压力"/>
  314. </el-form-item>
  315. </el-col>
  316. </el-row>
  317. <el-row>
  318. <el-col :span="12">
  319. <el-form-item label="设计温度+'(℃)'" prop="desTemp">
  320. <el-input v-model="form.desTemp" placeholder="请输入设计温度"/>
  321. </el-form-item>
  322. </el-col>
  323. <el-col :span="12">
  324. <el-form-item label="工作温度+'(℃)'" prop="optTemp">
  325. <el-input v-model="form.optTemp" placeholder="请输入工作温度"/>
  326. </el-form-item>
  327. </el-col>
  328. </el-row>
  329. <el-row>
  330. </el-row>
  331. <el-row>
  332. <el-col :span="12">
  333. <el-form-item label="最近一次检验日期" prop="warnDate">
  334. <el-date-picker v-model="form.warnDate" placeholder="请选择+ 最近一次检验日期" clearable
  335. size="small"
  336. style="width: 100%"
  337. type="month"
  338. value-format="yyyy-MM-dd">
  339. </el-date-picker>
  340. </el-form-item>
  341. </el-col>
  342. <el-col :span="12">
  343. <el-form-item label="下次检验日期" prop="nextWarnDate">
  344. <el-date-picker v-model="form.nextWarnDate" placeholder="请选择+ 下次检验日期" clearable
  345. size="small"
  346. style="width: 100%"
  347. type="month"
  348. value-format="yyyy-MM-dd">
  349. </el-date-picker>
  350. </el-form-item>
  351. </el-col>
  352. </el-row>
  353. <el-row>
  354. <el-col :span="12">
  355. </el-col>
  356. <el-col :span="12">
  357. <el-form-item label="检验机构名称" prop="checkUnit">
  358. <el-input v-model="form.checkUnit" placeholder="请输入检验机构名称"/>
  359. </el-form-item>
  360. </el-col>
  361. <el-col :span="12">
  362. <el-form-item label="检查结论" prop="checkConclusion">
  363. <el-input v-model="form.checkConclusion" placeholder="请输入检查结论"/>
  364. </el-form-item>
  365. </el-col>
  366. </el-row>
  367. <el-row>
  368. <el-col :span="12">
  369. <el-form-item label="报告编号" prop="reportNo">
  370. <el-input v-model="form.reportNo" placeholder="请输入报告编号"/>
  371. </el-form-item>
  372. </el-col>
  373. <el-col :span="12">
  374. <el-form-item label="安全阀" prop="reliefValve">
  375. <el-input v-model="form.reliefValve" placeholder="请输入安全阀"/>
  376. </el-form-item>
  377. </el-col>
  378. </el-row>
  379. <el-row>
  380. <el-form-item label="ISO图纸" prop="picUrl">
  381. <el-upload
  382. ref="doc"
  383. :action="doc.url"
  384. :auto-upload="true"
  385. :disabled="doc.isUploading"
  386. :file-list="fileList"
  387. :headers="doc.headers"
  388. :multiple="true"
  389. :on-progress="handleFileDocProgress"
  390. :on-success="handleFileDocSuccess"
  391. accept=".jpg,.png"
  392. list-type="picture"
  393. >
  394. <el-button type="primary"><i class="el-icon-upload"></i> 点击上传</el-button>
  395. </el-upload>
  396. </el-form-item>
  397. </el-row>
  398. <el-row>
  399. <el-col :span="12">
  400. <el-form-item label="状态" prop="status">
  401. <el-radio-group v-model="form.status" size="large">
  402. <el-radio label="1" size="large">在用</el-radio>
  403. <el-radio label="2" size="large">停用</el-radio>
  404. <el-radio label="3" size="large">报废</el-radio>
  405. <el-radio label="-1" size="large">封存</el-radio>
  406. </el-radio-group>
  407. </el-form-item>
  408. </el-col>
  409. <el-col :span="12">
  410. <el-form-item label="备注" prop="remarks">
  411. <el-input v-model="form.remarks" placeholder="请输入内容" type="textarea"/>
  412. </el-form-item>
  413. </el-col>
  414. </el-row>
  415. </el-form>
  416. <div slot="footer" class="dialog-footer">
  417. <el-button type="primary" @click="submitForm"> 确 定 </el-button>
  418. <el-button @click="cancel"> 取 消 </el-button>
  419. </div>
  420. </el-dialog>
  421. <!-- 用户导入对话框 -->
  422. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" append-to-body width="400px">
  423. <el-upload
  424. ref="upload"
  425. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  426. :auto-upload="false"
  427. :disabled="upload.isUploading"
  428. :headers="upload.headers"
  429. :limit="1"
  430. :on-progress="handleFileUploadProgress"
  431. :on-success="handleFileSuccess"
  432. accept=".xlsx, .xls"
  433. drag
  434. >
  435. <i class="el-icon-upload"></i>
  436. <div class="el-upload__text">
  437. 将文件拖到此处,或
  438. <em> 点击上传 </em>
  439. </div>
  440. <div slot="tip" class="el-upload__tip">
  441. <!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  442. <el-link style="font-size:12px" type="info" @click="importTemplate"> 下载模板 </el-link>
  443. </div>
  444. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  445. <input :value="upload.type" hidden name="type"/>
  446. </form>
  447. <div slot="tip" class="el-upload__tip" style="color:red"> 提示:仅允许导入“xls”或“xlsx”格式文件! </div>
  448. </el-upload>
  449. <div slot="footer" class="dialog-footer">
  450. <a v-if="waitSubmit" style="margin-right: 300px"> 正在导入... </a>
  451. <el-button v-loading.fullscreen.lock="fullscreenLoading" type="primary"
  452. @click="submitFileForm"> 确定
  453. </el-button>
  454. <el-button @click="upload.open = false"> 取消 </el-button>
  455. </div>
  456. </el-dialog>
  457. <form ref="downloadDevForm" :action="downloadDevAction" target="FORMSUBMIT">
  458. <input v-model="devType" hidden name="devType"/>
  459. <input v-model="ids" hidden name="ids"/>
  460. <input v-model="downloadType" hidden name="downloadType"/>
  461. </form>
  462. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pic.title" :visible.sync="pic.open" append-to-body width="710px">
  463. <div>
  464. <el-image
  465. v-for="url in pic.picUrl"
  466. :key="url"
  467. :preview-src-list="pic.picUrl"
  468. :src="url"
  469. fit="cover"
  470. style="width: 200px; height: 200px;margin:10px;border-radius: 5%"/>
  471. </div>
  472. </el-dialog>
  473. </div>
  474. </template>
  475. <script>
  476. import {
  477. addSpecYlgd,
  478. delSpecYlgd,
  479. duplicate,
  480. exportSpecList,
  481. exportSpecYlgd,
  482. getSpecYlgd,
  483. listSpecYlgd,
  484. updateSpecYlgd,
  485. } from "@/api/sems/specYlgd";
  486. import {treeselect} from "@/api/system/dept";
  487. import {getToken} from "@/utils/auth";
  488. import Treeselect from "@riophae/vue-treeselect";
  489. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  490. export default {
  491. name: "SpecYlgd",
  492. components: {Treeselect},
  493. data() {
  494. return {
  495. picUrl: [],
  496. pic: {
  497. title: 'iso图纸预览',
  498. picUrl: [],
  499. numPages: null,
  500. open: false,
  501. pageNum: 1,
  502. pageTotalNum: 1,
  503. loadedRatio: 0,
  504. },
  505. fileList: [],
  506. doc: {
  507. file: "",
  508. // 是否显示弹出层(报告附件)
  509. open: false,
  510. // 弹出层标题(报告附件)
  511. title: "",
  512. // 是否禁用上传
  513. isUploading: false,
  514. // 是否更新已经存在的用户数据
  515. updateSupport: 0,
  516. // 报告附件上传位置编号
  517. ids: 0,
  518. // 设置上传的请求头部
  519. headers: {Authorization: "Bearer " + getToken()},
  520. // 上传的地址
  521. url: process.env.VUE_APP_BASE_API + "/sems/specYlgd/uploadFile",
  522. commonfileList: null,
  523. pType: 'traning',
  524. pId: null
  525. },
  526. filterList: [], //删选的list
  527. fullscreenLoading: false,
  528. waitSubmit: false,
  529. hisReformVisible: false,
  530. dataForm: 0,
  531. devType: 2,
  532. // 遮罩层
  533. loading: true,
  534. addAprroveVisible: false,
  535. hisAprroveVisible: false,
  536. hisCheckVisible: false,
  537. inspectionInformation: false,
  538. modifyTitle: '设备修改申请',
  539. modifyVisible: false,
  540. downloadType: '',
  541. downloadDevAction: process.env.VUE_APP_BASE_API + '/common/download/exportDevList',
  542. // 选中数组
  543. ids: [],
  544. dataListSelections: [],
  545. // 非单个禁用
  546. single: true,
  547. // 非多个禁用
  548. multiple: true,
  549. // 显示搜索条件
  550. showSearch: false,
  551. // 总条数
  552. total: 0,
  553. // 特种设备压力管道台账表格数据
  554. specYlgdList: [],
  555. // 弹出层标题
  556. title: "",
  557. // 部门树选项
  558. deptOptions: undefined,
  559. clientHeight: 300,
  560. // 是否显示弹出层
  561. open: false,
  562. // 状态字典
  563. statusOptions: [],
  564. plantOptions: [],
  565. plantMaintOptions: [],
  566. // 申请状态字典
  567. approveStatusOptions: [],
  568. wxjlList: [],
  569. // 用户导入参数
  570. upload: {
  571. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  572. // 是否显示弹出层(用户导入)
  573. type: "specYlgd",
  574. // 是否显示弹出层(用户导入)
  575. open: false,
  576. // 弹出层标题(用户导入)
  577. title: "",
  578. // 是否禁用上传
  579. isUploading: false,
  580. // 是否更新已经存在的用户数据
  581. updateSupport: 0,
  582. // 设置上传的请求头部
  583. headers: {Authorization: "Bearer " + getToken()},
  584. // 上传的地址
  585. url: process.env.VUE_APP_BASE_API + "/sems/specYlgd/importData"
  586. },
  587. // 查询参数
  588. queryParams: {
  589. fuzzy: null,
  590. dataForm: 0,
  591. pageNum: 1,
  592. orderByColumn: null,
  593. isAsc: null,
  594. pageSize: 20,
  595. plantCode: null,
  596. unit: null,
  597. devname: null,
  598. devno: null,
  599. submitdate: null,
  600. material: null,
  601. dia: null,
  602. scheduleNo: null,
  603. length: null,
  604. starting: null,
  605. ending: null,
  606. desPressure: null,
  607. desTemp: null,
  608. optPressure: null,
  609. optTemp: null,
  610. medium: null,
  611. checkConclusion: null,
  612. checkUnit: null,
  613. safeClass: null,
  614. reportNo: null,
  615. approveTime: null,
  616. changeTime: null,
  617. plantMaint: null,
  618. engineer: null,
  619. weldNumber: null,
  620. layingMethod: null,
  621. adiabatic: null,
  622. antiCorrosion: null,
  623. adiabaticThickness: null,
  624. isDanger: null,
  625. installDate: null,
  626. yearWarnDate: null,
  627. yearNextWarnDate: null,
  628. yearReportNo: null,
  629. status: 3,
  630. },
  631. // 表单参数
  632. form: {},
  633. modifyForm: {},
  634. // 表单校验
  635. rules: {}
  636. };
  637. },
  638. watch: {
  639. // 根据名称筛选部门树
  640. deptName(val) {
  641. this.$refs.tree.filter(val);
  642. }
  643. },
  644. created() {
  645. //设置表格高度对应屏幕高度
  646. this.$nextTick(() => {
  647. this.clientHeight = document.body.clientHeight - 250
  648. })
  649. this.getList();
  650. this.getTreeselect();
  651. this.getDicts("spec_dev_status").then(response => {
  652. this.statusOptions = response.data;
  653. });
  654. //预警等级字典
  655. this.getDicts("ALARM_LEVEL").then(response => {
  656. for (let i = 0; i < response.data.length; i++) {
  657. let items = {
  658. text: '',
  659. value: ''
  660. };
  661. items.value = response.data[i].dictValue;
  662. items.text = response.data[i].dictLabel;
  663. this.filterList.push(items);
  664. }
  665. });
  666. this.getDicts("spec_approve_status").then(response => {
  667. for (let i = 0; i < response.data.length; i++) {
  668. if (!["5", "6", "7", "8", "16", "17"].includes(response.data[i].dictValue)) {
  669. this.approveStatusOptions.push(response.data[i])
  670. }
  671. }
  672. });
  673. this.getDicts("SPEC_PLANT_MAINT").then(response => {
  674. this.plantMaintOptions = response.data;
  675. });
  676. let plantParams = {
  677. pType: 1
  678. }
  679. },
  680. methods: {
  681. handleSee(row) {
  682. this.pic.picUrl = []
  683. this.pic.open = true
  684. // this.pic.title = row.picName
  685. let picUrls = row.isoPicUrl.split(",");
  686. for (let i = 0; i < picUrls.length; i++) {
  687. let url = process.env.VUE_APP_BASE_API + picUrls[i];
  688. this.pic.picUrl.push(url)
  689. }
  690. },
  691. //附件上传中处理
  692. handleFileDocProgress(event, file, fileList) {
  693. this.doc.file = file;
  694. },
  695. //附件上传成功处理
  696. handleFileDocSuccess(response, file, fileList) {
  697. this.picUrl.push(response.msg)
  698. // this.picName.push(file.name)
  699. console.log(fileList)
  700. console.log(file)
  701. // this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
  702. },
  703. /** 查询特种设备压力管道台账列表 */
  704. getList() {
  705. this.loading = true;
  706. listSpecYlgd(this.queryParams).then(response => {
  707. this.specYlgdList = response.rows;
  708. this.total = response.total;
  709. this.loading = false;
  710. });
  711. },
  712. /** 查询部门下拉树结构 */
  713. getTreeselect() {
  714. treeselect().then(response => {
  715. this.deptOptions = response.data;
  716. });
  717. },
  718. // 状态字典翻译
  719. statusFormat(row, column) {
  720. return this.selectDictLabel(this.statusOptions, row.status);
  721. },
  722. // 申请状态字典翻译
  723. approveStatusFormat(row, column) {
  724. return this.selectDictLabel(this.approveStatusOptions, row.approveStatus);
  725. },
  726. // 取消按钮
  727. cancel() {
  728. this.open = false;
  729. this.reset();
  730. },
  731. // 表单重置
  732. reset() {
  733. this.form = {
  734. //dataForm: 0,
  735. id: null,
  736. plantCode: null,
  737. unit: null,
  738. devname: null,
  739. devno: null,
  740. submitdate: null,
  741. status: 3,
  742. delFlag: null,
  743. createrCode: null,
  744. createdate: null,
  745. updaterCode: null,
  746. updatedate: null,
  747. deptId: null,
  748. remarks: null,
  749. approveStatus: 0,
  750. regno: null,
  751. useno: null,
  752. warnDate: null,
  753. warnCycle: null,
  754. nextWarnDate: null,
  755. warnFlag: null,
  756. grade: null,
  757. designer: null,
  758. installer: null,
  759. material: null,
  760. dia: null,
  761. scheduleNo: null,
  762. length: null,
  763. starting: null,
  764. ending: null,
  765. desPressure: null,
  766. desTemp: null,
  767. optPressure: null,
  768. optTemp: null,
  769. medium: null,
  770. checkConclusion: null,
  771. checkUnit: null,
  772. safeClass: null,
  773. reportNo: null,
  774. approveTime: null,
  775. changeTime: null,
  776. plantMaint: null,
  777. engineer: null,
  778. weldNumber: null,
  779. layingMethod: null,
  780. adiabatic: null,
  781. antiCorrosion: null,
  782. adiabaticThickness: null,
  783. isDanger: null,
  784. yearWarnDate: null,
  785. yearNextWarnDate: null,
  786. yearReportNo: null
  787. };
  788. this.resetForm("form");
  789. this.dataForm = 0;
  790. this.fileList = [];
  791. this.picUrl = [];
  792. },
  793. /** 搜索按钮操作 */
  794. handleQuery() {
  795. this.queryParams.pageNum = 1;
  796. this.getList();
  797. },
  798. /** 重置按钮操作 */
  799. resetQuery() {
  800. this.resetForm("queryForm");
  801. this.handleQuery();
  802. },
  803. // 多选框选中数据
  804. handleSelectionChange(selection) {
  805. this.ids = selection.map(item => item.id)
  806. this.single = selection.length !== 1
  807. this.multiple = !selection.length
  808. this.dataListSelections = selection
  809. },
  810. /** 新增按钮操作 */
  811. handleAdd() {
  812. this.fileList = [];
  813. this.picUrl = [];
  814. this.reset();
  815. this.open = true;
  816. this.title = '添加特种设备压力管道台账';
  817. },
  818. /** 修改按钮操作 */
  819. handleUpdate(row) {
  820. this.reset();
  821. const id = row.id || this.ids
  822. getSpecYlgd(id).then(response => {
  823. this.form = response.data;
  824. this.open = true;
  825. this.title = '修改特种设备压力管道台账';
  826. });
  827. },
  828. /** 提交按钮 */
  829. submitForm() {
  830. this.$refs["form"].validate(valid => {
  831. if (valid) {
  832. if (this.picUrl) {
  833. this.form.isoPicUrl = this.picUrl.join(',')
  834. } else {
  835. this.form.isoPicUrl = null;
  836. }
  837. if (this.form.id != null) {
  838. updateSpecYlgd(this.form).then(response => {
  839. this.$modal.msgSuccess('修改成功');
  840. this.open = false;
  841. this.getList();
  842. });
  843. } else {
  844. addSpecYlgd(this.form).then(response => {
  845. this.$modal.msgSuccess('新增成功');
  846. this.open = false;
  847. this.getList();
  848. });
  849. }
  850. }
  851. });
  852. },
  853. /** 删除按钮操作 */
  854. handleDelete(row) {
  855. const ids = row.id || this.ids;
  856. this.$confirm('是否确认删除?', '警告', {
  857. confirmButtonText: '确定',
  858. cancelButtonText: '取消',
  859. type: "warning"
  860. }).then(function() {
  861. return delSpecYlgd(ids);
  862. }).then(() => {
  863. this.getList();
  864. this.$modal.msgSuccess('删除成功');
  865. })
  866. },
  867. /** 删除按钮操作 */
  868. handleDup() {
  869. this.$confirm('是否确认删除?', '警告', {
  870. confirmButtonText: '确定',
  871. cancelButtonText: '取消',
  872. type: "warning"
  873. }).then(function () {
  874. return duplicate();
  875. }).then(() => {
  876. this.getList();
  877. this.$modal.msgSuccess('删除成功');
  878. })
  879. },
  880. /** 导出按钮操作 */
  881. handleExport() {
  882. const queryParams = this.queryParams;
  883. this.$confirm('是否确认导出所有特种设备压力管道台账数据项?', '警告', {
  884. confirmButtonText: '确定',
  885. cancelButtonText: '取消',
  886. type: "warning"
  887. }).then(function () {
  888. return exportSpecYlgd(queryParams);
  889. }).then(response => {
  890. this.download(response.msg);
  891. })
  892. },
  893. /** 导入按钮操作 */
  894. handleImport() {
  895. this.upload.title = '用户导入';
  896. this.upload.open = true;
  897. },
  898. /** 下载模板操作 */
  899. importTemplate() {
  900. this.$refs['downloadFileForm'].submit()
  901. },
  902. // 文件上传中处理
  903. handleFileUploadProgress(event, file, fileList) {
  904. this.upload.isUploading = true;
  905. this.waitSubmit = true;
  906. },
  907. // 文件上传成功处理
  908. handleFileSuccess(response, file, fileList) {
  909. this.waitSubmit = false;
  910. this.upload.open = false;
  911. this.upload.isUploading = false;
  912. this.$refs.upload.clearFiles();
  913. this.fullscreenLoading = false;
  914. if (response.data.length > 0) {
  915. let failrow = ''
  916. for (let i = 0; i < response.data.length; i++) {
  917. failrow += response.data[i] + ','
  918. }
  919. this.$alert('导入成功条数:' + response.msg + '<br>' + '失败行数:' + failrow, '导入结果', {dangerouslyUseHTMLString: true});
  920. } else {
  921. this.$alert('导入成功条数:' + response.msg, '导入结果', {dangerouslyUseHTMLString: true});
  922. }
  923. this.getList();
  924. },
  925. // 提交上传文件
  926. submitFileForm() {
  927. this.$refs.upload.submit();
  928. this.fullscreenLoading = true;
  929. },
  930. addAprrove(row, type) {
  931. var rows = row ? [row] : this.dataListSelections.map(item => {
  932. return item
  933. })
  934. for (let i = 0; i < rows.length; i++) {
  935. if (rows[i].approveStatus != 0) {
  936. this.$alert('当前设备正在申请中,无法重复申请', '提示', {
  937. type: 'warning'
  938. })
  939. return
  940. }
  941. }
  942. this.addAprroveVisible = true
  943. console.log(rows)
  944. console.log(type)
  945. this.$nextTick(() => {
  946. this.$refs.addApprove.init(rows, type)
  947. })
  948. },
  949. hisApprove(row, type) {
  950. this.hisAprroveVisible = true
  951. this.$nextTick(() => {
  952. this.$refs.hisApprove.init(row, type)
  953. })
  954. },
  955. checkList(row, type) {
  956. this.hisCheckVisible = true
  957. this.$nextTick(() => {
  958. this.$refs.hisCheck.init(row, type)
  959. })
  960. },
  961. hisReform(row) {
  962. this.hisReformVisible = true
  963. this.$nextTick(() => {
  964. this.$refs.hisReformList.init(row);
  965. })
  966. },
  967. //导出excel
  968. downloadDev(type) {
  969. var rows = this.dataListSelections.map(item => {
  970. return item.id
  971. })
  972. const queryParams = {ids: null};
  973. queryParams.ids = rows.join()
  974. exportSpecList(queryParams).then(response => {
  975. this.download(response.msg);
  976. })
  977. },
  978. //2021年9月15日 13:40:55 更改路径
  979. uploadUrl(uploadType) {
  980. return process.env.VUE_APP_BASE_API + "/sems/specYlgd/updateData"
  981. },
  982. //位号颜色变换
  983. tableCellStyle({row, column, rowIndex, columnIndex}) {
  984. if (columnIndex == 8 && row.isRepeat == 1) {
  985. return "color:rgba(255, 26, 26, 0.98);"
  986. }
  987. if (row.warnFlag == 1) {
  988. return "background-color:rgba(255, 255,153, 0.5);"
  989. }
  990. if (row.warnFlag == 2) {
  991. return "background-color:rgba(255, 180, 68, 0.5);"
  992. }
  993. if (row.warnFlag == 3) {
  994. return "background-color:rgba(255, 68,68, 0.5);"
  995. }
  996. },
  997. //element表格排序
  998. sortList(val) {
  999. var sort = "asc";
  1000. let sortTip = val.order
  1001. this.queryParams.isAsc = sort;
  1002. this.queryParams.orderByColumn = val.prop;
  1003. if (sortTip === 'descending') {
  1004. sort = 'desc' // 降序
  1005. } else if (sortTip === 'ascending') {
  1006. sort = 'asc' // 升序
  1007. } else if (sortTip === null) {
  1008. this.queryParams.isAsc = null;
  1009. this.queryParams.orderByColumn = null;
  1010. }
  1011. this.loading = true;
  1012. listSpecYlgd(this.queryParams).then(response => {
  1013. this.specYlgdList = response.rows;
  1014. this.total = response.total;
  1015. this.loading = false;
  1016. });
  1017. }
  1018. }
  1019. };
  1020. </script>