index.vue 30 KB

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