h113.vue 29 KB

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