|
|
|
|
@ -16,27 +16,11 @@
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<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-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
|
|
|
|
|
<el-form-item label="员工姓名" prop="employeeId">
|
|
|
|
|
<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"
|
|
|
|
|
v-model="queryParams.empName"
|
|
|
|
|
placeholder="请输入员工姓名"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
@ -50,12 +34,12 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="年月日期" prop="date">
|
|
|
|
|
<el-input
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="queryParams.date"
|
|
|
|
|
placeholder="请输入年月日期"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
type="month"
|
|
|
|
|
value-format="yyyy-MM"
|
|
|
|
|
placeholder="请选择年月日期">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
@ -68,72 +52,61 @@
|
|
|
|
|
<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"
|
|
|
|
|
icon="el-icon-magic-stick"
|
|
|
|
|
size="mini"
|
|
|
|
|
@click="handleExport"
|
|
|
|
|
v-hasPermi="['pay:butieEmplyee:export']"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
@click="openGenerateDialog"
|
|
|
|
|
v-hasPermi="['pay:butieEmplyee:gen']"
|
|
|
|
|
>生成</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 v-loading="loading" :data="butieEmplyeeList">
|
|
|
|
|
<el-table-column label="员工" align="center" prop="empName" />
|
|
|
|
|
<!-- <el-table-column label="补贴扣减金额" align="center" prop="money" />-->
|
|
|
|
|
<el-table-column label="年月日期" align="center" prop="date">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<span>{{ parseTime(scope.row.date, '{y}年{m}月') }}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column :label="item.butieName" align="center" :prop="item.butieName" min-width="80%" v-for="(item, index) in butieMap" :key="index">
|
|
|
|
|
<template slot-scope="scope" >
|
|
|
|
|
<template v-for="(sum,i) in scope.row.btList">
|
|
|
|
|
<template v-if="scope.row.edit && item.butieName === sum.butieName">
|
|
|
|
|
<el-input v-model="sum.money" class="edit-input" size="small" />
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<span :key="i" v-if="item.butieName === sum.butieName">{{sum.money}}</span>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="!scope.row.edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-edit"
|
|
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
|
|
v-hasPermi="['pay:butieEmplyee:edit']"
|
|
|
|
|
v-hasPermi="['pay:butieEmplyee:alledit']"
|
|
|
|
|
>修改</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="scope.row.edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-circle-check"
|
|
|
|
|
@click="ensureRowEdit(scope.row)"
|
|
|
|
|
v-hasPermi="['pay:butieEmplyee:alledit']"
|
|
|
|
|
>确定</el-button>
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="scope.row.edit"
|
|
|
|
|
size="mini"
|
|
|
|
|
type="text"
|
|
|
|
|
icon="el-icon-delete"
|
|
|
|
|
@click="handleDelete(scope.row)"
|
|
|
|
|
v-hasPermi="['pay:butieEmplyee:remove']"
|
|
|
|
|
>删除</el-button>
|
|
|
|
|
icon="el-icon-circle-close"
|
|
|
|
|
@click="cancelRowEdit(scope.row)"
|
|
|
|
|
v-hasPermi="['pay:butieEmplyee:alledit']"
|
|
|
|
|
>取消</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
@ -147,38 +120,27 @@
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 添加或修改补贴和员工联系对话框 -->
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
<el-form-item label="租户id" prop="tenantId">
|
|
|
|
|
<el-input v-model="form.tenantId" placeholder="请输入租户id" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="补贴id" prop="butieId">
|
|
|
|
|
<el-input v-model="form.butieId" placeholder="请输入补贴id" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="员工id" prop="employeeId">
|
|
|
|
|
<el-input v-model="form.employeeId" placeholder="请输入员工id" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="补贴扣减金额" prop="money">
|
|
|
|
|
<el-input v-model="form.money" placeholder="请输入补贴扣减金额" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="年月日期" prop="date">
|
|
|
|
|
<el-input v-model="form.date" placeholder="请输入年月日期" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-dialog title="选择自动生成月份" :visible.sync="generateDialogVisible" :close-on-click-modal="false" width="300">
|
|
|
|
|
<div class="block">
|
|
|
|
|
<span class="demonstration">请选择月份 </span>
|
|
|
|
|
<el-date-picker
|
|
|
|
|
v-model="genMonth"
|
|
|
|
|
type="month"
|
|
|
|
|
value-format="yyyy-MM"
|
|
|
|
|
placeholder="月份">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
<el-button @click="generateDialogVisible = false">取 消</el-button>
|
|
|
|
|
<el-button type="primary" @click="generateBuTieEmpByMonth">确 定</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listSummary, getButieEmplyee, delButieEmplyee, addButieEmplyee, updateButieEmplyee } from "@/api/pay/butieEmplyee";
|
|
|
|
|
import { listSummary, checkDataExist, generateBuTieEmpByMonth, updateAllbt } from "@/api/pay/butieEmplyee";
|
|
|
|
|
import { listTenant } from "@/api/pay/tenant";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
@ -191,26 +153,14 @@ export default {
|
|
|
|
|
active_id:this.$store.state.user.tenantId,
|
|
|
|
|
list:[]
|
|
|
|
|
},
|
|
|
|
|
// 按钮loading
|
|
|
|
|
buttonLoading: false,
|
|
|
|
|
// 遮罩层
|
|
|
|
|
loading: true,
|
|
|
|
|
// 选中数组
|
|
|
|
|
ids: [],
|
|
|
|
|
// 非单个禁用
|
|
|
|
|
single: true,
|
|
|
|
|
// 非多个禁用
|
|
|
|
|
multiple: true,
|
|
|
|
|
// 显示搜索条件
|
|
|
|
|
showSearch: true,
|
|
|
|
|
// 总条数
|
|
|
|
|
total: 0,
|
|
|
|
|
// 补贴和员工联系表格数据
|
|
|
|
|
butieEmplyeeList: [],
|
|
|
|
|
// 弹出层标题
|
|
|
|
|
title: "",
|
|
|
|
|
// 是否显示弹出层
|
|
|
|
|
open: false,
|
|
|
|
|
// 查询参数
|
|
|
|
|
queryParams: {
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
@ -221,32 +171,10 @@ export default {
|
|
|
|
|
money: undefined,
|
|
|
|
|
date: undefined,
|
|
|
|
|
},
|
|
|
|
|
// 表单参数
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
id: [
|
|
|
|
|
{ required: true, message: "主键ID不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
tenantId: [
|
|
|
|
|
{ required: true, message: "租户id不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
butieId: [
|
|
|
|
|
{ required: true, message: "补贴id不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
employeeId: [
|
|
|
|
|
{ required: true, message: "员工id不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
money: [
|
|
|
|
|
{ required: true, message: "补贴扣减金额不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
date: [
|
|
|
|
|
{ required: true, message: "年月日期不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
remark: [
|
|
|
|
|
{ required: true, message: "备注不能为空", trigger: "blur" }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
butieMap: [],
|
|
|
|
|
// 补贴信息生成对话框
|
|
|
|
|
generateDialogVisible: false,
|
|
|
|
|
genMonth: null,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
@ -283,32 +211,31 @@ export default {
|
|
|
|
|
this.queryParams.tenantId = this.gsInfo.active_id;
|
|
|
|
|
listSummary(this.queryParams).then(response => {
|
|
|
|
|
this.butieEmplyeeList = response.rows;
|
|
|
|
|
if(this.butieEmplyeeList.length > 0){
|
|
|
|
|
this.butieMap = [];
|
|
|
|
|
this.butieEmplyeeList.forEach(item => {
|
|
|
|
|
this.$set(item,"btList",[]);
|
|
|
|
|
for(const key in item.butieMap){
|
|
|
|
|
var list = {
|
|
|
|
|
butieName: key,
|
|
|
|
|
money: item.butieMap[key].money,
|
|
|
|
|
btid: item.butieMap[key].btid
|
|
|
|
|
}
|
|
|
|
|
item.btList.push(list);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
for(const key in this.butieEmplyeeList[0].butieMap){
|
|
|
|
|
var list = {
|
|
|
|
|
butieName: key
|
|
|
|
|
}
|
|
|
|
|
this.butieMap.push(list);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(this.butieEmplyeeList);
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
id: undefined,
|
|
|
|
|
tenantId: undefined,
|
|
|
|
|
butieId: undefined,
|
|
|
|
|
employeeId: undefined,
|
|
|
|
|
money: undefined,
|
|
|
|
|
date: undefined,
|
|
|
|
|
createBy: undefined,
|
|
|
|
|
createTime: undefined,
|
|
|
|
|
updateBy: undefined,
|
|
|
|
|
updateTime: undefined,
|
|
|
|
|
remark: undefined
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
|
handleQuery() {
|
|
|
|
|
this.queryParams.pageNum = 1;
|
|
|
|
|
@ -319,75 +246,76 @@ export default {
|
|
|
|
|
this.resetForm("queryForm");
|
|
|
|
|
this.handleQuery();
|
|
|
|
|
},
|
|
|
|
|
// 多选框选中数据
|
|
|
|
|
handleSelectionChange(selection) {
|
|
|
|
|
this.ids = selection.map(item => item.id)
|
|
|
|
|
this.single = selection.length!==1
|
|
|
|
|
this.multiple = !selection.length
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.reset();
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加补贴和员工联系";
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
this.reset();
|
|
|
|
|
const id = row.id || this.ids
|
|
|
|
|
getButieEmplyee(id).then(response => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "修改补贴和员工联系";
|
|
|
|
|
});
|
|
|
|
|
if (!row.edit) {
|
|
|
|
|
row.edit = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.buttonLoading = true;
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateButieEmplyee(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
this.buttonLoading = false;
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addButieEmplyee(this.form).then(response => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
this.buttonLoading = false;
|
|
|
|
|
/** 确定修改按钮操作*/
|
|
|
|
|
ensureRowEdit(row) {
|
|
|
|
|
updateAllbt(row).then(res => {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: '修改成功',
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
if (row.edit) {
|
|
|
|
|
row.edit = false;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
|
this.$modal.confirm('是否确认删除补贴和员工联系编号为"' + ids + '"的数据项?').then(() => {
|
|
|
|
|
this.loading = true;
|
|
|
|
|
return delButieEmplyee(ids);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
/** 取消修改按钮操作*/
|
|
|
|
|
cancelRowEdit(row) {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
},
|
|
|
|
|
openGenerateDialog() {
|
|
|
|
|
this.genMonth = null;
|
|
|
|
|
this.generateDialogVisible = true;
|
|
|
|
|
},
|
|
|
|
|
generateBuTieEmpByMonth() {
|
|
|
|
|
let param = {
|
|
|
|
|
month: this.genMonth,
|
|
|
|
|
tenantId : this.gsInfo.active_id
|
|
|
|
|
}
|
|
|
|
|
const loading = this.$loading({
|
|
|
|
|
lock: true,
|
|
|
|
|
text: 'Loading',
|
|
|
|
|
spinner: 'el-icon-loading',
|
|
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
|
|
});
|
|
|
|
|
checkDataExist(param).then(res => {
|
|
|
|
|
if (res.code === 200 && res.msg == '数据已经存在,是否覆盖?') {
|
|
|
|
|
this.$confirm('此操作将覆盖掉当月已录入数据, 是否继续?', '提示', {
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning'
|
|
|
|
|
}).then(() => {
|
|
|
|
|
generateBuTieEmpByMonth(param).then(res => {
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'success',
|
|
|
|
|
message: res.msg
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
}).finally(() => {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
this.$message({
|
|
|
|
|
type: 'info',
|
|
|
|
|
message: '已取消操作'
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('pay/butieEmplyee/export', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `butieEmplyee_${new Date().getTime()}.xlsx`)
|
|
|
|
|
});
|
|
|
|
|
this.generateDialogVisible = false
|
|
|
|
|
loading.close();
|
|
|
|
|
} else {
|
|
|
|
|
if (res.code === 200) {
|
|
|
|
|
this.$message({
|
|
|
|
|
message: res.msg,
|
|
|
|
|
type: 'success'
|
|
|
|
|
});
|
|
|
|
|
loading.close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|