index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  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. clearable
  8. placeholder="请输入装置名称"
  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:specAqf: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:specAqf: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:specAqf: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:specAqf: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:specAqf: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 v-loading="loading" :data="aqfList" :height="clientHeight" border
  83. @selection-change="handleSelectionChange">
  84. <el-table-column align="center" fixed="left" type="selection" width="55"/>
  85. <el-table-column :index="indexMethod" align="center" label="序号" type="index" width="50"/>
  86. <el-table-column :show-overflow-tooltip="true" align="center" label="装置名称" prop="plantCode"/>
  87. <el-table-column :show-overflow-tooltip="true" align="center" label="描述" prop="describe"/>
  88. <el-table-column :show-overflow-tooltip="true" align="center" label="介质" prop="medium"/>
  89. <el-table-column :show-overflow-tooltip="true" align="center" label="介质相态" prop="mediumPhase"/>
  90. <el-table-column :show-overflow-tooltip="true" align="center" label="从" prop="starting"/>
  91. <el-table-column :show-overflow-tooltip="true" align="center" label="到" prop="arrive"/>
  92. <el-table-column :show-overflow-tooltip="true" align="center" label="出厂编号" prop="factoryNo"/>
  93. <el-table-column :show-overflow-tooltip="true" align="center" label="阀类型" prop="valveType"/>
  94. <el-table-column :show-overflow-tooltip="true" align="center" label="数据表" prop="datasheet"/>
  95. <el-table-column :show-overflow-tooltip="true" align="center" label="计算书" prop="calculationBook"/>
  96. <el-table-column :show-overflow-tooltip="true" align="center" label="Free Orifice Selected Area mm2"
  97. prop="selectedArea" width="220px"/>
  98. <el-table-column :show-overflow-tooltip="true" align="center" label="Senarios(design case bold)" prop="senarios"
  99. width="200px"/>
  100. <el-table-column :show-overflow-tooltip="true" align="center" label="Required relieving capacity"
  101. prop="requiredRelieving" width="200px"/>
  102. <el-table-column :show-overflow-tooltip="true" align="center" label="Rated relieving capacity (Kg/hr)"
  103. prop="ratedRelieving" width="220px"/>
  104. <el-table-column :show-overflow-tooltip="true" align="center" label="入口尺寸" prop="inletSize"/>
  105. <el-table-column :show-overflow-tooltip="true" align="center" label="入口垫片压力等级" prop="pressureRating"
  106. width="140px"/>
  107. <el-table-column :show-overflow-tooltip="true" align="center" label="出口尺寸" prop="outSize"/>
  108. <el-table-column :show-overflow-tooltip="true" align="center" label="出口垫片压力等级" prop="outPressureRating"
  109. width="140px"/>
  110. <el-table-column :show-overflow-tooltip="true" align="center" label="设定压力" prop="setPressure"/>
  111. <el-table-column :show-overflow-tooltip="true" align="center" label="背压" prop="backPressure"/>
  112. <el-table-column :formatter="yseOrNoFormat" :show-overflow-tooltip="true" align="center" label="是否强检"
  113. prop="isInspection"/>
  114. <el-table-column :show-overflow-tooltip="true" align="center" label="本次校验日期" prop="warnDate" width="100px">
  115. <template slot-scope="scope">
  116. <span>{{ parseTime(scope.row.warnDate, '{y}-{m}-{d}') }}</span>
  117. </template>
  118. </el-table-column>
  119. <el-table-column :show-overflow-tooltip="true" align="center" label="下次校验日期" prop="nextWarnDate"
  120. width="100px">
  121. <template slot-scope="scope">
  122. <span>{{ parseTime(scope.row.nextWarnDate, '{y}-{m}-{d}') }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column :formatter="yseOrNoFormat" :show-overflow-tooltip="true" align="center" label="是否需要脚手架"
  126. prop="needScaffold" width="120px"/>
  127. <el-table-column :formatter="yseOrNoFormat" :show-overflow-tooltip="true" align="center" label="保温"
  128. prop="keepWarm"/>
  129. <el-table-column :formatter="yseOrNoFormat" :show-overflow-tooltip="true" align="center" label="吊机"
  130. prop="crane"/>
  131. <el-table-column :show-overflow-tooltip="true" align="center" label="检验状态" prop="checkStatus"/>
  132. <el-table-column :formatter="statusFormatter" :show-overflow-tooltip="true" align="center" label="状态"
  133. prop="status"/>
  134. <el-table-column align="center" class-name="small-padding fixed-width" fixed="right" label="操作" width="120">
  135. <template slot-scope="scope">
  136. <el-button
  137. v-hasPermi="['sems:specAqf:edit']"
  138. icon="el-icon-edit"
  139. size="mini"
  140. type="text"
  141. @click="handleUpdate(scope.row)"
  142. >修改
  143. </el-button>
  144. </template>
  145. </el-table-column>
  146. </el-table>
  147. <pagination
  148. v-show="total>0"
  149. :limit.sync="queryParams.pageSize"
  150. :page.sync="queryParams.pageNum"
  151. :total="total"
  152. @pagination="getList"
  153. />
  154. <!-- 添加或修改特种设备安全阀台账对话框 -->
  155. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" append-to-body width="60%" >
  156. <el-form ref="form" :model="form" :rules="rules" label-width="130px">
  157. <el-row>
  158. <el-col :span="12">
  159. <el-form-item label="装置名称" prop="plantCode">
  160. <el-input v-model="form.plantCode" placeholder="请输入装置名称"/>
  161. </el-form-item>
  162. </el-col>
  163. <el-col :span="12">
  164. <el-form-item label="描述" prop="describe">
  165. <el-input v-model="form.describe" placeholder="请输入描述"/>
  166. </el-form-item>
  167. </el-col>
  168. </el-row>
  169. <el-row>
  170. <el-col :span="12">
  171. <el-form-item label="介质" prop="medium">
  172. <el-input v-model="form.medium" placeholder="请输入介质"/>
  173. </el-form-item>
  174. </el-col>
  175. <el-col :span="12">
  176. <el-form-item label="介质相态" prop="mediumPhase">
  177. <el-input v-model="form.mediumPhase" placeholder="请输入介质相态"/>
  178. </el-form-item>
  179. </el-col>
  180. </el-row>
  181. <el-row>
  182. <el-col :span="12">
  183. <el-form-item label="从" prop="starting">
  184. <el-input v-model="form.starting" placeholder="请输入从"/>
  185. </el-form-item>
  186. </el-col>
  187. <el-col :span="12">
  188. <el-form-item label="到" prop="arrive">
  189. <el-input v-model="form.arrive" placeholder="请输入到"/>
  190. </el-form-item>
  191. </el-col>
  192. </el-row>
  193. <el-row>
  194. <el-col :span="12">
  195. <el-form-item label="出厂编号" prop="factoryNo">
  196. <el-input v-model="form.factoryNo" placeholder="请输入出厂编号"/>
  197. </el-form-item>
  198. </el-col>
  199. <el-col :span="12">
  200. <el-form-item label="阀类型" prop="valveType">
  201. <el-input v-model="form.valveType" placeholder="请输入阀类型"/>
  202. </el-form-item>
  203. </el-col>
  204. </el-row>
  205. <el-row>
  206. <el-col :span="12">
  207. <el-form-item label="数据表" prop="datasheet">
  208. <el-input v-model="form.datasheet" placeholder="请输入数据表"/>
  209. </el-form-item>
  210. </el-col>
  211. <el-col :span="12">
  212. <el-form-item label="计算书" prop="calculationBook">
  213. <el-input v-model="form.calculationBook" placeholder="请输入计算书"/>
  214. </el-form-item>
  215. </el-col>
  216. </el-row>
  217. <el-row>
  218. <el-col :span="12">
  219. <el-form-item label="Free Orifice Selected Area mm2" prop="selectedArea">
  220. <el-input v-model="form.selectedArea" placeholder="请输入Free Orifice Selected Area mm2"/>
  221. </el-form-item>
  222. </el-col>
  223. <el-col :span="12">
  224. <el-form-item label="Senarios(design case bold)" prop="senarios">
  225. <el-input v-model="form.senarios" placeholder="请输入Senarios(design case bold)"/>
  226. </el-form-item>
  227. </el-col>
  228. </el-row>
  229. <el-row>
  230. <el-col :span="12">
  231. <el-form-item label="Required relieving capacity" prop="requiredRelieving">
  232. <el-input v-model="form.requiredRelieving" placeholder="请输入Required relieving capacity"/>
  233. </el-form-item>
  234. </el-col>
  235. <el-col :span="12">
  236. <el-form-item label="Rated relieving capacity (Kg/hr)" prop="ratedRelieving">
  237. <el-input v-model="form.ratedRelieving" placeholder="请输入Rated relieving capacity (Kg/hr)"/>
  238. </el-form-item>
  239. </el-col>
  240. </el-row>
  241. <el-row>
  242. <el-col :span="12">
  243. <el-form-item label="入口尺寸" prop="inletSize">
  244. <el-input v-model="form.inletSize" placeholder="请输入入口尺寸"/>
  245. </el-form-item>
  246. </el-col>
  247. <el-col :span="12">
  248. <el-form-item label="入口垫片压力等级" prop="pressureRating">
  249. <el-input v-model="form.pressureRating" placeholder="请输入入口垫片压力等级"/>
  250. </el-form-item>
  251. </el-col>
  252. </el-row>
  253. <el-row>
  254. <el-col :span="12">
  255. <el-form-item label="出口尺寸" prop="outSize">
  256. <el-input v-model="form.outSize" placeholder="请输入出口尺寸"/>
  257. </el-form-item>
  258. </el-col>
  259. <el-col :span="12">
  260. <el-form-item label="出口垫片压力等级" prop="outPressureRating">
  261. <el-input v-model="form.outPressureRating" 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="setPressure">
  268. <el-input v-model="form.setPressure" placeholder="请输入设定压力"/>
  269. </el-form-item>
  270. </el-col>
  271. <el-col :span="12">
  272. <el-form-item label="背压" prop="backPressure">
  273. <el-input v-model="form.backPressure" 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="warnDate">
  280. <el-date-picker v-model="form.warnDate" clearable placeholder="选择本次校验日期"
  281. size="small"
  282. style="width: 100%"
  283. type="date"
  284. value-format="yyyy-MM-dd">
  285. </el-date-picker>
  286. </el-form-item>
  287. </el-col>
  288. <el-col :span="12">
  289. <el-form-item label="下次校验日期" prop="nextWarnDate">
  290. <el-date-picker v-model="form.nextWarnDate" clearable placeholder="选择下次校验日期"
  291. size="small"
  292. style="width: 100%"
  293. type="date"
  294. value-format="yyyy-MM-dd">
  295. </el-date-picker>
  296. </el-form-item>
  297. </el-col>
  298. </el-row>
  299. <el-row>
  300. <el-col :span="12">
  301. <el-form-item label="是否强检" prop="isInspection">
  302. <el-radio-group v-model="form.isInspection" size="large">
  303. <el-radio label="1" size="large">是</el-radio>
  304. <el-radio label="0" size="large">否</el-radio>
  305. </el-radio-group>
  306. </el-form-item>
  307. </el-col>
  308. <el-col :span="12">
  309. <el-form-item label="是否需要脚手架" prop="needScaffold">
  310. <el-radio-group v-model="form.needScaffold" size="large">
  311. <el-radio label="1" size="large">是</el-radio>
  312. <el-radio label="0" size="large">否</el-radio>
  313. </el-radio-group>
  314. </el-form-item>
  315. </el-col>
  316. </el-row>
  317. <el-row>
  318. <el-col :span="12">
  319. <el-form-item label="保温" prop="keepWarm">
  320. <el-radio-group v-model="form.keepWarm" size="large">
  321. <el-radio label="1" size="large">是</el-radio>
  322. <el-radio label="0" size="large">否</el-radio>
  323. </el-radio-group>
  324. </el-form-item>
  325. </el-col>
  326. <el-col :span="12">
  327. <el-form-item label="吊机" prop="crane">
  328. <el-radio-group v-model="form.crane" size="large">
  329. <el-radio label="1" size="large">是</el-radio>
  330. <el-radio label="0" size="large">否</el-radio>
  331. </el-radio-group>
  332. </el-form-item>
  333. </el-col>
  334. </el-row>
  335. <el-row>
  336. <el-col :span="12">
  337. <el-form-item label="状态" prop="status">
  338. <el-radio-group v-model="form.status" size="large">
  339. <el-radio :label="1" size="large">在用</el-radio>
  340. <el-radio :label="2" size="large">停用</el-radio>
  341. <el-radio :label="3" size="large">报废</el-radio>
  342. <el-radio :label="-1" size="large">封存</el-radio>
  343. </el-radio-group>
  344. </el-form-item>
  345. </el-col>
  346. <el-col :span="12">
  347. <el-form-item label="备注" prop="remarks">
  348. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  349. </el-form-item>
  350. </el-col>
  351. </el-row>
  352. </el-form>
  353. <div slot="footer" class="dialog-footer">
  354. <el-button type="primary" @click="submitForm">确 定</el-button>
  355. <el-button @click="cancel">取 消</el-button>
  356. </div>
  357. </el-dialog>
  358. <!-- 用户导入对话框 -->
  359. <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" append-to-body width="400px">
  360. <el-upload
  361. ref="upload"
  362. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  363. :auto-upload="false"
  364. :disabled="upload.isUploading"
  365. :headers="upload.headers"
  366. :limit="1"
  367. :on-progress="handleFileUploadProgress"
  368. :on-success="handleFileSuccess"
  369. accept=".xlsx, .xls"
  370. drag
  371. >
  372. <i class="el-icon-upload"></i>
  373. <div class="el-upload__text">
  374. 将文件拖到此处,或
  375. <em>点击上传</em>
  376. </div>
  377. <div slot="tip" class="el-upload__tip">
  378. <el-checkbox v-model="upload.updateSupport"/>
  379. 是否更新已经存在的用户数据
  380. <el-link style="font-size:12px" type="info" @click="importTemplate">下载模板</el-link>
  381. </div>
  382. <div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  383. </el-upload>
  384. <div slot="footer" class="dialog-footer">
  385. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  386. <el-button @click="upload.open = false">取 消</el-button>
  387. </div>
  388. </el-dialog>
  389. </div>
  390. </template>
  391. <script>
  392. import {addAqf, delAqf, exportAqf, getAqf, importTemplate, listAqf, updateAqf} from "@/api/sems/aqf";
  393. import {treeselect} from "@/api/system/dept";
  394. import {getToken} from "@/utils/auth";
  395. import Treeselect from "@riophae/vue-treeselect";
  396. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  397. export default {
  398. name: "Aqf",
  399. components: {Treeselect},
  400. data() {
  401. return {
  402. yesOrNoOptions: [],
  403. statusOptions: [],
  404. // 遮罩层
  405. loading: true,
  406. // 选中数组
  407. ids: [],
  408. // 非单个禁用
  409. single: true,
  410. // 非多个禁用
  411. multiple: true,
  412. // 显示搜索条件
  413. showSearch: false,
  414. // 总条数
  415. total: 0,
  416. // 特种设备安全阀台账表格数据
  417. aqfList: [],
  418. // 弹出层标题
  419. title: "",
  420. // 部门树选项
  421. deptOptions: undefined,
  422. clientHeight: 300,
  423. // 是否显示弹出层
  424. open: false,
  425. // 用户导入参数
  426. upload: {
  427. // 是否显示弹出层(用户导入)
  428. open: false,
  429. // 弹出层标题(用户导入)
  430. title: "",
  431. // 是否禁用上传
  432. isUploading: false,
  433. // 是否更新已经存在的用户数据
  434. updateSupport: 0,
  435. // 设置上传的请求头部
  436. headers: {Authorization: "Bearer " + getToken()},
  437. // 上传的地址
  438. url: process.env.VUE_APP_BASE_API + "/sems/aqf/importData"
  439. },
  440. // 查询参数
  441. queryParams: {
  442. fuzzy: null,
  443. pageNum: 1,
  444. pageSize: 20,
  445. plantCode: null,
  446. devno: null,
  447. pidNo: null,
  448. describe: null,
  449. medium: null,
  450. mediumPhase: null,
  451. starting: null,
  452. arrive: null,
  453. manufacturer: null,
  454. model: null,
  455. factoryNo: null,
  456. valveType: null,
  457. datasheet: null,
  458. calculationBook: null,
  459. selectedArea: null,
  460. senarios: null,
  461. requiredRelieving: null,
  462. ratedRelieving: null,
  463. inletSize: null,
  464. pressureRating: null,
  465. outSize: null,
  466. outPressureRating: null,
  467. setPressure: null,
  468. backPressure: null,
  469. isInspection: null,
  470. warnDate: null,
  471. nextWarnDate: null,
  472. needScaffold: null,
  473. keepWarm: null,
  474. crane: null,
  475. submitdate: null,
  476. status: 1,
  477. createrCode: null,
  478. createdate: null,
  479. updaterCode: null,
  480. updatedate: null,
  481. deptId: null,
  482. remarks: null,
  483. approveStatus: null,
  484. approveTime: null,
  485. changeTime: null
  486. },
  487. // 表单参数
  488. form: {},
  489. // 表单校验
  490. rules: {}
  491. };
  492. },
  493. watch: {
  494. // 根据名称筛选部门树
  495. deptName(val) {
  496. this.$refs.tree.filter(val);
  497. }
  498. },
  499. created() {
  500. //设置表格高度对应屏幕高度
  501. this.$nextTick(() => {
  502. this.clientHeight = document.body.clientHeight - 250
  503. })
  504. this.getList();
  505. this.getTreeselect();
  506. this.getDicts("YES_NO").then(response => {
  507. this.yesOrNoOptions = response.data;
  508. });
  509. this.getDicts("spec_dev_status").then(response => {
  510. this.statusOptions = response.data;
  511. });
  512. },
  513. methods: {
  514. statusFormatter(row, column) {
  515. return this.selectDictLabel(this.statusOptions, row.status);
  516. },
  517. // 是否字典翻译
  518. yseOrNoFormat(row, column) {
  519. switch (column.property) {
  520. case "isPid":
  521. return this.selectDictLabel(this.yesOrNoOptions, row.isPid);
  522. case "isInspection":
  523. return this.selectDictLabel(this.yesOrNoOptions, row.isInspection);
  524. case "keepWarm":
  525. return this.selectDictLabel(this.yesOrNoOptions, row.keepWarm);
  526. case "crane":
  527. return this.selectDictLabel(this.yesOrNoOptions, row.crane);
  528. case "needScaffold":
  529. return this.selectDictLabel(this.yesOrNoOptions, row.needScaffold);
  530. }
  531. },
  532. /** 查询特种设备安全阀台账列表 */
  533. getList() {
  534. this.loading = true;
  535. listAqf(this.queryParams).then(response => {
  536. this.aqfList = response.rows;
  537. this.total = response.total;
  538. this.loading = false;
  539. });
  540. },
  541. /** 查询部门下拉树结构 */
  542. getTreeselect() {
  543. treeselect().then(response => {
  544. this.deptOptions = response.data;
  545. });
  546. },
  547. // 取消按钮
  548. cancel() {
  549. this.open = false;
  550. this.reset();
  551. },
  552. // 表单重置
  553. reset() {
  554. this.form = {
  555. id: null,
  556. plantCode: null,
  557. devno: null,
  558. pidNo: null,
  559. describe: null,
  560. medium: null,
  561. mediumPhase: null,
  562. starting: null,
  563. arrive: null,
  564. manufacturer: null,
  565. model: null,
  566. factoryNo: null,
  567. valveType: null,
  568. datasheet: null,
  569. calculationBook: null,
  570. selectedArea: null,
  571. senarios: null,
  572. requiredRelieving: null,
  573. ratedRelieving: null,
  574. inletSize: null,
  575. pressureRating: null,
  576. outSize: null,
  577. outPressureRating: null,
  578. setPressure: null,
  579. backPressure: null,
  580. isInspection: null,
  581. warnDate: null,
  582. nextWarnDate: null,
  583. needScaffold: null,
  584. keepWarm: null,
  585. crane: null,
  586. submitdate: null,
  587. status: 0,
  588. delFlag: null,
  589. createrCode: null,
  590. createdate: null,
  591. updaterCode: null,
  592. updatedate: null,
  593. deptId: null,
  594. remarks: null,
  595. approveStatus: 0,
  596. approveTime: null,
  597. changeTime: null
  598. };
  599. this.resetForm("form");
  600. },
  601. /** 搜索按钮操作 */
  602. handleQuery() {
  603. this.queryParams.pageNum = 1;
  604. this.getList();
  605. },
  606. /** 重置按钮操作 */
  607. resetQuery() {
  608. this.resetForm("queryForm");
  609. this.handleQuery();
  610. },
  611. // 多选框选中数据
  612. handleSelectionChange(selection) {
  613. this.ids = selection.map(item => item.id)
  614. this.single = selection.length !== 1
  615. this.multiple = !selection.length
  616. },
  617. /** 新增按钮操作 */
  618. handleAdd() {
  619. this.reset();
  620. this.open = true;
  621. this.title = "添加特种设备安全阀台账";
  622. },
  623. /** 修改按钮操作 */
  624. handleUpdate(row) {
  625. this.reset();
  626. const id = row.id || this.ids
  627. getAqf(id).then(response => {
  628. this.form = response.data;
  629. this.open = true;
  630. this.title = "修改特种设备安全阀台账";
  631. });
  632. },
  633. /** 提交按钮 */
  634. submitForm() {
  635. this.$refs["form"].validate(valid => {
  636. if (valid) {
  637. if (this.form.id != null) {
  638. updateAqf(this.form).then(response => {
  639. this.$modal.msgSuccess("修改成功");
  640. this.open = false;
  641. this.getList();
  642. });
  643. } else {
  644. addAqf(this.form).then(response => {
  645. this.$modal.msgSuccess("新增成功");
  646. this.open = false;
  647. this.getList();
  648. });
  649. }
  650. }
  651. });
  652. },
  653. /** 删除按钮操作 */
  654. handleDelete(row) {
  655. const ids = row.id || this.ids;
  656. this.$confirm('是否确认删除?', "警告", {
  657. confirmButtonText: "确定",
  658. cancelButtonText: "取消",
  659. type: "warning"
  660. }).then(function () {
  661. return delAqf(ids);
  662. }).then(() => {
  663. this.getList();
  664. this.$modal.msgSuccess("删除成功");
  665. })
  666. },
  667. /** 导出按钮操作 */
  668. handleExport() {
  669. const queryParams = this.queryParams;
  670. this.$confirm('是否确认导出所有特种设备安全阀台账数据项?', "警告", {
  671. confirmButtonText: "确定",
  672. cancelButtonText: "取消",
  673. type: "warning"
  674. }).then(function () {
  675. return exportAqf(queryParams);
  676. }).then(response => {
  677. this.download(response.msg);
  678. })
  679. },
  680. /** 导入按钮操作 */
  681. handleImport() {
  682. this.upload.title = "用户导入";
  683. this.upload.open = true;
  684. },
  685. /** 下载模板操作 */
  686. importTemplate() {
  687. importTemplate().then(response => {
  688. this.download(response.msg);
  689. });
  690. },
  691. // 文件上传中处理
  692. handleFileUploadProgress(event, file, fileList) {
  693. this.upload.isUploading = true;
  694. },
  695. // 文件上传成功处理
  696. handleFileSuccess(response, file, fileList) {
  697. this.upload.open = false;
  698. this.upload.isUploading = false;
  699. this.$refs.upload.clearFiles();
  700. this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
  701. this.getList();
  702. },
  703. // 提交上传文件
  704. submitFileForm() {
  705. this.$refs.upload.submit();
  706. },
  707. //翻页后继续计算序列值
  708. indexMethod(index) {
  709. return (this.queryParams.pageNum - 1) * this.queryParams.pageSize + index + 1;
  710. }
  711. }
  712. };
  713. </script>