index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  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="unit">
  5. <el-input
  6. v-model="queryParams.unit"
  7. placeholder="请输入单元号"
  8. clearable
  9. size="small"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item label="P&ID图号" prop="pidNo">
  14. <el-input
  15. v-model="queryParams.pidNo"
  16. placeholder="请输入P&ID图号"
  17. clearable
  18. size="small"
  19. @keyup.enter.native="handleQuery"
  20. />
  21. </el-form-item>
  22. <el-form-item label="安全阀位号" prop="devNo">
  23. <el-input
  24. v-model="queryParams.devNo"
  25. placeholder="请输入安全阀位号"
  26. clearable
  27. size="small"
  28. @keyup.enter.native="handleQuery"
  29. />
  30. </el-form-item>
  31. <el-form-item>
  32. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  33. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  34. </el-form-item>
  35. </el-form>
  36. <el-row :gutter="10" class="mb8">
  37. <el-col :span="1.5">
  38. <el-button
  39. type="primary"
  40. icon="el-icon-plus"
  41. size="mini"
  42. @click="handleAdd"
  43. v-hasPermi="['pssr:safetyValve:add']"
  44. v-if="isApprove==0"
  45. >新增
  46. </el-button>
  47. </el-col>
  48. <el-col :span="1.5">
  49. <el-button
  50. type="success"
  51. icon="el-icon-edit"
  52. size="mini"
  53. :disabled="single"
  54. @click="handleUpdate"
  55. v-hasPermi="['pssr:safetyValve:edit']"
  56. v-if="isApprove==0"
  57. >修改
  58. </el-button>
  59. </el-col>
  60. <el-col :span="1.5">
  61. <el-button
  62. type="success"
  63. icon="el-icon-edit"
  64. size="mini"
  65. :disabled="multiple"
  66. @click="handleBatch"
  67. v-if="isApprove==0"
  68. v-hasPermi="['pssr:pipe:edit']"
  69. >批量修改
  70. </el-button>
  71. </el-col>
  72. <el-col :span="1.5">
  73. <el-button
  74. type="danger"
  75. icon="el-icon-delete"
  76. size="mini"
  77. :disabled="multiple"
  78. @click="handleDelete"
  79. v-hasPermi="['pssr:safetyValve:remove']"
  80. v-if="isApprove==0"
  81. >删除
  82. </el-button>
  83. </el-col>
  84. <el-col :span="1.5">
  85. <el-button
  86. type="warning"
  87. icon="el-icon-download"
  88. size="mini"
  89. @click="handleExport"
  90. v-hasPermi="['pssr:safetyValve:export']"
  91. v-if="isApprove==0"
  92. >导出
  93. </el-button>
  94. </el-col>
  95. <el-col :span="1.5">
  96. <el-button
  97. type="success"
  98. icon="el-icon-s-promotion"
  99. size="mini"
  100. @click="handleApprove"
  101. v-if="isApprove==0"
  102. v-hasPermi="['pssr:safetyValve:edit']"
  103. >发起审批
  104. </el-button>
  105. </el-col>
  106. <el-col :span="1.5">
  107. <el-button
  108. type="primary"
  109. icon="el-icon-check"
  110. size="mini"
  111. v-if="isApprove==4||isApprove==5"
  112. @click="handleConfirmApprove"
  113. v-hasPermi="['pssr:safetyValve:edit']"
  114. >确认
  115. </el-button>
  116. </el-col>
  117. <el-col :span="1.5">
  118. <el-button
  119. type="danger"
  120. icon="el-icon-refresh-left"
  121. size="mini"
  122. v-if="isApprove==2"
  123. :disabled="multiple"
  124. @click="handleTurnDown"
  125. v-hasPermi="['pssr:safetyValve:edit']"
  126. >驳回
  127. </el-button>
  128. </el-col>
  129. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  130. </el-row>
  131. <div style="width: 100%;text-align: center;margin-bottom: 15px">
  132. <h2>安全阀检查清单</h2>
  133. <br>
  134. <span>检查内容:所有的安全阀是否已经校验,是否在有效期内,并确认安装位置是否正确,是否投用,核对安全阀校验压力和设定压力是否一致,是(√),否(×),如有不符合要求的立即联系负责人整改。</span>
  135. </div>
  136. <el-table v-loading="loading" :data="safetyValveList" @selection-change="handleSelectionChange"
  137. :height="clientHeight" border>
  138. <el-table-column type="selection" width="55" align="center"/>
  139. <el-table-column label="审批状态" align="center" prop="approveStatus" width="105">
  140. <template slot-scope="scope">
  141. <el-tag v-if="scope.row.approveStatus==0">未审批</el-tag>
  142. <el-tag v-if="scope.row.approveStatus==1" type="warning">待确认</el-tag>
  143. <el-tag v-if="scope.row.approveStatus==3" type="success">已确认1</el-tag>
  144. <el-tag v-if="scope.row.approveStatus==2" type="success">已确认2</el-tag>
  145. </template>
  146. </el-table-column>
  147. <el-table-column label="单元号" align="center" prop="unit" :show-overflow-tooltip="true" width="180"/>
  148. <el-table-column label="P&ID图号" align="center" prop="pidNo" :show-overflow-tooltip="true" width="180"/>
  149. <el-table-column label="安全阀位号" align="center" prop="devNo" :show-overflow-tooltip="true" width="180"/>
  150. <el-table-column label="保护设备" align="center" prop="safetyDev" :show-overflow-tooltip="true" width="180"/>
  151. <el-table-column label="已经校验(是/否)" align="center" prop="verify" :show-overflow-tooltip="true" width="180"/>
  152. <el-table-column label="在有效期内(是/否)" align="center" prop="inValidity" :show-overflow-tooltip="true" width="180"/>
  153. <el-table-column label="安装位置" align="center" prop="installLocation" :show-overflow-tooltip="true"
  154. width="180"/>
  155. <el-table-column label="安装位置准确(是/否)" align="center" prop="installAccuracy" :show-overflow-tooltip="true"
  156. width="180"/>
  157. <el-table-column label="投用(是/否)" align="center" prop="putUse" :show-overflow-tooltip="true" width="180"/>
  158. <el-table-column label="设定压力(Mpa)" align="center" prop="setPressure" :show-overflow-tooltip="true" width="180"/>
  159. <el-table-column label="校验压力与设定压力一致(是/否)" align="center" prop="uniformPressure"
  160. :show-overflow-tooltip="true" width="230"/>
  161. <el-table-column label="确认人1" align="center" prop="confirmer1" :show-overflow-tooltip="true" width="180">
  162. <template slot-scope="scope">
  163. <span>{{ userFormat(scope.row.confirmer1) }}</span>
  164. </template>
  165. </el-table-column>
  166. <el-table-column label="确认人2" align="center" prop="confirmer2" :show-overflow-tooltip="true" width="180">
  167. <template slot-scope="scope">
  168. <span>{{ userFormat(scope.row.confirmer2) }}</span>
  169. </template>
  170. </el-table-column>
  171. <el-table-column label="时间" align="center" prop="confirmationTime" :show-overflow-tooltip="true" width="180">
  172. <template slot-scope="scope">
  173. <span>{{ parseTime(scope.row.confirmationDate, '{y}-{m}-{d}') }}</span>
  174. </template>
  175. </el-table-column>
  176. <el-table-column label="驳回原因" align="center" prop="reason" :show-overflow-tooltip="true"/>
  177. <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true" width="180"/>
  178. <el-table-column label="操作" align="center" fixed="right" width="120" v-if="isApprove==0"
  179. class-name="small-padding fixed-width">
  180. <template slot-scope="scope">
  181. <el-button
  182. size="mini"
  183. type="text"
  184. icon="el-icon-folder"
  185. v-if="scope.row.approveStatus!=2"
  186. @click="handleDoc(scope.row)"
  187. >附件
  188. </el-button>
  189. <el-button
  190. size="mini"
  191. type="text"
  192. icon="el-icon-edit"
  193. @click="handleUpdate(scope.row)"
  194. v-hasPermi="['pssr:safetyValve:edit']"
  195. >修改
  196. </el-button>
  197. <el-button
  198. size="mini"
  199. type="text"
  200. icon="el-icon-delete"
  201. @click="handleDelete(scope.row)"
  202. v-hasPermi="['pssr:safetyValve:remove']"
  203. >删除
  204. </el-button>
  205. </template>
  206. </el-table-column>
  207. </el-table>
  208. <pagination
  209. v-show="total>0"
  210. :total="total"
  211. :page.sync="queryParams.pageNum"
  212. :limit.sync="queryParams.pageSize"
  213. @pagination="getList"
  214. />
  215. <!-- 添加或修改安全设施-安全阀对话框 -->
  216. <el-dialog :close-on-click-modal="false" :title="title" :visible.sync="open" width="500px" append-to-body>
  217. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  218. <el-form-item label="单元号" prop="unit">
  219. <el-input v-model="form.unit" placeholder="请输入单元号"/>
  220. </el-form-item>
  221. <el-form-item label="P&ID图号" prop="pidNo">
  222. <el-input v-model="form.pidNo" placeholder="请输入P&ID图号"/>
  223. </el-form-item>
  224. <el-form-item label="安全阀位号" prop="devNo">
  225. <el-input v-model="form.devNo" placeholder="请输入安全阀位号"/>
  226. </el-form-item>
  227. <el-form-item label="保护设备" prop="safetyDev">
  228. <el-input v-model="form.safetyDev" placeholder="请输入保护设备"/>
  229. </el-form-item>
  230. <el-form-item label="已经校验(是/否)" prop="verify">
  231. <el-radio v-model="form.verify" label="✔" border>✔</el-radio>
  232. <el-radio v-model="form.verify" label="✖" border>✖</el-radio>
  233. </el-form-item>
  234. <el-form-item label="在有效期内(是/否)" prop="inValidity">
  235. <el-radio v-model="form.inValidity" label="✔" border>✔</el-radio>
  236. <el-radio v-model="form.inValidity" label="✖" border>✖</el-radio>
  237. </el-form-item>
  238. <el-form-item label="安装位置" prop="installLocation">
  239. <el-input v-model="form.installLocation" placeholder="请输入安装位置"/>
  240. </el-form-item>
  241. <el-form-item label="安装位置准确(是/否)" prop="installAccuracy">
  242. <el-radio v-model="form.installAccuracy" label="✔" border>✔</el-radio>
  243. <el-radio v-model="form.installAccuracy" label="✖" border>✖</el-radio>
  244. </el-form-item>
  245. <el-form-item label="投用(是/否)" prop="putUse">
  246. <el-radio v-model="form.putUse" label="✔" border>✔</el-radio>
  247. <el-radio v-model="form.putUse" label="✖" border>✖</el-radio>
  248. </el-form-item>
  249. <el-form-item label="设定压力" prop="setPressure">
  250. <el-input v-model="form.setPressure" placeholder="请输入设定压力"/>
  251. </el-form-item>
  252. <el-form-item label="校验压力与设定压力一致(是/否)" prop="uniformPressure">
  253. <el-radio v-model="form.uniformPressure" label="✔" border>✔</el-radio>
  254. <el-radio v-model="form.uniformPressure" label="✖" border>✖</el-radio>
  255. </el-form-item>
  256. <el-form-item label="确认人1" prop="confirmer1">
  257. <el-select v-model="form.confirmer1" filterable placeholder="请选择确认人1">
  258. <el-option v-for="user in userOptions"
  259. :label="user.nickName"
  260. :value="user.userId+''"
  261. :key="user.userId"/>
  262. </el-select>
  263. </el-form-item>
  264. <el-form-item label="确认人2" prop="confirmer2">
  265. <el-select v-model="form.confirmer2" filterable placeholder="请选择确认人2">
  266. <el-option v-for="user in userOptions"
  267. :label="user.nickName"
  268. :value="user.userId+''"
  269. :key="user.userId"/>
  270. </el-select>
  271. </el-form-item>
  272. <el-form-item label="备注" prop="remarks">
  273. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  274. </el-form-item>
  275. </el-form>
  276. <div slot="footer" class="dialog-footer">
  277. <el-button type="primary" @click="submitForm">确 定</el-button>
  278. <el-button @click="cancel">取 消</el-button>
  279. </div>
  280. </el-dialog>
  281. <!-- 用户导入对话框 -->
  282. <el-dialog :close-on-click-modal="false" :title="upload.title" :visible.sync="upload.open" width="400px"
  283. append-to-body>
  284. <el-upload
  285. ref="upload"
  286. :limit="1"
  287. accept=".xlsx, .xls"
  288. :headers="upload.headers"
  289. :action="upload.url + '?updateSupport=' + upload.updateSupport"
  290. :disabled="upload.isUploading"
  291. :on-progress="handleFileUploadProgress"
  292. :on-success="handleFileSuccess"
  293. :auto-upload="false"
  294. drag
  295. >
  296. <i class="el-icon-upload"></i>
  297. <div class="el-upload__text">
  298. 将文件拖到此处,或
  299. <em>点击上传</em>
  300. </div>
  301. <div class="el-upload__tip" slot="tip">
  302. <el-checkbox v-model="upload.updateSupport"/>
  303. 是否更新已经存在的用户数据
  304. <el-link type="info" style="font-size:12px" @click="importTemplate">下载模板</el-link>
  305. </div>
  306. <div class="el-upload__tip" style="color:red" slot="tip">提示:仅允许导入“xls”或“xlsx”格式文件!</div>
  307. </el-upload>
  308. <div slot="footer" class="dialog-footer">
  309. <el-button type="primary" @click="submitFileForm">确 定</el-button>
  310. <el-button @click="upload.open = false">取 消</el-button>
  311. </div>
  312. </el-dialog>
  313. <!-- 附件对话框 -->
  314. <el-dialog v-dialogDrag :close-on-click-modal="false" :visible.sync="doc.open" append-to-body title="现场照片"
  315. width="1000px">
  316. <el-image v-for="file in doc.fileList" :key="file.id" :src="file.fileUrl" lazy></el-image>
  317. </el-dialog>
  318. <!-- 驳回原因对话框 -->
  319. <el-dialog v-dialogDrag :close-on-click-modal="false" :visible.sync="reason.open" append-to-body title="驳回"
  320. width="1000px">
  321. <el-table :data="items" border>
  322. <el-table-column label="P&ID图号" align="center" prop="pidNo" :show-overflow-tooltip="true" width="180"/>
  323. <el-table-column label="安全阀位号" align="center" prop="devNo" :show-overflow-tooltip="true" width="180"/>
  324. <el-table-column label="驳回原因" align="center" prop="reason" :show-overflow-tooltip="true">
  325. <template slot-scope="scope">
  326. <el-input v-model="scope.row.reason" placeholder="请输入驳回原因"/>
  327. </template>
  328. </el-table-column>
  329. </el-table>
  330. <div slot="footer" class="dialog-footer">
  331. <el-button type="primary" @click="submitReasonForm">确 定</el-button>
  332. <el-button @click="reasonCancel">取 消</el-button>
  333. </div>
  334. </el-dialog>
  335. </div>
  336. </template>
  337. <script>
  338. import {
  339. addSafetyValve,
  340. delSafetyValve,
  341. exportSafetyValve,
  342. getSafetyValve,
  343. importTemplate,
  344. listSafetyValve,
  345. updateSafetyValve,
  346. updateSafetyValveBatch,
  347. } from "@/api/pssr/safetyValve";
  348. import {treeselect} from "@/api/system/dept";
  349. import {getToken} from "@/utils/auth";
  350. import Treeselect from "@riophae/vue-treeselect";
  351. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  352. import {listUserNoPage} from "@/api/system/user";
  353. import {listFile} from "@/api/pssr/file";
  354. import {handleconfirmValve, handleturnDownValve} from "@/api/pssr/safety";
  355. import {doApprove} from "@/api/pssr/approve";
  356. import {updateMaterialBatch} from "@/api/pssr/material";
  357. export default {
  358. dicts: ['pssr_approve_status'],
  359. name: "SafetyValve",
  360. components: {Treeselect},
  361. props: {
  362. subId: {
  363. type: Number,
  364. default: 0
  365. },
  366. isApprove: {
  367. type: Number,
  368. default: 0
  369. },
  370. },
  371. data() {
  372. return {
  373. reason: {
  374. open: false
  375. },
  376. doc: {
  377. file: "",
  378. // 是否显示弹出层(报告附件)
  379. open: false,
  380. fileList: [],
  381. queryParams: {
  382. itemId: null,
  383. subId: this.subId,
  384. forShort: 'aqss-v'
  385. },
  386. },
  387. userOptions: [],
  388. // 遮罩层
  389. loading: true,
  390. // 选中数组
  391. ids: [],
  392. items: [],
  393. // 非单个禁用
  394. single: true,
  395. // 非多个禁用
  396. multiple: true,
  397. // 显示搜索条件
  398. showSearch: false,
  399. // 总条数
  400. total: 0,
  401. // 安全设施-安全阀表格数据
  402. safetyValveList: [],
  403. // 弹出层标题
  404. title: "",
  405. // 部门树选项
  406. deptOptions: undefined,
  407. clientHeight: 300,
  408. // 是否显示弹出层
  409. open: false,
  410. openBatch: false,
  411. // 用户导入参数
  412. upload: {
  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 + "/pssr/safetyValve/importData"
  425. },
  426. // 查询参数
  427. queryParams: {
  428. pageNum: 1,
  429. pageSize: 20,
  430. subId: this.subId,
  431. approveId: null,
  432. unit: null,
  433. pidNo: null,
  434. devNo: null,
  435. safetyDev: null,
  436. verify: null,
  437. inValidity: null,
  438. installLocation: null,
  439. installAccuracy: null,
  440. setPressure: null,
  441. uniformPressure: null,
  442. confirmer1: null,
  443. confirmer2: null,
  444. confirmationTime: null,
  445. createrCode: null,
  446. createdate: null,
  447. updaterCode: null,
  448. updatedate: null,
  449. deptId: null,
  450. remarks: null
  451. },
  452. // 表单参数
  453. form: {},
  454. // 表单校验
  455. rules: {
  456. confirmer1: [{required: true, message: "人员不可为空", trigger: "blur"}],
  457. confirmer2: [{required: true, message: "人员不可为空", trigger: "blur"}],
  458. }
  459. };
  460. },
  461. watch: {
  462. // 根据名称筛选部门树
  463. deptName(val) {
  464. this.$refs.tree.filter(val);
  465. }
  466. },
  467. created() {
  468. //设置表格高度对应屏幕高度
  469. this.$nextTick(() => {
  470. this.clientHeight = document.body.clientHeight - 380
  471. })
  472. this.getList();
  473. this.getTreeselect();
  474. listUserNoPage({}).then(res => {
  475. this.userOptions = res.data
  476. });
  477. },
  478. methods: {
  479. /** 查询安全设施-安全阀列表 */
  480. getList() {
  481. this.loading = true;
  482. listSafetyValve(this.queryParams).then(response => {
  483. this.safetyValveList = response.rows;
  484. this.total = response.total;
  485. this.loading = false;
  486. });
  487. },
  488. /** 查询部门下拉树结构 */
  489. getTreeselect() {
  490. treeselect().then(response => {
  491. this.deptOptions = response.data;
  492. });
  493. },
  494. // 取消按钮
  495. cancel() {
  496. this.open = false;
  497. this.reset();
  498. },
  499. // 表单重置
  500. reset() {
  501. this.form = {
  502. id: null,
  503. subId: this.subId,
  504. approveId: null,
  505. unit: null,
  506. pidNo: null,
  507. devNo: null,
  508. safetyDev: null,
  509. verify: null,
  510. inValidity: null,
  511. installLocation: null,
  512. installAccuracy: null,
  513. setPressure: null,
  514. uniformPressure: null,
  515. confirmer1: null,
  516. confirmer2: null,
  517. confirmationTime: null,
  518. delFlag: null,
  519. createrCode: null,
  520. createdate: null,
  521. updaterCode: null,
  522. updatedate: null,
  523. deptId: null,
  524. remarks: null
  525. };
  526. this.resetForm("form");
  527. },
  528. /** 搜索按钮操作 */
  529. handleQuery() {
  530. this.queryParams.pageNum = 1;
  531. this.getList();
  532. },
  533. /** 重置按钮操作 */
  534. resetQuery() {
  535. this.resetForm("queryForm");
  536. this.handleQuery();
  537. },
  538. // 多选框选中数据
  539. handleSelectionChange(selection) {
  540. this.items=selection;
  541. this.ids = selection.map(item => item.id)
  542. this.single = selection.length !== 1
  543. this.multiple = !selection.length
  544. },
  545. /** 新增按钮操作 */
  546. handleAdd() {
  547. this.reset();
  548. this.open = true;
  549. this.title = "添加安全设施-安全阀";
  550. },
  551. /** 修改按钮操作 */
  552. handleUpdate(row) {
  553. this.reset();
  554. const id = row.id || this.ids
  555. getSafetyValve(id).then(response => {
  556. this.form = response.data;
  557. this.open = true;
  558. this.title = "修改安全设施-安全阀";
  559. });
  560. },
  561. /** 提交按钮 */
  562. submitForm() {
  563. this.$refs["form"].validate(valid => {
  564. if (valid) {
  565. if (this.form.id != null) {
  566. updateSafetyValve(this.form).then(response => {
  567. this.msgSuccess("修改成功");
  568. this.open = false;
  569. this.getList();
  570. });
  571. } else {
  572. addSafetyValve(this.form).then(response => {
  573. this.msgSuccess("新增成功");
  574. this.open = false;
  575. this.getList();
  576. });
  577. }
  578. }
  579. });
  580. },
  581. /** 删除按钮操作 */
  582. handleDelete(row) {
  583. const ids = row.id || this.ids;
  584. this.$confirm('是否确认删除?', "警告", {
  585. confirmButtonText: "确定",
  586. cancelButtonText: "取消",
  587. type: "warning"
  588. }).then(function () {
  589. return delSafetyValve(ids);
  590. }).then(() => {
  591. this.getList();
  592. this.msgSuccess("删除成功");
  593. })
  594. },
  595. /** 导出按钮操作 */
  596. handleExport() {
  597. const queryParams = this.queryParams;
  598. this.$confirm('是否确认导出所有安全设施-安全阀数据项?', "警告", {
  599. confirmButtonText: "确定",
  600. cancelButtonText: "取消",
  601. type: "warning"
  602. }).then(function () {
  603. return exportSafetyValve(queryParams);
  604. }).then(response => {
  605. this.download(response.msg);
  606. })
  607. },
  608. /** 导入按钮操作 */
  609. handleImport() {
  610. this.upload.title = "用户导入";
  611. this.upload.open = true;
  612. },
  613. /** 下载模板操作 */
  614. importTemplate() {
  615. importTemplate().then(response => {
  616. this.download(response.msg);
  617. });
  618. },
  619. // 文件上传中处理
  620. handleFileUploadProgress(event, file, fileList) {
  621. this.upload.isUploading = true;
  622. },
  623. // 文件上传成功处理
  624. handleFileSuccess(response, file, fileList) {
  625. this.upload.open = false;
  626. this.upload.isUploading = false;
  627. this.$refs.upload.clearFiles();
  628. this.$alert(response.msg, "导入结果", {dangerouslyUseHTMLString: true});
  629. this.getList();
  630. },
  631. // 提交上传文件
  632. submitFileForm() {
  633. this.$refs.upload.submit();
  634. },
  635. /** 报告附件按钮操作 */
  636. handleDoc(row) {
  637. this.doc.fileList=[]
  638. this.doc.open = true;
  639. this.doc.queryParams.itemId = row.id
  640. this.getFileList()
  641. },
  642. getFileList() {
  643. listFile(this.doc.queryParams).then(response => {
  644. this.doc.fileList = response.rows;
  645. this.doc.fileList.forEach(item => {
  646. item.fileUrl = process.env.VUE_APP_BASE_API + item.fileUrl;
  647. });
  648. });
  649. },
  650. //发起审批
  651. handleApprove() {
  652. doApprove(this.subId).then(res => {
  653. this.msgSuccess("已发起确认流程");
  654. this.getList();
  655. })
  656. },
  657. handleConfirmApprove() {
  658. let data = {
  659. ids: this.ids,
  660. subId: this.subId,
  661. taskType: this.isApprove
  662. }
  663. handleconfirmValve(data).then(res => {
  664. this.msgSuccess("确认成功");
  665. this.getList()
  666. this.$emit('refreshHisList');
  667. })
  668. },
  669. handleTurnDown(val) {
  670. this.reason.open=true;
  671. },
  672. userFormat(userId) {
  673. for (let item of this.userOptions) {
  674. if (item.userId == userId) {
  675. return item.nickName
  676. }
  677. }
  678. },
  679. reasonCancel() {
  680. this.reason.open = false;
  681. },
  682. submitReasonForm(){
  683. handleturnDownValve(this.items).then(res => {
  684. this.msgSuccess("驳回成功");
  685. this.reason.open = false;
  686. this.$emit('refreshHisList');
  687. })
  688. },
  689. handleBatch(){
  690. this.reset();
  691. this.openBatch = true
  692. },
  693. // 取消按钮
  694. cancelBatch() {
  695. this.openBatch = false;
  696. this.reset();
  697. },
  698. /** 提交按钮 */
  699. submitFormBatch() {
  700. this.$refs["form"].validate(valid => {
  701. if (valid) {
  702. this.form.ids = this.ids
  703. updateSafetyValveBatch(this.form).then(response => {
  704. this.msgSuccess("修改成功");
  705. this.open = false;
  706. this.getList();
  707. });
  708. }
  709. });
  710. },
  711. }
  712. };
  713. </script>