index.vue 25 KB

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