zx.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739
  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="装置" label-width="50" 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:specCc: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:specCc: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:specCc: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:specCc: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:specCc: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="specCcList"
  83. :height="clientHeight" border @selection-change="handleSelectionChange" @sort-change="sortList">
  84. <el-table-column align="center" fixed="left" 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="型号" :show-overflow-tooltip="true" align="center" prop="model"/>
  89. <el-table-column label="使用登记证编号 车牌号" :show-overflow-tooltip="true" align="center" fixed="left"
  90. prop="carNo" width="180"/>
  91. <el-table-column label="设备代码" :show-overflow-tooltip="true" align="center" prop="regno"/>
  92. <el-table-column label="发动机号/底盘号" :show-overflow-tooltip="true" align="center" prop="frameNo"
  93. width="150"/>
  94. <el-table-column label="下次检验日期" align="center" prop="nextWarnDate" sortable="custom" width="140">
  95. <template slot-scope="scope">
  96. <span>{{ parseTime(scope.row.nextWarnDate, '{y}-{m}-{d}') }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="出厂资料" :show-overflow-tooltip="true" align="center" prop="factoryInfo"/>
  100. <el-table-column label="使用场所" :show-overflow-tooltip="true" align="center" fixed="left"
  101. prop="useDept"/>
  102. <el-table-column label="防爆级别" :show-overflow-tooltip="true" align="center" prop="exGrade"/>
  103. <el-table-column label="制造单位" :show-overflow-tooltip="true" align="center" prop="createUnit"/>
  104. <el-table-column label="检验状态" align="center" 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:specCc: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
  130. width="60%">
  131. <el-form ref="form" :model="form" :rules="rules" label-width="140px">
  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="devType">
  140. <el-input v-model="form.devType" 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="carNo">
  147. <el-input v-model="form.carNo" placeholder="请输入使用登记证编号/车牌号"/>
  148. </el-form-item>
  149. </el-col>
  150. <el-col :span="12">
  151. <el-form-item label="使用场所" prop="useDept">
  152. <el-input v-model="form.useDept" 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="regno">
  164. <el-input v-model="form.regno" placeholder="请输入设备代码"/>
  165. </el-form-item>
  166. </el-col>
  167. </el-row>
  168. <el-row>
  169. <el-col :span="12">
  170. <el-form-item label="发动机号/底盘号" prop="frameNo">
  171. <el-input v-model="form.frameNo" placeholder="请输入车架(底盘)编号"/>
  172. </el-form-item>
  173. </el-col>
  174. <el-col :span="12">
  175. <el-form-item label="下次检验日期" prop="nextWarnDate">
  176. <el-date-picker v-model="form.nextWarnDate" placeholder="请选择+ 下次检验日期" clearable
  177. size="small"
  178. style="width: 100%"
  179. type="month"
  180. value-format="yyyy-MM-dd">
  181. </el-date-picker>
  182. </el-form-item>
  183. </el-col>
  184. </el-row>
  185. <el-row>
  186. <el-col :span="12">
  187. <el-form-item label="出厂资料" prop="factoryInfo">
  188. <el-input v-model="form.factoryInfo" placeholder="请输入出厂资料"/>
  189. </el-form-item>
  190. </el-col>
  191. <el-col :span="12">
  192. <el-form-item label="防爆级别" prop="exGrade">
  193. <el-input v-model="form.exGrade" placeholder="请输入防爆级别"/>
  194. </el-form-item>
  195. </el-col>
  196. </el-row>
  197. <el-row>
  198. <el-col :span="12">
  199. <el-form-item label="制造单位" prop="createUnit">
  200. <el-input v-model="form.createUnit" 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. addSpecCc,
  273. delSpecCc,
  274. duplicate,
  275. exportSpecCc,
  276. exportSpecList,
  277. getSpecCc,
  278. listSpecCc,
  279. updateSpecCc
  280. } from "@/api/sems/specCc";
  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: "SpecCc",
  287. components: {Treeselect},
  288. data() {
  289. return {
  290. filterList: [], //删选的list
  291. fullscreenLoading: false,
  292. waitSubmit: false,
  293. hisReformVisible: false,
  294. dataForm: 0,
  295. devType: 6,
  296. inspectionInformation: false,
  297. downloadType: '',
  298. downloadDevAction: process.env.VUE_APP_BASE_API + '/common/download/exportDevList',
  299. // 遮罩层
  300. loading: true,
  301. modifyVisible: false,
  302. // 选中数组
  303. ids: [],
  304. dataListSelections: [],
  305. // 非单个禁用
  306. single: true,
  307. // 非多个禁用
  308. multiple: true,
  309. // 显示搜索条件
  310. showSearch: false,
  311. // 总条数
  312. total: 0,
  313. // 特种设备叉车台账表格数据
  314. specCcList: [],
  315. // 弹出层标题
  316. title: "",
  317. // 部门树选项
  318. deptOptions: undefined,
  319. clientHeight: 300,
  320. // 是否显示弹出层
  321. open: false,
  322. // 状态字典
  323. statusOptions: [],
  324. plantOptions: [],
  325. plantMaintOptions: [],
  326. // 申请状态字典
  327. approveStatusOptions: [],
  328. specCcOwnerOptions: [],
  329. wxjlList: [],
  330. // 用户导入参数
  331. upload: {
  332. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  333. // 是否显示弹出层(用户导入)
  334. type: "specCc",
  335. // 是否显示弹出层(用户导入)
  336. open: false,
  337. // 弹出层标题(用户导入)
  338. title: "",
  339. // 是否禁用上传
  340. isUploading: false,
  341. // 是否更新已经存在的用户数据
  342. updateSupport: 0,
  343. // 设置上传的请求头部
  344. headers: {Authorization: "Bearer " + getToken()},
  345. // 上传的地址
  346. url: process.env.VUE_APP_BASE_API + "/sems/specCc/importData"
  347. },
  348. // 查询参数
  349. queryParams: {
  350. pageNum: 1,
  351. pageSize: 20,
  352. orderByColumn: null,
  353. isAsc: null,
  354. plantCode: null,
  355. carNo: null,
  356. devname: null,
  357. devno: null,
  358. status: -1,
  359. fuzzy: null,
  360. },
  361. // 表单参数
  362. form: {},
  363. modifyForm: {},
  364. // 表单校验
  365. rules: {
  366. plantCode: [
  367. {required: true, message: '装置名称不能为空', trigger: "blur"}
  368. ],
  369. }
  370. };
  371. },
  372. watch: {
  373. // 根据名称筛选部门树
  374. deptName(val) {
  375. this.$refs.tree.filter(val);
  376. }
  377. },
  378. created() {
  379. //设置表格高度对应屏幕高度
  380. this.$nextTick(() => {
  381. this.clientHeight = document.body.clientHeight - 250
  382. })
  383. this.getList();
  384. this.getTreeselect();
  385. this.getDicts("spec_dev_status").then(response => {
  386. this.statusOptions = response.data;
  387. });
  388. //预警等级字典
  389. this.getDicts("ALARM_LEVEL").then(response => {
  390. for (let i = 0; i < response.data.length; i++) {
  391. let items = {
  392. text: '',
  393. value: ''
  394. };
  395. items.value = response.data[i].dictValue;
  396. items.text = response.data[i].dictLabel;
  397. this.filterList.push(items);
  398. }
  399. });
  400. this.getDicts("spec_approve_status").then(response => {
  401. for (let i = 0; i < response.data.length; i++) {
  402. if (!["5", "6", "7", "8", "16", "17"].includes(response.data[i].dictValue)) {
  403. this.approveStatusOptions.push(response.data[i])
  404. }
  405. }
  406. });
  407. this.getDicts("spec_cc_owner").then(response => {
  408. this.specCcOwnerOptions = response.data;
  409. });
  410. this.getDicts("SPEC_PLANT_MAINT").then(response => {
  411. this.plantMaintOptions = response.data;
  412. });
  413. let plantParams = {
  414. pType: 1
  415. }
  416. },
  417. methods: {
  418. /** 查询特种设备叉车台账列表 */
  419. getList() {
  420. this.loading = true;
  421. listSpecCc(this.queryParams).then(response => {
  422. this.specCcList = response.rows;
  423. this.total = response.total;
  424. this.loading = false;
  425. });
  426. },
  427. /** 查询部门下拉树结构 */
  428. getTreeselect() {
  429. treeselect().then(response => {
  430. this.deptOptions = response.data;
  431. });
  432. },
  433. // 状态字典翻译
  434. statusFormat(row, column) {
  435. return this.selectDictLabel(this.statusOptions, row.status);
  436. },
  437. // 申请状态字典翻译
  438. approveStatusFormat(row, column) {
  439. return this.selectDictLabel(this.approveStatusOptions, row.approveStatus);
  440. },
  441. // 取消按钮
  442. cancel() {
  443. this.open = false;
  444. this.reset();
  445. },
  446. // 表单重置
  447. reset() {
  448. this.form = {
  449. id: null,
  450. plantCode: null,
  451. unit: null,
  452. carNo: null,
  453. devname: null,
  454. devno: null,
  455. submitdate: null,
  456. status: -1,
  457. delFlag: null,
  458. createrCode: null,
  459. createdate: null,
  460. updaterCode: null,
  461. updatedate: null,
  462. deptId: null,
  463. remarks: null,
  464. perTestConclusion: null,
  465. approveStatus: 0,
  466. regno: null,
  467. useno: null,
  468. warnDate: null,
  469. warnCycle: null,
  470. nextWarnDate: null,
  471. warnFlag: null,
  472. createUnit: null,
  473. checkStrategy: null,
  474. firstWarnDate: null,
  475. checkUnit: null,
  476. docno: null,
  477. approveTime: null,
  478. changeTime: null,
  479. engineNo: null,
  480. color: null,
  481. capacity: null,
  482. model: null,
  483. engineType: null,
  484. devClass: null,
  485. exUnit: null,
  486. useDept: null,
  487. engineer: null,
  488. exGrade: null,
  489. reportNo: null,
  490. frameNo: null,
  491. productNo: null,
  492. assetOwner: null
  493. };
  494. this.dataForm = 0;
  495. this.resetForm("form");
  496. },
  497. /** 搜索按钮操作 */
  498. handleQuery() {
  499. this.queryParams.pageNum = 1;
  500. this.getList();
  501. },
  502. /** 重置按钮操作 */
  503. resetQuery() {
  504. this.resetForm("queryForm");
  505. this.handleQuery();
  506. },
  507. // 多选框选中数据
  508. handleSelectionChange(selection) {
  509. this.ids = selection.map(item => item.id)
  510. this.single = selection.length !== 1
  511. this.multiple = !selection.length
  512. this.dataListSelections = selection
  513. },
  514. /** 新增按钮操作 */
  515. handleAdd() {
  516. this.reset();
  517. this.open = true;
  518. this.title = '添加特种设备场内机动车辆台账';
  519. },
  520. /** 修改按钮操作 */
  521. handleUpdate(row) {
  522. this.reset();
  523. const id = row.id || this.ids
  524. getSpecCc(id).then(response => {
  525. this.form = response.data;
  526. this.open = true;
  527. this.title = '修改特种设备场内机动车辆台账';
  528. });
  529. },
  530. /** 提交按钮 */
  531. submitForm() {
  532. this.$refs["form"].validate(valid => {
  533. if (valid) {
  534. if (this.form.id != null) {
  535. updateSpecCc(this.form).then(response => {
  536. this.$modal.msgSuccess('修改成功');
  537. this.open = false;
  538. this.getList();
  539. });
  540. } else {
  541. addSpecCc(this.form).then(response => {
  542. this.$modal.msgSuccess('新增成功');
  543. this.open = false;
  544. this.getList();
  545. });
  546. }
  547. }
  548. });
  549. },
  550. /** 删除按钮操作 */
  551. handleDelete(row) {
  552. const ids = row.id || this.ids;
  553. this.$confirm('是否确认删除?', '警告', {
  554. confirmButtonText: '确定',
  555. cancelButtonText: '取消',
  556. type: "warning"
  557. }).then(function() {
  558. return delSpecCc(ids);
  559. }).then(() => {
  560. this.getList();
  561. this.$modal.msgSuccess('删除成功');
  562. })
  563. },
  564. /** 去重按钮操作 */
  565. handleDup() {
  566. this.$confirm('是否确认删除?', '警告', {
  567. confirmButtonText: '确定',
  568. cancelButtonText: '取消',
  569. type: "warning"
  570. }).then(function () {
  571. return duplicate();
  572. }).then(() => {
  573. this.getList();
  574. this.$modal.msgSuccess('删除成功');
  575. })
  576. },
  577. /** 导出按钮操作 */
  578. handleExport() {
  579. const queryParams = this.queryParams;
  580. this.$confirm('是否确认导出所有特种设备场内机动车辆台账数据项?', '警告', {
  581. confirmButtonText: '确定',
  582. cancelButtonText: '取消',
  583. type: "warning"
  584. }).then(function () {
  585. return exportSpecCc(queryParams);
  586. }).then(response => {
  587. this.download(response.msg);
  588. })
  589. },
  590. /** 导入按钮操作 */
  591. handleImport() {
  592. this.upload.title = '用户导入';
  593. this.upload.open = true;
  594. },
  595. /** 下载模板操作 */
  596. importTemplate() {
  597. this.$refs['downloadFileForm'].submit()
  598. },
  599. // 文件上传中处理
  600. handleFileUploadProgress(event, file, fileList) {
  601. this.waitSubmit = true;
  602. this.upload.isUploading = true;
  603. },
  604. // 文件上传成功处理
  605. handleFileSuccess(response, file, fileList) {
  606. this.waitSubmit = false;
  607. this.upload.open = false;
  608. this.upload.isUploading = false;
  609. this.$refs.upload.clearFiles();
  610. this.fullscreenLoading = false;
  611. if (response.data.length > 0) {
  612. let failrow = ''
  613. for (let i = 0; i < response.data.length; i++) {
  614. failrow += response.data[i] + ','
  615. }
  616. this.$alert('导入成功条数:' + response.msg + '<br>' + '失败行数:' + failrow, '导入结果', {dangerouslyUseHTMLString: true});
  617. } else {
  618. this.$alert('导入成功条数:' + response.msg, '导入结果', {dangerouslyUseHTMLString: true});
  619. }
  620. this.getList();
  621. },
  622. // 提交上传文件
  623. submitFileForm() {
  624. this.$refs.upload.submit();
  625. this.fullscreenLoading = true;
  626. },
  627. addAprrove(row, type) {
  628. var rows = row ? [row] : this.dataListSelections.map(item => {
  629. return item
  630. })
  631. for (let i = 0; i < rows.length; i++) {
  632. if (rows[i].assetOwner != '自主产权') {
  633. this.$alert('当前设备非自主产权,无法申请', '提示', {
  634. type: 'warning'
  635. })
  636. return
  637. }
  638. }
  639. for (let i = 0; i < rows.length; i++) {
  640. if (rows[i].approveStatus != 0) {
  641. this.$alert('当前设备正在申请中,无法重复申请', '提示', {
  642. type: 'warning'
  643. })
  644. return
  645. }
  646. }
  647. this.addAprroveVisible = true
  648. console.log(rows)
  649. console.log(type)
  650. this.$nextTick(() => {
  651. this.$refs.addApprove.init(rows, type)
  652. })
  653. },
  654. hisApprove(row, type) {
  655. this.hisAprroveVisible = true
  656. this.$nextTick(() => {
  657. this.$refs.hisApprove.init(row, type)
  658. })
  659. },
  660. checkList(row, type) {
  661. this.hisCheckVisible = true
  662. this.$nextTick(() => {
  663. this.$refs.hisCheck.init(row, type)
  664. })
  665. },
  666. hisReform(row) {
  667. this.hisReformVisible = true
  668. this.$nextTick(() => {
  669. this.$refs.hisReformList.init(row);
  670. })
  671. },
  672. //导出excel
  673. downloadDev(type) {
  674. var rows = this.dataListSelections.map(item => {
  675. return item.id
  676. })
  677. const queryParams = {ids: null};
  678. queryParams.ids = rows.join()
  679. exportSpecList(queryParams).then(response => {
  680. this.download(response.msg);
  681. })
  682. },
  683. uploadUrl(uploadType) {
  684. return process.env.VUE_APP_BASE_API + "/sems/specCc/updateData"
  685. },
  686. submitModofyForm() {
  687. addModify(this.modifyForm).then(response => {
  688. this.$modal.msgSuccess('提交成功');
  689. this.modifyVisible = false
  690. this.getList();
  691. });
  692. },
  693. //位号颜色变换
  694. tableCellStyle({row, column, rowIndex, columnIndex}) {
  695. if (columnIndex == 6 && row.isRepeat == 1) {
  696. return "color:rgba(255, 26, 26, 0.98);"
  697. }
  698. if (row.warnFlag == 1) {
  699. return "background-color:rgba(255, 255,153, 0.5);"
  700. }
  701. if (row.warnFlag == 2) {
  702. return "background-color:rgba(255, 180, 68, 0.5);"
  703. }
  704. if (row.warnFlag == 3) {
  705. return "background-color:rgba(255, 68,68, 0.5);"
  706. }
  707. },
  708. //element表格排序
  709. sortList(val) {
  710. var sort = "asc";
  711. let sortTip = val.order
  712. this.queryParams.isAsc = sort;
  713. this.queryParams.orderByColumn = val.prop;
  714. if (sortTip === 'descending') {
  715. sort = 'desc' // 降序
  716. } else if (sortTip === 'ascending') {
  717. sort = 'asc' // 升序
  718. } else if (sortTip === null) {
  719. this.queryParams.isAsc = null;
  720. this.queryParams.orderByColumn = null;
  721. }
  722. this.loading = true;
  723. listSpecCc(this.queryParams).then(response => {
  724. this.specCcList = response.rows;
  725. this.total = response.total;
  726. this.loading = false;
  727. });
  728. }
  729. }
  730. };
  731. </script>