index.vue 22 KB

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