This commit is contained in:
2026-09-09 16:16:22 +08:00
parent ebffbab428
commit ba3a985c40
3749 changed files with 29 additions and 608551 deletions
@@ -1,137 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<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"
:clearable="false"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</div>
<div class="btn-group tool-button mt5">
<el-select v-model="pageForm.khid"
@change="doSearch"
placeholder="请选择考核">
<el-option
v-for="item in kh"
:key="item.id"
:label="item.assessment"
: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>
</el-card>
<el-card shadow="never" class="mt20">
<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"
align="center">
</el-table-column>
<el-table-column label="分工会名称" prop="unionname" header-align="center"
show-overflow-tooltip
align="center" sortable></el-table-column>
<el-table-column label="最终考核得分" prop="xgh_score" header-align="center"
show-overflow-tooltip
align="center" sortable></el-table-column>
<!-- <el-table-column label="名次" prop="Ranking" header-align="center" show-overflow-tooltip-->
<!-- align="center"></el-table-column>-->
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tabLoading: false,
tableData: [],
kh: [],
pageForm: {
khid: "",
annual: "",
pageNumber: 1,
pageSize: 10,
totalCount: 0,
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
}
},
methods: {
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()
this.pageData();
},
pageData() {
sublime.showLoadingbar();
$.post(base + "/platform/ghkh/khph/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");
this.tabLoading = true
},
},
async created() {
this.pageForm.annual = new Date().getFullYear() + ""
await this.getKh()
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -1,232 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
#app {
overflow-y: unset !important;
}
</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-input v-model="pageForm.assessment" placeholder="根据考核名称关键字查询"></el-input>
</div>
<div class="btn-group tool-button mt5">
<el-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt20">
<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">
<template scope="scope">
{{scope.row.annual}}
</template>
</el-table-column>
<el-table-column label="考核名称" prop="assessment" header-align="center"
show-overflow-tooltip
align="center"></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>
<el-button size="mini" type="primary" @click="openEdit(scope.row.id)">
编辑
</el-button>
<el-button size="mini" type="danger" @click="doDelete(scope.row.id)">
删除
</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="doEdit()">提交
</el-button>
</template>
<template #edit>
<kh-zb :data="formData" @change="v=>{this.formData=v}"></kh-zb>
</template>
<template #view>
<kh-zb :data="viewData" :is_view="true"></kh-zb>
</template>
</guava>
</div>
<script>
var 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()
);
}
},
}
},
components: {
'kh-zb': httpVueLoader('/components/kh/KhZb.vue')
},
methods: {
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()
},
pageData() {
sublime.showLoadingbar();
this.tabLoading = true
$.post(base + "/platform/ghkh/khzb/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");
},
doSearch() {
this.pageForm.pageNumber = 1
this.pageData();
},
async openEdit(id) {
const {code, data, msg} = await $.get('/platform/ghkh/khzb/edit', {id})
if (code == 0) {
this.formData = data
this.$refs.guava.edit()
}
},
doEdit() {
$.post(base + "/platform/ghkh/khzb/doEdit", {kh_zb: JSON.stringify(this.formData)}, (res) => {
const {code, data, msg} = res
if (code == 0) {
this.$message({
message: msg,
type: 'success'
});
} else {
this.$message({
message: msg,
type: 'error'
});
}
this.$refs.guava.index()
this.pageData()
},
)
},
doDelete(id) {
this.$confirm('您确定要删除吗!', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: (a, b) => {
if ("confirm" == a) {//确认后再执行
$.post(base + "/platform/ghkh/khzb/delete", {id: id}, (data) => {
if (data.code === 0) {
this.$message({
message: data.msg,
type: 'success'
});
this.pageData();
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
}, "json");
}
}
});
},
async openView(id) {
this.$refs.guava.view()
this.loading = true;
const {code, data, msg} = await $.get('/platform/ghkh/khzb/edit', {id})
if (code == 0) {
this.viewData = data
console.log(this.viewData)
}
this.loading = false;
},
},
async created() {
this.pageData();
}
})
</script>
<!--#
}
#-->
@@ -1,347 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<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: 100%;"
clearable="true"
@change="flushUnits" @clear="flushUnits"
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}"
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>
</el-card>
<el-card shadow="never" class="mt20">
<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">
<template scope="scope">
{{scope.row.annual}}
</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="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="bzf" header-align="center" show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="自评得分" prop="zp_score" header-align="center" show-overflow-tooltip
align="center"></el-table-column>
<el-table-column label="校工会得分" prop="xgh_score" header-align="center" show-overflow-tooltip
align="center"></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)">查看</el-button>
</template>
</el-table-column>
</el-table>
<!--#include("/layouts/pagination.html"){}#-->
</el-card>
</template>
<template #edit>
<el-form :model="formData" ref="form" label-width="100px"
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
<vi-title title="指标信息"></vi-title>
<el-row gutter="20">
<el-col :span="8">
<el-form-item prop="annual" label="年&emsp;&emsp;度">
<el-date-picker
readonly
v-model="formData.annual"
type="year"
value-format="yyyy"
placeholder="选择年度">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="flatname" label="分工会名称">
<el-input maxlength="30" value="" readonly v-model="formData.flatname"
placeholder="请填写分工会名称"
type="text"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="assessment" label="考核名称">
<el-input maxlength="30" readonly v-model="formData.assessment" placeholder="请填写考核名称"
type="text"></el-input>
</el-form-item>
</el-col>
</el-row>
<vi-title title="考核内容"></vi-title>
<el-form-item label="" label-width="0" v-for="nr,idx in formData.nrs">
<el-row type="flex" align="middle" justify="space-between">
<el-input v-model="nr.content" readonly maxlength="30" style="width: 50%"
placeholder="请填写考核内容">
<template slot="prepend"><span>{{ idx + 1 }}</span></template>
</el-input>
</el-row>
<el-row style="margin-top: 20px">
<el-table :data="nr.bzs" style="width: 100%" border show-summary
:summary-method="getSummaries">
<el-table-column align="center" header-align="center" label="序号" type="index">
</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 placeholder="请填写考核标准"></el-input>
</template>
</el-table-column>
<el-table-column label="标准分" prop="score" header-align="center" align="center"
width="150px">
<template scope="{row}">
<el-input v-model.number="row.score" readonly maxlength="4"
placeholder="请填写标准分"></el-input>
</template>
</el-table-column>
<el-table-column label="自评得分" prop="zpf" header-align="center" align="center"
width="150px">
<template scope="{row}">
<el-input v-if="row.zpf" v-model.number="row.zpf" maxlength="4"
readonly placeholder="请填写自评分"></el-input>
<el-input v-else value="暂无" maxlength="4"
readonly></el-input>
</template>
</el-table-column>
<el-table-column label="校工会评分" prop="schools" header-align="center" align="center"
width="150px">
<template scope="{row}">
<el-input v-model.number="row.schools" readonly maxlength="4"
placeholder="请填写评分"></el-input>
</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" readonly maxlength="50"
placeholder="请填写加、减原因"></el-input>
</template>
</el-table-column>
<el-table-column label="有关佐证材料" header-align="center" align="center"
width="250px">
<template scope="{row}">
<el-button type="primary" :disabled="!row.isEvidence" plain
@click="doView(nr.content,row.inspection,row)">
查看佐证材料
</el-button>
</template>
</el-table-column>
</el-table>
</el-row>
</el-form-item>
</el-form>
</template>
</guava>
<el-drawer
:visible.sync="dialog"
direction="rtl" size="40%"
custom-class="demo-drawer"
ref="drawer">
<div class="demo-drawer__content" style="padding: 0 15px">
<upload-materials :data="data" :is_view="true"></upload-materials>
</div>
</el-drawer>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
unions: [],
units: [],
data: {},
row: {},
dialog: false,
loading: false,
formData: {},
tabLoading: false,
tableData: [],
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
},
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
}
},
components: {
'upload-materials': httpVueLoader('/components/kh/UploadMaterials.vue')
},
methods: {
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()
},
openView(row) {
$.post(base + "/platform/ghkh/lssjcx/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
}
if (bz.sh) {
bz.addition = bz.sh.addition
bz.schools = bz.sh.schools
}
})
})
res.data.union_id = row.union_id
res.data.flatname = row.unionname
this.formData = res.data
this.$refs.guava.edit()
})
},
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] = '小计';
return;
} else if (index === 5) {
sums[index] = '';
return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
if (sums[2]) {
sums[2] = sums[2]
}
if (sums[3]) {
sums[3] = sums[3]
}
if (sums[4]) {
sums[4] = sums[4]
}
} else {
sums[index] = '';
}
});
return sums;
},
pageData() {
sublime.showLoadingbar();
this.tabLoading = true
$.post(base + "/platform/ghkh/lssjcx/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 flushUnits() {
this.$set(this.pageForm, "unitId", "")
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
this.units = await getUnits(this.pageForm.unionId)
} else {
this.units = await getUnits("${@shiro.getPrincipalProperty('unit').getUnionid()}")
}
},
},
async created() {
this.pageData();
this.unions = await getUnions()
this.flushUnits()
}
})
</script>
<!--#
}
#-->
@@ -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>
<!--#
}
#-->
@@ -1,145 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
.el-card__header {
display: flex;
align-items: center;
justify-content: space-between;
}
</style>
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<template #header>
<div>
<h3 style="color: #1867b0">新建考核指标</h3>
</div>
<div>
<el-button type="primary" @click="doAdd()">
提交
</el-button>
</div>
</template>
<template>
<kh-zb :data="formData" @change="v=>{this.formData=v}"></kh-zb>
</template>
</el-card>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
data() {
return {
v: 'index',
formData: {},
}
},
components: {
'kh-zb': httpVueLoader('/components/kh/KhZb.vue?v=' + moment(new Date()).unix()),
},
methods: {
async doAdd() {
let flag = true
if (!this.formData.annual) {
this.$message({
message: "年度不能为空",
type: 'error'
})
return
}
if (!this.formData.assessment) {
this.$message({
message: "考核名称不能为空",
type: 'error'
})
return
}
this.formData.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (!nr.content) {
this.$message({
message: "考核内容不能为空",
type: 'error'
})
flag = false;
throw Error()
} else if (!bz.inspection) {
this.$message({
message: "考核标准不能为空",
type: 'error'
})
flag = false;
throw Error()
} /*else if (!bz.score) {
this.$message({
message: "分数不能为空",
type: 'error'
})
flag = false;
throw Error()
}*/
})
})
if (flag) {
const resp = await $.post('/platform/ghkh/Xjkhzb/doAdd',{kh_zb: JSON.stringify(this.formData)})
if (resp.code === 0){
this.formData.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
nr.content = ""
bz.inspection = ""
bz.score = ""
bz.single_score = ''
bz.associatedmodule = ''
})
this.formData.annual = ""
this.formData.assessment = ""
})
this.$message({
message: resp.msg,
type: 'success'
});
location.href='/platform/ghkh/khzb'
}else {
this.$message({
message: resp.msg,
type: 'error'
});
}
// $.post(base + "/platform/ghkh/Xjkhzb/doAdd", {kh_zb: JSON.stringify(this.formData)}, (res) => {
// if (res.code === 0) {
// this.formData.nrs.forEach(nr => {
// nr.bzs.forEach(bz => {
// nr.content = ""
// bz.inspection = ""
// bz.score = ""
// bz.single_score = ''
// bz.associatedmodule = ''
// })
// this.formData.annual = ""
// this.formData.assessment = ""
// })
// this.$message({
// message: res.msg,
// type: 'success'
// });
// location.href = '/platform/ghkh/khzb'
// }
// },
// )
}
}
}
})
</script>
<!--#
}
#-->
-692
View File
@@ -1,692 +0,0 @@
<!--#
layout("/layouts/platform.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<guava ref="guava" edit_scroll>
<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-button type="primary" icon="el-icon-search" @click="doSearch"></el-button>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<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">
<template scope="scope">
{{scope.row.annual}}
</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="zp_score" header-align="center" sortable align="center">
<template scope="scope">
{{scope.row.zp_score | none2str}}
</template>
</el-table-column>
<el-table-column label="校工会评分" prop="xgh_score" header-align="center" sortable align="center">
<template scope="scope">
{{scope.row.xgh_score | none2str}}
</template>
</el-table-column>
<el-table-column label="状态" prop="name" header-align="center" align="center">
<template scope="scope">
<span class="text-info" v-if="!scope.row.state">未自评</span>
<span class="text-success" v-else-if="scope.row.state==1">自评中</span>
<span class="text-warning" v-else-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="250px">
<template scope="scope">
<el-button size="mini" type="primary" v-if="scope.row.state" @click="openView(scope.row)">
查看
</el-button>
<el-button size="mini" type="primary" @click="openAdd(scope.row)"
v-if="!scope.row.state">
自评
</el-button>
<el-button size="mini" type="primary" @click="openEdit(scope.row)"
v-if="scope.row.state==1">
修改
</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;margin-left: 10px;"
@click="doSaveOrSubmit('submit')">
提交
</el-button>
<el-button type="primary" plain style="float: right;margin-top: 5px"
@click="doSaveOrSubmit('save')">
保存
</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 style="margin-top: 20px">
<el-table :data="nr.bzs" border show-summary :summary-method="getSummaries">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="70px">
</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="inspection" header-align="center"
align="center"
width="300px">
<template scope="{row}">
{{row.scoringCriteria}}
</template>
</el-table-column>
<el-table-column label="项目自评" prop="score" header-align="center"
width="200px"
align="center">
<template scope="{row}">
{{row.score}}
</template>
</el-table-column>
<el-table-column label="自评分值" disabled prop="zp.zpf" header-align="center"
width="200px"
align="center">
<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-if="row.score>0"
v-model="row.zp.zpf"
:max="row.score"
:min="0"
step-strictly
:precision="0"></el-input-number>
<el-input-number v-else
v-model="row.zp.zpf"
:min="0"
step-strictly
:precision="0"></el-input-number>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-row>
</div>
</el-form>
<!-- <div>-->
<!-- <el-button type="primary" @click="doSaveOrSubmit('submit')">-->
<!-- 提交-->
<!-- </el-button>-->
<!-- <el-button type="primary" plain style="float: right;margin-top: 5px" @click="doSaveOrSubmit('save')">-->
<!-- 保存-->
<!-- </el-button>-->
<!-- </div>-->
</template>
<template #view>
<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">
<el-form-item label="" label-width="0" 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 style="margin-top: 20px">
<el-table :data="nr.bzs" border show-summary :summary-method="getSummaries2">
<el-table-column align="center" header-align="center" label="序号" type="index"
width="70px">
</el-table-column>
<el-table-column label="考核标准" disabled prop="inspection" header-align="center"
align="center">
<template scope="{row}">
{{row.inspection}}
</template>
</el-table-column>
<el-table-column label="标准分" prop="score" header-align="center" align="center"
width="250px">
<template scope="{row}">
{{row.score}}
</template>
</el-table-column>
<el-table-column label="自评得分" prop="zpf" header-align="center" align="center"
width="250px">
<template scope="{row}">
{{row.zpf}}
<!-- <el-input v-if="row.zpf" v-model.number="row.zpf" maxlength="4"-->
<!-- readonly placeholder="请填写自评分"></el-input>-->
<!-- <el-input v-else value="暂无" maxlength="4"-->
<!-- readonly></el-input>-->
</template>
</el-table-column>
</el-table>
</el-row>
</el-form-item>
</el-form>
</template>
</guava>
<el-drawer
:visible.sync="dialog"
:show-close="false"
direction="rtl" size="40%"
custom-class="demo-drawer" :before-close="()=>{addForm()}"
ref="drawer">
<div class="demo-drawer__content" style="padding: 0 15px">
<upload-materials :data="data"></upload-materials>
<div class="demo-drawer__footer" style="float: right">
<el-popover
placement="top"
width="160"
v-model="visible">
<p>您确定要返回吗?返回将不能保存!</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="cancelForm">确定</el-button>
</div>
<el-button slot="reference">返 回</el-button>
</el-popover>
<!-- <el-button @click="cancelForm">取 消</el-button>-->
<el-button type="primary" @click="addForm">确 定</el-button>
</div>
</div>
</el-drawer>
<el-drawer
:visible.sync="dialog_view"
direction="rtl" size="40%"
custom-class="demo-drawer"
ref="drawer">
<div class="demo-drawer__content" style="padding: 0 15px">
<upload-materials :data="data" :is_view="true"></upload-materials>
</div>
</el-drawer>
<calcscore-table :relation_year="relationYear"
:show_modal.sync="calcSoreTableModal"
@get_table_data="autoFillScore"/>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
visible: false,
fileList: [],
v: 'index',
tableData: [],
formData: {},
dialog: false,
dialog_view: false,
loading: false,
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
},
data: {bz: '', clnrs: null, nr: ''},
row: {},
index: "",
idx: "",
addFormData: [],
pickerOptions: {
disabledDate(time) {
return (
time.getFullYear() > new Date().getFullYear()
);
}
},
relationYear: {},
calcSoreTableModal: false,
current_bz_id: ''
}
},
filters: {
none2str(val) {
return val ? val : '暂无'
}
},
components: {
'upload-materials': httpVueLoader('/components/kh/UploadMaterials.vue'),
'calcscore-table': httpVueLoader('/components/kh/CalcScoreTab.vue?ver=' + Math.random()),
},
methods: {
getPropPath(idx, rowIndex) {
return 'nrs[' + idx + "].bzs[" + rowIndex + "].zp.zpf";
},
goBack() {
this.pageData()
this.$refs.guava.index()
},
//计算得分
async calcScore(row) {
this.current_bz_id = row.id
this.calcSoreTableModal = true
this.relationYear = {year: this.formData.annual, bz_relation_id: row.bz_relation_id}
},
autoFillScore(scoreTable) {
this.formData.nrs.some(nr => {
nr.bzs.some(v => {
if (v.id === this.current_bz_id) {
this.$set(v, 'clnr', this.renderScoreTable(v.bz_relation_id, scoreTable))
if (scoreTable.length * v.single_score > Number(v.score) && !v.beyond_highestscore) {
this.$message.warning('自评得分不能超过标准分!')
this.$set(v.zp, 'zpf', v.score)
return true
}
if (this.relationYear.bz_relation_id === "Performance") {
let single_score = 0
scoreTable.map(v => {
single_score += v.integral
})
this.$set(v.zp, 'zpf', single_score)
} else {
this.$set(v.zp, 'zpf', scoreTable.length * v.single_score)
}
return true
}
})
})
},
//自定义材料内容
renderScoreTable(relation_id, score_data) {
if (score_data) {
let res = ''
switch (relation_id) {
case 'proposal':
score_data.map((v, i) => {
res += (i + 1) + ' .提案人:' + v.username + ',提案名称:' + v.proposalName + ';\n'
})
return res
case 'secteameet':
score_data.map((v, i) => {
res += (i + 1) + ' .申请人:' + v.username + ',会议名称:' + v.meeting_name + ';\n'
})
return res
case 'ConandDif':
score_data.map((v, i) => {
res += (i + 1) + ' .被慰问/补助人:' + v.be_username + ',慰问/补助类型:' + v.typename + ';\n'
})
return res
case 'Performance':
score_data.map((v, i) => {
res += (i + 1) + ' .在:' + v.activityName + '届运动会中,' + v.eventName + '项目获得了地' + v.ranking + '名;\n'
})
return res
default:
return ''
}
}
return ''
},
async doSaveOrSubmit(v) {
const msg = v === 'save' ? '保存后可继续填写或修改,您确定要保存吗?' : '提交后不允许修改自评分,您确定要提交至校工会吗?'
const confirm = await this.$confirm(msg, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
if (confirm !== 'confirm') {
return
}
const params = []
this.formData.nrs.forEach(n => {
n.bzs.forEach(b => {
params.push({
"zb_id": this.formData.id,
"nr_id": n.id,
"bz_id": b.id,
"clnr": b.zp.clnr,
"zpf": b.zp.zpf,
"files": b.zp.files,
"id": b.zp.id ? b.zp.id : null
})
})
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const res = await $.post(base + "/platform/ghkh/zp/doHandler", {
zp: JSON.stringify(params),
handleType: v,
zbId: this.formData.id
})
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
} else {
this.$message.error(res.msg)
}
loading.close()
if (v === 'submit') {
this.$refs.guava.index()
return
}
const resa = await $.post(base + '/platform/ghkh/zp/openView', {id: this.formData.id})
await this.$nextTick()
this.formData = resa.data
},
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()
},
viewUpload(nr, bz, row) {
this.data = {nr, bz, clnr: row.clnr, ...row.zp}
this.dialog_view = true
},
upload(nr, bz, row, index, idx) {
this.dialog = true
if (row.zp) {
this.data = {nr, bz, clnr: row.clnr, ...row.zp}
} else {
this.data = {nr, bz, clnr: row.clnr, ...row.zp}
}
this.row = row
this.index = index
this.idx = idx
},
addForm() {
this.formData.nrs[this.idx].bzs[this.index].zp = this.data
this.dialog = false
},
cancelForm() {
this.visible = false
this.loading = false;
this.dialog = false;
},
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 => isNaN(v['score']) ? 0 : parseInt(v['score'])).reduce((a, b) => a + b)) + '分'
} else if (index === 4) {
sums[index] = (data.map(v => v['zp']['zpf']).reduce((a, b) => parseInt(a) + parseInt(b))) + '分'
}
});
return sums
},
getSummaries2(param) {
const {columns, data} = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '小计';
} else if ([1].includes(index)) {
sums[index] = '';
} else if (index === 2) {
sums[index] = (data.map(v => isNaN(v['score']) ? 0 : parseInt(v['score'])).reduce((a, b) => a + b)) + '分'
} else if (index === 3) {
sums[index] = (data.map(v => v['zp']['zpf']).reduce((a, b) => parseInt(a) + parseInt(b))) + '分'
}
});
return sums
},
pageData() {
sublime.showLoadingbar();
this.tabLoading = true
$.post(base + "/platform/ghkh/zp/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 openAdd(row) {
const data = await $.post(base + "/platform/ghkh/khzb/getZb", {id: row.id})
data.nrs.forEach(v => {
v.bzs.forEach(x => {
if (!x.zp) {
x.zp = {zpf: 0}
}
})
})
this.formData = data
this.$refs.guava.edit()
},
async openEdit(row) {
const resa = await $.post(base + '/platform/ghkh/zp/openView', {id: row.id})
this.formData = resa.data
this.$refs.guava.edit()
},
async doAdd() {
this.addFormData = []
this.formData.nrs.forEach(n => {
let zp = {}
n.bzs.forEach(b => {
if (b.zp) {
zp = {
"zb_id": this.formData.id, "nr_id": n.id,
"bz_id": b.id, "clnr": b.zp.clnr, "zpf": b.zpf, "files": b.zp.files
}
} else {
zp = {"zb_id": this.formData.id, "nr_id": n.id, "bz_id": b.id, "zpf": b.zpf}
}
this.addFormData.push(zp)
})
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
const res = await $.post(base + "/platform/ghkh/zp/doAdd", {zp: JSON.stringify(this.addFormData)})
if (res.code === 0) {
this.pageData()
this.$message.success(res.msg)
} else {
this.$message.error(res.msg)
}
loading.close()
const resa = await $.post(base + '/platform/ghkh/zp/openView', {id: this.formData.id})
await this.$nextTick()
this.formData = resa.data
},
doEdit() {
this.formData.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (bz.zp) {
bz.zp = {
...bz.zp, "zpf": bz.zpf,
}
}
})
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
$.post(base + "/platform/ghkh/zp/doEdit", {zb: JSON.stringify(this.formData)}, (data) => {
if (data.code == 0) {
this.pageData()
this.$message.success(data.msg)
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
loading.close()
})
},
subXgh() {
this.formData.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (bz.zp) {
bz.zp = {
"bz": bz.zp.bz,
"files": bz.zp.files,
"clnr": bz.zp.clnr,
"zb_id": this.formData.id,
"nr_id": nr.id,
"bz_id": bz.id,
"zpf": bz.zpf
}
/* bz.zp = {
...bz.zp, "zpf": bz.zpf,
}*/
} else {
bz.zp = {"zb_id": this.formData.id, "nr_id": nr.id, "bz_id": bz.id, "zpf": bz.zpf}
}
})
})
const loading = this.$loading({
lock: true,
text: '数据提交中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
$.post(base + "/platform/ghkh/zp/subXgh", {zb: JSON.stringify(this.formData)}, (data) => {
if (data.code == 0) {
this.$refs.guava.index()
this.pageData()
this.$message.success(data.msg)
} else {
this.$message({
message: data.msg,
type: 'error'
});
}
loading.close()
})
},
openView(row) {
$.post(loc() + "/findOne", {id: row.id}, (res) => {
res.data.nrs.forEach(nr => {
nr.bzs.forEach(bz => {
if (bz.zp) {
bz.zpf = bz.zp.zpf
bz.clnr = bz.zp.clnr
}
})
})
this.formData = res.data;
})
this.$refs.guava.view()
},
},
async created() {
this.pageData();
}
})
</script>
<!--#
}
#-->