h118.vue 25 KB

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