h109.vue 33 KB

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