h116.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  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[10] }}</span>
  79. </template>
  80. </el-table-column>
  81. <el-table-column v-for="(item,index) in 10" :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="PASS2出口" 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[10] }}</span>
  91. </template>
  92. </el-table-column>
  93. <el-table-column v-for="(item,index) in 10" :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="PASS3出口" 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[10] }}</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column v-for="(item,index) in 10" :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="PASS4出口" 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[10] }}</span>
  115. </template>
  116. </el-table-column>
  117. <el-table-column v-for="(item,index) in 10" :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="PASS5出口" 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[10] }}</span>
  127. </template>
  128. </el-table-column>
  129. <el-table-column v-for="(item,index) in 10" :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="PASS6出口" 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[10] }}</span>
  139. </template>
  140. </el-table-column>
  141. <el-table-column v-for="(item,index) in 10" :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="PASS7出口" 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[10] }}</span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column v-for="(item,index) in 10" :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="PASS8出口" 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[10] }}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column v-for="(item,index) in 10" :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="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  172. <template slot-scope="scope">
  173. <el-button
  174. size="mini"
  175. type="text"
  176. icon="el-icon-edit"
  177. @click="handleUpdate(scope.row)"
  178. v-hasPermi="['production:pressure:edit']"
  179. >修改</el-button>
  180. <el-button
  181. size="mini"
  182. type="text"
  183. icon="el-icon-delete"
  184. @click="handleDelete(scope.row)"
  185. v-hasPermi="['production:pressure:remove']"
  186. >删除</el-button>
  187. </template>
  188. </el-table-column>
  189. </el-table>
  190. <pagination
  191. v-show="total>0"
  192. :total="total"
  193. :page.sync="queryParams.pageNum"
  194. :limit.sync="queryParams.pageSize"
  195. @pagination="getList"
  196. />
  197. <!-- 添加或修改裂解炉炉管测压对话框 -->
  198. <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
  199. <el-form ref="form" :model="form" :rules="rules" label-width="100px">
  200. <el-form-item label="裂解炉名称" prop="furnanceName">
  201. <el-input v-model="form.furnanceName" placeholder="请输入裂解炉名称" />
  202. </el-form-item>
  203. <el-form-item label="巡检日期" prop="recordTime">
  204. <el-date-picker clearable size="small" style="width: 200px"
  205. v-model="form.recordTime"
  206. type="date"
  207. value-format="yyyy-MM-dd"
  208. placeholder="选择巡检日期">
  209. </el-date-picker>
  210. </el-form-item>
  211. <el-form-item label="归属部门" prop="deptId">
  212. <treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门" />
  213. </el-form-item>
  214. </el-form>
  215. <el-descriptions title="PASS1出口" direction="vertical" :column="6" border>
  216. <el-descriptions-item label="入口">
  217. <el-input v-model="pass1[10]"/>
  218. </el-descriptions-item>
  219. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  220. <el-input v-model="pass1[index]"/>
  221. </el-descriptions-item>
  222. <el-descriptions-item label=""></el-descriptions-item>
  223. </el-descriptions><br/>
  224. <el-descriptions title="PASS2出口" direction="vertical" :column="6" border>
  225. <el-descriptions-item label="入口">
  226. <el-input v-model="pass2[10]"/>
  227. </el-descriptions-item>
  228. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  229. <el-input v-model="pass2[index]"/>
  230. </el-descriptions-item>
  231. <el-descriptions-item label=""></el-descriptions-item>
  232. </el-descriptions><br/>
  233. <el-descriptions title="PASS3出口" direction="vertical" :column="6" border>
  234. <el-descriptions-item label="入口">
  235. <el-input v-model="pass3[10]"/>
  236. </el-descriptions-item>
  237. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  238. <el-input v-model="pass3[index]"/>
  239. </el-descriptions-item>
  240. <el-descriptions-item label=""></el-descriptions-item>
  241. </el-descriptions><br/>
  242. <el-descriptions title="PASS4出口" direction="vertical" :column="6" border>
  243. <el-descriptions-item label="入口">
  244. <el-input v-model="pass4[10]"/>
  245. </el-descriptions-item>
  246. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  247. <el-input v-model="pass4[index]"/>
  248. </el-descriptions-item>
  249. <el-descriptions-item label=""></el-descriptions-item>
  250. </el-descriptions><br/>
  251. <el-descriptions title="PASS5出口" direction="vertical" :column="6" border>
  252. <el-descriptions-item label="入口">
  253. <el-input v-model="pass5[10]"/>
  254. </el-descriptions-item>
  255. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  256. <el-input v-model="pass5[index]"/>
  257. </el-descriptions-item>
  258. <el-descriptions-item label=""></el-descriptions-item>
  259. </el-descriptions><br/>
  260. <el-descriptions title="PASS6出口" direction="vertical" :column="6" border>
  261. <el-descriptions-item label="入口">
  262. <el-input v-model="pass6[10]"/>
  263. </el-descriptions-item>
  264. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  265. <el-input v-model="pass6[index]"/>
  266. </el-descriptions-item>
  267. <el-descriptions-item label=""></el-descriptions-item>
  268. </el-descriptions><br/>
  269. <el-descriptions title="PASS7出口" direction="vertical" :column="6" border>
  270. <el-descriptions-item label="入口">
  271. <el-input v-model="pass7[10]"/>
  272. </el-descriptions-item>
  273. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  274. <el-input v-model="pass7[index]"/>
  275. </el-descriptions-item>
  276. <el-descriptions-item label=""></el-descriptions-item>
  277. </el-descriptions><br/>
  278. <el-descriptions title="PASS8出口" direction="vertical" :column="6" border>
  279. <el-descriptions-item label="入口">
  280. <el-input v-model="pass8[10]"/>
  281. </el-descriptions-item>
  282. <el-descriptions-item v-for="(item, index) in 10" :label="(index+1).toString()">
  283. <el-input v-model="pass8[index]"/>
  284. </el-descriptions-item>
  285. <el-descriptions-item label=""></el-descriptions-item>
  286. </el-descriptions>
  287. <div slot="footer" class="dialog-footer">
  288. <el-button type="primary" @click="submitForm">确 定</el-button>
  289. <el-button @click="cancel">取 消</el-button>
  290. </div>
  291. </el-dialog>
  292. <!-- 用户导入对话框 -->
  293. <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
  294. <el-upload
  295. ref="upload"
  296. :limit="1"
  297. accept=".xlsx, .xls"
  298. :headers="upload.headers"
  299. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  300. :disabled="upload.isUploading"
  301. :on-progress="handleFileUploadProgress"
  302. :on-success="handleFileSuccess"
  303. :auto-upload="false"
  304. drag
  305. >
  306. <i class="el-icon-upload"></i>
  307. <div class="el-upload__text">
  308. 将文件拖到此处,或
  309. <em>点击上传</em>
  310. </div>
  311. <div class="el-upload__tip" slot="tip">
  312. <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据
  313. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  314. </div>
  315. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  316. </el-upload>
  317. <div slot="footer" class="dialog-footer">
  318. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  319. <el-button @click="upload.open = false">取 消</el-button>
  320. </div>
  321. </el-dialog>
  322. </div>
  323. </template>
  324. <script>
  325. import { listPressure, getPressure, delPressure, addPressure, updatePressure, exportPressure, importTemplate} from "@/api/production/pressure";
  326. import { treeselect } from "@/api/system/dept";
  327. import { getToken } from "@/utils/auth";
  328. import Treeselect from "@riophae/vue-treeselect";
  329. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  330. export default {
  331. name: "Pressure",
  332. components: { Treeselect },
  333. data() {
  334. return {
  335. // 遮罩层
  336. loading: true,
  337. // 选中数组
  338. ids: [],
  339. // 非单个禁用
  340. single: true,
  341. // 非多个禁用
  342. multiple: true,
  343. // 显示搜索条件
  344. showSearch: true,
  345. // 总条数
  346. total: 0,
  347. // 裂解炉炉管测压表格数据
  348. pressureList: [],
  349. // 弹出层标题
  350. title: "",
  351. // 部门树选项
  352. deptOptions: undefined,
  353. clientHeight:300,
  354. // 是否显示弹出层
  355. open: false,
  356. // 用户导入参数
  357. upload: {
  358. // 是否显示弹出层(用户导入)
  359. open: false,
  360. // 弹出层标题(用户导入)
  361. title: "",
  362. // 是否禁用上传
  363. isUploading: false,
  364. // 是否更新已经存在的用户数据
  365. updateSupport: 0,
  366. // 设置上传的请求头部
  367. headers: { Authorization: "Bearer " + getToken() },
  368. // 上传的地址
  369. url: process.env.VUE_APP_BASE_API + "/production/pressure/importData"
  370. },
  371. // 查询参数
  372. queryParams: {
  373. pageNum: 1,
  374. pageSize: 20,
  375. furnanceName: null,
  376. recordTime: null,
  377. pass1: null,
  378. pass2: null,
  379. pass3: null,
  380. pass4: null,
  381. pass5: null,
  382. pass6: null,
  383. pass7: null,
  384. pass8: null,
  385. pass9: null,
  386. pass10: null,
  387. pass11: null,
  388. pass12: null,
  389. pass13: null,
  390. pass14: null,
  391. pass15: null,
  392. pass16: null,
  393. deptId: null,
  394. },
  395. recordTime: null,
  396. // 表单参数
  397. form: {},
  398. pass1:[],
  399. pass2:[],
  400. pass3:[],
  401. pass4:[],
  402. pass5:[],
  403. pass6:[],
  404. pass7:[],
  405. pass8:[],
  406. pass9:[],
  407. pass10:[],
  408. pass11:[],
  409. pass12:[],
  410. pass13:[],
  411. pass14:[],
  412. pass15:[],
  413. pass16:[],
  414. // 表单校验
  415. rules: {
  416. id: [
  417. { required: true, message: "主键id不能为空", trigger: "blur" }
  418. ],
  419. }
  420. };
  421. },
  422. watch: {
  423. // 根据名称筛选部门树
  424. deptName(val) {
  425. this.$refs.tree.filter(val);
  426. }
  427. },
  428. created() {
  429. //设置表格高度对应屏幕高度
  430. this.$nextTick(() => {
  431. this.clientHeight = document.body.clientHeight -250
  432. })
  433. // this.getList();
  434. // this.getTreeselect();
  435. },
  436. methods: {
  437. init() {
  438. this.getList();
  439. },
  440. /** 查询裂解炉炉管测压列表 */
  441. getList() {
  442. this.loading = true;
  443. this.queryParams.furnanceName = "H116";
  444. listPressure(this.queryParams).then(response => {
  445. for (let i = 0; i< response.rows.length; i++) {
  446. if (response.rows[i].pass1 == null) { response.rows[i].pass1 = []; } else { response.rows[i].pass1 = response.rows[i].pass1.split(','); }
  447. if (response.rows[i].pass2 == null) { response.rows[i].pass2 = []; } else { response.rows[i].pass2 = response.rows[i].pass2.split(','); }
  448. if (response.rows[i].pass3 == null) { response.rows[i].pass3 = []; } else { response.rows[i].pass3 = response.rows[i].pass3.split(','); }
  449. if (response.rows[i].pass4 == null) { response.rows[i].pass4 = []; } else { response.rows[i].pass4 = response.rows[i].pass4.split(','); }
  450. if (response.rows[i].pass5 == null) { response.rows[i].pass5 = []; } else { response.rows[i].pass5 = response.rows[i].pass5.split(','); }
  451. if (response.rows[i].pass6 == null) { response.rows[i].pass6 = []; } else { response.rows[i].pass6 = response.rows[i].pass6.split(','); }
  452. if (response.rows[i].pass7 == null) { response.rows[i].pass7 = []; } else { response.rows[i].pass7 = response.rows[i].pass7.split(','); }
  453. if (response.rows[i].pass8 == null) { response.rows[i].pass8 = []; } else { response.rows[i].pass8 = response.rows[i].pass8.split(','); }
  454. }
  455. this.pressureList = response.rows;
  456. this.total = response.total;
  457. this.loading = false;
  458. });
  459. },
  460. /** 查询部门下拉树结构 */
  461. getTreeselect() {
  462. treeselect().then(response => {
  463. this.deptOptions = response.data;
  464. });
  465. },
  466. // 取消按钮
  467. cancel() {
  468. this.open = false;
  469. this.reset();
  470. },
  471. // 表单重置
  472. reset() {
  473. this.form = {
  474. id: null,
  475. furnanceName: null,
  476. recordTime: null,
  477. pass1: null,
  478. pass2: null,
  479. pass3: null,
  480. pass4: null,
  481. pass5: null,
  482. pass6: null,
  483. pass7: null,
  484. pass8: null,
  485. pass9: null,
  486. pass10: null,
  487. pass11: null,
  488. pass12: null,
  489. pass13: null,
  490. pass14: null,
  491. pass15: null,
  492. pass16: null,
  493. deptId: null,
  494. delFlag: null,
  495. createBy: null,
  496. createTime: null,
  497. updateBy: null,
  498. updateTime: null,
  499. };
  500. this.pass1 = [];
  501. this.pass2 = [];
  502. this.pass3 = [];
  503. this.pass4 = [];
  504. this.pass5 = [];
  505. this.pass6 = [];
  506. this.pass7 = [];
  507. this.pass8 = [];
  508. this.pass9 = [];
  509. this.pass10 = [];
  510. this.pass11 = [];
  511. this.pass12 = [];
  512. this.pass13 = [];
  513. this.pass14 = [];
  514. this.pass15 = [];
  515. this.pass16 = [];
  516. this.resetForm("form");
  517. },
  518. /** 搜索按钮操作 */
  519. handleQuery() {
  520. this.queryParams.pageNum = 1;
  521. this.getList();
  522. },
  523. /** 重置按钮操作 */
  524. resetQuery() {
  525. this.resetForm("queryForm");
  526. this.handleQuery();
  527. },
  528. // 多选框选中数据
  529. handleSelectionChange(selection) {
  530. this.ids = selection.map(item => item.id)
  531. this.single = selection.length!==1
  532. this.multiple = !selection.length
  533. },
  534. /** 新增按钮操作 */
  535. handleAdd() {
  536. this.reset();
  537. this.form.furnanceName = "H116";
  538. this.open = true;
  539. this.title = "添加裂解炉炉管测压";
  540. },
  541. /** 修改按钮操作 */
  542. handleUpdate(row) {
  543. this.reset();
  544. const id = row.id || this.ids
  545. getPressure(id).then(response => {
  546. this.form = response.data;
  547. if (response.data.pass1 == null) { this.pass1 = []; } else { this.pass1 = response.data.pass1.split(','); }
  548. if (response.data.pass2 == null) { this.pass2 = []; } else { this.pass2 = response.data.pass2.split(','); }
  549. if (response.data.pass3 == null) { this.pass3 = []; } else { this.pass3 = response.data.pass3.split(','); }
  550. if (response.data.pass4 == null) { this.pass4 = []; } else { this.pass4 = response.data.pass4.split(','); }
  551. if (response.data.pass5 == null) { this.pass5 = []; } else { this.pass5 = response.data.pass5.split(','); }
  552. if (response.data.pass6 == null) { this.pass6 = []; } else { this.pass6 = response.data.pass6.split(','); }
  553. if (response.data.pass7 == null) { this.pass7 = []; } else { this.pass7 = response.data.pass7.split(','); }
  554. if (response.data.pass8 == null) { this.pass8 = []; } else { this.pass8 = response.data.pass8.split(','); }
  555. this.open = true;
  556. this.title = "修改裂解炉炉管测压";
  557. });
  558. },
  559. /** 提交按钮 */
  560. submitForm() {
  561. this.form.pass1 = this.pass1.join(",");
  562. this.form.pass2 = this.pass2.join(",");
  563. this.form.pass3 = this.pass3.join(",");
  564. this.form.pass4 = this.pass4.join(",");
  565. this.form.pass5 = this.pass5.join(",");
  566. this.form.pass6 = this.pass6.join(",");
  567. this.form.pass7 = this.pass7.join(",");
  568. this.form.pass8 = this.pass8.join(",");
  569. this.form.pass9 = this.pass9.join(",");
  570. this.form.pass10 = this.pass10.join(",");
  571. this.form.pass11 = this.pass11.join(",");
  572. this.form.pass12 = this.pass12.join(",");
  573. this.form.pass13 = this.pass13.join(",");
  574. this.form.pass14 = this.pass14.join(",");
  575. this.form.pass15 = this.pass15.join(",");
  576. this.form.pass16 = this.pass16.join(",");
  577. this.$refs["form"].validate(valid => {
  578. if (valid) {
  579. if (this.form.id != null) {
  580. updatePressure(this.form).then(response => {
  581. this.msgSuccess("修改成功");
  582. this.open = false;
  583. this.getList();
  584. });
  585. } else {
  586. addPressure(this.form).then(response => {
  587. this.msgSuccess("新增成功");
  588. this.open = false;
  589. this.getList();
  590. });
  591. }
  592. }
  593. });
  594. },
  595. /** 删除按钮操作 */
  596. handleDelete(row) {
  597. const ids = row.id || this.ids;
  598. this.$confirm('是否确认删除?', "警告", {
  599. confirmButtonText: "确定",
  600. cancelButtonText: "取消",
  601. type: "warning"
  602. }).then(function() {
  603. return delPressure(ids);
  604. }).then(() => {
  605. this.getList();
  606. this.msgSuccess("删除成功");
  607. })
  608. },
  609. /** 导出按钮操作 */
  610. handleExport() {
  611. const queryParams = this.queryParams;
  612. this.$confirm('是否确认导出所有裂解炉炉管测压数据项?', "警告", {
  613. confirmButtonText: "确定",
  614. cancelButtonText: "取消",
  615. type: "warning"
  616. }).then(function() {
  617. return exportPressure(queryParams);
  618. }).then(response => {
  619. this.download(response.msg);
  620. })
  621. },
  622. /** 导入按钮操作 */
  623. handleImport() {
  624. this.upload.title = "用户导入";
  625. this.upload.open = true;
  626. },
  627. /** 下载模板操作 */
  628. importTemplate() {
  629. importTemplate().then(response => {
  630. this.download(response.msg);
  631. });
  632. },
  633. // 文件上传中处理
  634. handleFileUploadProgress(event, file, fileList) {
  635. this.upload.isUploading = true;
  636. },
  637. // 文件上传成功处理
  638. handleFileSuccess(response, file, fileList) {
  639. this.upload.open = false;
  640. this.upload.isUploading = false;
  641. this.$refs.upload.clearFiles();
  642. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  643. this.getList();
  644. },
  645. // 提交上传文件
  646. submitFileForm() {
  647. this.$refs.upload.submit();
  648. }
  649. }
  650. };
  651. </script>