更新补贴发放功能
This commit is contained in:
parent
642f65bab5
commit
adaf6abd7b
@ -58,8 +58,9 @@ public class FtStaffInfoDaoController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/staffListWithDepart")
|
@GetMapping("/staffListWithDepart")
|
||||||
public AjaxResult staffListWithDepart(FtStaffInfoDao ftStaffInfoDao) {
|
public TableDataInfo staffListWithDepart(FtStaffInfoDao ftStaffInfoDao) {
|
||||||
return AjaxResult.success(iFtStaffInfoDaoService.selectStaffInfoWithDepart(ftStaffInfoDao));
|
startPage();
|
||||||
|
return getDataTable(iFtStaffInfoDaoService.selectStaffInfoWithDepart(ftStaffInfoDao));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.ruoyi.system.fantang.controller;
|
package com.ruoyi.system.fantang.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.ruoyi.common.annotation.Log;
|
import com.ruoyi.common.annotation.Log;
|
||||||
import com.ruoyi.common.core.controller.BaseController;
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
@ -12,6 +13,8 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
|
|||||||
import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
|
import com.ruoyi.system.fantang.domain.FtStaffInfoDao;
|
||||||
import com.ruoyi.system.fantang.domain.FtStaffSubsidyDao;
|
import com.ruoyi.system.fantang.domain.FtStaffSubsidyDao;
|
||||||
import com.ruoyi.system.fantang.domain.FtSubsidyDao;
|
import com.ruoyi.system.fantang.domain.FtSubsidyDao;
|
||||||
|
import com.ruoyi.system.fantang.mapper.FtStaffInfoDaoMapper;
|
||||||
|
import com.ruoyi.system.fantang.service.IFtStaffInfoDaoService;
|
||||||
import com.ruoyi.system.fantang.service.IFtStaffSubsidyDaoService;
|
import com.ruoyi.system.fantang.service.IFtStaffSubsidyDaoService;
|
||||||
import com.ruoyi.system.fantang.vo.FtStaffSubsidyVo;
|
import com.ruoyi.system.fantang.vo.FtStaffSubsidyVo;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@ -19,10 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 补贴流水查看Controller
|
* 补贴流水查看Controller
|
||||||
@ -37,6 +37,8 @@ public class FtStaffSubsidyDaoController extends BaseController {
|
|||||||
|
|
||||||
private final IFtStaffSubsidyDaoService iFtStaffSubsidyDaoService;
|
private final IFtStaffSubsidyDaoService iFtStaffSubsidyDaoService;
|
||||||
|
|
||||||
|
private final IFtStaffInfoDaoService staffInfoDaoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询补贴流水查看列表
|
* 查询补贴流水查看列表
|
||||||
*/
|
*/
|
||||||
@ -120,8 +122,11 @@ public class FtStaffSubsidyDaoController extends BaseController {
|
|||||||
public AjaxResult submitGiveOutSubsidy(@RequestBody FtStaffSubsidyVo ftStaffSubsidyVo) {
|
public AjaxResult submitGiveOutSubsidy(@RequestBody FtStaffSubsidyVo ftStaffSubsidyVo) {
|
||||||
|
|
||||||
FtSubsidyDao subsidy = ftStaffSubsidyVo.getSubsidy();
|
FtSubsidyDao subsidy = ftStaffSubsidyVo.getSubsidy();
|
||||||
List<FtStaffInfoDao> staffData = ftStaffSubsidyVo.getStaffData();
|
List<String> noGiveoutList = ftStaffSubsidyVo.getNoGiveoutList();
|
||||||
Date giveOutDate = ftStaffSubsidyVo.getGiveOutDate();
|
Date giveOutDate = ftStaffSubsidyVo.getGiveOutDate();
|
||||||
|
QueryWrapper<FtStaffInfoDao> wrapper = new QueryWrapper<>();
|
||||||
|
wrapper.notIn("staff_id",noGiveoutList);
|
||||||
|
List<FtStaffInfoDao> staffData = staffInfoDaoService.list(wrapper);
|
||||||
|
|
||||||
List<FtStaffSubsidyDao> ftStaffSubsidyDaoList = new ArrayList<>();
|
List<FtStaffSubsidyDao> ftStaffSubsidyDaoList = new ArrayList<>();
|
||||||
|
|
||||||
|
@ -20,4 +20,6 @@ public class FtStaffSubsidyVo {
|
|||||||
|
|
||||||
private FtSubsidyDao subsidy;
|
private FtSubsidyDao subsidy;
|
||||||
|
|
||||||
|
private List<String> noGiveoutList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -130,14 +130,6 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 补贴发放弹出层-->
|
<!-- 补贴发放弹出层-->
|
||||||
<el-dialog title="选择发放员工" :visible.sync="showPopupSubsidyGiveOut" width="1000px" align="center">
|
<el-dialog title="选择发放员工" :visible.sync="showPopupSubsidyGiveOut" width="1000px" align="center">
|
||||||
@ -184,6 +176,7 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="scope.row.giveOutFlag"
|
v-model="scope.row.giveOutFlag"
|
||||||
|
@change="changeGiveoutFlag(scope.row.staffId, $event)"
|
||||||
active-color="#13ce66"
|
active-color="#13ce66"
|
||||||
inactive-color="#ff4949"
|
inactive-color="#ff4949"
|
||||||
active-text="是"
|
active-text="是"
|
||||||
@ -192,6 +185,14 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getAllStaffList"
|
||||||
|
/>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<el-button type="primary" @click="submitGiveOut">发放补贴</el-button>
|
<el-button type="primary" @click="submitGiveOut">发放补贴</el-button>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -232,15 +233,17 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {addSubsidy, delSubsidy, exportSubsidy, getSubsidy, listSubsidy, updateSubsidy} from "@/api/fantang/subsidy";
|
import {addSubsidy, delSubsidy, exportSubsidy, getSubsidy, listSubsidy, updateSubsidy} from "@/api/fantang/subsidy";
|
||||||
import {staffListWithDepart} from "@/api/fantang/staffInfo";
|
import {staffListWithDepart} from "../../../api/fantang/staffInfo";
|
||||||
import {listDepart} from "@/api/fantang/depart";
|
import {listDepart} from "@/api/fantang/depart";
|
||||||
import {submitGiveOutSubsidy} from "@/api/fantang/staffSubsidy";
|
import {submitGiveOutSubsidy} from "../../../api/fantang/staffSubsidy";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Subsidy",
|
name: "Subsidy",
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
// 不发放补贴人员清单
|
||||||
|
noGiveoutList: [],
|
||||||
giveOutDate: null,
|
giveOutDate: null,
|
||||||
departOptions: [],
|
departOptions: [],
|
||||||
staffData: [],
|
staffData: [],
|
||||||
@ -278,6 +281,8 @@ export default {
|
|||||||
// 收费弹出层查询参数
|
// 收费弹出层查询参数
|
||||||
giveOutQueryParams: {
|
giveOutQueryParams: {
|
||||||
departId: null,
|
departId: null,
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
},
|
},
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
@ -304,6 +309,20 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
changeGiveoutFlag(staffId, e) {
|
||||||
|
// console.log('row:', staffId, 'event:', e);
|
||||||
|
if (!e) {
|
||||||
|
if (this.noGiveoutList.find(item => item == staffId)) {
|
||||||
|
// console.log('find', staffId);
|
||||||
|
} else {
|
||||||
|
this.noGiveoutList.push(staffId)
|
||||||
|
// console.log('Notfind', staffId);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.noGiveoutList = this.noGiveoutList.filter(item => item != staffId);
|
||||||
|
}
|
||||||
|
console.log('this.noGiveoutList',this.noGiveoutList.toString());
|
||||||
|
},
|
||||||
|
|
||||||
filterDepart() {
|
filterDepart() {
|
||||||
return row.tag === value;
|
return row.tag === value;
|
||||||
@ -311,7 +330,7 @@ export default {
|
|||||||
|
|
||||||
// 响应发放补贴按钮
|
// 响应发放补贴按钮
|
||||||
clickSubsidyGiveOut(row) {
|
clickSubsidyGiveOut(row) {
|
||||||
this.getAllStaffList();
|
this.getAllStaffList(this.queryParams);
|
||||||
this.showPopupSubsidyGiveOut = true;
|
this.showPopupSubsidyGiveOut = true;
|
||||||
const subsidyId = row.subsidyId
|
const subsidyId = row.subsidyId
|
||||||
getSubsidy(subsidyId).then(response => {
|
getSubsidy(subsidyId).then(response => {
|
||||||
@ -337,12 +356,17 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
getAllStaffList() {
|
getAllStaffList() {
|
||||||
staffListWithDepart().then(response => {
|
staffListWithDepart(this.queryParams).then(response => {
|
||||||
this.staffData = response.data;
|
this.staffData = response.rows;
|
||||||
|
this.staffData.forEach(item=> {
|
||||||
|
if (this.noGiveoutList.find(f=> f == item.staffId) ) {
|
||||||
|
item.giveOutFlag = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.total = response.total;
|
||||||
// for (let i = 0; i < this.staffData.length; i++) {
|
// for (let i = 0; i < this.staffData.length; i++) {
|
||||||
// this.staffData[i].giveOutFlag = true;
|
// this.staffData[i].giveOutFlag = true;
|
||||||
// }
|
// }
|
||||||
console.log('staffData-->', this.staffData);
|
|
||||||
})
|
})
|
||||||
listDepart().then(response => {
|
listDepart().then(response => {
|
||||||
this.departOptions = response.rows;
|
this.departOptions = response.rows;
|
||||||
@ -379,16 +403,18 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
submitGiveOut() {
|
submitGiveOut() {
|
||||||
if (new Date() < this.giveOutDate) {
|
if (new Date() >= this.giveOutDate) {
|
||||||
|
|
||||||
let giveOutSubmitData = {
|
let giveOutSubmitData = {
|
||||||
giveOutDate: this.giveOutDate,
|
giveOutDate: this.giveOutDate,
|
||||||
staffData: this.staffData,
|
noGiveoutList: this.noGiveoutList,
|
||||||
subsidy: this.form
|
subsidy: this.form
|
||||||
}
|
}
|
||||||
|
console.log('submitGiveOutSubsidy:',giveOutSubmitData.staffData)
|
||||||
|
|
||||||
submitGiveOutSubsidy(giveOutSubmitData).then(res => {
|
submitGiveOutSubsidy(giveOutSubmitData).then(res => {
|
||||||
this.msgSuccess("发放成功")
|
this.msgSuccess("发放成功")
|
||||||
})
|
});
|
||||||
}else {
|
}else {
|
||||||
this.msgError("发放日期不可小于当前日期")
|
this.msgError("发放日期不可小于当前日期")
|
||||||
}
|
}
|
||||||
@ -396,9 +422,10 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleGiveOutQueryChange() {
|
handleGiveOutQueryChange() {
|
||||||
// console.log("change")
|
|
||||||
staffListWithDepart(this.giveOutQueryParams).then(response => {
|
staffListWithDepart(this.giveOutQueryParams).then(response => {
|
||||||
this.staffData = response.data;
|
this.staffData = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
// for (let i = 0; i < this.staffData.length; i++) {
|
// for (let i = 0; i < this.staffData.length; i++) {
|
||||||
// this.staffData[i].giveOutFlag = true;
|
// this.staffData[i].giveOutFlag = true;
|
||||||
// }
|
// }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user