index.vue 22 KB

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