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

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,20 +125,20 @@ public class FtStaffSubsidyDaoController extends BaseController {
List<FtStaffSubsidyDao> ftStaffSubsidyDaoList = new ArrayList<>();
for (FtStaffInfoDao staffDatum : staffData) {
FtStaffSubsidyDao ftStaffSubsidyDao = new FtStaffSubsidyDao();
ftStaffSubsidyDao.setStaffId(staffDatum.getStaffId());
ftStaffSubsidyDao.setSubsidyType(subsidy.getType());
ftStaffSubsidyDao.setIncomeType("1");
ftStaffSubsidyDao.setPrice(subsidy.getPrice());
ftStaffSubsidyDao.setConsumAt(giveOutDate);
ftStaffSubsidyDaoList.add(ftStaffSubsidyDao);
if (staffDatum.getGiveOutFlag()){
FtStaffSubsidyDao ftStaffSubsidyDao = new FtStaffSubsidyDao();
ftStaffSubsidyDao.setStaffId(staffDatum.getStaffId());
ftStaffSubsidyDao.setSubsidyType(subsidy.getType());
ftStaffSubsidyDao.setIncomeType("1");
ftStaffSubsidyDao.setPrice(subsidy.getPrice());
ftStaffSubsidyDao.setConsumAt(giveOutDate);
ftStaffSubsidyDaoList.add(ftStaffSubsidyDao);
}
}
iFtStaffSubsidyDaoService.insertBatchStaffSubsidy(ftStaffSubsidyDaoList);
return null;
return AjaxResult.success("发放成功");
}
}

View File

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

View File

@ -26,7 +26,7 @@
<select id="selectStaffInfoWithDepart" parameterType="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>
</select>

View File

@ -142,35 +142,40 @@
<!-- 补贴发放弹出层-->
<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-item label="科室" prop="departId">
<el-select v-model="giveOutQueryParams.departId" placeholder="请选择科室" @change="handleGiveOutQueryChange"
clearable>
<el-option
v-for="item in departOptions"
:key="item.departName"
:label="item.departName"
:value="item.departId">
</el-option>
</el-select>
</el-form-item>
<el-row :gutter="10">
<el-col :span="4"></el-col>
<el-col :span="8">
<el-form-item label="科室" prop="departId">
<el-select v-model="giveOutQueryParams.departId" placeholder="请选择科室" @change="handleGiveOutQueryChange"
clearable>
<el-option
v-for="item in departOptions"
:key="item.departName"
:label="item.departName"
:value="item.departId">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<span>发放日期 </span>
<!-- <el-date-picker-->
<!-- v-model="giveOutDate"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="至"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期">-->
<!-- </el-date-picker>-->
<el-date-picker
v-model="giveOutDate"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择发放日期">
</el-date-picker>
</el-col>
</el-row>
</el-form>
<div class="block">
<span>发放日期 </span>
<!-- <el-date-picker-->
<!-- v-model="giveOutDate"-->
<!-- value-format="yyyy-MM-dd"-->
<!-- type="daterange"-->
<!-- range-separator="至"-->
<!-- start-placeholder="开始日期"-->
<!-- end-placeholder="结束日期">-->
<!-- </el-date-picker>-->
<el-date-picker
v-model="giveOutDate"
value-format="yyyy-MM-dd"
type="date"
placeholder="请选择发放日期">
</el-date-picker>
</div>
<br>
<el-table :data="staffData">
<el-table-column prop="departName" label="科室" width="150" align="center"></el-table-column>
@ -290,6 +295,8 @@ export default {
}
};
},
created() {
this.getList();
this.getDicts("ft_subsidy").then(response => {
@ -304,6 +311,7 @@ export default {
//
clickSubsidyGiveOut(row) {
this.getAllStaffList();
this.showPopupSubsidyGiveOut = true;
const subsidyId = row.subsidyId
getSubsidy(subsidyId).then(response => {
@ -326,16 +334,20 @@ export default {
this.total = response.total;
this.loading = false;
});
},
getAllStaffList() {
staffListWithDepart().then(response => {
this.staffData = response.data;
for (let i = 0; i < this.staffData.length; i++) {
this.staffData[i].giveOutFlag = true;
}
console.log(this.staffData);
// for (let i = 0; i < this.staffData.length; i++) {
// this.staffData[i].giveOutFlag = true;
// }
console.log('staffData-->', this.staffData);
})
listDepart().then(response => {
this.departOptions = response.rows;
})
},
//
typeFormat(row, column) {