232 lines
8.4 KiB
HTML
232 lines
8.4 KiB
HTML
<!--#
|
|
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>
|
|
<!--#
|
|
}
|
|
#--> |