zx.vue 28 KB

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