index.vue 27 KB

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