parent
9766fb7ae5
commit
094e625569
@ -0,0 +1,32 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function list(data) {
|
||||
return request({
|
||||
url: '/salary/list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveOrEditSalaryBase(data) {
|
||||
return request({
|
||||
url: '/salary/saveOrEdit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delSalaryBase(data) {
|
||||
return request({
|
||||
url: '/salary/remove',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
export function listAll() {
|
||||
return request({
|
||||
url: '/api/salary/listAll',
|
||||
method: 'post',
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function list(data) {
|
||||
return request({
|
||||
url: '/staffSalaryBase/list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveOrEditSalaryBase(data) {
|
||||
return request({
|
||||
url: '/staffSalaryBase/saveOrEdit',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function delSalaryBase(data) {
|
||||
return request({
|
||||
url: '/staffSalaryBase/remove',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询列表
|
||||
export function listAddress(data) {
|
||||
return request({
|
||||
url: '/api/address/list',
|
||||
method: 'get',
|
||||
data
|
||||
})
|
||||
}
|
||||
@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<el-select
|
||||
v-model="staffId"
|
||||
v-select-load-more="loadSalary"
|
||||
filterable
|
||||
:clearable="clearable"
|
||||
:placeholder="placeholder"
|
||||
default-first-option
|
||||
size="small"
|
||||
@change="handleSelect"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in staffList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
>
|
||||
<div>
|
||||
<div class="inline-block item">
|
||||
<span class="option">{{ item.name }}({{ item.salary }})</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<script>
|
||||
import { list } from '@/api/school/salary'
|
||||
export default {
|
||||
props: {
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
teacher: {
|
||||
type: String,
|
||||
default: undefined
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '选择员工'
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
staffId: this.value,
|
||||
staffList: [],
|
||||
pageNum: 1,
|
||||
hasMoreData: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(newValue, oldValue) {
|
||||
this.staffId = newValue
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadSalary()
|
||||
},
|
||||
methods: {
|
||||
loadSalary: function() {
|
||||
if (this.pageNum === 1) {
|
||||
list({
|
||||
pageNum: this.pageNum,
|
||||
pageSize: 10,
|
||||
teacher: this.teacher
|
||||
}).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.staffList = response.data.rows
|
||||
this.hasMoreData = response.data.rows.length > 0
|
||||
this.pageNum = this.pageNum + 1
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
} else if (this.hasMoreData) {
|
||||
list({
|
||||
pageNum: this.pageNum,
|
||||
pageSize: 10,
|
||||
}).then(response => {
|
||||
if (response.code === 200) {
|
||||
this.staffList = this.staffList.concat(response.data.rows)
|
||||
this.hasMoreData = response.data.rows.length > 0
|
||||
this.pageNum = this.pageNum + 1
|
||||
} else {
|
||||
this.msgError(response.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSelect: function(val) {
|
||||
this.$emit('input', val)
|
||||
this.$emit('change', val)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style ref="stylesheet/scss" lang="scss" scoped>
|
||||
.option{
|
||||
padding-right: 15px;
|
||||
color: #333;
|
||||
font-weight: normal;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<el-select
|
||||
v-model="staffId"
|
||||
v-select-load-more="loadStaff"
|
||||
filterable
|
||||
:clearable="clearable"
|
||||
:placeholder="placeholder"
|
||||
default-first-option
|
||||
size="small"
|
||||
@change="handleSelect"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in staffList"
|
||||
:key="item.staffId"
|
||||
:label="item.staffName"
|
||||
:value="item.staffId"
|
||||
>
|
||||
<div>
|
||||
<div class="inline-block item">
|
||||
<span class="title">姓名:</span>
|
||||
<span class="option">{{ item.staffName }}</span>
|
||||
</div>
|
||||
<div class="inline-block item">
|
||||
<span class="title">联系电话:</span>
|
||||
<span class="option">{{ item.phone }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<script>
|
||||
import { listSchool } from '@/api/school/sc/school'
|
||||
export default {
|
||||
props: {
|
||||
clearable: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
teacher: {
|
||||
type: String,
|
||||
default: undefined
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '选择员工'
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: undefined
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
staffId: this.value,
|
||||
staffList: [],
|
||||
pageNum: 1,
|
||||
hasMoreData: false
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(newValue, oldValue) {
|
||||
this.staffId = newValue
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.loadStaff()
|
||||
},
|
||||
methods: {
|
||||
loadStaff: function() {
|
||||
if (this.pageNum === 1) {
|
||||
listSchool({
|
||||
pageNum: this.pageNum,
|
||||
teacher: this.teacher
|
||||
}).then(response => {
|
||||
if (response.respCode === '0000') {
|
||||
this.staffList = response.data.rows
|
||||
this.hasMoreData = response.data.rows.length > 0
|
||||
this.pageNum = this.pageNum + 1
|
||||
} else {
|
||||
this.msgError(response.respMsg)
|
||||
}
|
||||
})
|
||||
} else if (this.hasMoreData) {
|
||||
listSchool({
|
||||
pageNum: this.pageNum
|
||||
}).then(response => {
|
||||
if (response.respCode === '0000') {
|
||||
this.staffList = this.staffList.concat(response.data.rows)
|
||||
this.hasMoreData = response.data.rows.length > 0
|
||||
this.pageNum = this.pageNum + 1
|
||||
} else {
|
||||
this.msgError(response.respMsg)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleSelect: function(val) {
|
||||
this.$emit('input', val)
|
||||
this.$emit('change', val)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style ref="stylesheet/scss" lang="scss" scoped>
|
||||
.option{
|
||||
padding-right: 15px;
|
||||
color: #333;
|
||||
font-weight: normal;
|
||||
}
|
||||
</style>
|
||||
@ -0,0 +1,21 @@
|
||||
export default {
|
||||
inserted(el, binding, vnode) {
|
||||
// 获取element-ui定义好的scroll盒子
|
||||
const SELECTWRAP_DOM = el.querySelector('.el-select-dropdown .el-select-dropdown__wrap')
|
||||
|
||||
SELECTWRAP_DOM.addEventListener('scroll', function() {
|
||||
/*
|
||||
* scrollHeight 获取元素内容高度(只读)
|
||||
* scrollTop 获取或者设置元素的偏移值,常用于, 计算滚动条的位置, 当一个元素的容器没有产生垂直方向的滚动条, 那它的scrollTop的值默认为0.
|
||||
* clientHeight 读取元素的可见高度(只读)
|
||||
* 如果元素滚动到底, 下面等式返回true, 没有则返回false:
|
||||
* ele.scrollHeight - ele.scrollTop === ele.clientHeight;
|
||||
*/
|
||||
const CONDITION = this.scrollHeight - this.scrollTop <= this.clientHeight
|
||||
|
||||
if (CONDITION) {
|
||||
binding.value()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,104 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="80px">
|
||||
<el-form-item label="开课校区:" prop="name">
|
||||
<SchoolSelect v-model="queryParams.schoolId" placeholder="请选择校区"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="课程:" prop="name">
|
||||
<course-select v-model="courseIdArray" :dept-id="queryParams.deptId" clearable multiple mounted-load-all />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column prop="name" label="薪资配置名称" />
|
||||
<el-table-column prop="salary" label="薪资金额(元)" />
|
||||
<el-table-column width="150" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit-outline" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
|
||||
<ChangeSalaryBase ref="changeSalaryBase" @success="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import ChangeSalaryBase from "@/views/school/salary/comps/ChangeSalaryBase.vue";
|
||||
import {delSalaryBase, list} from "@/api/school/salary";
|
||||
import SchoolSelect from "@/components/sc/school/schoolSelect.vue";
|
||||
import courseSelect from "@/components/sc/course/courseSelect.vue";
|
||||
|
||||
export default {
|
||||
name: 'CalTime',
|
||||
components: {courseSelect, SchoolSelect, ChangeSalaryBase},
|
||||
data(){
|
||||
return{
|
||||
loading: true,
|
||||
single: true,
|
||||
multiple: true,
|
||||
total: 0,
|
||||
dataList: [],
|
||||
open: false,
|
||||
courseIdArray:[],
|
||||
queryParams:{
|
||||
schoolId:'',
|
||||
pageNum:1,
|
||||
pageSize: 10,
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleAdd(){
|
||||
this.$refs.changeSalaryBase.handleAdd()
|
||||
},
|
||||
handleUpdate(row){
|
||||
this.$refs.changeSalaryBase.handleUpdate(row)
|
||||
},
|
||||
handleDelete(){
|
||||
this.$confirm('是否确认删除?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function() {
|
||||
return delSalaryBase({id:row.id})
|
||||
}).then((res) => {
|
||||
this.getList()
|
||||
this.msgSuccess(res.msg)
|
||||
}).catch(function() {})
|
||||
},
|
||||
getList(){
|
||||
this.loading=false
|
||||
list(this.queryParams).then(res=>{
|
||||
this.total=res.data.total
|
||||
this.dataList=res.data.rows
|
||||
})
|
||||
},
|
||||
handleQuery(){
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery(){
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,79 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog title="添加基础薪资配置" :visible.sync="open" width="600px">
|
||||
<el-form ref="form" :model="form" label-width="90px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="配置名称:" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入配置名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="金额(元):" prop="salary">
|
||||
<el-input v-model="form.salary" placeholder="请输入配置名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {saveOrEditSalaryBase} from "@/api/school/salary";
|
||||
|
||||
export default {
|
||||
name: 'ChangeSalaryBase',
|
||||
data() {
|
||||
return {
|
||||
open: false,
|
||||
// 表单参数
|
||||
form: {
|
||||
name: '',
|
||||
salary:null,
|
||||
},
|
||||
loadingSelect: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
name:'',
|
||||
salary: null,
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加学生基本信息'
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const data=JSON.parse(JSON.stringify(row))
|
||||
this.form=data
|
||||
this.open = true
|
||||
this.title = '修改学生基本信息'
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
saveOrEditSalaryBase(this.form).then(res=>{
|
||||
this.msgSuccess(res.msg)
|
||||
this.open = false
|
||||
this.$emit('success')
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog title="添加教师基础工资配置" :visible.sync="open" width="600px">
|
||||
<el-form ref="form" :model="form" label-width="120px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="员工:" prop="name">
|
||||
<staff-select v-model="form.teacherId" teacher="1" placeholder="请选择任课教师" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="薪资配置(元):" prop="salary">
|
||||
<SalaryBaseSelect v-model="form.salary" placeholder="请输入配置名称" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {saveOrEditSalaryBase} from "@/api/school/salary";
|
||||
import staffSelect from "@/components/system/staff/staffSelect.vue";
|
||||
import SalaryBaseSelect from "@/components/sc/salary/salaryBaseSelect.vue";
|
||||
|
||||
export default {
|
||||
name: 'ChangeStaffSalaryBase',
|
||||
components: {SalaryBaseSelect, staffSelect},
|
||||
data() {
|
||||
return {
|
||||
open: false,
|
||||
// 表单参数
|
||||
form: {
|
||||
name: '',
|
||||
salary:null,
|
||||
},
|
||||
loadingSelect: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
reset() {
|
||||
this.form = {
|
||||
name:'',
|
||||
salary: null,
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加学生基本信息'
|
||||
},
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const data=JSON.parse(JSON.stringify(row))
|
||||
this.form=data
|
||||
this.open = true
|
||||
this.title = '修改学生基本信息'
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
saveOrEditSalaryBase(this.form).then(res=>{
|
||||
this.msgSuccess(res.msg)
|
||||
this.open = false
|
||||
this.$emit('success')
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,98 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="80px">
|
||||
<el-form-item label="配置名称:" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入薪资配置名称" clearable size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column prop="name" label="薪资配置名称" />
|
||||
<el-table-column prop="salary" label="薪资金额(元)" />
|
||||
<el-table-column width="150" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit-outline" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
|
||||
<ChangeSalaryBase ref="changeSalaryBase" @success="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import ChangeSalaryBase from "@/views/school/salary/comps/ChangeSalaryBase.vue";
|
||||
import {delSalaryBase, list} from "@/api/school/salary";
|
||||
|
||||
export default {
|
||||
name: 'SalaryBase',
|
||||
components: {ChangeSalaryBase},
|
||||
data(){
|
||||
return{
|
||||
loading: true,
|
||||
single: true,
|
||||
multiple: true,
|
||||
total: 0,
|
||||
dataList: [],
|
||||
open: false,
|
||||
queryParams:{
|
||||
name:'',
|
||||
pageNum:1,
|
||||
pageSize: 10,
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleAdd(){
|
||||
this.$refs.changeSalaryBase.handleAdd()
|
||||
},
|
||||
handleUpdate(row){
|
||||
this.$refs.changeSalaryBase.handleUpdate(row)
|
||||
},
|
||||
handleDelete(){
|
||||
this.$confirm('是否确认删除?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function() {
|
||||
return delSalaryBase({id:row.id})
|
||||
}).then((res) => {
|
||||
this.getList()
|
||||
this.msgSuccess(res.msg)
|
||||
}).catch(function() {})
|
||||
},
|
||||
getList(){
|
||||
this.loading=false
|
||||
list(this.queryParams).then(res=>{
|
||||
this.total=res.data.total
|
||||
this.dataList=res.data.rows
|
||||
})
|
||||
},
|
||||
handleQuery(){
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery(){
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="80px">
|
||||
<el-form-item label="薪资配置:" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请选择基础薪资" clearable size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="员工:" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请选择员工" clearable size="small"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column prop="staffName" label="教师姓名" />
|
||||
<el-table-column prop="salaryBaseName" label="基础薪资名称" />
|
||||
<el-table-column prop="salary" label="薪资金额(元)" />
|
||||
<el-table-column width="150" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit-outline" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
|
||||
<ChangeStaffSalaryBase ref="changeStaffSalaryBase" @success="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import ChangeSalaryBase from "@/views/school/salary/comps/ChangeSalaryBase.vue";
|
||||
import {delSalaryBase, list} from "@/api/school/salary/staff";
|
||||
import ChangeStaffSalaryBase from "@/views/school/salary/comps/ChangeStaffSalaryBase.vue";
|
||||
|
||||
export default {
|
||||
name: 'SalaryBase',
|
||||
components: {ChangeStaffSalaryBase, ChangeSalaryBase},
|
||||
data(){
|
||||
return{
|
||||
loading: true,
|
||||
single: true,
|
||||
multiple: true,
|
||||
total: 0,
|
||||
dataList: [],
|
||||
open: false,
|
||||
queryParams:{
|
||||
name:'',
|
||||
pageNum:1,
|
||||
pageSize: 10,
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
handleAdd(){
|
||||
this.$refs.changeStaffSalaryBase.handleAdd()
|
||||
},
|
||||
handleUpdate(row){
|
||||
this.$refs.changeStaffSalaryBase.handleUpdate(row)
|
||||
},
|
||||
handleDelete(){
|
||||
this.$confirm('是否确认删除?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function() {
|
||||
return delSalaryBase({id:row.id})
|
||||
}).then((res) => {
|
||||
this.getList()
|
||||
this.msgSuccess(res.msg)
|
||||
}).catch(function() {})
|
||||
},
|
||||
getList(){
|
||||
this.loading=false
|
||||
list(this.queryParams).then(res=>{
|
||||
this.total=res.data.total
|
||||
this.dataList=res.data.rows
|
||||
})
|
||||
},
|
||||
handleQuery(){
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery(){
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -1,282 +1,26 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form ref="queryForm" :model="queryParams" :inline="true" label-width="68px">
|
||||
<el-form-item label="所属校区" prop="deptId">
|
||||
<dept-select v-model="queryParams.deptId" placeholder="请输入所属校区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="教室名" prop="roomName">
|
||||
<el-input
|
||||
v-model="queryParams.roomName"
|
||||
placeholder="请输入教室名"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="memo">
|
||||
<el-input
|
||||
v-model="queryParams.memo"
|
||||
placeholder="请输入备注"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-hasPermi="['sc:room:add']"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-hasPermi="['sc:room:update']"
|
||||
type="primary"
|
||||
icon="el-icon-edit-outline"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
v-hasPermi="['sc:room:delete']"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column prop="deptName" label="所属校区" />
|
||||
<el-table-column prop="roomName" label="教室名" />
|
||||
<el-table-column prop="memo" label="备注" />
|
||||
<el-table-column width="150" label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
v-hasPermi="['sc:room:update']"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit-outline"
|
||||
@click="handleUpdate(scope.row)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
v-hasPermi="['sc:room:delete']"
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px">
|
||||
<el-form ref="form" v-loading="loadingChange" :model="form" :rules="rules" label-width="80px">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="教室名:" prop="roomName">
|
||||
<el-input v-model="form.roomName" placeholder="请输入教室名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属校区:" prop="deptId">
|
||||
<dept-select v-model="form.deptId" placeholder="请选择所属校区" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注:" prop="memo">
|
||||
<el-input v-model="form.memo" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="loadingChange" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-tabs>
|
||||
<el-tab-pane label="基础薪资配置" name="first">基础薪资配置</el-tab-pane>
|
||||
<el-tab-pane label="员工基础薪资" name="second">员工基础薪资</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listRoom, getRoom, delRoom, addRoom, updateRoom } from '@/api/school/sc/room'
|
||||
import deptSelect from '@/components/system/dept/deptSelect'
|
||||
export default {
|
||||
name: 'Room',
|
||||
components: {
|
||||
deptSelect
|
||||
},
|
||||
name: 'Salary',
|
||||
data(){
|
||||
return{
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
loadingChange: false,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 表格树数据
|
||||
dataList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deptId: undefined,
|
||||
roomName: undefined,
|
||||
memo: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
roomName: [
|
||||
{ required: true, message: '教室名不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
listRoom(this.queryParams).then(response => {
|
||||
this.dataList = response.data.rows
|
||||
this.total = response.data.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
deptId: undefined,
|
||||
roomName: undefined,
|
||||
memo: undefined
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd(row) {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加教室'
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.roomId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
getRoom(row.roomId || this.ids).then(response => {
|
||||
this.form = response.data
|
||||
this.open = true
|
||||
this.title = '修改教室'
|
||||
})
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
this.loadingChange = true
|
||||
if (this.form.roomId !== undefined) {
|
||||
updateRoom(this.form).then(response => {
|
||||
this.loadingChange = false
|
||||
if (response.respCode === '0000') {
|
||||
this.msgSuccess('修改成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.respMsg)
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loadingChange = false
|
||||
})
|
||||
} else {
|
||||
addRoom(this.form).then(response => {
|
||||
this.loadingChange = false
|
||||
if (response.respCode === '0000') {
|
||||
this.msgSuccess('新增成功')
|
||||
this.open = false
|
||||
this.getList()
|
||||
} else {
|
||||
this.msgError(response.respMsg)
|
||||
}
|
||||
}).catch(() => {
|
||||
this.loadingChange = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.roomId || this.ids
|
||||
this.$confirm('是否确认删除?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(function() {
|
||||
return delRoom(id)
|
||||
}).then((response) => {
|
||||
if (response.respCode === '0000') {
|
||||
this.getList()
|
||||
this.msgSuccess('删除成功')
|
||||
} else {
|
||||
this.msgError(response.respMsg)
|
||||
}
|
||||
}).catch(function() {})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
Reference in new issue