index.vue 24 KB

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