index.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item label="漏点编号" prop="pointNo">
  5. <el-input
  6. v-model="queryParams.pointNo"
  7. placeholder="请输入漏点编号"
  8. clearable
  9. @keyup.enter.native="handleQuery"
  10. />
  11. </el-form-item>
  12. <el-form-item label="泄漏位置" prop="leakagePosition">
  13. <el-input
  14. v-model="queryParams.leakagePosition"
  15. placeholder="请输入泄漏位置"
  16. clearable
  17. @keyup.enter.native="handleQuery"
  18. />
  19. </el-form-item>
  20. <el-form-item label="泄漏介质" prop="leakageMedium">
  21. <el-input
  22. v-model="queryParams.leakageMedium"
  23. placeholder="请输入泄漏介质"
  24. clearable
  25. @change="handleQuery"
  26. />
  27. </el-form-item>
  28. <el-form-item label="消漏结果" prop="leakageEliminationResults">
  29. <el-select clearable multiple
  30. v-model="queryParams.leakageEliminationResults"
  31. placeholder="请选择消漏结果">
  32. <el-option v-for="dict in dict.type.leakage_result"
  33. :value="dict.value"
  34. :label="dict.label"
  35. :key="dict.value"/>
  36. </el-select>
  37. </el-form-item>
  38. <el-form-item>
  39. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  40. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  41. </el-form-item>
  42. </el-form>
  43. <el-row :gutter="10" class="mb8">
  44. <el-col :span="1.5">
  45. <el-button
  46. type="primary"
  47. plain
  48. icon="el-icon-plus"
  49. size="mini"
  50. @click="handleAdd"
  51. v-hasPermi="['asset:points:add']"
  52. >新增
  53. </el-button>
  54. </el-col>
  55. <el-col :span="1.5">
  56. <el-button
  57. type="success"
  58. plain
  59. icon="el-icon-edit"
  60. size="mini"
  61. :disabled="single"
  62. @click="handleUpdate"
  63. v-hasPermi="['asset:points:edit']"
  64. >修改
  65. </el-button>
  66. </el-col>
  67. <el-col :span="1.5">
  68. <el-button
  69. type="danger"
  70. plain
  71. icon="el-icon-delete"
  72. size="mini"
  73. :disabled="multiple"
  74. @click="handleDelete"
  75. v-hasPermi="['asset:points:remove']"
  76. >删除
  77. </el-button>
  78. </el-col>
  79. <el-col :span="1.5">
  80. <el-button
  81. type="warning"
  82. plain
  83. icon="el-icon-upload2"
  84. size="mini"
  85. @click="handleImport"
  86. v-hasPermi="['asset:points:add']"
  87. >导入
  88. </el-button>
  89. </el-col>
  90. <el-col :span="1.5">
  91. <el-button
  92. type="warning"
  93. plain
  94. icon="el-icon-download"
  95. size="mini"
  96. @click="handleExport"
  97. v-hasPermi="['asset:points:export']"
  98. >导出
  99. </el-button>
  100. </el-col>
  101. <el-col :span="1.5">
  102. <el-button
  103. type="success"
  104. plain
  105. icon="el-icon-date"
  106. size="mini"
  107. @click="openRecord"
  108. >日常巡检记录
  109. </el-button>
  110. </el-col>
  111. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  112. </el-row>
  113. <el-table v-loading="loading" :data="pointsList" @selection-change="handleSelectionChange" :height="clientHeight"
  114. border>
  115. <el-table-column type="selection" width="55" align="center"/>
  116. <el-table-column label="漏点编号" align="center" prop="pointNo" width="130" fixed="left"/>
  117. <el-table-column label="泄漏位置" align="center" prop="leakagePosition" width="230" fixed="left"/>
  118. <el-table-column label="泄漏介质" align="center" prop="leakageMedium" width="120" fixed="left"/>
  119. <el-table-column label="发现时间" align="center" prop="discoveryTime" width="180">
  120. <template slot-scope="scope">
  121. <span>{{ parseTime(scope.row.discoveryTime, '{y}-{m}-{d}') }}</span>
  122. </template>
  123. </el-table-column>
  124. <el-table-column label="发现人员" align="center" prop="discoveryName" width="180"/>
  125. <el-table-column label="泄漏量" align="center" prop="leakageAmount" width="180"/>
  126. <el-table-column label="SAP通知单号" align="center" prop="sapNo" width="180"/>
  127. <el-table-column label="消漏时间" align="center" prop="leakageEliminationTime" width="180">
  128. <template slot-scope="scope">
  129. <span>{{ parseTime(scope.row.leakageEliminationTime, '{y}-{m}-{d}') }}</span>
  130. </template>
  131. </el-table-column>
  132. <el-table-column label="消漏方法" align="center" prop="leakageEliminationFunc" width="180"/>
  133. <el-table-column label="挂牌" align="center" prop="listing" width="180"/>
  134. <el-table-column label="带压堵漏" align="center" prop="pressurePlugging" width="180"/>
  135. <el-table-column label="消漏结果" align="center" prop="leakageEliminationResult" width="100">
  136. <template slot-scope="scope">
  137. <dict-tag :options="dict.type.leakage_result" :value="scope.row.leakageEliminationResult"/>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="下次检修日期" align="center" prop="nextCheckDate" width="180">
  141. <template slot-scope="scope">
  142. <span>{{ parseTime(scope.row.nextCheckDate, '{y}-{m}-{d}') }}</span>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="备注" align="center" prop="remarks" width="230"/>
  146. <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="180">
  147. <template slot-scope="scope">
  148. <el-button
  149. size="mini"
  150. type="text"
  151. icon="el-icon-edit"
  152. @click="handleUpdate(scope.row)"
  153. v-hasPermi="['asset:points:edit']"
  154. >修改
  155. </el-button>
  156. <el-button
  157. size="mini"
  158. type="text"
  159. icon="el-icon-delete"
  160. @click="handleDelete(scope.row)"
  161. v-hasPermi="['asset:points:remove']"
  162. >删除
  163. </el-button>
  164. </template>
  165. </el-table-column>
  166. </el-table>
  167. <pagination
  168. v-show="total>0"
  169. :total="total"
  170. :page.sync="queryParams.pageNum"
  171. :limit.sync="queryParams.pageSize"
  172. @pagination="getList"
  173. />
  174. <!-- 添加或修改漏点清单对话框 -->
  175. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body :close-on-click-modal="false">
  176. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  177. <el-form-item label="漏点编号" prop="pointNo">
  178. <el-input v-model="form.pointNo" placeholder="请输入漏点编号"/>
  179. </el-form-item>
  180. <el-form-item label="泄漏位置" prop="leakagePosition">
  181. <el-input v-model="form.leakagePosition" placeholder="请输入泄漏位置"/>
  182. </el-form-item>
  183. <el-form-item label="泄漏介质" prop="leakageMedium">
  184. <el-input v-model="form.leakageMedium" placeholder="请输入泄漏介质"/>
  185. </el-form-item>
  186. <el-form-item label="发现时间" prop="discoveryTime">
  187. <el-date-picker clearable
  188. v-model="form.discoveryTime"
  189. type="date"
  190. value-format="yyyy-MM-dd"
  191. placeholder="请选择发现时间">
  192. </el-date-picker>
  193. </el-form-item>
  194. <el-form-item label="发现人员" prop="discoveryName">
  195. <el-input v-model="form.discoveryName" placeholder="请输入发现人员"/>
  196. </el-form-item>
  197. <el-form-item label="泄漏量" prop="leakageAmount">
  198. <el-input v-model="form.leakageAmount" placeholder="请输入泄漏量"/>
  199. </el-form-item>
  200. <el-form-item label="SAP通知单号" prop="sapNo">
  201. <el-input v-model="form.sapNo" placeholder="请输入SAP通知单号"/>
  202. </el-form-item>
  203. <el-form-item label="消漏时间" prop="leakageEliminationTime">
  204. <el-date-picker clearable
  205. v-model="form.leakageEliminationTime"
  206. type="date"
  207. value-format="yyyy-MM-dd"
  208. placeholder="请选择消漏时间">
  209. </el-date-picker>
  210. </el-form-item>
  211. <el-form-item label="消漏方法" prop="leakageEliminationFunc">
  212. <el-input v-model="form.leakageEliminationFunc" placeholder="请输入消漏方法"/>
  213. </el-form-item>
  214. <el-form-item label="挂牌" prop="listing">
  215. <el-input v-model="form.listing" placeholder="请输入挂牌"/>
  216. </el-form-item>
  217. <el-form-item label="带压堵漏" prop="pressurePlugging">
  218. <el-input v-model="form.pressurePlugging" placeholder="请输入带压堵漏"/>
  219. </el-form-item>
  220. <el-form-item label="消漏结果" prop="leakageEliminationResult">
  221. <el-select clearable v-model="form.leakageEliminationResult" placeholder="请选择消漏结果">
  222. <el-option v-for="dict in dict.type.leakage_result"
  223. :value="dict.value"
  224. :label="dict.label"
  225. :key="dict.value"/>
  226. </el-select>
  227. </el-form-item>
  228. <el-form-item label="下次检修日期" prop="nextCheckDate">
  229. <el-date-picker clearable
  230. v-model="form.nextCheckDate"
  231. type="date"
  232. value-format="yyyy-MM-dd"
  233. placeholder="请选择下次检修日期">
  234. </el-date-picker>
  235. </el-form-item>
  236. <el-form-item label="备注" prop="remarks">
  237. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  238. </el-form-item>
  239. </el-form>
  240. <div slot="footer" class="dialog-footer">
  241. <el-button type="primary" @click="submitForm">确 定</el-button>
  242. <el-button @click="cancel">取 消</el-button>
  243. </div>
  244. </el-dialog>
  245. <el-dialog title="日常巡检记录" :visible.sync="record.open" width="80%" append-to-body
  246. :close-on-click-modal="false">
  247. <el-form :model="record.queryParams" ref="recordQueryForm" size="small" :inline="true" label-width="68px">
  248. <el-form-item label="日期" prop="checkDateM">
  249. <el-date-picker
  250. v-model="record.queryParams.checkDateM"
  251. type="date"
  252. value-format="yyyy-MM-dd"
  253. placeholder="请选择日期"
  254. @change="handleRecordQuery">
  255. </el-date-picker>
  256. </el-form-item>
  257. <el-form-item>
  258. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleRecordQuery">搜索</el-button>
  259. <el-button icon="el-icon-refresh" size="mini" @click="resetRecordQuery">重置</el-button>
  260. </el-form-item>
  261. <right-toolbar :showSearch.sync="record.showSearch" @queryTable="getRecordList" :search="false"></right-toolbar>
  262. </el-form>
  263. <table style="width: 100%; margin-bottom: 30px">
  264. <tr>
  265. <td rowspan="3" colspan="2">漏点巡检记录表</td>
  266. <td>日期</td>
  267. <td colspan="2">{{ parseTime(record.pointPatrol.checkDateM, '{y}年{m}月{d}日') }}</td>
  268. <td colspan="2">{{ parseTime(record.pointPatrol.checkDateN, '{y}年{m}月{d}日') }}</td>
  269. </tr>
  270. <tr>
  271. <td>班组</td>
  272. <td colspan="2">
  273. <span v-if="!record.isEdit">{{ record.pointPatrol.teamM }}班</span>
  274. <span v-else><el-input v-model="record.pointPatrol.teamM" placeholder="请输入当前班组"
  275. style="width: 150px"/> 班</span>
  276. </td>
  277. <td colspan="2">
  278. <span v-if="!record.isEdit">{{ record.pointPatrol.teamN }}班</span>
  279. <span v-else><el-input v-model="record.pointPatrol.teamN" placeholder="请输入当前班组"
  280. style="width: 150px"/> 班</span>
  281. </td>
  282. </tr>
  283. <tr>
  284. <td>时间</td>
  285. <td colspan="2">早班一次</td>
  286. <td colspan="2">夜班一次</td>
  287. </tr>
  288. <tr>
  289. <td>漏点编号</td>
  290. <td>漏点位置</td>
  291. <td>介质</td>
  292. <td>挂牌(是/否)</td>
  293. <td>泄露状态<br/>(未检出/轻微/严重)</td>
  294. <td>挂牌(是/否)</td>
  295. <td>泄露状态<br/>(未检出/轻微/严重)</td>
  296. </tr>
  297. <tr v-for="item in record.pointPatrol.records">
  298. <td>{{ item.pointNo }}</td>
  299. <td>{{ item.leakagePosition }}</td>
  300. <td>{{ item.leakageMedium }}</td>
  301. <td>
  302. <el-radio-group v-model="item.suspendPlateM">
  303. <el-radio label="是">是</el-radio>
  304. <el-radio label="否">否</el-radio>
  305. </el-radio-group>
  306. </td>
  307. <td>
  308. <el-radio-group v-model="item.leakageStatusM">
  309. <el-radio label="未检出">未检出</el-radio>
  310. <el-radio label="轻微">轻微</el-radio>
  311. <el-radio label="严重">严重</el-radio>
  312. </el-radio-group>
  313. </td>
  314. <td>
  315. <el-radio-group v-model="item.suspendPlateN">
  316. <el-radio label="是">是</el-radio>
  317. <el-radio label="否">否</el-radio>
  318. </el-radio-group>
  319. </td>
  320. <td>
  321. <el-radio-group v-model="item.leakageStatusN">
  322. <el-radio label="未检出">未检出</el-radio>
  323. <el-radio label="轻微">轻微</el-radio>
  324. <el-radio label="严重">严重</el-radio>
  325. </el-radio-group>
  326. </td>
  327. </tr>
  328. </table>
  329. <div slot="footer" class="dialog-footer">
  330. <el-button type="primary" @click="submitPatrolForm" v-if="isToday(record.queryParams.checkDateM)">保 存
  331. </el-button>
  332. <el-button @click="cancelPatrol">返 回</el-button>
  333. </div>
  334. </el-dialog>
  335. <!-- 用户导入对话框 -->
  336. <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" append-to-body
  337. width="400px">
  338. <el-upload
  339. ref="upload"
  340. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  341. :auto-upload="false"
  342. :disabled="upload.isUploading"
  343. :headers="upload.headers"
  344. :limit="1"
  345. :on-progress="handleFileUploadProgress"
  346. :on-success="handleFileSuccess"
  347. accept=".xlsx, .xls"
  348. drag
  349. >
  350. <i class="el-icon-upload"></i>
  351. <div class="el-upload__text">
  352. 将文件拖到此处,或
  353. <em>点击上传</em>
  354. </div>
  355. <div slot="tip" class="el-upload__tip">
  356. <!-- <el-checkbox v-model="upload.updateSupport"/>-->
  357. <!-- 是否更新已经存在的用户数据-->
  358. <el-link style="font-size:12px" type="info" @click="importTemplate">下载模板</el-link>
  359. </div>
  360. <div slot="tip" class="el-upload__tip" style="color:red">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  361. </el-upload>
  362. <div slot="footer" class="dialog-footer">
  363. <el-button v-loading.fullscreen.lock="fullscreenLoading" type="primary" @click="submitFileForm">确 定
  364. </el-button>
  365. <el-button @click="upload.open = false">取 消</el-button>
  366. </div>
  367. </el-dialog>
  368. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  369. <input :value="upload.type" hidden name="type"/>
  370. </form>
  371. </div>
  372. </template>
  373. <script>
  374. import {addPoints, delPoints, getPoints, listPoints, updatePoints} from "@/api/asset/points";
  375. import PointRecord from "@/views/asset/pointRecord/index.vue";
  376. import PointPatrol from "@/views/asset/pointPatrol/index.vue";
  377. import {getToken} from "@/utils/auth";
  378. import {addPointPatrol, listPointPatrol, updatePointPatrol} from "@/api/asset/pointPatrol";
  379. export default {
  380. dicts: ['leakage_result'],
  381. name: "Points",
  382. components: {PointPatrol, PointRecord},
  383. data() {
  384. return {
  385. fullscreenLoading: false,
  386. record: {
  387. open: false,
  388. queryParams: {
  389. pageNum: 1,
  390. pageSize: 20,
  391. teamM: null,
  392. checkDateM: new Date(),
  393. signM: null,
  394. teamN: null,
  395. checkDateN: null,
  396. signN: null,
  397. remarks: null,
  398. createrCode: null,
  399. createdate: null,
  400. updaterCode: null,
  401. updatedate: null,
  402. deptId: null
  403. },
  404. isEdit: false,
  405. pointPatrol: {},
  406. // 显示搜索条件
  407. showSearch: false,
  408. },
  409. // 用户导入参数
  410. upload: {
  411. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  412. type: "assetPoints",
  413. // 是否显示弹出层(用户导入)
  414. open: false,
  415. // 弹出层标题(用户导入)
  416. title: "",
  417. // 是否禁用上传
  418. isUploading: false,
  419. // 是否更新已经存在的用户数据
  420. updateSupport: 0,
  421. // 设置上传的请求头部
  422. headers: {Authorization: "Bearer " + getToken()},
  423. // 上传的地址
  424. url: process.env.VUE_APP_BASE_API + "/asset/points/importData"
  425. },
  426. // 页面高度
  427. clientHeight: 300,
  428. // 遮罩层
  429. loading: true,
  430. // 选中数组
  431. ids: [],
  432. // 非单个禁用
  433. single: true,
  434. // 非多个禁用
  435. multiple: true,
  436. // 显示搜索条件
  437. showSearch: false,
  438. // 总条数
  439. total: 0,
  440. // 漏点清单表格数据
  441. pointsList: [],
  442. // 弹出层标题
  443. title: "",
  444. // 是否显示弹出层
  445. open: false,
  446. // 查询参数
  447. queryParams: {
  448. pageNum: 1,
  449. pageSize: 20,
  450. pointNo: null,
  451. leakagePosition: null,
  452. leakageMedium: null,
  453. discoveryTime: null,
  454. discoveryName: null,
  455. leakageAmount: null,
  456. sapNo: null,
  457. leakageEliminationTime: null,
  458. leakageEliminationFunc: null,
  459. listing: null,
  460. pressurePlugging: null,
  461. leakageEliminationResult: null,
  462. leakageEliminationResults: [],
  463. nextCheckDate: null,
  464. remarks: null,
  465. createrCode: null,
  466. createdate: null,
  467. updaterCode: null,
  468. updatedate: null,
  469. deptId: null
  470. },
  471. // 表单参数
  472. form: {},
  473. // 表单校验
  474. rules: {}
  475. };
  476. },
  477. created() {
  478. this.getList();
  479. //设置表格高度对应屏幕高度
  480. this.$nextTick(() => {
  481. this.clientHeight = (document.body.clientHeight - 80) * 0.8
  482. });
  483. },
  484. methods: {
  485. isToday(date) {
  486. const today = new Date();
  487. const todayISOString = today.toISOString().split('T')[0];
  488. if (typeof (date) == "object") {
  489. date = date.toISOString().split('T')[0];
  490. }
  491. return date === todayISOString;
  492. },
  493. getRecordList() {
  494. this.record.pointPatrol = {};
  495. if (this.record.queryParams.checkDateM == null) {
  496. this.record.queryParams.checkDateM = new Date();
  497. }
  498. listPointPatrol(this.record.queryParams).then(response => {
  499. let list = response.rows;
  500. if (list.length > 0) {
  501. this.record.pointPatrol = list[0]
  502. this.record.isEdit = false
  503. } else {
  504. this.record.pointPatrol = {}
  505. this.record.isEdit = true
  506. }
  507. });
  508. },
  509. resetRecordQuery() {
  510. this.resetForm("recordQueryForm");
  511. this.getRecordList();
  512. },
  513. handleRecordQuery() {
  514. this.getRecordList();
  515. },
  516. cancelPatrol() {
  517. this.record.open = false;
  518. },
  519. submitPatrolForm() {
  520. this.record.isEdit = false
  521. this.record.pointPatrol.checkDateM = this.record.queryParams.checkDateM;
  522. if (this.record.pointPatrol.id != null) {
  523. updatePointPatrol(this.record.pointPatrol).then(response => {
  524. this.$modal.msgSuccess("修改成功");
  525. this.getRecordList();
  526. });
  527. } else {
  528. addPointPatrol(this.record.pointPatrol).then(response => {
  529. this.$modal.msgSuccess("新增成功");
  530. this.getRecordList();
  531. });
  532. }
  533. },
  534. /** 导入按钮操作 */
  535. handleImport() {
  536. this.upload.title = "用户导入";
  537. this.upload.open = true;
  538. },
  539. // 提交上传文件
  540. submitFileForm() {
  541. this.$refs.upload.submit();
  542. this.fullscreenLoading = true;
  543. },
  544. // 文件上传中处理
  545. handleFileUploadProgress(event, file, fileList) {
  546. this.upload.isUploading = true;
  547. },
  548. // 文件上传成功处理
  549. handleFileSuccess(response, file, fileList) {
  550. this.upload.open = false;
  551. this.upload.isUploading = false;
  552. this.$refs.upload.clearFiles();
  553. this.fullscreenLoading = false;
  554. if (response.data.length > 0) {
  555. let failrow = ''
  556. for (let i = 0; i < response.data.length; i++) {
  557. failrow += response.data[i] + ','
  558. }
  559. this.$alert('导入成功条数:' + response.msg + '<br>' + '失败行数:' + failrow, '导入结果', {dangerouslyUseHTMLString: true});
  560. } else {
  561. this.$alert('导入成功条数:' + response.msg, '导入结果', {dangerouslyUseHTMLString: true});
  562. }
  563. },
  564. /** 下载模板操作 */
  565. importTemplate() {
  566. this.$refs['downloadFileForm'].submit()
  567. },
  568. openRecord() {
  569. this.record.open = true;
  570. this.record.queryParams.checkDateM = new Date();
  571. this.getRecordList();
  572. },
  573. /** 查询漏点清单列表 */
  574. getList() {
  575. this.loading = true;
  576. if (this.queryParams.leakageEliminationResults && this.queryParams.leakageEliminationResults.length > 0) {
  577. this.queryParams.leakageEliminationResult = this.queryParams.leakageEliminationResults.join(",");
  578. }
  579. listPoints(this.queryParams).then(response => {
  580. this.pointsList = response.rows;
  581. this.total = response.total;
  582. this.loading = false;
  583. });
  584. },
  585. // 取消按钮
  586. cancel() {
  587. this.open = false;
  588. this.reset();
  589. },
  590. // 表单重置
  591. reset() {
  592. this.form = {
  593. id: null,
  594. pointNo: null,
  595. leakagePosition: null,
  596. leakageMedium: null,
  597. discoveryTime: null,
  598. discoveryName: null,
  599. leakageAmount: null,
  600. sapNo: null,
  601. leakageEliminationTime: null,
  602. leakageEliminationFunc: null,
  603. listing: null,
  604. pressurePlugging: null,
  605. leakageEliminationResult: null,
  606. nextCheckDate: null,
  607. remarks: null,
  608. delFlag: null,
  609. createrCode: null,
  610. createdate: null,
  611. updaterCode: null,
  612. updatedate: null,
  613. deptId: null
  614. };
  615. this.resetForm("form");
  616. },
  617. /** 搜索按钮操作 */
  618. handleQuery() {
  619. this.queryParams.pageNum = 1;
  620. this.getList();
  621. },
  622. /** 重置按钮操作 */
  623. resetQuery() {
  624. this.resetForm("queryForm");
  625. this.handleQuery();
  626. },
  627. // 多选框选中数据
  628. handleSelectionChange(selection) {
  629. this.ids = selection.map(item => item.id)
  630. this.single = selection.length !== 1
  631. this.multiple = !selection.length
  632. },
  633. /** 新增按钮操作 */
  634. handleAdd() {
  635. this.reset();
  636. this.open = true;
  637. this.title = "添加漏点清单";
  638. },
  639. /** 修改按钮操作 */
  640. handleUpdate(row) {
  641. this.reset();
  642. const id = row.id || this.ids
  643. getPoints(id).then(response => {
  644. this.form = response.data;
  645. this.open = true;
  646. this.title = "修改漏点清单";
  647. });
  648. },
  649. /** 提交按钮 */
  650. submitForm() {
  651. this.$refs["form"].validate(valid => {
  652. if (valid) {
  653. if (this.form.id != null) {
  654. updatePoints(this.form).then(response => {
  655. this.$modal.msgSuccess("修改成功");
  656. this.open = false;
  657. this.getList();
  658. });
  659. } else {
  660. addPoints(this.form).then(response => {
  661. this.$modal.msgSuccess("新增成功");
  662. this.open = false;
  663. this.getList();
  664. });
  665. }
  666. }
  667. });
  668. },
  669. /** 删除按钮操作 */
  670. handleDelete(row) {
  671. const ids = row.id || this.ids;
  672. this.$modal.confirm('是否确认删除漏点清单编号为"' + ids + '"的数据项?').then(function () {
  673. return delPoints(ids);
  674. }).then(() => {
  675. this.getList();
  676. this.$modal.msgSuccess("删除成功");
  677. }).catch(() => {
  678. });
  679. },
  680. /** 导出按钮操作 */
  681. handleExport() {
  682. this.download('asset/points/export', {
  683. ...this.queryParams
  684. }, `points_${new Date().getTime()}.xlsx`)
  685. }
  686. }
  687. };
  688. </script>
  689. <style scoped lang="scss">
  690. /* 表格边框 */
  691. table {
  692. border-collapse: collapse;
  693. }
  694. table td {
  695. border: 1px #b4b4b4 solid;
  696. padding: 10px;
  697. text-align: center;
  698. }
  699. </style>