index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. <template>
  2. <div class="app-container">
  3. <el-tabs type="border-card">
  4. <el-tab-pane label="月度反馈">
  5. <!-- 搜索栏 -->
  6. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
  7. <el-form-item label="年" prop="feedbackYear" label-width="35px">
  8. <el-input
  9. v-model="queryParams.feedbackYear"
  10. placeholder="请输入年"
  11. clearable
  12. size="small"
  13. @keyup.enter.native="handleQuery"
  14. />
  15. </el-form-item>
  16. <el-form-item label="月" prop="feedbackMonth" label-width="35px">
  17. <el-input
  18. v-model="queryParams.feedbackMonth"
  19. placeholder="请输入月"
  20. clearable
  21. size="small"
  22. @keyup.enter.native="handleQuery"
  23. />
  24. </el-form-item>
  25. <el-form-item label="学员编号" prop="successorId" label-width="80px">
  26. <el-input
  27. v-model="queryParams.successorId"
  28. placeholder="请输入学员编号"
  29. clearable
  30. size="small"
  31. @keyup.enter.native="handleQuery"
  32. />
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  36. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  37. <el-button icon="el-icon-refresh" size="mini" @click="refresh()">刷新</el-button>
  38. </el-form-item>
  39. </el-form>
  40. <!-- 列表 -->
  41. <el-table
  42. :span-method="spanMethod"
  43. v-loading="loading"
  44. :data="feedbackList"
  45. @selection-change="handleSelectionChange"
  46. :height="clientHeight"
  47. border
  48. >
  49. <el-table-column label="学员编号" align="center" :show-overflow-tooltip="true" prop="successorId"/>
  50. <el-table-column label="时间" align="center" :show-overflow-tooltip="true" width="120">
  51. <template slot-scope="scope">
  52. <span>{{scope.row.feedbackYear}}年{{scope.row.feedbackMonth}}月</span>
  53. </template>
  54. </el-table-column>
  55. <el-table-column label="培训内容" align="center" :show-overflow-tooltip="true" prop="plantName"/>
  56. <el-table-column label="开始日期" align="center" :show-overflow-tooltip="true" width="120" prop="startDate"/>
  57. <el-table-column label="结束日期" align="center" :show-overflow-tooltip="true" width="120" prop="endDate"/>
  58. <el-table-column label="实际完成日期" align="center" :show-overflow-tooltip="true" width="120" prop="dateOfCompletion"/>
  59. <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyStatus"/>
  60. <el-table-column label="学员反馈" align="center" prop="successorFeedback" :show-overflow-tooltip="true"/>
  61. <el-table-column label="导师反馈" align="center" prop="mentorFeedback" :show-overflow-tooltip="true"/>
  62. <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  63. <template slot-scope="scope">
  64. <el-button
  65. size="mini"
  66. type="text"
  67. icon="el-icon-edit"
  68. @click="handleUpdate(scope.row)"
  69. v-hasPermi="['spec:feedback:edit']"
  70. v-if="scope.row.mentorFeedback==null"
  71. >反馈</el-button>
  72. <el-button
  73. size="mini"
  74. type="text"
  75. icon="el-icon-edit"
  76. @click="handleUpdate(scope.row)"
  77. v-hasPermi="['spec:feedback:edit']"
  78. v-if="scope.row.mentorFeedback!=null"
  79. >修改</el-button>
  80. </template>
  81. </el-table-column>
  82. </el-table>
  83. <!-- 分页 -->
  84. <pagination
  85. v-show="total>0"
  86. :total="total"
  87. :page.sync="queryParams.pageNum"
  88. :limit.sync="queryParams.pageSize"
  89. @pagination="getList"
  90. />
  91. <!-- 添加或修改对话框 -->
  92. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  93. <el-form ref="form" :model="form" :rules="rules">
  94. <el-form-item prop="successorFeedback">
  95. <el-input type="textarea" rows="6" v-model="form.mentorFeedback" placeholder="请输入反馈内容" />
  96. </el-form-item>
  97. </el-form>
  98. <div slot="footer" class="dialog-footer">
  99. <el-button type="primary" @click="submitForm">确 定</el-button>
  100. <el-button @click="cancel">取 消</el-button>
  101. </div>
  102. </el-dialog>
  103. </el-tab-pane>
  104. <el-tab-pane label="季度反馈">
  105. <!-- 搜索栏 -->
  106. <el-form :model="queryParams2" ref="queryForm2" :inline="true" v-show="showSearch">
  107. <el-form-item label="年" prop="feedbackYear" label-width="35px">
  108. <el-input
  109. v-model="queryParams2.feedbackYear"
  110. placeholder="请输入年"
  111. clearable
  112. size="small"
  113. @keyup.enter.native="handleQuery2"
  114. />
  115. </el-form-item>
  116. <el-form-item label="季度" prop="feedbackSeason">
  117. <el-input
  118. v-model="queryParams2.feedbackSeason"
  119. placeholder="请输入季度"
  120. clearable
  121. size="small"
  122. @keyup.enter.native="handleQuery2"
  123. label-width="50px"
  124. />
  125. </el-form-item>
  126. <el-form-item label="学员编号" prop="feedbackMonth" label-width="80px">
  127. <el-input
  128. v-model="queryParams2.successorId"
  129. placeholder="请输入学员编号"
  130. clearable
  131. size="small"
  132. @keyup.enter.native="handleQuery2"
  133. />
  134. </el-form-item>
  135. <el-form-item>
  136. <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery2">搜索</el-button>
  137. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery2">重置</el-button>
  138. <el-button icon="el-icon-refresh" size="mini" @click="refresh2()">刷新</el-button>
  139. </el-form-item>
  140. </el-form>
  141. <!-- 列表 -->
  142. <el-table
  143. :span-method="spanMethod"
  144. v-loading="loading"
  145. :data="feedbackListSeasonal"
  146. @selection-change="handleSelectionChange"
  147. :height="clientHeight"
  148. ref="feedbackListSeasonalTable"
  149. border
  150. >
  151. <el-table-column label="学员编号" align="center" :show-overflow-tooltip="true" prop="successorId"/>
  152. <el-table-column label="时间" align="center" :show-overflow-tooltip="true" width="200">
  153. <template slot-scope="scope">
  154. <span>{{scope.row.feedbackYear}}年{{scope.row.feedbackSeason}}季度</span>
  155. </template>
  156. </el-table-column>
  157. <el-table-column label="培训内容" align="center" :show-overflow-tooltip="true" prop="plantName"/>
  158. <el-table-column label="开始日期" align="center" :show-overflow-tooltip="true" width="120" prop="startDate"/>
  159. <el-table-column label="结束日期" align="center" :show-overflow-tooltip="true" width="120" prop="endDate"/>
  160. <el-table-column label="实际完成日期" align="center" :show-overflow-tooltip="true" width="120" prop="dateOfCompletion"/>
  161. <el-table-column label="学习状态" align="center" :show-overflow-tooltip="true" width="120" prop="studyStatus"/>
  162. <el-table-column label="学员反馈" align="center" prop="successorFeedback" :show-overflow-tooltip="true"/>
  163. <el-table-column label="导师反馈" align="center" prop="mentorFeedback" :show-overflow-tooltip="true"/>
  164. <el-table-column label="操作" align="center" fixed="right" width="120" class-name="small-padding fixed-width">
  165. <template slot-scope="scope">
  166. <el-button
  167. size="mini"
  168. type="text"
  169. icon="el-icon-edit"
  170. @click="handleUpdate(scope.row)"
  171. v-hasPermi="['spec:feedback:edit']"
  172. v-if="scope.row.mentorFeedback==null"
  173. >反馈</el-button>
  174. <el-button
  175. size="mini"
  176. type="text"
  177. icon="el-icon-edit"
  178. @click="handleUpdate(scope.row)"
  179. v-hasPermi="['spec:feedback:edit']"
  180. v-if="scope.row.mentorFeedback!=null"
  181. >修改</el-button>
  182. </template>
  183. </el-table-column>
  184. </el-table>
  185. <!-- 分页 -->
  186. <!-- <pagination
  187. v-show="total>0"
  188. :total="total"
  189. :page.sync="queryParams.pageNum"
  190. :limit.sync="queryParams.pageSize"
  191. @pagination="getList"
  192. /> -->
  193. <!-- 添加或修改对话框 -->
  194. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  195. <el-form ref="form" :model="form" :rules="rules">
  196. <el-form-item prop="successorFeedback">
  197. <el-input type="textarea" rows="6" v-model="form.mentorFeedback" placeholder="请输入反馈内容" />
  198. </el-form-item>
  199. </el-form>
  200. <div slot="footer" class="dialog-footer">
  201. <el-button type="primary" @click="submitForm">确 定</el-button>
  202. <el-button @click="cancel">取 消</el-button>
  203. </div>
  204. </el-dialog>
  205. <!-- 报告附件对话框 -->
  206. <el-dialog v-dialogDrag :title="doc.title" :visible.sync="doc.open" width="700px" append-to-body>
  207. <el-table :data="doc.commonfileList" border>
  208. <el-table-column :label="$t('文件名')" align="center" prop="fileName" :show-overflow-tooltip="true">
  209. <template slot-scope="scope">
  210. <a class="link-type" @click="handleDownload(scope.row)">
  211. <span>{{ scope.row.fileName }}</span>
  212. </a>
  213. </template>
  214. </el-table-column>
  215. <el-table-column :label="$t('大小(Kb)')" align="center" prop="fileSize" :show-overflow-tooltip="true" width="80" />
  216. <el-table-column :label="$t('上传人')" align="center" prop="creator" :show-overflow-tooltip="true" width="120"/>
  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')"
  221. size="mini"
  222. type="text"
  223. icon="el-icon-view"
  224. @click="handleSee(scope.row)"
  225. >{{ $t('预览') }}</el-button>
  226. <el-button
  227. size="mini"
  228. type="text"
  229. icon="el-icon-download"
  230. @click="handleDownload(scope.row)"
  231. >{{ $t('下载') }}</el-button>
  232. <el-button
  233. size="mini"
  234. type="text"
  235. icon="el-icon-delete"
  236. @click="handleDeleteDoc(scope.row)"
  237. >{{ $t('删除') }}</el-button>
  238. </template>
  239. </el-table-column>
  240. </el-table>
  241. <el-dialog v-dialogDrag :title="pdf.title" :visible.sync="pdf.open" width="1300px" append-to-body>
  242. <div style="margin-top: -60px;float: right;margin-right: 40px;">
  243. <el-button size="mini" type="text" @click="openPdf">{{$t('新页面打开PDF')}}</el-button></div>
  244. <div style="margin-top: -30px">
  245. <iframe :src="pdf.pdfUrl" frameborder="0" width="100%" height="700px"></iframe>
  246. </div>
  247. </el-dialog>
  248. <div slot="footer" class="dialog-footer">
  249. <el-button @click="doc.open = false">{{ $t('返 回') }}</el-button>
  250. </div>
  251. </el-dialog>
  252. </el-tab-pane>
  253. <el-tab-pane label="受邀反馈"></el-tab-pane>
  254. </el-tabs>
  255. </div>
  256. </template>
  257. <script>
  258. import { listMentorMonthlyFeedback, listMentorSeasonalFeedback, getFeedback, delFeedback, addFeedback, updateFeedback, exportFeedback, importTemplate} from "@/api/training/spec/feedback";
  259. import { treeselect } from "@/api/system/dept";
  260. import { getToken } from "@/utils/auth";
  261. import Treeselect from "@riophae/vue-treeselect";
  262. import "@riophae/vue-treeselect/dist/vue-treeselect.css";
  263. export default {
  264. name: "Feedback",
  265. components: { Treeselect },
  266. data() {
  267. return {
  268. // 标签页选中项
  269. activeName: 'first',
  270. // 遮罩层
  271. loading: true,
  272. // 选中数组
  273. ids: [],
  274. // 非单个禁用
  275. single: true,
  276. // 非多个禁用
  277. multiple: true,
  278. // 显示搜索条件
  279. showSearch: true,
  280. // 总条数
  281. total: 0,
  282. // 专项培训反馈表格数据
  283. feedbackList: [],
  284. // 专项培训季度反馈表格数据
  285. feedbackListSeasonal: [],
  286. // 弹出层标题
  287. title: "",
  288. // 部门树选项
  289. deptOptions: undefined,
  290. clientHeight:300,
  291. // 是否显示弹出层
  292. open: false,
  293. // 用户导入参数
  294. upload: {
  295. // 是否显示弹出层(用户导入)
  296. open: false,
  297. // 弹出层标题(用户导入)
  298. title: "",
  299. // 是否禁用上传
  300. isUploading: false,
  301. // 是否更新已经存在的用户数据
  302. updateSupport: 0,
  303. // 设置上传的请求头部
  304. headers: { Authorization: "Bearer " + getToken() },
  305. // 上传的地址
  306. url: process.env.VUE_APP_BASE_API + "/spec/feedback/importData"
  307. },
  308. // 查询参数
  309. queryParams: {
  310. pageNum: 1,
  311. pageSize: 1000,
  312. feedbackType: null,
  313. mentorId: null,
  314. successorId: null,
  315. parentId: null,
  316. planId: null,
  317. feedbackYear: null,
  318. feedbackSeason: null,
  319. feedbackMonth: null,
  320. successorFeedback: null,
  321. mentorFeedback: null,
  322. feedbackScore: null,
  323. feedbackStatus: null,
  324. meetingDate: null
  325. },
  326. queryParams2: {
  327. pageNum: 1,
  328. pageSize: 1000,
  329. feedbackType: null,
  330. mentorId: null,
  331. successorId: null,
  332. parentId: null,
  333. planId: null,
  334. feedbackYear: null,
  335. feedbackSeason: null,
  336. feedbackMonth: null,
  337. successorFeedback: null,
  338. mentorFeedback: null,
  339. feedbackScore: null,
  340. feedbackStatus: null,
  341. meetingDate: null
  342. },
  343. // 表单参数
  344. form: {},
  345. form2: {},
  346. // 表单校验
  347. rules: {
  348. },
  349. //合并单元格参数
  350. spanArr: [],
  351. spanArr2: [],
  352. // 报告附件参数
  353. doc: {
  354. file: "",
  355. // 是否显示弹出层(报告附件)
  356. open: false,
  357. // 弹出层标题(报告附件)
  358. title: "",
  359. // 是否禁用上传
  360. isUploading: false,
  361. // 是否更新已经存在的用户数据
  362. updateSupport: 0,
  363. // 报告附件上传位置编号
  364. ids: 0,
  365. // 设置上传的请求头部
  366. headers: { Authorization: "Bearer " + getToken() },
  367. // 上传的地址
  368. url: process.env.VUE_APP_BASE_API + "/common/commonfile/uploadFile",
  369. commonfileList: null,
  370. queryParams: {
  371. pId: null,
  372. pType: 'plan'
  373. },
  374. pType: 'plan',
  375. pId: null
  376. },
  377. // pdf文件参数
  378. pdf : {
  379. title: '',
  380. pdfUrl: '',
  381. numPages: null,
  382. open: false,
  383. pageNum: 1,
  384. pageTotalNum: 1,
  385. loadedRatio: 0,
  386. },
  387. };
  388. },
  389. watch: {
  390. // 根据名称筛选部门树
  391. deptName(val) {
  392. this.$refs.tree.filter(val);
  393. }
  394. },
  395. created() {
  396. //设置表格高度对应屏幕高度
  397. this.$nextTick(() => {
  398. this.clientHeight = document.body.clientHeight -250
  399. })
  400. this.getList();
  401. this.getListSeasonal();
  402. this.getTreeselect();
  403. },
  404. methods: {
  405. // 合并单元格
  406. spanMethod({ row, column, rowIndex, columnIndex }) {
  407. // 按月合并单元格
  408. if (columnIndex === 1 || columnIndex === 7 || columnIndex === 8 || columnIndex === 9) {
  409. if (row.isFirstLine == 1) {
  410. return {
  411. rowspan: row.rowspan,
  412. colspan: 1
  413. };
  414. } else {
  415. return {
  416. rowspan: 0,
  417. colspan: 0
  418. };
  419. }
  420. }
  421. // 按人合并单元格
  422. if (columnIndex === 0) {
  423. if(this.spanArr[rowIndex]){
  424. return {
  425. rowspan:this.spanArr[rowIndex],
  426. colspan:1
  427. }
  428. }else{
  429. return {
  430. rowspan: 0,
  431. colspan: 0
  432. }
  433. }
  434. }
  435. },
  436. spanMethod2({ row, column, rowIndex, columnIndex }) {
  437. // 按月合并单元格
  438. if (columnIndex === 1 || columnIndex === 7 || columnIndex === 8 || columnIndex === 9) {
  439. if (row.isFirstLine == 1) {
  440. return {
  441. rowspan: row.rowspan,
  442. colspan: 1
  443. };
  444. } else {
  445. return {
  446. rowspan: 0,
  447. colspan: 0
  448. };
  449. }
  450. }
  451. // 按人合并单元格
  452. if (columnIndex === 0) {
  453. if(this.spanArr2[rowIndex]){
  454. return {
  455. rowspan:this.spanArr2[rowIndex],
  456. colspan:1
  457. }
  458. }else{
  459. return {
  460. rowspan: 0,
  461. colspan: 0
  462. }
  463. }
  464. }
  465. },
  466. // 刷新
  467. refresh() {
  468. // 保留检索条件
  469. this.getList(this.form);
  470. },
  471. refresh2() {
  472. // 保留检索条件
  473. this.getListSeasonal(this.form2);
  474. },
  475. // 标签页切换
  476. handleClick(tab, event) {
  477. console.log(tab, event);
  478. },
  479. /** 查询专项培训反馈列表 */
  480. getList() {
  481. this.loading = true;
  482. listMentorMonthlyFeedback(this.queryParams).then(response => {
  483. let dataList = [];
  484. let responseRows = response.rows;
  485. let rowCount = 0;
  486. for (let i = 0; i < responseRows.length; i++) {
  487. let planList = responseRows[i].planList;
  488. for (let j = 0; j < planList.length; j++) {
  489. rowCount = rowCount + 1;
  490. let data = {...planList[j]};
  491. data.id = responseRows[i].id;
  492. data.feedbackStatus = responseRows[i].feedbackStatus;
  493. data.feedbackYear = responseRows[i].feedbackYear;
  494. data.feedbackMonth = responseRows[i].feedbackMonth;
  495. data.mentorFeedback = responseRows[i].mentorFeedback;
  496. data.successorFeedback = responseRows[i].successorFeedback;
  497. data.successorId = responseRows[i].successorId;
  498. if (j == 0) { // 第一条计划
  499. data.isFirstLine = 1;
  500. data.rowspan = planList.length;
  501. } else {
  502. data.isFirstLine = 0;
  503. }
  504. dataList.push(data);
  505. }
  506. }
  507. let contactDot = 0;
  508. for (let i = 0; i < dataList.length; i++) {
  509. if (i == 0) {
  510. this.spanArr.push(1);
  511. } else {
  512. if(dataList[i].successorId === dataList[i-1].successorId){
  513. this.spanArr[contactDot] += 1;
  514. this.spanArr.push(0);
  515. }else{
  516. contactDot = i;
  517. this.spanArr.push(1);
  518. }
  519. }
  520. }
  521. this.feedbackList = dataList;
  522. this.total = response.total;
  523. this.loading = false;
  524. });
  525. },
  526. /** 查询专项培训季度反馈列表 */
  527. getListSeasonal() {
  528. this.loading = true;
  529. listMentorSeasonalFeedback(this.queryParams).then(response => {
  530. let dataList = [];
  531. let responseRows = response.rows;
  532. let rowCount = 0;
  533. for (let i = 0; i < responseRows.length; i++) {
  534. let planList = responseRows[i].planList;
  535. for (let j = 0; j < planList.length; j++) {
  536. rowCount = rowCount + 1;
  537. let data = {...planList[j]};
  538. data.id = responseRows[i].id;
  539. data.feedbackStatus = responseRows[i].feedbackStatus;
  540. data.feedbackYear = responseRows[i].feedbackYear;
  541. data.feedbackSeason = responseRows[i].feedbackSeason;
  542. data.mentorFeedback = responseRows[i].mentorFeedback;
  543. data.successorFeedback = responseRows[i].successorFeedback;
  544. data.successorId = responseRows[i].successorId;
  545. if (j == 0) { // 第一条计划
  546. data.isFirstLine = 1;
  547. data.rowspan = planList.length;
  548. } else {
  549. data.isFirstLine = 0;
  550. }
  551. dataList.push(data);
  552. }
  553. }
  554. let contactDot = 0;
  555. for (let i = 0; i < dataList.length; i++) {
  556. if (i == 0) {
  557. this.spanArr2.push(1);
  558. } else {
  559. if(dataList[i].successorId === dataList[i-1].successorId){
  560. this.spanArr2[contactDot] += 1;
  561. this.spanArr2.push(0);
  562. }else{
  563. contactDot = i;
  564. this.spanArr2.push(1);
  565. }
  566. }
  567. }
  568. console.log(dataList);
  569. this.feedbackListSeasonal = dataList;
  570. this.total = response.total;
  571. this.$nextTick(() => {
  572. this.$refs.feedbackListSeasonalTable.doLayout(); // 解决表格错位
  573. });
  574. this.loading = false;
  575. });
  576. },
  577. /** 文件下载处理 */
  578. handleDownload(row) {
  579. var name = row.fileName;
  580. var url = row.fileUrl;
  581. var suffix = url.substring(url.lastIndexOf("."), url.length);
  582. const a = document.createElement('a')
  583. a.setAttribute('download', name)
  584. a.setAttribute('target', '_blank')
  585. a.setAttribute('href', process.env.VUE_APP_BASE_API + url)
  586. a.click()
  587. },
  588. openPdf(){
  589. window.open(this.pdf.pdfUrl);//path是文件的全路径地址
  590. },
  591. handleSee (row){
  592. this.pdf.open =true
  593. this.pdf.title = row.fileName
  594. this.pdf.pdfUrl = process.env.VUE_APP_BASE_API +'/pdf/web/viewer.html?file=' + process.env.VUE_APP_BASE_API + row.fileUrl
  595. },
  596. /** 报告附件按钮操作 */
  597. handleDoc(row) {
  598. this.doc.id = row.id;
  599. this.doc.title = row.feedbackYear + "年" + row.feedbackSeason + "季度" + this.$t('学习汇报附件');
  600. this.doc.open = true;
  601. this.doc.queryParams.pId = row.id
  602. this.doc.pId = row.id
  603. this.getFileList()
  604. this.$nextTick(() => {
  605. this.$refs.doc.clearFiles()
  606. })
  607. },
  608. getFileList (){
  609. allFileList(this.doc.queryParams).then(response => {
  610. this.doc.commonfileList = response;
  611. });
  612. },
  613. /** 附件上传中处理 */
  614. handleFileDocProgress(event, file, fileList) {
  615. this.doc.file = file;
  616. this.doc.isUploading = true;
  617. },
  618. /** 附件上传成功处理 */
  619. handleFileDocSuccess(response, file, fileList) {
  620. this.doc.isUploading = false;
  621. this.$alert(response.msg, this.$t('导入结果'), { dangerouslyUseHTMLString: true });
  622. this.getFileList()
  623. },
  624. /** 查询部门下拉树结构 */
  625. getTreeselect() {
  626. treeselect().then(response => {
  627. this.deptOptions = response.data;
  628. });
  629. },
  630. // 取消按钮
  631. cancel() {
  632. this.open = false;
  633. this.reset();
  634. },
  635. // 表单重置
  636. reset() {
  637. this.form = {
  638. id: null,
  639. feedbackType: null,
  640. mentorId: null,
  641. successorId: null,
  642. parentId: null,
  643. planId: null,
  644. feedbackYear: null,
  645. feedbackSeason: null,
  646. feedbackMonth: null,
  647. successorFeedback: null,
  648. mentorFeedback: null,
  649. feedbackScore: null,
  650. feedbackStatus: 0,
  651. meetingDate: null
  652. };
  653. this.resetForm("form");
  654. },
  655. reset2() {
  656. this.form2 = {
  657. id: null,
  658. feedbackType: null,
  659. mentorId: null,
  660. successorId: null,
  661. parentId: null,
  662. planId: null,
  663. feedbackYear: null,
  664. feedbackSeason: null,
  665. feedbackMonth: null,
  666. successorFeedback: null,
  667. mentorFeedback: null,
  668. feedbackScore: null,
  669. feedbackStatus: 0,
  670. meetingDate: null
  671. };
  672. this.resetForm("form2");
  673. },
  674. /** 搜索按钮操作 */
  675. handleQuery() {
  676. this.queryParams.pageNum = 1;
  677. this.getList();
  678. },
  679. handleQuery2() {
  680. this.queryParams2.pageNum = 1;
  681. this.getListSeasonal();
  682. },
  683. /** 重置按钮操作 */
  684. resetQuery() {
  685. this.resetForm("queryForm");
  686. this.handleQuery();
  687. },
  688. resetQuery2() {
  689. this.resetForm("queryForm2");
  690. this.handleQuery2();
  691. },
  692. // 多选框选中数据
  693. handleSelectionChange(selection) {
  694. this.ids = selection.map(item => item.id)
  695. this.single = selection.length!==1
  696. this.multiple = !selection.length
  697. },
  698. /** 新增按钮操作 */
  699. handleAdd() {
  700. this.reset();
  701. this.open = true;
  702. this.title = "添加专项培训反馈";
  703. },
  704. /** 修改按钮操作 */
  705. handleUpdate(row) {
  706. this.reset();
  707. const id = row.id || this.ids
  708. getFeedback(id).then(response => {
  709. this.form = response.data;
  710. this.open = true;
  711. this.title = "导师反馈(" + row.successorId + " " + row.feedbackYear + "年" + row.feedbackMonth + "月)";
  712. });
  713. },
  714. /** 提交操作 */
  715. handleSubmit(row) {
  716. this.reset();
  717. const id = row.id || this.ids
  718. getFeedback(id).then(response => {
  719. this.form = response.data;
  720. this.form.feedbackStatus = 1;
  721. updateFeedback(this.form).then(response => {
  722. this.msgSuccess("提交成功");
  723. this.open = false;
  724. this.getList();
  725. });
  726. });
  727. },
  728. /** 提交按钮 */
  729. submitForm() {
  730. this.$refs["form"].validate(valid => {
  731. if (valid) {
  732. if (this.form.id != null) {
  733. updateFeedback(this.form).then(response => {
  734. this.msgSuccess("修改成功");
  735. this.open = false;
  736. this.getList();
  737. });
  738. } else {
  739. addFeedback(this.form).then(response => {
  740. this.msgSuccess("新增成功");
  741. this.open = false;
  742. this.getList();
  743. });
  744. }
  745. }
  746. });
  747. },
  748. /** 删除按钮操作 */
  749. handleDelete(row) {
  750. const ids = row.id || this.ids;
  751. this.$confirm('是否确认删除?', "警告", {
  752. confirmButtonText: "确定",
  753. cancelButtonText: "取消",
  754. type: "warning"
  755. }).then(function() {
  756. return delFeedback(ids);
  757. }).then(() => {
  758. this.getList();
  759. this.msgSuccess("删除成功");
  760. })
  761. },
  762. /** 导出按钮操作 */
  763. handleExport() {
  764. const queryParams = this.queryParams;
  765. this.$confirm('是否确认导出所有专项培训反馈数据项?', "警告", {
  766. confirmButtonText: "确定",
  767. cancelButtonText: "取消",
  768. type: "warning"
  769. }).then(function() {
  770. return exportFeedback(queryParams);
  771. }).then(response => {
  772. this.download(response.msg);
  773. })
  774. },
  775. /** 导入按钮操作 */
  776. handleImport() {
  777. this.upload.title = "用户导入";
  778. this.upload.open = true;
  779. },
  780. /** 下载模板操作 */
  781. importTemplate() {
  782. importTemplate().then(response => {
  783. this.download(response.msg);
  784. });
  785. },
  786. // 文件上传中处理
  787. handleFileUploadProgress(event, file, fileList) {
  788. this.upload.isUploading = true;
  789. },
  790. // 文件上传成功处理
  791. handleFileSuccess(response, file, fileList) {
  792. this.upload.open = false;
  793. this.upload.isUploading = false;
  794. this.$refs.upload.clearFiles();
  795. this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
  796. this.getList();
  797. },
  798. // 提交上传文件
  799. submitFileForm() {
  800. this.$refs.upload.submit();
  801. }
  802. }
  803. };
  804. </script>