h109.vue 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825
  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. >新增</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="100">
  71. <template slot-scope="scope">
  72. <span>{{ parseTime(scope.row.recordTime, '{y}-{m}-{d}') }}</span>
  73. </template>
  74. </el-table-column>
  75. <el-table-column label="PASS1出口左" align="center" prop="pass1" :show-overflow-tooltip="true">
  76. <el-table-column label="入口" align="center" width="60">
  77. <template slot-scope="scope">
  78. <span>{{ scope.row.pass1[14] }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  82. <template slot-scope="scope">
  83. <span>{{ scope.row.pass1[index] }}</span>
  84. </template>
  85. </el-table-column>
  86. </el-table-column>
  87. <el-table-column label="PASS1出口右" align="center" prop="pass2" :show-overflow-tooltip="true">
  88. <el-table-column label="入口" align="center" width="60">
  89. <template slot-scope="scope">
  90. <span>{{ scope.row.pass2[14] }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  94. <template slot-scope="scope">
  95. <span>{{ scope.row.pass2[index] }}</span>
  96. </template>
  97. </el-table-column>
  98. </el-table-column>
  99. <el-table-column label="PASS2出口左" align="center" prop="pass3" :show-overflow-tooltip="true">
  100. <el-table-column label="入口" align="center" width="60">
  101. <template slot-scope="scope">
  102. <span>{{ scope.row.pass3[14] }}</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  106. <template slot-scope="scope">
  107. <span>{{ scope.row.pass3[index] }}</span>
  108. </template>
  109. </el-table-column>
  110. </el-table-column>
  111. <el-table-column label="PASS2出口右" align="center" prop="pass4" :show-overflow-tooltip="true">
  112. <el-table-column label="入口" align="center" width="60">
  113. <template slot-scope="scope">
  114. <span>{{ scope.row.pass4[14] }}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  118. <template slot-scope="scope">
  119. <span>{{ scope.row.pass4[index] }}</span>
  120. </template>
  121. </el-table-column>
  122. </el-table-column>
  123. <el-table-column label="PASS3出口左" align="center" prop="pass5" :show-overflow-tooltip="true">
  124. <el-table-column label="入口" align="center" width="60">
  125. <template slot-scope="scope">
  126. <span>{{ scope.row.pass5[14] }}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  130. <template slot-scope="scope">
  131. <span>{{ scope.row.pass5[index] }}</span>
  132. </template>
  133. </el-table-column>
  134. </el-table-column>
  135. <el-table-column label="PASS3出口右" align="center" prop="pass6" :show-overflow-tooltip="true">
  136. <el-table-column label="入口" align="center" width="60">
  137. <template slot-scope="scope">
  138. <span>{{ scope.row.pass6[14] }}</span>
  139. </template>
  140. </el-table-column>
  141. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  142. <template slot-scope="scope">
  143. <span>{{ scope.row.pass6[index] }}</span>
  144. </template>
  145. </el-table-column>
  146. </el-table-column>
  147. <el-table-column label="PASS4出口左" align="center" prop="pass7" :show-overflow-tooltip="true">
  148. <el-table-column label="入口" align="center" width="60">
  149. <template slot-scope="scope">
  150. <span>{{ scope.row.pass7[14] }}</span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  154. <template slot-scope="scope">
  155. <span>{{ scope.row.pass7[index] }}</span>
  156. </template>
  157. </el-table-column>
  158. </el-table-column>
  159. <el-table-column label="PASS4出口右" align="center" prop="pass8" :show-overflow-tooltip="true">
  160. <el-table-column label="入口" align="center" width="60">
  161. <template slot-scope="scope">
  162. <span>{{ scope.row.pass8[14] }}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  166. <template slot-scope="scope">
  167. <span>{{ scope.row.pass8[index] }}</span>
  168. </template>
  169. </el-table-column>
  170. </el-table-column>
  171. <el-table-column label="PASS5出口左" align="center" prop="pass9" :show-overflow-tooltip="true">
  172. <el-table-column label="入口" align="center" width="60">
  173. <template slot-scope="scope">
  174. <span>{{ scope.row.pass9[14] }}</span>
  175. </template>
  176. </el-table-column>
  177. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  178. <template slot-scope="scope">
  179. <span>{{ scope.row.pass9[index] }}</span>
  180. </template>
  181. </el-table-column>
  182. </el-table-column>
  183. <el-table-column label="PASS5出口右" align="center" prop="pass10" :show-overflow-tooltip="true">
  184. <el-table-column label="入口" align="center" width="60">
  185. <template slot-scope="scope">
  186. <span>{{ scope.row.pass10[14] }}</span>
  187. </template>
  188. </el-table-column>
  189. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  190. <template slot-scope="scope">
  191. <span>{{ scope.row.pass10[index] }}</span>
  192. </template>
  193. </el-table-column>
  194. </el-table-column>
  195. <el-table-column label="PASS6出口左" align="center" prop="pass11" :show-overflow-tooltip="true">
  196. <el-table-column label="入口" align="center" width="60">
  197. <template slot-scope="scope">
  198. <span>{{ scope.row.pass11[14] }}</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  202. <template slot-scope="scope">
  203. <span>{{ scope.row.pass11[index] }}</span>
  204. </template>
  205. </el-table-column>
  206. </el-table-column>
  207. <el-table-column label="PASS6出口右" align="center" prop="pass12" :show-overflow-tooltip="true">
  208. <el-table-column label="入口" align="center" width="60">
  209. <template slot-scope="scope">
  210. <span>{{ scope.row.pass12[14] }}</span>
  211. </template>
  212. </el-table-column>
  213. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  214. <template slot-scope="scope">
  215. <span>{{ scope.row.pass12[index] }}</span>
  216. </template>
  217. </el-table-column>
  218. </el-table-column>
  219. <el-table-column label="PASS7出口左" align="center" prop="pass13" :show-overflow-tooltip="true">
  220. <el-table-column label="入口" align="center" width="60">
  221. <template slot-scope="scope">
  222. <span>{{ scope.row.pass13[14] }}</span>
  223. </template>
  224. </el-table-column>
  225. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  226. <template slot-scope="scope">
  227. <span>{{ scope.row.pass13[index] }}</span>
  228. </template>
  229. </el-table-column>
  230. </el-table-column>
  231. <el-table-column label="PASS7出口右" align="center" prop="pass14" :show-overflow-tooltip="true">
  232. <el-table-column label="入口" align="center" width="60">
  233. <template slot-scope="scope">
  234. <span>{{ scope.row.pass14[14] }}</span>
  235. </template>
  236. </el-table-column>
  237. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  238. <template slot-scope="scope">
  239. <span>{{ scope.row.pass14[index] }}</span>
  240. </template>
  241. </el-table-column>
  242. </el-table-column>
  243. <el-table-column label="PASS8出口左" align="center" prop="pass15" :show-overflow-tooltip="true">
  244. <el-table-column label="入口" align="center" width="60">
  245. <template slot-scope="scope">
  246. <span>{{ scope.row.pass15[14] }}</span>
  247. </template>
  248. </el-table-column>
  249. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  250. <template slot-scope="scope">
  251. <span>{{ scope.row.pass15[index] }}</span>
  252. </template>
  253. </el-table-column>
  254. </el-table-column>
  255. <el-table-column label="PASS8出口右" align="center" prop="pass16" :show-overflow-tooltip="true">
  256. <el-table-column label="入口" align="center" width="60">
  257. <template slot-scope="scope">
  258. <span>{{ scope.row.pass16[14] }}</span>
  259. </template>
  260. </el-table-column>
  261. <el-table-column v-for="(item,index) in 14" :label="(index+1).toString()" align="center" width="60">
  262. <template slot-scope="scope">
  263. <span>{{ scope.row.pass16[index] }}</span>
  264. </template>
  265. </el-table-column>
  266. </el-table-column>
  267. <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  268. <template slot-scope="scope">
  269. <el-button
  270. size="mini"
  271. type="text"
  272. icon="el-icon-edit"
  273. @click="handleUpdate(scope.row)"
  274. v-hasPermi="['production:pressure:edit']"
  275. >修改</el-button>
  276. <el-button
  277. size="mini"
  278. type="text"
  279. icon="el-icon-delete"
  280. @click="handleDelete(scope.row)"
  281. v-hasPermi="['production:pressure:remove']"
  282. >删除</el-button>
  283. </template>
  284. </el-table-column>
  285. </el-table>
  286. <pagination
  287. v-show="total>0"
  288. :total="total"
  289. :page.sync="queryParams.pageNum"
  290. :limit.sync="queryParams.pageSize"
  291. @pagination="getList"
  292. />
  293. <!-- 添加或修改裂解炉炉管测压对话框 -->
  294. <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
  295. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  296. <el-form-item label="裂解炉名称" prop="furnanceName">
  297. <el-input v-model="form.furnanceName" placeholder="请输入裂解炉名称" />
  298. </el-form-item>
  299. <el-form-item label="巡检日期" prop="recordTime">
  300. <el-date-picker clearable size="small" style="width: 200px"
  301. v-model="form.recordTime"
  302. type="date"
  303. value-format="yyyy-MM-dd"
  304. placeholder="选择巡检日期">
  305. </el-date-picker>
  306. </el-form-item>
  307. <el-form-item label="归属部门" prop="deptId">
  308. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
  309. </el-form-item>
  310. </el-form>
  311. <el-descriptions title="PASS1出口左" direction="vertical" :column="5" border>
  312. <el-descriptions-item label="入口">
  313. <el-input v-model="pass1[14]"/>
  314. </el-descriptions-item>
  315. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  316. <el-input v-model="pass1[index]"/>
  317. </el-descriptions-item>
  318. </el-descriptions><br/>
  319. <el-descriptions title="PASS1出口右" direction="vertical" :column="5" border>
  320. <el-descriptions-item label="入口">
  321. <el-input v-model="pass2[14]"/>
  322. </el-descriptions-item>
  323. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  324. <el-input v-model="pass2[index]"/>
  325. </el-descriptions-item>
  326. </el-descriptions><br/>
  327. <el-descriptions title="PASS2出口左" direction="vertical" :column="5" border>
  328. <el-descriptions-item label="入口">
  329. <el-input v-model="pass3[14]"/>
  330. </el-descriptions-item>
  331. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  332. <el-input v-model="pass3[index]"/>
  333. </el-descriptions-item>
  334. </el-descriptions><br/>
  335. <el-descriptions title="PASS2出口右" direction="vertical" :column="5" border>
  336. <el-descriptions-item label="入口">
  337. <el-input v-model="pass4[14]"/>
  338. </el-descriptions-item>
  339. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  340. <el-input v-model="pass4[index]"/>
  341. </el-descriptions-item>
  342. </el-descriptions><br/>
  343. <el-descriptions title="PASS3出口左" direction="vertical" :column="5" border>
  344. <el-descriptions-item label="入口">
  345. <el-input v-model="pass5[14]"/>
  346. </el-descriptions-item>
  347. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  348. <el-input v-model="pass5[index]"/>
  349. </el-descriptions-item>
  350. </el-descriptions><br/>
  351. <el-descriptions title="PASS3出口右" direction="vertical" :column="5" border>
  352. <el-descriptions-item label="入口">
  353. <el-input v-model="pass6[14]"/>
  354. </el-descriptions-item>
  355. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  356. <el-input v-model="pass6[index]"/>
  357. </el-descriptions-item>
  358. </el-descriptions><br/>
  359. <el-descriptions title="PASS4出口左" direction="vertical" :column="5" border>
  360. <el-descriptions-item label="入口">
  361. <el-input v-model="pass7[14]"/>
  362. </el-descriptions-item>
  363. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  364. <el-input v-model="pass7[index]"/>
  365. </el-descriptions-item>
  366. </el-descriptions><br/>
  367. <el-descriptions title="PASS4出口右" direction="vertical" :column="5" border>
  368. <el-descriptions-item label="入口">
  369. <el-input v-model="pass8[14]"/>
  370. </el-descriptions-item>
  371. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  372. <el-input v-model="pass8[index]"/>
  373. </el-descriptions-item>
  374. </el-descriptions><br/>
  375. <el-descriptions title="PASS5出口左" direction="vertical" :column="5" border>
  376. <el-descriptions-item label="入口">
  377. <el-input v-model="pass9[14]"/>
  378. </el-descriptions-item>
  379. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  380. <el-input v-model="pass9[index]"/>
  381. </el-descriptions-item>
  382. </el-descriptions><br/>
  383. <el-descriptions title="PASS5出口右" direction="vertical" :column="5" border>
  384. <el-descriptions-item label="入口">
  385. <el-input v-model="pass10[14]"/>
  386. </el-descriptions-item>
  387. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  388. <el-input v-model="pass10[index]"/>
  389. </el-descriptions-item>
  390. </el-descriptions><br/>
  391. <el-descriptions title="PASS6出口左" direction="vertical" :column="5" border>
  392. <el-descriptions-item label="入口">
  393. <el-input v-model="pass11[14]"/>
  394. </el-descriptions-item>
  395. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  396. <el-input v-model="pass11[index]"/>
  397. </el-descriptions-item>
  398. </el-descriptions><br/>
  399. <el-descriptions title="PASS6出口右" direction="vertical" :column="5" border>
  400. <el-descriptions-item label="入口">
  401. <el-input v-model="pass12[14]"/>
  402. </el-descriptions-item>
  403. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  404. <el-input v-model="pass12[index]"/>
  405. </el-descriptions-item>
  406. </el-descriptions><br/>
  407. <el-descriptions title="PASS7出口左" direction="vertical" :column="5" border>
  408. <el-descriptions-item label="入口">
  409. <el-input v-model="pass13[14]"/>
  410. </el-descriptions-item>
  411. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  412. <el-input v-model="pass13[index]"/>
  413. </el-descriptions-item>
  414. </el-descriptions><br/>
  415. <el-descriptions title="PASS7出口右" direction="vertical" :column="5" border>
  416. <el-descriptions-item label="入口">
  417. <el-input v-model="pass14[14]"/>
  418. </el-descriptions-item>
  419. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  420. <el-input v-model="pass14[index]"/>
  421. </el-descriptions-item>
  422. </el-descriptions><br/>
  423. <el-descriptions title="PASS8出口左" direction="vertical" :column="5" border>
  424. <el-descriptions-item label="入口">
  425. <el-input v-model="pass15[14]"/>
  426. </el-descriptions-item>
  427. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  428. <el-input v-model="pass15[index]"/>
  429. </el-descriptions-item>
  430. </el-descriptions><br/>
  431. <el-descriptions title="PASS8出口右" direction="vertical" :column="5" border>
  432. <el-descriptions-item label="入口">
  433. <el-input v-model="pass16[14]"/>
  434. </el-descriptions-item>
  435. <el-descriptions-item v-for="(item, index) in 14" :label="(index+1).toString()">
  436. <el-input v-model="pass16[index]"/>
  437. </el-descriptions-item>
  438. </el-descriptions>
  439. <div slot="footer" class="dialog-footer">
  440. <el-button type="primary" @click="submitForm">确 定</el-button>
  441. <el-button @click="cancel">取 消</el-button>
  442. </div>
  443. </el-dialog>
  444. <!-- 用户导入对话框 -->
  445. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  446. <el-upload
  447. ref="upload"
  448. :limit="1"
  449. accept=".xlsx, .xls"
  450. :headers="upload.headers"
  451. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  452. :disabled="upload.isUploading"
  453. :on-progress="handleFileUploadProgress"
  454. :on-success="handleFileSuccess"
  455. :auto-upload="false"
  456. drag
  457. >
  458. <i class="el-icon-upload"></i>
  459. <div class="el-upload__text">
  460. 将文件拖到此处,或
  461. <em>点击上传</em>
  462. </div>
  463. <div class="el-upload__tip" slot="tip">
  464. <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
  465. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  466. </div>
  467. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  468. </el-upload>
  469. <div slot="footer" class="dialog-footer">
  470. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  471. <el-button @click="upload.open = false">取 消</el-button>
  472. </div>
  473. </el-dialog>
  474. </div>
  475. </template>
  476. <script>
  477. import { listPressure, getPressure, delPressure, addPressure, updatePressure, exportPressure, importTemplate} from "@/api/production/pressure";
  478. import { treeselect } from "@/api/system/dept";
  479. import { getToken } from "@/utils/auth";
  480. import Treeselect from "@riophae/vue-treeselect";
  481. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  482. export default {
  483. name: "Pressure",
  484. components: { Treeselect },
  485. data() {
  486. return {
  487. // 遮罩层
  488. loading: true,
  489. // 选中数组
  490. ids: [],
  491. // 非单个禁用
  492. single: true,
  493. // 非多个禁用
  494. multiple: true,
  495. // 显示搜索条件
  496. showSearch: true,
  497. // 总条数
  498. total: 0,
  499. // 裂解炉炉管测压表格数据
  500. pressureList: [],
  501. // 弹出层标题
  502. title: "",
  503. // 部门树选项
  504. deptOptions: undefined,
  505. clientHeight:300,
  506. // 是否显示弹出层
  507. open: false,
  508. // 用户导入参数
  509. upload: {
  510. // 是否显示弹出层(用户导入)
  511. open: false,
  512. // 弹出层标题(用户导入)
  513. title: "",
  514. // 是否禁用上传
  515. isUploading: false,
  516. // 是否更新已经存在的用户数据
  517. updateSupport: 0,
  518. // 设置上传的请求头部
  519. headers: { Authorization: "Bearer " + getToken() },
  520. // 上传的地址
  521. url: process.env.VUE_APP_BASE_API + "/production/pressure/importData"
  522. },
  523. // 查询参数
  524. queryParams: {
  525. pageNum: 1,
  526. pageSize: 20,
  527. furnanceName: null,
  528. recordTime: null,
  529. pass1: null,
  530. pass2: null,
  531. pass3: null,
  532. pass4: null,
  533. pass5: null,
  534. pass6: null,
  535. pass7: null,
  536. pass8: null,
  537. pass9: null,
  538. pass10: null,
  539. pass11: null,
  540. pass12: null,
  541. pass13: null,
  542. pass14: null,
  543. pass15: null,
  544. pass16: null,
  545. deptId: null,
  546. },
  547. recordTime: null,
  548. // 表单参数
  549. form: {},
  550. pass1:[],
  551. pass2:[],
  552. pass3:[],
  553. pass4:[],
  554. pass5:[],
  555. pass6:[],
  556. pass7:[],
  557. pass8:[],
  558. pass9:[],
  559. pass10:[],
  560. pass11:[],
  561. pass12:[],
  562. pass13:[],
  563. pass14:[],
  564. pass15:[],
  565. pass16:[],
  566. // 表单校验
  567. rules: {
  568. id: [
  569. { required: true, message: "主键id不能为空", trigger: "blur" }
  570. ],
  571. }
  572. };
  573. },
  574. watch: {
  575. // 根据名称筛选部门树
  576. deptName(val) {
  577. this.$refs.tree.filter(val);
  578. }
  579. },
  580. created() {
  581. //设置表格高度对应屏幕高度
  582. this.$nextTick(() => {
  583. this.clientHeight = document.body.clientHeight -250
  584. })
  585. // this.getList();
  586. // this.getTreeselect();
  587. },
  588. methods: {
  589. init() {
  590. this.getList();
  591. },
  592. /** 查询裂解炉炉管测压列表 */
  593. getList() {
  594. this.loading = true;
  595. this.queryParams.furnanceName = "H109";
  596. listPressure(this.queryParams).then(response => {
  597. for (let i = 0; i< response.rows.length; i++) {
  598. if (response.rows[i].pass1 == null) { response.rows[i].pass1 = []; } else { response.rows[i].pass1 = response.rows[i].pass1.split(','); }
  599. if (response.rows[i].pass2 == null) { response.rows[i].pass2 = []; } else { response.rows[i].pass2 = response.rows[i].pass2.split(','); }
  600. if (response.rows[i].pass3 == null) { response.rows[i].pass3 = []; } else { response.rows[i].pass3 = response.rows[i].pass3.split(','); }
  601. if (response.rows[i].pass4 == null) { response.rows[i].pass4 = []; } else { response.rows[i].pass4 = response.rows[i].pass4.split(','); }
  602. if (response.rows[i].pass5 == null) { response.rows[i].pass5 = []; } else { response.rows[i].pass5 = response.rows[i].pass5.split(','); }
  603. if (response.rows[i].pass6 == null) { response.rows[i].pass6 = []; } else { response.rows[i].pass6 = response.rows[i].pass6.split(','); }
  604. if (response.rows[i].pass7 == null) { response.rows[i].pass7 = []; } else { response.rows[i].pass7 = response.rows[i].pass7.split(','); }
  605. if (response.rows[i].pass8 == null) { response.rows[i].pass8 = []; } else { response.rows[i].pass8 = response.rows[i].pass8.split(','); }
  606. if (response.rows[i].pass9 == null) { response.rows[i].pass9 = []; } else { response.rows[i].pass9 = response.rows[i].pass9.split(','); }
  607. if (response.rows[i].pass10 == null) { response.rows[i].pass10 = []; } else { response.rows[i].pass10 = response.rows[i].pass10.split(','); }
  608. if (response.rows[i].pass11 == null) { response.rows[i].pass11 = []; } else { response.rows[i].pass11 = response.rows[i].pass11.split(','); }
  609. if (response.rows[i].pass12 == null) { response.rows[i].pass12 = []; } else { response.rows[i].pass12 = response.rows[i].pass12.split(','); }
  610. if (response.rows[i].pass13 == null) { response.rows[i].pass13 = []; } else { response.rows[i].pass13 = response.rows[i].pass13.split(','); }
  611. if (response.rows[i].pass14 == null) { response.rows[i].pass14 = []; } else { response.rows[i].pass14 = response.rows[i].pass14.split(','); }
  612. if (response.rows[i].pass15 == null) { response.rows[i].pass15 = []; } else { response.rows[i].pass15 = response.rows[i].pass15.split(','); }
  613. if (response.rows[i].pass16 == null) { response.rows[i].pass16 = []; } else { response.rows[i].pass16 = response.rows[i].pass16.split(','); }
  614. }
  615. this.pressureList = response.rows;
  616. this.total = response.total;
  617. this.loading = false;
  618. });
  619. },
  620. /** 查询部门下拉树结构 */
  621. getTreeselect() {
  622. treeselect().then(response => {
  623. this.deptOptions = response.data;
  624. });
  625. },
  626. // 取消按钮
  627. cancel() {
  628. this.open = false;
  629. this.reset();
  630. },
  631. // 表单重置
  632. reset() {
  633. this.form = {
  634. id: null,
  635. furnanceName: null,
  636. recordTime: null,
  637. pass1: null,
  638. pass2: null,
  639. pass3: null,
  640. pass4: null,
  641. pass5: null,
  642. pass6: null,
  643. pass7: null,
  644. pass8: null,
  645. pass9: null,
  646. pass10: null,
  647. pass11: null,
  648. pass12: null,
  649. pass13: null,
  650. pass14: null,
  651. pass15: null,
  652. pass16: null,
  653. deptId: null,
  654. delFlag: null,
  655. createBy: null,
  656. createTime: null,
  657. updateBy: null,
  658. updateTime: null,
  659. };
  660. this.pass1 = [];
  661. this.pass2 = [];
  662. this.pass3 = [];
  663. this.pass4 = [];
  664. this.pass5 = [];
  665. this.pass6 = [];
  666. this.pass7 = [];
  667. this.pass8 = [];
  668. this.pass9 = [];
  669. this.pass10 = [];
  670. this.pass11 = [];
  671. this.pass12 = [];
  672. this.pass13 = [];
  673. this.pass14 = [];
  674. this.pass15 = [];
  675. this.pass16 = [];
  676. this.resetForm("form");
  677. },
  678. /** 搜索按钮操作 */
  679. handleQuery() {
  680. this.queryParams.pageNum = 1;
  681. this.getList();
  682. },
  683. /** 重置按钮操作 */
  684. resetQuery() {
  685. this.resetForm("queryForm");
  686. this.handleQuery();
  687. },
  688. // 多选框选中数据
  689. handleSelectionChange(selection) {
  690. this.ids = selection.map(item => item.id)
  691. this.single = selection.length!==1
  692. this.multiple = !selection.length
  693. },
  694. /** 新增按钮操作 */
  695. handleAdd() {
  696. this.reset();
  697. this.form.furnanceName = "H109";
  698. this.open = true;
  699. this.title = "添加裂解炉炉管测压";
  700. },
  701. /** 修改按钮操作 */
  702. handleUpdate(row) {
  703. this.reset();
  704. const id = row.id || this.ids
  705. getPressure(id).then(response => {
  706. this.form = response.data;
  707. if (response.data.pass1 == null) { this.pass1 = []; } else { this.pass1 = response.data.pass1.split(','); }
  708. if (response.data.pass2 == null) { this.pass2 = []; } else { this.pass2 = response.data.pass2.split(','); }
  709. if (response.data.pass3 == null) { this.pass3 = []; } else { this.pass3 = response.data.pass3.split(','); }
  710. if (response.data.pass4 == null) { this.pass4 = []; } else { this.pass4 = response.data.pass4.split(','); }
  711. if (response.data.pass5 == null) { this.pass5 = []; } else { this.pass5 = response.data.pass5.split(','); }
  712. if (response.data.pass6 == null) { this.pass6 = []; } else { this.pass6 = response.data.pass6.split(','); }
  713. if (response.data.pass7 == null) { this.pass7 = []; } else { this.pass7 = response.data.pass7.split(','); }
  714. if (response.data.pass8 == null) { this.pass8 = []; } else { this.pass8 = response.data.pass8.split(','); }
  715. if (response.data.pass9 == null) { this.pass9 = []; } else { this.pass9 = response.data.pass9.split(','); }
  716. if (response.data.pass10 == null) { this.pass10 = []; } else { this.pass10 = response.data.pass10.split(','); }
  717. if (response.data.pass11 == null) { this.pass11 = []; } else { this.pass11 = response.data.pass11.split(','); }
  718. if (response.data.pass12 == null) { this.pass12 = []; } else { this.pass12 = response.data.pass12.split(','); }
  719. if (response.data.pass13 == null) { this.pass13 = []; } else { this.pass13 = response.data.pass13.split(','); }
  720. if (response.data.pass14 == null) { this.pass14 = []; } else { this.pass14 = response.data.pass14.split(','); }
  721. if (response.data.pass15 == null) { this.pass15 = []; } else { this.pass15 = response.data.pass15.split(','); }
  722. if (response.data.pass16 == null) { this.pass16 = []; } else { this.pass16 = response.data.pass16.split(','); }
  723. this.open = true;
  724. this.title = "修改裂解炉炉管测压";
  725. });
  726. },
  727. /** 提交按钮 */
  728. submitForm() {
  729. this.form.pass1 = this.pass1.join(",");
  730. this.form.pass2 = this.pass2.join(",");
  731. this.form.pass3 = this.pass3.join(",");
  732. this.form.pass4 = this.pass4.join(",");
  733. this.form.pass5 = this.pass5.join(",");
  734. this.form.pass6 = this.pass6.join(",");
  735. this.form.pass7 = this.pass7.join(",");
  736. this.form.pass8 = this.pass8.join(",");
  737. this.form.pass9 = this.pass9.join(",");
  738. this.form.pass10 = this.pass10.join(",");
  739. this.form.pass11 = this.pass11.join(",");
  740. this.form.pass12 = this.pass12.join(",");
  741. this.form.pass13 = this.pass13.join(",");
  742. this.form.pass14 = this.pass14.join(",");
  743. this.form.pass15 = this.pass15.join(",");
  744. this.form.pass16 = this.pass16.join(",");
  745. this.$refs["form"].validate(valid => {
  746. if (valid) {
  747. if (this.form.id != null) {
  748. updatePressure(this.form).then(response => {
  749. this.msgSuccess("修改成功");
  750. this.open = false;
  751. this.getList();
  752. });
  753. } else {
  754. addPressure(this.form).then(response => {
  755. this.msgSuccess("新增成功");
  756. this.open = false;
  757. this.getList();
  758. });
  759. }
  760. }
  761. });
  762. },
  763. /** 删除按钮操作 */
  764. handleDelete(row) {
  765. const ids = row.id || this.ids;
  766. this.$confirm('是否确认删除?', "警告", {
  767. confirmButtonText: "确定",
  768. cancelButtonText: "取消",
  769. type: "warning"
  770. }).then(function() {
  771. return delPressure(ids);
  772. }).then(() => {
  773. this.getList();
  774. this.msgSuccess("删除成功");
  775. })
  776. },
  777. /** 导出按钮操作 */
  778. handleExport() {
  779. const queryParams = this.queryParams;
  780. this.$confirm('是否确认导出所有裂解炉炉管测压数据项?', "警告", {
  781. confirmButtonText: "确定",
  782. cancelButtonText: "取消",
  783. type: "warning"
  784. }).then(function() {
  785. return exportPressure(queryParams);
  786. }).then(response => {
  787. this.download(response.msg);
  788. })
  789. },
  790. /** 导入按钮操作 */
  791. handleImport() {
  792. this.upload.title = "用户导入";
  793. this.upload.open = true;
  794. },
  795. /** 下载模板操作 */
  796. importTemplate() {
  797. importTemplate().then(response => {
  798. this.download(response.msg);
  799. });
  800. },
  801. // 文件上传中处理
  802. handleFileUploadProgress(event, file, fileList) {
  803. this.upload.isUploading = true;
  804. },
  805. // 文件上传成功处理
  806. handleFileSuccess(response, file, fileList) {
  807. this.upload.open = false;
  808. this.upload.isUploading = false;
  809. this.$refs.upload.clearFiles();
  810. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  811. this.getList();
  812. },
  813. // 提交上传文件
  814. submitFileForm() {
  815. this.$refs.upload.submit();
  816. }
  817. }
  818. };
  819. </script>