员工补贴页面修改

master
wanglei 7 months ago
parent 9b80e71b7e
commit 5221df8714

@ -42,3 +42,13 @@ export function delButieEmplyee(id) {
method: 'delete'
})
}
// 查询员工补贴 列表
export function listSummary(query) {
return request({
url: '/pay/butieEmplyee/summary',
method: 'get',
params: query
})
}

@ -1,134 +1,151 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="租户id" prop="tenantId">
<el-input
v-model="queryParams.tenantId"
placeholder="请输入租户id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="补贴id" prop="butieId">
<el-input
v-model="queryParams.butieId"
placeholder="请输入补贴id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="员工id" prop="employeeId">
<el-input
v-model="queryParams.employeeId"
placeholder="请输入员工id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="补贴扣减金额" prop="money">
<el-input
v-model="queryParams.money"
placeholder="请输入补贴扣减金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="年月日期" prop="date">
<el-input
v-model="queryParams.date"
placeholder="请输入年月日期"
clearable
@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
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['pay:butieEmplyee:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['pay:butieEmplyee:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['pay:butieEmplyee:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['pay:butieEmplyee:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<div class="company" v-if="!$store.state.user.tenantId">
<el-input
style="width: 200px"
placeholder="公司名称"
size="small"
prefix-icon="el-icon-search"
v-model="gsInfo.tenantName"
@keyup.enter.native="getGsInfoList">
</el-input>
<div class="cp-content" style="width: 200px">
<div :class="gsInfo.active_id===item.id?'cp-item active':'cp-item'" @click="changCompany(item.id)" v-for="item in gsInfo.list">{{ item.name }}</div>
</div>
</div>
<el-table v-loading="loading" :data="butieEmplyeeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="id" v-if="true"/>
<el-table-column label="租户id" align="center" prop="tenantId" />
<el-table-column label="补贴id" align="center" prop="butieId" />
<el-table-column label="员工id" align="center" prop="employeeId" />
<el-table-column label="补贴扣减金额" align="center" prop="money" />
<el-table-column label="年月日期" align="center" prop="date" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<div :class="$store.state.user.tenantId?'content-all':'content'">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="租户id" prop="tenantId">
<el-input
v-model="queryParams.tenantId"
placeholder="请输入租户id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="补贴id" prop="butieId">
<el-input
v-model="queryParams.butieId"
placeholder="请输入补贴id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="员工id" prop="employeeId">
<el-input
v-model="queryParams.employeeId"
placeholder="请输入员工id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="补贴扣减金额" prop="money">
<el-input
v-model="queryParams.money"
placeholder="请输入补贴扣减金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="年月日期" prop="date">
<el-input
v-model="queryParams.date"
placeholder="请输入年月日期"
clearable
@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
type="primary"
plain
icon="el-icon-plus"
size="mini"
type="text"
@click="handleAdd"
v-hasPermi="['pay:butieEmplyee:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['pay:butieEmplyee:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
size="mini"
type="text"
type="danger"
plain
icon="el-icon-delete"
@click="handleDelete(scope.row)"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['pay:butieEmplyee:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['pay:butieEmplyee:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="butieEmplyeeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="id" v-if="true"/>
<el-table-column label="租户id" align="center" prop="tenantId" />
<el-table-column label="补贴id" align="center" prop="butieId" />
<el-table-column label="员工id" align="center" prop="employeeId" />
<el-table-column label="补贴扣减金额" align="center" prop="money" />
<el-table-column label="年月日期" align="center" prop="date" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['pay:butieEmplyee:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['pay:butieEmplyee:remove']"
>删除</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"
/>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
<!-- 添加或修改补贴和员工联系对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
@ -161,12 +178,19 @@
</template>
<script>
import { listButieEmplyee, getButieEmplyee, delButieEmplyee, addButieEmplyee, updateButieEmplyee } from "@/api/pay/butieEmplyee";
import { listSummary, getButieEmplyee, delButieEmplyee, addButieEmplyee, updateButieEmplyee } from "@/api/pay/butieEmplyee";
import { listTenant } from "@/api/pay/tenant";
export default {
name: "ButieEmplyee",
data() {
return {
//
gsInfo:{
tenantName:'',
active_id:this.$store.state.user.tenantId,
list:[]
},
// loading
buttonLoading: false,
//
@ -226,13 +250,38 @@ export default {
};
},
created() {
this.getList();
if (!this.$store.state.user.tenantId) {
this.getGsInfoList()
}else {
this.gsInfo.active_id = this.$store.state.user.tenantId
this.getList();
}
},
methods: {
//
getGsInfoList(){
listTenant({ name: this.gsInfo.tenantName }).then(response => {
if(response.rows.length>0){
this.gsInfo.list = response.rows;
this.gsInfo.active_id = this.gsInfo.list[0].id
this.getList()
}else{
this.$alert(`没有查到相关公司,暂无数据!`, `提示`, {
type: 'warning'
});
}
});
},
//
changCompany(id){
this.gsInfo.active_id = id
this.getList()
},
/** 查询补贴和员工联系列表 */
getList() {
this.loading = true;
listButieEmplyee(this.queryParams).then(response => {
this.queryParams.tenantId = this.gsInfo.active_id;
listSummary(this.queryParams).then(response => {
this.butieEmplyeeList = response.rows;
this.total = response.total;
this.loading = false;
@ -343,3 +392,43 @@ export default {
}
};
</script>
<style scoped lang="scss">
.app-container {
display: flex;
.company {
border-radius: 5px;
width: 230px;
height: calc(100vh - 115px);
overflow-y: auto;
.cp-content {
margin-top: 20px;
.cp-item {
cursor: pointer;
padding: 6px 10px 6px 5px;
color: #424242;
font-size: 14px;
&:hover {
background: #f6f6f6;
}
}
.active{
background: #edf6ff;
}
}
}
.content{
padding-left: 15px;
width: calc(100% - 250px);
.el-button--medium {
padding: 2px 0px;
}
}
.content-all{
width: 100%;
.el-button--medium {
padding: 2px 0px;
}
}
}
</style>

Loading…
Cancel
Save