ty.vue 28 KB

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