You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
124 lines
4.2 KiB
124 lines
4.2 KiB
3 years ago
|
<template>
|
||
|
<div class="main-content">
|
||
|
<div class="area-form">
|
||
|
<el-form :inline="true" size="default">
|
||
|
<el-form-item label="员工名">
|
||
|
<el-input v-model="form.name" placeholder="请输入"></el-input>
|
||
|
</el-form-item>
|
||
|
<el-form-item label="部门">
|
||
|
<el-input v-model="form.department" placeholder="请输入"></el-input>
|
||
|
</el-form-item>
|
||
|
<el-form-item>
|
||
|
<el-button type="primary" @click="confirm">查 询</el-button>
|
||
|
<el-button @click="reset">重 置</el-button>
|
||
|
</el-form-item>
|
||
|
</el-form>
|
||
|
</div>
|
||
|
<div class="area-table">
|
||
|
<el-table :data="tableData.data" size="default" border :header-cell-style="{background: '#EEE'}">
|
||
|
<el-table-column prop="name" label="员工" width="360"></el-table-column>
|
||
|
<el-table-column prop="main_departmentName" label="部门"></el-table-column>
|
||
|
<el-table-column prop="sub_departmentName" label="上级部门"></el-table-column>
|
||
|
<el-table-column prop="point" label="积分"></el-table-column>
|
||
|
<el-table-column prop="action" label="操作" fixed="right" width="240">
|
||
|
<template #default="scope">
|
||
|
<el-link type="primary" @click="changePoint(scope.row.id)">修改积分</el-link>
|
||
|
</template>
|
||
|
</el-table-column>
|
||
|
</el-table>
|
||
|
<el-pagination
|
||
|
v-model:currentPage="pagination.current"
|
||
|
v-model:page-size="pagination.pageSize"
|
||
|
:page-sizes="[10, 20, 30, 40]"
|
||
|
background
|
||
|
layout="total, sizes, prev, pager, next, jumper"
|
||
|
:total="pagination.total"
|
||
|
/>
|
||
|
</div>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import {defineComponent, reactive, watch, getCurrentInstance} from 'vue'
|
||
|
import {statusFormatter} from './config.js'
|
||
|
export default defineComponent({
|
||
|
name: 'v-questList',
|
||
|
setup() {
|
||
|
const form = reactive({
|
||
|
name: undefined,
|
||
|
department: undefined,
|
||
|
});
|
||
|
const tableData = reactive({
|
||
|
data: [],
|
||
|
});
|
||
|
const pagination = reactive({
|
||
|
total: 0,
|
||
|
current: 1,
|
||
|
pageSize: 10
|
||
|
})
|
||
|
const { proxy } = getCurrentInstance();
|
||
|
return {
|
||
|
form,proxy,
|
||
|
tableData,pagination,
|
||
|
statusFormatter
|
||
|
}
|
||
|
},
|
||
|
mounted() {
|
||
|
// this.getApi()
|
||
|
// this.getData()
|
||
|
watch(() => (this.pagination.pageSize), () => {
|
||
|
this.getData()
|
||
|
});
|
||
|
watch(() => (this.pagination.current), () => {
|
||
|
this.getData()
|
||
|
})
|
||
|
},
|
||
|
methods: {
|
||
|
getApi() {
|
||
|
let obj = Object.assign(this.form,{pageNum: this.pagination.current,pageSize: this.pagination.pageSize})
|
||
|
this.proxy.$post("/user/department", obj).then(res => {
|
||
|
const data = res.data
|
||
|
}).catch(() => {});
|
||
|
},
|
||
|
getData() {
|
||
|
let obj = Object.assign(this.form,{pageNum: this.pagination.current,pageSize: this.pagination.pageSize})
|
||
|
this.proxy.$post("/user/list", obj).then(res => {
|
||
|
if(res.code == 200) {
|
||
|
const data = res.data
|
||
|
this.tableData.data = data.records;
|
||
|
this.pagination.total = data.total
|
||
|
} else {
|
||
|
this.$message.error(res.msg)
|
||
|
}
|
||
|
}).catch(() => {});
|
||
|
},
|
||
|
confirm() {
|
||
|
this.getData()
|
||
|
},
|
||
|
reset() {
|
||
|
this.form.name = undefined;
|
||
|
this.form.department = undefined;
|
||
|
this.getData();
|
||
|
},
|
||
|
changePoint(value) {
|
||
|
|
||
|
},
|
||
|
//删除
|
||
|
singleDel(id) {
|
||
|
this.$alert(
|
||
|
'是否删除'+id+'?', //文字
|
||
|
'删除', //标题
|
||
|
{type: 'warning'}
|
||
|
).then(() => {
|
||
|
this.$message.success('删除成功')
|
||
|
}).catch(() => {})
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
</script>
|
||
|
|
||
|
<style lang="less" scoped>
|
||
|
.area-table {
|
||
|
margin-top: 16px
|
||
|
}
|
||
|
</style>
|