123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568 |
- <template>
- <div class="evaluationUnitRating">
- <div class="evaluationUnitRatingBtn">
- <div class="collectSeach">
- <div class="exceed">
- <span class="exceedSpan">单位名称:</span>
- <el-input v-model="resCompanyName" placeholder="请输入单位名称"></el-input>
- </div>
- <div class="exceed">
- <span class="exceedSpan">业务属性:</span>
- <el-select v-model="businessStr" placeholder="请选择业务属性" clearable >
- <el-option
- v-for="item in binSectionoptions"
- :key="item.sectionCode"
- :label="item.sectionName"
- :value="item.sectionCode">
- </el-option>
- </el-select>
- </div>
- <div class="exceed">
- <span class="exceedSpan" style="width: 80px">考评年度:</span>
- <el-date-picker v-model="resAnnual" type="year" value-format="YYYY" placeholder="选择年份" />
- </div>
- <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
- </div>
- <div class="PeriodBtn">
- <btns
- :showImport="true"
- :showExport="true"
- :showSave="true"
- :showAdd="true"
- :showDelete="true"
- :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
- :disDelete="changeDateSelect.length === 0"
- :disImport="false"
- :disExport="false"
- @handleAdd="handleAdd"
- @handleEdit="handleEdit"
- @handleDelete="handleDelete"
- @handleImport="handleImport"
- @handleExport="handleExport"
- ></btns>
- </div>
- <div class="evaluationUnitRatingTableData">
- <!-- @row-click="rowClickToggle" -->
- <el-table :data="evaluationUnitRatingData" style="width: 100%" ref="tableSS"
- @select="rowClick" @select-all="rowClick">
- <el-table-column type="selection" label="操作" align="center"></el-table-column>
- <el-table-column type="index" label="序号" align="center"></el-table-column>
- <el-table-column label="考评单位" width="200">
- <template #default="scope">
- <el-tooltip
- class="box-item"
- effect="customized"
- :content="scope.row.organizationShortName"
- placement="right"
- >
- <span class="tooltipCC">{{scope.row.organizationShortName}}</span>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column label="业务板块" prop="binSectionName" />
- <el-table-column label="考评年度" prop="year" />
- <el-table-column label="生成经营评级" prop="scjyRate" />
- <el-table-column label="前期评级" prop="qqRate" />
- <el-table-column label="基建评级" prop="jjRate" />
- <el-table-column label="年度评级" prop="yearRate" />
- </el-table>
- </div>
- <el-dialog :title="title" custom-class="startToDia" v-model="dialogVisible" width="600px" :close-on-click-modal="false">
- <div class="periodFrom">
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" :validate-on-rule-change="false">
- <el-form-item label="考评单位" prop="companyRuleF">
- <el-select v-model="ruleForm.companyRuleF" placeholder="请选择考评单位" :disabled="isSave">
- <el-option
- v-for="item in companyData"
- :key="item.organizationId"
- :label="item.organizationShortName"
- :value="item.organizationId">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="业务属性" prop="binSection">
- <el-select v-model="ruleForm.binSection" placeholder="请选择业务属性">
- <el-option
- v-for="item in binSectionoptions"
- :key="item.sectionCode"
- :label="item.sectionName"
- :value="item.sectionCode">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="年份" prop="year">
- <el-date-picker
- v-model="ruleForm.year"
- :disabled="isSave"
- type="year"
- value-format="YYYY"
- placeholder="请选择年份"
- />
- </el-form-item>
- <el-form-item label="生成经营评级">
- <el-select v-model="ruleForm.scjyRate" placeholder="请选择评级">
- <el-option
- v-for="item in ratingArr"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="前期评级">
- <el-select v-model="ruleForm.qqRate" placeholder="请选择评级">
- <el-option
- v-for="item in ratingArr"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="基建评级">
- <el-select v-model="ruleForm.jjRate" placeholder="请选择评级">
- <el-option
- v-for="item in ratingArr"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="年度评级">
- <el-select v-model="ruleForm.yearRate" placeholder="请选择评级">
- <el-option
- v-for="item in ratingArr"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="描述" prop="remark">
- <el-input v-model="ruleForm.remark" :rows="5" type="textarea" placeholder="请输入描述"></el-input>
- </el-form-item>
- </el-form>
- </div>
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveevaluaStart('ruleForm')">确 定</el-button>
- </span>
- </template>
- </el-dialog>
- </div>
- <start-from-list ref="startFromDetail" ></start-from-list>
- <import-dailog ref="importPage" @successImport="successImport"></import-dailog>
- </div>
- </template>
- <script>
- import importDailog from '../importPage/importDailog.vue'
- import startFromList from './evaluationDeptStartFrom.vue'
- import btns from '../elbuttonS.vue'
- import seachs from '../seachGroup.vue'
- import ExcelJS from 'exceljs'
- import fileSave from 'file-saver'
- import {apiGetorganizationratinglist, apiGetorganizationratingsave,apiGetOrganizationListAll,apiGetbinsectionList,
- apiPostorganizationratingDelete} from '../../api/api'
- export default {
- components: {
- startFromList,
- importDailog,
- btns,
- seachs
- },
- data() {
- return {
- dialogVisible: false,
- isSave: false,
- title: '',
- evalradio: {},
- changeDateSelect: [],
- evaluationUnitRatingData:[],
- companyData: [],
- binSectionoptions: [],
- ruleForm: {
- companyRuleF: '',
- year: '',
- binSection: '',
- scjyRate: '',
- qqRate: '',
- jjRate: '',
- yearRate: '',
- remark: ''
- },
- rules: {
- companyRuleF: [
- { required: true, message: '请选择考评单位', trigger: 'change' }
- ],
- binSection: [
- { required: true, message: '请选择考评单位', trigger: 'change' }
- ],
- year: [
- { required: true, message: '请选择年份', trigger: 'change' }
- ]
- },
- resCompanyName: '',
- businessStr: '',
- resAnnual: '',
- monthArr: [],
- ratingArr: []
- }
- },
- created() {
- this.ratingArr = [
- {
- label: 'A级',
- value: 'A'
- },
- {
- label: 'B级',
- value: 'B'
- },
- {
- label: 'C级',
- value: 'C'
- }
- ]
- this.resAnnual = new Date().getFullYear().toString()
- this.getevaluRatingList()
- this.getOrganizetionData()
- this.getDataDictionary()
- },
- methods:{
- // 查询列表页面
- getevaluRatingList() {
- let that = this
- let params = {
- pageNum: 1,
- pageSize: 500,
- organizationId: that.resCompanyName,
- binSection: that.businessStr,
- year: that.resAnnual
- }
- apiGetorganizationratinglist(params).then(datas =>{
- if (datas && datas.data.records) {
- that.evaluationUnitRatingData = datas.data.records
- }
- })
- },
- //查询单位数据
- getOrganizetionData() {
- let that = this
- let params = {
- evaluationCycle: 'NDKP',
- organizationType: 'DWKP'
- }
- apiGetOrganizationListAll(params).then(datas => {
- if (datas && datas.data) {
- that.companyData = datas.data
- }
- })
- },
- // 查询属性和阶段
- getDataDictionary() {
- let that = this
- let params = {
- type: '1'
- }
- apiGetbinsectionList(params).then(datas =>{
- if (datas && datas.data) {
- that.binSectionoptions = datas.data
- }
- })
- },
- saveevaluaStart(formName) {
- let that = this
- that.$refs[formName].validate((valid) => {
- if (valid) {
- that.saveAndEditIndicatorData()
- }
- });
- },
- //新增/修改考评启动数据
- saveAndEditIndicatorData() {
- let that = this
- let orgName = ''
- this.companyData.forEach(item =>{
- if (item.organizationId === that.ruleForm.companyRuleF) {
- orgName = item.organizationShortName
- }
- })
- let params = {
- organizationId: that.ruleForm.companyRuleF,
- organizationShortName: orgName,
- year: that.ruleForm.year,
- binSection: that.ruleForm.binSection,
- scjyRate: that.ruleForm.scjyRate,
- qqRate: that.ruleForm.qqRate,
- jjRate: that.ruleForm.jjRate,
- yearRate: that.ruleForm.yearRate,
- remark: that.ruleForm.remark
- }
- if (that.isSave) {
- params.id = that.evalradio.id
- }
- apiGetorganizationratingsave(params).then(datas =>{
- if (!datas.success) {
- that.$message({
- message: datas.message,
- type: 'error'
- });
- } else {
- if (!that.isSave) {
- that.$message({
- message: '单位绩效考核评级新增成功',
- type: 'success'
- });
- } else {
- that.$message({
- message: '单位绩效考核评级修改成功',
- type: 'success'
- });
- }
- that.dialogVisible = false
- that.changeDateSelect = []
- that.getevaluRatingList()
- }
- })
- },
- getSeachData() {
- this.getevaluRatingList()
- },
- resetSeach() {
- this.resCompanyName = ''
- this.businessStr = ''
- this.resAnnual = ''
- this.getevaluRatingList()
- },
- rowClick(selection, row) {
- this.changeDateSelect = selection
- },
- // rowClickToggle(row) {
- // this.$refs.tableSS.toggleRowSelection(row)
- // },
- handleAdd() {
- this.dialogVisible = true
- this.isSave = false
- this.title = '新建单位绩效考核评级'
- this.$nextTick(() =>{
- this.ruleForm = {
- companyRuleF: '',
- year: '',
- binSection: '',
- scjyRate: '',
- qqRate: '',
- jjRate: '',
- yearRate: '',
- remark: ''
- }
- })
- },
- handleEdit() {
- this.dialogVisible = true
- this.isSave = true
- this.title = '修改单位绩效考核评级'
- this.evalradio = this.changeDateSelect[0]
- this.ruleForm = {
- companyRuleF: this.evalradio.organizationId,
- year: this.evalradio.year,
- binSection: this.evalradio.binSection,
- scjyRate: this.evalradio.scjyRate,
- qqRate: this.evalradio.qqRate,
- jjRate: this.evalradio.jjRate,
- yearRate: this.evalradio.yearRate,
- remark: this.evalradio.remark
- }
- },
- //删除
- handleDelete() {
- this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let that = this
- let paramsArr = []
- that.changeDateSelect.forEach(it =>{
- paramsArr.push(it.id)
- })
- apiPostorganizationratingDelete(paramsArr.join(',')).then(datas =>{
- that.$message({
- type: 'success',
- message: '删除成功!'
- });
- that.getevaluRatingList()
- that.changeDateSelect = []
- })
- })
- },
- handleImport() {
- this.$refs.importPage.upload.title = "单位考评评级"
- this.$refs.importPage.upload.open = true
- this.$refs.importPage.upload.url = '/organization-rating/import'
- },
- successImport(val) {
- this.getevaluRatingList()
- },
- handleExport() {
- let data = this.evaluationUnitRatingData //接口返回数据
- const workbook = new ExcelJS.Workbook()
- const worksheet = workbook.addWorksheet('Sheet1')
- //根据数据自己调整
- let colums = []
- colums = [
- { header: 'ID', key: 'id', width: 26, hidden: true},
- { header: '考评单位', key: 'organizationShortName', width: 26 },
- { header: '考评单位ID', key: 'organizationId', width: 26, hidden: true },
- { header: '业务板块ID', key: 'binSection', width: 26, hidden: true },
- { header: '考评年度', key: 'year', width: 26 },
- { header: '生成经营评级', key: 'scjyRate', width: 26 },
- { header: '前期评级', key: 'qqRate', width: 26 },
- { header: '基建评级', key: 'jjRate', width: 26 },
- { header: '年度评级', key: 'yearRate', width: 26 },
- { header: '备注', key: 'remake', width: 26 },
- ]
- worksheet.columns = colums
- worksheet.getRow(1).font = {
- size: 12,
- bold: true
- }
- worksheet.addRows(data)
- workbook.xlsx.writeBuffer().then(buffer => {
- //这里为type
- const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' })
- fileSave(blob, `单位考评评级数据导出.xlsx`)
- })
- }
- }
- }
- </script>
- <style lang="less">
- .evaluationUnitRating{
- .evaluationUnitRatingBtn{
- .collectSeach{
- display: flex;
- padding: 24px 20px;
- border-bottom: 1px solid#D6DBEA;
- .exceed{
- display: flex;
- .exceedSpan{
- width: 100px;
- height: 12px;
- font-size: 14px;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #8991B0;
- line-height: 12px;
- margin-top: 14px;
- }
- .el-input{
- margin-right:10px;
- height: 40px;
- .el-input__inner{
- height:40px;
- }
- .el-input__suffix{
- .el-select__caret{
- line-height:30px;
- }
- }
- }
- }
- .el-select{
- margin-right:10px;
- .el-input__inner{
- height:30px;
- }
- .el-input__suffix{
- .el-select__caret{
- line-height:30px;
- }
- }
- }
- }
- span{
- font-size:14px;
- }
- .PeriodBtn{
- display: flex;
- justify-content: end;
- padding: 20px 0;
- }
- .el-button{
- height: 30px;
- // width:100px;
- padding: 0 20px ;
- // padding-top: 8px;
- span{
- margin:0;
- }
- }
- .evaluationUnitRatingTableData{
- .el-table{
- .el-table__body-wrapper{
- height: 65vh !important;
- }
- .el-input__inner{
- height: 30px !important;
- }
- .el-radio__label{
- display: none;
- }
- .tooltipCC{
- width: 300px !important;
- display: inline-block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .tooltipCCDes{
- width: 50px;
- display: inline-block;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .indicitem{
- color: #409EFF;
- font-size: 12px;
- margin-right: 20px;
- cursor:pointer;
- &:hover{
- text-decoration: underline;
- }
- }
- }
- .el-pagination{
- margin-top: 20px;
- text-align: end;
- position: relative;
- }
- }
- .el-overlay{
- .startToDia{
- .el-dialog__body{
- padding: 30px 60px 30px 20px !important;
- .periodFrom{
- .el-select, .el-input{
- width: 100%;
- }
- .el-input{
- height: 30px;
- }
- }
- .flowSty{
- width: 100%;
- height: 70vh;
- }
- }
- }
- }
- }
-
- }
- </style>
|