h113.vue 26 KB

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