|
|
|
|
@ -1,37 +1,49 @@
|
|
|
|
|
<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">
|
|
|
|
|
|
|
|
|
|
<div class="company" v-if="!$store.state.user.tenantId">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.tenantId"
|
|
|
|
|
placeholder="请输入租户id"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="补贴或者扣减项名称" prop="name">
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
<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="名称" prop="name">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.name"
|
|
|
|
|
placeholder="请输入补贴或者扣减项名称"
|
|
|
|
|
placeholder="请输入名称"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="固定" prop="fixed">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.fixed"
|
|
|
|
|
placeholder="请输入固定"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
<el-select v-model="queryParams.fixed" placeholder="请选择固定类型" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.pay_butie_fixed"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="删除标志" prop="deleted">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.deleted"
|
|
|
|
|
placeholder="请输入删除标志"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
<el-form-item label="扣补类型" prop="type">
|
|
|
|
|
<el-select v-model="queryParams.type" placeholder="请选择补贴类型" clearable>
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.pay_butie_type"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
|
|
@ -72,27 +84,23 @@
|
|
|
|
|
v-hasPermi="['pay:butie: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:butie:export']"
|
|
|
|
|
>导出</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="butieList" @selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
|
|
<el-table-column label="主键" align="center" prop="id" v-if="true"/>
|
|
|
|
|
<el-table-column label="租户id" align="center" prop="tenantId" />
|
|
|
|
|
<el-table-column label="补贴或者扣减项名称" align="center" prop="name" />
|
|
|
|
|
<el-table-column label="固定" align="center" prop="fixed" />
|
|
|
|
|
<el-table-column label="类型" align="center" prop="type" />
|
|
|
|
|
<el-table-column label="删除标志" align="center" prop="deleted" />
|
|
|
|
|
<el-table-column label="ID" align="center" prop="id" />
|
|
|
|
|
<el-table-column label="名称" align="center" prop="name" />
|
|
|
|
|
<el-table-column label="固定" align="center" prop="fixed">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.pay_butie_fixed" :value="scope.row.fixed"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="类型" align="center" prop="type">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<dict-tag :options="dict.type.pay_butie_type" :value="scope.row.type"/>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
<el-table-column label="备注" align="center" prop="remark" />
|
|
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
@ -122,20 +130,33 @@
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
</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 label="名称" prop="name">
|
|
|
|
|
<el-input v-model="form.name" placeholder="请输入名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="补贴或者扣减项名称" prop="name">
|
|
|
|
|
<el-input v-model="form.name" placeholder="请输入补贴或者扣减项名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="固定" prop="fixed">
|
|
|
|
|
<el-input v-model="form.fixed" placeholder="请输入固定" />
|
|
|
|
|
<el-form-item label="固定类型" prop="fixed">
|
|
|
|
|
<el-select v-model="form.fixed" placeholder="请选择固定类型" style="width: 100%;">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.pay_butie_fixed"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="删除标志" prop="deleted">
|
|
|
|
|
<el-input v-model="form.deleted" placeholder="请输入删除标志" />
|
|
|
|
|
<el-form-item label="扣补类型" prop="type">
|
|
|
|
|
<el-select v-model="form.type" placeholder="请选择扣补类型" style="width: 100%;">
|
|
|
|
|
<el-option
|
|
|
|
|
v-for="dict in dict.type.pay_butie_type"
|
|
|
|
|
:key="dict.value"
|
|
|
|
|
:label="dict.label"
|
|
|
|
|
:value="dict.value"
|
|
|
|
|
></el-option>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
|
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
|
|
@ -151,11 +172,19 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { listButie, getButie, delButie, addButie, updateButie } from "@/api/pay/butie";
|
|
|
|
|
import { listTenant } from "@/api/pay/tenant";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "Butie",
|
|
|
|
|
dicts: ['pay_butie_type', 'pay_butie_fixed'],
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
// 公司信息
|
|
|
|
|
gsInfo:{
|
|
|
|
|
tenantName:'',
|
|
|
|
|
active_id:this.$store.state.user.tenantId,
|
|
|
|
|
list:[]
|
|
|
|
|
},
|
|
|
|
|
// 按钮loading
|
|
|
|
|
buttonLoading: false,
|
|
|
|
|
// 遮罩层
|
|
|
|
|
@ -190,37 +219,50 @@ export default {
|
|
|
|
|
form: {},
|
|
|
|
|
// 表单校验
|
|
|
|
|
rules: {
|
|
|
|
|
id: [
|
|
|
|
|
{ required: true, message: "主键不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
tenantId: [
|
|
|
|
|
{ required: true, message: "租户id不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
name: [
|
|
|
|
|
{ required: true, message: "补贴或者扣减项名称不能为空", trigger: "blur" }
|
|
|
|
|
{ required: true, message: "名称不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
fixed: [
|
|
|
|
|
{ required: true, message: "固定不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
type: [
|
|
|
|
|
{ required: true, message: "类型不能为空", trigger: "change" }
|
|
|
|
|
],
|
|
|
|
|
deleted: [
|
|
|
|
|
{ required: true, message: "删除标志不能为空", trigger: "blur" }
|
|
|
|
|
],
|
|
|
|
|
remark: [
|
|
|
|
|
{ required: true, message: "备注不能为空", trigger: "blur" }
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
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;
|
|
|
|
|
this.queryParams.tenantId = this.gsInfo.active_id;
|
|
|
|
|
listButie(this.queryParams).then(response => {
|
|
|
|
|
this.butieList = response.rows;
|
|
|
|
|
this.total = response.total;
|
|
|
|
|
@ -287,6 +329,7 @@ export default {
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.form.tenantId = this.gsInfo.active_id;
|
|
|
|
|
this.buttonLoading = true;
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateButie(this.form).then(response => {
|
|
|
|
|
@ -323,12 +366,46 @@ export default {
|
|
|
|
|
this.loading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
this.download('pay/butie/export', {
|
|
|
|
|
...this.queryParams
|
|
|
|
|
}, `butie_${new Date().getTime()}.xlsx`)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
</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>
|
|
|
|
|
|