evaluationUnitRatingPage.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. <template>
  2. <div class="evaluationUnitRating">
  3. <div class="evaluationUnitRatingBtn">
  4. <div class="collectSeach">
  5. <div class="exceed">
  6. <span class="exceedSpan">单位名称:</span>
  7. <el-input v-model="resCompanyName" placeholder="请输入单位名称"></el-input>
  8. </div>
  9. <div class="exceed">
  10. <span class="exceedSpan">业务属性:</span>
  11. <el-select v-model="businessStr" placeholder="请选择业务属性" clearable >
  12. <el-option
  13. v-for="item in binSectionoptions"
  14. :key="item.sectionCode"
  15. :label="item.sectionName"
  16. :value="item.sectionCode">
  17. </el-option>
  18. </el-select>
  19. </div>
  20. <div class="exceed">
  21. <span class="exceedSpan" style="width: 80px">考评年度:</span>
  22. <el-date-picker v-model="resAnnual" type="year" value-format="YYYY" placeholder="选择年份" />
  23. </div>
  24. <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
  25. </div>
  26. <div class="PeriodBtn">
  27. <btns
  28. :showImport="true"
  29. :showExport="true"
  30. :showSave="true"
  31. :showAdd="true"
  32. :showDelete="true"
  33. :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
  34. :disDelete="changeDateSelect.length === 0"
  35. :disImport="false"
  36. :disExport="false"
  37. @handleAdd="handleAdd"
  38. @handleEdit="handleEdit"
  39. @handleDelete="handleDelete"
  40. @handleImport="handleImport"
  41. @handleExport="handleExport"
  42. ></btns>
  43. </div>
  44. <div class="evaluationUnitRatingTableData">
  45. <!-- @row-click="rowClickToggle" -->
  46. <el-table :data="evaluationUnitRatingData" style="width: 100%" ref="tableSS"
  47. @select="rowClick" @select-all="rowClick">
  48. <el-table-column type="selection" label="操作" align="center"></el-table-column>
  49. <el-table-column type="index" label="序号" align="center"></el-table-column>
  50. <el-table-column label="考评单位" width="200">
  51. <template #default="scope">
  52. <el-tooltip
  53. class="box-item"
  54. effect="customized"
  55. :content="scope.row.organizationShortName"
  56. placement="right"
  57. >
  58. <span class="tooltipCC">{{scope.row.organizationShortName}}</span>
  59. </el-tooltip>
  60. </template>
  61. </el-table-column>
  62. <el-table-column label="业务板块" prop="binSectionName" />
  63. <el-table-column label="考评年度" prop="year" />
  64. <el-table-column label="生成经营评级" prop="scjyRate" />
  65. <el-table-column label="前期评级" prop="qqRate" />
  66. <el-table-column label="基建评级" prop="jjRate" />
  67. <el-table-column label="年度评级" prop="yearRate" />
  68. </el-table>
  69. </div>
  70. <el-dialog :title="title" custom-class="startToDia" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
  71. <div class="periodFrom">
  72. <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
  73. <el-form-item label="考评单位" prop="companyRuleF">
  74. <el-select v-model="ruleForm.companyRuleF" placeholder="请选择考评单位" :disabled="isSave">
  75. <el-option
  76. v-for="item in companyData"
  77. :key="item.organizationId"
  78. :label="item.organizationShortName"
  79. :value="item.organizationId">
  80. </el-option>
  81. </el-select>
  82. </el-form-item>
  83. <el-form-item label="业务属性" prop="binSection">
  84. <el-select v-model="ruleForm.binSection" placeholder="请选择业务属性">
  85. <el-option
  86. v-for="item in binSectionoptions"
  87. :key="item.sectionCode"
  88. :label="item.sectionName"
  89. :value="item.sectionCode">
  90. </el-option>
  91. </el-select>
  92. </el-form-item>
  93. <el-form-item label="年份" prop="year">
  94. <el-date-picker
  95. v-model="ruleForm.year"
  96. :disabled="isSave"
  97. type="year"
  98. value-format="YYYY"
  99. placeholder="请选择年份"
  100. />
  101. </el-form-item>
  102. <el-form-item label="生成经营评级">
  103. <el-select v-model="ruleForm.scjyRate" placeholder="请选择评级">
  104. <el-option
  105. v-for="item in ratingArr"
  106. :key="item.value"
  107. :label="item.label"
  108. :value="item.value">
  109. </el-option>
  110. </el-select>
  111. </el-form-item>
  112. <el-form-item label="前期评级">
  113. <el-select v-model="ruleForm.qqRate" placeholder="请选择评级">
  114. <el-option
  115. v-for="item in ratingArr"
  116. :key="item.value"
  117. :label="item.label"
  118. :value="item.value">
  119. </el-option>
  120. </el-select>
  121. </el-form-item>
  122. <el-form-item label="基建评级">
  123. <el-select v-model="ruleForm.jjRate" placeholder="请选择评级">
  124. <el-option
  125. v-for="item in ratingArr"
  126. :key="item.value"
  127. :label="item.label"
  128. :value="item.value">
  129. </el-option>
  130. </el-select>
  131. </el-form-item>
  132. <el-form-item label="年度评级">
  133. <el-select v-model="ruleForm.yearRate" placeholder="请选择评级">
  134. <el-option
  135. v-for="item in ratingArr"
  136. :key="item.value"
  137. :label="item.label"
  138. :value="item.value">
  139. </el-option>
  140. </el-select>
  141. </el-form-item>
  142. <el-form-item label="描述" prop="remark">
  143. <el-input v-model="ruleForm.remark" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
  144. </el-form-item>
  145. </el-form>
  146. </div>
  147. <template #footer>
  148. <span class="dialog-footer">
  149. <el-button @click="dialogVisible = false">取 消</el-button>
  150. <el-button type="primary" @click="saveevaluaStart('ruleForm')">确 定</el-button>
  151. </span>
  152. </template>
  153. </el-dialog>
  154. </div>
  155. <start-from-list ref="startFromDetail" ></start-from-list>
  156. <import-dailog ref="importPage" @successImport="successImport"></import-dailog>
  157. </div>
  158. </template>
  159. <script>
  160. import importDailog from '../importPage/importDailog.vue'
  161. import startFromList from './evaluationDeptStartFrom.vue'
  162. import btns from '../elbuttonS.vue'
  163. import seachs from '../seachGroup.vue'
  164. import ExcelJS from 'exceljs'
  165. import fileSave from 'file-saver'
  166. import {apiGetorganizationratinglist, apiGetorganizationratingsave,apiGetOrganizationListAll,apiGetbinsectionList,
  167. apiPostorganizationratingDelete} from '../../api/api'
  168. export default {
  169. components: {
  170. startFromList,
  171. importDailog,
  172. btns,
  173. seachs
  174. },
  175. data() {
  176. return {
  177. dialogVisible: false,
  178. isSave: false,
  179. title: '',
  180. evalradio: {},
  181. changeDateSelect: [],
  182. evaluationUnitRatingData:[],
  183. companyData: [],
  184. binSectionoptions: [],
  185. ruleForm: {
  186. companyRuleF: '',
  187. year: '',
  188. binSection: '',
  189. scjyRate: '',
  190. qqRate: '',
  191. jjRate: '',
  192. yearRate: '',
  193. remark: ''
  194. },
  195. rules: {
  196. companyRuleF: [
  197. { required: true, message: '请选择考评单位', trigger: 'change' }
  198. ],
  199. binSection: [
  200. { required: true, message: '请选择考评单位', trigger: 'change' }
  201. ],
  202. year: [
  203. { required: true, message: '请选择年份', trigger: 'change' }
  204. ]
  205. },
  206. resCompanyName: '',
  207. businessStr: '',
  208. resAnnual: '',
  209. monthArr: [],
  210. ratingArr: []
  211. }
  212. },
  213. created() {
  214. this.ratingArr = [
  215. {
  216. label: 'A级',
  217. value: 'A'
  218. },
  219. {
  220. label: 'B级',
  221. value: 'B'
  222. },
  223. {
  224. label: 'C级',
  225. value: 'C'
  226. }
  227. ]
  228. this.resAnnual = new Date().getFullYear().toString()
  229. this.getevaluRatingList()
  230. this.getOrganizetionData()
  231. this.getDataDictionary()
  232. },
  233. methods:{
  234. // 查询列表页面
  235. getevaluRatingList() {
  236. let that = this
  237. let params = {
  238. pageNum: 1,
  239. pageSize: 500,
  240. organizationId: that.resCompanyName,
  241. binSection: that.businessStr,
  242. year: that.resAnnual
  243. }
  244. apiGetorganizationratinglist(params).then(datas =>{
  245. if (datas && datas.data.records) {
  246. that.evaluationUnitRatingData = datas.data.records
  247. }
  248. })
  249. },
  250. //查询单位数据
  251. getOrganizetionData() {
  252. let that = this
  253. let params = {
  254. evaluationCycle: 'NDKP',
  255. organizationType: 'DWKP'
  256. }
  257. apiGetOrganizationListAll(params).then(datas => {
  258. if (datas && datas.data) {
  259. that.companyData = datas.data
  260. }
  261. })
  262. },
  263. // 查询属性和阶段
  264. getDataDictionary() {
  265. let that = this
  266. let params = {
  267. type: '1'
  268. }
  269. apiGetbinsectionList(params).then(datas =>{
  270. if (datas && datas.data) {
  271. that.binSectionoptions = datas.data
  272. }
  273. })
  274. },
  275. saveevaluaStart(formName) {
  276. let that = this
  277. that.$refs[formName].validate((valid) => {
  278. if (valid) {
  279. that.saveAndEditIndicatorData()
  280. }
  281. });
  282. },
  283. //新增/修改考评启动数据
  284. saveAndEditIndicatorData() {
  285. let that = this
  286. let orgName = ''
  287. this.companyData.forEach(item =>{
  288. if (item.organizationId === that.ruleForm.companyRuleF) {
  289. orgName = item.organizationShortName
  290. }
  291. })
  292. let params = {
  293. organizationId: that.ruleForm.companyRuleF,
  294. organizationShortName: orgName,
  295. year: that.ruleForm.year,
  296. binSection: that.ruleForm.binSection,
  297. scjyRate: that.ruleForm.scjyRate,
  298. qqRate: that.ruleForm.qqRate,
  299. jjRate: that.ruleForm.jjRate,
  300. yearRate: that.ruleForm.yearRate,
  301. remark: that.ruleForm.remark
  302. }
  303. if (that.isSave) {
  304. params.id = that.evalradio.id
  305. }
  306. apiGetorganizationratingsave(params).then(datas =>{
  307. if (!datas.success) {
  308. that.$message({
  309. message: datas.message,
  310. type: 'error'
  311. });
  312. } else {
  313. if (!that.isSave) {
  314. that.$message({
  315. message: '单位绩效考核评级新增成功',
  316. type: 'success'
  317. });
  318. } else {
  319. that.$message({
  320. message: '单位绩效考核评级修改成功',
  321. type: 'success'
  322. });
  323. }
  324. that.dialogVisible = false
  325. that.changeDateSelect = []
  326. that.getevaluRatingList()
  327. }
  328. })
  329. },
  330. getSeachData() {
  331. this.getevaluRatingList()
  332. },
  333. resetSeach() {
  334. this.resCompanyName = ''
  335. this.businessStr = ''
  336. this.resAnnual = ''
  337. this.getevaluRatingList()
  338. },
  339. rowClick(selection, row) {
  340. this.changeDateSelect = selection
  341. },
  342. // rowClickToggle(row) {
  343. // this.$refs.tableSS.toggleRowSelection(row)
  344. // },
  345. handleAdd() {
  346. this.dialogVisible = true
  347. this.isSave = false
  348. this.title = '新建单位绩效考核评级'
  349. this.$nextTick(() =>{
  350. this.ruleForm = {
  351. companyRuleF: '',
  352. year: '',
  353. binSection: '',
  354. scjyRate: '',
  355. qqRate: '',
  356. jjRate: '',
  357. yearRate: '',
  358. remark: ''
  359. }
  360. })
  361. },
  362. handleEdit() {
  363. this.dialogVisible = true
  364. this.isSave = true
  365. this.title = '修改单位绩效考核评级'
  366. this.evalradio = this.changeDateSelect[0]
  367. this.ruleForm = {
  368. companyRuleF: this.evalradio.organizationId,
  369. year: this.evalradio.year,
  370. binSection: this.evalradio.binSection,
  371. scjyRate: this.evalradio.scjyRate,
  372. qqRate: this.evalradio.qqRate,
  373. jjRate: this.evalradio.jjRate,
  374. yearRate: this.evalradio.yearRate,
  375. remark: this.evalradio.remark
  376. }
  377. },
  378. //删除
  379. handleDelete() {
  380. this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
  381. confirmButtonText: '确定',
  382. cancelButtonText: '取消',
  383. type: 'warning'
  384. }).then(() => {
  385. let that = this
  386. let paramsArr = []
  387. that.changeDateSelect.forEach(it =>{
  388. paramsArr.push(it.id)
  389. })
  390. apiPostorganizationratingDelete(paramsArr.join(',')).then(datas =>{
  391. that.$message({
  392. type: 'success',
  393. message: '删除成功!'
  394. });
  395. that.getevaluRatingList()
  396. that.changeDateSelect = []
  397. })
  398. })
  399. },
  400. handleImport() {
  401. this.$refs.importPage.upload.title = "单位考评评级"
  402. this.$refs.importPage.upload.open = true
  403. this.$refs.importPage.upload.url = '/organization-rating/import'
  404. },
  405. successImport(val) {
  406. this.getevaluRatingList()
  407. },
  408. handleExport() {
  409. let data = this.evaluationUnitRatingData //接口返回数据
  410. const workbook = new ExcelJS.Workbook()
  411. const worksheet = workbook.addWorksheet('Sheet1')
  412. //根据数据自己调整
  413. let colums = []
  414. colums = [
  415. { header: 'ID', key: 'id', width: 26, hidden: true},
  416. { header: '考评单位', key: 'organizationShortName', width: 26 },
  417. { header: '考评单位ID', key: 'organizationId', width: 26, hidden: true },
  418. { header: '业务板块ID', key: 'binSection', width: 26, hidden: true },
  419. { header: '考评年度', key: 'year', width: 26 },
  420. { header: '生成经营评级', key: 'scjyRate', width: 26 },
  421. { header: '前期评级', key: 'qqRate', width: 26 },
  422. { header: '基建评级', key: 'jjRate', width: 26 },
  423. { header: '年度评级', key: 'yearRate', width: 26 },
  424. { header: '备注', key: 'remake', width: 26 },
  425. ]
  426. worksheet.columns = colums
  427. worksheet.getRow(1).font = {
  428. size: 12,
  429. bold: true
  430. }
  431. worksheet.addRows(data)
  432. workbook.xlsx.writeBuffer().then(buffer => {
  433. //这里为type
  434. const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
  435. fileSave(blob, `单位考评评级数据导出.xlsx`)
  436. })
  437. }
  438. }
  439. }
  440. </script>
  441. <style lang="less">
  442. .evaluationUnitRating{
  443. .evaluationUnitRatingBtn{
  444. .collectSeach{
  445. display: flex;
  446. padding: 24px 20px;
  447. border-bottom: 1px solid#D6DBEA;
  448. .exceed{
  449. display: flex;
  450. .exceedSpan{
  451. width: 100px;
  452. height: 12px;
  453. font-size: 14px;
  454. font-family: Microsoft YaHei;
  455. font-weight: 400;
  456. color: #8991B0;
  457. line-height: 12px;
  458. margin-top: 14px;
  459. }
  460. .el-input{
  461. margin-right:10px;
  462. height: 40px;
  463. .el-input__inner{
  464. height:40px;
  465. }
  466. .el-input__suffix{
  467. .el-select__caret{
  468. line-height:30px;
  469. }
  470. }
  471. }
  472. }
  473. .el-select{
  474. margin-right:10px;
  475. .el-input__inner{
  476. height:30px;
  477. }
  478. .el-input__suffix{
  479. .el-select__caret{
  480. line-height:30px;
  481. }
  482. }
  483. }
  484. }
  485. span{
  486. font-size:14px;
  487. }
  488. .PeriodBtn{
  489. display: flex;
  490. justify-content: end;
  491. padding: 20px 0;
  492. }
  493. .el-button{
  494. height: 30px;
  495. // width:100px;
  496. padding: 0 20px ;
  497. // padding-top: 8px;
  498. span{
  499. margin:0;
  500. }
  501. }
  502. .evaluationUnitRatingTableData{
  503. .el-table{
  504. .el-table__body-wrapper{
  505. height: 65vh !important;
  506. }
  507. .el-input__inner{
  508. height: 30px !important;
  509. }
  510. .el-radio__label{
  511. display: none;
  512. }
  513. .tooltipCC{
  514. width: 300px !important;
  515. display: inline-block;
  516. overflow: hidden;
  517. text-overflow: ellipsis;
  518. white-space: nowrap;
  519. }
  520. .tooltipCCDes{
  521. width: 50px;
  522. display: inline-block;
  523. overflow: hidden;
  524. text-overflow: ellipsis;
  525. white-space: nowrap;
  526. }
  527. .indicitem{
  528. color: #409EFF;
  529. font-size: 12px;
  530. margin-right: 20px;
  531. cursor:pointer;
  532. &:hover{
  533. text-decoration: underline;
  534. }
  535. }
  536. }
  537. .el-pagination{
  538. margin-top: 20px;
  539. text-align: end;
  540. position: relative;
  541. }
  542. }
  543. .el-overlay{
  544. .startToDia{
  545. .el-dialog__body{
  546. padding: 30px 60px 30px 20px !important;
  547. .periodFrom{
  548. .el-select, .el-input{
  549. width: 100%;
  550. }
  551. .el-input{
  552. height: 30px;
  553. }
  554. }
  555. .flowSty{
  556. width: 100%;
  557. height: 70vh;
  558. }
  559. }
  560. }
  561. }
  562. }
  563. }
  564. </style>