ib.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652
  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="identifiedDateStr">
  5. <el-date-picker clearable size="small" style="width: 200px"
  6. v-model="queryParams.identifiedDateStr"
  7. type="year"
  8. @change="handleQuery"
  9. value-format="yyyy"
  10. placeholder="选择提出日期">
  11. </el-date-picker>
  12. </el-form-item>
  13. <el-form-item label="事件描述" prop="incidentDescription">
  14. <el-input
  15. v-model="queryParams.incidentDescription"
  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="['issue:operationlist:add']"
  35. >新增
  36. </el-button>
  37. </el-col>
  38. <el-col :span="1.5">
  39. <el-button
  40. type="success"
  41. icon="el-icon-edit"
  42. size="mini"
  43. :disabled="single"
  44. @click="handleUpdate"
  45. v-hasPermi="['issue:operationlist:edit']"
  46. >修改
  47. </el-button>
  48. </el-col>
  49. <el-col :span="1.5">
  50. <el-button
  51. type="danger"
  52. icon="el-icon-delete"
  53. size="mini"
  54. :disabled="multiple"
  55. @click="handleDelete"
  56. v-hasPermi="['issue:operationlist:remove']"
  57. >删除
  58. </el-button>
  59. </el-col>
  60. <el-col :span="1.5">
  61. <el-button
  62. type="info"
  63. icon="el-icon-upload2"
  64. size="mini"
  65. @click="handleImport"
  66. v-hasPermi="['issue:operationlist:edit']"
  67. >导入
  68. </el-button>
  69. </el-col>
  70. <el-col :span="1.5">
  71. <el-button
  72. type="warning"
  73. icon="el-icon-download"
  74. size="mini"
  75. @click="handleExport"
  76. v-hasPermi="['issue:operationlist:export']"
  77. >导出
  78. </el-button>
  79. </el-col>
  80. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  81. </el-row>
  82. <el-table v-loading="loading" :data="operationlistList" @selection-change="handleSelectionChange"
  83. :height="clientHeight" border>
  84. <el-table-column type="selection" width="55" align="center"/>
  85. <el-table-column type="index" label="序号" width="55" align="center" :index="indexMethod"/>
  86. <el-table-column label="时间" align="center" prop="identifiedDate" :show-overflow-tooltip="true"/>
  87. <el-table-column label="班组" align="center" prop="shiftClass" :show-overflow-tooltip="true"/>
  88. <el-table-column label="事件分类" align="center" prop="incidentType" :show-overflow-tooltip="true"/>
  89. <el-table-column label="事件描述" align="center" prop="incidentDescription" :show-overflow-tooltip="true"/>
  90. <el-table-column label="原因" align="center" prop="causeRes" :show-overflow-tooltip="true"/>
  91. <el-table-column label="措施" align="center" prop="coutermeasures" :show-overflow-tooltip="true"/>
  92. <el-table-column label="备注" align="center" prop="remarks" :show-overflow-tooltip="true"/>
  93. <el-table-column label="操作" align="center" fixed="right" width="160" class-name="small-padding fixed-width">
  94. <template slot-scope="scope">
  95. <el-button
  96. size="mini"
  97. type="text"
  98. icon="el-icon-edit"
  99. @click="handleUpdate(scope.row)"
  100. v-hasPermi="['issue:operationlist:edit']"
  101. >修改
  102. </el-button>
  103. <el-button
  104. size="mini"
  105. type="text"
  106. icon="el-icon-delete"
  107. @click="handleDelete(scope.row)"
  108. v-hasPermi="['issue:operationlist:remove']"
  109. >删除
  110. </el-button>
  111. <el-button
  112. size="mini"
  113. type="text"
  114. icon="el-icon-document"
  115. @click="handleDoc(scope.row)"
  116. v-hasPermi="['issue:operationlist:edit']"
  117. >{{ $t('附件') }}
  118. </el-button>
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. <pagination
  123. v-show="total>0"
  124. :total="total"
  125. :page.sync="queryParams.pageNum"
  126. :limit.sync="queryParams.pageSize"
  127. @pagination="getList"
  128. />
  129. <!-- 添加或修改CBPB工艺事件清单对话框 -->
  130. <el-dialog :title="title" :visible.sync="open" width="60%" append-to-body :close-on-click-modal="false">
  131. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  132. <el-form-item label="时间" prop="identifiedDate">
  133. <el-date-picker clearable size="small" style="width: 100%"
  134. v-model="form.identifiedDate"
  135. type="date"
  136. value-format="yyyy-MM-dd"
  137. placeholder="选择时间">
  138. </el-date-picker>
  139. </el-form-item>
  140. <el-form-item label="班组" prop="shiftClass">
  141. <el-select v-model="form.shiftClass" placeholder="请选择班组" clearable style="width: 100%">
  142. <el-option value="A" laabel="A"></el-option>
  143. <el-option value="B" laabel="B"></el-option>
  144. <el-option value="C" laabel="C"></el-option>
  145. <el-option value="D" laabel="D"></el-option>
  146. </el-select>
  147. </el-form-item>
  148. <el-form-item label="事件分类" prop="incidentType">
  149. <el-select v-model="form.incidentType" placeholder="请选择事件分类" clearable style="width: 100%">
  150. <el-option value="工艺" laabel="工艺"></el-option>
  151. <el-option value="仪表" laabel="仪表"></el-option>
  152. <el-option value="其他" laabel="其他"></el-option>
  153. </el-select>
  154. </el-form-item>
  155. <el-form-item label="事件描述" prop="incidentDescription">
  156. <el-input v-model="form.incidentDescription" type="textarea" placeholder="请输入事件描述"/>
  157. </el-form-item>
  158. <el-form-item label="原因" prop="causeRes">
  159. <el-input v-model="form.causeRes" type="textarea" placeholder="请输入原因"/>
  160. </el-form-item>
  161. <el-form-item label="措施" prop="coutermeasures">
  162. <el-input v-model="form.coutermeasures" type="textarea" placeholder="请输入措施"/>
  163. </el-form-item>
  164. <el-form-item label="备注" prop="remarks">
  165. <el-input v-model="form.remarks" placeholder="请输入备注"/>
  166. </el-form-item>
  167. </el-form>
  168. <div slot="footer" class="dialog-footer">
  169. <el-button type="primary" @click="submitForm">确 定</el-button>
  170. <el-button @click="cancel">取 消</el-button>
  171. </div>
  172. </el-dialog>
  173. <!-- 用户导入对话框 -->
  174. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="upload.title" :visible.sync="upload.open"
  175. width="400px" append-to-body>
  176. <el-upload
  177. ref="upload"
  178. :limit="1"
  179. accept=".xlsx, .xls"
  180. :headers="upload.headers"
  181. :action="upload.url"
  182. :disabled="upload.isUploading"
  183. :on-progress="handleFileUploadProgress"
  184. :on-success="handleFileSuccess"
  185. :auto-upload="false"
  186. drag
  187. >
  188. <i class="el-icon-upload"></i>
  189. <div class="el-upload__text">
  190. {{ $t('将文件拖到此处,或') }}
  191. <em>{{ $t('点击上传') }}</em>
  192. </div>
  193. <div class="el-upload__tip" slot="tip">
  194. <!--<el-checkbox v-model="upload.updateSupport" />是否更新已经存在的用户数据-->
  195. <el-link type="info" style="font-size:12px" @click="importTemplate">{{ $t('下载模板') }}</el-link>
  196. </div>
  197. <form ref="downloadFileForm" :action="upload.downloadAction" target="FORMSUBMIT">
  198. <input name="type" :value="upload.type" hidden/>
  199. </form>
  200. <div class="el-upload__tip" style="color:red" slot="tip">{{ $t('提示:仅允许导入“xls”或“xlsx”格式文件!') }}</div>
  201. </el-upload>
  202. <div slot="footer" class="dialog-footer">
  203. <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>
  204. <el-button @click="upload.open = false">{{ $t('取 消') }}</el-button>
  205. </div>
  206. </el-dialog><!-- 报告附件对话框 -->
  207. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px"
  208. append-to-body>
  209. <el-upload
  210. ref="doc"
  211. :limit="50"
  212. :headers="doc.headers"
  213. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  214. :disabled="doc.isUploading"
  215. :on-progress="handleFileDocProgress"
  216. :on-success="handleFileDocSuccess"
  217. :auto-upload="true"
  218. drag
  219. >
  220. <i class="el-icon-upload"></i>
  221. <div class="el-upload__text">
  222. {{ $t('将文件拖到此处,或') }}
  223. <em>{{ $t('点击上传') }}</em>
  224. </div>
  225. </el-upload>
  226. <el-table :data="doc.commonfileList" border>
  227. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  228. <template slot-scope="scope">
  229. <a class="link-type" @click="handleDownload(scope.row)">
  230. <span>{{ scope.row.fileName }}</span>
  231. </a>
  232. </template>
  233. </el-table-column>
  234. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true"
  235. width="80"/>
  236. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  237. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  238. <template slot-scope="scope">
  239. <el-button
  240. v-if="scope.row.fileName.endsWith('pdf')"
  241. size="mini"
  242. type="text"
  243. icon="el-icon-view"
  244. @click="handleSee(scope.row)"
  245. >{{ $t('预览') }}
  246. </el-button>
  247. <el-button
  248. size="mini"
  249. type="text"
  250. icon="el-icon-download"
  251. @click="handleDownload(scope.row)"
  252. >{{ $t('下载') }}
  253. </el-button>
  254. <el-button
  255. size="mini"
  256. type="text"
  257. icon="el-icon-delete"
  258. @click="handleDeleteDoc(scope.row)"
  259. >{{ $t('删除') }}
  260. </el-button>
  261. </template>
  262. </el-table-column>
  263. </el-table>
  264. <el-dialog :close-on-click-modal="false" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px"
  265. append-to-body>
  266. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  267. <el-button size="mini" type="text" @click="openPdf">{{ $t('新页面打开PDF') }}</el-button>
  268. </div>
  269. <div style="margin-top: -30px">
  270. <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
  271. </div>
  272. </el-dialog>
  273. <div slot="footer" class="dialog-footer">
  274. <!-- <el-button type="primary" @click="submitFileForm">{{ $t('确 定') }}</el-button>-->
  275. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  276. </div>
  277. </el-dialog>
  278. </div>
  279. </template>
  280. <script>
  281. import {
  282. addOperationlist,
  283. delOperationlist,
  284. exportOperationlist,
  285. getOperationlist,
  286. listOperationlist,
  287. updateOperationlist
  288. } from "@/api/issue/operationlist";
  289. import {treeselect} from "@/api/system/dept";
  290. import {getToken} from "@/utils/auth";
  291. import Treeselect from "@riophae/vue-treeselect";
  292. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  293. import {allFileList, delCommonfile} from "@/api/common/commonfile";
  294. export default {
  295. name: "OperationlistIb",
  296. components: {Treeselect},
  297. data() {
  298. return {
  299. // 遮罩层
  300. loading: true,
  301. // 选中数组
  302. ids: [],
  303. // 非单个禁用
  304. single: true,
  305. // 非多个禁用
  306. multiple: true,
  307. // 显示搜索条件
  308. showSearch: false,
  309. // 总条数
  310. total: 0,
  311. // CBPB工艺事件清单表格数据
  312. operationlistList: [],
  313. // 弹出层标题
  314. title: "",
  315. // 部门树选项
  316. deptOptions: undefined,
  317. clientHeight: 300,
  318. // 是否显示弹出层
  319. open: false,
  320. // 用户导入参数
  321. upload: {
  322. downloadAction: process.env.VUE_APP_BASE_API + '/common/template',
  323. //下载模板类型
  324. type: "operationlist",
  325. // 是否显示弹出层(用户导入)
  326. open: false,
  327. // 弹出层标题(用户导入)
  328. title: "",
  329. // 是否禁用上传
  330. isUploading: false,
  331. // 是否更新已经存在的用户数据
  332. updateSupport: 0,
  333. // 设置上传的请求头部
  334. headers: {Authorization: "Bearer " + getToken()},
  335. // 上传的地址
  336. url: process.env.VUE_APP_BASE_API + "/issue/operationlist/importData"
  337. },
  338. // 报告附件参数
  339. doc: {
  340. file: "",
  341. // 是否显示弹出层(报告附件)
  342. open: false,
  343. // 弹出层标题(报告附件)
  344. title: "",
  345. // 是否禁用上传
  346. isUploading: false,
  347. // 是否更新已经存在的用户数据
  348. updateSupport: 0,
  349. // 报告附件上传位置编号
  350. ids: 0,
  351. // 设置上传的请求头部
  352. headers: {Authorization: "Bearer " + getToken()},
  353. // 上传的地址
  354. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  355. commonfileList: null,
  356. queryParams: {
  357. pId: null,
  358. pType: 'operationlist'
  359. },
  360. pType: 'operationlist',
  361. pId: null
  362. },
  363. pdf: {
  364. title: '',
  365. pdfUrl: '',
  366. numPages: null,
  367. open: false,
  368. pageNum: 1,
  369. pageTotalNum: 1,
  370. loadedRatio: 0,
  371. },
  372. // 查询参数
  373. queryParams: {
  374. pageNum: 1,
  375. pageSize: 20,
  376. plant: 'IB',
  377. shiftClass: null,
  378. incidentDescription: null,
  379. causeRes: null,
  380. identifiedDate: null,
  381. identifiedDateStr: null,
  382. incidentType: null,
  383. coutermeasures: null,
  384. createrCode: null,
  385. createdate: null,
  386. updaterCode: null,
  387. updatedate: null,
  388. deptId: null,
  389. remarks: null
  390. },
  391. // 表单参数
  392. form: {},
  393. // 表单校验
  394. rules: {
  395. coutermeasures: [
  396. {required: true, message: "措施不能为空", trigger: "blur"}
  397. ],
  398. causeRes: [
  399. {required: true, message: "原因不能为空", trigger: "blur"}
  400. ],
  401. incidentDescription: [
  402. {required: true, message: "事件描述不能为空", trigger: "blur"}
  403. ],
  404. incidentType: [
  405. {required: true, message: "请选择事件分类", trigger: "blur"}
  406. ],
  407. shiftClass: [
  408. {required: true, message: "请选择班组", trigger: "blur"}
  409. ],
  410. identifiedDate: [
  411. {required: true, message: "请选择时间", trigger: "blur"}
  412. ],
  413. }
  414. };
  415. },
  416. watch: {
  417. // 根据名称筛选部门树
  418. deptName(val) {
  419. this.$refs.tree.filter(val);
  420. }
  421. },
  422. created() {
  423. //设置表格高度对应屏幕高度
  424. this.$nextTick(() => {
  425. this.clientHeight = document.body.clientHeight - 250
  426. })
  427. this.getList();
  428. this.getTreeselect();
  429. },
  430. methods: {
  431. /** 查询CBPB工艺事件清单列表 */
  432. getList() {
  433. this.loading = true;
  434. listOperationlist(this.queryParams).then(response => {
  435. this.operationlistList = response.rows;
  436. this.total = response.total;
  437. this.loading = false;
  438. });
  439. },
  440. /** 查询部门下拉树结构 */
  441. getTreeselect() {
  442. treeselect().then(response => {
  443. this.deptOptions = response.data;
  444. });z
  445. },
  446. // 取消按钮
  447. cancel() {
  448. this.open = false;
  449. this.reset();
  450. },
  451. // 表单重置
  452. reset() {
  453. this.form = {
  454. id: null,
  455. plant: 'IB',
  456. shiftClass: null,
  457. incidentDescription: null,
  458. causeRes: null,
  459. coutermeasures: null,
  460. identifiedDate: null,
  461. incidentType: null,
  462. delFlag: null,
  463. createrCode: null,
  464. createdate: null,
  465. updaterCode: null,
  466. updatedate: null,
  467. deptId: null,
  468. remarks: null
  469. };
  470. this.resetForm("form");
  471. },
  472. /** 搜索按钮操作 */
  473. handleQuery() {
  474. this.queryParams.pageNum = 1;
  475. this.getList();
  476. },
  477. /** 重置按钮操作 */
  478. resetQuery() {
  479. this.resetForm("queryForm");
  480. this.handleQuery();
  481. },
  482. // 多选框选中数据
  483. handleSelectionChange(selection) {
  484. this.ids = selection.map(item => item.id)
  485. this.single = selection.length !== 1
  486. this.multiple = !selection.length
  487. },
  488. /** 新增按钮操作 */
  489. handleAdd() {
  490. this.reset();
  491. this.open = true;
  492. this.title = "添加CBPB工艺事件清单";
  493. },
  494. /** 修改按钮操作 */
  495. handleUpdate(row) {
  496. this.reset();
  497. const id = row.id || this.ids
  498. getOperationlist(id).then(response => {
  499. this.form = response.data;
  500. this.open = true;
  501. this.title = "修改CBPB工艺事件清单";
  502. });
  503. },
  504. /** 提交按钮 */
  505. submitForm() {
  506. this.$refs["form"].validate(valid => {
  507. if (valid) {
  508. if (this.form.id != null) {
  509. updateOperationlist(this.form).then(response => {
  510. this.msgSuccess("修改成功");
  511. this.open = false;
  512. this.getList();
  513. });
  514. } else {
  515. addOperationlist(this.form).then(response => {
  516. this.msgSuccess("新增成功");
  517. this.open = false;
  518. this.getList();
  519. });
  520. }
  521. }
  522. });
  523. },
  524. /** 删除按钮操作 */
  525. handleDelete(row) {
  526. const ids = row.id || this.ids;
  527. this.$confirm('是否确认删除?', "警告", {
  528. confirmButtonText: "确定",
  529. cancelButtonText: "取消",
  530. type: "warning"
  531. }).then(function () {
  532. return delOperationlist(ids);
  533. }).then(() => {
  534. this.getList();
  535. this.msgSuccess("删除成功");
  536. })
  537. },
  538. /** 导出按钮操作 */
  539. handleExport() {
  540. const queryParams = this.queryParams;
  541. this.$confirm('是否确认导出所有CBPB工艺事件清单数据项?', "警告", {
  542. confirmButtonText: "确定",
  543. cancelButtonText: "取消",
  544. type: "warning"
  545. }).then(function () {
  546. return exportOperationlist(queryParams);
  547. }).then(response => {
  548. this.download(response.msg);
  549. })
  550. },
  551. /** 导入按钮操作 */
  552. handleImport() {
  553. this.upload.title = "用户导入";
  554. this.upload.open = true;
  555. },
  556. /** 下载模板操作 */
  557. importTemplate() {
  558. this.$refs['downloadFileForm'].submit()
  559. },
  560. // 文件上传中处理
  561. handleFileUploadProgress(event, file, fileList) {
  562. this.upload.isUploading = true;
  563. },
  564. // 文件上传成功处理
  565. handleFileSuccess(response, file, fileList) {
  566. this.upload.open = false;
  567. this.upload.isUploading = false;
  568. this.$refs.upload.clearFiles();
  569. if (response.data[0] != null) {
  570. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据') + "," + this.$t('第') + response.data + this.$t('行数据出现错误导入失败') + "。", this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  571. } else {
  572. this.$alert(this.$t('成功导入') + response.msg + this.$t('条数据'), this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  573. }
  574. this.getList();
  575. },
  576. // 提交上传文件
  577. submitFileForm() {
  578. this.$refs.upload.submit();
  579. }, /** 报告附件按钮操作 */
  580. handleDoc(row) {
  581. this.doc.id = row.id;
  582. this.doc.title = this.$t('附件');
  583. this.doc.open = true;
  584. this.doc.queryParams.pId = row.id
  585. this.doc.pId = row.id
  586. this.getFileList()
  587. this.$nextTick(() => {
  588. this.$refs.doc.clearFiles()
  589. })
  590. },
  591. getFileList() {
  592. allFileList(this.doc.queryParams).then(response => {
  593. this.doc.commonfileList = response;
  594. });
  595. },
  596. //附件上传中处理
  597. handleFileDocProgress(event, file, fileList) {
  598. this.doc.file = file;
  599. this.doc.isUploading = true;
  600. },
  601. //附件上传成功处理
  602. handleFileDocSuccess(response, file, fileList) {
  603. this.doc.isUploading = false;
  604. this.$alert(response.msg, this.$t('导入结果'), {dangerouslyUseHTMLString: true});
  605. this.getFileList()
  606. },
  607. /** 删除按钮操作 */
  608. handleDeleteDoc(row) {
  609. const ids = row.id || this.ids;
  610. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  611. confirmButtonText: this.$t('确定'),
  612. cancelButtonText: this.$t('取消'),
  613. type: "warning"
  614. }).then(function () {
  615. return delCommonfile(ids);
  616. }).then(() => {
  617. this.getFileList()
  618. this.msgSuccess(this.$t('删除成功'));
  619. })
  620. },
  621. // 文件下载处理
  622. handleDownload(row) {
  623. var name = row.fileName;
  624. var url = row.fileUrl;
  625. var suffix = url.substring(url.lastIndexOf("."), url.length);
  626. const a = document.createElement('a')
  627. a.setAttribute('download', name)
  628. a.setAttribute('target', '_blank')
  629. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  630. a.click()
  631. },
  632. openPdf() {
  633. window.open(this.pdf.pdfUrl);//path是文件的全路径地址
  634. },
  635. handleSee(row) {
  636. this.pdf.open = true
  637. this.pdf.title = row.fileName
  638. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  639. },
  640. //翻页后继续计算序列值
  641. indexMethod(index) {
  642. return (this.queryParams.pageNum-1)*this.queryParams.pageSize+index+1;
  643. }
  644. }
  645. };
  646. </script>