h115.vue 28 KB

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