h130.vue 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154
  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="巡检日期" prop="recordTime">
  5. <el-date-picker
  6. v-model="queryParams.recordTime"
  7. type="month"
  8. value-format="yyyy-MM"
  9. placeholder="选择巡检日期">
  10. </el-date-picker>
  11. </el-form-item>
  12. <el-form-item>
  13. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  14. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  15. </el-form-item>
  16. </el-form>
  17. <el-row :gutter="10" class="mb8">
  18. <!--<el-col :span="1.5">-->
  19. <!--<el-button-->
  20. <!--type="primary"-->
  21. <!--icon="el-icon-plus"-->
  22. <!--size="mini"-->
  23. <!--@click="handleAdd"-->
  24. <!--v-hasPermi="['production:pressure:add']"-->
  25. <!--&gt;新增</el-button>-->
  26. <!--</el-col>-->
  27. <el-col :span="1.5">
  28. <el-button
  29. type="success"
  30. icon="el-icon-edit"
  31. size="mini"
  32. :disabled="single"
  33. @click="handleUpdate"
  34. v-hasPermi="['production:pressure:edit']"
  35. >修改</el-button>
  36. </el-col>
  37. <el-col :span="1.5">
  38. <el-button
  39. type="danger"
  40. icon="el-icon-delete"
  41. size="mini"
  42. :disabled="multiple"
  43. @click="handleDelete"
  44. v-hasPermi="['production:pressure:remove']"
  45. >删除</el-button>
  46. </el-col>
  47. <!--<el-col :span="1.5">-->
  48. <!--<el-button-->
  49. <!--type="info"-->
  50. <!--icon="el-icon-upload2"-->
  51. <!--size="mini"-->
  52. <!--@click="handleImport"-->
  53. <!--v-hasPermi="['production:pressure:edit']"-->
  54. <!--&gt;导入</el-button>-->
  55. <!--</el-col>-->
  56. <!--<el-col :span="1.5">-->
  57. <!--<el-button-->
  58. <!--type="warning"-->
  59. <!--icon="el-icon-download"-->
  60. <!--size="mini"-->
  61. <!--@click="handleExport"-->
  62. <!--v-hasPermi="['production:pressure:export']"-->
  63. <!--&gt;导出</el-button>-->
  64. <!--</el-col>-->
  65. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  66. </el-row>
  67. <el-table v-loading="loading" :data="pressureList" @selection-change="handleSelectionChange" :height="clientHeight" border>
  68. <el-table-column type="selection" width="55" align="center" />
  69. <el-table-column label="裂解炉名称" align="center" prop="furnanceName" :show-overflow-tooltip="true" width="100"/>
  70. <el-table-column label="巡检日期" align="center" prop="recordTime" width="150">
  71. <template slot-scope="scope">
  72. <span>{{ parseTime(scope.row.recordTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="班组" align="center" prop="team" :show-overflow-tooltip="true" width="80" :formatter="teamFormat"/>
  76. <el-table-column label="状态" align="center" prop="status" :show-overflow-tooltip="true" width="80" :formatter="statusFormat"/>
  77. <el-table-column label="PASS1出口" align="center" prop="pass1" :show-overflow-tooltip="true">
  78. <el-table-column label="入口" align="center" width="60">
  79. <template slot-scope="scope">
  80. <span>{{ scope.row.pass1[6] }}</span>
  81. </template>
  82. </el-table-column>
  83. <el-table-column label="1" align="center" width="60">
  84. <template slot-scope="scope">
  85. <span>{{ scope.row.pass1[0] }}</span>
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="1" align="center" width="60">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.pass1[1] }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column label="2" align="center" width="60">
  94. <template slot-scope="scope">
  95. <span>{{ scope.row.pass1[2] }}</span>
  96. </template>
  97. </el-table-column>
  98. <el-table-column label="2" align="center" width="60">
  99. <template slot-scope="scope">
  100. <span>{{ scope.row.pass1[3] }}</span>
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="3" align="center" width="60">
  104. <template slot-scope="scope">
  105. <span>{{ scope.row.pass1[4] }}</span>
  106. </template>
  107. </el-table-column>
  108. <el-table-column label="3" align="center" width="60">
  109. <template slot-scope="scope">
  110. <span>{{ scope.row.pass1[5] }}</span>
  111. </template>
  112. </el-table-column>
  113. </el-table-column>
  114. <el-table-column label="PASS2出口" align="center" prop="pass2" :show-overflow-tooltip="true">
  115. <el-table-column label="入口" align="center" width="60">
  116. <template slot-scope="scope">
  117. <span>{{ scope.row.pass2[6] }}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="4" align="center" width="60">
  121. <template slot-scope="scope">
  122. <span>{{ scope.row.pass2[0] }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="4" align="center" width="60">
  126. <template slot-scope="scope">
  127. <span>{{ scope.row.pass2[1] }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="5" align="center" width="60">
  131. <template slot-scope="scope">
  132. <span>{{ scope.row.pass2[2] }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="5" align="center" width="60">
  136. <template slot-scope="scope">
  137. <span>{{ scope.row.pass2[3] }}</span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="6" align="center" width="60">
  141. <template slot-scope="scope">
  142. <span>{{ scope.row.pass2[4] }}</span>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="6" align="center" width="60">
  146. <template slot-scope="scope">
  147. <span>{{ scope.row.pass2[5] }}</span>
  148. </template>
  149. </el-table-column>
  150. </el-table-column>
  151. <el-table-column label="PASS3出口" align="center" prop="pass3" :show-overflow-tooltip="true">
  152. <el-table-column label="入口" align="center" width="60">
  153. <template slot-scope="scope">
  154. <span>{{ scope.row.pass3[6] }}</span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="7" align="center" width="60">
  158. <template slot-scope="scope">
  159. <span>{{ scope.row.pass3[0] }}</span>
  160. </template>
  161. </el-table-column>
  162. <el-table-column label="7" align="center" width="60">
  163. <template slot-scope="scope">
  164. <span>{{ scope.row.pass3[1] }}</span>
  165. </template>
  166. </el-table-column>
  167. <el-table-column label="8" align="center" width="60">
  168. <template slot-scope="scope">
  169. <span>{{ scope.row.pass3[2] }}</span>
  170. </template>
  171. </el-table-column>
  172. <el-table-column label="8" align="center" width="60">
  173. <template slot-scope="scope">
  174. <span>{{ scope.row.pass3[3] }}</span>
  175. </template>
  176. </el-table-column>
  177. <el-table-column label="9" align="center" width="60">
  178. <template slot-scope="scope">
  179. <span>{{ scope.row.pass3[4] }}</span>
  180. </template>
  181. </el-table-column>
  182. <el-table-column label="9" align="center" width="60">
  183. <template slot-scope="scope">
  184. <span>{{ scope.row.pass3[5] }}</span>
  185. </template>
  186. </el-table-column>
  187. </el-table-column>
  188. <el-table-column label="PASS4出口" align="center" prop="pass4" :show-overflow-tooltip="true">
  189. <el-table-column label="入口" align="center" width="60">
  190. <template slot-scope="scope">
  191. <span>{{ scope.row.pass4[6] }}</span>
  192. </template>
  193. </el-table-column>
  194. <el-table-column label="10" align="center" width="60">
  195. <template slot-scope="scope">
  196. <span>{{ scope.row.pass4[0] }}</span>
  197. </template>
  198. </el-table-column>
  199. <el-table-column label="10" align="center" width="60">
  200. <template slot-scope="scope">
  201. <span>{{ scope.row.pass4[1] }}</span>
  202. </template>
  203. </el-table-column>
  204. <el-table-column label="11" align="center" width="60">
  205. <template slot-scope="scope">
  206. <span>{{ scope.row.pass4[2] }}</span>
  207. </template>
  208. </el-table-column>
  209. <el-table-column label="11" align="center" width="60">
  210. <template slot-scope="scope">
  211. <span>{{ scope.row.pass4[3] }}</span>
  212. </template>
  213. </el-table-column>
  214. <el-table-column label="12" align="center" width="60">
  215. <template slot-scope="scope">
  216. <span>{{ scope.row.pass4[4] }}</span>
  217. </template>
  218. </el-table-column>
  219. <el-table-column label="12" align="center" width="60">
  220. <template slot-scope="scope">
  221. <span>{{ scope.row.pass4[5] }}</span>
  222. </template>
  223. </el-table-column>
  224. </el-table-column>
  225. <el-table-column label="操作" align="center" fixed="right" width="200" class-name="small-padding fixed-width">
  226. <template slot-scope="scope">
  227. <el-button
  228. size="mini"
  229. type="text"
  230. @click="handlePhoto(scope.row)"
  231. >现场照片</el-button>
  232. <el-button
  233. size="mini"
  234. type="text"
  235. icon="el-icon-edit"
  236. @click="handleUpdate(scope.row)"
  237. v-hasPermi="['production:pressure:edit']"
  238. >修改</el-button>
  239. <el-button
  240. size="mini"
  241. type="text"
  242. icon="el-icon-delete"
  243. @click="handleDelete(scope.row)"
  244. v-hasPermi="['production:pressure:remove']"
  245. >删除</el-button>
  246. </template>
  247. </el-table-column>
  248. </el-table>
  249. <pagination
  250. v-show="total>0"
  251. :total="total"
  252. :page.sync="queryParams.pageNum"
  253. :limit.sync="queryParams.pageSize"
  254. @pagination="getList"
  255. />
  256. <!-- 添加或修改裂解炉炉管测压对话框 -->
  257. <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
  258. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  259. <el-form-item label="裂解炉名称" prop="furnanceName">
  260. <el-input v-model="form.furnanceName" placeholder="请输入裂解炉名称" />
  261. </el-form-item>
  262. <el-form-item label="巡检日期" prop="recordTimeYmd">
  263. <el-date-picker clearable size="small" style="width: 200px"
  264. v-model="recordTimeYmd"
  265. type="date"
  266. value-format="yyyy-MM-dd"
  267. placeholder="选择巡检日期">
  268. </el-date-picker>
  269. </el-form-item>
  270. <el-form-item label="巡检时间" prop="recordTimeHms">
  271. <el-time-picker
  272. v-model="recordTimeHms"
  273. :picker-options="{selectableRange: '00:00:01 - 23:59:59'}"
  274. placeholder="请选择时间"
  275. value-format="HH:mm:ss"
  276. size="small"
  277. style="width: 200px">
  278. </el-time-picker>
  279. </el-form-item>
  280. <el-form-item label="班组">
  281. <el-select v-model="form.team" placeholder="请选择" size="small">
  282. <el-option
  283. v-for="item in teamOptions"
  284. :key="item.dictValue"
  285. :label="item.dictLabel"
  286. :value="item.dictValue">
  287. </el-option>
  288. </el-select>
  289. </el-form-item>
  290. <el-form-item label="记录人">
  291. <el-select v-model="form.recorder" placeholder="请选择" size="small">
  292. <el-option
  293. v-for="item in userList"
  294. :key="item.userId"
  295. :label="item.nickName"
  296. :value="item.userId">
  297. </el-option>
  298. </el-select>
  299. </el-form-item>
  300. <el-form-item label="状态">
  301. <el-select v-model="form.status" placeholder="请选择" size="small" @change="handleChange">
  302. <el-option
  303. v-for="item in statusOptions"
  304. :key="item.dictValue"
  305. :label="item.dictLabel"
  306. :value="item.dictValue">
  307. </el-option>
  308. </el-select>
  309. </el-form-item>
  310. <el-form-item label="归属部门" prop="deptId">
  311. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
  312. </el-form-item>
  313. </el-form>
  314. <el-descriptions title="PASS1出口" direction="vertical" :column="7" border>
  315. <el-descriptions-item label="入口">
  316. <el-input v-model="pass1[6]"/>
  317. </el-descriptions-item>
  318. <el-descriptions-item label="1">
  319. <el-input v-model="pass1[0]"/>
  320. </el-descriptions-item>
  321. <el-descriptions-item label="1">
  322. <el-input v-model="pass1[1]"/>
  323. </el-descriptions-item>
  324. <el-descriptions-item label="2">
  325. <el-input v-model="pass1[2]"/>
  326. </el-descriptions-item>
  327. <el-descriptions-item label="2">
  328. <el-input v-model="pass1[3]"/>
  329. </el-descriptions-item>
  330. <el-descriptions-item label="3">
  331. <el-input v-model="pass1[4]"/>
  332. </el-descriptions-item>
  333. <el-descriptions-item label="3">
  334. <el-input v-model="pass1[5]"/>
  335. </el-descriptions-item>
  336. </el-descriptions><br/>
  337. <el-descriptions title="PASS2出口" direction="vertical" :column="7" border>
  338. <el-descriptions-item label="入口">
  339. <el-input v-model="pass2[6]"/>
  340. </el-descriptions-item>
  341. <el-descriptions-item label="4">
  342. <el-input v-model="pass2[0]"/>
  343. </el-descriptions-item>
  344. <el-descriptions-item label="4">
  345. <el-input v-model="pass2[1]"/>
  346. </el-descriptions-item>
  347. <el-descriptions-item label="5">
  348. <el-input v-model="pass2[2]"/>
  349. </el-descriptions-item>
  350. <el-descriptions-item label="5">
  351. <el-input v-model="pass2[3]"/>
  352. </el-descriptions-item>
  353. <el-descriptions-item label="6">
  354. <el-input v-model="pass2[4]"/>
  355. </el-descriptions-item>
  356. <el-descriptions-item label="6">
  357. <el-input v-model="pass2[5]"/>
  358. </el-descriptions-item>
  359. </el-descriptions><br/>
  360. <el-descriptions title="PASS3出口" direction="vertical" :column="7" border>
  361. <el-descriptions-item label="入口">
  362. <el-input v-model="pass3[6]"/>
  363. </el-descriptions-item>
  364. <el-descriptions-item label="7">
  365. <el-input v-model="pass3[0]"/>
  366. </el-descriptions-item>
  367. <el-descriptions-item label="7">
  368. <el-input v-model="pass3[1]"/>
  369. </el-descriptions-item>
  370. <el-descriptions-item label="8">
  371. <el-input v-model="pass3[2]"/>
  372. </el-descriptions-item>
  373. <el-descriptions-item label="8">
  374. <el-input v-model="pass3[3]"/>
  375. </el-descriptions-item>
  376. <el-descriptions-item label="9">
  377. <el-input v-model="pass3[4]"/>
  378. </el-descriptions-item>
  379. <el-descriptions-item label="9">
  380. <el-input v-model="pass3[5]"/>
  381. </el-descriptions-item>
  382. </el-descriptions><br/>
  383. <el-descriptions title="PASS4出口" direction="vertical" :column="7" border>
  384. <el-descriptions-item label="入口">
  385. <el-input v-model="pass4[6]"/>
  386. </el-descriptions-item>
  387. <el-descriptions-item label="10">
  388. <el-input v-model="pass4[0]"/>
  389. </el-descriptions-item>
  390. <el-descriptions-item label="10">
  391. <el-input v-model="pass4[1]"/>
  392. </el-descriptions-item>
  393. <el-descriptions-item label="11">
  394. <el-input v-model="pass4[2]"/>
  395. </el-descriptions-item>
  396. <el-descriptions-item label="11">
  397. <el-input v-model="pass4[3]"/>
  398. </el-descriptions-item>
  399. <el-descriptions-item label="12">
  400. <el-input v-model="pass4[4]"/>
  401. </el-descriptions-item>
  402. <el-descriptions-item label="12">
  403. <el-input v-model="pass4[5]"/>
  404. </el-descriptions-item>
  405. </el-descriptions>
  406. <div slot="footer" class="dialog-footer">
  407. <el-button type="primary" @click="submitForm">确 定</el-button>
  408. <el-button @click="cancel">取 消</el-button>
  409. </div>
  410. </el-dialog>
  411. <!-- 用户导入对话框 -->
  412. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  413. <el-upload
  414. ref="upload"
  415. :limit="1"
  416. accept=".xlsx, .xls"
  417. :headers="upload.headers"
  418. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  419. :disabled="upload.isUploading"
  420. :on-progress="handleFileUploadProgress"
  421. :on-success="handleFileSuccess"
  422. :auto-upload="false"
  423. drag
  424. >
  425. <i class="el-icon-upload"></i>
  426. <div class="el-upload__text">
  427. 将文件拖到此处,或
  428. <em>点击上传</em>
  429. </div>
  430. <div class="el-upload__tip" slot="tip">
  431. <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
  432. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  433. </div>
  434. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  435. </el-upload>
  436. <div slot="footer" class="dialog-footer">
  437. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  438. <el-button @click="upload.open = false">取 消</el-button>
  439. </div>
  440. </el-dialog>
  441. <!-- 现场照片 -->
  442. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="800px" append-to-body >
  443. <el-tabs tab-position="left">
  444. <el-tab-pane label="PASS1">
  445. <el-upload ref="doc"
  446. :limit="1"
  447. :headers="doc.headers"
  448. :action="doc.url + '?pType=furnancePressurePass1&pId=' + doc.pId"
  449. :disabled="doc.isUploading"
  450. :on-progress="handleFileDocProgress"
  451. :on-success="handleFileDocSuccess"
  452. :auto-upload="true"
  453. drag
  454. >
  455. <i class="el-icon-upload"></i>
  456. <div class="el-upload__text">
  457. {{ $t('将文件拖到此处,或') }}
  458. <em>{{ $t('点击上传') }}</em>
  459. </div>
  460. </el-upload>
  461. <el-table :data="doc.commonfileList1" border>
  462. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  463. <template slot-scope="scope">
  464. <a class="link-type" @click="handleDownload(scope.row)">
  465. <span>{{ scope.row.fileName }}</span>
  466. </a>
  467. </template>
  468. </el-table-column>
  469. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  470. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  471. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  472. <template slot-scope="scope">
  473. <el-button
  474. size="mini"
  475. type="text"
  476. icon="el-icon-download"
  477. @click="handleDownload(scope.row)"
  478. >{{ $t('下载') }}</el-button>
  479. <el-button
  480. size="mini"
  481. type="text"
  482. icon="el-icon-delete"
  483. @click="handleDeleteDoc(scope.row)"
  484. >{{ $t('删除') }}</el-button>
  485. </template>
  486. </el-table-column>
  487. </el-table>
  488. </el-tab-pane>
  489. <el-tab-pane label="PASS2">
  490. <el-upload ref="doc"
  491. :limit="1"
  492. :headers="doc.headers"
  493. :action="doc.url + '?pType=furnancePressurePass2&pId=' + doc.pId"
  494. :disabled="doc.isUploading"
  495. :on-progress="handleFileDocProgress"
  496. :on-success="handleFileDocSuccess"
  497. :auto-upload="true"
  498. drag
  499. >
  500. <i class="el-icon-upload"></i>
  501. <div class="el-upload__text">
  502. {{ $t('将文件拖到此处,或') }}
  503. <em>{{ $t('点击上传') }}</em>
  504. </div>
  505. </el-upload>
  506. <el-table :data="doc.commonfileList2" border>
  507. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  508. <template slot-scope="scope">
  509. <a class="link-type" @click="handleDownload(scope.row)">
  510. <span>{{ scope.row.fileName }}</span>
  511. </a>
  512. </template>
  513. </el-table-column>
  514. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  515. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  516. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  517. <template slot-scope="scope">
  518. <el-button
  519. size="mini"
  520. type="text"
  521. icon="el-icon-download"
  522. @click="handleDownload(scope.row)"
  523. >{{ $t('下载') }}</el-button>
  524. <el-button
  525. size="mini"
  526. type="text"
  527. icon="el-icon-delete"
  528. @click="handleDeleteDoc(scope.row)"
  529. >{{ $t('删除') }}</el-button>
  530. </template>
  531. </el-table-column>
  532. </el-table>
  533. </el-tab-pane>
  534. <el-tab-pane label="PASS3">
  535. <el-upload ref="doc"
  536. :limit="1"
  537. :headers="doc.headers"
  538. :action="doc.url + '?pType=furnancePressurePass3&pId=' + doc.pId"
  539. :disabled="doc.isUploading"
  540. :on-progress="handleFileDocProgress"
  541. :on-success="handleFileDocSuccess"
  542. :auto-upload="true"
  543. drag
  544. >
  545. <i class="el-icon-upload"></i>
  546. <div class="el-upload__text">
  547. {{ $t('将文件拖到此处,或') }}
  548. <em>{{ $t('点击上传') }}</em>
  549. </div>
  550. </el-upload>
  551. <el-table :data="doc.commonfileList3" border>
  552. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  553. <template slot-scope="scope">
  554. <a class="link-type" @click="handleDownload(scope.row)">
  555. <span>{{ scope.row.fileName }}</span>
  556. </a>
  557. </template>
  558. </el-table-column>
  559. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  560. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  561. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  562. <template slot-scope="scope">
  563. <el-button
  564. size="mini"
  565. type="text"
  566. icon="el-icon-download"
  567. @click="handleDownload(scope.row)"
  568. >{{ $t('下载') }}</el-button>
  569. <el-button
  570. size="mini"
  571. type="text"
  572. icon="el-icon-delete"
  573. @click="handleDeleteDoc(scope.row)"
  574. >{{ $t('删除') }}</el-button>
  575. </template>
  576. </el-table-column>
  577. </el-table>
  578. </el-tab-pane>
  579. <el-tab-pane label="PASS4">
  580. <el-upload ref="doc"
  581. :limit="1"
  582. :headers="doc.headers"
  583. :action="doc.url + '?pType=furnancePressurePass4&pId=' + doc.pId"
  584. :disabled="doc.isUploading"
  585. :on-progress="handleFileDocProgress"
  586. :on-success="handleFileDocSuccess"
  587. :auto-upload="true"
  588. drag
  589. >
  590. <i class="el-icon-upload"></i>
  591. <div class="el-upload__text">
  592. {{ $t('将文件拖到此处,或') }}
  593. <em>{{ $t('点击上传') }}</em>
  594. </div>
  595. </el-upload>
  596. <el-table :data="doc.commonfileList4" border>
  597. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  598. <template slot-scope="scope">
  599. <a class="link-type" @click="handleDownload(scope.row)">
  600. <span>{{ scope.row.fileName }}</span>
  601. </a>
  602. </template>
  603. </el-table-column>
  604. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  605. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  606. <el-table-column :label="$t('操作')" align="center" width="220" class-name="small-padding fixed-width">
  607. <template slot-scope="scope">
  608. <el-button
  609. size="mini"
  610. type="text"
  611. icon="el-icon-download"
  612. @click="handleDownload(scope.row)"
  613. >{{ $t('下载') }}</el-button>
  614. <el-button
  615. size="mini"
  616. type="text"
  617. icon="el-icon-delete"
  618. @click="handleDeleteDoc(scope.row)"
  619. >{{ $t('删除') }}</el-button>
  620. </template>
  621. </el-table-column>
  622. </el-table>
  623. </el-tab-pane>
  624. </el-tabs>
  625. <div slot="footer" class="dialog-footer">
  626. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  627. </div>
  628. </el-dialog>
  629. </div>
  630. </template>
  631. <script>
  632. import { listPressure, getPressure, delPressure, addPressure, updatePressure, exportPressure, importTemplate} from "@/api/production/pressure";
  633. import { treeselect } from "@/api/system/dept";
  634. import { getToken } from "@/utils/auth";
  635. import Treeselect from "@riophae/vue-treeselect";
  636. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  637. import { listUserNoPage, getUserId } from "@/api/system/user";
  638. import {addCommonfile, allFileListFuzzy, delCommonfile, updateCommonfile} from "@/api/common/commonfile";
  639. export default {
  640. name: "Pressure",
  641. components: { Treeselect },
  642. data() {
  643. return {
  644. // 遮罩层
  645. loading: true,
  646. // 选中数组
  647. ids: [],
  648. // 非单个禁用
  649. single: true,
  650. // 非多个禁用
  651. multiple: true,
  652. // 显示搜索条件
  653. showSearch: true,
  654. // 总条数
  655. total: 0,
  656. // 裂解炉炉管测压表格数据
  657. pressureList: [],
  658. // 弹出层标题
  659. title: "",
  660. // 部门树选项
  661. deptOptions: undefined,
  662. clientHeight:300,
  663. // 是否显示弹出层
  664. open: false,
  665. // 用户导入参数
  666. upload: {
  667. // 是否显示弹出层(用户导入)
  668. open: false,
  669. // 弹出层标题(用户导入)
  670. title: "",
  671. // 是否禁用上传
  672. isUploading: false,
  673. // 是否更新已经存在的用户数据
  674. updateSupport: 0,
  675. // 设置上传的请求头部
  676. headers: { Authorization: "Bearer " + getToken() },
  677. // 上传的地址
  678. url: process.env.VUE_APP_BASE_API + "/production/pressure/importData"
  679. },
  680. // 查询参数
  681. queryParams: {
  682. pageNum: 1,
  683. pageSize: 20,
  684. furnanceName: null,
  685. recordTime: null,
  686. pass1: null,
  687. pass2: null,
  688. pass3: null,
  689. pass4: null,
  690. pass5: null,
  691. pass6: null,
  692. pass7: null,
  693. pass8: null,
  694. pass9: null,
  695. pass10: null,
  696. pass11: null,
  697. pass12: null,
  698. pass13: null,
  699. pass14: null,
  700. pass15: null,
  701. pass16: null,
  702. deptId: null,
  703. },
  704. recordTime: null,
  705. // 表单参数
  706. form: {},
  707. pass1:[],
  708. pass2:[],
  709. pass3:[],
  710. pass4:[],
  711. pass5:[],
  712. pass6:[],
  713. pass7:[],
  714. pass8:[],
  715. pass9:[],
  716. pass10:[],
  717. pass11:[],
  718. pass12:[],
  719. pass13:[],
  720. pass14:[],
  721. pass15:[],
  722. pass16:[],
  723. // 表单校验
  724. rules: {
  725. id: [
  726. { required: true, message: "主键id不能为空", trigger: "blur" }
  727. ],
  728. },
  729. // 状态字典
  730. statusOptions: [],
  731. // 班组字典
  732. teamOptions: [],
  733. recordTimeYmd: null,
  734. recordTimeHms: null,
  735. // 用户列表
  736. userList: [],doc: {
  737. file: "",
  738. // 是否显示弹出层(报告附件)
  739. open: false,
  740. // 弹出层标题(报告附件)
  741. title: "附件",
  742. // 是否禁用上传
  743. isUploading: false,
  744. // 是否更新已经存在的用户数据
  745. updateSupport: 0,
  746. // 报告附件上传位置编号
  747. ids: 0,
  748. // 设置上传的请求头部
  749. headers: { Authorization: "Bearer " + getToken() },
  750. // 上传的地址
  751. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  752. commonfileList1: null,
  753. commonfileList2: null,
  754. commonfileList3: null,
  755. commonfileList4: null,
  756. queryParams: {
  757. pId: null
  758. },
  759. pId: null,
  760. form: {}
  761. },
  762. };
  763. },
  764. watch: {
  765. // 根据名称筛选部门树
  766. deptName(val) {
  767. this.$refs.tree.filter(val);
  768. }
  769. },
  770. created() {
  771. //设置表格高度对应屏幕高度
  772. this.$nextTick(() => {
  773. this.clientHeight = document.body.clientHeight -250
  774. })
  775. // this.getList();
  776. this.getTreeselect();
  777. this.getDicts("FURNANCE_STATUS").then(response => {
  778. this.statusOptions = response.data;
  779. });
  780. this.getDicts("TEAM_DIVIDE").then(response => {
  781. this.teamOptions = response.data;
  782. });
  783. this.listUser();
  784. },
  785. methods: {
  786. init() {
  787. this.getList();
  788. },
  789. // 现场照片
  790. handlePhoto(row) {
  791. this.doc.id = row.id;
  792. this.doc.title = row.furnanceName + " " + row.recordTime + " 现场照片";
  793. this.doc.open = true;
  794. this.doc.queryParams.pId = row.id
  795. this.doc.pId = row.id
  796. this.doc.commonfileList1 = null;
  797. this.doc.commonfileList2 = null;
  798. this.doc.commonfileList3 = null;
  799. this.doc.commonfileList4 = null;
  800. this.getFileList1();
  801. this.getFileList2();
  802. this.getFileList3();
  803. this.getFileList4();
  804. },
  805. getFileList1() {
  806. allFileListFuzzy({
  807. "pId": this.doc.queryParams.pId,
  808. "pType": "furnancePressurePass1"
  809. }).then(response => {
  810. this.doc.commonfileList1 = response;
  811. });
  812. },
  813. getFileList2() {
  814. allFileListFuzzy({
  815. "pId": this.doc.queryParams.pId,
  816. "pType": "furnancePressurePass2"
  817. }).then(response => {
  818. this.doc.commonfileList2 = response;
  819. });
  820. },
  821. getFileList3() {
  822. allFileListFuzzy({
  823. "pId": this.doc.queryParams.pId,
  824. "pType": "furnancePressurePass3"
  825. }).then(response => {
  826. this.doc.commonfileList3 = response;
  827. });
  828. },
  829. getFileList4() {
  830. allFileListFuzzy({
  831. "pId": this.doc.queryParams.pId,
  832. "pType": "furnancePressurePass4"
  833. }).then(response => {
  834. this.doc.commonfileList4 = response;
  835. });
  836. },
  837. //附件上传中处理
  838. handleFileDocProgress(event, file, fileList) {
  839. this.doc.file = file;
  840. this.doc.isUploading = true;
  841. },
  842. //附件上传成功处理
  843. handleFileDocSuccess(response, file, fileList) {
  844. this.doc.isUploading = false;
  845. this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  846. this.getFileList1()
  847. this.getFileList2()
  848. this.getFileList3()
  849. this.getFileList4()
  850. },
  851. // 文件下载处理
  852. handleDownload(row) {
  853. var name = row.fileName;
  854. var url = row.fileUrl;
  855. var suffix = url.substring(url.lastIndexOf("."), url.length);
  856. const a = document.createElement('a')
  857. a.setAttribute('download', name)
  858. a.setAttribute('target', '_blank')
  859. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  860. a.click()
  861. },
  862. /** 删除按钮操作 */
  863. handleDeleteDoc(row) {
  864. const ids = row.id || this.ids;
  865. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  866. confirmButtonText: this.$t('确定'),
  867. cancelButtonText: this.$t('取消'),
  868. type: "warning"
  869. }).then(function () {
  870. return delCommonfile(ids);
  871. }).then(() => {
  872. this.getFileList1();
  873. this.getFileList2();
  874. this.getFileList3();
  875. this.getFileList4();
  876. this.msgSuccess(this.$t('删除成功'));
  877. })
  878. },
  879. listUser() {
  880. listUserNoPage().then(response => {
  881. this.userList = response.data;
  882. });
  883. },
  884. // 班值字典翻译
  885. teamFormat(row, column) {
  886. return this.selectDictLabel(this.teamOptions, row.team);
  887. },
  888. // 字典翻译
  889. statusFormat(row, column) {
  890. return this.selectDictLabel(this.statusOptions, row.status);
  891. },
  892. handleChange() {
  893. if (this.form.status === '1') {
  894. this.pass1 = ["0", "0", "0", "0", "0", "0", "0"];
  895. this.pass2 = ["0", "0", "0", "0", "0", "0", "0"];
  896. this.pass3 = ["0", "0", "0", "0", "0", "0", "0"];
  897. this.pass4 = ["0", "0", "0", "0", "0", "0", "0"];
  898. this.pass5 = ["0", "0", "0", "0", "0", "0", "0"];
  899. this.pass6 = ["0", "0", "0", "0", "0", "0", "0"];
  900. this.pass7 = ["0", "0", "0", "0", "0", "0", "0"];
  901. this.pass8 = ["0", "0", "0", "0", "0", "0", "0"];
  902. this.pass9 = ["0", "0", "0", "0", "0", "0", "0"];
  903. this.pass10 = ["0", "0", "0", "0", "0", "0", "0"];
  904. this.pass11 = ["0", "0", "0", "0", "0", "0", "0"];
  905. this.pass12 = ["0", "0", "0", "0", "0", "0", "0"];
  906. this.pass13 = ["0", "0", "0", "0", "0", "0", "0"];
  907. this.pass14 = ["0", "0", "0", "0", "0", "0", "0"];
  908. this.pass15 = ["0", "0", "0", "0", "0", "0", "0"];
  909. this.pass16 = ["0", "0", "0", "0", "0", "0", "0"];
  910. } else {
  911. this.pass1 = [];
  912. this.pass2 = [];
  913. this.pass3 = [];
  914. this.pass4 = [];
  915. this.pass5 = [];
  916. this.pass6 = [];
  917. this.pass7 = [];
  918. this.pass8 = [];
  919. this.pass9 = [];
  920. this.pass10 = [];
  921. this.pass11 = [];
  922. this.pass12 = [];
  923. this.pass13 = [];
  924. this.pass14 = [];
  925. this.pass15 = [];
  926. this.pass16 = [];
  927. }
  928. },
  929. /** 查询裂解炉炉管测压列表 */
  930. getList() {
  931. this.loading = true;
  932. this.queryParams.furnanceName = "H130";
  933. listPressure(this.queryParams).then(response => {
  934. for (let i = 0; i< response.rows.length; i++) {
  935. if (response.rows[i].pass1 == null) { response.rows[i].pass1 = []; } else { response.rows[i].pass1 = response.rows[i].pass1.split(','); }
  936. if (response.rows[i].pass2 == null) { response.rows[i].pass2 = []; } else { response.rows[i].pass2 = response.rows[i].pass2.split(','); }
  937. if (response.rows[i].pass3 == null) { response.rows[i].pass3 = []; } else { response.rows[i].pass3 = response.rows[i].pass3.split(','); }
  938. if (response.rows[i].pass4 == null) { response.rows[i].pass4 = []; } else { response.rows[i].pass4 = response.rows[i].pass4.split(','); }
  939. if (response.rows[i].pass5 == null) { response.rows[i].pass5 = []; } else { response.rows[i].pass5 = response.rows[i].pass5.split(','); }
  940. if (response.rows[i].pass6 == null) { response.rows[i].pass6 = []; } else { response.rows[i].pass6 = response.rows[i].pass6.split(','); }
  941. if (response.rows[i].pass7 == null) { response.rows[i].pass7 = []; } else { response.rows[i].pass7 = response.rows[i].pass7.split(','); }
  942. if (response.rows[i].pass8 == null) { response.rows[i].pass8 = []; } else { response.rows[i].pass8 = response.rows[i].pass8.split(','); }
  943. }
  944. this.pressureList = response.rows;
  945. this.total = response.total;
  946. this.loading = false;
  947. });
  948. },
  949. /** 查询部门下拉树结构 */
  950. getTreeselect() {
  951. treeselect().then(response => {
  952. this.deptOptions = response.data;
  953. });
  954. },
  955. // 取消按钮
  956. cancel() {
  957. this.open = false;
  958. this.reset();
  959. },
  960. // 表单重置
  961. reset() {
  962. this.form = {
  963. id: null,
  964. furnanceName: null,
  965. recordTime: null,
  966. pass1: null,
  967. pass2: null,
  968. pass3: null,
  969. pass4: null,
  970. pass5: null,
  971. pass6: null,
  972. pass7: null,
  973. pass8: null,
  974. pass9: null,
  975. pass10: null,
  976. pass11: null,
  977. pass12: null,
  978. pass13: null,
  979. pass14: null,
  980. pass15: null,
  981. pass16: null,
  982. deptId: null,
  983. delFlag: null,
  984. createBy: null,
  985. createTime: null,
  986. updateBy: null,
  987. updateTime: null,
  988. };
  989. this.pass1 = [];
  990. this.pass2 = [];
  991. this.pass3 = [];
  992. this.pass4 = [];
  993. this.pass5 = [];
  994. this.pass6 = [];
  995. this.pass7 = [];
  996. this.pass8 = [];
  997. this.pass9 = [];
  998. this.pass10 = [];
  999. this.pass11 = [];
  1000. this.pass12 = [];
  1001. this.pass13 = [];
  1002. this.pass14 = [];
  1003. this.pass15 = [];
  1004. this.pass16 = [];
  1005. this.resetForm("form");
  1006. },
  1007. /** 搜索按钮操作 */
  1008. handleQuery() {
  1009. this.queryParams.pageNum = 1;
  1010. this.getList();
  1011. },
  1012. /** 重置按钮操作 */
  1013. resetQuery() {
  1014. this.resetForm("queryForm");
  1015. this.handleQuery();
  1016. },
  1017. // 多选框选中数据
  1018. handleSelectionChange(selection) {
  1019. this.ids = selection.map(item => item.id)
  1020. this.single = selection.length!==1
  1021. this.multiple = !selection.length
  1022. },
  1023. /** 新增按钮操作 */
  1024. handleAdd() {
  1025. this.reset();
  1026. getUserId().then(response => {
  1027. this.form.recorder = response.data;
  1028. this.form.furnanceName = "H130";
  1029. this.open = true;
  1030. this.title = "添加裂解炉炉管测压";
  1031. });
  1032. },
  1033. /** 修改按钮操作 */
  1034. handleUpdate(row) {
  1035. this.reset();
  1036. const id = row.id || this.ids
  1037. getPressure(id).then(response => {
  1038. this.form = response.data;
  1039. let recordTime = new Date(this.form.recordTime);
  1040. this.recordTimeYmd = recordTime.getFullYear() + "-" + (recordTime.getMonth() + 1) + "-" + recordTime.getDate();
  1041. this.recordTimeHms = recordTime.getHours() + ":" + recordTime.getMinutes() + ":" + recordTime.getSeconds();
  1042. if (response.data.pass1 == null) { this.pass1 = []; } else { this.pass1 = response.data.pass1.split(','); }
  1043. if (response.data.pass2 == null) { this.pass2 = []; } else { this.pass2 = response.data.pass2.split(','); }
  1044. if (response.data.pass3 == null) { this.pass3 = []; } else { this.pass3 = response.data.pass3.split(','); }
  1045. if (response.data.pass4 == null) { this.pass4 = []; } else { this.pass4 = response.data.pass4.split(','); }
  1046. if (response.data.pass5 == null) { this.pass5 = []; } else { this.pass5 = response.data.pass5.split(','); }
  1047. if (response.data.pass6 == null) { this.pass6 = []; } else { this.pass6 = response.data.pass6.split(','); }
  1048. if (response.data.pass7 == null) { this.pass7 = []; } else { this.pass7 = response.data.pass7.split(','); }
  1049. if (response.data.pass8 == null) { this.pass8 = []; } else { this.pass8 = response.data.pass8.split(','); }
  1050. this.open = true;
  1051. this.title = "修改裂解炉炉管测压";
  1052. });
  1053. },
  1054. /** 提交按钮 */
  1055. submitForm() {
  1056. this.form.pass1 = this.pass1.join(",");
  1057. this.form.pass2 = this.pass2.join(",");
  1058. this.form.pass3 = this.pass3.join(",");
  1059. this.form.pass4 = this.pass4.join(",");
  1060. this.form.pass5 = this.pass5.join(",");
  1061. this.form.pass6 = this.pass6.join(",");
  1062. this.form.pass7 = this.pass7.join(",");
  1063. this.form.pass8 = this.pass8.join(",");
  1064. this.form.pass9 = this.pass9.join(",");
  1065. this.form.pass10 = this.pass10.join(",");
  1066. this.form.pass11 = this.pass11.join(",");
  1067. this.form.pass12 = this.pass12.join(",");
  1068. this.form.pass13 = this.pass13.join(",");
  1069. this.form.pass14 = this.pass14.join(",");
  1070. this.form.pass15 = this.pass15.join(",");
  1071. this.form.pass16 = this.pass16.join(",");
  1072. this.form.recordTime = this.recordTimeYmd + " " + this.recordTimeHms;
  1073. this.$refs["form"].validate(valid => {
  1074. if (valid) {
  1075. if (this.form.id != null) {
  1076. updatePressure(this.form).then(response => {
  1077. this.msgSuccess("修改成功");
  1078. this.open = false;
  1079. this.getList();
  1080. });
  1081. } else {
  1082. addPressure(this.form).then(response => {
  1083. this.msgSuccess("新增成功");
  1084. this.open = false;
  1085. this.getList();
  1086. });
  1087. }
  1088. }
  1089. });
  1090. },
  1091. /** 删除按钮操作 */
  1092. handleDelete(row) {
  1093. const ids = row.id || this.ids;
  1094. this.$confirm('是否确认删除?', "警告", {
  1095. confirmButtonText: "确定",
  1096. cancelButtonText: "取消",
  1097. type: "warning"
  1098. }).then(function() {
  1099. return delPressure(ids);
  1100. }).then(() => {
  1101. this.getList();
  1102. this.msgSuccess("删除成功");
  1103. })
  1104. },
  1105. /** 导出按钮操作 */
  1106. handleExport() {
  1107. const queryParams = this.queryParams;
  1108. this.$confirm('是否确认导出所有裂解炉炉管测压数据项?', "警告", {
  1109. confirmButtonText: "确定",
  1110. cancelButtonText: "取消",
  1111. type: "warning"
  1112. }).then(function() {
  1113. return exportPressure(queryParams);
  1114. }).then(response => {
  1115. this.download(response.msg);
  1116. })
  1117. },
  1118. /** 导入按钮操作 */
  1119. handleImport() {
  1120. this.upload.title = "用户导入";
  1121. this.upload.open = true;
  1122. },
  1123. /** 下载模板操作 */
  1124. importTemplate() {
  1125. importTemplate().then(response => {
  1126. this.download(response.msg);
  1127. });
  1128. },
  1129. // 文件上传中处理
  1130. handleFileUploadProgress(event, file, fileList) {
  1131. this.upload.isUploading = true;
  1132. },
  1133. // 文件上传成功处理
  1134. handleFileSuccess(response, file, fileList) {
  1135. this.upload.open = false;
  1136. this.upload.isUploading = false;
  1137. this.$refs.upload.clearFiles();
  1138. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  1139. this.getList();
  1140. },
  1141. // 提交上传文件
  1142. submitFileForm() {
  1143. this.$refs.upload.submit();
  1144. }
  1145. }
  1146. };
  1147. </script>