index.vue 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094
  1. <template>
  2. <div class="app-container">
  3. <!-- 搜索栏 -->
  4. <el-form :inline="true">
  5. <el-form-item label="会议日期">
  6. <el-date-picker
  7. size="small"
  8. v-model="meetingDate"
  9. align="right"
  10. type="date"
  11. placeholder="选择会议日期"
  12. :picker-options="pickerOptions"
  13. style="width:200px"
  14. >
  15. </el-date-picker>
  16. </el-form-item>
  17. <el-form-item label="参会导师">
  18. <el-select
  19. size="small"
  20. v-model="mentorOptionsArray"
  21. multiple
  22. placeholder="请选择导师"
  23. prop="mentorId"
  24. style="width:200px"
  25. >
  26. <el-option
  27. v-for="mentor in this.mentorOptions"
  28. :key="mentor.key"
  29. :label="mentor.value"
  30. :value="mentor.key">
  31. </el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button
  36. icon="el-icon-s-promotion"
  37. type="success"
  38. size="mini"
  39. @click="handleInvite"
  40. >
  41. 邀请
  42. </el-button>
  43. </el-form-item>
  44. </el-form>
  45. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
  46. <el-form-item label="学员" prop="successorId">
  47. <el-select
  48. size="small"
  49. v-model="queryParams.successorId"
  50. placeholder="请选择学员"
  51. @change="someMethod()"
  52. style="width:200px"
  53. >
  54. <el-option
  55. v-for="successor in this.successorOptions"
  56. :key="successor.key"
  57. :label="successor.value"
  58. :value="successor.key"
  59. ></el-option>
  60. </el-select>
  61. </el-form-item>
  62. <el-form-item label="年" prop="feedbackYear">
  63. <el-date-picker
  64. v-model="queryParams.feedbackYear"
  65. placeholder="请选择年"
  66. clearable
  67. type="year"
  68. size="small"
  69. @keyup.enter.native="handleQuery"
  70. style="width:200px"
  71. />
  72. </el-form-item>
  73. <el-form-item label="季度" prop="feedbackSason">
  74. <el-select
  75. v-model="queryParams.feedbackSeason"
  76. placeholder="请选择季度"
  77. clearable
  78. size="small"
  79. @keyup.enter.native="handleQuery"
  80. style="width:200px"
  81. >
  82. <el-option label="第一季度" value="1"></el-option>
  83. <el-option label="第二季度" value="2"></el-option>
  84. <el-option label="第三季度" value="3"></el-option>
  85. <el-option label="第四季度" value="4"></el-option>
  86. </el-select>
  87. </el-form-item>
  88. <el-form-item>
  89. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  90. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  91. </el-form-item>
  92. </el-form>
  93. <!-- 标签页 -->
  94. <el-tabs type="border-card" @tab-click="handleTabClick" v-model="activeName">
  95. <el-tab-pane
  96. :key="item.name"
  97. v-for="(item) in mentorTabs"
  98. :label="item.title"
  99. :name="item.name"
  100. >
  101. <!-- 培养计划总表 -->
  102. <el-table
  103. v-loading="loading"
  104. :data="dataList"
  105. @selection-change="handleSelectionChange"
  106. ref="feedbackListSeasonalTable"
  107. border
  108. :cell-style="tableCellStyle"
  109. >
  110. <el-table-column label="培养内容" align="center" prop="plantName" width="600px"/>
  111. <el-table-column label="开始日期" align="center" prop="startDate"/>
  112. <el-table-column label="结束日期" align="center" prop="endDate"/>
  113. <el-table-column label="实际完成日期" align="center" prop="dateOfCompletion"/>
  114. <el-table-column label="学习状态" align="center" prop="studyState" :formatter="studyStateFormat"/>
  115. <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
  116. <template slot-scope="scope">
  117. <el-button
  118. size="mini"
  119. type="text"
  120. icon="el-icon-chat-dot-round"
  121. v-hasPermi="['spec:plan:edit']"
  122. @click="handleFeedback(scope.row)"
  123. >详情</el-button>
  124. </template>
  125. </el-table-column>
  126. </el-table>
  127. <!-- 汇报附件 -->
  128. <div>
  129. <h3>汇报展示PPT</h3>
  130. <el-upload
  131. ref="doc"
  132. :headers="doc.headers"
  133. class="upload-demo"
  134. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  135. :disabled="doc.isUploading"
  136. :on-progress="handleFileDocProgress"
  137. :on-success="handleFileDocSuccess"
  138. :auto-upload="true"
  139. multiple
  140. :limit="3">
  141. <el-button size="small" type="primary" style="margin-bottom:10px;">点击上传</el-button>
  142. </el-upload>
  143. <el-table :data="doc.commonfileList" border style="width:600px;">
  144. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  145. <template slot-scope="scope">
  146. <a class="link-type" @click="handleDownload(scope.row)">
  147. <span>{{ scope.row.fileName }}</span>
  148. </a>
  149. </template>
  150. </el-table-column>
  151. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  152. <template slot-scope="scope">
  153. <el-button
  154. v-if="scope.row.fileName.endsWith('pdf')"
  155. size="mini"
  156. type="text"
  157. icon="el-icon-view"
  158. @click="handleSee(scope.row)"
  159. >{{ $t('预览') }}</el-button>
  160. <el-button
  161. size="mini"
  162. type="text"
  163. icon="el-icon-download"
  164. @click="handleDownload(scope.row)"
  165. >{{ $t('下载') }}</el-button>
  166. <el-button
  167. size="mini"
  168. type="text"
  169. icon="el-icon-delete"
  170. @click="handleDeleteDoc(scope.row)"
  171. >{{ $t('删除') }}</el-button>
  172. </template>
  173. </el-table-column>
  174. </el-table>
  175. </div>
  176. <!-- 问卷 -->
  177. <div>
  178. <div style="display:inline-block;width:40%;">
  179. <h3 style="margin-bottom:0px;">学员表现</h3>
  180. <div class="question">
  181. 1. 学员的现场汇报精神面貌如何?
  182. </div>
  183. <div class="answer">
  184. <el-radio-group v-model="radio1" size="small">
  185. <el-radio label="1">优秀</el-radio>
  186. <el-radio label="2">良好</el-radio>
  187. <el-radio label="3">一般</el-radio>
  188. <el-radio label="4">基本合格</el-radio>
  189. </el-radio-group>
  190. </div>
  191. <div class="question">
  192. 2. 学员的现场汇报语言表达如何?
  193. </div>
  194. <div class="answer">
  195. <el-radio-group v-model="radio2" size="small">
  196. <el-radio label="1">优秀</el-radio>
  197. <el-radio label="2">良好</el-radio>
  198. <el-radio label="3">一般</el-radio>
  199. <el-radio label="4">基本合格</el-radio>
  200. </el-radio-group>
  201. </div>
  202. <div class="question">
  203. 3. 学员的现场汇报逻辑思维如何?
  204. </div>
  205. <div class="answer">
  206. <el-radio-group v-model="radio3" size="small">
  207. <el-radio label="1">优秀</el-radio>
  208. <el-radio label="2">良好</el-radio>
  209. <el-radio label="3">一般</el-radio>
  210. <el-radio label="4">基本合格</el-radio>
  211. </el-radio-group>
  212. </div>
  213. <h3 style="margin-bottom:0px;">汇报材料及内容</h3>
  214. <div class="question">
  215. 4. 汇报材料准备是否充分,汇报材料是否紧贴本季学习内容?
  216. </div>
  217. <div class="answer">
  218. <el-radio-group v-model="radio4" size="small">
  219. <el-radio label="1">充分</el-radio>
  220. <el-radio label="2">比较充分</el-radio>
  221. <el-radio label="3">一般</el-radio>
  222. <el-radio label="4">基本合格</el-radio>
  223. </el-radio-group>
  224. </div>
  225. <div class="question">
  226. 5. 汇报内容是否符合学习材料(SOP或者程序)的要求?
  227. </div>
  228. <div class="answer">
  229. <el-radio-group v-model="radio5" size="small">
  230. <el-radio label="1">完全符合</el-radio>
  231. <el-radio label="2">基本符合</el-radio>
  232. <el-radio label="3">一般</el-radio>
  233. <el-radio label="4">基本合格</el-radio>
  234. </el-radio-group>
  235. </div>
  236. <div class="question">
  237. 6. 学员对本季的学习内容、学习目标及学习结果的阐述是否具体、完整、准确?
  238. </div>
  239. <div class="answer">
  240. <el-radio-group v-model="radio6" size="small">
  241. <el-radio label="1">非常全面</el-radio>
  242. <el-radio label="2">全面</el-radio>
  243. <el-radio label="3">一般</el-radio>
  244. <el-radio label="4">基本合格</el-radio>
  245. </el-radio-group>
  246. </div>
  247. <div class="question">
  248. 7. 学员本季汇报内容较上次是否有所提升?
  249. </div>
  250. <div class="answer">
  251. <el-radio-group v-model="radio7" size="small">
  252. <el-radio label="1">进步明显</el-radio>
  253. <el-radio label="2">略有提升</el-radio>
  254. <el-radio label="3">一般</el-radio>
  255. <el-radio label="4">基本合格</el-radio>
  256. </el-radio-group>
  257. </div>
  258. </div>
  259. <div style="display:inline-block;width:40%;">
  260. <div class="question">
  261. 8. 汇报内容针对本季学习范围是否存在明显的汇报漏项或者不足?
  262. </div>
  263. <div class="answer">
  264. <el-radio-group v-model="radio8" size="small">
  265. <el-radio label="1">完全不存在</el-radio>
  266. <el-radio label="2">基本不存在</el-radio>
  267. <el-radio label="3">无明显存在</el-radio>
  268. <el-radio label="4">存在</el-radio>
  269. </el-radio-group>
  270. </div>
  271. <div class="question">
  272. 9. 学员的本季汇报内容是否结合岗位工作实际?
  273. </div>
  274. <div class="answer">
  275. <el-radio-group v-model="radio9" size="small">
  276. <el-radio label="1">紧密结合</el-radio>
  277. <el-radio label="2">结合</el-radio>
  278. <el-radio label="3">一般</el-radio>
  279. <el-radio label="4">基本合格</el-radio>
  280. </el-radio-group>
  281. </div>
  282. <div class="question">
  283. 10. 学员在实际工作中是否能够学有所用?
  284. </div>
  285. <div class="answer">
  286. <el-radio-group v-model="radio10" size="small">
  287. <el-radio label="1">灵活运用</el-radio>
  288. <el-radio label="2">基本运用</el-radio>
  289. <el-radio label="3">尝试运用</el-radio>
  290. <el-radio label="4">基本合格</el-radio>
  291. </el-radio-group>
  292. </div>
  293. <div class="question">
  294. 11. 汇报内容对目标岗位建设是否能起到启发促进作用?
  295. </div>
  296. <div class="answer">
  297. <el-radio-group v-model="radio11" size="small">
  298. <el-radio label="1">极有建设性</el-radio>
  299. <el-radio label="2">建设性</el-radio>
  300. <el-radio label="3">一般</el-radio>
  301. <el-radio label="4">基本合格</el-radio>
  302. </el-radio-group>
  303. </div>
  304. <div class="question">
  305. 12. 汇报内容对于装置及公司的人才培养计划是否能起到建设性促进作用?
  306. </div>
  307. <div class="answer">
  308. <el-radio-group v-model="radio12" size="small">
  309. <el-radio label="1">极有建设性</el-radio>
  310. <el-radio label="2">建设性</el-radio>
  311. <el-radio label="3">一般</el-radio>
  312. <el-radio label="4">基本合格</el-radio>
  313. </el-radio-group>
  314. </div>
  315. <div class="question">
  316. 13. 汇报内容是否有对装置生产、管理、建设提出合理化建议?
  317. </div>
  318. <div class="answer">
  319. <el-radio-group v-model="radio13" size="small">
  320. <el-radio label="1">有可采用的合理化建议</el-radio>
  321. <el-radio label="2">有可行性合理化建议</el-radio>
  322. <el-radio label="3">有合理化建议</el-radio>
  323. <el-radio label="4">无</el-radio>
  324. </el-radio-group>
  325. </div>
  326. <div class="question">
  327. 14. 汇报内容是否对下期培训提出新的培训需求?
  328. </div>
  329. <div class="answer">
  330. <el-radio-group v-model="radio14" size="small">
  331. <el-radio label="1">有计划外需求</el-radio>
  332. <el-radio label="2">有计划内需求</el-radio>
  333. <el-radio label="3">有需求</el-radio>
  334. <el-radio label="4">无具体需求</el-radio>
  335. </el-radio-group>
  336. </div>
  337. </div>
  338. </div>
  339. <!-- 导师反馈 -->
  340. <div>
  341. <h3 style="margin-top:0px;">导师反馈</h3>
  342. <editor :min-height="300" v-model="mentorFeedback"/>
  343. </div>
  344. <!-- 保存按钮 -->
  345. <div style="text-align:center;margin: 20px auto;">
  346. <el-button
  347. size="medium"
  348. type="success"
  349. @click="handleSave"
  350. >
  351. 保存
  352. </el-button>
  353. </div>
  354. </el-tab-pane>
  355. </el-tabs>
  356. <!-- 详情对话框 -->
  357. <el-dialog v-dialogDrag :title="feedbackDialog.title" :visible.sync="feedbackDialog.open" width="800px" append-to-body>
  358. <div style="width:700px; margin:0px auto;">
  359. <h3 style="margin-bottom:20px;">学员心得</h3>
  360. <el-table :data="tableData" border style="width: 100%">
  361. <el-table-column prop="id" label="编号" width="50"></el-table-column>
  362. <el-table-column prop="question" label="问题" width="250"></el-table-column>
  363. <el-table-column prop="answer" label="答案"></el-table-column>
  364. </el-table>
  365. <el-table :data="docFeedback.commonfileList" border>
  366. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  367. <template slot-scope="scope">
  368. <a class="link-type" @click="handleDownload(scope.row)">
  369. <span>{{ scope.row.fileName }}</span>
  370. </a>
  371. </template>
  372. </el-table-column>
  373. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  374. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  375. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  376. <template slot-scope="scope">
  377. <el-button
  378. v-if="scope.row.fileName.endsWith('pdf')"
  379. size="mini"
  380. type="text"
  381. icon="el-icon-view"
  382. @click="handleSee(scope.row)"
  383. >{{ $t('预览') }}</el-button>
  384. <el-button
  385. size="mini"
  386. type="text"
  387. icon="el-icon-download"
  388. @click="handleDownload(scope.row)"
  389. >{{ $t('下载') }}</el-button>
  390. </template>
  391. </el-table-column>
  392. </el-table>
  393. <el-form v-if="detailFeedback != null">
  394. <h3 style="margin-top:30px;margin-bottom:20px;">导师反馈</h3>
  395. <el-form-item>
  396. <p v-html="detailFeedback" style="border:1px solid #DFE6EC;"/>
  397. </el-form-item>
  398. </el-form>
  399. </div>
  400. </el-dialog>
  401. </div>
  402. </template>
  403. <script>
  404. import { getAnswer, addAnswer, updateAnswer, listAnswer } from "@/api/training/spec/answer";
  405. import { allFileList, delCommonfile } from "@/api/common/commonfile";
  406. import { addFeedback, getFeedbackByParams, listInvitedSuccessor, updateFeedback, listFeedback, getFeedbackByPlanId } from "@/api/training/spec/feedback";
  407. import { listMentors } from "@/api/training/spec/successor";
  408. import { listSuccessorsByMentorId, listPlanSeasonal } from "@/api/training/spec/plan";
  409. import { getToken } from "@/utils/auth";
  410. import Treeselect from "@riophae/vue-treeselect";
  411. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  412. import Editor from '@/components/Editor';
  413. export default {
  414. name: "SeasonalFeedback",
  415. components: { Treeselect, Editor },
  416. data() {
  417. return {
  418. // 导师标签
  419. mentorTabs: [],
  420. // 详情对话框表格数据
  421. tableData: [],
  422. // 反馈id
  423. feedbackId: null,
  424. // 会议日期快捷选项
  425. pickerOptions: {
  426. shortcuts: [{
  427. text: '今天',
  428. onClick(picker) {
  429. picker.$emit('pick', new Date());
  430. }
  431. }, {
  432. text: '昨天',
  433. onClick(picker) {
  434. const date = new Date();
  435. date.setTime(date.getTime() - 3600 * 1000 * 24);
  436. picker.$emit('pick', date);
  437. }
  438. }, {
  439. text: '一周前',
  440. onClick(picker) {
  441. const date = new Date();
  442. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  443. picker.$emit('pick', date);
  444. }
  445. }, {
  446. text: '一周后',
  447. onClick(picker) {
  448. const date = new Date();
  449. date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
  450. picker.$emit('pick', date);
  451. }
  452. }]
  453. },
  454. // 会议日期
  455. meetingDate: null,
  456. // 学习状态字典
  457. studyStateOptions: [],
  458. // 汇报展示附件参数
  459. doc: { // 反馈附件
  460. file: "",
  461. // 是否显示弹出层(报告附件)
  462. open: false,
  463. // 弹出层标题(报告附件)
  464. title: "",
  465. // 是否禁用上传
  466. isUploading: false,
  467. // 是否更新已经存在的用户数据
  468. updateSupport: 0,
  469. // 报告附件上传位置编号
  470. ids: 0,
  471. // 设置上传的请求头部
  472. headers: { Authorization: "Bearer " + getToken() },
  473. // 上传的地址
  474. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  475. commonfileList: null,
  476. queryParams: {
  477. pId: null,
  478. pType: 'docSeasonal'
  479. },
  480. pType: 'docSeasonal',
  481. pId: null
  482. },
  483. // 培养计划总表数据
  484. dataList: [],
  485. // 首选标签页
  486. activeName: null,
  487. // 学员下拉列表
  488. successorOptions: [],
  489. // 导师下拉列表
  490. mentorOptions: [],
  491. // 导师数组
  492. mentorOptionsArray: [],
  493. // 包含导师id的查询对象
  494. queryObject: {
  495. mentorStaffId: ""
  496. },
  497. // 导师反馈内容
  498. mentorFeedback: null, // 季度反馈内容
  499. detailFeedback: null, // 计划详情反馈内容
  500. // 反馈对话框参数
  501. feedbackDialog: {
  502. id: 0,
  503. // 是否显示弹出层(报告附件)
  504. open: false,
  505. // 弹出层标题(报告附件)
  506. title: ""
  507. },
  508. // 问卷单选框
  509. radio1: '',
  510. radio2: '',
  511. radio3: '',
  512. radio4: '',
  513. radio5: '',
  514. radio6: '',
  515. radio7: '',
  516. radio8: '',
  517. radio9: '',
  518. radio10: '',
  519. radio11: '',
  520. radio12: '',
  521. radio13: '',
  522. radio14: '',
  523. // 报告附件参数
  524. doc: { // 季度汇报附件
  525. file: "",
  526. // 是否显示弹出层(报告附件)
  527. open: false,
  528. // 弹出层标题(报告附件)
  529. title: "",
  530. // 是否禁用上传
  531. isUploading: false,
  532. // 是否更新已经存在的用户数据
  533. updateSupport: 0,
  534. // 报告附件上传位置编号
  535. ids: 0,
  536. // 设置上传的请求头部
  537. headers: { Authorization: "Bearer " + getToken() },
  538. // 上传的地址
  539. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  540. commonfileList: null,
  541. queryParams: {
  542. pId: null,
  543. pType: 'plan'
  544. },
  545. pType: 'plan',
  546. pId: null
  547. },
  548. docFeedback: { // 反馈附件
  549. file: "",
  550. // 是否显示弹出层(报告附件)
  551. open: false,
  552. // 弹出层标题(报告附件)
  553. title: "",
  554. // 是否禁用上传
  555. isUploading: false,
  556. // 是否更新已经存在的用户数据
  557. updateSupport: 0,
  558. // 报告附件上传位置编号
  559. ids: 0,
  560. // 设置上传的请求头部
  561. headers: { Authorization: "Bearer " + getToken() },
  562. // 上传的地址
  563. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  564. commonfileList: null,
  565. queryParams: {
  566. pId: null,
  567. pType: 'docFeedback'
  568. },
  569. pType: 'docFeedback',
  570. pId: null
  571. },
  572. // 标签页选中项
  573. activeName: 'zhu',
  574. // 遮罩层
  575. loading: true,
  576. // 选中数组
  577. ids: [],
  578. // 非单个禁用
  579. single: true,
  580. // 非多个禁用
  581. multiple: true,
  582. // 显示搜索条件
  583. showSearch: true,
  584. // 总条数
  585. total: 0,
  586. // 专项培训反馈表格数据
  587. feedbackList: [],
  588. // 弹出层标题
  589. title: "",
  590. // 部门树选项
  591. deptOptions: undefined,
  592. clientHeight:300,
  593. // 是否显示弹出层
  594. open: false,
  595. // 用户导入参数
  596. upload: {
  597. // 是否显示弹出层(用户导入)
  598. open: false,
  599. // 弹出层标题(用户导入)
  600. title: "",
  601. // 是否禁用上传
  602. isUploading: false,
  603. // 是否更新已经存在的用户数据
  604. updateSupport: 0,
  605. // 设置上传的请求头部
  606. headers: { Authorization: "Bearer " + getToken() },
  607. // 上传的地址
  608. url: process.env.VUE_APP_BASE_API + "/spec/feedback/importData"
  609. },
  610. // 查询参数
  611. queryParams: {
  612. pageNum: 1,
  613. pageSize: 100,
  614. feedbackType: null,
  615. mentorId: null,
  616. successorId: null,
  617. successorName: null,
  618. parentId: null,
  619. planId: null,
  620. feedbackYear: null,
  621. feedbackSeason: null,
  622. feedbackMonth: null,
  623. successorFeedback: null,
  624. mentorFeedback: null,
  625. feedbackScore: null,
  626. feedbackStatus: null,
  627. meetingDate: null
  628. },
  629. // 表单参数
  630. form: {},
  631. // 表单校验
  632. rules: {
  633. }
  634. };
  635. },
  636. watch: {
  637. },
  638. created() {
  639. //设置表格高度对应屏幕高度
  640. this.$nextTick(() => {
  641. this.clientHeight = document.body.clientHeight -250
  642. })
  643. // 获取学习状态字典
  644. this.getDicts("st_study_state").then(response => {
  645. this.studyStateOptions = response.data;
  646. });
  647. // 初始化页面数据
  648. this.initPageData();
  649. },
  650. methods: {
  651. /** 标签页切换事件 */
  652. handleTabClick(tab) {
  653. console.log(tab.name);
  654. // 导师id=tab.name
  655. // 根据导师id学员id年季度获取feedbackId
  656. // 刷新问卷和导师反馈内容
  657. },
  658. /** 初始化页面数据 */
  659. initPageData() {
  660. // 获取当前日期
  661. let date = new Date();
  662. // 搜索条件默认为当年、当季度
  663. this.queryParams.feedbackYear = date.getFullYear().toString();
  664. this.queryParams.feedbackSeason = ( ( date.getMonth() + 2 ) / 3 ).toString();
  665. // ====================获取导师下拉列表====================
  666. listMentors().then(response => {
  667. let mentorList = response.data;
  668. for (let i = 0; i < mentorList.length; i++) {
  669. let mentor = {};
  670. mentor.key = mentorList[i].mentorStaffId;
  671. mentor.value = mentorList[i].mentorStaffName;
  672. this.mentorOptions.push(mentor);
  673. }
  674. });
  675. // ====================获取当前导师的学员列表====================
  676. listSuccessorsByMentorId(this.queryObject).then(response => {
  677. let data = response.data;
  678. for (let i = 0; i < data.length; i++) {
  679. if (i == 0) {
  680. // 默认选中列表中第一个学员
  681. this.queryParams.successorId = data[i].staffId;
  682. this.getList();
  683. }
  684. this.successorOptions.push( { key: data[i].staffId, value: data[i].staffName } );
  685. }
  686. // 获取当前学员当年当季度反馈id
  687. getFeedbackByParams({
  688. successorId: this.queryParams.successorId,
  689. feedbackYear: this.queryParams.feedbackYear,
  690. feedbackSeason: this.queryParams.feedbackSeason
  691. }).then(response => {
  692. let data = response.data;
  693. this.feedbackId = data.id;
  694. this.meetingDate = data.meetingDate;
  695. this.mentorFeedback = data.mentorFeedback;
  696. // 初始化汇报附件
  697. this.initFileList(data.id);
  698. // ====================初始化导师标签页====================
  699. this.activeName = data.mentorId;
  700. this.mentorTabs.push({ name: data.mentorId, title: data.mentorName});
  701. listFeedback( { parentId: data.id } ).then(response => {
  702. let data = response.rows;
  703. for (let i = 0; i < data.length; i++) {
  704. this.mentorTabs.push({ name: data[i].mentorId, title: data[i].mentorName});
  705. }
  706. });
  707. // ====================获取问卷答案====================
  708. listAnswer( { feedbackId: this.feedbackId } ).then(response => {
  709. let data = response.rows;
  710. for (let i = 0; i < data.length; i++) {
  711. if (data[i].questionId == "4") { this.radio1 = data[i].answer; }
  712. if (data[i].questionId == "5") { this.radio2 = data[i].answer; }
  713. if (data[i].questionId == "6") { this.radio3 = data[i].answer; }
  714. if (data[i].questionId == "7") { this.radio4 = data[i].answer; }
  715. if (data[i].questionId == "8") { this.radio5 = data[i].answer; }
  716. if (data[i].questionId == "9") { this.radio6 = data[i].answer; }
  717. if (data[i].questionId == "10") { this.radio7 = data[i].answer; }
  718. if (data[i].questionId == "11") { this.radio8 = data[i].answer; }
  719. if (data[i].questionId == "12") { this.radio9 = data[i].answer; }
  720. if (data[i].questionId == "13") { this.radio10 = data[i].answer; }
  721. if (data[i].questionId == "14") { this.radio11 = data[i].answer; }
  722. if (data[i].questionId == "15") { this.radio12 = data[i].answer; }
  723. if (data[i].questionId == "16") { this.radio13 = data[i].answer; }
  724. if (data[i].questionId == "17") { this.radio14 = data[i].answer; }
  725. }
  726. });
  727. });
  728. });
  729. // ====================获取当前导师作为受邀导师的学员列表====================
  730. listInvitedSuccessor(null).then(response => {
  731. let data = response.data;
  732. for (let i = 0; i < data.length; i++) {
  733. this.successorOptions.push( { key: data[i].successorId, value: data[i].successorName } );
  734. }
  735. });
  736. },
  737. /** 问卷判空 */
  738. isEmpty() {
  739. let radioArray = [ this.radio1, this.radio2, this.radio3, this.radio4, this.radio5, this.radio6, this.radio7, this.radio8, this.radio9, this.radio10, this.radio11, this.radio12, this.radio13, this.radio14 ];
  740. let isEmpty = false;
  741. for (let i = 0; i < radioArray.length; i++) {
  742. if (radioArray[i] == "") {
  743. isEmpty = true;
  744. }
  745. }
  746. return isEmpty;
  747. },
  748. /** 计算导师评分 */
  749. calcFeedbackScore() {
  750. let mentorFeedbackScore = 0; // 本导师评分
  751. let invitedMentorFeedbackScoreSum = 0; // 受邀导师总分
  752. let invitedMentorFeedbackScoreAvg = 0; // 受邀导师平均分
  753. let invitedMentors = 0; // 受邀导师人数
  754. let overallScore = 0; // 季度平均分
  755. let feedbackId = null; // 本导师反馈id
  756. // 获取问题答案列表
  757. listAnswer( { feedbackId: this.feedbackId } )
  758. .then(response => {
  759. let data = response.rows;
  760. // 计算导师评分
  761. let total = 0; // 总分
  762. for (let i = 0; i < data.length; i++) {
  763. if(data[i].answer == "1") {
  764. total += 100;
  765. }
  766. }
  767. let avg = total / 14; // 平均分
  768. // 更新当前导师评分
  769. return updateFeedback( { id: this.feedbackId, feedbackScore: avg } );
  770. })
  771. .then(() => {
  772. // 获取本导师反馈
  773. return getFeedbackByParams({
  774. successorId: this.queryParams.successorId,
  775. feedbackYear: this.queryParams.feedbackYear,
  776. feedbackSeason: this.queryParams.feedbackSeason
  777. })
  778. })
  779. .then(response => {
  780. // 设置本导师反馈id
  781. feedbackId = response.data.id;
  782. // 设置导师评分
  783. mentorFeedbackScore = response.data.feedbackScore;
  784. // 获取受邀导师列表
  785. return listFeedback( { parentId: feedbackId } );
  786. })
  787. .then(response => {
  788. let data = response.rows;
  789. for (let i = 0; i < data.length; i++) {
  790. if (data[i].feedbackScore != null) {
  791. invitedMentorFeedbackScoreSum += Number(data[i].feedbackScore);
  792. invitedMentors += 1;
  793. }
  794. }
  795. // 受邀导师平均分 = 总分 / 人数
  796. invitedMentorFeedbackScoreAvg = invitedMentorFeedbackScoreSum / invitedMentors;
  797. // 季度平均分 = 本导师评分 * 60% + 受邀导师平均分 * 40%
  798. overallScore = mentorFeedbackScore * 0.6 + invitedMentorFeedbackScoreAvg * 0.4;
  799. // 更新季度平均分
  800. updateFeedback({ id: feedbackId, overallScore: overallScore });
  801. });
  802. },
  803. /** 保存反馈问题 */
  804. saveAnswer(questionId, answer) {
  805. let answerObj = {};
  806. answerObj.feedbackId = this.feedbackId;
  807. answerObj.questionId = questionId;
  808. getAnswer(answerObj).then(response => {
  809. let data = response.data;
  810. answerObj.answer = answer;
  811. if (data != null) {
  812. if (response.answer == data.answer) { // 答案一致
  813. return;
  814. } else { // 答案不一致
  815. answerObj.id = data.id;
  816. updateAnswer(answerObj).then(response => {
  817. // 计算导师评分
  818. this.calcFeedbackScore();
  819. });
  820. }
  821. } else {
  822. addAnswer(answerObj).then(response => {
  823. // 计算导师评分
  824. this.calcFeedbackScore();
  825. });
  826. }
  827. });
  828. },
  829. /** 保存导师反馈内容 */
  830. saveMentorFeedback() {
  831. let feedback = {};
  832. feedback.id = this.feedbackId;
  833. feedback.mentorFeedback = this.mentorFeedback;
  834. updateFeedback(feedback);
  835. },
  836. /** 保存按钮处理 */
  837. handleSave() {
  838. // 问卷判空
  839. if (this.isEmpty()) {
  840. this.$message.error('问卷答案不能为空')
  841. return;
  842. }
  843. let radioArray = [ this.radio1, this.radio2, this.radio3, this.radio4, this.radio5, this.radio6, this.radio7, this.radio8, this.radio9, this.radio10, this.radio11, this.radio12, this.radio13, this.radio14 ];
  844. let questionArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
  845. // 保存问卷内容
  846. for (let i = 0; i < radioArray.length; i++) {
  847. this.saveAnswer(questionArray[i]+3, radioArray[i]);
  848. }
  849. // 保存导师反馈内容
  850. this.saveMentorFeedback();
  851. this.msgSuccess("保存成功");
  852. },
  853. /** 培养计划详情处理 */
  854. handleFeedback(row) {
  855. // 加载反馈附件
  856. this.docFeedback.id = row.id;
  857. this.docFeedback.queryParams.pId = row.id
  858. this.docFeedback.pId = row.id
  859. this.getFileListFeedback();
  860. // 清空导师反馈内容
  861. this.detailFeedback = null;
  862. // 清空表格数据
  863. this.tableData = [];
  864. let feedback1 = {};
  865. feedback1.planId = row.id;
  866. feedback1.questionId = 1;
  867. let feedback2 = {};
  868. feedback2.planId = row.id;
  869. feedback2.questionId = 2;
  870. let feedback3 = {};
  871. feedback3.planId = row.id;
  872. feedback3.questionId = 3;
  873. let answerObj1 = {};
  874. let answerObj2 = {};
  875. let answerObj3 = {};
  876. // 获取问题和答案
  877. getAnswer(feedback1).then(response => {
  878. let data = response.data;
  879. if (data != null) {
  880. answerObj1 = { id: 1, question: data.question, answer: data.answer};
  881. }
  882. return getAnswer(feedback2);
  883. }).then(response => {
  884. let data = response.data;
  885. if (data != null) {
  886. answerObj2 = { id: 2, question: data.question, answer: data.answer};
  887. }
  888. return getAnswer(feedback3);
  889. }).then(response => {
  890. let data = response.data;
  891. if (data != null) {
  892. answerObj3 = { id: 3, question: data.question, answer: data.answer};
  893. this.tableData.push(answerObj1);
  894. this.tableData.push(answerObj2);
  895. this.tableData.push(answerObj3);
  896. }
  897. // 获取导师反馈内容
  898. return getFeedbackByPlanId(row.id);
  899. }).then(response => {
  900. if (response.data != null) {
  901. let data = response.data;
  902. this.detailFeedback = data.mentorFeedback;
  903. }
  904. this.feedbackDialog.title = row.staffName + row.plantName + "学习情况详情";
  905. this.feedbackDialog.planId = row.id;
  906. this.feedbackDialog.studyState = row.studyState;
  907. this.feedbackDialog.open = true;
  908. });
  909. },
  910. /** 单元格样式 */
  911. tableCellStyle(row, column, rowIndex, columnIndex) {
  912. if (row.column.label === "实际完成日期" && row.row.dateOfCompletion > row.row.endDate) {
  913. return "background: #FFEEEE"
  914. }
  915. },
  916. /** 学习状态字典翻译 */
  917. studyStateFormat(row, column) {
  918. return this.selectDictLabel(this.studyStateOptions, row.studyState);
  919. },
  920. /** 文件下载处理 */
  921. handleDownload(row) {
  922. var name = row.fileName;
  923. var url = row.fileUrl;
  924. var suffix = url.substring(url.lastIndexOf("."), url.length);
  925. const a = document.createElement('a');
  926. a.setAttribute('download', name);
  927. a.setAttribute('target', '_blank');
  928. a.setAttribute('href', process.env.VUE_APP_BASE_API + url);
  929. a.click();
  930. },
  931. openPdf() {
  932. window.open(this.pdf.pdfUrl);//path是文件的全路径地址
  933. },
  934. handleSee(row) {
  935. this.pdf.open = true;
  936. this.pdf.title = row.fileName;
  937. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl;
  938. },
  939. /** 汇报附件参数初始化 */
  940. initFileList(id) {
  941. this.doc.queryParams.pId = id
  942. this.doc.pId = id
  943. this.getFileList()
  944. // this.$nextTick(() => {
  945. // this.$refs.doc.clearFiles()
  946. // })
  947. },
  948. getFileList() {
  949. allFileList(this.doc.queryParams).then(response => {
  950. this.doc.commonfileList = response;
  951. });
  952. },
  953. getFileListFeedback() {
  954. allFileList(this.docFeedback.queryParams).then(response => {
  955. this.docFeedback.commonfileList = response;
  956. });
  957. },
  958. /** 附件上传中处理 */
  959. handleFileDocProgress(event, file, fileList) {
  960. this.doc.file = file;
  961. this.doc.isUploading = true;
  962. },
  963. handleFileDocProgressFeedback(event, file, fileList) {
  964. this.docFeedback.file = file;
  965. this.docFeedback.isUploading = true;
  966. },
  967. /** 附件上传成功处理 */
  968. handleFileDocSuccess(response, file, fileList) {
  969. this.doc.isUploading = false;
  970. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  971. this.getFileList()
  972. },
  973. handleFileDocSuccessFeedback(response, file, fileList) {
  974. this.docMentorFeedback.isUploading = false;
  975. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  976. this.getFileListFeedback()
  977. },
  978. /** 删除按钮操作 */
  979. handleDeleteDoc(row) {
  980. const ids = row.id || this.ids;
  981. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  982. confirmButtonText: this.$t('确定'),
  983. cancelButtonText: this.$t('取消'),
  984. type: "warning"
  985. }).then(function() {
  986. return delCommonfile(ids);
  987. }).then(() => {
  988. this.getFileList()
  989. this.msgSuccess(this.$t('删除成功'));
  990. })
  991. },
  992. /** 邀请导师 */
  993. handleInvite() {
  994. let updateParams = {};
  995. updateParams.id = this.feedbackId;
  996. updateParams.meetingDate = this.meetingDate;
  997. // 修改会议日期
  998. updateFeedback(updateParams);
  999. for (let i = 0; i < this.mentorOptionsArray.length; i++) {
  1000. let feedback = {};
  1001. feedback.parentId = this.feedbackId; // 设置父级id
  1002. feedback.feedbackYear = this.queryParams.feedbackYear;
  1003. feedback.feedbackSeason = this.queryParams.feedbackSeason;
  1004. feedback.feedbackType = 3;
  1005. feedback.mentorId = this.mentorOptionsArray[i];
  1006. feedback.successorId = this.queryParams.successorId;
  1007. getFeedbackByParams(feedback).then(response => {
  1008. let data = response.data;
  1009. if (data == null) {
  1010. // 新增受邀导师反馈记录
  1011. addFeedback(feedback);
  1012. }
  1013. });
  1014. // 发送邮件提醒受邀导师
  1015. }
  1016. // 刷新标签列表
  1017. this.msgSuccess("邀请成功,邮件已发送");
  1018. },
  1019. /** 查询专项培训反馈列表 */
  1020. getList() {
  1021. this.loading = true;
  1022. listPlanSeasonal(this.queryParams).then(response => {
  1023. this.dataList = response.rows;
  1024. this.total = response.total;
  1025. this.loading = false;
  1026. });
  1027. },
  1028. // 取消按钮
  1029. cancel() {
  1030. this.open = false;
  1031. this.reset();
  1032. },
  1033. // 表单重置
  1034. reset() {
  1035. this.form = {
  1036. id: null,
  1037. feedbackType: null,
  1038. mentorId: null,
  1039. successorId: null,
  1040. successorName: null,
  1041. parentId: null,
  1042. planId: null,
  1043. feedbackYear: null,
  1044. feedbackSeason: null,
  1045. feedbackMonth: null,
  1046. successorFeedback: null,
  1047. mentorFeedback: null,
  1048. feedbackScore: null,
  1049. feedbackStatus: 0,
  1050. meetingDate: null
  1051. };
  1052. this.resetForm("form");
  1053. },
  1054. /** 搜索按钮操作 */
  1055. handleQuery() {
  1056. this.queryParams.pageNum = 1;
  1057. this.getList();
  1058. },
  1059. /** 重置按钮操作 */
  1060. resetQuery() {
  1061. this.resetForm("queryForm");
  1062. this.handleQuery();
  1063. },
  1064. // 多选框选中数据
  1065. handleSelectionChange(selection) {
  1066. this.ids = selection.map(item => item.id)
  1067. this.single = selection.length!==1
  1068. this.multiple = !selection.length
  1069. },
  1070. }
  1071. };
  1072. </script>
  1073. <style scoped>
  1074. .question{
  1075. margin: 20px 0px;
  1076. padding-left: 20px;
  1077. }
  1078. .answer{
  1079. padding-bottom: 10px;
  1080. padding-left: 40px;
  1081. }
  1082. h3{
  1083. margin: 20px 0px;
  1084. }
  1085. </style>