monthdata.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879
  1. <template>
  2. <div class="app-container">
  3. <!-- 搜索栏 -->
  4. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
  5. <el-form-item label="年" prop="feedbackYear">
  6. <el-date-picker
  7. v-model="queryParams.feedbackYearTemp"
  8. @change="handleQuery"
  9. placeholder="请选择年"
  10. clearable
  11. type="year"
  12. size="small"
  13. style="width:200px"
  14. />
  15. </el-form-item>
  16. <el-form-item>
  17. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  18. </el-form-item>
  19. </el-form>
  20. <!-- 标签页 -->
  21. <el-tabs type="border-card" @tab-click="handleTabClick" v-model="activeMonth">
  22. <el-tab-pane
  23. :key="item.key"
  24. v-for="(item) in monthTabs"
  25. :label="item.value"
  26. :name="item.key"
  27. :lazy="true"
  28. >
  29. <div v-if="item.key == activeMonth">
  30. <!-- 培养计划总表 -->
  31. <el-table
  32. v-loading="loading"
  33. :data="dataList"
  34. @selection-change="handleSelectionChange"
  35. ref="feedbackListSeasonalTable"
  36. border
  37. :cell-style="tableCellStyle"
  38. >
  39. <template slot="empty">
  40. <el-empty :image-size="100" description='当月无学习计划'></el-empty>
  41. </template>
  42. <el-table-column label="培养内容" align="center" prop="plantName" width="600px"/>
  43. <el-table-column label="开始日期" align="center" prop="startDate"/>
  44. <el-table-column label="结束日期" align="center" prop="endDate"/>
  45. <el-table-column label="实际完成日期" align="center" prop="dateOfCompletion"/>
  46. <el-table-column label="学习状态" align="center" prop="studyState" :formatter="studyStateFormat"/>
  47. <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
  48. <template slot-scope="scope">
  49. <el-button
  50. size="mini"
  51. type="text"
  52. icon="el-icon-chat-dot-round"
  53. v-hasPermi="['spec:plan:edit']"
  54. @click="handleFeedback(scope.row)"
  55. >详情</el-button>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. <!-- 导师反馈 -->
  60. <div>
  61. <h3>导师反馈</h3>
  62. <span
  63. v-html="mentorFeedback"
  64. style="overflow:scroll; display:block; border:1px solid #CCCCCC; height: 300px; padding:15px;font-family: Helvetica, Arial, sans-serif; font-size: 13px;"
  65. >
  66. </span>
  67. </div>
  68. </div>
  69. </el-tab-pane>
  70. </el-tabs>
  71. <!-- 详情对话框 -->
  72. <el-dialog v-dialogDrag :title="feedbackDialog.title" :visible.sync="feedbackDialog.open" width="800px" append-to-body>
  73. <div style="width:700px; margin:0px auto;">
  74. <h3 style="margin-bottom:20px;">学员心得</h3>
  75. <el-table :data="tableData" border style="width: 100%">
  76. <el-table-column prop="id" label="编号" width="50"></el-table-column>
  77. <el-table-column prop="question" label="问题" width="250"></el-table-column>
  78. <el-table-column prop="answer" label="答案"></el-table-column>
  79. </el-table>
  80. <el-table :data="docFeedback.commonfileList" border>
  81. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  82. <template slot-scope="scope">
  83. <a class="link-type" @click="handleDownload(scope.row)">
  84. <span>{{ scope.row.fileName }}</span>
  85. </a>
  86. </template>
  87. </el-table-column>
  88. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  89. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  90. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  91. <template slot-scope="scope">
  92. <el-button
  93. v-if="scope.row.fileName.endsWith('pdf')||scope.row.fileName.endsWith('xlsx')||scope.row.fileName.endsWith('md')
  94. ||scope.row.fileName.endsWith('docx')||scope.row.fileName.endsWith('doc')||scope.row.fileName.endsWith('txt')
  95. ||scope.row.fileName.endsWith('jpg')||scope.row.fileName.endsWith('png')||scope.row.fileName.endsWith('csv')
  96. ||scope.row.fileName.endsWith('mp4')||scope.row.fileName.endsWith('svg')||scope.row.fileName.endsWith('dwg')
  97. ||scope.row.fileName.endsWith('flv')||scope.row.fileName.endsWith('swf')||scope.row.fileName.endsWith('gif')
  98. ||scope.row.fileName.endsWith('3gp')||scope.row.fileName.endsWith('mkv')||scope.row.fileName.endsWith('tif')"
  99. size="mini"
  100. type="text"
  101. icon="el-icon-view"
  102. @click="handleSee(scope.row)"
  103. > {{ $t('预览') }}</el-button>
  104. <el-button
  105. v-if="scope.row.fileName.endsWith('ppt')||scope.row.fileName.endsWith('pptx') "
  106. size="mini"
  107. type="text"
  108. icon="el-icon-view"
  109. @click="handleSeePPT(scope.row)"
  110. > {{ $t('ppt预览') }}</el-button>
  111. <el-button
  112. size="mini"
  113. type="text"
  114. icon="el-icon-download"
  115. @click="handleDownload(scope.row)"
  116. >{{ $t('下载') }}</el-button>
  117. <el-button
  118. size="mini"
  119. type="text"
  120. icon="el-icon-delete"
  121. @click="handleDeleteDoc(scope.row)"
  122. >{{ $t('删除') }}</el-button>
  123. </template>
  124. </el-table-column>
  125. </el-table>
  126. <el-form v-if="detailFeedback != null">
  127. <h3 style="margin-top:30px;margin-bottom:20px;">导师反馈</h3>
  128. <el-form-item>
  129. <p v-html="detailFeedback" style="border:1px solid #DFE6EC; overflow:scroll; height:200px;"/>
  130. </el-form-item>
  131. </el-form>
  132. </div>
  133. </el-dialog>
  134. <!-- 预览对话框 -->
  135. <el-dialog v-loading="loadingFlash" element-loading-background="rgba(0,0,0,0.2)" v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" :center="true" append-to-body>
  136. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  137. <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
  138. <div style="margin-top: -30px" >
  139. <iframe id="iFrame" class="iframe-html" :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px" v-if="ppt"></iframe>
  140. </div>
  141. <div style="padding: 30px; width: 100%; height: 100%;" >
  142. <el-carousel class="" ref="carousel" arrow="always" v-if="pptView"
  143. height="700px" trigger="click" :autoplay="false" indicator-position="outside">
  144. <el-carousel-item class="lun_img" v-for="item in imgs" v-bind:key="item" >
  145. <img :src="item" width="100%" height="100%" object-fit="cover" />
  146. </el-carousel-item>
  147. </el-carousel>
  148. </div>
  149. </el-dialog>
  150. </div>
  151. </template>
  152. <script>
  153. import { getAnswer, addAnswer, updateAnswer, listAnswer } from "@/api/training/spec/answer";
  154. import { allFileList, delCommonfile } from "@/api/common/commonfile";
  155. import { addFeedback, getFeedbackByParams, listInvitedSuccessor, updateFeedback, listFeedback, getFeedbackByPlanId } from "@/api/training/spec/feedback";
  156. import { listMentors, getSuccessorBySuccessorId } from "@/api/training/spec/successor";
  157. import { listSuccessorsByMentorId, listPlanMonthly } from "@/api/training/spec/plan";
  158. import { getToken } from "@/utils/auth";
  159. import Treeselect from "@riophae/vue-treeselect";
  160. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  161. import Editor from '@/components/Editor';
  162. import { getStaffId, isMentor } from "@/api/plant/staffmgr";
  163. export default {
  164. name: "MonthlyFeedback",
  165. components: { Treeselect, Editor },
  166. data() {
  167. return {
  168. //图片集合 打开关闭按钮 等等
  169. imgs:[],
  170. jpgList:[],
  171. ppt:false,
  172. pptView:false,
  173. loadingFlash:false,
  174. // 当前用户id
  175. staffId: null,
  176. // 是否为导师
  177. isMentor: null,
  178. // 首选标签页
  179. activeMonth: null,
  180. // 月份标签页
  181. monthTabs: [
  182. { key: "1", value: "1月" },
  183. { key: "2", value: "2月" },
  184. { key: "3", value: "3月" },
  185. { key: "4", value: "4月" },
  186. { key: "5", value: "5月" },
  187. { key: "6", value: "6月" },
  188. { key: "7", value: "7月" },
  189. { key: "8", value: "8月" },
  190. { key: "9", value: "9月" },
  191. { key: "10", value: "10月" },
  192. { key: "11", value: "11月" },
  193. { key: "12", value: "12月" }
  194. ],
  195. // 导师标签
  196. mentorTabs: [],
  197. // 详情对话框表格数据
  198. tableData: [],
  199. // 反馈id
  200. feedbackId: null,
  201. // 父级反馈id
  202. parentId: null,
  203. // 会议日期快捷选项
  204. pickerOptions: {
  205. shortcuts: [{
  206. text: '今天',
  207. onClick(picker) {
  208. picker.$emit('pick', new Date());
  209. }
  210. }, {
  211. text: '昨天',
  212. onClick(picker) {
  213. const date = new Date();
  214. date.setTime(date.getTime() - 3600 * 1000 * 24);
  215. picker.$emit('pick', date);
  216. }
  217. }, {
  218. text: '一周前',
  219. onClick(picker) {
  220. const date = new Date();
  221. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  222. picker.$emit('pick', date);
  223. }
  224. }, {
  225. text: '一周后',
  226. onClick(picker) {
  227. const date = new Date();
  228. date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
  229. picker.$emit('pick', date);
  230. }
  231. }]
  232. },
  233. // 会议日期
  234. meetingDate: null,
  235. // 学习状态字典
  236. studyStateOptions: [],
  237. // 汇报展示附件参数
  238. doc: { // 反馈附件
  239. file: "",
  240. // 是否显示弹出层(报告附件)
  241. open: false,
  242. // 弹出层标题(报告附件)
  243. title: "",
  244. // 是否禁用上传
  245. isUploading: false,
  246. // 是否更新已经存在的用户数据
  247. updateSupport: 0,
  248. // 报告附件上传位置编号
  249. ids: 0,
  250. // 设置上传的请求头部
  251. headers: { Authorization: "Bearer " + getToken() },
  252. // 上传的地址
  253. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  254. commonfileList: null,
  255. queryParams: {
  256. pId: null,
  257. pType: 'docSeasonal'
  258. },
  259. pType: 'docSeasonal',
  260. pId: null
  261. },
  262. // 培养计划总表数据
  263. dataList: [],
  264. // 首选标签页
  265. activeName: null,
  266. // 学员下拉列表
  267. successorOptions: [],
  268. // 导师下拉列表
  269. mentorOptions: [],
  270. // 导师数组
  271. mentorOptionsArray: [],
  272. // 包含导师id的查询对象
  273. queryObject: {
  274. mentorStaffId: ""
  275. },
  276. // 导师反馈内容
  277. mentorFeedback: "", // 季度反馈内容
  278. detailFeedback: "", // 计划详情反馈内容
  279. // 反馈对话框参数
  280. feedbackDialog: {
  281. id: 0,
  282. // 是否显示弹出层(报告附件)
  283. open: false,
  284. // 弹出层标题(报告附件)
  285. title: ""
  286. },
  287. // 问卷单选框
  288. radio1: '',
  289. radio2: '',
  290. radio3: '',
  291. radio4: '',
  292. radio5: '',
  293. radio6: '',
  294. radio7: '',
  295. radio8: '',
  296. radio9: '',
  297. radio10: '',
  298. radio11: '',
  299. radio12: '',
  300. radio13: '',
  301. radio14: '',
  302. // 报告附件参数
  303. doc: { // 季度汇报附件
  304. file: "",
  305. // 是否显示弹出层(报告附件)
  306. open: false,
  307. // 弹出层标题(报告附件)
  308. title: "",
  309. // 是否禁用上传
  310. isUploading: false,
  311. // 是否更新已经存在的用户数据
  312. updateSupport: 0,
  313. // 报告附件上传位置编号
  314. ids: 0,
  315. // 设置上传的请求头部
  316. headers: { Authorization: "Bearer " + getToken() },
  317. // 上传的地址
  318. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  319. commonfileList: null,
  320. queryParams: {
  321. pId: null,
  322. pType: 'plan'
  323. },
  324. pType: 'plan',
  325. pId: null
  326. },
  327. docFeedback: { // 反馈附件
  328. file: "",
  329. // 是否显示弹出层(报告附件)
  330. open: false,
  331. // 弹出层标题(报告附件)
  332. title: "",
  333. // 是否禁用上传
  334. isUploading: false,
  335. // 是否更新已经存在的用户数据
  336. updateSupport: 0,
  337. // 报告附件上传位置编号
  338. ids: 0,
  339. // 设置上传的请求头部
  340. headers: { Authorization: "Bearer " + getToken() },
  341. // 上传的地址
  342. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  343. commonfileList: null,
  344. queryParams: {
  345. pId: null,
  346. pType: 'docFeedback'
  347. },
  348. pType: 'docFeedback',
  349. pId: null
  350. },
  351. // 标签页选中项
  352. activeName: 'zhu',
  353. // 遮罩层
  354. loading: true,
  355. // 选中数组
  356. ids: [],
  357. // 非单个禁用
  358. single: true,
  359. // 非多个禁用
  360. multiple: true,
  361. // 显示搜索条件
  362. showSearch: true,
  363. // 总条数
  364. total: 0,
  365. // 专项培训反馈表格数据
  366. feedbackList: [],
  367. // 弹出层标题
  368. title: "",
  369. // 部门树选项
  370. deptOptions: undefined,
  371. clientHeight:300,
  372. // 是否显示弹出层
  373. open: false,
  374. // 用户导入参数
  375. upload: {
  376. // 是否显示弹出层(用户导入)
  377. open: false,
  378. // 弹出层标题(用户导入)
  379. title: "",
  380. // 是否禁用上传
  381. isUploading: false,
  382. // 是否更新已经存在的用户数据
  383. updateSupport: 0,
  384. // 设置上传的请求头部
  385. headers: { Authorization: "Bearer " + getToken() },
  386. // 上传的地址
  387. url: process.env.VUE_APP_BASE_API + "/spec/feedback/importData"
  388. },
  389. pdf : {
  390. title: '',
  391. pdfUrl: '',
  392. numPages: null,
  393. open: false,
  394. pageNum: 1,
  395. pageTotalNum: 1,
  396. loadedRatio: 0,
  397. },
  398. // 查询参数
  399. queryParams: {
  400. pageNum: 1,
  401. pageSize: 100,
  402. feedbackType: null,
  403. mentorId: null,
  404. successorId: null,
  405. successorName: null,
  406. parentId: null,
  407. planId: null,
  408. feedbackYear: null,
  409. feedbackYearTemp: null,
  410. feedbackSeason: null,
  411. feedbackMonth: null,
  412. successorFeedback: null,
  413. mentorFeedback: null,
  414. feedbackScore: null,
  415. feedbackStatus: null,
  416. meetingDate: null
  417. },
  418. // 表单参数
  419. form: {},
  420. // 表单校验
  421. rules: {
  422. }
  423. };
  424. },
  425. watch: {
  426. },
  427. created() {
  428. //设置表格高度对应屏幕高度
  429. this.$nextTick(() => {
  430. this.clientHeight = document.body.clientHeight -250
  431. })
  432. const staffId = this.$route.params && this.$route.params.staffId;
  433. this.queryParams.successorId = staffId;
  434. // 获取学习状态字典
  435. this.getDicts("st_study_state").then(response => {
  436. this.studyStateOptions = response.data;
  437. });
  438. // 初始化页面数据
  439. this.initPageData();
  440. },
  441. methods: {
  442. /** 标签页切换事件 */
  443. handleTabClick(tab) {
  444. this.queryParams.feedbackMonth = tab.name;
  445. this.getList();
  446. // 清空导师反馈内容
  447. this.mentorFeedback = "";
  448. // 根据月获取反馈id
  449. getFeedbackByParams({
  450. successorId: this.queryParams.successorId,
  451. feedbackYear: this.queryParams.feedbackYear,
  452. feedbackMonth: this.queryParams.feedbackMonth,
  453. }).then(response => {
  454. let data = response.data;
  455. // 设置反馈id为当前月反馈id
  456. this.feedbackId = data.id;
  457. // 刷新导师反馈内容
  458. this.mentorFeedback = data.mentorFeedback;
  459. });
  460. },
  461. /** 初始化页面数据 */
  462. initPageData() {
  463. // 获取当前日期
  464. let date = new Date();
  465. // 搜索条件默认为当年、当月
  466. this.queryParams.feedbackYear = date.getFullYear().toString();
  467. this.queryParams.feedbackYearTemp = date.getFullYear().toString();
  468. this.queryParams.feedbackMonth = ( date.getMonth() + 1 ).toString();
  469. this.activeMonth = ( date.getMonth() + 1 ).toString();
  470. // 获取当前用户id
  471. getStaffId().then(response => {
  472. this.staffId = response.data;
  473. // 判断当前用户是否为导师
  474. return isMentor();
  475. })
  476. .then(response => {
  477. this.isMentor = response.data;
  478. if (this.isMentor) { // 当前用户是导师
  479. // 获取当前导师的学员列表
  480. listSuccessorsByMentorId(this.queryObject).then(response => {
  481. let data = response.data;
  482. for (let i = 0; i < data.length; i++) {
  483. if (i == 0 && data.length != 0) {
  484. getSuccessorBySuccessorId(this.queryParams.successorId).then(response => {
  485. this.queryParams.mentorId = response.data.mentorId;
  486. });
  487. // 查询学习计划列表
  488. this.getList();
  489. }
  490. this.successorOptions.push( { key: data[i].staffId, value: data[i].staffName } );
  491. }
  492. if (data.length != 0) {
  493. // 获取当前学员当年当月反馈id
  494. getFeedbackByParams({
  495. successorId: this.queryParams.successorId,
  496. feedbackYear: this.queryParams.feedbackYear,
  497. feedbackMonth: this.queryParams.feedbackMonth
  498. }).then(response => {
  499. let data = response.data;
  500. this.feedbackId = data.id;
  501. this.mentorFeedback = data.mentorFeedback;
  502. });
  503. }else {
  504. this.loading = false;
  505. return;
  506. }
  507. });
  508. } else { // 当前用户是学员
  509. // 学员id = 当当前用户id
  510. this.queryParams.successorId = this.staffId;
  511. // 查询学习计划列表
  512. this.getList();
  513. // 获取当前学员当年当月反馈id
  514. getFeedbackByParams({
  515. successorId: this.queryParams.successorId,
  516. feedbackYear: this.queryParams.feedbackYear,
  517. feedbackMonth: this.queryParams.feedbackMonth
  518. }).then(response => {
  519. let data = response.data;
  520. this.feedbackId = data.id;
  521. this.mentorFeedback = data.mentorFeedback;
  522. });
  523. }
  524. });
  525. },
  526. /** 保存导师反馈内容 */
  527. saveMentorFeedback() {
  528. let feedback = {};
  529. feedback.id = this.feedbackId;
  530. feedback.mentorFeedback = this.mentorFeedback;
  531. updateFeedback(feedback);
  532. },
  533. /** 保存按钮处理 */
  534. handleSave() {
  535. // 保存导师反馈内容
  536. this.saveMentorFeedback();
  537. this.msgSuccess("保存成功");
  538. },
  539. /** 培养计划详情处理 */
  540. handleFeedback(row) {
  541. // 加载反馈附件
  542. this.docFeedback.id = row.id;
  543. this.docFeedback.queryParams.pId = row.id
  544. this.docFeedback.pId = row.id
  545. this.getFileListFeedback();
  546. // 清空导师反馈内容
  547. this.detailFeedback = null;
  548. // 清空表格数据
  549. this.tableData = [];
  550. let feedback1 = {};
  551. feedback1.planId = row.id;
  552. feedback1.questionId = 1;
  553. let feedback2 = {};
  554. feedback2.planId = row.id;
  555. feedback2.questionId = 2;
  556. let feedback3 = {};
  557. feedback3.planId = row.id;
  558. feedback3.questionId = 3;
  559. let answerObj1 = {};
  560. let answerObj2 = {};
  561. let answerObj3 = {};
  562. // 获取问题和答案
  563. getAnswer(feedback1).then(response => {
  564. let data = response.data;
  565. if (data != null) {
  566. answerObj1 = { id: 1, question: data.question, answer: data.answer};
  567. }
  568. return getAnswer(feedback2);
  569. }).then(response => {
  570. let data = response.data;
  571. if (data != null) {
  572. answerObj2 = { id: 2, question: data.question, answer: data.answer};
  573. }
  574. return getAnswer(feedback3);
  575. }).then(response => {
  576. let data = response.data;
  577. if (data != null) {
  578. answerObj3 = { id: 3, question: data.question, answer: data.answer};
  579. this.tableData.push(answerObj1);
  580. this.tableData.push(answerObj2);
  581. this.tableData.push(answerObj3);
  582. }
  583. // 获取导师反馈内容
  584. return getFeedbackByPlanId(row.id);
  585. }).then(response => {
  586. if (response.data != null) {
  587. let data = response.data;
  588. this.detailFeedback = data.mentorFeedback;
  589. }
  590. this.feedbackDialog.title = row.staffName + row.plantName + "学习情况详情";
  591. this.feedbackDialog.planId = row.id;
  592. this.feedbackDialog.studyState = row.studyState;
  593. this.feedbackDialog.open = true;
  594. });
  595. },
  596. /** 单元格样式 */
  597. tableCellStyle(row, column, rowIndex, columnIndex) {
  598. if (row.column.label === "实际完成日期" && row.row.dateOfCompletion > row.row.endDate) {
  599. return "background: #FFEEEE"
  600. }
  601. },
  602. /** 学习状态字典翻译 */
  603. studyStateFormat(row, column) {
  604. return this.selectDictLabel(this.studyStateOptions, row.studyState);
  605. },
  606. /** 文件下载处理 */
  607. handleDownload(row) {
  608. var name = row.fileName;
  609. var url = row.fileUrl;
  610. var suffix = url.substring(url.lastIndexOf("."), url.length);
  611. const a = document.createElement('a');
  612. a.setAttribute('download', name);
  613. a.setAttribute('target', '_blank');
  614. a.setAttribute('href', process.env.VUE_APP_BASE_API + url);
  615. a.click();
  616. },
  617. /** 汇报附件参数初始化 */
  618. initFileList(id) {
  619. this.doc.queryParams.pId = id
  620. this.doc.pId = id
  621. this.getFileList()
  622. // this.$nextTick(() => {
  623. // this.$refs.doc.clearFiles()
  624. // })
  625. },
  626. getFileList() {
  627. allFileList(this.doc.queryParams).then(response => {
  628. this.doc.commonfileList = response;
  629. });
  630. },
  631. getFileListFeedback() {
  632. allFileList(this.docFeedback.queryParams).then(response => {
  633. this.docFeedback.commonfileList = response;
  634. });
  635. },
  636. /** 附件上传中处理 */
  637. handleFileDocProgress(event, file, fileList) {
  638. this.doc.file = file;
  639. this.doc.isUploading = true;
  640. },
  641. handleFileDocProgressFeedback(event, file, fileList) {
  642. this.docFeedback.file = file;
  643. this.docFeedback.isUploading = true;
  644. },
  645. /** 附件上传成功处理 */
  646. handleFileDocSuccess(response, file, fileList) {
  647. this.doc.isUploading = false;
  648. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  649. this.getFileList()
  650. },
  651. handleFileDocSuccessFeedback(response, file, fileList) {
  652. this.docMentorFeedback.isUploading = false;
  653. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  654. this.getFileListFeedback()
  655. },
  656. /** 删除按钮操作 */
  657. handleDeleteDoc(row) {
  658. const ids = row.id || this.ids;
  659. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  660. confirmButtonText: this.$t('确定'),
  661. cancelButtonText: this.$t('取消'),
  662. type: "warning"
  663. }).then(function() {
  664. return delCommonfile(ids);
  665. }).then(() => {
  666. this.getFileList()
  667. this.msgSuccess(this.$t('删除成功'));
  668. })
  669. },
  670. /** 查询专项培训反馈列表 */
  671. getList() {
  672. this.loading = true;
  673. listPlanMonthly(this.queryParams).then(response => {
  674. this.dataList = response.rows;
  675. this.total = response.total;
  676. this.loading = false;
  677. console.log(this.queryParams);
  678. });
  679. },
  680. // 取消按钮
  681. cancel() {
  682. this.open = false;
  683. this.reset();
  684. },
  685. // 表单重置
  686. reset() {
  687. this.form = {
  688. id: null,
  689. feedbackType: null,
  690. mentorId: null,
  691. successorId: null,
  692. successorName: null,
  693. parentId: null,
  694. planId: null,
  695. feedbackYear: null,
  696. feedbackSeason: null,
  697. feedbackMonth: null,
  698. successorFeedback: null,
  699. mentorFeedback: null,
  700. feedbackScore: null,
  701. feedbackStatus: 0,
  702. meetingDate: null
  703. };
  704. this.resetForm("form");
  705. },
  706. /** 搜索按钮操作 */
  707. handleQuery() {
  708. if (typeof(this.queryParams.feedbackYearTemp) == 'string') {
  709. this.queryParams.feedbackYear = this.queryParams.feedbackYearTemp;
  710. } else {
  711. this.queryParams.feedbackYear = this.queryParams.feedbackYearTemp.getFullYear();
  712. }
  713. this.queryParams.pageNum = 1;
  714. this.getList();
  715. // 清空导师反馈内容
  716. this.mentorFeedback = "";
  717. getFeedbackByParams({
  718. successorId: this.queryParams.successorId,
  719. feedbackYear: this.queryParams.feedbackYear,
  720. feedbackMonth: this.queryParams.feedbackMonth,
  721. }).then(response => {
  722. let data = response.data;
  723. this.feedbackId = data.id;
  724. this.mentorFeedback = data.mentorFeedback;
  725. });
  726. },
  727. /** 重置按钮操作 */
  728. resetQuery() {
  729. this.resetForm("queryForm");
  730. this.handleQuery();
  731. },
  732. // 多选框选中数据
  733. handleSelectionChange(selection) {
  734. this.ids = selection.map(item => item.id)
  735. this.single = selection.length!==1
  736. this.multiple = !selection.length
  737. },
  738. //文件预览
  739. openPdf(){
  740. //ppt就跳路由预览,office就直接打开文件新页面
  741. const didi={ imgs:this.imgs}
  742. if( this.pptView==true&&this.ppt==false){
  743. let routeUrl = this.$router.resolve({
  744. path: "/cpms/index.html#/pptyulan",
  745. query:didi
  746. });
  747. window.open("/cpms/index.html#/pptyulan?id=" + this.pdf.pdfUrl, '_blank')
  748. console.log(this.imgs)
  749. }else {
  750. window.open(this.pdf.pdfUrl)
  751. }
  752. },
  753. handleSeePPT (row){
  754. //ppt预览
  755. this.loadingFlash=true
  756. this.pdf.open =true
  757. this.pdf.title = row.fileName
  758. this.pdf.pdfUrl = row.fileUrl
  759. this.pptView=true
  760. this.ppt=false
  761. const formatDate =new FormData();
  762. formatDate.append("filepath",row.fileUrl)
  763. //调用文件预览api
  764. let res= this.officeConvert.pptConvertCommon(formatDate)
  765. //查看接受的全局方法的返回结果 console.log(res)
  766. //利用.then方法接受Promise对象
  767. res.then((result)=>{
  768. //关闭加载中
  769. this.loadingFlash=false
  770. //成功时直接给地址
  771. this.videoList = result.data.imagePathList
  772. //将返回的地址集合遍历添加到绑定的数组中
  773. this.imgs=[]
  774. for (var key=0;key<this.videoList.length;key++) {
  775. this.imgs.push( process.env.VUE_APP_BASE_API+ this.videoList[key] );
  776. }
  777. }).catch(result => {
  778. //请求失败,关闭loading,pdf地址直接为为空,不显示
  779. this.pdf.pdfUrl =""
  780. this.loadingFlash = false;
  781. })
  782. },
  783. handleSee (row){
  784. //office预览
  785. this.loadingFlash=true
  786. this.pdf.open =true
  787. this.pdf.title = row.fileName
  788. this.pdf.pdfUrl =""
  789. this.pptView=false
  790. this.ppt=true
  791. //如果是PDF等直接可以打开的就不调接口,否则调用接口
  792. if(row.fileName.endsWith('pdf')){
  793. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API + '/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  794. this.loadingFlash=false
  795. }
  796. else{
  797. const formatDate =new FormData();
  798. formatDate.append("filepath",row.fileUrl)
  799. //调用文件预览api
  800. let res= this.officeConvert.officeConvertCommon(formatDate)
  801. //查看接受的全局方法的返回结果 console.log(res)
  802. //利用.then方法接受Promise对象
  803. res.then((result)=>{
  804. //关闭加载中
  805. this.loadingFlash=false
  806. if(result.msg.includes("csv")){
  807. this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
  808. this.$alert(result.msg, this.$t('检查乱码'), { dangerouslyUseHTMLString: true });
  809. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  810. }else if(result.msg.includes("不存在")){
  811. //文件不存在时提示
  812. this.pdf.pdfUrl =""
  813. this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
  814. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  815. this.pdf.open =false
  816. }else if(result.msg.includes("不支持此格式")){
  817. this.pdf.pdfUrl =""
  818. this.$alert(result.msg, this.$t('预览失败'), { dangerouslyUseHTMLString: true });
  819. // this.$message({message: result.msg, center: true,type:'warning', offset:400, });
  820. this.pdf.open =false
  821. } else{
  822. //成功时直接给地址
  823. this.pdf.pdfUrl =process.env.VUE_APP_BASE_API+ result.data
  824. }
  825. // this.$nextTick(() => {
  826. // const iframe = window.frames['iFrame']
  827. // const handleLoad = () => {
  828. // setTimeout(() => {
  829. // const Do = (iframe.contentWindow || iframe.contentDocument)
  830. // console.log(Do.document.getElementsByTagName('table')[0])
  831. // Do.document.getElementsByTagName('table')[0].style.width = "100%"
  832. // Do.document.getElementsByTagName('table')[0].setAttribute("class","table")
  833. // }, 500)
  834. // }
  835. // iframe.addEventListener('load', handleLoad, true)
  836. // })
  837. }).catch(result => {
  838. //请求失败,关闭loading,pdf地址直接为为空,不显示
  839. this.pdf.pdfUrl =""
  840. this.loadingFlash = false;
  841. })
  842. }
  843. },
  844. }
  845. };
  846. </script>
  847. <style scoped>
  848. .question{
  849. margin: 20px 0px;
  850. padding-left: 20px;
  851. }
  852. .answer{
  853. padding-bottom: 10px;
  854. padding-left: 40px;
  855. }
  856. h3{
  857. margin: 20px 0px;
  858. }
  859. </style>