index.vue 22 KB

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