evaluationApplicationTab.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  1. <template>
  2. <div class="applicationTable">
  3. <el-dialog title="统计汇总详情" v-model="editEvaluaVisible" :fullscreen="true" :close-on-click-modal="false">
  4. <div class="reportTAll">
  5. <div class="reportTBtn">
  6. <div class="collectSeach">
  7. <div class="exceed">
  8. <span class="exceedSpan" style="width: 80px">选择时间:</span>
  9. <el-date-picker
  10. v-model="timeIds"
  11. type="monthrange"
  12. unlink-panels
  13. value-format="YYYY-MM"
  14. range-separator="To"
  15. start-placeholder="开始时间"
  16. end-placeholder="结束时间"
  17. />
  18. </div>
  19. <div class="exceed" style="margin-left: 10px">
  20. <span class="exceedSpan" style="width: 100px">填报部门:</span>
  21. <el-select v-model="deptNameS" filterable clearable :disabled="ispersonDept !== 'true'"
  22. placeholder="请选择部门名称" @change="changeDeptLead">
  23. <el-option
  24. v-for="item in departData"
  25. :key="item.deptId"
  26. :label="item.deptName"
  27. :value="item.deptId">
  28. </el-option>
  29. </el-select>
  30. </div>
  31. <div class="exceed" style="margin-left: 10px">
  32. <span class="exceedSpan" style="width: 100px">人员编号:</span>
  33. <el-input v-model="userNameS" placeholder="请输入人员编号"/>
  34. </div>
  35. <!-- <div class="exceed" style="margin-left: 10px">
  36. <span class="exceedSpan" style="width: 100px">选择人员:</span>
  37. <el-select v-model="userNameS" filterable clearable placeholder="请选择人员">
  38. <el-option
  39. v-for="item in deptLeaderOptionDet"
  40. :key="item.id"
  41. :label="item.name"
  42. :value="item.id">
  43. </el-option>
  44. </el-select>
  45. </div> -->
  46. <seachs @handleSeach="getreportTableData" :showRest="false"></seachs>
  47. <el-button type="warning" icon="Download" size="mini" @click="handleExport" style="margin-left:10px">导出</el-button>
  48. </div>
  49. <div class="reportTTableData">
  50. <el-table :data="reportTableData" ref="report-table" style="width: 100%">
  51. <el-table-column label="序号" type="index" width="50" align="center" />
  52. <el-table-column label="人员编码" prop="employeeNo" align="center" />
  53. <el-table-column label="人员姓名" prop="employeeName" align="center" />
  54. <el-table-column label="评定系数" prop="suggestedValue" align="center" />
  55. <el-table-column label="申报月份" prop="declarationMonth" align="center" />
  56. <el-table-column label="申报次数" prop="declarationsNumber" align="center" />
  57. <el-table-column label="申报部门" prop="reportingDepartment" align="center" />
  58. <el-table-column label="评定级别" prop="declarationLevel" align="center" />
  59. </el-table>
  60. </div>
  61. </div>
  62. </div>
  63. </el-dialog>
  64. </div>
  65. </template>
  66. <script>
  67. import seachs from '../seachGroup.vue'
  68. import { saveAs } from 'file-saver'
  69. import ExcelJS from 'exceljs'
  70. import fileSave from 'file-saver'
  71. import {apiGetstatisticalSummaryList, apiGetuserPageList, apiGetExportMsg} from '../../api/api'
  72. export default {
  73. components: {seachs},
  74. data() {
  75. return {
  76. editEvaluaVisible: false,
  77. reportTableData: [],
  78. departData: [],
  79. deptLeaderOptionDet: [],
  80. timeIds: [],
  81. deptNameS: '',
  82. userNameS: '',
  83. userMes: {},
  84. ispersonDept: window.sessionStorage.getItem('ispersonDept')
  85. }
  86. },
  87. methods: {
  88. init(departData) {
  89. this.editEvaluaVisible = true
  90. this.departData = departData
  91. this.userMes = JSON.parse(window.sessionStorage.getItem('user'))
  92. this.deptNameS = this.userMes.deptId ? this.userMes.deptId : ''
  93. this.reportTableData = []
  94. let month = (new Date().getMonth()+1) < 10 ? '0'+(new Date().getMonth()+1) : (new Date().getMonth()+1)
  95. let startTim = `${new Date().getFullYear()}-${new Date().getMonth() < 10 ? '0'+new Date().getMonth() : new Date().getMonth()}`
  96. let endTim = `${new Date().getFullYear()}-${month}`
  97. this.timeIds = [startTim, endTim]
  98. this.getreportTableData()
  99. // this.changeDeptLead()
  100. },
  101. sortMethods(a, b, it) {
  102. if (a[it] < b[it]) {
  103. return -1
  104. }
  105. },
  106. // 根据部门查询人员
  107. changeDeptLead(val) {
  108. let that = this
  109. let params = {
  110. orgId: val ? val : ''
  111. }
  112. apiGetuserPageList(params).then(datas =>{
  113. if (datas && datas.data) {
  114. that.deptLeaderOptionDet.push(datas.data)
  115. }
  116. })
  117. },
  118. // 查询数据
  119. getreportTableData() {
  120. let that = this
  121. let params = {
  122. // year: this.timeIds.substring(0, this.timeIds.indexOf('-')),
  123. // month: this.timeIds.substring(this.timeIds.indexOf('-')+1, this.timeIds.length)*1
  124. startTime: that.timeIds[0],
  125. endTime: that.timeIds[1],
  126. deptId: that.deptNameS,
  127. // employeeId: that.userNameS
  128. employeeNo: that.userNameS
  129. }
  130. apiGetstatisticalSummaryList(params).then(datas =>{
  131. if (datas && datas.data) {
  132. that.reportTableData = datas.data
  133. }
  134. })
  135. },
  136. handleExport() {
  137. let that = this
  138. let params = {
  139. startTime: that.timeIds[0],
  140. endTime: that.timeIds[1],
  141. deptId: that.deptNameS,
  142. // employeeId: that.userNameS
  143. employeeNo: that.userNameS
  144. }
  145. let url = 'evaluation-dept-ad/generateStatisticalSummaryReports'
  146. let fileName = '统计汇总信息数据.xlsx'
  147. apiGetExportMsg(url,params).then(datas =>{
  148. let blob = new Blob([datas])
  149. saveAs(blob, fileName)
  150. }).catch((r) => {
  151. console.error(r)
  152. })
  153. }
  154. }
  155. }
  156. </script>
  157. <style lang="less">
  158. .applicationTable{
  159. .el-overlay{
  160. .el-dialog{
  161. // margin-top: 5vh !important;
  162. .el-dialog__body{
  163. padding: 0 20px 30px 20px !important;
  164. .reportTAll{
  165. .el-select, .el-input{
  166. width: 100%;
  167. }
  168. .reportTBtn{
  169. padding: 10px 20px 0 20px;
  170. .collectSeach {
  171. display: flex;
  172. padding: 24px 20px;
  173. border-bottom: 1px solid#D6DBEA;
  174. .exceed {
  175. display: flex;
  176. .exceedSpan {
  177. height: 12px;
  178. font-size: 14px;
  179. font-family: Microsoft YaHei;
  180. font-weight: 400;
  181. color: #8991B0;
  182. line-height: 12px;
  183. margin-top: 14px;
  184. }
  185. .el-select{
  186. line-height: 40px !important;
  187. .el-input__inner, .is-disabled{
  188. height:40px !important;
  189. }
  190. .el-input__suffix{
  191. .el-select__caret{
  192. line-height:40px;
  193. }
  194. }
  195. }
  196. .el-date-editor--monthrange{
  197. height: 40px;
  198. }
  199. }
  200. span {
  201. font-size: 14px;
  202. }
  203. .PeriodBtn {
  204. display: flex;
  205. justify-content: flex-end;
  206. padding: 20px 0;
  207. }
  208. .el-button {
  209. height: 30px;
  210. // width:100px;
  211. padding: 0 30px;
  212. // padding-top: 8px;
  213. span {
  214. margin: 0;
  215. }
  216. }
  217. }
  218. }
  219. .reportTTableData{
  220. .el-table{
  221. .el-table__body-wrapper{
  222. height: 65vh !important;
  223. }
  224. .el-input__inner{
  225. height: 30px !important;
  226. }
  227. .el-radio__label{
  228. display: none;
  229. }
  230. }
  231. .el-pagination{
  232. margin-top: 20px;
  233. text-align: end;
  234. position: relative;
  235. }
  236. }
  237. .onlyDialog{
  238. .el-overlay{
  239. .el-dialog{
  240. margin-top: 10vh !important;
  241. }
  242. }
  243. }
  244. }
  245. }
  246. .el-dialog__footer{
  247. .dialog-footer{
  248. display: flex;
  249. justify-content: center;
  250. .el-button{
  251. width: 180px !important;
  252. height: 40px !important;
  253. }
  254. }
  255. }
  256. }
  257. }
  258. }
  259. </style>