bf.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  1. <template>
  2. <div class="app-container">
  3. <el-form v-show="showSearch" ref="queryForm" :inline="true" :model="queryParams" label-width="68px">
  4. <el-form-item label="装置名称" prop="plantCode">
  5. <el-input
  6. v-model="queryParams.plantCode"
  7. placeholder="请输入装置名称"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="全局搜索" prop="fuzzy">
  14. <el-input
  15. v-model="queryParams.fuzzy"
  16. clearable
  17. placeholder="请输入要查询的值"
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item>
  23. <el-button icon="el-icon-search" size="mini" type="primary" @click="handleQuery"> 搜索 </el-button>
  24. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"> 重置 </el-button>
  25. </el-form-item>
  26. </el-form>
  27. <el-row :gutter="10" class="mb8">
  28. <el-col :span="1.5">
  29. <el-button
  30. v-hasPermi="['sems:specGl:add']"
  31. icon="el-icon-plus"
  32. size="mini"
  33. type="primary"
  34. @click="handleAdd"
  35. > 新增
  36. </el-button>
  37. </el-col>
  38. <el-col :span="1.5">
  39. <el-button
  40. v-hasPermi="['sems:specGl:edit']"
  41. :disabled="single"
  42. icon="el-icon-edit"
  43. size="mini"
  44. type="success"
  45. @click="handleUpdate"
  46. > 修改
  47. </el-button>
  48. </el-col>
  49. <el-col :span="1.5">
  50. <el-button
  51. v-hasPermi="['sems:specGl:remove']"
  52. :disabled="multiple"
  53. icon="el-icon-delete"
  54. size="mini"
  55. type="danger"
  56. @click="handleDelete"
  57. > 删除
  58. </el-button>
  59. </el-col>
  60. <el-col :span="1.5">
  61. <el-button
  62. v-hasPermi="['sems:specGl:edit']"
  63. icon="el-icon-upload2"
  64. size="mini"
  65. type="info"
  66. @click="handleImport"
  67. > 导入
  68. </el-button>
  69. </el-col>
  70. <el-col :span="1.5">
  71. <el-button
  72. v-hasPermi="['sems:specGl:export']"
  73. icon="el-icon-download"
  74. size="mini"
  75. type="warning"
  76. @click="handleExport"
  77. > 导出
  78. </el-button>
  79. </el-col>
  80. <!-- <el-col :span="1.5">
  81. <el-button
  82. type="primary"
  83. icon="el-icon-download"
  84. size="mini"
  85. @click="inspectionInformation = true"
  86. v-hasPermi="['sems:specGl:add']"
  87. > 检验更新 </el-button>
  88. </el-col>
  89. <el-col :span="1.5">
  90. <el-button
  91. type="danger"
  92. icon="el-icon-delete"
  93. size="mini"
  94. @click="handleDup"
  95. v-hasPermi="['system:plant:remove']"
  96. > 数据去重 </el-button>
  97. </el-col>-->
  98. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  99. </el-row>
  100. <el-table ref="deviceTable" v-loading="loading" :cell-style="tableCellStyle" :data="specGlList"
  101. :height="clientHeight" border @selection-change="handleSelectionChange" @sort-change="sortList">
  102. <el-table-column align="center" fixed="left" type="selection" width="55"/>
  103. <el-table-column label="装置" :show-overflow-tooltip="true" align="center" prop="plantCode"/>
  104. <el-table-column label="容器编号" :show-overflow-tooltip="true" align="center" prop="containerNo"/>
  105. <el-table-column label="注册编号" :show-overflow-tooltip="true" align="center" prop="regno"/>
  106. <el-table-column label="使用证号码" :show-overflow-tooltip="true" align="center" prop="useno" width="120"/>
  107. <el-table-column label="建档情况" :show-overflow-tooltip="true" align="center" prop="filedSituation"/>
  108. <el-table-column label="出厂资料" :show-overflow-tooltip="true" align="center" prop="factoryInfo"/>
  109. <el-table-column label="下次定期检查日期" :show-overflow-tooltip="true" align="center">
  110. <el-table-column label="内部检验(1次/2年)" align="center" prop="internalInspection" width="180">
  111. <template slot-scope="scope">
  112. <span>{{ parseTime(scope.row.internalInspection, '{y}-{m}-{d}') }}</span>
  113. </template>
  114. </el-table-column>
  115. <el-table-column label="外部检验(1次/年)" align="center" prop="externalInspection" width="180">
  116. <template slot-scope="scope">
  117. <span>{{ parseTime(scope.row.externalInspection, '{y}-{m}-{d}') }}</span>
  118. </template>
  119. </el-table-column>
  120. <el-table-column label="试压(1次/3年)" align="center" prop="pressureTest" width="180">
  121. <template slot-scope="scope">
  122. <span>{{ parseTime(scope.row.pressureTest, '{y}-{m}-{d}') }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="能效测试(1次/2年)" align="center" prop="energyEfficiencyTest" width="180">
  126. <template slot-scope="scope">
  127. <span>{{ parseTime(scope.row.energyEfficiencyTest, '{y}-{m}-{d}') }}</span>
  128. </template>
  129. </el-table-column>
  130. </el-table-column>
  131. <el-table-column label="容器名称" :show-overflow-tooltip="true" align="center" prop="devname"/>
  132. <el-table-column label="出厂编号" :show-overflow-tooltip="true" align="center" prop="factoryNo"/>
  133. <el-table-column label="介质" :show-overflow-tooltip="true" align="center" prop="medium"/>
  134. <el-table-column label="设计单位" :show-overflow-tooltip="true" align="center" prop="designUnit"/>
  135. <el-table-column label="制造单位" :show-overflow-tooltip="true" align="center" prop="createUnit"/>
  136. <el-table-column label="检验状态" align="center" prop="checkStatus"/>
  137. <el-table-column :formatter="statusFormat" label="状态" align="center" prop="status"/>
  138. <!-- <el-table-column label="申请状态" align="center" prop="approveStatus" :formatter="approveStatusFormat" />-->
  139. <el-table-column label="备注" :show-overflow-tooltip="true" align="center" prop="remarks"/>
  140. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right"
  141. width="140">
  142. <template slot-scope="scope">
  143. <el-button
  144. v-hasPermi="['sems:specGl:edit']"
  145. icon="el-icon-edit"
  146. size="mini"
  147. type="text"
  148. @click="handleUpdate(scope.row)"
  149. >修改
  150. </el-button>
  151. </template>
  152. </el-table-column>
  153. </el-table>
  154. <pagination
  155. v-show="total>0"
  156. :limit.sync="queryParams.pageSize"
  157. :page-sizes="[20,100,300,500]"
  158. :page.sync="queryParams.pageNum"
  159. :total="total"
  160. @pagination="getList"
  161. />
  162. <!-- 添加或修改特种设备锅炉台账对话框 -->
  163. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="title" :visible.sync="open" append-to-body width="1200px">
  164. <el-form ref="form" :model="form" :rules="rules" label-width="160px">
  165. <el-row>
  166. <el-col :span="12">
  167. <el-form-item label="装置" prop="plantCode">
  168. <el-input v-model="form.plantCode" placeholder="请输入装置"/>
  169. </el-form-item>
  170. </el-col>
  171. <el-col :span="12">
  172. <el-form-item label="介质" prop="medium">
  173. <el-input v-model="form.medium" placeholder="请输入介质"/>
  174. </el-form-item>
  175. </el-col>
  176. </el-row>
  177. <el-row>
  178. <el-col :span="12">
  179. <el-form-item label="容器名称" prop="devname">
  180. <el-input v-model="form.devname" placeholder="请输入设备名称"/>
  181. </el-form-item>
  182. </el-col>
  183. <el-col :span="12">
  184. <el-form-item label="容器编号" prop="containerNo">
  185. <el-input v-model="form.containerNo" placeholder="请输入容器编号"/>
  186. </el-form-item>
  187. </el-col>
  188. </el-row>
  189. <el-row>
  190. <el-col :span="12">
  191. <el-form-item label="使用证编号" prop="useno">
  192. <el-input v-model="form.useno" placeholder="请输入使用证编号"/>
  193. </el-form-item>
  194. </el-col>
  195. <el-col :span="12">
  196. <el-form-item label="注册编号" prop="regno">
  197. <el-input v-model="form.regno" placeholder="请输入注册编号"/>
  198. </el-form-item>
  199. </el-col>
  200. </el-row>
  201. <el-row>
  202. <el-col :span="12">
  203. <el-form-item label="建档情况" prop="filedSituation">
  204. <el-input v-model="form.filedSituation" placeholder="请输入注册编号"/>
  205. </el-form-item>
  206. </el-col>
  207. <el-col :span="12">
  208. <el-form-item label="出厂资料" prop="factoryInfo">
  209. <el-input v-model="form.factoryInfo" placeholder="请输入出厂资料"/>
  210. </el-form-item>
  211. </el-col>
  212. </el-row>
  213. <el-row>
  214. <el-col :span="12">
  215. <el-form-item label="下次内部检验日期" prop="internalInspection">
  216. <el-date-picker v-model="form.internalInspection" placeholder="请选择+ 下次内部检验日期"
  217. clearable
  218. size="small"
  219. style="width:100%"
  220. type="month"
  221. value-format="yyyy-MM-dd">
  222. </el-date-picker>
  223. </el-form-item>
  224. </el-col>
  225. <el-col :span="12">
  226. <el-form-item label="下次外部检验日期" prop="externalInspection">
  227. <el-date-picker v-model="form.externalInspection" placeholder="请选择+ 下次外部检验日期"
  228. clearable
  229. size="small"
  230. style="width: 100%"
  231. type="month"
  232. value-format="yyyy-MM-dd">
  233. </el-date-picker>
  234. </el-form-item>
  235. </el-col>
  236. </el-row>
  237. <el-row>
  238. <el-col :span="12">
  239. <el-form-item label="下次试压检验日期" prop="pressureTest">
  240. <el-date-picker v-model="form.pressureTest" placeholder="请选择+ 下次试压检验日期" clearable
  241. size="small"
  242. style="width: 100%"
  243. type="month"
  244. value-format="yyyy-MM-dd">
  245. </el-date-picker>
  246. </el-form-item>
  247. </el-col>
  248. <el-col :span="12">
  249. <el-form-item label="下次能效测试检验日期" prop="energyEfficiencyTest">
  250. <el-date-picker v-model="form.energyEfficiencyTest"
  251. placeholder="请选择+ 下次能效测试检验日期" clearable
  252. size="small"
  253. style="width: 100%"
  254. type="month"
  255. value-format="yyyy-MM-dd">
  256. </el-date-picker>
  257. </el-form-item>
  258. </el-col>
  259. </el-row>
  260. <el-row>
  261. <el-col :span="12">
  262. <el-form-item label="设计单位" prop="designUnit">
  263. <el-input v-model="form.designUnit" placeholder="请输入设计单位"/>
  264. </el-form-item>
  265. </el-col>
  266. <el-col :span="12">
  267. <el-form-item label="制造单位" prop="createUnit">
  268. <el-input v-model="form.createUnit" placeholder="请输入制造单位"/>
  269. </el-form-item>
  270. </el-col>
  271. </el-row>
  272. <el-row>
  273. <el-col :span="12">
  274. <el-form-item label="出厂编号" prop="factoryNo">
  275. <el-input v-model="form.factoryNo" placeholder="请输入出厂编号"/>
  276. </el-form-item>
  277. </el-col>
  278. <el-col :span="12">
  279. <el-form-item label="状态" prop="status">
  280. <el-radio-group v-model="form.status" size="large">
  281. <el-radio label="1" size="large">在用</el-radio>
  282. <el-radio label="2" size="large">停用</el-radio>
  283. <el-radio label="3" size="large">报废</el-radio>
  284. <el-radio label="-1" size="large">封存</el-radio>
  285. </el-radio-group>
  286. </el-form-item>
  287. </el-col>
  288. </el-row>
  289. <el-row>
  290. <el-col :span="12">
  291. <el-form-item label="备注" prop="remarks">
  292. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  293. </el-form-item>
  294. </el-col>
  295. </el-row>
  296. </el-form>
  297. <div slot="footer" class="dialog-footer">
  298. <el-button type="primary" @click="submitForm"> 确 定 </el-button>
  299. <el-button @click="cancel"> 取 消 </el-button>
  300. </div>
  301. </el-dialog>
  302. <!-- 用户导入对话框 -->
  303. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open" append-to-body width="400px">
  304. <el-upload
  305. ref="upload"
  306. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  307. :auto-upload="false"
  308. :disabled="upload.isUploading"
  309. :headers="upload.headers"
  310. :limit="1"
  311. :on-progress="handleFileUploadProgress"
  312. :on-success="handleFileSuccess"
  313. accept=".xlsx, .xls"
  314. drag
  315. >
  316. <i class="el-icon-upload"></i>
  317. <div class="el-upload__text">
  318. 将文件拖到此处,或
  319. <em> 点击上传 </em>
  320. </div>
  321. <div slot="tip" class="el-upload__tip">
  322. <!-- <el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  323. <el-link style="font-size:12px" type="info" @click="importTemplate"> 下载模板 </el-link>
  324. </div>
  325. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  326. <input :value="upload.type" hidden name="type"/>
  327. </form>
  328. <div slot="tip" class="el-upload__tip" style="color:red"> 提示:仅允许导入“xls”或“xlsx”格式文件! </div>
  329. </el-upload>
  330. <div slot="footer" class="dialog-footer">
  331. <a v-if="waitSubmit" style="margin-right: 300px"> 正在导入... </a>
  332. <el-button v-loading.fullscreen.lock="fullscreenLoading" type="primary"
  333. @click="submitFileForm"> 确定
  334. </el-button>
  335. <el-button @click="upload.open = false"> 取消 </el-button>
  336. </div>
  337. </el-dialog>
  338. <form ref="downloadDevForm" :action="downloadDevAction" target="FORMSUBMIT">
  339. <input v-model="devType" hidden name="devType"/>
  340. <input v-model="ids" hidden name="ids"/>
  341. <input v-model="downloadType" hidden name="downloadType"/>
  342. </form>
  343. </div>
  344. </template>
  345. <script>
  346. import {
  347. addSpecGl,
  348. delSpecGl,
  349. duplicate,
  350. exportSpecGl,
  351. exportSpecList,
  352. getSpecGl,
  353. listSpecGl,
  354. updateSpecGl
  355. } from "@/api/sems/specGl";
  356. import {treeselect} from "@/api/system/dept";
  357. import {getToken} from "@/utils/auth";
  358. import Treeselect from "@riophae/vue-treeselect";
  359. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  360. export default {
  361. name: "SpecGl",
  362. components: {Treeselect},
  363. data() {
  364. return {
  365. filterList: [], //删选的list
  366. fullscreenLoading: false,
  367. waitSubmit: false,
  368. hisReformVisible: false,
  369. dataForm: 0,
  370. devType: 4,
  371. // 遮罩层
  372. loading: true,
  373. addAprroveVisible: false,
  374. hisAprroveVisible: false,
  375. hisCheckVisible: false,
  376. inspectionInformation: false,
  377. downloadType: '',
  378. downloadDevAction: process.env.VUE_APP_BASE_API + '/common/download/exportDevList',
  379. modifyTitle: '设备修改申请',
  380. modifyVisible: false,
  381. // 选中数组
  382. ids: [],
  383. dataListSelections: [],
  384. // 非单个禁用
  385. single: true,
  386. // 非多个禁用
  387. multiple: true,
  388. // 显示搜索条件
  389. showSearch: false,
  390. // 总条数
  391. total: 0,
  392. // 特种设备锅炉台账表格数据
  393. specGlList: [],
  394. // 弹出层标题
  395. title: "",
  396. // 部门树选项
  397. deptOptions: undefined,
  398. clientHeight: 300,
  399. // 是否显示弹出层
  400. open: false,
  401. // 状态字典
  402. statusOptions: [],
  403. // 申请状态字典
  404. approveStatusOptions: [],
  405. plantOptions: [],
  406. plantMaintOptions: [],
  407. wxjlList: [],
  408. // 用户导入参数
  409. upload: {
  410. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  411. // 是否显示弹出层(用户导入)
  412. type: "specGl",
  413. // 是否显示弹出层(用户导入)
  414. open: false,
  415. // 弹出层标题(用户导入)
  416. title: "",
  417. // 是否禁用上传
  418. isUploading: false,
  419. // 是否更新已经存在的用户数据
  420. updateSupport: 0,
  421. // 设置上传的请求头部
  422. headers: {Authorization: "Bearer " + getToken()},
  423. // 上传的地址
  424. url: process.env.VUE_APP_BASE_API + "/sems/specGl/importData"
  425. },
  426. // 查询参数
  427. queryParams: {
  428. pageNum: 1,
  429. pageSize: 20,
  430. fuzzy: null,
  431. orderByColumn: null,
  432. isAsc: null,
  433. plantCode: null,
  434. unit: null,
  435. devname: null,
  436. devno: null,
  437. regno: null,
  438. useno: null,
  439. warnDate: null,
  440. nextWarnDate: null,
  441. warnFlag: null,
  442. createUnit: null,
  443. burnMode: null,
  444. burnKind: null,
  445. ratedPower: null,
  446. desPressure: null,
  447. desTemp: null,
  448. optPressure: null,
  449. optTemp: null,
  450. checkUnit: null,
  451. checkConclusion: null,
  452. model: null,
  453. waterMode: null,
  454. reportNo: null,
  455. approveTime: null,
  456. changeTime: null,
  457. plantMaint: null,
  458. status: 3,
  459. },
  460. // 表单参数
  461. form: {},
  462. modifyForm: {},
  463. // 表单校验
  464. rules: {
  465. plantCode: [
  466. {required: true, message: '装置名称不能为空', trigger: "blur"}
  467. ],
  468. }
  469. };
  470. },
  471. watch: {
  472. // 根据名称筛选部门树
  473. deptName(val) {
  474. this.$refs.tree.filter(val);
  475. }
  476. },
  477. created() {
  478. //设置表格高度对应屏幕高度
  479. this.$nextTick(() => {
  480. this.clientHeight = document.body.clientHeight - 250
  481. })
  482. this.getList();
  483. this.getTreeselect();
  484. this.getDicts("spec_dev_status").then(response => {
  485. this.statusOptions = response.data;
  486. });
  487. //预警等级字典
  488. this.getDicts("ALARM_LEVEL").then(response => {
  489. for (let i = 0; i < response.data.length; i++) {
  490. let items = {
  491. text: '',
  492. value: ''
  493. };
  494. items.value = response.data[i].dictValue;
  495. items.text = response.data[i].dictLabel;
  496. this.filterList.push(items);
  497. }
  498. });
  499. this.getDicts("spec_approve_status").then(response => {
  500. for (let i = 0; i < response.data.length; i++) {
  501. if (!["5", "6", "7", "8", "16", "17"].includes(response.data[i].dictValue)) {
  502. this.approveStatusOptions.push(response.data[i])
  503. }
  504. }
  505. });
  506. this.getDicts("SPEC_PLANT_MAINT").then(response => {
  507. this.plantMaintOptions = response.data;
  508. });
  509. let plantParams = {
  510. pType: 1
  511. }
  512. mylistPlant(plantParams).then(response => {
  513. this.plantOptions = response.data;
  514. });
  515. },
  516. methods: {
  517. /** 查询特种设备锅炉台账列表 */
  518. getList() {
  519. this.loading = true;
  520. listSpecGl(this.queryParams).then(response => {
  521. this.specGlList = response.rows;
  522. this.total = response.total;
  523. this.loading = false;
  524. });
  525. },
  526. /** 查询部门下拉树结构 */
  527. getTreeselect() {
  528. treeselect().then(response => {
  529. this.deptOptions = response.data;
  530. });
  531. },
  532. // 状态字典翻译
  533. statusFormat(row, column) {
  534. return this.selectDictLabel(this.statusOptions, row.status);
  535. },
  536. // 申请状态字典翻译
  537. approveStatusFormat(row, column) {
  538. return this.selectDictLabel(this.approveStatusOptions, row.approveStatus);
  539. },
  540. // 取消按钮
  541. cancel() {
  542. this.open = false;
  543. this.reset();
  544. },
  545. // 表单重置
  546. reset() {
  547. this.form = {
  548. id: null,
  549. plantCode: null,
  550. unit: null,
  551. devname: null,
  552. devno: null,
  553. submitdate: null,
  554. status: 3,
  555. delFlag: null,
  556. createrCode: null,
  557. createdate: null,
  558. updaterCode: null,
  559. updatedate: null,
  560. deptId: null,
  561. remarks: null,
  562. approveStatus: 0,
  563. regno: null,
  564. useno: null,
  565. warnDate: null,
  566. warnCycle: null,
  567. nextWarnDate: null,
  568. warnFlag: null,
  569. createUnit: null,
  570. burnMode: null,
  571. burnKind: null,
  572. ratedPower: null,
  573. desPressure: null,
  574. desTemp: null,
  575. optPressure: null,
  576. optTemp: null,
  577. checkUnit: null,
  578. checkConclusion: null,
  579. model: null,
  580. waterMode: null,
  581. reportNo: null,
  582. approveTime: null,
  583. changeTime: null,
  584. plantMaint: null,
  585. outWarnDate: null,
  586. outNextWarnDate: null,
  587. outCheckConclusion: null,
  588. outReportNo: null,
  589. engineer: null
  590. };
  591. this.dataForm = 0;
  592. this.resetForm("form");
  593. },
  594. /** 搜索按钮操作 */
  595. handleQuery() {
  596. this.queryParams.pageNum = 1;
  597. this.getList();
  598. },
  599. /** 重置按钮操作 */
  600. resetQuery() {
  601. this.resetForm("queryForm");
  602. this.handleQuery();
  603. },
  604. // 多选框选中数据
  605. handleSelectionChange(selection) {
  606. this.ids = selection.map(item => item.id)
  607. this.single = selection.length !== 1
  608. this.multiple = !selection.length
  609. this.dataListSelections = selection
  610. },
  611. /** 新增按钮操作 */
  612. handleAdd() {
  613. this.reset();
  614. this.open = true;
  615. this.title = '添加特种设备锅炉台账';
  616. },
  617. /** 修改按钮操作 */
  618. handleUpdate(row) {
  619. this.reset();
  620. const id = row.id || this.ids
  621. getSpecGl(id).then(response => {
  622. this.form = response.data;
  623. this.open = true;
  624. this.title = '修改特种设备锅炉台账';
  625. });
  626. },
  627. /** 提交按钮 */
  628. submitForm() {
  629. console.log(this.form)
  630. this.$refs["form"].validate(valid => {
  631. if (valid) {
  632. if (this.form.id != null) {
  633. updateSpecGl(this.form).then(response => {
  634. this.msgSuccess('修改成功');
  635. this.open = false;
  636. this.getList();
  637. });
  638. } else {
  639. addSpecGl(this.form).then(response => {
  640. this.msgSuccess('新增成功');
  641. this.open = false;
  642. this.getList();
  643. });
  644. }
  645. }
  646. });
  647. },
  648. /** 删除按钮操作 */
  649. handleDelete(row) {
  650. const ids = row.id || this.ids;
  651. this.$confirm('是否确认删除?', '警告', {
  652. confirmButtonText: '确定',
  653. cancelButtonText: '取消',
  654. type: "warning"
  655. }).then(function () {
  656. return delSpecGl(ids);
  657. }).then(() => {
  658. this.getList();
  659. this.msgSuccess('删除成功');
  660. })
  661. },
  662. /** 导出按钮操作 */
  663. handleExport() {
  664. const queryParams = this.queryParams;
  665. this.$confirm('是否确认导出所有特种设备锅炉台账数据项?', '警告', {
  666. confirmButtonText: '确定',
  667. cancelButtonText: '取消',
  668. type: "warning"
  669. }).then(function () {
  670. return exportSpecGl(queryParams);
  671. }).then(response => {
  672. this.download(response.msg);
  673. })
  674. },
  675. /** 导入按钮操作 */
  676. handleImport() {
  677. this.upload.title = '用户导入';
  678. this.upload.open = true;
  679. },
  680. /** 下载模板操作 */
  681. importTemplate() {
  682. this.$refs['downloadFileForm'].submit()
  683. },
  684. // 文件上传中处理
  685. handleFileUploadProgress(event, file, fileList) {
  686. this.waitSubmit = true;
  687. this.upload.isUploading = true;
  688. },
  689. // 文件上传成功处理
  690. handleFileSuccess(response, file, fileList) {
  691. this.waitSubmit = false;
  692. this.upload.open = false;
  693. this.upload.isUploading = false;
  694. this.$refs.upload.clearFiles();
  695. this.fullscreenLoading = false;
  696. if (response.data.length > 0) {
  697. let failrow = ''
  698. for (let i = 0; i < response.data.length; i++) {
  699. failrow += response.data[i] + ','
  700. }
  701. this.$alert('导入成功条数:'+ response.msg + '<br>' + '失败行数:' + failrow, '导入结果', {dangerouslyUseHTMLString: true});
  702. } else {
  703. this.$alert('导入成功条数:' + response.msg, '导入结果', {dangerouslyUseHTMLString: true});
  704. }
  705. this.getList();
  706. },
  707. // 提交上传文件
  708. submitFileForm() {
  709. this.$refs.upload.submit();
  710. this.fullscreenLoading = true;
  711. },
  712. addAprrove(row, type) {
  713. var rows = row ? [row] : this.dataListSelections.map(item => {
  714. return item
  715. })
  716. for (let i = 0; i < rows.length; i++) {
  717. if (rows[i].approveStatus != 0) {
  718. this.$alert('当前设备正在申请中,无法重复申请', '提示', {
  719. type: 'warning'
  720. })
  721. return
  722. }
  723. }
  724. this.addAprroveVisible = true
  725. console.log(rows)
  726. console.log(type)
  727. this.$nextTick(() => {
  728. this.$refs.addApprove.init(rows, type)
  729. })
  730. },
  731. hisApprove(row, type) {
  732. this.hisAprroveVisible = true
  733. this.$nextTick(() => {
  734. this.$refs.hisApprove.init(row, type)
  735. })
  736. },
  737. checkList(row, type) {
  738. this.hisCheckVisible = true
  739. this.$nextTick(() => {
  740. this.$refs.hisCheck.init(row, type)
  741. })
  742. },
  743. hisReform(row) {
  744. this.hisReformVisible = true
  745. this.$nextTick(() => {
  746. this.$refs.hisReformList.init(row)
  747. })
  748. },
  749. //导出excel
  750. downloadDev(type) {
  751. var rows = this.dataListSelections.map(item => {
  752. return item.id
  753. })
  754. const queryParams = {ids: null};
  755. queryParams.ids = rows.join()
  756. exportSpecList(queryParams).then(response => {
  757. this.download(response.msg);
  758. })
  759. },
  760. uploadUrl(uploadType) {
  761. return process.env.VUE_APP_BASE_API + "/sems/specGl/updateData"
  762. },
  763. //位号颜色变换
  764. tableCellStyle({row, column, rowIndex, columnIndex}) {
  765. if (columnIndex == 7 && row.isRepeat == 1) {
  766. return "color:rgba(255, 26, 26, 0.98);"
  767. }
  768. if (row.warnFlag == 1) {
  769. return "background-color:rgba(255, 255,153, 0.5);"
  770. }
  771. if (row.warnFlag == 2) {
  772. return "background-color:rgba(255, 180, 68, 0.5);"
  773. }
  774. if (row.warnFlag == 3) {
  775. return "background-color:rgba(255, 68,68, 0.5);"
  776. }
  777. },
  778. //element表格排序
  779. sortList(val) {
  780. var sort = "asc";
  781. let sortTip = val.order
  782. this.queryParams.isAsc = sort;
  783. this.queryParams.orderByColumn = val.prop;
  784. if (sortTip === 'descending') {
  785. sort = 'desc' // 降序
  786. } else if (sortTip === 'ascending') {
  787. sort = 'asc' // 升序
  788. } else if (sortTip === null) {
  789. this.queryParams.isAsc = null;
  790. this.queryParams.orderByColumn = null;
  791. }
  792. this.loading = true;
  793. listSpecGl(this.queryParams).then(response => {
  794. this.specGlList = response.rows;
  795. this.total = response.total;
  796. this.loading = false;
  797. });
  798. }
  799. }
  800. };
  801. </script>