h116.vue 27 KB

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