index.vue 52 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409
  1. <template>
  2. <div class="app-container">
  3. <!-- 搜索栏 -->
  4. <el-form :inline="true" v-if="isMentor">
  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" v-if="isMentor">
  47. <el-select
  48. size="small"
  49. v-model="queryParams.successorId"
  50. placeholder="请选择学员"
  51. style="width:200px"
  52. >
  53. <el-option
  54. v-for="successor in this.successorOptions"
  55. :key="successor.key"
  56. :label="successor.value"
  57. :value="successor.key"
  58. ></el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="年" prop="feedbackYear">
  62. <el-date-picker
  63. v-model="queryParams.feedbackYearTemp"
  64. placeholder="请选择年"
  65. clearable
  66. type="year"
  67. size="small"
  68. @keyup.enter.native="handleQuery"
  69. @change="yearFormateter"
  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. :lazy="true"
  101. >
  102. <div v-if="item.name == activeName">
  103. <!-- 培养计划总表 -->
  104. <el-table
  105. v-loading="loading"
  106. :data="dataList"
  107. @selection-change="handleSelectionChange"
  108. ref="feedbackListSeasonalTable"
  109. border
  110. :cell-style="tableCellStyle"
  111. >
  112. <el-table-column label="培养内容" align="center" prop="plantName" width="600px"/>
  113. <el-table-column label="开始日期" align="center" prop="startDate"/>
  114. <el-table-column label="结束日期" align="center" prop="endDate"/>
  115. <el-table-column label="实际完成日期" align="center" prop="dateOfCompletion"/>
  116. <el-table-column label="学习状态" align="center" prop="studyState" :formatter="studyStateFormat"/>
  117. <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
  118. <template slot-scope="scope">
  119. <el-button
  120. size="mini"
  121. type="text"
  122. icon="el-icon-chat-dot-round"
  123. v-hasPermi="['spec:plan:edit']"
  124. @click="handleFeedback(scope.row)"
  125. >详情</el-button>
  126. </template>
  127. </el-table-column>
  128. </el-table>
  129. <!-- 汇报附件 -->
  130. <div>
  131. <h3>汇报展示PPT</h3>
  132. <el-upload
  133. v-if="!isMentor"
  134. ref="doc"
  135. :headers="doc.headers"
  136. class="upload-demo"
  137. :action="doc.url + '?pType=' + doc.pType + '&pId=' + doc.pId"
  138. :disabled="doc.isUploading"
  139. :on-progress="handleFileDocProgress"
  140. :on-success="handleFileDocSuccess"
  141. :auto-upload="true"
  142. multiple
  143. :limit="3">
  144. <el-button size="small" type="primary" style="margin-bottom:10px;">点击上传</el-button>
  145. </el-upload>
  146. <el-table :data="doc.commonfileList" border style="width:600px;">
  147. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  148. <template slot-scope="scope">
  149. <a class="link-type" @click="handleDownload(scope.row)">
  150. <span>{{ scope.row.fileName }}</span>
  151. </a>
  152. </template>
  153. </el-table-column>
  154. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  155. <template slot-scope="scope">
  156. <el-button
  157. v-if="scope.row.fileName.endsWith('pdf')"
  158. size="mini"
  159. type="text"
  160. icon="el-icon-view"
  161. @click="handleSee(scope.row)"
  162. >{{ $t('预览') }}</el-button>
  163. <el-button
  164. size="mini"
  165. type="text"
  166. icon="el-icon-download"
  167. @click="handleDownload(scope.row)"
  168. >{{ $t('下载') }}</el-button>
  169. <el-button
  170. v-if="!isMentor"
  171. size="mini"
  172. type="text"
  173. icon="el-icon-delete"
  174. @click="handleDeleteDoc(scope.row)"
  175. >{{ $t('删除') }}</el-button>
  176. </template>
  177. </el-table-column>
  178. </el-table>
  179. </div>
  180. <!-- 问卷 -->
  181. <div v-if="isMentor">
  182. <div style="display:inline-block;width:40%;">
  183. <h3 style="margin-bottom:0px;">学员表现</h3>
  184. <div class="question">
  185. 1. 学员的现场汇报精神面貌如何?
  186. </div>
  187. <div class="answer">
  188. <el-radio-group v-model="radio1" size="small">
  189. <el-radio label="1">优秀</el-radio>
  190. <el-radio label="2">良好</el-radio>
  191. <el-radio label="3">一般</el-radio>
  192. <el-radio label="4">基本合格</el-radio>
  193. </el-radio-group>
  194. </div>
  195. <div class="question">
  196. 2. 学员的现场汇报语言表达如何?
  197. </div>
  198. <div class="answer">
  199. <el-radio-group v-model="radio2" size="small">
  200. <el-radio label="1">优秀</el-radio>
  201. <el-radio label="2">良好</el-radio>
  202. <el-radio label="3">一般</el-radio>
  203. <el-radio label="4">基本合格</el-radio>
  204. </el-radio-group>
  205. </div>
  206. <div class="question">
  207. 3. 学员的现场汇报逻辑思维如何?
  208. </div>
  209. <div class="answer">
  210. <el-radio-group v-model="radio3" size="small">
  211. <el-radio label="1">优秀</el-radio>
  212. <el-radio label="2">良好</el-radio>
  213. <el-radio label="3">一般</el-radio>
  214. <el-radio label="4">基本合格</el-radio>
  215. </el-radio-group>
  216. </div>
  217. <h3 style="margin-bottom:0px;">汇报材料及内容</h3>
  218. <div class="question">
  219. 4. 汇报材料准备是否充分,汇报材料是否紧贴本季学习内容?
  220. </div>
  221. <div class="answer">
  222. <el-radio-group v-model="radio4" size="small">
  223. <el-radio label="1">充分</el-radio>
  224. <el-radio label="2">比较充分</el-radio>
  225. <el-radio label="3">一般</el-radio>
  226. <el-radio label="4">基本合格</el-radio>
  227. </el-radio-group>
  228. </div>
  229. <div class="question">
  230. 5. 汇报内容是否符合学习材料(SOP或者程序)的要求?
  231. </div>
  232. <div class="answer">
  233. <el-radio-group v-model="radio5" size="small">
  234. <el-radio label="1">完全符合</el-radio>
  235. <el-radio label="2">基本符合</el-radio>
  236. <el-radio label="3">一般</el-radio>
  237. <el-radio label="4">基本合格</el-radio>
  238. </el-radio-group>
  239. </div>
  240. <div class="question">
  241. 6. 学员对本季的学习内容、学习目标及学习结果的阐述是否具体、完整、准确?
  242. </div>
  243. <div class="answer">
  244. <el-radio-group v-model="radio6" size="small">
  245. <el-radio label="1">非常全面</el-radio>
  246. <el-radio label="2">全面</el-radio>
  247. <el-radio label="3">一般</el-radio>
  248. <el-radio label="4">基本合格</el-radio>
  249. </el-radio-group>
  250. </div>
  251. <div class="question">
  252. 7. 学员本季汇报内容较上次是否有所提升?
  253. </div>
  254. <div class="answer">
  255. <el-radio-group v-model="radio7" size="small">
  256. <el-radio label="1">进步明显</el-radio>
  257. <el-radio label="2">略有提升</el-radio>
  258. <el-radio label="3">一般</el-radio>
  259. <el-radio label="4">基本合格</el-radio>
  260. </el-radio-group>
  261. </div>
  262. </div>
  263. <div style="display:inline-block;width:40%;">
  264. <div class="question">
  265. 8. 汇报内容针对本季学习范围是否存在明显的汇报漏项或者不足?
  266. </div>
  267. <div class="answer">
  268. <el-radio-group v-model="radio8" size="small">
  269. <el-radio label="1">完全不存在</el-radio>
  270. <el-radio label="2">基本不存在</el-radio>
  271. <el-radio label="3">无明显存在</el-radio>
  272. <el-radio label="4">存在</el-radio>
  273. </el-radio-group>
  274. </div>
  275. <div class="question">
  276. 9. 学员的本季汇报内容是否结合岗位工作实际?
  277. </div>
  278. <div class="answer">
  279. <el-radio-group v-model="radio9" size="small">
  280. <el-radio label="1">紧密结合</el-radio>
  281. <el-radio label="2">结合</el-radio>
  282. <el-radio label="3">一般</el-radio>
  283. <el-radio label="4">基本合格</el-radio>
  284. </el-radio-group>
  285. </div>
  286. <div class="question">
  287. 10. 学员在实际工作中是否能够学有所用?
  288. </div>
  289. <div class="answer">
  290. <el-radio-group v-model="radio10" size="small">
  291. <el-radio label="1">灵活运用</el-radio>
  292. <el-radio label="2">基本运用</el-radio>
  293. <el-radio label="3">尝试运用</el-radio>
  294. <el-radio label="4">基本合格</el-radio>
  295. </el-radio-group>
  296. </div>
  297. <div class="question">
  298. 11. 汇报内容对目标岗位建设是否能起到启发促进作用?
  299. </div>
  300. <div class="answer">
  301. <el-radio-group v-model="radio11" size="small">
  302. <el-radio label="1">极有建设性</el-radio>
  303. <el-radio label="2">建设性</el-radio>
  304. <el-radio label="3">一般</el-radio>
  305. <el-radio label="4">基本合格</el-radio>
  306. </el-radio-group>
  307. </div>
  308. <div class="question">
  309. 12. 汇报内容对于装置及公司的人才培养计划是否能起到建设性促进作用?
  310. </div>
  311. <div class="answer">
  312. <el-radio-group v-model="radio12" size="small">
  313. <el-radio label="1">极有建设性</el-radio>
  314. <el-radio label="2">建设性</el-radio>
  315. <el-radio label="3">一般</el-radio>
  316. <el-radio label="4">基本合格</el-radio>
  317. </el-radio-group>
  318. </div>
  319. <div class="question">
  320. 13. 汇报内容是否有对装置生产、管理、建设提出合理化建议?
  321. </div>
  322. <div class="answer">
  323. <el-radio-group v-model="radio13" size="small">
  324. <el-radio label="1">有可采用的合理化建议</el-radio>
  325. <el-radio label="2">有可行性合理化建议</el-radio>
  326. <el-radio label="3">有合理化建议</el-radio>
  327. <el-radio label="4">无</el-radio>
  328. </el-radio-group>
  329. </div>
  330. <div class="question">
  331. 14. 汇报内容是否对下期培训提出新的培训需求?
  332. </div>
  333. <div class="answer">
  334. <el-radio-group v-model="radio14" size="small">
  335. <el-radio label="1">有计划外需求</el-radio>
  336. <el-radio label="2">有计划内需求</el-radio>
  337. <el-radio label="3">有需求</el-radio>
  338. <el-radio label="4">无具体需求</el-radio>
  339. </el-radio-group>
  340. </div>
  341. </div>
  342. </div>
  343. <!-- 导师反馈 -->
  344. <div>
  345. <h3>导师反馈</h3>
  346. <div v-if="showSaveButton && ( staffId == activeName )">
  347. <editor
  348. :min-height="300"
  349. v-model="mentorFeedback"
  350. />
  351. </div>
  352. <span
  353. v-if="!showSaveButton && ( staffId != activeName )"
  354. v-html="mentorFeedback"
  355. style="overflow:scroll; display:block; border:1px solid #CCCCCC; height: 300px; padding:15px;font-family: Helvetica, Arial, sans-serif; font-size: 13px;"
  356. >
  357. </span>
  358. </div>
  359. <!-- 保存按钮 -->
  360. <div style="text-align:center;margin: 20px auto;">
  361. <el-button
  362. size="medium"
  363. type="success"
  364. @click="handleSave"
  365. v-if="showSaveButton && ( staffId == activeName )"
  366. >
  367. 保存
  368. </el-button>
  369. </div>
  370. </div>
  371. </el-tab-pane>
  372. </el-tabs>
  373. <!-- 详情对话框 -->
  374. <el-dialog v-dialogDrag :title="feedbackDialog.title" :visible.sync="feedbackDialog.open" width="800px" append-to-body>
  375. <div style="width:700px; margin:0px auto;">
  376. <h3 style="margin-bottom:20px;">学员心得</h3>
  377. <el-table :data="tableData" border style="width: 100%">
  378. <el-table-column prop="id" label="编号" width="50"></el-table-column>
  379. <el-table-column prop="question" label="问题" width="250"></el-table-column>
  380. <el-table-column prop="answer" label="答案"></el-table-column>
  381. </el-table>
  382. <el-table :data="docFeedback.commonfileList" border>
  383. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  384. <template slot-scope="scope">
  385. <a class="link-type" @click="handleDownload(scope.row)">
  386. <span>{{ scope.row.fileName }}</span>
  387. </a>
  388. </template>
  389. </el-table-column>
  390. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  391. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  392. <el-table-column :label="$t('操作')" align="center" width="120" class-name="small-padding fixed-width">
  393. <template slot-scope="scope">
  394. <el-button
  395. v-if="scope.row.fileName.endsWith('pdf')"
  396. size="mini"
  397. type="text"
  398. icon="el-icon-view"
  399. @click="handleSee(scope.row)"
  400. >{{ $t('预览') }}</el-button>
  401. <el-button
  402. size="mini"
  403. type="text"
  404. icon="el-icon-download"
  405. @click="handleDownload(scope.row)"
  406. >{{ $t('下载') }}</el-button>
  407. </template>
  408. </el-table-column>
  409. </el-table>
  410. <el-form v-if="detailFeedback != null">
  411. <h3 style="margin-top:30px;margin-bottom:20px;">导师反馈</h3>
  412. <el-form-item>
  413. <p v-html="detailFeedback" style="border:1px solid #DFE6EC; overflow:scroll; height:200px;"/>
  414. </el-form-item>
  415. </el-form>
  416. </div>
  417. </el-dialog>
  418. </div>
  419. </template>
  420. <script>
  421. import { getAnswer, addAnswer, updateAnswer, listAnswer } from "@/api/training/spec/answer";
  422. import { listScore, getScore, delScore, addScore, updateScore, exportScore, importTemplate} from "@/api/training/spec/score";
  423. import { allFileList, delCommonfile } from "@/api/common/commonfile";
  424. import { addFeedback, getFeedbackByParams, listInvitedSuccessor, updateFeedback, listFeedback, getFeedbackByPlanId } from "@/api/training/spec/feedback";
  425. import { listMentors } from "@/api/training/spec/successor";
  426. import { listSuccessorsByMentorId, listPlanSeasonal } from "@/api/training/spec/plan";
  427. import { getToken } from "@/utils/auth";
  428. import Treeselect from "@riophae/vue-treeselect";
  429. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  430. import Editor from '@/components/Editor';
  431. import { listMentors2, getStaffId, isMentor } from "@/api/plant/staffmgr";
  432. export default {
  433. name: "SeasonalFeedback",
  434. components: { Treeselect, Editor },
  435. data() {
  436. return {
  437. // 父级反馈导师id
  438. mentorId: null,
  439. // 是否为第一次搜索
  440. isFirstSearch: true,
  441. // 当前用户id
  442. staffId: null,
  443. // 是否为导师
  444. isMentor: null,
  445. // 显示保存按钮
  446. showSaveButton: false,
  447. // 导师标签
  448. mentorTabs: [],
  449. // 详情对话框表格数据
  450. tableData: [],
  451. // 反馈id
  452. feedbackId: null,
  453. // 父级反馈id
  454. parentId: null,
  455. // 会议日期快捷选项
  456. pickerOptions: {
  457. shortcuts: [{
  458. text: '今天',
  459. onClick(picker) {
  460. picker.$emit('pick', new Date());
  461. }
  462. }, {
  463. text: '昨天',
  464. onClick(picker) {
  465. const date = new Date();
  466. date.setTime(date.getTime() - 3600 * 1000 * 24);
  467. picker.$emit('pick', date);
  468. }
  469. }, {
  470. text: '一周前',
  471. onClick(picker) {
  472. const date = new Date();
  473. date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
  474. picker.$emit('pick', date);
  475. }
  476. }, {
  477. text: '一周后',
  478. onClick(picker) {
  479. const date = new Date();
  480. date.setTime(date.getTime() + 3600 * 1000 * 24 * 7);
  481. picker.$emit('pick', date);
  482. }
  483. }]
  484. },
  485. // 会议日期
  486. meetingDate: null,
  487. // 学习状态字典
  488. studyStateOptions: [],
  489. // 汇报展示附件参数
  490. doc: { // 反馈附件
  491. file: "",
  492. // 是否显示弹出层(报告附件)
  493. open: false,
  494. // 弹出层标题(报告附件)
  495. title: "",
  496. // 是否禁用上传
  497. isUploading: false,
  498. // 是否更新已经存在的用户数据
  499. updateSupport: 0,
  500. // 报告附件上传位置编号
  501. ids: 0,
  502. // 设置上传的请求头部
  503. headers: { Authorization: "Bearer " + getToken() },
  504. // 上传的地址
  505. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  506. commonfileList: null,
  507. queryParams: {
  508. pId: null,
  509. pType: 'docSeasonal'
  510. },
  511. pType: 'docSeasonal',
  512. pId: null
  513. },
  514. // 培养计划总表数据
  515. dataList: [],
  516. // 首选标签页
  517. activeName: null,
  518. // 学员下拉列表
  519. successorOptions: [],
  520. // 导师下拉列表
  521. mentorOptions: [],
  522. // 导师数组
  523. mentorOptionsArray: [],
  524. // 包含导师id的查询对象
  525. queryObject: {
  526. mentorStaffId: ""
  527. },
  528. // 导师反馈内容
  529. mentorFeedback: "", // 季度反馈内容
  530. detailFeedback: "", // 计划详情反馈内容
  531. // 反馈对话框参数
  532. feedbackDialog: {
  533. id: 0,
  534. // 是否显示弹出层(报告附件)
  535. open: false,
  536. // 弹出层标题(报告附件)
  537. title: ""
  538. },
  539. // 问卷单选框
  540. radio1: '',
  541. radio2: '',
  542. radio3: '',
  543. radio4: '',
  544. radio5: '',
  545. radio6: '',
  546. radio7: '',
  547. radio8: '',
  548. radio9: '',
  549. radio10: '',
  550. radio11: '',
  551. radio12: '',
  552. radio13: '',
  553. radio14: '',
  554. // 报告附件参数
  555. doc: { // 季度汇报附件
  556. file: "",
  557. // 是否显示弹出层(报告附件)
  558. open: false,
  559. // 弹出层标题(报告附件)
  560. title: "",
  561. // 是否禁用上传
  562. isUploading: false,
  563. // 是否更新已经存在的用户数据
  564. updateSupport: 0,
  565. // 报告附件上传位置编号
  566. ids: 0,
  567. // 设置上传的请求头部
  568. headers: { Authorization: "Bearer " + getToken() },
  569. // 上传的地址
  570. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  571. commonfileList: null,
  572. queryParams: {
  573. pId: null,
  574. pType: 'plan'
  575. },
  576. pType: 'plan',
  577. pId: null
  578. },
  579. docFeedback: { // 反馈附件
  580. file: "",
  581. // 是否显示弹出层(报告附件)
  582. open: false,
  583. // 弹出层标题(报告附件)
  584. title: "",
  585. // 是否禁用上传
  586. isUploading: false,
  587. // 是否更新已经存在的用户数据
  588. updateSupport: 0,
  589. // 报告附件上传位置编号
  590. ids: 0,
  591. // 设置上传的请求头部
  592. headers: { Authorization: "Bearer " + getToken() },
  593. // 上传的地址
  594. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  595. commonfileList: null,
  596. queryParams: {
  597. pId: null,
  598. pType: 'docFeedback'
  599. },
  600. pType: 'docFeedback',
  601. pId: null
  602. },
  603. // 标签页选中项
  604. activeName: 'zhu',
  605. // 遮罩层
  606. loading: true,
  607. // 选中数组
  608. ids: [],
  609. // 非单个禁用
  610. single: true,
  611. // 非多个禁用
  612. multiple: true,
  613. // 显示搜索条件
  614. showSearch: true,
  615. // 总条数
  616. total: 0,
  617. // 专项培训反馈表格数据
  618. feedbackList: [],
  619. // 弹出层标题
  620. title: "",
  621. // 部门树选项
  622. deptOptions: undefined,
  623. clientHeight:300,
  624. // 是否显示弹出层
  625. open: false,
  626. // 用户导入参数
  627. upload: {
  628. // 是否显示弹出层(用户导入)
  629. open: false,
  630. // 弹出层标题(用户导入)
  631. title: "",
  632. // 是否禁用上传
  633. isUploading: false,
  634. // 是否更新已经存在的用户数据
  635. updateSupport: 0,
  636. // 设置上传的请求头部
  637. headers: { Authorization: "Bearer " + getToken() },
  638. // 上传的地址
  639. url: process.env.VUE_APP_BASE_API + "/spec/feedback/importData"
  640. },
  641. // 查询参数
  642. queryParams: {
  643. pageNum: 1,
  644. pageSize: 100,
  645. feedbackType: null,
  646. mentorId: null,
  647. successorId: null,
  648. successorName: null,
  649. parentId: null,
  650. planId: null,
  651. feedbackYear: null,
  652. feedbackYearTemp: null,
  653. feedbackSeason: null,
  654. feedbackMonth: null,
  655. successorFeedback: null,
  656. mentorFeedback: null,
  657. feedbackScore: null,
  658. feedbackStatus: null,
  659. meetingDate: null
  660. },
  661. // 表单参数
  662. form: {},
  663. // 表单校验
  664. rules: {
  665. }
  666. };
  667. },
  668. watch: {
  669. },
  670. created() {
  671. //设置表格高度对应屏幕高度
  672. this.$nextTick(() => {
  673. this.clientHeight = document.body.clientHeight -250
  674. })
  675. // 获取学习状态字典
  676. this.getDicts("st_study_state").then(response => {
  677. this.studyStateOptions = response.data;
  678. });
  679. // 初始化页面数据
  680. this.initPageData();
  681. },
  682. methods: {
  683. /** 设置最后截止日期 */
  684. resetLastDay() {
  685. // 最后截止日期
  686. let lastDay = new Date(this.meetingDate);
  687. lastDay.setTime(lastDay.getTime() + 3600 * 1000 * 24 * 7);
  688. // 当前日期
  689. let now = new Date();
  690. if (lastDay > now) {
  691. // 导师可修改反馈内容
  692. this.showSaveButton = true;
  693. // 学员可查看导师反馈内容
  694. } else {
  695. // 导师不可修改反馈内容
  696. this.showSaveButton = false;
  697. // 学员不可查看导师反馈内容
  698. }
  699. },
  700. /** 标签页切换事件 */
  701. handleTabClick(tab) {
  702. this.activeName = tab.name;
  703. if (this.isMentor) {
  704. // 清空问卷
  705. this.radio1 = null;
  706. this.radio2 = null;
  707. this.radio3 = null;
  708. this.radio4 = null;
  709. this.radio5 = null;
  710. this.radio6 = null;
  711. this.radio7 = null;
  712. this.radio8 = null;
  713. this.radio9 = null;
  714. this.radio10 = null;
  715. this.radio11 = null;
  716. this.radio12 = null;
  717. this.radio13 = null;
  718. this.radio14 = null;
  719. }
  720. // 清空导师反馈内容
  721. this.mentorFeedback = "";
  722. // 查询参数
  723. let feedback = {};
  724. feedback.mentorId = tab.name;
  725. feedback.successorId = this.queryParams.successorId;
  726. feedback.feedbackYear = this.queryParams.feedbackYear;
  727. feedback.feedbackSeason = this.queryParams.feedbackSeason;
  728. // 是子节点
  729. if (this.mentorId != tab.name) {
  730. // 设置父节点id
  731. feedback.parentId = this.parentId;
  732. }
  733. // 根据标签页导师id获取反馈id
  734. getFeedbackByParams(feedback).then(response => {
  735. let data = response.data;
  736. // 设置反馈id为当前tab导师反馈id
  737. this.feedbackId = data.id;
  738. // 刷新导师反馈内容
  739. this.mentorFeedback = data.mentorFeedback;
  740. if (this.isMentor) {
  741. // 刷新问卷
  742. listAnswer( { feedbackId: this.feedbackId } ).then(response => {
  743. let data = response.rows;
  744. for (let i = 0; i < data.length; i++) {
  745. if (data[i].questionId == "4") { this.radio1 = data[i].answer; }
  746. if (data[i].questionId == "5") { this.radio2 = data[i].answer; }
  747. if (data[i].questionId == "6") { this.radio3 = data[i].answer; }
  748. if (data[i].questionId == "7") { this.radio4 = data[i].answer; }
  749. if (data[i].questionId == "8") { this.radio5 = data[i].answer; }
  750. if (data[i].questionId == "9") { this.radio6 = data[i].answer; }
  751. if (data[i].questionId == "10") { this.radio7 = data[i].answer; }
  752. if (data[i].questionId == "11") { this.radio8 = data[i].answer; }
  753. if (data[i].questionId == "12") { this.radio9 = data[i].answer; }
  754. if (data[i].questionId == "13") { this.radio10 = data[i].answer; }
  755. if (data[i].questionId == "14") { this.radio11 = data[i].answer; }
  756. if (data[i].questionId == "15") { this.radio12 = data[i].answer; }
  757. if (data[i].questionId == "16") { this.radio13 = data[i].answer; }
  758. if (data[i].questionId == "17") { this.radio14 = data[i].answer; }
  759. }
  760. window.scrollTo(0, 0);
  761. });
  762. }
  763. });
  764. },
  765. /** 初始化页面数据 */
  766. initPageData() {
  767. // 获取当前日期
  768. let date = new Date();
  769. // 搜索条件默认为当年、当季度
  770. this.queryParams.feedbackYear = date.getFullYear().toString();
  771. this.queryParams.feedbackYearTemp = date.getFullYear().toString();
  772. this.queryParams.feedbackSeason = ( ( date.getMonth() + 2 ) / 3 ).toString();
  773. // 获取当前用户id
  774. getStaffId().then(response => {
  775. this.staffId = response.data;
  776. // 判断当前用户是否为导师
  777. return isMentor();
  778. }).then(response => {
  779. this.isMentor = response.data;
  780. if (this.isMentor) { // 当前用户是导师
  781. // ====================获取导师下拉列表====================
  782. listMentors2().then(response => {
  783. let mentorList = response.data;
  784. for (let i = 0; i < mentorList.length; i++) {
  785. if (mentorList[i].staffid!=this.staffId) {
  786. let mentor = {};
  787. mentor.key = mentorList[i].staffid;
  788. mentor.value = mentorList[i].name;
  789. this.mentorOptions.push(mentor);
  790. }
  791. }
  792. });
  793. // ====================获取当前导师的学员列表====================
  794. listSuccessorsByMentorId(this.queryObject).then(response => {
  795. let data = response.data;
  796. for (let i = 0; i < data.length; i++) {
  797. this.successorOptions.push( { key: data[i].staffId, value: data[i].staffName } );
  798. }
  799. // ====================获取当前导师作为受邀导师的学员列表====================
  800. return listInvitedSuccessor(null);
  801. })
  802. .then(response => {
  803. let data = response.data;
  804. for (let i = 0; i < data.length; i++) {
  805. this.successorOptions.push( { key: data[i].successorId, value: data[i].successorName } );
  806. }
  807. if (this.successorOptions.length != 0) {
  808. // 默认选中列表中第一个学员
  809. this.queryParams.successorId = this.successorOptions[0].key;
  810. this.getList();
  811. }
  812. // 获取当前学员当年当季度反馈id
  813. return getFeedbackByParams({
  814. successorId: this.queryParams.successorId,
  815. feedbackYear: this.queryParams.feedbackYear,
  816. feedbackSeason: this.queryParams.feedbackSeason
  817. });
  818. })
  819. .then(response => {
  820. let data = response.data;
  821. this.feedbackId = data.id;
  822. this.mentorId = data.mentorId;
  823. this.parentId = data.id;
  824. this.meetingDate = data.meetingDate;
  825. this.resetLastDay();
  826. this.mentorFeedback = data.mentorFeedback;
  827. // 初始化汇报附件
  828. this.initFileList(data.id);
  829. // ====================初始化导师标签页====================
  830. this.activeName = data.mentorId;
  831. this.mentorTabs.push({ name: data.mentorId, title: data.mentorName});
  832. listFeedback( { parentId: data.id } ).then(response => {
  833. let data = response.rows;
  834. for (let i = 0; i < data.length; i++) {
  835. this.mentorTabs.push({ name: data[i].mentorId, title: data[i].mentorName});
  836. }
  837. });
  838. // ====================获取问卷答案====================
  839. listAnswer( { feedbackId: this.feedbackId } ).then(response => {
  840. let data = response.rows;
  841. for (let i = 0; i < data.length; i++) {
  842. if (data[i].questionId == "4") { this.radio1 = data[i].answer; }
  843. if (data[i].questionId == "5") { this.radio2 = data[i].answer; }
  844. if (data[i].questionId == "6") { this.radio3 = data[i].answer; }
  845. if (data[i].questionId == "7") { this.radio4 = data[i].answer; }
  846. if (data[i].questionId == "8") { this.radio5 = data[i].answer; }
  847. if (data[i].questionId == "9") { this.radio6 = data[i].answer; }
  848. if (data[i].questionId == "10") { this.radio7 = data[i].answer; }
  849. if (data[i].questionId == "11") { this.radio8 = data[i].answer; }
  850. if (data[i].questionId == "12") { this.radio9 = data[i].answer; }
  851. if (data[i].questionId == "13") { this.radio10 = data[i].answer; }
  852. if (data[i].questionId == "14") { this.radio11 = data[i].answer; }
  853. if (data[i].questionId == "15") { this.radio12 = data[i].answer; }
  854. if (data[i].questionId == "16") { this.radio13 = data[i].answer; }
  855. if (data[i].questionId == "17") { this.radio14 = data[i].answer; }
  856. }
  857. window.scrollTo(0, 0);
  858. });
  859. });
  860. } else { // 当前用户是学员
  861. this.queryParams.successorId = this.staffId;
  862. this.getList();
  863. // 获取当前学员当年当季度反馈id
  864. getFeedbackByParams({
  865. successorId: this.queryParams.successorId,
  866. feedbackYear: this.queryParams.feedbackYear,
  867. feedbackSeason: this.queryParams.feedbackSeason
  868. }).then(response => {
  869. let data = response.data;
  870. this.feedbackId = data.id;
  871. this.parentId = data.id;
  872. this.meetingDate = data.meetingDate;
  873. this.resetLastDay();
  874. this.mentorFeedback = data.mentorFeedback;
  875. // 初始化汇报附件
  876. this.initFileList(data.id);
  877. // ====================初始化导师标签页====================
  878. this.activeName = data.mentorId;
  879. this.mentorTabs.push({ name: data.mentorId, title: data.mentorName});
  880. listFeedback( { parentId: data.id } ).then(response => {
  881. let data = response.rows;
  882. for (let i = 0; i < data.length; i++) {
  883. this.mentorTabs.push({ name: data[i].mentorId, title: data[i].mentorName});
  884. }
  885. });
  886. });
  887. }
  888. });
  889. },
  890. /** 问卷判空 */
  891. isEmpty() {
  892. 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 ];
  893. let isEmpty = false;
  894. for (let i = 0; i < radioArray.length; i++) {
  895. if (radioArray[i] == "") {
  896. isEmpty = true;
  897. }
  898. }
  899. return isEmpty;
  900. },
  901. /** 邀请表格判空 */
  902. isInvitationFormEmpty() {
  903. if (this.meetingDate == "" || this.mentorOptionsArray.length == 0) {
  904. return true;
  905. } else {
  906. return false;
  907. }
  908. },
  909. /** 计算导师评分 */
  910. calcFeedbackScore() {
  911. let mentorFeedbackScore = 0; // 本导师评分
  912. let invitedMentorFeedbackScoreSum = 0; // 受邀导师总分
  913. let invitedMentorFeedbackScoreAvg = 0; // 受邀导师平均分
  914. let invitedMentors = 0; // 受邀导师人数
  915. let overallScore = 0; // 季度平均分
  916. let feedbackId = null; // 本导师反馈id
  917. // 获取问题答案列表
  918. listAnswer( { feedbackId: this.feedbackId } )
  919. .then(response => {
  920. let data = response.rows;
  921. // 计算导师评分
  922. let total = 0; // 总分
  923. for (let i = 0; i < data.length; i++) {
  924. if(data[i].answer == "1") {
  925. total += 100;
  926. }
  927. else if(data[i].answer == "2") {
  928. total += 75;
  929. }
  930. else if(data[i].answer == "3") {
  931. total += 50;
  932. }
  933. else if(data[i].answer == "4") {
  934. total += 25;
  935. }
  936. }
  937. let avg = total / 14; // 平均分
  938. // 更新当前导师评分
  939. return updateFeedback( { id: this.feedbackId, feedbackScore: avg } );
  940. })
  941. .then(() => {
  942. // 获取本导师反馈
  943. return getFeedbackByParams({
  944. successorId: this.queryParams.successorId,
  945. feedbackYear: this.queryParams.feedbackYear,
  946. feedbackSeason: this.queryParams.feedbackSeason
  947. })
  948. })
  949. .then(response => {
  950. // 设置本导师反馈id
  951. feedbackId = response.data.id;
  952. // 设置导师评分
  953. mentorFeedbackScore = response.data.feedbackScore;
  954. // 获取受邀导师列表
  955. return listFeedback( { parentId: feedbackId } );
  956. })
  957. .then(response => {
  958. let data = response.rows;
  959. for (let i = 0; i < data.length; i++) {
  960. if (data[i].feedbackScore != null) {
  961. invitedMentorFeedbackScoreSum += Number(data[i].feedbackScore);
  962. invitedMentors += 1;
  963. }
  964. }
  965. // 计算受邀导师平均分
  966. if (invitedMentorFeedbackScoreSum == 0) { // 受邀导师未评分
  967. invitedMentorFeedbackScoreAvg = 0;
  968. } else {
  969. // 受邀导师平均分 = 总分 / 人数
  970. invitedMentorFeedbackScoreAvg = invitedMentorFeedbackScoreSum / invitedMentors;
  971. }
  972. // 计算季度平均分
  973. if (invitedMentorFeedbackScoreSum == 0) { // 受邀导师未评分
  974. overallScore = mentorFeedbackScore;
  975. } else if (mentorFeedbackScore == 0) { // 本导师未评分
  976. overallScore = invitedMentorFeedbackScoreAvg;
  977. } else {
  978. // 季度平均分 = 本导师评分 * 60% + 受邀导师平均分 * 40%
  979. overallScore = mentorFeedbackScore * 0.6 + invitedMentorFeedbackScoreAvg * 0.4;
  980. }
  981. // 更新季度平均分
  982. updateFeedback({ id: feedbackId, overallScore: overallScore });
  983. // 更新继任者评分表数据
  984. getScore({
  985. successorId: this.queryParams.successorId,
  986. feedbackYear: this.queryParams.feedbackYear,
  987. feedbackSeason: this.queryParams.feedbackSeason
  988. }).then(response => {
  989. let data = response.data;
  990. let score = {};
  991. if (this.queryParams.feedbackSeason == "1") {
  992. score.quarterOne = overallScore;
  993. }
  994. if (this.queryParams.feedbackSeason == "2") {
  995. score.quarterTwo = overallScore;
  996. }
  997. if (this.queryParams.feedbackSeason == "3") {
  998. score.quarterThree = overallScore;
  999. }
  1000. if (this.queryParams.feedbackSeason == "4") {
  1001. score.quarterFour = overallScore;
  1002. }
  1003. if (data != null) {
  1004. score.id = data.id;
  1005. updateScore(score);
  1006. } else {
  1007. score.successorId = this.queryParams.successorId;
  1008. score.feedbackYear = this.queryParams.feedbackYear;
  1009. score.feedbackSeason = this.queryParams.feedbackSeason;
  1010. addScore(score);
  1011. }
  1012. });
  1013. });
  1014. },
  1015. /** 保存反馈问题 */
  1016. saveAnswer(questionId, answer) {
  1017. let answerObj = {};
  1018. answerObj.feedbackId = this.feedbackId;
  1019. answerObj.questionId = questionId;
  1020. getAnswer(answerObj).then(response => {
  1021. let data = response.data;
  1022. answerObj.answer = answer;
  1023. if (data != null) {
  1024. if (response.answer == data.answer) { // 答案一致
  1025. return;
  1026. } else { // 答案不一致
  1027. answerObj.id = data.id;
  1028. updateAnswer(answerObj).then(response => {
  1029. // 计算导师评分
  1030. this.calcFeedbackScore();
  1031. });
  1032. }
  1033. } else {
  1034. addAnswer(answerObj).then(response => {
  1035. // 计算导师评分
  1036. this.calcFeedbackScore();
  1037. });
  1038. }
  1039. });
  1040. },
  1041. /** 保存导师反馈内容 */
  1042. saveMentorFeedback() {
  1043. let feedback = {};
  1044. feedback.id = this.feedbackId;
  1045. feedback.mentorFeedback = this.mentorFeedback;
  1046. updateFeedback(feedback);
  1047. },
  1048. /** 保存按钮处理 */
  1049. handleSave() {
  1050. // 问卷判空
  1051. if (this.isEmpty()) {
  1052. this.$message.error('问卷答案不能为空')
  1053. return;
  1054. }
  1055. 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 ];
  1056. let questionArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
  1057. // 保存问卷内容
  1058. for (let i = 0; i < radioArray.length; i++) {
  1059. this.saveAnswer(questionArray[i]+3, radioArray[i]);
  1060. }
  1061. // 保存导师反馈内容
  1062. this.saveMentorFeedback();
  1063. this.msgSuccess("保存成功");
  1064. },
  1065. /** 培养计划详情处理 */
  1066. handleFeedback(row) {
  1067. // 加载反馈附件
  1068. this.docFeedback.id = row.id;
  1069. this.docFeedback.queryParams.pId = row.id
  1070. this.docFeedback.pId = row.id
  1071. this.getFileListFeedback();
  1072. // 清空导师反馈内容
  1073. this.detailFeedback = null;
  1074. // 清空表格数据
  1075. this.tableData = [];
  1076. let feedback1 = {};
  1077. feedback1.planId = row.id;
  1078. feedback1.questionId = 1;
  1079. let feedback2 = {};
  1080. feedback2.planId = row.id;
  1081. feedback2.questionId = 2;
  1082. let feedback3 = {};
  1083. feedback3.planId = row.id;
  1084. feedback3.questionId = 3;
  1085. let answerObj1 = {};
  1086. let answerObj2 = {};
  1087. let answerObj3 = {};
  1088. // 获取问题和答案
  1089. getAnswer(feedback1).then(response => {
  1090. let data = response.data;
  1091. if (data != null) {
  1092. answerObj1 = { id: 1, question: data.question, answer: data.answer};
  1093. }
  1094. return getAnswer(feedback2);
  1095. }).then(response => {
  1096. let data = response.data;
  1097. if (data != null) {
  1098. answerObj2 = { id: 2, question: data.question, answer: data.answer};
  1099. }
  1100. return getAnswer(feedback3);
  1101. }).then(response => {
  1102. let data = response.data;
  1103. if (data != null) {
  1104. answerObj3 = { id: 3, question: data.question, answer: data.answer};
  1105. this.tableData.push(answerObj1);
  1106. this.tableData.push(answerObj2);
  1107. this.tableData.push(answerObj3);
  1108. }
  1109. // 获取导师反馈内容
  1110. return getFeedbackByPlanId(row.id);
  1111. }).then(response => {
  1112. if (response.data != null) {
  1113. let data = response.data;
  1114. this.detailFeedback = data.mentorFeedback;
  1115. }
  1116. this.feedbackDialog.title = row.staffName + row.plantName + "学习情况详情";
  1117. this.feedbackDialog.planId = row.id;
  1118. this.feedbackDialog.studyState = row.studyState;
  1119. this.feedbackDialog.open = true;
  1120. });
  1121. },
  1122. /** 单元格样式 */
  1123. tableCellStyle(row, column, rowIndex, columnIndex) {
  1124. if (row.column.label === "实际完成日期" && row.row.dateOfCompletion > row.row.endDate) {
  1125. return "background: #FFEEEE"
  1126. }
  1127. },
  1128. /** 学习状态字典翻译 */
  1129. studyStateFormat(row, column) {
  1130. return this.selectDictLabel(this.studyStateOptions, row.studyState);
  1131. },
  1132. /** 文件下载处理 */
  1133. handleDownload(row) {
  1134. var name = row.fileName;
  1135. var url = row.fileUrl;
  1136. var suffix = url.substring(url.lastIndexOf("."), url.length);
  1137. const a = document.createElement('a');
  1138. a.setAttribute('download', name);
  1139. a.setAttribute('target', '_blank');
  1140. a.setAttribute('href', process.env.VUE_APP_BASE_API + url);
  1141. a.click();
  1142. },
  1143. openPdf() {
  1144. window.open(this.pdf.pdfUrl);//path是文件的全路径地址
  1145. },
  1146. handleSee(row) {
  1147. this.pdf.open = true;
  1148. this.pdf.title = row.fileName;
  1149. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl;
  1150. },
  1151. /** 汇报附件参数初始化 */
  1152. initFileList(id) {
  1153. this.doc.queryParams.pId = id
  1154. this.doc.pId = id
  1155. this.getFileList()
  1156. // this.$nextTick(() => {
  1157. // this.$refs.doc.clearFiles()
  1158. // })
  1159. },
  1160. getFileList() {
  1161. allFileList(this.doc.queryParams).then(response => {
  1162. this.doc.commonfileList = response;
  1163. });
  1164. },
  1165. getFileListFeedback() {
  1166. allFileList(this.docFeedback.queryParams).then(response => {
  1167. this.docFeedback.commonfileList = response;
  1168. });
  1169. },
  1170. /** 附件上传中处理 */
  1171. handleFileDocProgress(event, file, fileList) {
  1172. this.doc.file = file;
  1173. this.doc.isUploading = true;
  1174. },
  1175. handleFileDocProgressFeedback(event, file, fileList) {
  1176. this.docFeedback.file = file;
  1177. this.docFeedback.isUploading = true;
  1178. },
  1179. /** 附件上传成功处理 */
  1180. handleFileDocSuccess(response, file, fileList) {
  1181. this.doc.isUploading = false;
  1182. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1183. this.getFileList()
  1184. },
  1185. handleFileDocSuccessFeedback(response, file, fileList) {
  1186. this.docMentorFeedback.isUploading = false;
  1187. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  1188. this.getFileListFeedback()
  1189. },
  1190. /** 删除按钮操作 */
  1191. handleDeleteDoc(row) {
  1192. const ids = row.id || this.ids;
  1193. this.$confirm(this.$t('是否确认删除?'), this.$t('警告'), {
  1194. confirmButtonText: this.$t('确定'),
  1195. cancelButtonText: this.$t('取消'),
  1196. type: "warning"
  1197. }).then(function() {
  1198. return delCommonfile(ids);
  1199. }).then(() => {
  1200. this.getFileList()
  1201. this.msgSuccess(this.$t('删除成功'));
  1202. })
  1203. },
  1204. /** 邀请导师 */
  1205. handleInvite() {
  1206. if (this.isInvitationFormEmpty()) {
  1207. this.$message.error('会议日期和受邀导师导师不能为空')
  1208. return;
  1209. }
  1210. let updateParams = {};
  1211. updateParams.id = this.feedbackId;
  1212. let date = new Date(this.meetingDate);
  1213. date.setTime( date.getTime() + 3600 * 1000 * 24 );
  1214. updateParams.meetingDate = date;
  1215. this.meetingDate = date;
  1216. updateParams.id = this.parentId;
  1217. // 修改会议日期
  1218. updateFeedback(updateParams);
  1219. for (let i = 0; i < this.mentorOptionsArray.length; i++) {
  1220. let feedback = {};
  1221. feedback.parentId = this.feedbackId; // 设置父级id
  1222. feedback.feedbackYear = this.queryParams.feedbackYear;
  1223. feedback.feedbackSeason = this.queryParams.feedbackSeason;
  1224. feedback.feedbackType = 3;
  1225. feedback.mentorId = this.mentorOptionsArray[i];
  1226. feedback.successorId = this.queryParams.successorId;
  1227. getFeedbackByParams(feedback).then(response => {
  1228. let data = response.data;
  1229. if (data == null) { // 该导师没有受邀
  1230. // 新增受邀导师反馈记录
  1231. addFeedback(feedback).then(response => {
  1232. getFeedbackByParams({
  1233. successorId: this.queryParams.successorId,
  1234. feedbackYear: this.queryParams.feedbackYear,
  1235. feedbackSeason: this.queryParams.feedbackSeason,
  1236. }).then(response => {
  1237. let data = response.data;
  1238. let firstMentor = {};
  1239. firstMentor.name = data.mentorId;
  1240. firstMentor.title = data.mentorName;
  1241. listFeedback( { parentId: data.id } ).then(response => {
  1242. let data = response.rows;
  1243. let mentorTabsTemp = [];
  1244. this.mentorTabs = [];
  1245. this.activeName = firstMentor.name;
  1246. mentorTabsTemp.push(firstMentor);
  1247. for (let i = 0; i < data.length; i++) {
  1248. mentorTabsTemp.push({ name: data[i].mentorId, title: data[i].mentorName});
  1249. }
  1250. this.mentorTabs = mentorTabsTemp;
  1251. });
  1252. });
  1253. });
  1254. }
  1255. });
  1256. // 发送邮件提醒受邀导师
  1257. }
  1258. this.msgSuccess("邀请成功,邮件已发送");
  1259. },
  1260. /** 查询专项培训反馈列表 */
  1261. getList() {
  1262. this.loading = true;
  1263. listPlanSeasonal(this.queryParams).then(response => {
  1264. this.dataList = response.rows;
  1265. this.total = response.total;
  1266. this.loading = false;
  1267. });
  1268. },
  1269. // 取消按钮
  1270. cancel() {
  1271. this.open = false;
  1272. this.reset();
  1273. },
  1274. // 表单重置
  1275. reset() {
  1276. this.form = {
  1277. id: null,
  1278. feedbackType: null,
  1279. mentorId: null,
  1280. successorId: null,
  1281. successorName: null,
  1282. parentId: null,
  1283. planId: null,
  1284. feedbackYear: null,
  1285. feedbackSeason: null,
  1286. feedbackMonth: null,
  1287. successorFeedback: null,
  1288. mentorFeedback: null,
  1289. feedbackScore: null,
  1290. feedbackStatus: 0,
  1291. meetingDate: null
  1292. };
  1293. this.resetForm("form");
  1294. },
  1295. yearFormateter() {
  1296. this.isFirstSearch = false;
  1297. },
  1298. /** 搜索按钮操作 */
  1299. handleQuery() {
  1300. this.queryParams.feedbackYear = this.queryParams.feedbackYearTemp;
  1301. if (this.isFirstSearch) {
  1302. this.queryParams.feedbackYear = this.queryParams.feedbackYearTemp;
  1303. } else {
  1304. this.queryParams.feedbackYear = this.queryParams.feedbackYearTemp.getFullYear();
  1305. }
  1306. this.queryParams.pageNum = 1;
  1307. this.getList();
  1308. // 清空问卷
  1309. this.radio1 = null;
  1310. this.radio2 = null;
  1311. this.radio3 = null;
  1312. this.radio4 = null;
  1313. this.radio5 = null;
  1314. this.radio6 = null;
  1315. this.radio7 = null;
  1316. this.radio8 = null;
  1317. this.radio9 = null;
  1318. this.radio10 = null;
  1319. this.radio11 = null;
  1320. this.radio12 = null;
  1321. this.radio13 = null;
  1322. this.radio14 = null;
  1323. // 清空导师反馈内容
  1324. this.mentorFeedback = "";
  1325. // 清空会议日期
  1326. this.meetingDate = null;
  1327. getFeedbackByParams({
  1328. successorId: this.queryParams.successorId,
  1329. feedbackYear: this.queryParams.feedbackYear,
  1330. feedbackSeason: this.queryParams.feedbackSeason,
  1331. }).then(response => {
  1332. let data = response.data;
  1333. this.feedbackId = data.id;
  1334. this.parentId = data.id;
  1335. this.mentorId = data.mentorId;
  1336. this.meetingDate = data.meetingDate;
  1337. this.resetLastDay();
  1338. this.mentorFeedback = data.mentorFeedback;
  1339. window.scrollTo(0, 0);
  1340. // 刷新汇报附件
  1341. this.initFileList(data.id);
  1342. // 初始化导师标签页
  1343. this.mentorTabs = [];
  1344. this.activeName = data.mentorId;
  1345. this.mentorTabs.push({ name: data.mentorId, title: data.mentorName});
  1346. listFeedback( { parentId: data.id } ).then(response => {
  1347. let data = response.rows;
  1348. for (let i = 0; i < data.length; i++) {
  1349. this.mentorTabs.push({ name: data[i].mentorId, title: data[i].mentorName});
  1350. }
  1351. });
  1352. // 刷新问卷
  1353. listAnswer( { feedbackId: this.feedbackId } ).then(response => {
  1354. let data = response.rows;
  1355. for (let i = 0; i < data.length; i++) {
  1356. if (data[i].questionId == "4") { this.radio1 = data[i].answer; }
  1357. if (data[i].questionId == "5") { this.radio2 = data[i].answer; }
  1358. if (data[i].questionId == "6") { this.radio3 = data[i].answer; }
  1359. if (data[i].questionId == "7") { this.radio4 = data[i].answer; }
  1360. if (data[i].questionId == "8") { this.radio5 = data[i].answer; }
  1361. if (data[i].questionId == "9") { this.radio6 = data[i].answer; }
  1362. if (data[i].questionId == "10") { this.radio7 = data[i].answer; }
  1363. if (data[i].questionId == "11") { this.radio8 = data[i].answer; }
  1364. if (data[i].questionId == "12") { this.radio9 = data[i].answer; }
  1365. if (data[i].questionId == "13") { this.radio10 = data[i].answer; }
  1366. if (data[i].questionId == "14") { this.radio11 = data[i].answer; }
  1367. if (data[i].questionId == "15") { this.radio12 = data[i].answer; }
  1368. if (data[i].questionId == "16") { this.radio13 = data[i].answer; }
  1369. if (data[i].questionId == "17") { this.radio14 = data[i].answer; }
  1370. }
  1371. window.scrollTo(0, 0);
  1372. });
  1373. });
  1374. },
  1375. /** 重置按钮操作 */
  1376. resetQuery() {
  1377. this.resetForm("queryForm");
  1378. this.handleQuery();
  1379. },
  1380. // 多选框选中数据
  1381. handleSelectionChange(selection) {
  1382. this.ids = selection.map(item => item.id)
  1383. this.single = selection.length!==1
  1384. this.multiple = !selection.length
  1385. },
  1386. }
  1387. };
  1388. </script>
  1389. <style scoped>
  1390. .question{
  1391. margin: 20px 0px;
  1392. padding-left: 20px;
  1393. }
  1394. .answer{
  1395. padding-bottom: 10px;
  1396. padding-left: 40px;
  1397. }
  1398. h3{
  1399. margin: 20px 0px;
  1400. }
  1401. </style>