443 lines
20 KiB
HTML
443 lines
20 KiB
HTML
<!--#
|
|
layout("/layouts/platform.html"){
|
|
#-->
|
|
|
|
|
|
<div id="app" v-cloak>
|
|
<el-row class="transition-row">
|
|
<transition name="el-zoom-in-center">
|
|
<div v-show="v=='index'" class="transition-item">
|
|
<el-row class="header navbar bg-white shadow">
|
|
<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-row>
|
|
|
|
|
|
<el-row class="el-table-container">
|
|
<el-table :data="tableData" style="width: 100%" 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="openShGh(scope.row)">评分
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-row>
|
|
|
|
<el-row class="el-pagination-container">
|
|
<el-pagination
|
|
@size-change="pageSizeChange"
|
|
@current-change="pageNumberChange"
|
|
:current-page="pageForm.pageNumber"
|
|
:page-sizes="[10, 20, 30, 50]"
|
|
:page-size="pageForm.pageSize"
|
|
layout="total, sizes, prev, pager, next"
|
|
:total="pageForm.totalCount">
|
|
</el-pagination>
|
|
</el-row>
|
|
</div>
|
|
</transition>
|
|
|
|
<transition name="el-zoom-in-center">
|
|
<div v-show="v=='edit'" class="transition-item">
|
|
<el-row class="header navbar bg-white shadow">
|
|
|
|
<el-button icon="el-icon-back" type="text" @click="v='index'" style="font-size: 18px">返回
|
|
</el-button>
|
|
<el-button type="primary" style="float: right;margin-top: 5px" @click="doEdit()">提交</el-button>
|
|
|
|
</el-row>
|
|
|
|
<el-form :model="formData" ref="form" label-width="100px" :rules="formRules"
|
|
style="height: calc(100vh - 50px);overflow-y: scroll;padding: 10px 15px">
|
|
<el-form-item label="指标信息 " label-width="110px" class="view-header">
|
|
</el-form-item>
|
|
<el-row gutter="20">
|
|
<el-col :span="8">
|
|
<el-form-item prop="annual" label="年  度">
|
|
<el-date-picker
|
|
:picker-options="pickerOptions"
|
|
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>
|
|
<el-form-item label="考核内容 " label-width="110px" class="view-header">
|
|
</el-form-item>
|
|
|
|
|
|
<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"
|
|
width="250px" 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="250px">
|
|
<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="250px">
|
|
<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="250px">
|
|
<template scope="{row}">
|
|
<el-input v-model.number="row.schools" 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" 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" plain @click="doView(nr.content,row.inspection,row)">
|
|
查看佐证材料
|
|
</el-button>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-row>
|
|
|
|
</el-form-item>
|
|
</el-form>
|
|
|
|
</div>
|
|
</transition>
|
|
|
|
</el-row>
|
|
|
|
|
|
<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>
|
|
|
|
window.vue = new Vue({
|
|
el: '#app',
|
|
data() {
|
|
return {
|
|
|
|
unions: [],
|
|
ghPageForm: {},
|
|
v: 'index',
|
|
tabLoading: false,
|
|
tableData: [],
|
|
showGh: true,
|
|
formData: {},
|
|
dialog: false,
|
|
loading: false,
|
|
pageForm: {
|
|
isAudit: 3,
|
|
pageNumber: 1,
|
|
pageSize: 10,
|
|
totalCount: 0,
|
|
year: new Date().getFullYear() + ""
|
|
},
|
|
formRules: {
|
|
schools: [{required: true, message: '请填写分数', trigger: ['blur', 'change']}],
|
|
addition: [{required: true, message: '请填写原因', trigger: ['blur', 'change']}],
|
|
},
|
|
data: {},
|
|
row: {},
|
|
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()
|
|
},
|
|
doEdit() {
|
|
let arr = []
|
|
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,
|
|
"flatid": this.formData.union_id,
|
|
"schools": b.schools,
|
|
"addition": b.addition
|
|
}
|
|
} else {
|
|
zp = {
|
|
"zb_id": this.formData.id,
|
|
"nr_id": n.id,
|
|
"bz_id": b.id,
|
|
"flatid": this.formData.union_id
|
|
}
|
|
}
|
|
arr.push(zp)
|
|
})
|
|
})
|
|
const loading = this.$loading({
|
|
lock: true,
|
|
text: '数据提交中...',
|
|
spinner: 'el-icon-loading',
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
});
|
|
$.post(base + "/platform/ghkh/xghsh/marking", {pf: JSON.stringify(arr)}, (data) => {
|
|
if (data.code == 0) {
|
|
this.v = 'index'
|
|
this.pageData()
|
|
this.$message.success(data.msg)
|
|
} else {
|
|
this.$message({
|
|
message: "请给校工会评分",
|
|
type: 'error'
|
|
});
|
|
}
|
|
loading.close()
|
|
})
|
|
|
|
},
|
|
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);
|
|
sums[index] += ' 分';
|
|
} else {
|
|
sums[index] = '';
|
|
}
|
|
});
|
|
return sums;
|
|
},
|
|
openShGh(row) {
|
|
this.v = 'edit';
|
|
$.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
|
|
})
|
|
},
|
|
doSearchGh() {
|
|
},
|
|
doSearch() {
|
|
this.pageForm.pageNumber = 1
|
|
this.pageData()
|
|
},
|
|
pageOrder(column) {//按字段排序
|
|
this.pageForm.pageOrderName = column.prop;
|
|
this.pageForm.pageOrderBy = column.order;
|
|
this.pageData();
|
|
},
|
|
pageNumberChange(val) {//页码更新操作
|
|
this.pageForm.pageNumber = val;
|
|
this.pageData();
|
|
},
|
|
pageSizeChange(val) {//分页大小更新操作
|
|
this.pageForm.pageSize = val;
|
|
this.pageData();
|
|
},
|
|
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>
|
|
<!--#
|
|
}
|
|
#--> |