index.vue 60 KB

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