472 lines
22 KiB
HTML
472 lines
22 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
<style>
|
|
#app {
|
|
height: 100%;
|
|
overflow-y: unset !important;
|
|
}
|
|
|
|
.el-form {
|
|
height: calc(100vh - 100px) !important;
|
|
}
|
|
|
|
.el-divider {
|
|
background-color: #1867b0;
|
|
}
|
|
|
|
.el-divider__text {
|
|
color: #1867b0;
|
|
}
|
|
</style>
|
|
<div id="app" v-cloak>
|
|
<guava ref="guava">
|
|
|
|
<template>
|
|
<el-card shadow="never">
|
|
<div class="search">
|
|
<div class="search-item">
|
|
<div class="search-item-label">年度:</div>
|
|
<div class="search-item-option">
|
|
<el-date-picker
|
|
:picker-options="pickerOptions"
|
|
v-model="pageForm.annual"
|
|
type="year"
|
|
style="width: 100%"
|
|
value-format="yyyy"
|
|
placeholder="选择年度">
|
|
</el-date-picker>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="search-item">
|
|
<div class="search-item-label">评议名称:</div>
|
|
<div class="search-item-option">
|
|
<el-input v-model="pageForm.assessment" placeholder="根据测评名称查询"></el-input>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="search-query">
|
|
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索</el-button>
|
|
</div>
|
|
</div>
|
|
</el-card>
|
|
|
|
<el-card shadow="never" class="mt20">
|
|
<table-tool label="项目列表" :app="this">
|
|
<template #func>
|
|
<!--<el-button type="primary" size="small">添加信息</el-button>-->
|
|
</template>
|
|
</table-tool>
|
|
<el-table :data="tableData" style="width: 100%" row-key="id"
|
|
v-loading="tabLoading">
|
|
<el-table-column align="center" header-align="center" label="序号" width="100px">
|
|
<template scope="scope">
|
|
<span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<el-table-column label="年度" prop="annual" header-align="center" width="300px"
|
|
sortable align="center">
|
|
</el-table-column>
|
|
|
|
<el-table-column label="考核名称" prop="assessment" header-align="center"
|
|
show-overflow-tooltipalign="center"></el-table-column>
|
|
|
|
<el-table-column label="评测模式" prop="assessmentMode" header-align="center"
|
|
show-overflow-tooltipalign="center">
|
|
<template scope="{row}">
|
|
{{row.assessmentMode===1?'工会评家':'主席/副主席评家'}}
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="打分模式" prop="scoringMode" header-align="center"
|
|
show-overflow-tooltipalign="center">
|
|
<template scope="{row}">
|
|
{{row.scoringMode===1?'评分模式':'选择模式'}}
|
|
</template>
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column align="center" header-align="center" label="操作" fixed="right"
|
|
width="250px">
|
|
<template scope="scope">
|
|
<el-button size="mini" type="primary" @click="openView(scope.row.id)">
|
|
查看
|
|
</el-button>
|
|
<template v-if="!scope.row.isReview">
|
|
<el-tooltip content="评议页面的提交按钮在右上角哦" placement="top">
|
|
<el-button size="mini" type="primary" @click="doReview(scope.row)">
|
|
自评
|
|
</el-button>
|
|
</el-tooltip>
|
|
</template>
|
|
<template v-else>
|
|
<el-button size="mini" type="primary" @click="openReview(scope.row)">评议结果</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
|
|
<!--#include("/layouts/pagination.html"){}#-->
|
|
</el-card>
|
|
</template>
|
|
|
|
|
|
<template #edit_func>
|
|
<el-button type="primary" style="float: right;margin-top: 5px;margin-left: 10px;"
|
|
@click="doSubmit()">提交
|
|
</el-button>
|
|
<!-- <el-button type="primary" plain style="float: right;margin-top: 5px" @click="doSaveOrSubmit('save')">保存</el-button>-->
|
|
</template>
|
|
|
|
<template #edit>
|
|
<el-form :model="formData" ref="form" label-width="100px"
|
|
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
|
|
|
|
<template v-if="formData.assessmentMode==2">
|
|
<vi-title title="评议对象选择"></vi-title>
|
|
<el-row>
|
|
<el-col :span="12">
|
|
<el-form-item prop="president" label-width="0px">
|
|
<el-select v-model="formData.president" placeholder="请选择主席/副主席进行评议"
|
|
style="width: 100%">
|
|
<el-option v-for="o in userList" :key="o.id" :label="o.presidents" :value="o.id">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-col>
|
|
<el-col :span="12">
|
|
<div style="margin: 8px 10px">
|
|
<span style="color: #ac2925">如已完成该对象的评议,请您手动更换评议对象</span>
|
|
</div>
|
|
</el-col>
|
|
</el-row>
|
|
</template>
|
|
|
|
|
|
<vi-title title="评议内容"></vi-title>
|
|
|
|
<el-form-item label="" label-width="0" v-for="o,idx in formData.nrs" :key="o.id">
|
|
|
|
<el-row type="flex" align="middle" justify="space-between">
|
|
<el-input v-model="o.content" readonly maxlength="30" style="width: 50%">
|
|
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
|
|
</el-input>
|
|
</el-row>
|
|
|
|
<el-row style="margin-top: 20px">
|
|
<el-table :data="o.bzs" style="width: 100%" border :show-summary = "formData.scoringMode !== 2 ? 'always' : false">
|
|
<el-table-column align="center" header-align="center" label="序号" type="index"
|
|
width="100px">
|
|
</el-table-column>
|
|
|
|
<el-table-column label="主要评比内容" disabled prop="inspection" header-align="center"
|
|
align="center">
|
|
<template scope="{row}">
|
|
<el-input v-model="row.inspection"
|
|
readonly type="textarea" rows="2"></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
|
|
<template v-if="formData.scoringMode===1">
|
|
<el-table-column label="标准分" prop="score" header-align="center" align="center"
|
|
width="250px">
|
|
<template scope="{row}">
|
|
<el-input v-model.number="row.score" readonly></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="评议分" prop="resultScore" header-align="center"
|
|
align="center" width="250px">
|
|
<template slot-scope="{row}">
|
|
<el-input v-model="row.resultScore" maxlength="4" @blur="changeScore(row)"
|
|
placeholder="请填写评议分"></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
</template>
|
|
|
|
<template v-if="formData.scoringMode===2">
|
|
<el-table-column label="满意度" prop="resultScore" header-align="center"
|
|
align="center" width="350px">
|
|
<template slot-scope="{row}">
|
|
<el-radio-group v-model="row.resultScore" size="small">
|
|
<el-radio label="非常满意">非常满意</el-radio>
|
|
<el-radio label="满意">满意</el-radio>
|
|
<el-radio label="良好">良好</el-radio>
|
|
<el-radio label="一般">一般</el-radio>
|
|
</el-radio-group>
|
|
</template>
|
|
</el-table-column>
|
|
</template>
|
|
</el-table>
|
|
</el-row>
|
|
<div v-if="formData.scoringMode===1">
|
|
<el-divider content-position="left">简述工作情况</el-divider>
|
|
<el-row>
|
|
<el-col :span="24">
|
|
<el-input type="textarea" :rows="2" maxlength="300" show-word-limit
|
|
v-model="o.remark" placeholder="请简述工作情况"></el-input>
|
|
</el-col>
|
|
</el-row>
|
|
</div>
|
|
</el-form-item>
|
|
|
|
<template v-if="formData.scoringMode===2">
|
|
<vi-title title="简述工作情况"></vi-title>
|
|
<el-form-item prop="options" label-width="0px">
|
|
<el-input type="textarea" :rows="2" maxlength="300" show-word-limit
|
|
v-model="presidentOpinions" placeholder="请简述工作情况"></el-input>
|
|
</el-form-item>
|
|
</template>
|
|
|
|
<template v-if="formData.reviewMode===1 && formData.scoringMode===1">
|
|
<vi-title title="职工评家总结"></vi-title>
|
|
<el-form-item prop="files" label-width="0px">
|
|
<file-upload :files.sync="formData.files" card :max="3"
|
|
:type="['doc','docx','xls','xlsx','pdf', 'jpg', 'png', 'jpeg']">
|
|
<template #el-upload__tip>
|
|
<div class="el-upload__tip" slot="tip">
|
|
图片类请上传jpg/png/jpeg等格式,文档类请上传doc/docx/xls/xlsx/pdf等格式,最多上传3个文件
|
|
</div>
|
|
</template>
|
|
</file-upload>
|
|
</el-form-item>
|
|
</template>
|
|
|
|
</el-form>
|
|
|
|
</template>
|
|
|
|
<template #view>
|
|
<union-comment-zb :data="viewData" :is_view="true"></union-comment-zb>
|
|
</template>
|
|
|
|
|
|
<template #public>
|
|
<wakes-home-review ref="wakesHomeReview"></wakes-home-review>
|
|
</template>
|
|
</guava>
|
|
</div>
|
|
<script>
|
|
|
|
const vue = new Vue({
|
|
el: '#app',
|
|
mixins: [initTableMixins],
|
|
data() {
|
|
return {
|
|
tabLoading: false,
|
|
loading: true,
|
|
activeName: '1',
|
|
tableData: [],
|
|
formData: {},
|
|
viewData: {
|
|
nrs: [{
|
|
bzs: [{}]
|
|
}],
|
|
},
|
|
pageForm: {
|
|
pageNumber: 1,
|
|
pageSize: 10,
|
|
totalCount: 0,
|
|
},
|
|
pickerOptions: {
|
|
disabledDate(time) {
|
|
return (
|
|
time.getFullYear() > new Date().getFullYear()
|
|
);
|
|
}
|
|
},
|
|
|
|
id:'',
|
|
presidentOpinions: '',
|
|
isShowSubmit: true,
|
|
isReadOnly: true,
|
|
userList: [],
|
|
}
|
|
},
|
|
components: {
|
|
'union-comment-zb': httpVueLoader('/components/wakeshome/review/UnionCommentZb.vue?v=' + moment(new Date()).unix()),
|
|
'wakes-home-review': httpVueLoader('/components/wakeshome/review/ReviewResult.vue?v=' + moment(new Date()).unix()),
|
|
},
|
|
methods: {
|
|
async openReview(row){
|
|
const resp = await $.get(loc() + "/getPeoId",{id:row.id})
|
|
if (resp.code === 0) {
|
|
this.$refs.guava.public()
|
|
this.$refs.wakesHomeReview.findOne(resp.data)
|
|
}
|
|
},
|
|
changeScore(row) {
|
|
if (Number(row.score) < Number(row.resultScore)) {
|
|
row.resultScore = null;
|
|
this.$message.warning('评议分不能超过标准分');
|
|
}
|
|
},
|
|
async doReview(o) {
|
|
//自评模式
|
|
if (o.reviewMode == 1 && !o.canJoin) {
|
|
this.$message.warning('您不在自评人员范围中');
|
|
return
|
|
}
|
|
|
|
const isExist = await getScopeUser(o.activityGroupId)
|
|
if ((o.commentTarget == 1 && !isExist) || (o.commentTarget == 3 && !o.canJoin)) {
|
|
this.$message.warning('您不在自评人员范围中');
|
|
return
|
|
}
|
|
|
|
const res = await $.get('/mobile/wakeshome/review/appraisal/isAssess',{id:o.id})
|
|
if (res.data > 0){
|
|
this.$message.warning('您已经填写过该评议,请点击评议结果可查看评议详情')
|
|
return
|
|
}
|
|
|
|
const resp = await $.get('/mobile/wakeshome/review/appraisal/getById', {id: o.id})
|
|
if (resp.code === 0) {
|
|
this.id = o.id
|
|
this.formData = resp.data
|
|
if (this.formData.assessmentMode === 2) {
|
|
this.formData.nrs.forEach(v => {
|
|
v.bzs.forEach(o => {
|
|
o.resultScore = '满意'
|
|
})
|
|
})
|
|
await this.getPresidents()
|
|
}
|
|
this.$refs.guava.edit()
|
|
}
|
|
},
|
|
async getPresidents() {
|
|
const resp = await $.get('/mobile/wakeshome/review/appraisal/getPresidents')
|
|
if (resp.code === 0) {
|
|
this.userList = resp.data
|
|
}
|
|
if (this.userList && this.userList.length > 0) {
|
|
this.president = this.userList[0].id
|
|
await this.presidentChange();
|
|
}
|
|
},
|
|
async presidentChange() {
|
|
const resp = await $.get('/mobile/wakeshome/review/appraisal/isAssess', {
|
|
id: this.id,
|
|
evaluatedPersonId: this.president,
|
|
})
|
|
if (resp.data > 0) {
|
|
this.$message.warning('您已经评测过该主席(副主席),请在点击评议结果可查看评议信息,或更换主席(副主席)进行测评')
|
|
this.isShowSubmit = true;
|
|
this.isReadOnly = true
|
|
}
|
|
},
|
|
async openView(id) {
|
|
this.$refs.guava.view()
|
|
this.loading = true;
|
|
const {code, data, msg} = await $.get('/platform/wakeshome/review/khzb/edit', {id})
|
|
if (code === 0) {
|
|
this.viewData = data
|
|
this.viewData.applyTime = [this.viewData.startTime,this.viewData.endTime]
|
|
}
|
|
this.loading = false;
|
|
},
|
|
async assignment(){
|
|
const self = this;
|
|
const bzList = [];
|
|
this.formData.nrs.forEach(v => {
|
|
v.bzs.forEach(o => {
|
|
if (self.formData.assessmentMode === 1 && v.remark){
|
|
o.options = v.remark
|
|
}
|
|
bzList.push(o)
|
|
})
|
|
})
|
|
this.formData.bzList = bzList
|
|
this.formData.id = this.id
|
|
this.formData.president = this.president
|
|
this.formData.files = JSON.stringify(this.formData.files)
|
|
},
|
|
async doSubmit(){
|
|
const validate = await this.$refs.form.validate()
|
|
if (!validate) {
|
|
return
|
|
}
|
|
|
|
this.$confirm('确定要提交该测评结果吗?提交后不可修改,请仔细检查后提交', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(async () => {
|
|
await this.assignment()
|
|
if (!this.formData.reviewResult) {
|
|
await this.createdReviewResult()
|
|
}
|
|
this.formData.bzList = JSON.stringify(this.formData.bzList)
|
|
const resp = await $.post('/mobile/wakeshome/review/appraisal/doSubmit',this.formData)
|
|
if (resp.code === 0) {
|
|
this.$message.success('提交成功')
|
|
this.$refs.guava.index()
|
|
this.formData = {}
|
|
this.pageData()
|
|
} else {
|
|
this.$message.warning(resp.msg)
|
|
}
|
|
})
|
|
},
|
|
async createdReviewResult(){
|
|
if (this.formData.assessmentMode === 1) {
|
|
let source = 0; // 标准分
|
|
let resultScore = 0; // 评议分
|
|
this.formData.bzList.forEach(v => {
|
|
source += Number(v.score)
|
|
resultScore += Number(v.resultScore)
|
|
})
|
|
const result = (resultScore / source) * 100
|
|
|
|
if (result > 95) {
|
|
this.formData.reviewResult = '非常满意'
|
|
} else if (result > 80 && result <= 94) {
|
|
this.formData.reviewResult = '满意'
|
|
} else if (result > 60 && result <= 79) {
|
|
this.formData.reviewResult = '良好'
|
|
} else {
|
|
this.formData.reviewResult = '一般'
|
|
}
|
|
/*if (result >= 80) {
|
|
this.formData.reviewResult = '满意'
|
|
} else if (result >= 60 && result <= 79) {
|
|
this.formData.reviewResult = '基本满意'
|
|
} else {
|
|
this.formData.reviewResult = '不满意'
|
|
}*/
|
|
} else if (this.formData.assessmentMode === 2) {
|
|
const result = this.formData.bzList.filter(v => v.resultScore === '满意' || v.resultScore === '基本满意')
|
|
const satisfactionPercentage = (result.length / this.formData.bzList.length) * 100;
|
|
|
|
if (satisfactionPercentage > 95) {
|
|
this.formData.reviewResult = '非常满意'
|
|
} else if (satisfactionPercentage > 80 && satisfactionPercentage <= 94) {
|
|
this.formData.reviewResult = '满意'
|
|
} else if (satisfactionPercentage > 60 && satisfactionPercentage <= 79) {
|
|
this.formData.reviewResult = '良好'
|
|
} else {
|
|
this.formData.reviewResult = '一般'
|
|
}
|
|
/*if (satisfactionPercentage >= 80) {
|
|
this.formData.reviewResult = '满意'
|
|
} else if (satisfactionPercentage >= 60 && satisfactionPercentage <= 79) {
|
|
this.formData.reviewResult = '基本满意'
|
|
} else {
|
|
this.formData.reviewResult = '不满意'
|
|
}*/
|
|
const user = this.userList.find(v=> v.id === this.president)
|
|
this.formData.evaluatedPersonName = user.username
|
|
this.formData.evaluatedPersonType = user.evaluatedPersonType
|
|
}
|
|
},
|
|
},
|
|
async created() {
|
|
this.pageData();
|
|
}
|
|
})
|
|
</script>
|
|
<!--#
|
|
}
|
|
#-->
|