女职工卫生费
This commit is contained in:
+33
-8
@@ -9,7 +9,10 @@ import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.zhgh.dayofficework.cadreTraining.model.CadreTrainingAct;
|
||||
import com.budwk.app.zhgh.dayofficework.exerciseCard.vo.ExercisePeopleImportVo;
|
||||
import com.budwk.app.zhgh.dayofficework.retiresouvenirs.model.RetireSouvenirsBatch;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryProject;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryUser;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryProjectService;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryUserService;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.vo.WomanSanitaryUserImportVo;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -38,6 +41,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -56,6 +60,8 @@ public class WomanSanitaryManageController {
|
||||
@Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private WomanSanitaryProjectService womanSanitaryProjectService;
|
||||
@Inject
|
||||
private WomanSanitaryUserService womanSanitaryUserService;
|
||||
|
||||
|
||||
@@ -78,7 +84,18 @@ public class WomanSanitaryManageController {
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
String sex) {
|
||||
Boolean issue,
|
||||
String projectId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
project.projectName
|
||||
|
||||
FROM
|
||||
woman_sanitary_user info
|
||||
LEFT JOIN `woman_sanitary_project` project ON project.id = info.projectId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(applyTime)", "=", year);
|
||||
@@ -94,12 +111,12 @@ public class WomanSanitaryManageController {
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("unionId", "=", unionId);
|
||||
cnd.andEX("unitId", "=", unitId);
|
||||
|
||||
// 性别查询条件
|
||||
cnd.andEX("sex", "=", sex);
|
||||
cnd.andEX("info.projectId", "=", projectId);
|
||||
cnd.andEX("issue", "=", issue);
|
||||
|
||||
cnd.desc("applyTime");
|
||||
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@@ -113,6 +130,14 @@ public class WomanSanitaryManageController {
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("查询事项")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Result selectList() {
|
||||
List<WomanSanitaryProject> list = womanSanitaryProjectService.query(Cnd.NEW().desc(WomanSanitaryProject::getCreatedAt));
|
||||
return Result.success(list);
|
||||
}
|
||||
|
||||
@At
|
||||
@SaCheckPermission(value = {"womanSanitary.manage", "h5.womanSanitary.manage"}, mode = SaMode.OR)
|
||||
public Result findOne(String id){
|
||||
@@ -174,10 +199,10 @@ public class WomanSanitaryManageController {
|
||||
@ApiOperation("导入人员")
|
||||
@SaCheckPermission("womanSanitary.manage")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Result importData(TempFile file, Boolean isFlag) {
|
||||
public Result importData(TempFile file,String businessId) {
|
||||
try {
|
||||
System.out.println(isFlag);
|
||||
NutMap nutMap = womanSanitaryUserService.handlingMemberImport(file, isFlag);
|
||||
|
||||
NutMap nutMap = womanSanitaryUserService.handlingMemberImport(file, businessId);
|
||||
if (Lang.isNotEmpty(nutMap)) {
|
||||
return Result.success(nutMap);
|
||||
}
|
||||
|
||||
+95
-10
@@ -1,23 +1,28 @@
|
||||
package com.budwk.app.zhgh.dayofficework.womanSanitary.controller;
|
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import cn.dev33.satoken.annotation.SaMode;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.budwk.app.base.page.Pagination;
|
||||
import com.budwk.app.base.param.PageForm;
|
||||
import com.budwk.app.base.result.Result;
|
||||
import com.budwk.app.base.utils.CommonDownloadUtil;
|
||||
import com.budwk.app.zhgh.dayofficework.cadreTraining.model.CadreTrainingAct;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryProject;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.model.WomanSanitaryUser;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryProjectService;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.service.WomanSanitaryUserService;
|
||||
import com.budwk.app.zhgh.dayofficework.womanSanitary.vo.WomanSanitaryUserExportVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
@@ -25,7 +30,9 @@ import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -59,15 +66,46 @@ public class WomanSanitaryQueryController {
|
||||
}
|
||||
|
||||
@At
|
||||
@ApiOperation("分页")
|
||||
@ApiOperation("人员分页")
|
||||
@SaCheckPermission(value = {"womanSanitary.query", "h5.womanSanitary.query"}, mode = SaMode.OR)
|
||||
public Result pageData(@Valid PageForm pageForm, Integer year) {
|
||||
public Result pageData(@Valid PageForm pageForm,
|
||||
Integer year,
|
||||
String unionId,
|
||||
String unitId,
|
||||
String searchKeyword,
|
||||
Boolean issue,
|
||||
String projectId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
project.projectName
|
||||
|
||||
FROM
|
||||
woman_sanitary_user info
|
||||
LEFT JOIN `woman_sanitary_project` project ON project.id = info.projectId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("year", "=", year);
|
||||
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
cnd.and(Cnd.likeEX("projectName", pageForm.getSearchKeyword()));
|
||||
// 年度查询条件
|
||||
cnd.andEX("year(applyTime)", "=", year);
|
||||
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), cnd);
|
||||
|
||||
// 工会、单位名称查询条件
|
||||
cnd.andEX("unionId", "=", unionId);
|
||||
cnd.andEX("unitId", "=", unitId);
|
||||
cnd.andEX("info.projectId", "=", projectId);
|
||||
cnd.andEX("issue", "=", issue);
|
||||
|
||||
cnd.desc("applyTime");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = womanSanitaryUserService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
return Result.success(pagination);
|
||||
}
|
||||
|
||||
@@ -82,4 +120,51 @@ public class WomanSanitaryQueryController {
|
||||
dao.clear(CadreTrainingAct.class, Cnd.where(CadreTrainingAct::getId, "=", id));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@SaCheckPermission(value = {"womanSanitary.query", "h5.womanSanitary.query"}, mode = SaMode.OR)
|
||||
@ApiOperation("导出女职工卫生费统计表")
|
||||
public void onExport(@Param(value = "projectId") String projectId,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "searchKeyword") String searchKeyword,
|
||||
@Param(value = "sex") String sex,
|
||||
@Param(value = "year") Integer year,
|
||||
@Param(value = "issue") Boolean issue,
|
||||
HttpServletResponse response) {
|
||||
//查询审核通过的数据
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
project.projectName
|
||||
FROM
|
||||
woman_sanitary_user info
|
||||
LEFT JOIN `woman_sanitary_project` project ON project.id = info.projectId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("year(applyTime)", "=", year);
|
||||
cnd.andEX("unionId", "=", unionId);
|
||||
cnd.andEX("unitId", "=", unitId);
|
||||
cnd.andEX("info.projectId", "=", projectId);
|
||||
cnd.andEX("issue", "=", issue);
|
||||
|
||||
cnd.desc("info.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
List<WomanSanitaryUserExportVo> list = womanSanitaryUserService.listVO(sql, WomanSanitaryUserExportVo.class);
|
||||
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, WomanSanitaryUserExportVo.class, list);
|
||||
CommonDownloadUtil.download("女职工卫生费统计表.xlsx", workbook, response);
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -31,11 +31,6 @@ public class WomanSanitaryUser extends BaseModel implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String projectId;
|
||||
|
||||
@Column
|
||||
@Comment("项目名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String projectName;
|
||||
|
||||
@Column
|
||||
@Comment("userid")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
|
||||
+1
-2
@@ -10,7 +10,6 @@ public interface WomanSanitaryUserService extends BaseService<WomanSanitaryUser>
|
||||
/**
|
||||
* 导入会员数据处理
|
||||
* @param file 文件
|
||||
* @param isFlag 是否清空更新
|
||||
*/
|
||||
NutMap handlingMemberImport(TempFile file, Boolean isFlag);
|
||||
NutMap handlingMemberImport(TempFile file, String projectId);
|
||||
}
|
||||
|
||||
+3
-2
@@ -52,7 +52,7 @@ public class WomanSanitaryUserServiceImpl extends BaseServiceImpl<WomanSanitaryU
|
||||
// 修改导入部分的代码
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@Override
|
||||
public NutMap handlingMemberImport(TempFile file, Boolean isFlag) {
|
||||
public NutMap handlingMemberImport(TempFile file,String projectId ) {
|
||||
// 修改1: 使用正确的VO类
|
||||
List<T> ts = EasyExcelUtil.syncReadModel(file.getFile(), WomanSanitaryUserImportVo.class, 0, 1);
|
||||
List<WomanSanitaryUserImportVo> list = JSONUtil.parseArray(JSONUtil.toJsonStr(ts)).toList(WomanSanitaryUserImportVo.class);
|
||||
@@ -129,6 +129,7 @@ public class WomanSanitaryUserServiceImpl extends BaseServiceImpl<WomanSanitaryU
|
||||
womanUser.setLoginName(v.getLoginName());
|
||||
womanUser.setApplyTime(new Date()); // 设置当前时间为申请时间
|
||||
womanUser.setIssue(false);
|
||||
womanUser.setProjectId(projectId);
|
||||
|
||||
if (v.getMoney() != null) {
|
||||
try {
|
||||
@@ -159,7 +160,7 @@ public class WomanSanitaryUserServiceImpl extends BaseServiceImpl<WomanSanitaryU
|
||||
nutMap.setv("successCount", Math.max(list.size() - errorInfos.size(), 0));
|
||||
nutMap.setv("errorCount", errorInfos.size());
|
||||
nutMap.setv("errorList", errorInfos.stream().map(v -> {
|
||||
return NutMap.NEW().addv("工号", v.getLoginName()).addv("姓名", v.getUsername()).addv("错误原因", v.getErrorInfo());
|
||||
return NutMap.NEW().addv("工号", v.getLoginName()).addv("姓名", v.getUserName()).addv("错误原因", v.getErrorInfo());
|
||||
}).collect(Collectors.toList()));
|
||||
return nutMap;
|
||||
}
|
||||
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package com.budwk.app.zhgh.dayofficework.womanSanitary.vo;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import com.alibaba.excel.annotation.ExcelIgnore;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
|
||||
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author hongqiwei
|
||||
* @name:WomanSanitaryUserImportVo
|
||||
* @Date 2025/11/3 13:56
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
public class WomanSanitaryUserExportVo {
|
||||
|
||||
@Excel(name = "工号", width = 20)
|
||||
private String loginName;
|
||||
|
||||
@Excel(name = "姓名", width = 20)
|
||||
private String userName;
|
||||
|
||||
@Excel(name = "性别", width = 20)
|
||||
private String sex;
|
||||
|
||||
@Excel(name = "事项", width = 20)
|
||||
private String projectName;
|
||||
|
||||
@Excel(name = "分工会", width = 20)
|
||||
private String unionName;
|
||||
|
||||
@Excel(name = "单位", width = 20)
|
||||
private String unitName;
|
||||
|
||||
@Excel(name = "电话", width = 20)
|
||||
private String mobile;
|
||||
|
||||
@Excel(name = "发放金额", width = 20)
|
||||
private Double money;
|
||||
|
||||
@Excel(name = "是否发放", width = 20)
|
||||
private String issueDisplay;
|
||||
|
||||
@Excel(name = "申请时间", width = 20, format = "yyyy-MM-dd")
|
||||
private String applyTime;
|
||||
|
||||
@ExcelIgnore
|
||||
private Boolean issue;
|
||||
|
||||
|
||||
// 添加getter方法用于自动计算显示值
|
||||
public String getIssueDisplay() {
|
||||
if (this.issue == null) {
|
||||
return "未发放";
|
||||
}
|
||||
return this.issue ? "已发放" : "未发放";
|
||||
}
|
||||
|
||||
public void setIssue(Boolean issue) {
|
||||
this.issue = issue;
|
||||
}
|
||||
|
||||
}
|
||||
+3
-3
@@ -11,8 +11,8 @@ import lombok.EqualsAndHashCode;
|
||||
/**
|
||||
* @version 1.0
|
||||
* @Author hongqiwei
|
||||
* @name:ExercisePeopleImportVo
|
||||
* @Date 2025/10/14 10:04
|
||||
* @name:WomanSanitaryUserImportVo
|
||||
* @Date 2025/11/13 14:04
|
||||
* @注释
|
||||
*/
|
||||
@Data
|
||||
@@ -26,7 +26,7 @@ public class WomanSanitaryUserImportVo {
|
||||
private String loginName;
|
||||
|
||||
@ExcelProperty("姓名")
|
||||
private String username;
|
||||
private String userName;
|
||||
|
||||
@ExcelProperty("性别")
|
||||
private String sex;
|
||||
|
||||
+9
-7
@@ -126,28 +126,30 @@ public class MutualInsuranceCollectController {
|
||||
public void onExport(@Param(value = "projectId") String projectId,
|
||||
@Param(value = "unionId") String unionId,
|
||||
@Param(value = "unitId") String unitId,
|
||||
@Param(value = "userName") String userName,
|
||||
@Param(value = "searchKeyword") String searchKeyword,
|
||||
@Param(value = "sex") String sex,
|
||||
HttpServletResponse response) {
|
||||
//查询审核通过的数据
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
info.*,
|
||||
ins.state instanceState
|
||||
info.*
|
||||
FROM
|
||||
mutual_insurance_user_info info
|
||||
LEFT JOIN `wf_process_instance` ins ON ins.businessNo = info.id
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(userName)) {
|
||||
cnd.and("info.userName", "like", "%" + userName + "%");
|
||||
// 姓名和工号查询条件
|
||||
if (StrUtil.isNotBlank(searchKeyword)) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("info.userName", "%" + searchKeyword + "%");
|
||||
seg.orLike("info.loginName", "%" + searchKeyword + "%");
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("info.projectId", "=", projectId);
|
||||
cnd.andEX("info.unionId", "=", unionId);
|
||||
cnd.andEX("info.unitId", "=", unitId);
|
||||
cnd.andEX("info.sex", "=", sex);
|
||||
cnd.and("ins.state", "=", 20);
|
||||
|
||||
|
||||
cnd.desc("info.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
|
||||
@@ -7,6 +7,7 @@ const formEdit = {
|
||||
<el-form-item label="事项名称" prop="projectName">
|
||||
<el-input v-model="formData.projectName" placeholder="请输入事项名称" maxlength="50"
|
||||
show-word-limit></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-col :span="12">
|
||||
|
||||
+3
-3
@@ -28,14 +28,14 @@
|
||||
},
|
||||
methods: {
|
||||
// 打开
|
||||
onOpen(projectId) {
|
||||
this.projectId = projectId
|
||||
onOpen(row) {
|
||||
this.row = row
|
||||
this.visible = true
|
||||
this.getInfo()
|
||||
},
|
||||
// 获取申请信息
|
||||
getInfo() {
|
||||
this.$axios.post('/platform/womanSanitary/project/findOne', {id: this.projectId}).then((res) => {
|
||||
this.$axios.post('/platform/womanSanitary/project/findOne', {id: this.row.id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.viewData = res.data
|
||||
}
|
||||
|
||||
+65
-24
@@ -9,14 +9,25 @@ layout("/layouts/platform.html"){
|
||||
<el-date-picker v-model="pageForm.year" type="year" value-format="yyyy" placeholder="请选择"
|
||||
style="width: 100%"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="事项名称">
|
||||
<el-select v-model="pageForm.projectId" @change="onProjectChange" style="width: 100%"
|
||||
placeholder="请选择事项名称" filterable clearable>
|
||||
<el-option v-for="item in projectIdOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.projectName"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="性别">
|
||||
<el-select v-model="pageForm.sex" placeholder="请选择性别" clearable style="width: 100%">
|
||||
<el-option label="男" value="男"></el-option>
|
||||
<el-option label="女" value="女"></el-option>
|
||||
|
||||
<search-item label="是否发放">
|
||||
<el-select v-model="pageForm.issue" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择是否发放" filterable clearable>
|
||||
<el-option :value="null" label="全部"></el-option>
|
||||
<el-option :value="false" label="未发放"></el-option>
|
||||
<el-option :value="true" label="已发放"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
@@ -51,6 +62,7 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="projectName" label="所属事项"></el-table-column>
|
||||
<el-table-column prop="unionName" label="所属工会"></el-table-column>
|
||||
<el-table-column prop="unitName" label="所属单位"></el-table-column>
|
||||
<el-table-column prop="mobile" label="联系方式"></el-table-column>
|
||||
@@ -61,7 +73,7 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="applyTime" label="录入时间"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<el-table-column label="操作" fixed="right" width="200px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button
|
||||
@click="setIssue(row.id)"
|
||||
@@ -80,6 +92,7 @@ layout("/layouts/platform.html"){
|
||||
temp_url="/platform/womanSanitary/manage/downloadTemplate"
|
||||
post_url="/platform/womanSanitary/manage/importData"
|
||||
@flush="successImport"
|
||||
:business_id="pageForm.projectId"
|
||||
></file-import>
|
||||
</el-dialog>
|
||||
</guava>
|
||||
@@ -98,15 +111,42 @@ layout("/layouts/platform.html"){
|
||||
unitOptions: [],
|
||||
userOptions: [],
|
||||
importDialog: false,
|
||||
checkedFields: []
|
||||
checkedFields: [],
|
||||
projectIdOptions: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
"file-import": httpVueLoader("/components/plugins/sysImport/index.vue?v=" + new Date().getTime())
|
||||
},
|
||||
methods: {
|
||||
onProjectChange(selectedId) {
|
||||
if (selectedId) {
|
||||
const selectedItem = this.projectIdOptions.find(item => item.id === selectedId);
|
||||
if (selectedItem) {
|
||||
this.$set(this.pageForm, 'projectName', selectedItem.projectName);
|
||||
}
|
||||
}
|
||||
// 触发搜索
|
||||
this.doSearch();
|
||||
},
|
||||
openImport() {
|
||||
this.importDialog = true
|
||||
// 先检查是否选择了事项
|
||||
if (!this.pageForm.projectId) {
|
||||
this.$message.warning("请先选择事项名称");
|
||||
return;
|
||||
}
|
||||
|
||||
// 弹出确认提示框
|
||||
this.$confirm('您确定将人员导入至' + this.pageForm.projectName + '中吗?', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
// 用户点击确定后打开导入对话框
|
||||
this.importDialog = true;
|
||||
}).catch(() => {
|
||||
// 用户点击取消,不执行任何操作
|
||||
});
|
||||
},
|
||||
successImport() {
|
||||
this.importDialog = false
|
||||
@@ -117,9 +157,7 @@ layout("/layouts/platform.html"){
|
||||
const row = this.tableData.find(item => item.id === id);
|
||||
if (!row) return;
|
||||
|
||||
// 切换发放状态
|
||||
const newIssueStatus = !row.issue;
|
||||
// 修复:确保actionText变量正确定义
|
||||
const actionText = newIssueStatus ? '发放' : '取消发放';
|
||||
|
||||
this.$axios.post("/platform/womanSanitary/manage/setIssue", {
|
||||
@@ -130,16 +168,11 @@ layout("/layouts/platform.html"){
|
||||
this.$message.success(`成功`);
|
||||
// 更新表格数据中的状态
|
||||
row.issue = newIssueStatus;
|
||||
} else {
|
||||
this.$message.error(res.msg || `失败`);
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error(`请求失败`);
|
||||
});
|
||||
})
|
||||
},
|
||||
isIssue() {
|
||||
// 确认发放所有列表数据
|
||||
this.$confirm("您确定要发放所有显示的数据吗?", "提示", {
|
||||
this.$confirm('您确定将' + this.pageForm.projectName + '中的人员都设置已发放吗?', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
@@ -147,13 +180,9 @@ layout("/layouts/platform.html"){
|
||||
this.$axios.post("/platform/womanSanitary/manage/batchIssue").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("发放成功");
|
||||
this.pageData(); // 重新加载数据
|
||||
} else {
|
||||
this.$message.error(res.msg || "发放失败");
|
||||
this.pageData();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message.error("发放请求失败");
|
||||
});
|
||||
})
|
||||
}).catch(() => {
|
||||
// 用户取消操作
|
||||
});
|
||||
@@ -172,9 +201,21 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
})
|
||||
},
|
||||
selectList() {
|
||||
return this.$axios.post("/platform/womanSanitary/manage/selectList").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.projectIdOptions = res.data
|
||||
if(this.projectIdOptions.length > 0) {
|
||||
this.$set(this.pageForm, 'projectId', this.projectIdOptions[0].id)
|
||||
this.$set(this.pageForm, 'projectName', this.projectIdOptions[0].projectName)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
async created() {
|
||||
await this.selectList()
|
||||
this.pageData()
|
||||
//工会查询
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
|
||||
+15
-3
@@ -3,6 +3,7 @@ layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<search @search="doSearch">
|
||||
<search-item label="年度">
|
||||
@@ -31,8 +32,9 @@ layout("/layouts/platform.html"){
|
||||
<!-- v-model="row.isOpen"></el-switch>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="操作" width="200px" fixed="right">
|
||||
<el-table-column label="操作" width="300px" fixed="right">
|
||||
<template slot-scope="{row}">
|
||||
<el-button @click="onView(row)" size="mini" type="primary">查看</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(row)">编辑</el-button>
|
||||
<el-button size="mini" type="danger" @click="onDelete(row.id)">删除</el-button>
|
||||
</template>
|
||||
@@ -40,18 +42,23 @@ layout("/layouts/platform.html"){
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<project-info ref="projectInfoRef"></project-info>
|
||||
</template>
|
||||
<form-edit ref="formEditRef" @refresh="doSearch"></form-edit>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include('../common/formEdit.js'){}#-->
|
||||
<!--#include('../common/projectInfo.js'){}#-->
|
||||
|
||||
new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
"form-edit": formEdit
|
||||
"form-edit": formEdit,
|
||||
"project-info": projectInfo
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -75,6 +82,11 @@ layout("/layouts/platform.html"){
|
||||
this.tableLoading = false
|
||||
})
|
||||
},
|
||||
onView(row) {
|
||||
this.$refs.guava.view(()=>{
|
||||
this.$refs.projectInfoRef.onOpen(row)
|
||||
})
|
||||
},
|
||||
openAdd() {
|
||||
this.$refs.formEditRef.onOpen()
|
||||
},
|
||||
|
||||
+40
-13
@@ -9,14 +9,26 @@ layout("/layouts/platform.html"){
|
||||
<el-date-picker v-model="pageForm.year" type="year" value-format="yyyy" placeholder="请选择"
|
||||
style="width: 100%"></el-date-picker>
|
||||
</search-item>
|
||||
<search-item label="事项名称">
|
||||
<el-select v-model="pageForm.projectId" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择事项名称" filterable clearable>
|
||||
<el-option v-for="item in projectIdOptions"
|
||||
:value="item.id"
|
||||
:key="item.id"
|
||||
:label="item.projectName"
|
||||
@change="doSearch"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="姓名/工号">
|
||||
<el-input placeholder="请输入姓名或工号" clearable v-model="pageForm.searchKeyword"></el-input>
|
||||
</search-item>
|
||||
<search-item label="性别">
|
||||
<el-select v-model="pageForm.sex" placeholder="请选择性别" clearable style="width: 100%">
|
||||
<el-option label="男" value="男"></el-option>
|
||||
<el-option label="女" value="女"></el-option>
|
||||
|
||||
<search-item label="是否发放">
|
||||
<el-select v-model="pageForm.issue" @change="doSearch" style="width: 100%"
|
||||
placeholder="请选择是否发放" filterable clearable>
|
||||
<el-option :value="null" label="全部"></el-option>
|
||||
<el-option :value="false" label="未发放"></el-option>
|
||||
<el-option :value="true" label="已发放"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
<search-item label="所属工会">
|
||||
@@ -43,20 +55,25 @@ layout("/layouts/platform.html"){
|
||||
</el-card>
|
||||
<el-card shadow="never">
|
||||
<table-tool>
|
||||
<el-button type="primary" size="small" @click="">导出</el-button>
|
||||
<el-button type="primary" size="small" @click="onExport" icon="el-icon-download">导出</el-button>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" style="width: 100%">
|
||||
<el-table-column type="index" width="50px" label="序号" :index="indexMethod"></el-table-column>
|
||||
<el-table-column prop="loginName" label="工号"></el-table-column>
|
||||
<el-table-column prop="userName" label="姓名"></el-table-column>
|
||||
<el-table-column prop="sex" label="性别"></el-table-column>
|
||||
<el-table-column prop="projectName" label="所属事项"></el-table-column>
|
||||
<el-table-column prop="unionName" label="所属工会"></el-table-column>
|
||||
<el-table-column prop="unitName" label="所属单位"></el-table-column>
|
||||
<el-table-column prop="mobile" label="联系方式"></el-table-column>
|
||||
<el-table-column prop="money" label="发放金额"></el-table-column>
|
||||
<el-table-column prop="issue" label="是否发放"></el-table-column>
|
||||
<el-table-column prop="issue" label="是否发放">
|
||||
<template slot-scope="{row}">
|
||||
<span :style="{color: row.issue ? '#67C23A' : ''}">{{ row.issue ? '已发放' : '未发放' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="applyTime" label="录入时间"></el-table-column>
|
||||
|
||||
<el-table-column label="操作" fixed="right" width="300px">
|
||||
<el-table-column label="操作" fixed="right" width="200px">
|
||||
<template slot-scope="{row}">
|
||||
<el-button v-if="$auth.hasRole('SYSADMIN')" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
|
||||
</template>
|
||||
@@ -84,16 +101,16 @@ layout("/layouts/platform.html"){
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// isIssue() {
|
||||
// },
|
||||
|
||||
onExport() {
|
||||
this.$downLoad('/platform/womanSanitary/query/onExport', this.pageForm)
|
||||
},
|
||||
onDelete(id) {
|
||||
this.$confirm("您确定要删除吗?", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$axios.post("/platform/exerciseCard/query/delete", {id}).then((res) => {
|
||||
this.$axios.post("/platform/womanSanitary/query/delete", {id}).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success(res.msg)
|
||||
this.pageData()
|
||||
@@ -101,9 +118,19 @@ layout("/layouts/platform.html"){
|
||||
})
|
||||
})
|
||||
},
|
||||
selectList() {
|
||||
this.$axios.post("/platform/womanSanitary/manage/selectList").then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.projectIdOptions = res.data
|
||||
if(this.projectIdOptions.length > 0) {
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
},
|
||||
created() {
|
||||
this.selectList()
|
||||
this.pageData()
|
||||
//工会查询
|
||||
this.$businessTool.listUnion().then((res) => (this.unionOptions = res))
|
||||
|
||||
Reference in New Issue
Block a user