index.vue 25 KB

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