123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706 |
- <template>
- <div class="evaluationCompany" v-loading="loadingImport">
- <div class="evaluationCompanyBtn">
- <div class="collectSeach">
- <div class="exceed">
- <span class="exceedSpan">单位名称:</span>
- <el-input v-model="companyS" placeholder="请输入单位名称"></el-input>
- </div>
- <div class="exceed">
- <span class="exceedSpan" style="margin-left: 10px;width: 80px">业务属性:</span>
- <el-select v-model="binSectionIds" placeholder="请选择业务属性">
- <el-option
- v-for="item in moduleData"
- :key="item.id"
- :label="item.sectionName"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- <div class="exceed">
- <span class="exceedSpan" style="margin-left: 10px;width: 80px">业务阶段:</span>
- <el-select v-model="stageIds" placeholder="请选择业务阶段">
- <el-option
- v-for="item in stageData"
- :key="item.id"
- :label="item.stageName"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- <div class="exceed">
- <span class="exceedSpan" style="margin-left: 10px;width: 80px">考评周期:</span>
- <el-select v-model="periodId" placeholder="请选择考评周期">
- <el-option
- v-for="item in periodData"
- :key="item.keyValue"
- :label="item.keyName"
- :value="item.keyValue">
- </el-option>
- </el-select>
- </div>
- <seachs @handleSeach="getSeachData" @handleRest="resetSeach"></seachs>
- </div>
- <div class="PeriodBtn">
- <btns
- :showImport="false" :showExport="false"
- :showAdd="$utils.havePurview('evalCompany:oneLevel:add')"
- :showSave="$utils.havePurview('evalCompany:oneLevel:save')"
- :showDelete="$utils.havePurview('evalCompany:oneLevel:delete')"
- :disSave="changeDateSelect.length === 0 || changeDateSelect.length>1"
- :disDelete="changeDateSelect.length === 0" :disImport="true" :disExport="true"
- @handleAdd="handleAdd" @handleEdit="handleEdit" @handleDelete="handleDelete"
- @handleImport="handleImport" @handleExport="handleExport"></btns>
- </div>
- <div class="evaluationCompanyTableData">
- <el-table :data="evaluationCompanyData" style="width: 100%" @select="rowClick" @select-all="rowClick">
- <el-table-column type="selection" label="操作" align="center"></el-table-column>
- <el-table-column label="单位名称" prop="organizationShortName" width="300">
- <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="organizationType" /> -->
- <el-table-column label="考评周期" prop="evaluationCycle">
- <template #default="scope">
- <span>{{scope.row.evaluationCycle==='YDKP'?'月度考评':scope.row.evaluationCycle==='JDKP'?'季度考评':'年度考评'}}</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="业务属性" prop="binSectionName" /> -->
- <el-table-column label="考评规则" prop="evaluateRuleName" width="300">
- <template #default="scope">
- <el-tooltip class="box-item" effect="customized" :content="scope.row.evaluateRuleName"
- placement="right">
- <span class="tooltipCC">{{scope.row.evaluateRuleName}}</span>
- </el-tooltip>
- </template>
- </el-table-column>
- <!-- <el-table-column label="业务阶段" prop="binStageName" width="200" /> -->
- <el-table-column label="是否考评" prop="binSectionName">
- <template #default="scope">
- <span>{{scope.row.isCheck?'是':'否'}}</span>
- </template>
- </el-table-column>
- <el-table-column label="生产经营权重" prop="scjyWeight">
- <template #default="scope">
- <span>{{Math.floor(scope.row.scjyWeight*100)}}%</span>
- </template>
- </el-table-column>
- <el-table-column label="前期权重" prop="qqWeight">
- <template #default="scope">
- <span>{{Math.floor(scope.row.qqWeight*100)}}%</span>
- </template>
- </el-table-column>
- <el-table-column label="基建权重" prop="jjWeight">
- <template #default="scope">
- <span>{{Math.floor(scope.row.jjWeight*100)}}%</span>
- </template>
- </el-table-column>
- <!-- <el-table-column label="年" prop="year" />
- <el-table-column label="月" prop="month" /> -->
- </el-table>
- <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
- :current-page="page.currentPage" :page-size="page.pagesize"
- layout="total, prev, pager, next, jumper" :total="page.total">
- </el-pagination>
- </div>
- <div class="indexdialog">
- <el-dialog :title="title" 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="organizationName">
- <el-select v-model="ruleForm.organizationName" filterable placeholder="请选择单位名称">
- <el-option v-for="item in companyDatas" :key="item.id" :label="item.shortName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="业务属性" prop="binSection">
- <el-select v-model="ruleForm.binSection" placeholder="请选择业务属性" multiple collapse-tags
- @change="changeBinsection">
- <el-option v-for="item in moduleData" :key="item.id" :label="item.sectionName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="业务阶段" prop="binStage">
- <el-select v-model="ruleForm.binStage" placeholder="请选择业务阶段" multiple collapse-tags
- @change="changeBinsection">
- <el-option v-for="item in stageData" :key="item.id" :label="item.stageName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="考评规则" prop="evaluateRule">
- <!-- @change="changeRule" -->
- <el-select v-model="ruleForm.evaluateRule" multiple collapse-tags collapse-tags-tooltip
- placeholder="请选择考评规则">
- <el-option v-for="item in ruleDataAll" :key="item.id" :label="item.ruleName"
- :value="item.id">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="考评周期" prop="evaluationCycle">
- <el-select v-model="ruleForm.evaluationCycle" placeholder="请选择考评周期">
- <el-option v-for="item in periodData" :key="item.keyValue" :label="item.keyName"
- :value="item.keyValue">
- </el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="是否考评">
- <el-radio-group v-model="ruleForm.isCheck">
- <el-radio border label="是" />
- <el-radio border label="否" />
- </el-radio-group>
- </el-form-item>
- <el-form-item label="生产经营权重" prop="scjyWeight">
- <el-input-number v-model="ruleForm.scjyWeight" :precision="2" :step="0.1" :min="0"
- :max="1" placeholder="请输入生产经营权重" />
- </el-form-item>
- <el-form-item label="前期权重" prop="qqWeight">
- <el-input-number v-model="ruleForm.qqWeight" :precision="2" :step="0.1" :min="0"
- :max="1" placeholder="请输入前期权重" />
- </el-form-item>
- <el-form-item label="基建权重" prop="jjWeight">
- <el-input-number v-model="ruleForm.jjWeight" :precision="2" :step="0.1" :min="0"
- :max="1" placeholder="请输入基建权重" />
- </el-form-item>
- <!-- <el-form-item label="年份" prop="year">
- <el-date-picker
- v-model="ruleForm.year"
- type="year"
- value-format="YYYY"
- placeholder="请选择年份"
- />
- </el-form-item>
- <el-form-item label="月份">
- <el-input-number v-model="ruleForm.month" :min="1" :max="12" />
- </el-form-item> -->
- <el-form-item label="指标顺序">
- <el-input-number v-model="ruleForm.orderNum" :min="1" />
- </el-form-item>
- </el-form>
- </div>
- <template #footer>
- <span class="dialog-footer">
- <el-button @click="dialogVisible = false">取 消</el-button>
- <el-button type="primary" @click="saveevaluationCompanyMsg('ruleForm')">确 定</el-button>
- </span>
- </template>
- </el-dialog>
- </div>
- <indicator-item ref="indicatorItem"></indicator-item>
- </div>
- <import-dailog ref="importPage" @successImport="successImport" @importLoading="importLoading"></import-dailog>
- </div>
- </template>
- <script>
- import importDailog from '../importPage/importDailog.vue'
- import btns from '../elbuttonS.vue'
- import seachs from '../seachGroup.vue'
- import {
- apiGetOrganizationList,
- apiGetorganizationSaveList,
- apiGetorganizationdeleteList,
- apiGetorganizationgetTree,
- apiGetdatadictionaryList,
- apiGetbinstageList,
- apiGetbinsectionList,
- apiGetevaluateListAll
- } from '../../api/api'
- export default {
- components: {
- importDailog,
- btns,
- seachs
- },
- data() {
- return {
- dialogVisible: false,
- title: '',
- isSave: false,
- changeDateSelect: [],
- indicatoroptions: [],
- companyS: '',
- evaluationCompanyData: [],
- moduleData: [],
- stageData: [],
- ruleDataAll: [],
- periodData: [],
- ruleForm: {
- organizationName: '',
- evaluateRule: [],
- binSection: [],
- binStage: [],
- evaluationCycle: '',
- isCheck: '是',
- scjyWeight: 0,
- qqWeight: 0,
- jjWeight: 0,
- // year: '',
- // month: 1,
- orderNum: 1
- },
- rules: {
- organizationName: [{
- required: true,
- message: '请选择单位名称',
- trigger: 'change'
- }],
- binSection: [{
- required: true,
- message: '请选择业务属性',
- trigger: 'change'
- }],
- binStage: [{
- required: true,
- message: '请选择业务阶段',
- trigger: 'change'
- }],
- evaluateRule: [{
- required: true,
- message: '请选择考评规则',
- trigger: 'change'
- }],
- evaluationCycle: [{
- required: true,
- message: '请选择考评周期',
- trigger: 'change'
- }],
- year: [{
- required: true,
- message: '请选择年份',
- trigger: 'change'
- }]
- },
- page: {
- pagesize: 12,
- currentPage: 1,
- total: 0
- },
- evalradio: {},
- loadingImport: false,
- companyDatas: [],
- periodId: '',
- stageIds: '',
- binSectionIds: ''
- }
- },
- created() {
- this.getEvalCompanyData()
- this.getRuleallData()
- this.getDataDictionary() //模块 阶段
- this.getPeriodData()
- this.getOrganizetionData(23031000, 2)
- },
- methods: {
- // 查询单位数据
- getEvalCompanyData() {
- let that = this
- let params = {
- pageNum: that.page.currentPage,
- pageSize: that.page.pagesize,
- organizationType: 'DWKP',
- organizationName: that.companyS,
- binSection: that.binSectionIds,
- binStage: that.stageIds,
- evaluationCycle: that.periodId
- }
- apiGetOrganizationList(params).then(datas => {
- if (datas && datas.data) {
- that.evaluationCompanyData = datas.data.records
- that.page.total = datas.data.total
- }
- })
- },
- //查询组织数据
- getOrganizetionData(id, num) {
- let that = this
- let params = {
- id: id,
- num: num
- }
- apiGetorganizationgetTree(params).then(datas => {
- if (datas && datas.data && datas.data[0].children.length > 0) {
- that.companyDatas = datas.data[0].children
- }
- })
- },
- // 查询规则模块和阶段数据
- getDataDictionary() {
- let that = this
- apiGetbinsectionList().then(datas => {
- if (datas && datas.data) {
- that.moduleData = datas.data
- }
- })
- apiGetbinstageList().then(datas => {
- if (datas && datas.data) {
- that.stageData = datas.data
- }
- })
- },
- getRuleallData(val, val1) {
- let that = this
- let params = {
- // pageNum: 1,
- // pageSize: 50,
- binSection: val ? val.join(',') : '',
- binStage: val1 ? val1.join(',') : ''
- }
- apiGetevaluateListAll(params).then(datas => {
- if (datas && datas.data) {
- that.ruleDataAll = datas.data
- }
- })
- },
- //考评周期
- getPeriodData() {
- let that = this
- let params = {
- superKey: 'KPZQ0001'
- }
- apiGetdatadictionaryList(params).then(datas => {
- if (datas && datas.data) {
- that.periodData = datas.data
- }
- })
- },
- changeBinsection(val) {
- if (this.ruleForm.binSection !== '' && this.ruleForm.binStage !== '') {
- this.getRuleallData(this.ruleForm.binSection, this.ruleForm.binStage)
- }
- },
- // changeRule(val) {
- // let binStageArr = []
- // for (let i = 0; i < this.ruleDataAll.length; i++) {
- // let item = this.ruleDataAll[i]
- // for (let j = 0; j < val.length; j++) {
- // let itn = val[j]
- // if (item.id === itn) {
- // binStageArr.push(item.binStage)
- // }
- // }
- // }
- // this.ruleForm.binStage = this.useFilter(binStageArr)
- // },
- useFilter(arr) {
- return arr.filter(function (item, index) {
- return arr.indexOf(item) === index; // 因为indexOf 只能查找到第一个
- })
- },
- handleAdd() {
- this.dialogVisible = true
- this.isSave = false
- this.title = '新增考评单位'
- this.$nextTick(() => {
- // this.$refs['ruleForm'].resetFields()
- this.ruleForm = {
- organizationName: '',
- evaluateRule: [],
- binSection: [],
- binStage: [],
- evaluationCycle: '',
- isCheck: '是',
- scjyWeight: 0,
- qqWeight: 0,
- jjWeight: 0,
- // year: '',
- // month: 1,
- orderNum: 1
- }
- })
- },
- handleEdit() {
- this.dialogVisible = true
- this.isSave = true
- this.title = '修改考评单位'
- this.evalradio = this.changeDateSelect[0]
- this.ruleForm = {
- organizationName: this.evalradio.organizationId,
- evaluationCycle: this.evalradio.evaluationCycle,
- evaluateRule: this.evalradio.evaluateRuleId.split(','),
- binSection: this.evalradio.binSection.split(','),
- binStage: this.evalradio.binStage.split(','),
- isCheck: this.evalradio.isCheck ? '是' : '否',
- scjyWeight: this.evalradio.scjyWeight,
- qqWeight: this.evalradio.qqWeight,
- jjWeight: this.evalradio.jjWeight,
- // year: this.evalradio.year,
- // month: this.evalradio.month,
- orderNum: this.evalradio.orderNum
- }
- this.getRuleallData(this.evalradio.binSection, this.evalradio.binStage)
- },
- saveevaluationCompanyMsg(formName) {
- let that = this
- that.$refs[formName].validate((valid) => {
- if (valid) {
- that.saveAndEditIndicatorData()
- }
- });
- },
- //新增/修改指标数据
- saveAndEditIndicatorData() {
- let that = this
- let orgName = ''
- let referred = ''
- let busType = ''
- that.companyDatas.forEach(item => {
- if (item.id === that.ruleForm.organizationName) {
- orgName = item.name
- referred = item.shortName
- busType = item.businessType
- }
- })
- let params = {
- organizationName: orgName,
- evaluationCycle: that.ruleForm.evaluationCycle,
- organizationType: 'DWKP',
- organizationShortName: referred,
- evaluateRuleId: that.ruleForm.evaluateRule.join(','),
- binSection: that.ruleForm.binSection.join(','),
- binStage: that.ruleForm.binStage.join(','),
- orderNum: that.ruleForm.orderNum,
- isCheck: that.ruleForm.isCheck === '是' ? true : false,
- scjyWeight: that.ruleForm.scjyWeight,
- qqWeight: that.ruleForm.qqWeight,
- jjWeight: that.ruleForm.jjWeight,
- businessType: busType
- // year: that.ruleForm.year,
- // month: that.ruleForm.month
- }
- if (that.isSave) {
- params.id = this.evalradio.id
- params.organizationId = that.evalradio.organizationId
- } else {
- params.organizationId = that.ruleForm.organizationName
- }
- apiGetorganizationSaveList(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.getEvalCompanyData()
- }
- })
- },
- //删除指标数据
- handleDelete() {
- this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let that = this
- let paramsArr = []
- that.changeDateSelect.forEach(it => {
- paramsArr.push(it.id)
- })
- apiGetorganizationdeleteList(paramsArr.join(',')).then(datas => {
- if (datas) {
- that.$message({
- type: 'success',
- message: '删除成功!'
- });
- that.changeDateSelect = []
- that.getEvalCompanyData()
- }
- })
- })
- },
- rowClick(selection, row) {
- this.changeDateSelect = selection
- },
- getSeachData() {
- this.page.currentPage = 1
- this.getEvalCompanyData()
- },
- resetSeach() {
- this.page.currentPage = 1
- this.companyS = ''
- this.periodId = ''
- this.stageIds = ''
- this.binSectionIds = ''
- this.getEvalCompanyData()
- },
- successImport(val) {
- this.loadingImport = false
- this.getEvalCompanyData()
- },
- importLoading(val) {
- this.loadingImport = true
- },
- handleSizeChange(val) {
- this.page.pagesize = val
- this.getEvalCompanyData()
- },
- handleCurrentChange(val) {
- this.page.currentPage = val
- this.getEvalCompanyData()
- },
- handleImport() {
- this.$refs.importPage.upload.title = "考评指标管理信息导入"
- this.$refs.importPage.upload.open = true
- },
- }
- }
- </script>
- <style lang="less">
- .evaluationCompany {
- .evaluationCompanyBtn {
- .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;
- .el-input__inner {
- height: 30px;
- }
- .el-input__suffix {
- .el-select__caret {
- line-height: 30px;
- }
- }
- }
- .el-select{
- line-height: 40px !important;
- .el-input__inner, .is-disabled{
- height:40px !important;
- }
- .el-input__suffix{
- .el-select__caret{
- line-height:40px;
- }
- }
- }
- }
- }
- span {
- font-size: 14px;
- }
- .PeriodBtn {
- display: flex;
- justify-content: end;
- padding: 20px 0;
- }
- .el-button {
- height: 30px;
- // width:100px;
- padding: 0 30px;
- // padding-top: 8px;
- span {
- margin: 0;
- }
- }
- .indexdialog {
- .el-overlay {
- .el-dialog {
- .el-dialog__body {
- padding: 30px 60px 30px 20px !important;
- .periodFrom {
- .el-select,
- .el-input {
- width: 100%;
- }
- .el-input {
- height: 30px;
- }
- }
- }
- }
- }
- }
- }
- .evaluationCompanyTableData {
- .el-table {
- .el-table__body-wrapper {
- height: 60vh !important;
- }
- .el-input__inner {
- height: 30px !important;
- }
- .el-radio__label {
- display: none;
- }
- .tooltipCC {
- width: 300px;
- 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;
- }
- }
- }
- </style>
|