Files
2026-09-08 19:49:21 +08:00

347 lines
15 KiB
HTML

<!--#
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>
<!--#
}
#-->