h113.vue 30 KB

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