ty.vue 28 KB

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