commit
This commit is contained in:
@@ -1,370 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.score {
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.standardScore {
|
||||
color: green;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-date-picker
|
||||
@change="khSearch"
|
||||
:picker-options="pickerOptions"
|
||||
v-model="pageForm.annual"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
placeholder="选择年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select placeholder="请选择所属工会" v-model="pageForm.unionid"
|
||||
style="width: 200px;"
|
||||
clearable="true" filterable="true">
|
||||
<el-option v-for="item in unions" :label="item.unionname"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button type="primary" icon="el-icon-search"
|
||||
@click="doSearch"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-radio-group v-model="pageForm.isAudit" @change="doSearch">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">已审核</el-radio-button>
|
||||
<el-radio-button :label="3">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="never" class="mt10">
|
||||
<el-table :data="tableData" row-key="id" @sort-change="pageOrder" 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">
|
||||
<template scope="scope">
|
||||
{{scope.row.annual}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="院级工会名称" prop="unionname" header-align="center"
|
||||
show-overflow-tooltip
|
||||
align="center">
|
||||
<template scope="{row}">
|
||||
({{row.unioncode}}){{row.unionname}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="考核名称" prop="assessment" header-align="center"
|
||||
show-overflow-tooltip
|
||||
align="center"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="标准分" prop="bzf" sortable header-align="center"
|
||||
show-overflow-tooltip
|
||||
align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="自评得分" sortable prop="zp_score" header-align="center"
|
||||
show-overflow-tooltip
|
||||
align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="校工会得分" sortable prop="xgh_score"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
align="center"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="状态" prop="name" header-align="center"
|
||||
align="center">
|
||||
<template scope="scope">
|
||||
<span class="text-warning" v-if="scope.row.state==2">待评分</span>
|
||||
<span class="text-success" v-else-if="scope.row.state==3">考核成功</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
fixed="right" width="120px">
|
||||
<template scope="scope">
|
||||
<el-button size="mini" :disabled="scope.row.state==3" type="primary"
|
||||
@click="openMarking(scope.row)">评分
|
||||
</el-button>
|
||||
</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"
|
||||
@click="doSave()">提交
|
||||
</el-button>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<h3 style="color: rgb(24, 103, 176);text-align: center;margin: 10px 0px 50px 0">
|
||||
{{formData.assessment}}
|
||||
</h3>
|
||||
<border-table>
|
||||
<table>
|
||||
<tr>
|
||||
<th>年度</th>
|
||||
<td>{{formData.annual}}</td>
|
||||
<th>考核分工会</th>
|
||||
<td>${@shiro.getPrincipalProperty('union').getUnionname()}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</border-table>
|
||||
<el-form :model="formData" ref="form" label-width="100px">
|
||||
|
||||
<div v-for="nr,idx in formData.nrs" :key="nr.id">
|
||||
<div style="font-size: 16px;line-height: 1.1;margin: 10px 0">{{ idx + 1 }}.{{nr.content}}</div>
|
||||
|
||||
<el-row class="mt20">
|
||||
<el-table :data="nr.bzs" style="width: 100%" border show-summary
|
||||
:summary-method="getSummaries">
|
||||
<el-table-column align="center" header-align="center" label="序号" width="70px"
|
||||
type="index">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="考核标准" prop="inspection" header-align="center" align="center">
|
||||
<template scope="{row}">
|
||||
{{row.inspection}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="评分标准" prop="scoringCriteria" header-align="center"
|
||||
align="center">
|
||||
<template scope="{row}">
|
||||
{{row.scoringCriteria}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="标准分" prop="score" header-align="center" align="center"
|
||||
width="120px">
|
||||
<template scope="{row}">
|
||||
<span class="score standardScore">{{row.score}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="自评得分" prop="zpf" header-align="center" align="center"
|
||||
width="120px">
|
||||
<template scope="{row}">
|
||||
<span class="score">{{row.zpf}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="考评分值" prop="examScore" header-align="center" align="center"
|
||||
width="280px">
|
||||
<template scope="{row,$index}">
|
||||
<el-form-item :prop="getPropPath(idx, $index)"
|
||||
label-width="0"
|
||||
:rules="[{required:true,message:'必填',trigger:['blur','change']}]">
|
||||
<el-input-number v-model="row.examScore"
|
||||
:max="row.score"
|
||||
:min="0"
|
||||
placeholder="请填写考评分值"></el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="考核办法" prop="assessmentMethod" header-align="center"
|
||||
align="center">
|
||||
<template scope="{row}">
|
||||
{{row.assessmentMethod}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="加、减原因" prop="addition" header-align="center"-->
|
||||
<!-- align="center"-->
|
||||
<!-- width="250px">-->
|
||||
<!-- <template scope="{row}">-->
|
||||
<!-- <el-input v-model.number="row.addition" maxlength="50"-->
|
||||
<!-- placeholder="请填写加、减原因"></el-input>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
window.vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
unions: [],
|
||||
ghPageForm: {},
|
||||
v: 'index',
|
||||
tabLoading: false,
|
||||
tableData: [],
|
||||
showGh: true,
|
||||
dialog: false,
|
||||
loading: false,
|
||||
pageForm: {
|
||||
isAudit: 3,
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
examScore: [{required: true, message: '请填写分数', trigger: ['blur', 'change']}],
|
||||
addition: [{required: true, message: '请填写原因', trigger: ['blur', 'change']}],
|
||||
},
|
||||
data: {},
|
||||
row: {},
|
||||
pickerOptions: {
|
||||
disabledDate(time) {
|
||||
return (
|
||||
time.getFullYear() > new Date().getFullYear()
|
||||
);
|
||||
}
|
||||
},
|
||||
formData: {
|
||||
nrs: []
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getPropPath(idx, rowIndex) {
|
||||
return 'nrs[' + idx + "].bzs[" + rowIndex + "].examScore";
|
||||
},
|
||||
|
||||
async getKh() {
|
||||
await $.get("/platform/ghkh/khph/getKh", {"annual": this.pageForm.annual}).then(res => {
|
||||
if (res.data.length != 0) {
|
||||
this.kh = res.data
|
||||
this.pageForm.khid = this.kh[0].id
|
||||
} else {
|
||||
this.kh = []
|
||||
this.pageForm.khid = ""
|
||||
}
|
||||
})
|
||||
},
|
||||
async khSearch() {
|
||||
await this.getKh()
|
||||
},
|
||||
async doSave() {
|
||||
this.$refs.form.validate(async (valid) => {
|
||||
if (valid) {
|
||||
const arr = this.formData.nrs.flatMap(n =>
|
||||
n.bzs.map(b => ({
|
||||
"zb_id": this.formData.id,
|
||||
"nr_id": n.id,
|
||||
"bz_id": b.id,
|
||||
"flatid": this.formData.union_id,
|
||||
"examScore": b.zp ? b.examScore : undefined,
|
||||
"addition": b.zp ? b.addition : undefined
|
||||
}))
|
||||
)
|
||||
const {code, msg} = await $.post(loc() + '/marking', {
|
||||
pf: JSON.stringify(arr),
|
||||
zbId: this.formData.id,
|
||||
unionId: this.formData.union_id
|
||||
})
|
||||
if (code === 0) {
|
||||
this.notifySuccess(msg)
|
||||
this.$refs.guava.index()
|
||||
this.pageData()
|
||||
} else {
|
||||
this.notifyWarning(msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
doView(nr, bz, row) {
|
||||
this.dialog = true
|
||||
this.data = {nr, bz, ...row.zp}
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '小计';
|
||||
} else if ([1, 2].includes(index)) {
|
||||
sums[index] = '';
|
||||
} else if (index === 3) {
|
||||
sums[index] = (data.map(v => parseInt(v['score'])).reduce((a, b) => a + b)) + '分'
|
||||
} else if (index === 4) {
|
||||
sums[index] = (data.map(v => v['zpf']).reduce((a, b) => parseInt(a) + parseInt(b))) + '分'
|
||||
} else if (index === 5) {
|
||||
sums[index] = (data.map(v => isNaN(v['examScore']) ? 0 : v['examScore']).reduce((a, b) => parseInt(a) + parseInt(b))) + '分'
|
||||
}
|
||||
});
|
||||
return sums
|
||||
},
|
||||
openMarking(row) {
|
||||
|
||||
|
||||
$.post(base + "/platform/ghkh/xghsh/getData", {
|
||||
zb_id: row.zb_id,
|
||||
union_id: row.union_id
|
||||
}, (res) => {
|
||||
res.data.nrs.forEach(nr => {
|
||||
nr.bzs.forEach(bz => {
|
||||
if (bz.zp) {
|
||||
bz.zpf = bz.zp.zpf
|
||||
}
|
||||
})
|
||||
})
|
||||
res.data.union_id = row.union_id
|
||||
res.data.flatname = row.unionname
|
||||
this.formData = res.data
|
||||
})
|
||||
this.$refs.guava.edit()
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tabLoading = true
|
||||
$.post(base + "/platform/ghkh/xghsh/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tabLoading = false
|
||||
if (data.code == 0) {
|
||||
this.tableData = data.data.list;
|
||||
this.pageForm.totalCount = data.data.totalCount;
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, "json");
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.unions = await getUnions()
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user