bf.vue 24 KB

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