|
@@ -1,71 +1,72 @@
|
|
|
<template>
|
|
|
- <div class="box boxMinHeight" style="min-height: 1000px;">
|
|
|
- <header class="header">
|
|
|
- <div class="header-content flex-box-ce">
|
|
|
- <div class="flex-box-ce header-left" @click="$router.go(-1)">
|
|
|
- <i class="el-icon-arrow-left fontColorF"></i>
|
|
|
- <el-tooltip class="item" effect="dark" :content="title" placement="bottom">
|
|
|
- <div class="text fontColorB font-flex-word">{{ title }}</div>
|
|
|
- </el-tooltip>
|
|
|
- </div>
|
|
|
- <div class="flex-1 flex-box-ce flex-center-center">
|
|
|
- <div :class="[activeIndex == 1 ? 'active-step2' : '']" class="flex-box-ce flex-center-center step-item2 barder-a" @click="activeStep(1)">
|
|
|
- <span>1</span>
|
|
|
- <div>分组信息</div><strong></strong>
|
|
|
- </div>
|
|
|
- <el-popover popper-class="popover" placement="bottom" width="250" trigger="manual" content="可通过点击对应数字来切换节点" v-model="visible">
|
|
|
- <div slot="reference" :class="[activeIndex == 2 ? 'active-step2' : '']" class="flex-box flex-center-center step-item2 barder-a" @click="activeStep(2)">
|
|
|
- <span>2</span>
|
|
|
- <div>考核模板</div>
|
|
|
- </div>
|
|
|
- </el-popover>
|
|
|
- <div :class="[activeIndex == 3 ? 'active-step2' : '']" class="flex-box flex-center-center step-item2" @click="activeStep(3)">
|
|
|
- <span>3</span>
|
|
|
- <div>具体流程</div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="flex-box-end header-right">
|
|
|
- <template v-if="isShowBtn">
|
|
|
- <el-button style="margin-right: 10px;" @click="activeIndexA(false)" v-if="activeIndex!=1">上一步</el-button>
|
|
|
- <el-button style="margin-right: 10px;" @click="activeIndexA(true)" v-if="activeIndex!=3">下一步</el-button>
|
|
|
- <el-button style="margin-right: 10px;" @click="preview()" v-if="activeIndex==3">预览</el-button>
|
|
|
- <el-button type="primary" @click="save()">保存</el-button>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </header>
|
|
|
- <div style="height: 1px; background-color: #DCDFE6;margin-top: 5px;"></div>
|
|
|
- <div class="main">
|
|
|
- <!-- 基本信息 -->
|
|
|
- <BasicMessage v-show="activeIndex == 1" ref="BasicMessage" :isShowBtn.sync="isShowBtn" :data="basicMessage"></BasicMessage>
|
|
|
- <!-- 模板设计 -->
|
|
|
- <Template v-show="activeIndex == 2" ref="Template" :data="template"></Template>
|
|
|
- <!-- 流程设计 -->
|
|
|
- <Flow v-show="activeIndex == 3" ref="Flow" :isShowScore="isShowScore" :data="flow"></Flow>
|
|
|
- </div>
|
|
|
- <!-- 选择被考核人员 -->
|
|
|
- <EmployeeSelector
|
|
|
- :isRequired="true"
|
|
|
- title="选择预览人员"
|
|
|
- :isChecKedAll="false"
|
|
|
- :employee_list="employee_list"
|
|
|
- :visible.sync="setAdministrator"
|
|
|
- :multi="false"
|
|
|
- :is_employee_list="true"
|
|
|
- :is_filtration_creator="false"
|
|
|
- @confirm="confirmAdministrator"
|
|
|
- />
|
|
|
- <!-- 预览 -->
|
|
|
- <el-drawer title="预览" :visible.sync="showDrawerTow" direction="btt" class="all-derawer">
|
|
|
- <Preview
|
|
|
- v-if="showDrawerTow"
|
|
|
- :parameter="previewData.parameter"
|
|
|
- :groupId="previewData.group_id"
|
|
|
- :employeeId="previewData.employee_id"
|
|
|
- :employeeList="previewData.employee_list"
|
|
|
- ></Preview>
|
|
|
- </el-drawer>
|
|
|
- </div>
|
|
|
+ <div class="box boxMinHeight" style="min-height: 1000px;">
|
|
|
+ <header class="header">
|
|
|
+ <div class="header-content flex-box-ce">
|
|
|
+ <div class="flex-box-ce header-left" @click="$router.go(-1)">
|
|
|
+ <i class="el-icon-arrow-left fontColorF"></i>
|
|
|
+ <el-tooltip class="item" effect="dark" :content="title" placement="bottom">
|
|
|
+ <div class="text fontColorB font-flex-word">{{ title }}</div>
|
|
|
+ </el-tooltip>
|
|
|
+ </div>
|
|
|
+ <div class="flex-1 flex-box-ce flex-center-center">
|
|
|
+ <div :class="[activeIndex == 1 ? 'active-step2' : '']" class="flex-box-ce flex-center-center step-item2 barder-a" @click="activeStep(1)">
|
|
|
+ <span>1</span>
|
|
|
+ <div>分组信息</div>
|
|
|
+ <strong></strong>
|
|
|
+ </div>
|
|
|
+ <el-popover popper-class="popover" placement="bottom" width="250" trigger="manual" content="可通过点击对应数字来切换节点" v-model="visible">
|
|
|
+ <div slot="reference" :class="[activeIndex == 2 ? 'active-step2' : '']" class="flex-box flex-center-center step-item2 barder-a" @click="activeStep(2)">
|
|
|
+ <span>2</span>
|
|
|
+ <div>考核模板</div>
|
|
|
+ </div>
|
|
|
+ </el-popover>
|
|
|
+ <div :class="[activeIndex == 3 ? 'active-step2' : '']" class="flex-box flex-center-center step-item2" @click="activeStep(3)">
|
|
|
+ <span>3</span>
|
|
|
+ <div>具体流程</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="flex-box-end header-right">
|
|
|
+ <template v-if="isShowBtn">
|
|
|
+ <el-button style="margin-right: 10px;" @click="activeIndexA(false)" v-if="activeIndex != 1">上一步</el-button>
|
|
|
+ <el-button style="margin-right: 10px;" @click="activeIndexA(true)" v-if="activeIndex != 3">下一步</el-button>
|
|
|
+ <el-button style="margin-right: 10px;" @click="preview()" v-if="activeIndex == 3">预览</el-button>
|
|
|
+ <el-button type="primary" @click="save()">保存</el-button>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </header>
|
|
|
+ <div style="height: 1px; background-color: #DCDFE6;margin-top: 5px;"></div>
|
|
|
+ <div class="main">
|
|
|
+ <!-- 基本信息 -->
|
|
|
+ <BasicMessage v-show="activeIndex == 1" ref="BasicMessage" :isShowBtn.sync="isShowBtn" :data="basicMessage"></BasicMessage>
|
|
|
+ <!-- 模板设计 -->
|
|
|
+ <Template v-show="activeIndex == 2" ref="Template" :data="template"></Template>
|
|
|
+ <!-- 流程设计 -->
|
|
|
+ <Flow v-show="activeIndex == 3" ref="Flow" :isShowScore="isShowScore" :data="flow"></Flow>
|
|
|
+ </div>
|
|
|
+ <!-- 选择被考核人员 -->
|
|
|
+ <EmployeeSelector
|
|
|
+ :isRequired="true"
|
|
|
+ title="选择预览人员"
|
|
|
+ :isChecKedAll="false"
|
|
|
+ :employee_list="employee_list"
|
|
|
+ :visible.sync="setAdministrator"
|
|
|
+ :multi="false"
|
|
|
+ :is_employee_list="true"
|
|
|
+ :is_filtration_creator="false"
|
|
|
+ @confirm="confirmAdministrator"
|
|
|
+ />
|
|
|
+ <!-- 预览 -->
|
|
|
+ <el-drawer title="预览" :visible.sync="showDrawerTow" direction="btt" class="all-derawer">
|
|
|
+ <Preview
|
|
|
+ v-if="showDrawerTow"
|
|
|
+ :parameter="previewData.parameter"
|
|
|
+ :groupId="previewData.group_id"
|
|
|
+ :employeeId="previewData.employee_id"
|
|
|
+ :employeeList="previewData.employee_list"
|
|
|
+ ></Preview>
|
|
|
+ </el-drawer>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
@@ -75,866 +76,904 @@ import Template from '@/components/evaluate/Template';
|
|
|
import Flow from '@/components/evaluate/Flow';
|
|
|
import Preview from '@/components/public/Preview';
|
|
|
export default {
|
|
|
- components: { BasicMessage, Template, Flow, EmployeeSelector, Preview },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- title: '新建考核表',
|
|
|
- activeIndex: '1',
|
|
|
- dialogVisible: false,
|
|
|
- isShowScore: false, //是否在流程里显示指定评分人模块
|
|
|
- basicMessage: { mannager_ids: [] }, //基础信息(编辑)
|
|
|
- template: {}, //模板设计(编辑)
|
|
|
- flow: {}, //流程设计(编辑)
|
|
|
- id: '', //考核表ID(编辑)
|
|
|
- setAdministrator: false,
|
|
|
- parameter: {},
|
|
|
- employee_list: [],
|
|
|
- isPreview: false, //是否预览离开页面
|
|
|
- // 预览
|
|
|
- showDrawerTow: false,
|
|
|
- previewData: {
|
|
|
- parameter: {},
|
|
|
- group_id: '',
|
|
|
- employee_id: [],
|
|
|
- employee_list: {}
|
|
|
- },
|
|
|
- visible:false,
|
|
|
- isTs:false,//离开是否要提示
|
|
|
- isShowBtn:false,//控制提交按钮是否显示
|
|
|
- };
|
|
|
- },
|
|
|
- watch: {
|
|
|
- activeIndex(val) {
|
|
|
- if (val != '1') {
|
|
|
- this.isTs = true;
|
|
|
- }
|
|
|
- if(val==3){
|
|
|
- this.getIsShowScore();
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.isPreview = false;
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- if (this.$route.query.data) {
|
|
|
- this.recoverData();
|
|
|
- };
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.visible = true;
|
|
|
- setTimeout(()=>{
|
|
|
- this.visible = false;
|
|
|
- },3000)
|
|
|
- })
|
|
|
- },
|
|
|
- methods: {
|
|
|
- activeIndexA(is){
|
|
|
- this.activeIndex=is? this.activeIndex+1:this.activeIndex-1;
|
|
|
- if (this.activeIndex != '1') {
|
|
|
- this.isTs = true;
|
|
|
+ components: { BasicMessage, Template, Flow, EmployeeSelector, Preview },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ title: '新建考核表',
|
|
|
+ activeIndex: '1',
|
|
|
+ dialogVisible: false,
|
|
|
+ isShowScore: false, //是否在流程里显示指定评分人模块
|
|
|
+ basicMessage: { mannager_ids: [] }, //基础信息(编辑)
|
|
|
+ template: {}, //模板设计(编辑)
|
|
|
+ flow: {}, //流程设计(编辑)
|
|
|
+ id: '', //考核表ID(编辑)
|
|
|
+ setAdministrator: false,
|
|
|
+ parameter: {},
|
|
|
+ employee_list: [],
|
|
|
+ isPreview: false, //是否预览离开页面
|
|
|
+ // 预览
|
|
|
+ showDrawerTow: false,
|
|
|
+ previewData: {
|
|
|
+ parameter: {},
|
|
|
+ group_id: '',
|
|
|
+ employee_id: [],
|
|
|
+ employee_list: {}
|
|
|
+ },
|
|
|
+ visible: false,
|
|
|
+ isTs: false, //离开是否要提示
|
|
|
+ isShowBtn: false //控制提交按钮是否显示
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ activeIndex(val) {
|
|
|
+ if (val != '1') {
|
|
|
+ this.isTs = true;
|
|
|
+ }
|
|
|
+ if (val == 3) {
|
|
|
+ this.getIsShowScore();
|
|
|
+ }
|
|
|
}
|
|
|
- if(this.activeIndex==3){
|
|
|
- this.getIsShowScore();
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.isPreview = false;
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ if (this.$route.query.data) {
|
|
|
+ this.recoverData();
|
|
|
}
|
|
|
- },
|
|
|
- confirmAdministrator(val) {
|
|
|
- this.isPreview = true;
|
|
|
- if (val.employee.length == 0) {
|
|
|
- this.showMessage('请选择被考核人员');
|
|
|
- } else {
|
|
|
- this.previewData = {
|
|
|
- parameter: this.parameter,
|
|
|
- group_id: this.id,
|
|
|
- employee_id: val.employee,
|
|
|
- employee_list: this.employee_list
|
|
|
- };
|
|
|
- this.showDrawerTow = true;
|
|
|
- }
|
|
|
- },
|
|
|
- //预览
|
|
|
- preview() {
|
|
|
- // 判断三大模块填写是否符合规则
|
|
|
- var basicMessage, template, flow;
|
|
|
- basicMessage = this.getIsBasicMessage();
|
|
|
- if (basicMessage) {
|
|
|
- template = this.getIsTemplate();
|
|
|
- }
|
|
|
- if (template) {
|
|
|
- flow = this.getIsFlow();
|
|
|
- }
|
|
|
- if (!basicMessage || !template || !flow) {
|
|
|
- this.setActiveIndex(basicMessage, template, flow);
|
|
|
- return false;
|
|
|
- }
|
|
|
- this.parameter = {
|
|
|
- name: basicMessage.name, //考核表名称
|
|
|
- cycle_type: basicMessage.cycle_type, //周期类型 1-天 2-月度 3-季度 4-半年度 5-年度 6-自定义
|
|
|
- mannager_ids: basicMessage.mannager_ids, //管理员工ID 多个使用’,’隔开(默认为管理全部考核表用户的人员)(可传入特定考核表管理权限人员的ID)
|
|
|
- employee_ids: basicMessage.employee_ids, //被考核员工ID 多个使用’,’隔开
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.visible = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ this.visible = false;
|
|
|
+ }, 3000);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ activeIndexA(is) {
|
|
|
+ this.activeIndex = is ? Number(this.activeIndex) + 1 : this.activeIndex - 1;
|
|
|
+ if (this.activeIndex != '1') {
|
|
|
+ this.isTs = true;
|
|
|
+ }
|
|
|
+ if (this.activeIndex == 3) {
|
|
|
+ this.getIsShowScore();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ confirmAdministrator(val) {
|
|
|
+ this.isPreview = true;
|
|
|
+ if (val.employee.length == 0) {
|
|
|
+ this.showMessage('请选择被考核人员');
|
|
|
+ } else {
|
|
|
+ this.previewData = {
|
|
|
+ parameter: this.parameter,
|
|
|
+ group_id: this.id,
|
|
|
+ employee_id: val.employee,
|
|
|
+ employee_list: this.employee_list
|
|
|
+ };
|
|
|
+ this.showDrawerTow = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //预览
|
|
|
+ preview() {
|
|
|
+ // 判断三大模块填写是否符合规则
|
|
|
+ var basicMessage, template, flow;
|
|
|
+ basicMessage = this.getIsBasicMessage();
|
|
|
+ if (basicMessage) {
|
|
|
+ template = this.getIsTemplate();
|
|
|
+ }
|
|
|
+ if (template) {
|
|
|
+ flow = this.getIsFlow();
|
|
|
+ }
|
|
|
+ if (!basicMessage || !template || !flow) {
|
|
|
+ this.setActiveIndex(basicMessage, template, flow);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.parameter = {
|
|
|
+ name: basicMessage.name, //考核表名称
|
|
|
+ cycle_type: basicMessage.cycle_type, //周期类型 1-天 2-月度 3-季度 4-半年度 5-年度 6-自定义
|
|
|
+ mannager_ids: basicMessage.mannager_ids, //管理员工ID 多个使用’,’隔开(默认为管理全部考核表用户的人员)(可传入特定考核表管理权限人员的ID)
|
|
|
+ employee_ids: basicMessage.employee_ids, //被考核员工ID 多个使用’,’隔开
|
|
|
|
|
|
- calc_type: template.ruleForm.calc_type, //指标评分计算方式 1-加和计算 2-加权计算
|
|
|
- calc_dimension: template.ruleForm.calc_dimension, //是否维度权重参与计算 1-是 0-否
|
|
|
- dimension: JSON.stringify(template.dimensionalityList), //维度配置数组列表
|
|
|
+ calc_type: template.ruleForm.calc_type, //指标评分计算方式 1-加和计算 2-加权计算
|
|
|
+ calc_dimension: template.ruleForm.calc_dimension, //是否维度权重参与计算 1-是 0-否
|
|
|
+ dimension: JSON.stringify(template.dimensionalityList), //维度配置数组列表
|
|
|
|
|
|
- process: JSON.stringify(flow), //流程数组列表
|
|
|
- config: JSON.stringify({ index_score: { action: [] } }), //考核表配置
|
|
|
- auto_move: 0 //是否自动移除同类型其他考核表重复被考核人员 0 否 1 是
|
|
|
- };
|
|
|
- this.setAdministrator = true;
|
|
|
- },
|
|
|
- // 编辑时复原整个流程数据
|
|
|
- recoverData() {
|
|
|
- let data = JSON.parse(this.$route.query.data);
|
|
|
- this.title = data.name;
|
|
|
- this.id = data.id;
|
|
|
- // 基础信息
|
|
|
- this.basicMessage = {
|
|
|
- id: data.id,
|
|
|
- name: data.name, //考核表名称
|
|
|
- cycle_type: data.cycle_type, //周期类型 1-天 2-月度 3-季度 4-半年度 5-年度 6-自定义
|
|
|
- mannager_ids: data.mannager_ids, //管理员工ID 多个使用’,’隔开(默认为管理全部考核表用户的人员)(可传入特定考核表管理权限人员的ID)
|
|
|
- employee_ids: data.employee_ids, //被考核员工ID 多个使用’,’隔开
|
|
|
- employees: data.employees
|
|
|
- };
|
|
|
- // 模板设计
|
|
|
- this.template = {
|
|
|
- calc_type: data.calc_type, //指标评分计算方式 1-加和计算 2-加权计算
|
|
|
- calc_dimension: data.calc_dimension, //是否维度权重参与计算 1-是 0-否
|
|
|
- dimension: data.dimension //维度配置数组列表
|
|
|
- };
|
|
|
- // 模板设计
|
|
|
- this.flow = {
|
|
|
- process: data.process //维度配置数组列表
|
|
|
- };
|
|
|
- if(this.$route.query.index){
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.activeIndex=this.$route.query.index;
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+ process: JSON.stringify(flow), //流程数组列表
|
|
|
+ config: JSON.stringify({ index_score: { action: [] } }), //考核表配置
|
|
|
+ auto_move: 0 //是否自动移除同类型其他考核表重复被考核人员 0 否 1 是
|
|
|
+ };
|
|
|
+ this.setAdministrator = true;
|
|
|
+ },
|
|
|
+ // 编辑时复原整个流程数据
|
|
|
+ recoverData() {
|
|
|
+ let data = JSON.parse(this.$route.query.data);
|
|
|
+ this.title = data.name;
|
|
|
+ this.id = data.id;
|
|
|
+ // 基础信息
|
|
|
+ this.basicMessage = {
|
|
|
+ id: data.id,
|
|
|
+ name: data.name, //考核表名称
|
|
|
+ cycle_type: data.cycle_type, //周期类型 1-天 2-月度 3-季度 4-半年度 5-年度 6-自定义
|
|
|
+ mannager_ids: data.mannager_ids, //管理员工ID 多个使用’,’隔开(默认为管理全部考核表用户的人员)(可传入特定考核表管理权限人员的ID)
|
|
|
+ employee_ids: data.employee_ids, //被考核员工ID 多个使用’,’隔开
|
|
|
+ employees: data.employees
|
|
|
+ };
|
|
|
+ // 模板设计
|
|
|
+ this.template = {
|
|
|
+ calc_type: data.calc_type, //指标评分计算方式 1-加和计算 2-加权计算
|
|
|
+ calc_dimension: data.calc_dimension, //是否维度权重参与计算 1-是 0-否
|
|
|
+ dimension: data.dimension //维度配置数组列表
|
|
|
+ };
|
|
|
+ // 模板设计
|
|
|
+ this.flow = {
|
|
|
+ process: data.process //维度配置数组列表
|
|
|
+ };
|
|
|
+ if (this.$route.query.index) {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.activeIndex = this.$route.query.index;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- save(auto_move) {
|
|
|
- // 判断三大模块填写是否符合规则
|
|
|
- var basicMessage, template, flow;
|
|
|
- basicMessage = this.getIsBasicMessage();
|
|
|
- if (basicMessage) {
|
|
|
- template = this.getIsTemplate();
|
|
|
- }
|
|
|
- if (template) {
|
|
|
- flow = this.getIsFlow();
|
|
|
- }
|
|
|
- if (!basicMessage || !template || !flow) {
|
|
|
- this.setActiveIndex(basicMessage, template, flow);
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (flow.score_supervisor.enable == 0&&this.isTs) {
|
|
|
- this.$confirm('未设置上级评分节点,建议完善考核流程,前往设置?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.setActiveIndex(true, true, false);
|
|
|
- this.isTs=false;
|
|
|
- }).catch(() => {
|
|
|
- let parameter = {
|
|
|
- name: basicMessage.name, //考核表名称
|
|
|
- cycle_type: basicMessage.cycle_type, //周期类型 1-天 2-月度 3-季度 4-半年度 5-年度 6-自定义
|
|
|
- manager_ids_code: this.$returnCode(basicMessage.mannager_ids), //管理员工ID 多个使用’,’隔开(默认为管理全部考核表用户的人员)(可传入特定考核表管理权限人员的ID)
|
|
|
- employee_ids_code: this.$returnCode(basicMessage.employee_ids), //被考核员工ID 多个使用’,’隔开
|
|
|
+ save(auto_move) {
|
|
|
+ // 判断三大模块填写是否符合规则
|
|
|
+ var basicMessage, template, flow;
|
|
|
+ basicMessage = this.getIsBasicMessage();
|
|
|
+ if (basicMessage) {
|
|
|
+ template = this.getIsTemplate();
|
|
|
+ }
|
|
|
+ if (template) {
|
|
|
+ flow = this.getIsFlow();
|
|
|
+ }
|
|
|
+ if (!basicMessage || !template || !flow) {
|
|
|
+ this.setActiveIndex(basicMessage, template, flow);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (flow.score_supervisor.enable == 0 && this.isTs) {
|
|
|
+ this.$confirm('未设置上级评分节点,建议完善考核流程', '提示', {
|
|
|
+ confirmButtonText: '仍要保存',
|
|
|
+ cancelButtonText: '前往设置',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let parameter = {
|
|
|
+ name: basicMessage.name, //考核表名称
|
|
|
+ cycle_type: basicMessage.cycle_type, //周期类型 1-天 2-月度 3-季度 4-半年度 5-年度 6-自定义
|
|
|
+ manager_ids_code: this.$returnCode(basicMessage.mannager_ids), //管理员工ID 多个使用’,’隔开(默认为管理全部考核表用户的人员)(可传入特定考核表管理权限人员的ID)
|
|
|
+ employee_ids_code: this.$returnCode(basicMessage.employee_ids), //被考核员工ID 多个使用’,’隔开
|
|
|
+ calc_type: template.ruleForm.calc_type, //指标评分计算方式 1-加和计算 2-加权计算
|
|
|
+ calc_dimension: template.ruleForm.calc_dimension, //是否维度权重参与计算 1-是 0-否
|
|
|
+ dimension: JSON.stringify(template.dimensionalityList), //维度配置数组列表
|
|
|
+ process: JSON.stringify(flow), //流程数组列表
|
|
|
+ config: JSON.stringify({ index_score: { action: [] } }), //考核表配置
|
|
|
+ auto_move: auto_move ? auto_move : 0 //是否自动移除同类型其他考核表重复被考核人员 0 否 1 是
|
|
|
+ };
|
|
|
+ if (this.id) {
|
|
|
+ parameter.id = this.id;
|
|
|
+ }
|
|
|
+ this.$axios('post', '/api/per/evaluation/edit_group', parameter).then(res => {
|
|
|
+ if (res.data.code == 1) {
|
|
|
+ if (!res.data.data.result) {
|
|
|
+ this.activeIndex = '1';
|
|
|
+ let str=this.returnStr(basicMessage.cycle_type)
|
|
|
+ let html = `<div>
|
|
|
+ <h5>当前考核表周期为 “ ${str} ” </h5>
|
|
|
+ <div>${res.data.data.msg}是否改为到此考核表中进行考核</div>
|
|
|
+ </div>`;
|
|
|
+ this.$confirm(html, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ this.save(1);
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.isTs = false;
|
|
|
+ if (this.id) {
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ } else {
|
|
|
+ this.$message.success('创建成功');
|
|
|
+ }
|
|
|
+ this.$router.go(-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.setActiveIndex(true, true, false);
|
|
|
+ this.isTs = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ let parameter = {
|
|
|
+ name: basicMessage.name, //考核表名称
|
|
|
+ cycle_type: basicMessage.cycle_type, //周期类型 1-天 2-月度 3-季度 4-半年度 5-年度 6-自定义
|
|
|
+ manager_ids_code: this.$returnCode(basicMessage.mannager_ids), //管理员工ID 多个使用’,’隔开(默认为管理全部考核表用户的人员)(可传入特定考核表管理权限人员的ID)
|
|
|
+ employee_ids_code: this.$returnCode(basicMessage.employee_ids), //被考核员工ID 多个使用’,’隔开
|
|
|
|
|
|
- calc_type: template.ruleForm.calc_type, //指标评分计算方式 1-加和计算 2-加权计算
|
|
|
- calc_dimension: template.ruleForm.calc_dimension, //是否维度权重参与计算 1-是 0-否
|
|
|
- dimension: JSON.stringify(template.dimensionalityList), //维度配置数组列表
|
|
|
+ calc_type: template.ruleForm.calc_type, //指标评分计算方式 1-加和计算 2-加权计算
|
|
|
+ calc_dimension: template.ruleForm.calc_dimension, //是否维度权重参与计算 1-是 0-否
|
|
|
+ dimension: JSON.stringify(template.dimensionalityList), //维度配置数组列表
|
|
|
|
|
|
- process: JSON.stringify(flow), //流程数组列表
|
|
|
- config: JSON.stringify({ index_score: { action: [] } }), //考核表配置
|
|
|
- auto_move: auto_move ? auto_move : 0 //是否自动移除同类型其他考核表重复被考核人员 0 否 1 是
|
|
|
- };
|
|
|
- if (this.id) {
|
|
|
- parameter.id = this.id;
|
|
|
- }
|
|
|
- this.$axios('post', '/api/per/evaluation/edit_group', parameter).then(res => {
|
|
|
- if (res.data.code == 1) {
|
|
|
- if (!res.data.data.result) {
|
|
|
- this.activeIndex = '1';
|
|
|
- this.$confirm(res.data.data.msg + ',是否改为到此考核表中进行考核', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.save(1);
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- } else {
|
|
|
- this.isTs = false;
|
|
|
- if (this.id) {
|
|
|
- this.$message.success('保存成功');
|
|
|
- } else {
|
|
|
- this.$message.success('创建成功');
|
|
|
- }
|
|
|
- this.$router.go(-1);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- } else {
|
|
|
- let parameter = {
|
|
|
- name: basicMessage.name, //考核表名称
|
|
|
- cycle_type: basicMessage.cycle_type, //周期类型 1-天 2-月度 3-季度 4-半年度 5-年度 6-自定义
|
|
|
- manager_ids_code: this.$returnCode(basicMessage.mannager_ids), //管理员工ID 多个使用’,’隔开(默认为管理全部考核表用户的人员)(可传入特定考核表管理权限人员的ID)
|
|
|
- employee_ids_code: this.$returnCode(basicMessage.employee_ids), //被考核员工ID 多个使用’,’隔开
|
|
|
+ process: JSON.stringify(flow), //流程数组列表
|
|
|
+ config: JSON.stringify({ index_score: { action: [] } }), //考核表配置
|
|
|
+ auto_move: auto_move ? auto_move : 0 //是否自动移除同类型其他考核表重复被考核人员 0 否 1 是
|
|
|
+ };
|
|
|
+ if (this.id) {
|
|
|
+ parameter.id = this.id;
|
|
|
+ }
|
|
|
+ this.$axios('post', '/api/per/evaluation/edit_group', parameter).then(res => {
|
|
|
+ if (res.data.code == 1) {
|
|
|
+ if (!res.data.data.result) {
|
|
|
+ this.activeIndex = '1';
|
|
|
+ let str=this.returnStr(basicMessage.cycle_type)
|
|
|
+ let html = `<div>
|
|
|
+ <h5>当前考核表周期为 “ ${str} ” </h5>
|
|
|
+ <div>${res.data.data.msg}是否改为到此考核表中进行考核</div>
|
|
|
+ </div>`;
|
|
|
+ this.$confirm(html, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.save(1);
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ } else {
|
|
|
+ this.isTs = false;
|
|
|
+ if (this.id) {
|
|
|
+ this.$message.success('保存成功');
|
|
|
+ } else {
|
|
|
+ this.$message.success('创建成功');
|
|
|
+ }
|
|
|
+ this.$router.go(-1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ returnStr(num) {
|
|
|
+ let str = '';
|
|
|
+ switch (num) {
|
|
|
+ case 1:
|
|
|
+ str = '天';
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ str = '月度';
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ str = '季度';
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ str = '半年季';
|
|
|
+ break;
|
|
|
+ case 5:
|
|
|
+ str = '年度';
|
|
|
+ break;
|
|
|
+ case 6:
|
|
|
+ str = '自定义';
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ },
|
|
|
+ // 流程设计获取与判断
|
|
|
+ getIsFlow() {
|
|
|
+ this.getIsShowScore();
|
|
|
+ let target = this.$refs['Flow'].target; // 目标制定
|
|
|
+ let confirmor = this.$refs['Flow'].$refs['Affirm'].confirmor; //目标确认
|
|
|
+ let supervisor = this.$refs['Flow'].$refs['SuperiorFlow'].score_supervisor; //上级评分数据
|
|
|
+ let special_scorer = this.$refs['Flow'].special_scorer; // 指定评分人
|
|
|
+ let reviewer = this.$refs['Flow'].$refs['Examine'].review; // 审批节点
|
|
|
+ let cc = this.$refs['Flow'].cc; // 抄送
|
|
|
|
|
|
- calc_type: template.ruleForm.calc_type, //指标评分计算方式 1-加和计算 2-加权计算
|
|
|
- calc_dimension: template.ruleForm.calc_dimension, //是否维度权重参与计算 1-是 0-否
|
|
|
- dimension: JSON.stringify(template.dimensionalityList), //维度配置数组列表
|
|
|
+ // 目标制定
|
|
|
+ if (target.type == 3) {
|
|
|
+ if (target.employeeList.length == 0) {
|
|
|
+ this.showMessage('目标制定请选择指定成员');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ target.employeeList = [];
|
|
|
+ }
|
|
|
+ // 目标确认
|
|
|
+ let isCfMployee = true; //判断目标确认人员是否有选择
|
|
|
+ confirmor.forEach(item => {
|
|
|
+ item.employee_ids = this.filtrationArr(item.employeeList);
|
|
|
+ item.action = this.isCx([{ index: item.index }, { transfer: item.transfer }]);
|
|
|
+ if (item.type == 2 && item.employeeList.length == 0) {
|
|
|
+ isCfMployee = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- process: JSON.stringify(flow), //流程数组列表
|
|
|
- config: JSON.stringify({ index_score: { action: [] } }), //考核表配置
|
|
|
- auto_move: auto_move ? auto_move : 0 //是否自动移除同类型其他考核表重复被考核人员 0 否 1 是
|
|
|
- };
|
|
|
- if (this.id) {
|
|
|
- parameter.id = this.id;
|
|
|
- }
|
|
|
- this.$axios('post', '/api/per/evaluation/edit_group', parameter).then(res => {
|
|
|
- if (res.data.code == 1) {
|
|
|
- if (!res.data.data.result) {
|
|
|
- this.activeIndex = '1';
|
|
|
- this.$confirm(res.data.data.msg + ',是否改为到此考核表中进行考核', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(() => {
|
|
|
- this.save(1);
|
|
|
- })
|
|
|
- .catch(() => {});
|
|
|
- } else {
|
|
|
- this.isTs = false;
|
|
|
- if (this.id) {
|
|
|
- this.$message.success('保存成功');
|
|
|
- } else {
|
|
|
- this.$message.success('创建成功');
|
|
|
- }
|
|
|
- this.$router.go(-1);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- // 流程设计获取与判断
|
|
|
- getIsFlow() {
|
|
|
- this.getIsShowScore();
|
|
|
- let target = this.$refs['Flow'].target; // 目标制定
|
|
|
- let confirmor = this.$refs['Flow'].$refs['Affirm'].confirmor; //目标确认
|
|
|
- let supervisor = this.$refs['Flow'].$refs['SuperiorFlow'].score_supervisor; //上级评分数据
|
|
|
- let special_scorer = this.$refs['Flow'].special_scorer; // 指定评分人
|
|
|
- let reviewer = this.$refs['Flow'].$refs['Examine'].review; // 审批节点
|
|
|
- let cc = this.$refs['Flow'].cc; // 抄送
|
|
|
-
|
|
|
- // 目标制定
|
|
|
- if(target.type==3){
|
|
|
- if(target.employeeList.length==0){
|
|
|
- this.showMessage('目标制定请选择指定成员');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }else{
|
|
|
- target.employeeList=[]
|
|
|
- }
|
|
|
- // 目标确认
|
|
|
- let isCfMployee=true;//判断目标确认人员是否有选择
|
|
|
- confirmor.forEach(item => {
|
|
|
- item.employee_ids = this.filtrationArr(item.employeeList);
|
|
|
- item.action = this.isCx([{ index: item.index }, { transfer: item.transfer }]);
|
|
|
- if (item.type == 2 && item.employeeList.length == 0) {
|
|
|
- isCfMployee = false;
|
|
|
- }
|
|
|
- });
|
|
|
+ if (this.$refs['Flow'].$refs['Affirm'].enable) {
|
|
|
+ if (!isCfMployee) {
|
|
|
+ this.showMessage('目标确认请选择指定成员');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //上级评分
|
|
|
+ let indexSum = 0;
|
|
|
+ let isLing = true;
|
|
|
+ let isEmployee = true; //判断上级评分人员是否有选择
|
|
|
+ supervisor.forEach(item => {
|
|
|
+ item.supervisor_confirm = item.is_supervisor_confirm ? 1 : 0;
|
|
|
+ item.role_name = 'creator';
|
|
|
+ item.employee_ids = this.filtrationArr(item.employeeList);
|
|
|
+ item.action = this.isCx([{ comment: item.comment }, { summary: item.summary }]);
|
|
|
+ item.transfer = item.isTransfer ? 1 : 0;
|
|
|
+ if (item.weight == 0) {
|
|
|
+ isLing = false;
|
|
|
+ }
|
|
|
+ indexSum += Number(item.weight);
|
|
|
+ if (item.type == 2 && item.employeeList.length == 0) {
|
|
|
+ isEmployee = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (this.$refs['Flow'].$refs['SuperiorFlow'].enable) {
|
|
|
+ if (!isEmployee) {
|
|
|
+ this.showMessage('上级评分请选择指定成员');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!isLing) {
|
|
|
+ this.showMessage('上级评分节点的权重不能为0%');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (indexSum != 100) {
|
|
|
+ this.showMessage('所有评分节点的权重总和必须等于100%');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // 指定评分人
|
|
|
+ special_scorer = {
|
|
|
+ enable: this.isShowScore ? 1 : 0,
|
|
|
+ action: this.isCx([{ comment: special_scorer.comment }, { summar: special_scorer.summar }])
|
|
|
+ };
|
|
|
+ let isEmployee2 = true; //判断审批节点指定成员是否有选择
|
|
|
+ //审批节点
|
|
|
+ reviewer.forEach(item => {
|
|
|
+ item.supervisor_confirm = item.is_supervisor_confirm ? 1 : 0;
|
|
|
+ item.action = this.isCx([{ transfer: item.transfer }, { refuse: item.refuse }]);
|
|
|
+ item.employee_ids = this.filtrationArr(item.employeeList);
|
|
|
+ if (item.type == 2 && item.employeeList.length == 0) {
|
|
|
+ isEmployee2 = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (this.$refs['Flow'].$refs['Examine'].enable) {
|
|
|
+ if (!isEmployee2) {
|
|
|
+ this.showMessage('审批节点请选择指定成员');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (cc.enable) {
|
|
|
+ if (cc.type == 2 && cc.employeeList.length == 0) {
|
|
|
+ this.showMessage('抄送请选择指定成员');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (cc.type == 1) {
|
|
|
+ cc.employeeList = [];
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- if(this.$refs['Flow'].$refs['Affirm'].enable){
|
|
|
- if (!isCfMployee) {
|
|
|
- this.showMessage('目标确认请选择指定成员');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- //上级评分
|
|
|
- let indexSum = 0;
|
|
|
- let isLing = true;
|
|
|
- let isEmployee = true; //判断上级评分人员是否有选择
|
|
|
- supervisor.forEach(item => {
|
|
|
- item.supervisor_confirm = item.is_supervisor_confirm ? 1 : 0;
|
|
|
- item.role_name = 'creator';
|
|
|
- item.employee_ids = this.filtrationArr(item.employeeList);
|
|
|
- item.action = this.isCx([{ comment: item.comment }, { summary: item.summary }]);
|
|
|
- item.transfer = item.isTransfer ? 1 : 0;
|
|
|
- if (item.weight == 0) {
|
|
|
- isLing = false;
|
|
|
- }
|
|
|
- indexSum += Number(item.weight);
|
|
|
- if (item.type == 2 && item.employeeList.length == 0) {
|
|
|
- isEmployee = false;
|
|
|
- }
|
|
|
- });
|
|
|
- if(this.$refs['Flow'].$refs['SuperiorFlow'].enable){
|
|
|
- if (!isEmployee) {
|
|
|
- this.showMessage('上级评分请选择指定成员');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- if (!isLing) {
|
|
|
- this.showMessage('上级评分节点的权重不能为0%');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (indexSum != 100) {
|
|
|
- this.showMessage('所有评分节点的权重总和必须等于100%');
|
|
|
- return false;
|
|
|
- }
|
|
|
- // 指定评分人
|
|
|
- special_scorer = {
|
|
|
- enable: this.isShowScore ? 1 : 0,
|
|
|
- action: this.isCx([{ comment: special_scorer.comment }, { summar: special_scorer.summar }])
|
|
|
- };
|
|
|
- let isEmployee2 = true; //判断审批节点指定成员是否有选择
|
|
|
- //审批节点
|
|
|
- reviewer.forEach(item => {
|
|
|
- item.supervisor_confirm = item.is_supervisor_confirm ? 1 : 0;
|
|
|
- item.action = this.isCx([{ transfer: item.transfer }, { refuse: item.refuse }]);
|
|
|
- item.employee_ids = this.filtrationArr(item.employeeList);
|
|
|
- if (item.type == 2 && item.employeeList.length == 0) {
|
|
|
- isEmployee2 = false;
|
|
|
- }
|
|
|
- });
|
|
|
- if(this.$refs['Flow'].$refs['Examine'].enable){
|
|
|
- if (!isEmployee2) {
|
|
|
- this.showMessage('审批节点请选择指定成员');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- if(cc.enable){
|
|
|
- if (cc.type == 2 && cc.employeeList.length == 0) {
|
|
|
- this.showMessage('抄送请选择指定成员');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if(cc.type == 1){
|
|
|
- cc.employeeList=[];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- let process = {
|
|
|
- type: this.$refs['Flow'].type, //流程方式 1-按评分人设置流程(默认) 2-按指标设置流程
|
|
|
- target: {
|
|
|
- //目标制定配置结果
|
|
|
- enable: 1, //是否启用 1-启用 0-禁用
|
|
|
- type: target.type, //制定者类型 1-系统(默认模板,不可制定目标直接进入下一步) 2-被考核人 3-指定成员 4-主管
|
|
|
- action: {
|
|
|
- //可执行动作(允许编辑内容)
|
|
|
- score_type: 1, //评分方式是否可编辑 1-可以 0-不可以
|
|
|
- result_source: 1, //结果值数据来源 1-可以 0-不可以
|
|
|
- reviewer: 1 //制定评分人 1-可以 0-不可以
|
|
|
- },
|
|
|
- multi_executor: target.multi_executor, //执行人多人时处理方式 1-依次制定 2-任一人制定即可
|
|
|
- manager_level: target.manager_level, //上级等级
|
|
|
- supervisor_confirm: 1, //是否有上级主管代替 1-是 0-否
|
|
|
- employee_ids: this.filtrationArr(target.employeeList) //制定成员id列表
|
|
|
- },
|
|
|
- confirm: {
|
|
|
- //目标确认配置结果
|
|
|
- enable: this.$refs['Flow'].$refs['Affirm'].enable, //是否启用 1-启用 0-禁用
|
|
|
- unique: 1, //重复去重
|
|
|
- confirmor:confirmor
|
|
|
- // confirmor: [
|
|
|
- // //确认人员列表
|
|
|
- // {
|
|
|
- // type: 1, //确认人类型 1-主管 2-指定成员 3-被考核人 4-角色
|
|
|
- // manager_level: 1, //主管级别
|
|
|
- // supervisor_confirm: 1, //找不到确认人,有上级主管代替 1-是 0-否
|
|
|
- // multi_executor: 1, //确认人多人时处理方式 1-依次确认 2-任一人确认 3-均需确认
|
|
|
- // action: [
|
|
|
- // //允许确认人动作
|
|
|
- // 'index', //修改指标
|
|
|
- // 'transfer' //转交
|
|
|
- // ],
|
|
|
- // employee_ids: [], //指定成员用户id列表(类型为指定成员时)
|
|
|
- // role_name: 'creator' //角色名称(类型为指定角色时)
|
|
|
- // }
|
|
|
- // ],
|
|
|
- },
|
|
|
- execution: {
|
|
|
- //执行中制定配置结果
|
|
|
- enable: 1 //是否启用 1-启用 0-禁用
|
|
|
- },
|
|
|
- score_self: {
|
|
|
- //自评指定配置结果
|
|
|
- enable: 0, //是否启用 1-启用 0-禁用
|
|
|
- weight: 0, //权重
|
|
|
- action: [
|
|
|
- //必填项动作
|
|
|
- 'comment', //指标评分说明
|
|
|
- 'summary' //评分总结
|
|
|
- ],
|
|
|
- rating: 0, //是否手动评级
|
|
|
- unique: 1 //评分人去重
|
|
|
- },
|
|
|
- score_mutual: {
|
|
|
- //互评配置结果
|
|
|
- enable: 0 //是否启用 1-启用 0-禁用
|
|
|
- },
|
|
|
- score_supervisor: {
|
|
|
- //上级评分
|
|
|
- enable: this.$refs['Flow'].$refs['SuperiorFlow'].enable, //是否启用 1-启用 0-禁用
|
|
|
- unique: this.$refs['Flow'].$refs['SuperiorFlow'].unique, //评分人去重 1-是 0-否
|
|
|
- supervisor: supervisor
|
|
|
- // supervisor: [ //上级配置列表
|
|
|
- // {
|
|
|
- // type: 1, //评分人类型 1-主管 2-指定成员 3-角色
|
|
|
- // manager_level: 1, //主管等级(只有评分人类型为主管时有效)
|
|
|
- // supervisor_confirm: 1, //找不到确认人时是否由上级主管代替(只有评分人类型为主管时有效) 1-是 0-否
|
|
|
- // role_name: "creator", //角色名(只有评分人类型为角色时有效)
|
|
|
- // employee_ids:[], //用户id列表(只有评分人类型为指定人员时有效)
|
|
|
- // weight: 10, //权重
|
|
|
- // multi_executor: 1, //评分人多人时 1-各自评分 2-任一人评分
|
|
|
- // rule: 1, //评分规则 1-指标均要评分 2-评分总结
|
|
|
- // action: [ //必填项
|
|
|
- // "comment", //指标评分说明
|
|
|
- // "summary" //评分总结
|
|
|
- // ],
|
|
|
- // rating: 0, //是否手动评分 1-是 0-否
|
|
|
- // transfer: 1 //是否允许转交 1-是 0-否
|
|
|
- // }
|
|
|
- // ]
|
|
|
- },
|
|
|
- special_scorer: special_scorer,
|
|
|
- // special_scorer: { //指定评分人(只有维度数据中有指定评分人的指标才会有)
|
|
|
- // enable:1, //是否启用 1-启用 0-禁用
|
|
|
- // action: ['comment','summar'] //必填项 'comment', //指标评分说明'summar ' //评分总
|
|
|
- // },
|
|
|
- review: {
|
|
|
- //审批节点
|
|
|
- enable: this.$refs['Flow'].$refs['Examine'].enable, //是否启用 1-启用 0-禁用
|
|
|
- unique: this.$refs['Flow'].$refs['Examine'].unique, //评分人去重 1-是 0-否
|
|
|
- reviewer: reviewer
|
|
|
- // reviewer: [ //审批人配置列表
|
|
|
- // {
|
|
|
- // type: 1, //用户种类 1-主管 2-指定成员 3-被考核人 4-角色
|
|
|
- // action: ['transfer','refuse'], //转交//驳回 //允许审批人动作
|
|
|
- // manager_level: 1, //主管级别(只有用户种类为主管有效)
|
|
|
- // supervisor_confirm: 1, //找不到审批人时,是否由上级主管代替(只有用户种类为主管有效)
|
|
|
- // multi_executor: 1, //审批人多人时选项 1-依次确认 2-任一人审批 3-均需审批(只有用户种类为主管、指定成员、角色时有效)
|
|
|
- // employee_ids:[], //用户id列表(只有用户种类为指定成员时有效)
|
|
|
- // role_name:"creator" //角色名(只有用户种类为角色时有效)
|
|
|
- // }
|
|
|
- // ]
|
|
|
- },
|
|
|
- cc: {
|
|
|
- //抄送配置
|
|
|
- enable: cc.enable, //是否启用 1-启用 0-禁用
|
|
|
- employee: {
|
|
|
- //抄送人员配置
|
|
|
- type: cc.type, //抄送人类型 1-主管 2-指定成员 3-角色
|
|
|
- manager_level: cc.manager_level, //主管等级(只有抄送人类型为主管时有效)
|
|
|
- employee_ids: this.filtrationArr(cc.employeeList), //指定成员id列表(只有抄送人类型为指定成员时有效)
|
|
|
- role_name: 'creator', //角色名称(只有抄送人类型为角色时有效)
|
|
|
- condition: cc.condition //抄送结果 1-得出总分 2-公示结果
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- return process;
|
|
|
- },
|
|
|
- // 模板设计获取与判断
|
|
|
- getIsTemplate() {
|
|
|
- let ruleForm = this.$refs['Template'].ruleForm;
|
|
|
- let dimensionalityList = this.$refs['Template'].dimensionalityList;
|
|
|
- let dimensionalityIndex = false; //判断维度是否有指标
|
|
|
- if (dimensionalityList.length == 0) {
|
|
|
- this.showMessage('维度不能为空');
|
|
|
- return false;
|
|
|
- }
|
|
|
- dimensionalityList.some(item => {
|
|
|
- if (item.index.length != 0) {
|
|
|
- dimensionalityIndex = true;
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
+ let process = {
|
|
|
+ type: this.$refs['Flow'].type, //流程方式 1-按评分人设置流程(默认) 2-按指标设置流程
|
|
|
+ target: {
|
|
|
+ //目标制定配置结果
|
|
|
+ enable: 1, //是否启用 1-启用 0-禁用
|
|
|
+ type: target.type, //制定者类型 1-系统(默认模板,不可制定目标直接进入下一步) 2-被考核人 3-指定成员 4-主管
|
|
|
+ action: {
|
|
|
+ //可执行动作(允许编辑内容)
|
|
|
+ score_type: 1, //评分方式是否可编辑 1-可以 0-不可以
|
|
|
+ result_source: 1, //结果值数据来源 1-可以 0-不可以
|
|
|
+ reviewer: 1 //制定评分人 1-可以 0-不可以
|
|
|
+ },
|
|
|
+ multi_executor: target.multi_executor, //执行人多人时处理方式 1-依次制定 2-任一人制定即可
|
|
|
+ manager_level: target.manager_level, //上级等级
|
|
|
+ supervisor_confirm: 1, //是否有上级主管代替 1-是 0-否
|
|
|
+ employee_ids: this.filtrationArr(target.employeeList) //制定成员id列表
|
|
|
+ },
|
|
|
+ confirm: {
|
|
|
+ //目标确认配置结果
|
|
|
+ enable: this.$refs['Flow'].$refs['Affirm'].enable, //是否启用 1-启用 0-禁用
|
|
|
+ unique: 1, //重复去重
|
|
|
+ confirmor: confirmor
|
|
|
+ // confirmor: [
|
|
|
+ // //确认人员列表
|
|
|
+ // {
|
|
|
+ // type: 1, //确认人类型 1-主管 2-指定成员 3-被考核人 4-角色
|
|
|
+ // manager_level: 1, //主管级别
|
|
|
+ // supervisor_confirm: 1, //找不到确认人,有上级主管代替 1-是 0-否
|
|
|
+ // multi_executor: 1, //确认人多人时处理方式 1-依次确认 2-任一人确认 3-均需确认
|
|
|
+ // action: [
|
|
|
+ // //允许确认人动作
|
|
|
+ // 'index', //修改指标
|
|
|
+ // 'transfer' //转交
|
|
|
+ // ],
|
|
|
+ // employee_ids: [], //指定成员用户id列表(类型为指定成员时)
|
|
|
+ // role_name: 'creator' //角色名称(类型为指定角色时)
|
|
|
+ // }
|
|
|
+ // ],
|
|
|
+ },
|
|
|
+ execution: {
|
|
|
+ //执行中制定配置结果
|
|
|
+ enable: 1 //是否启用 1-启用 0-禁用
|
|
|
+ },
|
|
|
+ score_self: {
|
|
|
+ //自评指定配置结果
|
|
|
+ enable: 0, //是否启用 1-启用 0-禁用
|
|
|
+ weight: 0, //权重
|
|
|
+ action: [
|
|
|
+ //必填项动作
|
|
|
+ 'comment', //指标评分说明
|
|
|
+ 'summary' //评分总结
|
|
|
+ ],
|
|
|
+ rating: 0, //是否手动评级
|
|
|
+ unique: 1 //评分人去重
|
|
|
+ },
|
|
|
+ score_mutual: {
|
|
|
+ //互评配置结果
|
|
|
+ enable: 0 //是否启用 1-启用 0-禁用
|
|
|
+ },
|
|
|
+ score_supervisor: {
|
|
|
+ //上级评分
|
|
|
+ enable: this.$refs['Flow'].$refs['SuperiorFlow'].enable, //是否启用 1-启用 0-禁用
|
|
|
+ unique: this.$refs['Flow'].$refs['SuperiorFlow'].unique, //评分人去重 1-是 0-否
|
|
|
+ supervisor: supervisor
|
|
|
+ // supervisor: [ //上级配置列表
|
|
|
+ // {
|
|
|
+ // type: 1, //评分人类型 1-主管 2-指定成员 3-角色
|
|
|
+ // manager_level: 1, //主管等级(只有评分人类型为主管时有效)
|
|
|
+ // supervisor_confirm: 1, //找不到确认人时是否由上级主管代替(只有评分人类型为主管时有效) 1-是 0-否
|
|
|
+ // role_name: "creator", //角色名(只有评分人类型为角色时有效)
|
|
|
+ // employee_ids:[], //用户id列表(只有评分人类型为指定人员时有效)
|
|
|
+ // weight: 10, //权重
|
|
|
+ // multi_executor: 1, //评分人多人时 1-各自评分 2-任一人评分
|
|
|
+ // rule: 1, //评分规则 1-指标均要评分 2-评分总结
|
|
|
+ // action: [ //必填项
|
|
|
+ // "comment", //指标评分说明
|
|
|
+ // "summary" //评分总结
|
|
|
+ // ],
|
|
|
+ // rating: 0, //是否手动评分 1-是 0-否
|
|
|
+ // transfer: 1 //是否允许转交 1-是 0-否
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ },
|
|
|
+ special_scorer: special_scorer,
|
|
|
+ // special_scorer: { //指定评分人(只有维度数据中有指定评分人的指标才会有)
|
|
|
+ // enable:1, //是否启用 1-启用 0-禁用
|
|
|
+ // action: ['comment','summar'] //必填项 'comment', //指标评分说明'summar ' //评分总
|
|
|
+ // },
|
|
|
+ review: {
|
|
|
+ //审批节点
|
|
|
+ enable: this.$refs['Flow'].$refs['Examine'].enable, //是否启用 1-启用 0-禁用
|
|
|
+ unique: this.$refs['Flow'].$refs['Examine'].unique, //评分人去重 1-是 0-否
|
|
|
+ reviewer: reviewer
|
|
|
+ // reviewer: [ //审批人配置列表
|
|
|
+ // {
|
|
|
+ // type: 1, //用户种类 1-主管 2-指定成员 3-被考核人 4-角色
|
|
|
+ // action: ['transfer','refuse'], //转交//驳回 //允许审批人动作
|
|
|
+ // manager_level: 1, //主管级别(只有用户种类为主管有效)
|
|
|
+ // supervisor_confirm: 1, //找不到审批人时,是否由上级主管代替(只有用户种类为主管有效)
|
|
|
+ // multi_executor: 1, //审批人多人时选项 1-依次确认 2-任一人审批 3-均需审批(只有用户种类为主管、指定成员、角色时有效)
|
|
|
+ // employee_ids:[], //用户id列表(只有用户种类为指定成员时有效)
|
|
|
+ // role_name:"creator" //角色名(只有用户种类为角色时有效)
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ },
|
|
|
+ cc: {
|
|
|
+ //抄送配置
|
|
|
+ enable: cc.enable, //是否启用 1-启用 0-禁用
|
|
|
+ employee: {
|
|
|
+ //抄送人员配置
|
|
|
+ type: cc.type, //抄送人类型 1-主管 2-指定成员 3-角色
|
|
|
+ manager_level: cc.manager_level, //主管等级(只有抄送人类型为主管时有效)
|
|
|
+ employee_ids: this.filtrationArr(cc.employeeList), //指定成员id列表(只有抄送人类型为指定成员时有效)
|
|
|
+ role_name: 'creator', //角色名称(只有抄送人类型为角色时有效)
|
|
|
+ condition: cc.condition //抄送结果 1-得出总分 2-公示结果
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ return process;
|
|
|
+ },
|
|
|
+ // 模板设计获取与判断
|
|
|
+ getIsTemplate() {
|
|
|
+ let ruleForm = this.$refs['Template'].ruleForm;
|
|
|
+ let dimensionalityList = this.$refs['Template'].dimensionalityList;
|
|
|
+ let dimensionalityIndex = false; //判断维度是否有指标
|
|
|
+ if (dimensionalityList.length == 0) {
|
|
|
+ this.showMessage('维度不能为空');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ dimensionalityList.some(item => {
|
|
|
+ if (item.index.length != 0) {
|
|
|
+ dimensionalityIndex = true;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
- if (!dimensionalityIndex) {
|
|
|
- this.showMessage('维度中指标至少有一条');
|
|
|
- return false;
|
|
|
- }
|
|
|
+ if (!dimensionalityIndex) {
|
|
|
+ this.showMessage('维度中指标至少有一条');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- if (ruleForm.calc_dimension == 1) {
|
|
|
- //当维度参与时
|
|
|
- let indexSum = 0;
|
|
|
- let is = false; //是否有量化跟非量化
|
|
|
- dimensionalityList.forEach(item => {
|
|
|
- if (item.index_type == 1 || item.index_type == 2) {
|
|
|
- is = true;
|
|
|
- indexSum += Number(item.dimension_weight);
|
|
|
- }
|
|
|
- });
|
|
|
- if (indexSum != 100 && is) {
|
|
|
- this.showMessage('所有维度的权重相加要等于100%');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- if (ruleForm.calc_type == 2 && ruleForm.calc_dimension == 0) {
|
|
|
- //当为加权计算,维度权重不参与时
|
|
|
- let indexSum = 0;
|
|
|
- let is = false; //是否有量化跟非量化
|
|
|
- dimensionalityList.forEach(item => {
|
|
|
- if (item.index.length > 0) {
|
|
|
- item.index.forEach(item2 => {
|
|
|
- if (item.index_type == 1 || item.index_type == 2) {
|
|
|
- is = true;
|
|
|
- indexSum += Number(item2.weight);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- if (indexSum != 100 && is) {
|
|
|
- this.showMessage('各维度中的所有指标权重相加要等于100%');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- if (ruleForm.calc_type == 2 && ruleForm.calc_dimension == 1) {
|
|
|
- //当为加权计算,维度权重参与时
|
|
|
- let isSum = true;
|
|
|
- let str = '';
|
|
|
- dimensionalityList.forEach(item => {
|
|
|
- if (item.index_type == 1 || item.index_type == 2) {
|
|
|
- let indexSum = 0;
|
|
|
- if (item.index.length > 0) {
|
|
|
- item.index.forEach(item2 => {
|
|
|
- indexSum += Number(item2.weight);
|
|
|
- });
|
|
|
- }
|
|
|
- if (indexSum != 100) {
|
|
|
- str = item.name;
|
|
|
- isSum = false;
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- if (!isSum) {
|
|
|
- this.showMessage('“' + str + '” 的指标权重相加要等于100%');
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (ruleForm.calc_dimension == 1) {
|
|
|
+ //当维度参与时
|
|
|
+ let indexSum = 0;
|
|
|
+ let is = false; //是否有量化跟非量化
|
|
|
+ dimensionalityList.forEach(item => {
|
|
|
+ if (item.index_type == 1 || item.index_type == 2) {
|
|
|
+ is = true;
|
|
|
+ indexSum += Number(item.dimension_weight);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (indexSum != 100 && is) {
|
|
|
+ this.showMessage('所有维度的权重相加要等于100%');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ruleForm.calc_type == 2 && ruleForm.calc_dimension == 0) {
|
|
|
+ //当为加权计算,维度权重不参与时
|
|
|
+ let indexSum = 0;
|
|
|
+ let is = false; //是否有量化跟非量化
|
|
|
+ dimensionalityList.forEach(item => {
|
|
|
+ if (item.index.length > 0) {
|
|
|
+ item.index.forEach(item2 => {
|
|
|
+ if (item.index_type == 1 || item.index_type == 2) {
|
|
|
+ is = true;
|
|
|
+ indexSum += Number(item2.weight);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (indexSum != 100 && is) {
|
|
|
+ this.showMessage('各维度中的所有指标权重相加要等于100%');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ruleForm.calc_type == 2 && ruleForm.calc_dimension == 1) {
|
|
|
+ //当为加权计算,维度权重参与时
|
|
|
+ let isSum = true;
|
|
|
+ let str = '';
|
|
|
+ dimensionalityList.forEach(item => {
|
|
|
+ if (item.index_type == 1 || item.index_type == 2) {
|
|
|
+ let indexSum = 0;
|
|
|
+ if (item.index.length > 0) {
|
|
|
+ item.index.forEach(item2 => {
|
|
|
+ indexSum += Number(item2.weight);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (indexSum != 100) {
|
|
|
+ str = item.name;
|
|
|
+ isSum = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (!isSum) {
|
|
|
+ this.showMessage('“' + str + '” 的指标权重相加要等于100%');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- dimensionalityList.forEach(item => {
|
|
|
- //重置数据
|
|
|
- item.target_index = item.target_index ? 1 : 0;
|
|
|
- if (item.index.length > 0) {
|
|
|
- item.index.forEach(item2 => {
|
|
|
- item2.type = item2.type;
|
|
|
- item2.per_remark = item2.per_remark;
|
|
|
- item2.remark = item2.remark;
|
|
|
- item2.target = item2.target;
|
|
|
- item2.result_type = item2.result_type;
|
|
|
- item2.result_employee_id = item2.result_employee_id;
|
|
|
- item2.unit = item2.unit;
|
|
|
- item2.weight = item2.weight;
|
|
|
- item2.reviewer_id = item2.reviewer_id; //指标的指定评分人id
|
|
|
- item2.need = 0;
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- return { ruleForm, dimensionalityList };
|
|
|
- },
|
|
|
- // 基础信息获取与判断
|
|
|
- getIsBasicMessage() {
|
|
|
- let ruleForm = this.$refs['BasicMessage'].ruleForm;
|
|
|
- if (!ruleForm.name) {
|
|
|
- this.showMessage('考核表名称不能为空');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (ruleForm.name.length<2) {
|
|
|
- this.showMessage('考核表名称不能小于两位');
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!ruleForm.employee_ids) {
|
|
|
- this.showMessage('被考核人员不能为空');
|
|
|
- return false;
|
|
|
- }
|
|
|
- let selected = this.$refs['BasicMessage'].selected;
|
|
|
- this.employee_list = selected.employee;
|
|
|
- return ruleForm;
|
|
|
- },
|
|
|
+ dimensionalityList.forEach(item => {
|
|
|
+ //重置数据
|
|
|
+ item.target_index = item.target_index ? 1 : 0;
|
|
|
+ if (item.index.length > 0) {
|
|
|
+ item.index.forEach(item2 => {
|
|
|
+ item2.type = item2.type;
|
|
|
+ item2.per_remark = item2.per_remark;
|
|
|
+ item2.remark = item2.remark;
|
|
|
+ item2.target = item2.target;
|
|
|
+ item2.result_type = item2.result_type;
|
|
|
+ item2.result_employee_id = item2.result_employee_id;
|
|
|
+ item2.unit = item2.unit;
|
|
|
+ item2.weight = item2.weight;
|
|
|
+ item2.reviewer_id = item2.reviewer_id; //指标的指定评分人id
|
|
|
+ item2.need = 0;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return { ruleForm, dimensionalityList };
|
|
|
+ },
|
|
|
+ // 基础信息获取与判断
|
|
|
+ getIsBasicMessage() {
|
|
|
+ let ruleForm = this.$refs['BasicMessage'].ruleForm;
|
|
|
+ if (!ruleForm.name) {
|
|
|
+ this.showMessage('考核表名称不能为空');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (ruleForm.name.length < 2) {
|
|
|
+ this.showMessage('考核表名称不能小于两位');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!ruleForm.employee_ids) {
|
|
|
+ this.showMessage('被考核人员不能为空');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ let selected = this.$refs['BasicMessage'].selected;
|
|
|
+ this.employee_list = selected.employee;
|
|
|
+ return ruleForm;
|
|
|
+ },
|
|
|
|
|
|
- setActiveIndex(str, str2, str3) {
|
|
|
- if (!str) {
|
|
|
- this.activeIndex = 1;
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!str2) {
|
|
|
- this.activeIndex = 2;
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (!str3) {
|
|
|
- this.activeIndex = 3;
|
|
|
- return false;
|
|
|
- }
|
|
|
- },
|
|
|
+ setActiveIndex(str, str2, str3) {
|
|
|
+ if (!str) {
|
|
|
+ this.activeIndex = 1;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!str2) {
|
|
|
+ this.activeIndex = 2;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (!str3) {
|
|
|
+ this.activeIndex = 3;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
|
|
|
- //处理权限,如果参数是真就加入数组返回
|
|
|
- isCx(arr) {
|
|
|
- let action = [];
|
|
|
- if (arr.length == 0) {
|
|
|
- return [];
|
|
|
- }
|
|
|
- arr.forEach(item => {
|
|
|
- for (let key in item) {
|
|
|
- if (item[key]) {
|
|
|
- action.push(key);
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- return action;
|
|
|
- },
|
|
|
- //过滤数组,返回数据中的ID
|
|
|
- filtrationArr(arr) {
|
|
|
- if (!arr) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if (arr.length == 0) {
|
|
|
- return [];
|
|
|
- }
|
|
|
- return arr.map(item => {
|
|
|
- return item.id;
|
|
|
- });
|
|
|
- },
|
|
|
- showMessage(str) {
|
|
|
- this.$message.error(str);
|
|
|
- },
|
|
|
- //判断模板设计维度里是否有指定评分人,有就再流程设置里,显示’指定评分人‘
|
|
|
- getIsShowScore() {
|
|
|
- this.isShowScore = false;
|
|
|
- var dimensionalityList = this.$refs['Template'].dimensionalityList;
|
|
|
- dimensionalityList.some(item => {
|
|
|
- if (item.index.length > 0) {
|
|
|
- item.index.some(item2 => {
|
|
|
- if (item2.reviewer_id != 0) {
|
|
|
- this.isShowScore = true;
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- activeStep(index) {
|
|
|
- //判断模板设计维度里是否有指定评分人,有就再流程设置里,显示’指定评分人‘
|
|
|
- if (index == 3) {
|
|
|
- this.isShowScore = false;
|
|
|
- var dimensionalityList = this.$refs['Template'].dimensionalityList;
|
|
|
- dimensionalityList.some(item => {
|
|
|
- if (item.index.length > 0) {
|
|
|
- item.index.some(item2 => {
|
|
|
- if (item2.reviewer_id != 0) {
|
|
|
- this.isShowScore = true;
|
|
|
- return true;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- this.activeIndex = index;
|
|
|
- } else {
|
|
|
- this.activeIndex = index;
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- beforeRouteLeave(to, from, next) {
|
|
|
- if (this.isTs && !this.isPreview) {
|
|
|
- setTimeout(() => {
|
|
|
- // hash模式下,此处必须要加延迟执行,主要解决浏览器前进后退带来的闪现
|
|
|
- this.$confirm('系统可能不会保存您做的更改。', '有修改的内容未保存,确认离开吗?', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => { next(); })
|
|
|
- .catch(() => {next(false);});
|
|
|
- }, 200);
|
|
|
- } else {
|
|
|
- next();
|
|
|
- }
|
|
|
- }
|
|
|
+ //处理权限,如果参数是真就加入数组返回
|
|
|
+ isCx(arr) {
|
|
|
+ let action = [];
|
|
|
+ if (arr.length == 0) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ arr.forEach(item => {
|
|
|
+ for (let key in item) {
|
|
|
+ if (item[key]) {
|
|
|
+ action.push(key);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return action;
|
|
|
+ },
|
|
|
+ //过滤数组,返回数据中的ID
|
|
|
+ filtrationArr(arr) {
|
|
|
+ if (!arr) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (arr.length == 0) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ return arr.map(item => {
|
|
|
+ return item.id;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ showMessage(str) {
|
|
|
+ this.$message.error(str);
|
|
|
+ },
|
|
|
+ //判断模板设计维度里是否有指定评分人,有就再流程设置里,显示’指定评分人‘
|
|
|
+ getIsShowScore() {
|
|
|
+ this.isShowScore = false;
|
|
|
+ var dimensionalityList = this.$refs['Template'].dimensionalityList;
|
|
|
+ dimensionalityList.some(item => {
|
|
|
+ if (item.index.length > 0) {
|
|
|
+ item.index.some(item2 => {
|
|
|
+ if (item2.reviewer_id != 0) {
|
|
|
+ this.isShowScore = true;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ activeStep(index) {
|
|
|
+ //判断模板设计维度里是否有指定评分人,有就再流程设置里,显示’指定评分人‘
|
|
|
+ if (index == 3) {
|
|
|
+ this.isShowScore = false;
|
|
|
+ var dimensionalityList = this.$refs['Template'].dimensionalityList;
|
|
|
+ dimensionalityList.some(item => {
|
|
|
+ if (item.index.length > 0) {
|
|
|
+ item.index.some(item2 => {
|
|
|
+ if (item2.reviewer_id != 0) {
|
|
|
+ this.isShowScore = true;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.activeIndex = index;
|
|
|
+ } else {
|
|
|
+ this.activeIndex = index;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
+ if (this.isTs && !this.isPreview) {
|
|
|
+ setTimeout(() => {
|
|
|
+ // hash模式下,此处必须要加延迟执行,主要解决浏览器前进后退带来的闪现
|
|
|
+ this.$confirm('系统可能不会保存您做的更改。', '有修改的内容未保存,确认离开吗?', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ next();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ next(false);
|
|
|
+ });
|
|
|
+ }, 200);
|
|
|
+ } else {
|
|
|
+ next();
|
|
|
+ }
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style scoped="scoped" lang="scss">
|
|
|
.box {
|
|
|
- padding: 20px;
|
|
|
- font-size: 14px;
|
|
|
- background-color: #fff;
|
|
|
- padding-top: 5px;
|
|
|
- min-width: 1200px;
|
|
|
+ padding: 20px;
|
|
|
+ font-size: 14px;
|
|
|
+ background-color: #fff;
|
|
|
+ padding-top: 5px;
|
|
|
+ min-width: 1200px;
|
|
|
}
|
|
|
.main {
|
|
|
- background-color: #fff;
|
|
|
+ background-color: #fff;
|
|
|
}
|
|
|
.box::-webkit-scrollbar {
|
|
|
- width: 3px;
|
|
|
- height: 10px;
|
|
|
- background-color: #fff;
|
|
|
+ width: 3px;
|
|
|
+ height: 10px;
|
|
|
+ background-color: #fff;
|
|
|
}
|
|
|
.box::-webkit-scrollbar-thumb {
|
|
|
- background-color: #d9d9d9;
|
|
|
+ background-color: #d9d9d9;
|
|
|
}
|
|
|
.el-header {
|
|
|
- background-color: #fff;
|
|
|
- padding: 0 !important;
|
|
|
- height: 60px;
|
|
|
+ background-color: #fff;
|
|
|
+ padding: 0 !important;
|
|
|
+ height: 60px;
|
|
|
}
|
|
|
.header-content {
|
|
|
- position: relative;
|
|
|
- box-sizing: border-box;
|
|
|
- height: 60px;
|
|
|
+ position: relative;
|
|
|
+ box-sizing: border-box;
|
|
|
+ height: 60px;
|
|
|
}
|
|
|
.header-right {
|
|
|
- width: 230px;
|
|
|
- text-align: right;
|
|
|
+ width: 230px;
|
|
|
+ text-align: right;
|
|
|
}
|
|
|
.header-left {
|
|
|
- width: 230px;
|
|
|
- box-sizing: border-box;
|
|
|
- height: 60px;
|
|
|
+ width: 230px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ height: 60px;
|
|
|
}
|
|
|
.header-left {
|
|
|
- cursor: pointer;
|
|
|
- height: 60px;
|
|
|
+ cursor: pointer;
|
|
|
+ height: 60px;
|
|
|
}
|
|
|
.header-left:hover .el-icon-arrow-left {
|
|
|
- background-color: #f5f7fa;
|
|
|
- color: #222;
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ color: #222;
|
|
|
}
|
|
|
.el-icon-arrow-left {
|
|
|
- font-size: 22px;
|
|
|
+ font-size: 22px;
|
|
|
}
|
|
|
.text {
|
|
|
- font-size: 18px;
|
|
|
- padding-left: 30px;
|
|
|
+ font-size: 18px;
|
|
|
+ padding-left: 30px;
|
|
|
}
|
|
|
.text::before {
|
|
|
- position: absolute;
|
|
|
- content: '';
|
|
|
- width: 1px;
|
|
|
- height: 36px;
|
|
|
- background-color: #ebebeb;
|
|
|
- left: 44px;
|
|
|
- top: 50%;
|
|
|
- margin-top: -18px;
|
|
|
+ position: absolute;
|
|
|
+ content: '';
|
|
|
+ width: 1px;
|
|
|
+ height: 36px;
|
|
|
+ background-color: #ebebeb;
|
|
|
+ left: 44px;
|
|
|
+ top: 50%;
|
|
|
+ margin-top: -18px;
|
|
|
}
|
|
|
|
|
|
.step-item2 {
|
|
|
- width: 200px;
|
|
|
- color: #d6d6d6;
|
|
|
- text-align: center;
|
|
|
- height: 60px;
|
|
|
- cursor: pointer;
|
|
|
- position: relative;
|
|
|
+ width: 200px;
|
|
|
+ color: #d6d6d6;
|
|
|
+ text-align: center;
|
|
|
+ height: 60px;
|
|
|
+ cursor: pointer;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
.step-item2 span {
|
|
|
- width: 36px;
|
|
|
- height: 36px;
|
|
|
- border-radius: 50%;
|
|
|
- text-align: center;
|
|
|
- line-height: 36px;
|
|
|
- font-size: 20px;
|
|
|
- border: 4px solid #d6d6d6;
|
|
|
+ width: 36px;
|
|
|
+ height: 36px;
|
|
|
+ border-radius: 50%;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 36px;
|
|
|
+ font-size: 20px;
|
|
|
+ border: 4px solid #d6d6d6;
|
|
|
}
|
|
|
.step-item2 div {
|
|
|
- font-size: 14px;
|
|
|
- margin-left: 5px;
|
|
|
+ font-size: 14px;
|
|
|
+ margin-left: 5px;
|
|
|
}
|
|
|
.active-step2 span {
|
|
|
- border: 4px solid #409eff;
|
|
|
- color: #fff;
|
|
|
- background-color: #409eff;
|
|
|
+ border: 4px solid #409eff;
|
|
|
+ color: #fff;
|
|
|
+ background-color: #409eff;
|
|
|
}
|
|
|
.active-step2 div {
|
|
|
- color: #409eff;
|
|
|
+ color: #409eff;
|
|
|
}
|
|
|
.barder-a::before {
|
|
|
- position: absolute;
|
|
|
- content: ' ';
|
|
|
- height: 4px;
|
|
|
- width: 90px;
|
|
|
- top: 28px;
|
|
|
- background-color: #d6d6d6;
|
|
|
- border-radius: 3px;
|
|
|
- right: -45px;
|
|
|
+ position: absolute;
|
|
|
+ content: ' ';
|
|
|
+ height: 4px;
|
|
|
+ width: 90px;
|
|
|
+ top: 28px;
|
|
|
+ background-color: #d6d6d6;
|
|
|
+ border-radius: 3px;
|
|
|
+ right: -45px;
|
|
|
}
|
|
|
|
|
|
.step-item {
|
|
|
- width: 140px;
|
|
|
- color: #777777;
|
|
|
- text-align: center;
|
|
|
- height: 60px;
|
|
|
- cursor: pointer;
|
|
|
+ width: 140px;
|
|
|
+ color: #777777;
|
|
|
+ text-align: center;
|
|
|
+ height: 60px;
|
|
|
+ cursor: pointer;
|
|
|
}
|
|
|
.step-item span {
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- border-radius: 50%;
|
|
|
- text-align: center;
|
|
|
- line-height: 24px;
|
|
|
- border: 1px solid #ebebeb;
|
|
|
- margin-right: 10px;
|
|
|
+ width: 24px;
|
|
|
+ height: 24px;
|
|
|
+ border-radius: 50%;
|
|
|
+ text-align: center;
|
|
|
+ line-height: 24px;
|
|
|
+ border: 1px solid #ebebeb;
|
|
|
+ margin-right: 10px;
|
|
|
}
|
|
|
.active-step {
|
|
|
- background-color: #1583f2;
|
|
|
- color: #fff;
|
|
|
+ background-color: #1583f2;
|
|
|
+ color: #fff;
|
|
|
}
|
|
|
.active-step span {
|
|
|
- border: 1px solid #1583f2;
|
|
|
- background-color: #fff;
|
|
|
- color: #1583f2;
|
|
|
+ border: 1px solid #1583f2;
|
|
|
+ background-color: #fff;
|
|
|
+ color: #1583f2;
|
|
|
}
|
|
|
|
|
|
// 预览
|
|
|
.all-derawer ::v-deep.el-drawer {
|
|
|
- height: 90% !important;
|
|
|
- border-radius: 10px 10px 0 0;
|
|
|
- background-color: #f5f7fa;
|
|
|
- min-width: 1100px !important;
|
|
|
+ height: 90% !important;
|
|
|
+ border-radius: 10px 10px 0 0;
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ min-width: 1100px !important;
|
|
|
}
|
|
|
.all-derawer ::v-deep.el-drawer__header {
|
|
|
- background-color: #f5f7fa;
|
|
|
- padding: 12px 20px;
|
|
|
- margin-bottom: 0px;
|
|
|
- font-size: 16px;
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ padding: 12px 20px;
|
|
|
+ margin-bottom: 0px;
|
|
|
+ font-size: 16px;
|
|
|
}
|
|
|
.all-derawer ::v-deep.el-drawer__body {
|
|
|
- height: calc(100vh - 500px);
|
|
|
- background-color: #fff;
|
|
|
- overflow: auto;
|
|
|
+ height: calc(100vh - 500px);
|
|
|
+ background-color: #fff;
|
|
|
+ overflow: auto;
|
|
|
}
|
|
|
// 滚动条样式
|
|
|
.all-derawer ::v-deep.el-drawer__body::-webkit-scrollbar {
|
|
|
- width: 4px;
|
|
|
- height: 4px;
|
|
|
+ width: 4px;
|
|
|
+ height: 4px;
|
|
|
}
|
|
|
|
|
|
/*外层轨道。可以用display:none让其不显示,也可以添加背景图片,颜色改变显示效果*/
|
|
|
.all-derawer ::v-deep.el-drawer__body::-webkit-scrollbar-track {
|
|
|
- width: 6px;
|
|
|
- background-color: #fff0;
|
|
|
- -webkit-border-radius: 2em;
|
|
|
- -moz-border-radius: 2em;
|
|
|
- border-radius: 2em;
|
|
|
+ width: 6px;
|
|
|
+ background-color: #fff0;
|
|
|
+ -webkit-border-radius: 2em;
|
|
|
+ -moz-border-radius: 2em;
|
|
|
+ border-radius: 2em;
|
|
|
}
|
|
|
|
|
|
/*滚动条的设置*/
|
|
|
.all-derawer ::v-deep.el-drawer__body::-webkit-scrollbar-thumb {
|
|
|
- background-color: #fff0;
|
|
|
- background-clip: padding-box;
|
|
|
- -webkit-border-radius: 2em;
|
|
|
- -moz-border-radius: 2em;
|
|
|
- border-radius: 2em;
|
|
|
+ background-color: #fff0;
|
|
|
+ background-clip: padding-box;
|
|
|
+ -webkit-border-radius: 2em;
|
|
|
+ -moz-border-radius: 2em;
|
|
|
+ border-radius: 2em;
|
|
|
}
|
|
|
/*滚动条移上去的背景*/
|
|
|
.all-derawer ::v-deep.el-drawer__body:hover::-webkit-scrollbar-thumb {
|
|
|
- background-color: rgba(144, 147, 153, 0.3);
|
|
|
- height: 20px;
|
|
|
+ background-color: rgba(144, 147, 153, 0.3);
|
|
|
+ height: 20px;
|
|
|
}
|
|
|
::v-deep :focus {
|
|
|
- outline: 0;
|
|
|
+ outline: 0;
|
|
|
}
|
|
|
</style>
|