修复前端补贴发放标志不能修改错误 并 根据发放标志插入记录,显示在职员工,

This commit is contained in:
ryoeiken 2020-12-21 17:41:53 +08:00
parent 742ce42f5e
commit 85747dc9a1
4 changed files with 59 additions and 43 deletions

View File

@ -125,8 +125,8 @@ public class FtStaffSubsidyDaoController extends BaseController {
List<FtStaffSubsidyDao> ftStaffSubsidyDaoList = new ArrayList<>(); List<FtStaffSubsidyDao> ftStaffSubsidyDaoList = new ArrayList<>();
for (FtStaffInfoDao staffDatum : staffData) { for (FtStaffInfoDao staffDatum : staffData) {
if (staffDatum.getGiveOutFlag()){
FtStaffSubsidyDao ftStaffSubsidyDao = new FtStaffSubsidyDao(); FtStaffSubsidyDao ftStaffSubsidyDao = new FtStaffSubsidyDao();
ftStaffSubsidyDao.setStaffId(staffDatum.getStaffId()); ftStaffSubsidyDao.setStaffId(staffDatum.getStaffId());
ftStaffSubsidyDao.setSubsidyType(subsidy.getType()); ftStaffSubsidyDao.setSubsidyType(subsidy.getType());
@ -135,10 +135,10 @@ public class FtStaffSubsidyDaoController extends BaseController {
ftStaffSubsidyDao.setConsumAt(giveOutDate); ftStaffSubsidyDao.setConsumAt(giveOutDate);
ftStaffSubsidyDaoList.add(ftStaffSubsidyDao); ftStaffSubsidyDaoList.add(ftStaffSubsidyDao);
} }
}
iFtStaffSubsidyDaoService.insertBatchStaffSubsidy(ftStaffSubsidyDaoList); iFtStaffSubsidyDaoService.insertBatchStaffSubsidy(ftStaffSubsidyDaoList);
return null; return AjaxResult.success("发放成功");
} }
} }

View File

@ -1,5 +1,6 @@
package com.ruoyi.system.fantang.domain; package com.ruoyi.system.fantang.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -133,4 +134,7 @@ public class FtStaffInfoDao {
private Boolean loginFlag; private Boolean loginFlag;
private String expired; private String expired;
@TableField(exist = false)
private Boolean giveOutFlag = true;
} }

View File

@ -26,7 +26,7 @@
<select id="selectStaffInfoWithDepart" parameterType="FtStaffInfoDao" <select id="selectStaffInfoWithDepart" parameterType="FtStaffInfoDao"
resultType="FtStaffInfoDao"> resultType="FtStaffInfoDao">
SELECT a.*, b.depart_name from ft_staff_info a LEFT JOIN ft_depart b on a.depart_id = b.depart_id where staff_type = 1 SELECT a.*, b.depart_name from ft_staff_info a LEFT JOIN ft_depart b on a.depart_id = b.depart_id where staff_type = 1 and a.flag = 1
<if test="departId != null">and b.depart_id = #{departId}</if> <if test="departId != null">and b.depart_id = #{departId}</if>
</select> </select>

View File

@ -142,6 +142,9 @@
<!-- 补贴发放弹出层--> <!-- 补贴发放弹出层-->
<el-dialog title="选择发放员工" :visible.sync="showPopupSubsidyGiveOut" width="1000px" align="center"> <el-dialog title="选择发放员工" :visible.sync="showPopupSubsidyGiveOut" width="1000px" align="center">
<el-form :model="giveOutQueryParams" ref="giveOutQueryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="giveOutQueryParams" ref="giveOutQueryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-row :gutter="10">
<el-col :span="4"></el-col>
<el-col :span="8">
<el-form-item label="科室" prop="departId"> <el-form-item label="科室" prop="departId">
<el-select v-model="giveOutQueryParams.departId" placeholder="请选择科室" @change="handleGiveOutQueryChange" <el-select v-model="giveOutQueryParams.departId" placeholder="请选择科室" @change="handleGiveOutQueryChange"
clearable> clearable>
@ -153,8 +156,8 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-col>
<div class="block"> <el-col :span="8">
<span>发放日期 </span> <span>发放日期 </span>
<!-- <el-date-picker--> <!-- <el-date-picker-->
<!-- v-model="giveOutDate"--> <!-- v-model="giveOutDate"-->
@ -170,7 +173,9 @@
type="date" type="date"
placeholder="请选择发放日期"> placeholder="请选择发放日期">
</el-date-picker> </el-date-picker>
</div> </el-col>
</el-row>
</el-form>
<br> <br>
<el-table :data="staffData"> <el-table :data="staffData">
<el-table-column prop="departName" label="科室" width="150" align="center"></el-table-column> <el-table-column prop="departName" label="科室" width="150" align="center"></el-table-column>
@ -290,6 +295,8 @@ export default {
} }
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getDicts("ft_subsidy").then(response => { this.getDicts("ft_subsidy").then(response => {
@ -304,6 +311,7 @@ export default {
// //
clickSubsidyGiveOut(row) { clickSubsidyGiveOut(row) {
this.getAllStaffList();
this.showPopupSubsidyGiveOut = true; this.showPopupSubsidyGiveOut = true;
const subsidyId = row.subsidyId const subsidyId = row.subsidyId
getSubsidy(subsidyId).then(response => { getSubsidy(subsidyId).then(response => {
@ -326,16 +334,20 @@ export default {
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
},
getAllStaffList() {
staffListWithDepart().then(response => { staffListWithDepart().then(response => {
this.staffData = response.data; this.staffData = response.data;
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(this.staffData); console.log('staffData-->', this.staffData);
}) })
listDepart().then(response => { listDepart().then(response => {
this.departOptions = response.rows; this.departOptions = response.rows;
}) })
}, },
// //
typeFormat(row, column) { typeFormat(row, column) {