<template>
|
<div class="custom-box">
|
<v-header
|
title="技能管理"
|
></v-header>
|
<div class="add">
|
<span class="back-color" @click="$router.go(-1)"><i class="el-icon-arrow-left"></i>返回上一级</span>
|
</div>
|
<div class="serachContent">
|
<el-form :inline="true" class="demo-form-inline">
|
<el-form-item label="关键词">
|
<el-input v-model="search.keyWord" style="width:350px" size="small" placeholder="请输入 请输入类型名称进行查找"></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button size="small" type="primary" @click="onSearch()">查询</el-button>
|
<el-button size="small" @click="Reset()">重置</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
<div class="addBtn">
|
<el-button size="small" type="primary" @click="add">新增</el-button>
|
</div>
|
<div class="tableBox">
|
<my-eltable
|
id="printTable"
|
ref="mt"
|
:paginationDataSource="tableData"
|
:tabheight="tabheight"
|
:tableHeader="tableHeader"
|
:loading="loading"
|
:checkbox="checkboxTable"
|
:isIndex="isIndex"
|
@onPageSizeChange="onPageSizeChange"
|
@onPaginationChange="onPaginationChange"
|
>
|
<template v-slot:btn="{ scope }">
|
<el-button type="text" @click="edit(scope)">编辑</el-button>
|
<el-button type="text" @click="deletes(scope)">删除</el-button>
|
</template>
|
</my-eltable>
|
</div>
|
<!-- 弹框模板 -->
|
<AddSkill v-model="isShow" :serverData="serverData" @change="isShow = false" @success="onAddSuccess"></AddSkill>
|
</div>
|
</template>
|
<script>
|
|
// import * as organizationServicer from '@/services/organizationServicer';
|
import MyEltable from '@/components/table/table2';
|
import AddSkill from './com/AddSkill'
|
export default {
|
name: 'Index',
|
components: { MyEltable, AddSkill },
|
props: [],
|
data() {
|
return {
|
isShow: false,
|
tableData: {},
|
loading: false,
|
checkboxTable: false,
|
isIndex: true,
|
tabheight: '100%',
|
tableHeader: [
|
{ label: '技能名称', prop: 'name' },
|
{ label: '备注', prop: 'remark' },
|
{ label: '创建人', prop: 'createByName' },
|
{ label: '创建时间', prop: 'createAt' },
|
{ label: '操作', slot: 'btn' }
|
],
|
search: {
|
keyWord: ''
|
},
|
/** 分页参数 */
|
paginationParams: {
|
currentPage: 1,
|
pageSize: 10,
|
total: 0
|
},
|
serverData: {}
|
};
|
},
|
|
mounted() {
|
this.init();
|
},
|
methods: {
|
add() {
|
this.isShow = true;
|
},
|
edit(d) {
|
this.serverData = d;
|
this.isShow = true;
|
},
|
onAddSuccess() {
|
this.isShow = false;
|
this.init()
|
},
|
deletes(d) {
|
this.$confirm('确定要删除该技能吗?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning'
|
}).then(async () => {
|
this.$api.get('volunteer/skill/delete',d,res=>{
|
// console.log(res)
|
this.$message('删除成功');
|
this.init();
|
})
|
// return
|
// await organizationServicer.deleteskill(d)
|
|
}).catch((res) => {
|
this.$message(res.message)
|
});
|
},
|
/** pageSize 改变时会触发 */
|
onPageSizeChange (pageSize) {
|
this.paginationParams.pageSize = pageSize;
|
this.init();
|
},
|
/** 分页 */
|
onPaginationChange (page) {
|
this.paginationParams.currentPage = page;
|
this.init();
|
},
|
|
onSearch() {
|
this.init();
|
},
|
Reset() {
|
this.search = {
|
status: '',
|
keyword: ''
|
};
|
this.init();
|
},
|
|
async init() {
|
const params = {
|
pageNum: this.paginationParams.currentPage,
|
pageSize: this.paginationParams.pageSize,
|
...this.search
|
}
|
this.$api.post('volunteer/skill/page',params,res=>{
|
this.tableData = res;
|
})
|
// return
|
// const res = await organizationServicer.skillpage(params)
|
|
}
|
}
|
};
|
</script>
|
<style lang="less" scoped>
|
/*@import '../../../styles/table.less';*/
|
.add {
|
text-align: right;
|
cursor: pointer;
|
}
|
</style>
|