commit
This commit is contained in:
@@ -9,6 +9,8 @@ import cn.hutool.json.JSONObject;
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.ColDefine;
|
||||
import org.nutz.dao.entity.annotation.ColType;
|
||||
import org.nutz.dao.entity.annotation.Column;
|
||||
@@ -20,6 +22,7 @@ import org.nutz.dao.entity.annotation.Table;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
@Table("audit")
|
||||
@Data
|
||||
public class Audit extends BaseModel {
|
||||
@Column
|
||||
@Name
|
||||
@@ -108,6 +111,12 @@ public class Audit extends BaseModel {
|
||||
@ColDefine(type = ColType.MYSQL_JSON)
|
||||
private JSONObject ext;
|
||||
|
||||
@Column
|
||||
@Comment("父级ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String parentId;
|
||||
|
||||
|
||||
public Date nowDate() {
|
||||
return new Date();
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public interface Roles {
|
||||
/**
|
||||
* 校工会会计
|
||||
*/
|
||||
String XGHKJ = "4f72d9259837486a8092c19897fa9dd6";
|
||||
String SCHOOL_UNION_ACCOUNTANT = "4f72d9259837486a8092c19897fa9dd6";
|
||||
|
||||
/**
|
||||
* 校工会管理员
|
||||
@@ -294,4 +294,19 @@ public interface Roles {
|
||||
* 校工会活动报销管理员
|
||||
*/
|
||||
String SchoolUnionActivityReimburseAdmin = "9426526f497542cb8351e0cac8fc9816";
|
||||
|
||||
/**
|
||||
* 宣传与文体工作办公室负责人
|
||||
*/
|
||||
String XCYWT = "ff0e310a1d954054824c0ed85f1904b7";
|
||||
|
||||
/**
|
||||
* 校工会分管主席
|
||||
*/
|
||||
String XGH02 = "7449096aef204965bf6071b30605997d";
|
||||
|
||||
/**
|
||||
* 工会委员会主席
|
||||
*/
|
||||
String WYH01 = "26fa82e6f7dd4641aa1655d9fa5c875a";
|
||||
}
|
||||
|
||||
@@ -12,4 +12,6 @@ public interface SysClubService extends BaseService<Sys_club> {
|
||||
Pagination pageData(Cnd cnd, PageForm page, Integer year, String name);
|
||||
|
||||
Boolean getInviteAgree(Sys_club club);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -145,8 +145,7 @@ public class ClubExamineRegisterServiceImpl extends ViServiceImpl implements Clu
|
||||
@Override
|
||||
public Object getXghBkMoney(String id) {
|
||||
jf_club club = dao().fetch(jf_club.class, Cnd.where("club_id", "=", id));
|
||||
Double total_quota = Double.valueOf(club.getTotal_quota());
|
||||
return total_quota;
|
||||
return club.getTotalQuota();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
package io.v.nutz.zhgh.activityBudget.conteoller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.activityBudget.service.ActivityBudgetApplyStatisticsService;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_school;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/5/26 14:25
|
||||
* @description 预算指定某个人修改
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/budget/allocationEdit")
|
||||
public class ActivityBudgetAllocationEditController {
|
||||
|
||||
@Inject
|
||||
private ActivityBudgetApplyStatisticsService applyStatisticsService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:platform/activityBudget/allocationEdit.html")
|
||||
@RequiresPermissions("activity.budget.allocationEdit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("activity.budget.allocationEdit")
|
||||
public Object pageData(PageForm pageForm, Integer year, String unionId, String clubId, String budgetTypeCode, String activityMatter) {
|
||||
Sql sql = applyStatisticsService.getsql(year, unionId, clubId, budgetTypeCode, activityMatter);
|
||||
return applyStatisticsService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("activity.budget.allocationEdit")
|
||||
public Object getApplyMoney(Integer year, String unionId, String clubId, String budgetTypeCode, String activityMatter) {
|
||||
Sql sql = applyStatisticsService.getsql(year, unionId, clubId, budgetTypeCode, activityMatter);
|
||||
List<NutMap> list = applyStatisticsService.listMap(sql);
|
||||
list = list.stream().filter(v -> !v.getBoolean("isSchoolBudget")).toList();
|
||||
double declareTotalBudgetMoney = list.stream().mapToDouble(map -> map.getDouble("declareTotalBudgetMoney")).sum();
|
||||
double totalBudgetMoney = list.stream().mapToDouble(map -> map.getDouble("totalBudgetMoney")).sum();
|
||||
return Map.of("declareTotalBudgetMoney", declareTotalBudgetMoney, "totalBudgetMoney", totalBudgetMoney);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("activity.budget.allocationEdit")
|
||||
public Object doSubmit(String id, String totalBudgetMoney, Sys_file[] files, Audit audit) {
|
||||
ActivityBudget budget = applyStatisticsService.dao().fetch(ActivityBudget.class, id);
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.set("money", budget.getTotalBudgetMoney());
|
||||
jsonObject.set("files", files);
|
||||
audit.setExt(jsonObject);
|
||||
audit.setParentId(id);
|
||||
applyStatisticsService.insert(audit);
|
||||
|
||||
applyStatisticsService.dao().update(ActivityBudget.class, Chain.make("totalBudgetMoney", totalBudgetMoney), Cnd.where("id", "=", id));
|
||||
|
||||
BigDecimal newTotalBudgetMoney = new BigDecimal(totalBudgetMoney);
|
||||
|
||||
if (budget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_ONE")) {
|
||||
jf_school school = applyStatisticsService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isNotEmpty(school)) {
|
||||
if (StrUtil.isNotBlank(budget.getId())) {
|
||||
school.setTotalQuota(school.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
|
||||
school.setTotalQuota(school.getTotalQuota().add(newTotalBudgetMoney));
|
||||
applyStatisticsService.updateIgnoreNull(school);
|
||||
}
|
||||
} else if (budget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
// 更新分工会活动经费表
|
||||
jf_yjgh jfYjgh = applyStatisticsService.dao().fetch(jf_yjgh.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("unionId", "=", budget.getUnionId()));
|
||||
if (ObjectUtil.isNotEmpty(jfYjgh)) {
|
||||
if (StrUtil.isNotBlank(budget.getId())) {
|
||||
jfYjgh.setTotalQuota(jfYjgh.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
jfYjgh.setTotalQuota(jfYjgh.getTotalQuota().add(newTotalBudgetMoney));
|
||||
applyStatisticsService.updateIgnoreNull(jfYjgh);
|
||||
}
|
||||
} else if (budget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
//如果不等于校工会预算才往表里面加预算
|
||||
if (!budget.getIsSchoolBudget()) {
|
||||
// 更新社团经费表
|
||||
jf_club jfClub = applyStatisticsService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("club_id", "=", budget.getClubId()));
|
||||
if (ObjectUtil.isNotEmpty(jfClub)) {
|
||||
if (StrUtil.isNotBlank(budget.getId())) {
|
||||
jfClub.setTotalQuota(jfClub.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
jfClub.setTotalQuota(jfClub.getTotalQuota().add(newTotalBudgetMoney));
|
||||
applyStatisticsService.updateIgnoreNull(jfClub);
|
||||
}
|
||||
}
|
||||
} else if (budget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_FOUR")) {
|
||||
// 更新其他经费表
|
||||
/* JfOther jfOther = applyStatisticsService.dao().fetch(JfOther.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isNotEmpty(jfOther)) {
|
||||
if (StrUtil.isNotBlank(budget.getId())) {
|
||||
jfOther.setTotalQuota(jfOther.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
jfOther.setTotalQuota(jfOther.getTotalQuota().add(newTotalBudgetMoney));
|
||||
applyStatisticsService.updateIgnoreNull(jfOther);
|
||||
}*/
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
package io.v.nutz.zhgh.activityBudget.conteoller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activityBudget.handler.ActivityBudgetUserApplyToDoHandler;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudgetDetails;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.Static;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetApplyController
|
||||
* @Description 预算申报
|
||||
* @Author zhf
|
||||
* @Date 2024/12/3 11:05
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/budget/apply")
|
||||
public class ActivityBudgetApplyController {
|
||||
@Inject("ActivityBudget")
|
||||
private ViService<ActivityBudget> baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:platform/activityBudget/apply.html")
|
||||
@RequiresPermissions("activity.budget.apply")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("activity.budget.apply")
|
||||
public Result doSubmit(@Param("activityBudget") ActivityBudget activityBudget, Boolean flag) {
|
||||
Dao dao = baseService.dao();
|
||||
if (flag) {
|
||||
activityBudget.setAuditState(1);
|
||||
}
|
||||
if (StrUtil.isEmpty(activityBudget.getId())) {
|
||||
activityBudget.setUserId(ShiroUtil.getUserId());
|
||||
activityBudget.setLoginName(ShiroUtil.getPlatformLoginname());
|
||||
activityBudget.setUserName(ShiroUtil.getPlatformUsername());
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_TWO").contains(activityBudget.getBudgetTypeCode())) {
|
||||
int activityMatterCount = dao.count(ActivityBudget.class,
|
||||
Cnd.where("activityMatter", "=", activityBudget.getActivityMatter()).and("unionId", "=", Vi.getUnionId()));
|
||||
if (flag && activityMatterCount > 0) {
|
||||
return Result.error(activityBudget.getActivityMatter() + "已填写申请!");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StrUtil.isNotBlank(activityBudget.getId()) && Lang.isNotEmpty(activityBudget.getBudgetDetails())) {
|
||||
dao.clear(ActivityBudgetDetails.class, Cnd.where("budgetId", "=", activityBudget.getId()));
|
||||
}
|
||||
|
||||
/* if (List.of( "superadmin").contains(ShiroUtil.getPlatformLoginname())) {
|
||||
if (flag) {
|
||||
activityBudget.setAuditState(4);
|
||||
activityBudget.setTotalBudgetMoney(activityBudget.getDeclareTotalBudgetMoney());
|
||||
ActivityBudget budget = null;
|
||||
if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
budget = dao.fetch(ActivityBudget.class, activityBudget.getId());
|
||||
}
|
||||
if (activityBudget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_ONE")) {
|
||||
jf_school school = dao.fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isNotEmpty(school)) {
|
||||
if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
school.setTotalQuota(school.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
school.setTotalQuota(school.getTotalQuota().add(activityBudget.getTotalBudgetMoney()));
|
||||
dao.updateIgnoreNull(school);
|
||||
}
|
||||
} else if (activityBudget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
// 更新分工会活动经费表
|
||||
jf_yjgh jfYjgh = dao.fetch(jf_yjgh.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("unionId", "=", activityBudget.getUnionId()));
|
||||
if (ObjectUtil.isNotEmpty(jfYjgh)) {
|
||||
if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
jfYjgh.setTotalQuota(jfYjgh.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
jfYjgh.setTotalQuota(jfYjgh.getTotalQuota().add(activityBudget.getTotalBudgetMoney()));
|
||||
dao.updateIgnoreNull(jfYjgh);
|
||||
}
|
||||
} else if (activityBudget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
//如果不等于校工会预算才往表里面加预算
|
||||
if (!activityBudget.getIsSchoolBudget()){
|
||||
// 更新社团经费表
|
||||
jf_club jfClub = dao.fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("club_id", "=", activityBudget.getClubId()));
|
||||
if (ObjectUtil.isNotEmpty(jfClub)) {
|
||||
if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
jfClub.setTotalQuota(jfClub.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
jfClub.setTotalQuota(jfClub.getTotalQuota().add(activityBudget.getTotalBudgetMoney()));
|
||||
dao.updateIgnoreNull(jfClub);
|
||||
}
|
||||
}
|
||||
} else if (activityBudget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_FOUR")) {
|
||||
// 更新其他经费表
|
||||
*//* JfOther jfOther = dao.fetch(JfOther.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isNotEmpty(jfOther)) {
|
||||
if (StrUtil.isNotBlank(activityBudget.getId())) {
|
||||
jfOther.setTotalQuota(jfOther.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
}
|
||||
jfOther.setTotalQuota(jfOther.getTotalQuota().add(activityBudget.getTotalBudgetMoney()));
|
||||
dao.updateIgnoreNull(jfOther);
|
||||
}*//*
|
||||
}
|
||||
}
|
||||
}*/
|
||||
dao.insertOrUpdate(activityBudget);
|
||||
for (ActivityBudgetDetails details : activityBudget.getBudgetDetails()) {
|
||||
details.setBudgetId(activityBudget.getId());
|
||||
}
|
||||
dao.insert(activityBudget.getBudgetDetails());
|
||||
|
||||
if (flag) {
|
||||
//插入后,发起待办流程
|
||||
ActivityBudgetUserApplyToDoHandler.START_PROCESS.exec(activityBudget,null);
|
||||
//发任务给校工会审核
|
||||
ActivityBudgetUserApplyToDoHandler.CREATE_SCHOOL_TASK.exec(activityBudget,null);
|
||||
//完成申请人的任务(申请拒绝的情况)
|
||||
ActivityBudgetUserApplyToDoHandler.COMPLETE_APPLY_TASK.exec(activityBudget,null);
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getClubsByUser() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id ,
|
||||
name as clubName
|
||||
FROM
|
||||
sys_club
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!List.of("9810051","superadmin").contains(ShiroUtil.getPlatformLoginname())){
|
||||
cnd.and(new Static(" id in (select clubid from sys_club_user where userid = '%s')"
|
||||
.formatted(ShiroUtil.getPrincipalProperty("id"))));
|
||||
}
|
||||
cnd.and("state", "=", 930);
|
||||
sql.setCondition(cnd);
|
||||
List list = baseService.listMap(sql);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getSchoolBudget() {
|
||||
return baseService.query(Cnd.where("budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_ONE").and("auditState", "=", 4));
|
||||
}
|
||||
}
|
||||
+459
@@ -0,0 +1,459 @@
|
||||
package io.v.nutz.zhgh.activityBudget.conteoller;
|
||||
|
||||
import cn.afterturn.easypoi.entity.BaseTypeConstants;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.models.Sys_dict;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.sys.services.SysDictService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudgetDetails;
|
||||
import io.v.nutz.zhgh.activityBudget.service.ActivityBudgetApplyStatisticsService;
|
||||
import io.v.nutz.zhgh.activityBudget.service.ActivityBudgetService;
|
||||
import io.v.nutz.zhgh.activityBudget.template.ActivityBudgetTemp;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
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;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.AdaptBy;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.mvc.upload.TempFile;
|
||||
import org.nutz.mvc.upload.UploadAdaptor;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetApplyListController
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/12/3 11:06
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/budget/applyList")
|
||||
public class ActivityBudgetApplyListController {
|
||||
|
||||
|
||||
@Inject
|
||||
private ActivityBudgetService activityBudgetService;
|
||||
@Inject
|
||||
private ActivityBudgetApplyStatisticsService activityBudgetApplyStatisticsService;
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:platform/activityBudget/applyList.html")
|
||||
@RequiresPermissions("activity.budget.applyList")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("activity.budget.applyList")
|
||||
public Object pageData(PageForm pageForm, Integer year, String activityMatter) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
YEAR(ab.applyDate) year,
|
||||
ab.*
|
||||
FROM
|
||||
activity_budget ab
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
// cnd.andEX("userId", "=", ShiroUtil.getUserId());
|
||||
if (StrUtil.isNotBlank(activityMatter)) {
|
||||
cnd.andEX("ab.activityMatter", "like", "%" + activityMatter + "%");
|
||||
}
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
if (ShiroUtil.hasAnyRoles("gh14,gh01")) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
group1.or("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_TWO");
|
||||
group1.and("ab.unionId", "=", Vi.getUnionId());
|
||||
group.or(group1);
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("club01,club05")) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
SqlExpressionGroup group2 = new SqlExpressionGroup();
|
||||
group2.or("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_THREE");
|
||||
group2.or("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_FOUR");
|
||||
List<String> clubIds = this.getClubsByRole().stream().map(v -> v.getString("id")).toList();
|
||||
group1.and("ab.clubId", "in", clubIds);
|
||||
group1.and(group2);
|
||||
group.or(group1);
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin,A06,xghjf" )) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
group1.and("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_ONE");
|
||||
group1.or("ab.loginName", "=", ShiroUtil.getPlatformLoginname());
|
||||
group.or(group1);
|
||||
}
|
||||
cnd.and(group);
|
||||
cnd.andEX("YEAR(ab.applyDate)", "=", year);
|
||||
cnd.asc("auditState").desc("applyDate");
|
||||
sql.setCondition(cnd);
|
||||
return activityBudgetService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("activity.budget.applyList")
|
||||
public Object doDelete(String id) {
|
||||
activityBudgetService.dao().delete(ActivityBudget.class, id);
|
||||
activityBudgetService.dao().clear(ActivityBudgetDetails.class, Cnd.where("budgetId", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("activity.budget.applyList")
|
||||
public Object findOne(String id) {
|
||||
return activityBudgetService.findOne(id);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("activity.budget.applyList")
|
||||
public Object batchSubmit(@Valid @Param("ids[]") String[] ids) {
|
||||
List<ActivityBudget> budgetList = activityBudgetService.query(Cnd.where("id", "in", ids));
|
||||
List<ActivityBudget> budgets = budgetList.stream().filter(a ->
|
||||
ObjectUtil.isEmpty(a.getDeclareTotalBudgetMoney())
|
||||
|| ObjectUtil.isEmpty(a.getHelpUnitName())
|
||||
|| ObjectUtil.isEmpty(a.getBudgetTypeCode())).toList();
|
||||
List<String> names = budgets.stream().map(ActivityBudget::getActivityMatter).toList();
|
||||
if (ObjectUtil.isNotEmpty(names)) {
|
||||
return Result.error("请完善活动预算信息【:" + StrUtil.join(",", names) + "】");
|
||||
}
|
||||
budgetList.forEach(b -> {
|
||||
b.setTotalBudgetMoney(b.getDeclareTotalBudgetMoney());
|
||||
b.setAuditState(1);
|
||||
});
|
||||
activityBudgetService.update(budgetList);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("activity.budget.applyList")
|
||||
public Object batchDelete(@Valid @Param("ids[]") String[] ids) {
|
||||
if (ObjectUtil.isNotEmpty(ids)) {
|
||||
activityBudgetService.clear(Cnd.where("id", "in", ids));
|
||||
activityBudgetService.dao().clear(ActivityBudgetDetails.class, Cnd.where("budgetId", "in", ids));
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
public void downloadImport(HttpServletResponse response) {
|
||||
try {
|
||||
response.setHeader("Content-Disposition", "attachment;filename="
|
||||
.concat(String.valueOf(URLEncoder.encode("预算申报模版.xlsx", "UTF-8"))));
|
||||
InputStream fin = Thread.currentThread().getContextClassLoader().getResourceAsStream("templates/budget/budgetImport.xlsx");
|
||||
IOUtils.copy(fin, response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("activity.budget.applyList")
|
||||
public void doExport(@Valid Integer year, String activityMatter, HttpServletResponse response) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
YEAR(ab.applyDate) year,
|
||||
ab.*
|
||||
FROM
|
||||
activity_budget ab
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(activityMatter)) {
|
||||
cnd.andEX("ab.activityMatter", "like", "%" + activityMatter + "%");
|
||||
}
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
if (ShiroUtil.hasAnyRoles("gh14,gh01")) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
group1.or("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_TWO");
|
||||
group1.and("ab.unionId", "=", Vi.getUnionId());
|
||||
group.or(group1);
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("club01,club05")) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
SqlExpressionGroup group2 = new SqlExpressionGroup();
|
||||
group2.or("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_THREE");
|
||||
group2.or("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_FOUR");
|
||||
List<String> clubIds = this.getClubsByRole().stream().map(v -> v.getString("id")).toList();
|
||||
group1.and("ab.clubId", "in", clubIds);
|
||||
group1.and(group2);
|
||||
group.or(group1);
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin,A06,xghjf")) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
group1.and("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_ONE");
|
||||
group1.or("ab.loginName", "=", ShiroUtil.getPlatformLoginname());
|
||||
group.or(group1);
|
||||
}
|
||||
cnd.and(group);
|
||||
cnd.andEX("YEAR(ab.applyDate)", "=", year);
|
||||
cnd.asc("auditState").desc("applyDate");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> mapList = activityBudgetService.listMap(sql);
|
||||
List<Sys_dict> dictList = sysDictService.getSubListByCode("ACTIVITY_BUDGET_TYPE");
|
||||
mapList.forEach(map -> {
|
||||
Sys_dict dict = dictList.stream().filter(d -> d.getCode().equals(map.getString("budgetTypeCode"))).findFirst().orElse(null);
|
||||
map.put("budgetTypeCode", dict.getName());
|
||||
});
|
||||
ArrayList<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("年度", "year", 20));
|
||||
entities.add(new ExcelExportEntity("申报人姓名", "userName", 20));
|
||||
entities.add(new ExcelExportEntity("申报人工号", "loginName", 20));
|
||||
entities.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
entities.add(new ExcelExportEntity("申报类型", "budgetTypeCode", 20));
|
||||
entities.add(new ExcelExportEntity("申报单位", "helpUnitName", 20));
|
||||
entities.add(new ExcelExportEntity("事项", "activityMatter", 20));
|
||||
ExcelExportEntity draftCodeEntity = new ExcelExportEntity("申报预算金额", "declareTotalBudgetMoney", 20);
|
||||
draftCodeEntity.setType(BaseTypeConstants.DOUBLE_TYPE);
|
||||
entities.add(draftCodeEntity);
|
||||
ExcelExportEntity draftCodeEntity2 = new ExcelExportEntity("审核预算金额", "totalBudgetMoney", 20);
|
||||
draftCodeEntity2.setType(BaseTypeConstants.DOUBLE_TYPE);
|
||||
entities.add(draftCodeEntity2);
|
||||
entities.add(new ExcelExportEntity("申报时间", "applyDate", 20));
|
||||
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "预算申报汇总表.xlsx");
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, mapList);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object doImport(TempFile file) {
|
||||
|
||||
try {
|
||||
List<ActivityBudgetTemp> activityBudgetTempList = ExcelImportUtil.importExcel(file.getFile(), ActivityBudgetTemp.class, new ImportParams());
|
||||
List<ActivityBudgetTemp> activityBudgetTempList2 = activityBudgetTempList.stream().filter(temp ->
|
||||
StrUtil.isAllNotEmpty(temp.getDeclareTotalBudgetMoney(), temp.getBudgetTypeCode())).toList();
|
||||
List<ActivityBudget> budgetList = activityBudgetService.query(Cnd.where("YEAR(applyDate)", "=", DateUtil.thisYear())
|
||||
.andEX("userId", "=", ShiroUtil.getUserId()));
|
||||
List<Sys_dict> budgetTypeList = sysDictService.getSubListByCode("ACTIVITY_BUDGET_TYPE");
|
||||
List<Sys_club> clubList = sysDictService.dao().query(Sys_club.class, Cnd.NEW());
|
||||
List<ActivityBudgetTemp> errorInfos = new ArrayList<>();
|
||||
List<ActivityBudget> successList = new ArrayList<>();
|
||||
for (ActivityBudgetTemp temp : activityBudgetTempList2) {
|
||||
if (StrUtil.isAllNotEmpty(temp.getDeclareTotalBudgetMoney(), temp.getBudgetTypeCode())) {
|
||||
if (ObjectUtil.isEmpty(temp.getActivityMatter())) {
|
||||
temp.setErrorInfo("活动项目不能为空!");
|
||||
errorInfos.add(temp);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ObjectUtil.isEmpty(temp.getBudgetTypeCode())) {
|
||||
temp.setErrorInfo("预算类型不能为空!");
|
||||
errorInfos.add(temp);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (List.of("协会活动").contains(temp.getBudgetTypeCode()) && ObjectUtil.isEmpty(temp.getHelpUnitName())) {
|
||||
temp.setErrorInfo("协会活动申报单位不能为空!");
|
||||
errorInfos.add(temp);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (List.of("协会活动").contains(temp.getBudgetTypeCode())) {
|
||||
|
||||
Sys_club sysClub = clubList.stream().filter(sys_club -> List.of("南京大学" + temp.getHelpUnitName(), temp.getHelpUnitName()).contains(sys_club.getName())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(sysClub)) {
|
||||
temp.setErrorInfo("当前申报单位在系统中不存在,请核对!");
|
||||
errorInfos.add(temp);
|
||||
continue;
|
||||
}
|
||||
// 判断当前用户是否有申请社团活动预算的权限
|
||||
//自己管理的协会
|
||||
List<NutMap> clubsByRoleList = this.getClubsByRole();
|
||||
NutMap clubRole = clubsByRoleList.stream().filter(c -> c.getString("id").equals(sysClub.getId())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(clubRole)) {
|
||||
temp.setErrorInfo("您没有申请社团活动预算的权限,请联系社团负责人!");
|
||||
errorInfos.add(temp);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Sys_dict dict = budgetTypeList.stream().filter(sys_dict -> sys_dict.getName().equals(temp.getBudgetTypeCode())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isEmpty(dict)) {
|
||||
temp.setErrorInfo("预算类型错误,请在下拉框选择!");
|
||||
errorInfos.add(temp);
|
||||
continue;
|
||||
}
|
||||
|
||||
ActivityBudget budget = budgetList.stream().filter(activityBudget -> activityBudget.getActivityMatter().equals(temp.getActivityMatter())).findFirst().orElse(null);
|
||||
if (ObjectUtil.isNotEmpty(budget)) {
|
||||
temp.setErrorInfo("活动项目在本年度中重复请核对!可以在系统【我的申报】界面,直接编辑提交。");
|
||||
errorInfos.add(temp);
|
||||
continue;
|
||||
}
|
||||
ActivityBudget activityBudget = new ActivityBudget();
|
||||
activityBudget.setUserId(ShiroUtil.getUserId());
|
||||
activityBudget.setUserName(ShiroUtil.getPlatformUsername());
|
||||
activityBudget.setLoginName(ShiroUtil.getPlatformLoginname());
|
||||
activityBudget.setActivityDate(temp.getActivityDate());
|
||||
activityBudget.setActivityMatter(temp.getActivityMatter());
|
||||
activityBudget.setActivityContent(temp.getActivityContent());
|
||||
activityBudget.setMobile(temp.getMobile());
|
||||
activityBudget.setBudgetTypeCode(dict.getCode());
|
||||
activityBudget.setDeclareTotalBudgetMoney(new BigDecimal(temp.getDeclareTotalBudgetMoney()));
|
||||
activityBudget.setApplyDate(DateUtil.today());
|
||||
activityBudget.setAuditState(0);
|
||||
if (List.of("协会活动").contains(temp.getBudgetTypeCode())) {
|
||||
Sys_club sysClub = clubList.stream().filter(sys_club -> sys_club.getName().equals(temp.getHelpUnitName())).findFirst().orElse(null);
|
||||
activityBudget.setHelpUnitName(sysClub.getName());
|
||||
activityBudget.setClubId(sysClub.getId());
|
||||
} else if (List.of("校工会活动", "其他项目").contains(temp.getBudgetTypeCode())) {
|
||||
activityBudget.setHelpUnitName("校工会");
|
||||
} else {
|
||||
activityBudget.setUnionId(Vi.getUnionId());
|
||||
activityBudget.setHelpUnitName(Vi.getUnion().getUnionname());
|
||||
}
|
||||
successList.add(activityBudget);
|
||||
}
|
||||
}
|
||||
activityBudgetService.insert(successList);
|
||||
//如果有错误数据就返回给前端
|
||||
if (Lang.isNotEmpty(errorInfos)) {
|
||||
NutMap nutMap = NutMap.NEW();
|
||||
nutMap.setv("totalCount", activityBudgetTempList2.size());
|
||||
nutMap.setv("successCount", Math.max(successList.size() - errorInfos.size(), 0));
|
||||
nutMap.setv("errorCount", errorInfos.size());
|
||||
nutMap.setv("errorList", errorInfos.stream().map(v -> NutMap.NEW().addv("活动项目", v.getActivityMatter()).addv("错误原因", v.getErrorInfo())).collect(Collectors.toList()));
|
||||
return io.v.nutz.base.result.Result.success(nutMap);
|
||||
}
|
||||
return Result.success().addMsg("导入成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<NutMap> getClubsByRole() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.id
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN `sys_user_role` role ON club.id = role.stid
|
||||
$condition
|
||||
""");
|
||||
cnd.and("role.roleId", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04));
|
||||
cnd.and("role.userId", "=", ShiroUtil.getUserId());
|
||||
cnd.and("club.isjs", "=", false);
|
||||
cnd.and("club.state", "=", 930);
|
||||
cnd.groupBy("club.id");
|
||||
cnd.asc("club.`code`");
|
||||
sql.setCondition(cnd);
|
||||
return activityBudgetService.listMap(sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("activity.budget.applyList")
|
||||
public Object getApplyMoney(Integer year, String activityMatter) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ab.declareTotalBudgetMoney,
|
||||
ab.totalBudgetMoney
|
||||
FROM
|
||||
activity_budget ab
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(activityMatter)) {
|
||||
cnd.andEX("ab.activityMatter", "like", "%" + activityMatter + "%");
|
||||
}
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
if (ShiroUtil.hasAnyRoles("gh14,gh01")) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
group1.or("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_TWO");
|
||||
group1.and("ab.unionId", "=", Vi.getUnionId());
|
||||
group.or(group1);
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("club01,club05")) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
SqlExpressionGroup group2 = new SqlExpressionGroup();
|
||||
group2.or("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_THREE");
|
||||
group2.or("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_FOUR");
|
||||
List<String> clubIds = this.getClubsByRole().stream().map(v -> v.getString("id")).toList();
|
||||
group1.and("ab.clubId", "in", clubIds);
|
||||
group1.and(group2);
|
||||
group.or(group1);
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin,A06,xghjf")) {
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
group1.and("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_ONE");
|
||||
group1.or("ab.loginName", "=", ShiroUtil.getPlatformLoginname());
|
||||
group.or(group1);
|
||||
}
|
||||
cnd.and(group);
|
||||
cnd.andEX("ab.isSchoolBudget", "=", 0);
|
||||
cnd.andEX("YEAR(ab.applyDate)", "=", year);
|
||||
cnd.andEX("ab.auditState", "=", 4);
|
||||
cnd.asc("auditState").desc("applyDate");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = activityBudgetService.listMap(sql);
|
||||
double declareTotalBudgetMoney = list.stream().mapToDouble(map -> map.getDouble("declareTotalBudgetMoney")).sum();
|
||||
double totalBudgetMoney = list.stream().mapToDouble(map -> map.getDouble("totalBudgetMoney")).sum();
|
||||
return Map.of("declareTotalBudgetMoney", declareTotalBudgetMoney, "totalBudgetMoney", totalBudgetMoney);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+162
@@ -0,0 +1,162 @@
|
||||
package io.v.nutz.zhgh.activityBudget.conteoller;
|
||||
|
||||
import cn.afterturn.easypoi.entity.BaseTypeConstants;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.sys.models.Sys_dict;
|
||||
import io.v.nutz.sys.services.SysDictService;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudgetDetails;
|
||||
import io.v.nutz.zhgh.activityBudget.service.ActivityBudgetApplyStatisticsService;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_school;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetApplyStatisticsController
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2025/3/5 下午8:10
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/budget/applyStatistics")
|
||||
public class ActivityBudgetApplyStatisticsController {
|
||||
|
||||
@Inject
|
||||
private ActivityBudgetApplyStatisticsService activityBudgetService;
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:platform/activityBudget/applyStatistics.html")
|
||||
@RequiresPermissions("activity.budget.applyStatistics")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("activity.budget.applyStatistics")
|
||||
public Object pageData(PageForm pageForm, Integer year, String unionId, String clubId, String budgetTypeCode, String activityMatter) {
|
||||
Sql sql = activityBudgetService.getsql(year, unionId, clubId, budgetTypeCode, activityMatter);
|
||||
return activityBudgetService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("activity.budget.applyStatistics")
|
||||
public void doExport(@Valid Integer year, String clubId, String unionId, @Valid String budgetTypeCode, HttpServletResponse response) {
|
||||
Sql sql = activityBudgetService.getsql(year, unionId, clubId, budgetTypeCode, null);
|
||||
List<NutMap> mapList = activityBudgetService.listMap(sql);
|
||||
List<Sys_dict> dictList = sysDictService.getSubListByCode("ACTIVITY_BUDGET_TYPE");
|
||||
mapList.forEach(map -> {
|
||||
Sys_dict dict = dictList.stream().filter(d -> d.getCode().equals(map.getString("budgetTypeCode"))).findFirst().orElse(null);
|
||||
map.put("budgetTypeCode", dict.getName());
|
||||
});
|
||||
ArrayList<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("年度", "year", 20));
|
||||
entities.add(new ExcelExportEntity("申报人姓名", "userName", 20));
|
||||
entities.add(new ExcelExportEntity("申报人工号", "loginName", 20));
|
||||
entities.add(new ExcelExportEntity("联系方式", "mobile", 20));
|
||||
entities.add(new ExcelExportEntity("申报类型", "budgetTypeCode", 20));
|
||||
entities.add(new ExcelExportEntity("申报单位", "helpUnitName", 20));
|
||||
entities.add(new ExcelExportEntity("事项", "activityMatter", 20));
|
||||
ExcelExportEntity draftCodeEntity = new ExcelExportEntity("申报预算金额", "declareTotalBudgetMoney", 20);
|
||||
draftCodeEntity.setType(BaseTypeConstants.DOUBLE_TYPE);
|
||||
entities.add(draftCodeEntity);
|
||||
ExcelExportEntity draftCodeEntity2 = new ExcelExportEntity("审核预算金额", "totalBudgetMoney", 20);
|
||||
draftCodeEntity2.setType(BaseTypeConstants.DOUBLE_TYPE);
|
||||
entities.add(draftCodeEntity2);
|
||||
entities.add(new ExcelExportEntity("申报时间", "applyDate", 20));
|
||||
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "预算申报汇总表.xlsx");
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, mapList);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("activity.budget.applyStatistics")
|
||||
public Object getApplyMoney(Integer year, String unionId, String clubId, String budgetTypeCode, String activityMatter) {
|
||||
Sql sql = activityBudgetService.getsql(year, unionId, clubId, budgetTypeCode, activityMatter);
|
||||
List<NutMap> list = activityBudgetService.listMap(sql);
|
||||
list = list.stream().filter(v -> !v.getBoolean("isSchoolBudget")).toList();
|
||||
double declareTotalBudgetMoney = list.stream().mapToDouble(map -> map.getDouble("declareTotalBudgetMoney")).sum();
|
||||
double totalBudgetMoney = list.stream().mapToDouble(map -> map.getDouble("totalBudgetMoney")).sum();
|
||||
return Map.of("declareTotalBudgetMoney", declareTotalBudgetMoney, "totalBudgetMoney", totalBudgetMoney);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("activity.budget.applyStatistics")
|
||||
public Object doDelete(String id) {
|
||||
ActivityBudget budget = sysDictService.dao().fetch(ActivityBudget.class, id);
|
||||
if (budget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_ONE")) {
|
||||
jf_school school = activityBudgetService.dao().fetch(jf_school.class, Cnd.where("year", "=", io.v.nutz.base.utils.DateUtil.getYear()));
|
||||
if (ObjectUtil.isNotEmpty(school)) {
|
||||
school.setTotalQuota(school.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
activityBudgetService.updateIgnoreNull(school);
|
||||
}
|
||||
} else if (budget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
// 更新分工会活动经费表
|
||||
jf_yjgh jfYjgh = activityBudgetService.dao().fetch(jf_yjgh.class, Cnd.where("year", "=", io.v.nutz.base.utils.DateUtil.getYear())
|
||||
.and("unionId", "=", budget.getUnionId()));
|
||||
if (ObjectUtil.isNotEmpty(jfYjgh)) {
|
||||
jfYjgh.setTotalQuota(jfYjgh.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
activityBudgetService.updateIgnoreNull(jfYjgh);
|
||||
}
|
||||
} else if (budget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
// 更新社团经费表
|
||||
jf_club jfClub = activityBudgetService.dao().fetch(jf_club.class, Cnd.where("year", "=", io.v.nutz.base.utils.DateUtil.getYear())
|
||||
.and("club_id", "=", budget.getClubId()));
|
||||
if (ObjectUtil.isNotEmpty(jfClub)) {
|
||||
jfClub.setTotalQuota(jfClub.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
activityBudgetService.updateIgnoreNull(jfClub);
|
||||
}
|
||||
} else if (budget.getBudgetTypeCode().equals("ACTIVITY_BUDGET_TYPE_FOUR")) {
|
||||
// 更新其他经费表
|
||||
/* JfOther jfOther = activityBudgetService.dao().fetch(JfOther.class, Cnd.where("year", "=", io.v.nutz.base.utils.DateUtil.getYear()));
|
||||
if (ObjectUtil.isNotEmpty(jfOther)) {
|
||||
jfOther.setTotalQuota(jfOther.getTotalQuota().subtract(budget.getTotalBudgetMoney()));
|
||||
activityBudgetService.updateIgnoreNull(jfOther);
|
||||
}*/
|
||||
}
|
||||
activityBudgetService.dao().delete(ActivityBudget.class, id);
|
||||
activityBudgetService.dao().clear(ActivityBudgetDetails.class, Cnd.where("budgetId", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package io.v.nutz.zhgh.activityBudget.conteoller;
|
||||
|
||||
import cn.afterturn.easypoi.entity.BaseTypeConstants;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.zhgh.activityBudget.service.ActivityBudgetQueryStatisticsService;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetQueryStatisticsController
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/12/16 14:17
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/budget/queryStatistics")
|
||||
public class ActivityBudgetQueryStatisticsController {
|
||||
|
||||
@Inject
|
||||
private ActivityBudgetQueryStatisticsService statisticsService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:platform/activityBudget/queryStatistics.html")
|
||||
@RequiresPermissions("activity.budget.queryStatistics")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("activity.budget.queryStatistics")
|
||||
public Object pageData(@Valid Integer year, String clubId, String unionId, @Valid String budgetTypeCode) {
|
||||
return statisticsService.getDataByBudgetTypeCode(year, clubId, unionId, budgetTypeCode);
|
||||
}
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("activity.budget.queryStatistics")
|
||||
public void doExport(@Valid Integer year, String clubId, String unionId, @Valid String budgetTypeCode, HttpServletResponse response) {
|
||||
List<NutMap> mapList = statisticsService.getDataByBudgetTypeCode(year, clubId, unionId, budgetTypeCode);
|
||||
if (budgetTypeCode.equals("ACTIVITY_BUDGET_TYPE_TWO")){
|
||||
mapList.forEach(m->{
|
||||
if (StrUtil.isEmpty(m.getString("unionName"))){
|
||||
m.put("unionName",m.getString("unitName"));
|
||||
m.put("unionCode",m.getString("unionId"));
|
||||
}
|
||||
});
|
||||
}
|
||||
ArrayList<ExcelExportEntity> entities = new ArrayList<>();
|
||||
entities.add(new ExcelExportEntity("年度", "year", 20));
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_ONE", "ACTIVITY_BUDGET_TYPE_FOUR").contains(budgetTypeCode)) {
|
||||
entities.add(new ExcelExportEntity("事项", "activityMatter", 50));
|
||||
}else if (budgetTypeCode.equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
entities.add(new ExcelExportEntity("编码", "unionCode", 20));
|
||||
entities.add(new ExcelExportEntity("分工会", "unionName", 20));
|
||||
}else if (budgetTypeCode.equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
entities.add(new ExcelExportEntity("编码", "clubCode", 20));
|
||||
entities.add(new ExcelExportEntity("协会名称", "clubName", 20));
|
||||
}
|
||||
ExcelExportEntity draftCodeEntity = new ExcelExportEntity("预算金额", "totalBudgetMoney", 20);
|
||||
draftCodeEntity.setType(BaseTypeConstants.DOUBLE_TYPE);
|
||||
entities.add(draftCodeEntity);
|
||||
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "预算申报汇总表.xlsx");
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, mapList);
|
||||
workbook.write(response.getOutputStream());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+135
@@ -0,0 +1,135 @@
|
||||
package io.v.nutz.zhgh.activityBudget.conteoller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activityBudget.handler.ActivityBudgetUserApplyToDoHandler;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.activityBudget.service.ActivityBudgetService;
|
||||
import io.v.nutz.zhgh.zgfw.handler.condolence.CondolenceToDoHandler;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
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;
|
||||
import org.nutz.json.Json;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetSchoolAuditController
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/12/16 10:47
|
||||
*/
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/activity/budget/schoolAudit")
|
||||
public class ActivityBudgetSchoolAuditController {
|
||||
|
||||
|
||||
@Inject
|
||||
private ActivityBudgetService activityBudgetService;
|
||||
|
||||
@Inject
|
||||
private SysLocalProcessService localProcessService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:platform/activityBudget/schoolAudit.html")
|
||||
@RequiresPermissions("activity.budget.schoolAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("activity.budget.schoolAudit")
|
||||
public Object pageData(PageForm pageForm, Integer year, String unionId, String clubId, Integer auditState, String budgetTypeCode, String activityMatter) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
YEAR(ab.applyDate) year,
|
||||
ab.*
|
||||
FROM
|
||||
activity_budget ab
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(activityMatter)) {
|
||||
cnd.andEX("ab.activityMatter", "like", "%" + activityMatter + "%");
|
||||
}
|
||||
if (Strings.isNotBlank(pageForm.getSearchKeyword())) {
|
||||
SqlExpressionGroup seg = new SqlExpressionGroup();
|
||||
seg.orLike("ab.userName", pageForm.getSearchKeyword());
|
||||
seg.orLike("ab.loginName", pageForm.getSearchKeyword());
|
||||
cnd.and(seg);
|
||||
}
|
||||
cnd.andEX("YEAR(ab.applyDate)", "=", year);
|
||||
cnd.andEX("ab.auditState", ">=", 1);
|
||||
cnd.andEX("ab.unionId", "=", unionId);
|
||||
cnd.andEX("ab.clubId", "=", clubId);
|
||||
cnd.andEX("ab.budgetTypeCode", "=", budgetTypeCode);
|
||||
if (auditState != 0) {
|
||||
cnd.and("ab.auditState", auditState == 1 ? ">" : "=", 1);
|
||||
}
|
||||
cnd.desc("ab.applyDate");
|
||||
sql.setCondition(cnd);
|
||||
return activityBudgetService.listPageMap(pageForm.getPageNumber(), pageForm.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("activity.budget.schoolAudit")
|
||||
public Object doSubmit(String id, Integer auditState, String totalBudgetMoney, Audit audit) {
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setAuditor(ShiroUtil.getUserId());
|
||||
audit.setAuditTime(new Date());
|
||||
activityBudgetService.insert(audit);
|
||||
activityBudgetService.update(Chain.make("auditState", auditState)
|
||||
.add("schoolAuditId", audit.getId()).add("totalBudgetMoney", totalBudgetMoney), Cnd.where("id", "=", id));
|
||||
ActivityBudget activityBudget = activityBudgetService.fetch(id);
|
||||
ActivityBudgetUserApplyToDoHandler.COMPLETE_SCHOOL_TASK.exec(activityBudget, audit.getAuditOpinion());
|
||||
if (auditState == 4) {
|
||||
ActivityBudgetUserApplyToDoHandler.COMPLETE_PROCESS.exec(activityBudget, audit.getAuditOpinion());
|
||||
} else if (auditState == 3) {
|
||||
ActivityBudgetUserApplyToDoHandler.CREATE_BACK_SCHOOL_TASK.exec(activityBudget, audit.getAuditOpinion());
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("activity.budget.schoolAudit")
|
||||
public Object doRevoke(@Valid String id) {
|
||||
ActivityBudget budget = activityBudgetService.fetch(id);
|
||||
budget.setAuditState(1);
|
||||
budget.setTotalBudgetMoney(null);
|
||||
activityBudgetService.update(budget);
|
||||
localProcessService.revokeTask("activity_budget@" + id, "校工会审核");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+173
@@ -0,0 +1,173 @@
|
||||
package io.v.nutz.zhgh.activityBudget.handler;
|
||||
|
||||
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.ViResource;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
|
||||
import lombok.Getter;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 活动申请待办处理
|
||||
*/
|
||||
|
||||
/**
|
||||
* @Author: zhf
|
||||
* @Date: 2025/8/30 11:06
|
||||
* @Version: v1.0.0
|
||||
* @Description: 活动申请待办处理
|
||||
**/
|
||||
@Getter
|
||||
public enum ActivityBudgetUserApplyToDoHandler {
|
||||
|
||||
/**
|
||||
* 流程开始
|
||||
*/
|
||||
START_PROCESS() {
|
||||
@Override
|
||||
public void exec(ActivityBudget activityBudget, String option) {
|
||||
Sys_user sysUser = dao.fetch(Sys_user.class, activityBudget.getUserId());
|
||||
|
||||
localProcessService.startProcess(
|
||||
"【年度预算】" + sysUser.getUsername(),
|
||||
"activity_budget@" + activityBudget.getId(),
|
||||
"年度预算申报",
|
||||
sysUser.getId(),
|
||||
"/platform/activity/budget/applyList",
|
||||
"/platform/activity/budget/applyList"
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 完成申请人的任务(申请拒绝的情况)
|
||||
*/
|
||||
COMPLETE_APPLY_TASK() {
|
||||
@Override
|
||||
public void exec(ActivityBudget activityBudget, String option) {
|
||||
localProcessService.completeTask(
|
||||
"apply_activity_budget_modify",
|
||||
"activity_budget@" + activityBudget.getId(),
|
||||
ShiroUtil.getUserId(),
|
||||
""
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 创建校工会任务
|
||||
*/
|
||||
CREATE_SCHOOL_TASK() {
|
||||
@Override
|
||||
public void exec(ActivityBudget activityBudget, String option) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname
|
||||
FROM
|
||||
sys_user_role sur
|
||||
LEFT JOIN sys_user u ON u.id = sur.userid
|
||||
WHERE
|
||||
sur.roleId = @SchoolUnionAdmin
|
||||
GROUP BY
|
||||
sur.userId
|
||||
""").setParam("SchoolUnionAdmin", Roles.XGHGLY);
|
||||
sql.setCallback(Sqls.callback.strs());
|
||||
dao.execute(sql);
|
||||
List<String> loginNames = sql.getList(String.class);
|
||||
if (Lang.isEmpty(loginNames)) {
|
||||
throw new RuntimeException("找不到下一步审核人,请联系管理员设置。");
|
||||
}
|
||||
localProcessService.createTask(
|
||||
"activity_budget@" + activityBudget.getId(),
|
||||
"school_audit",
|
||||
"校工会审核",
|
||||
ShiroUtil.getUserId(),
|
||||
loginNames,
|
||||
"/platform/activity/budget/schoolAudit",
|
||||
"/platform/activity/budget/schoolAudit",
|
||||
"/platform/activity/budget/schoolAudit",
|
||||
"/platform/activity/budget/schoolAudit"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("activity_budget@" + activityBudget.getId(), "校工会审核");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 校工会退回,退回给个人节点
|
||||
*/
|
||||
CREATE_BACK_SCHOOL_TASK() {
|
||||
@Override
|
||||
public void exec(ActivityBudget activityBudget, String option) {
|
||||
|
||||
localProcessService.createTask(
|
||||
"activity_budget@" + activityBudget.getId(),
|
||||
"school_back",
|
||||
"校工会退回",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of(activityBudget.getLoginName()),
|
||||
"/platform/activity/budget/applyList",
|
||||
"/platform/activity/budget/applyList",
|
||||
"/platform/activity/budget/applyList",
|
||||
"/platform/activity/budget/applyList"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("activity_budget@" + activityBudget.getId(), "校工会退回");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 校工会完成
|
||||
*/
|
||||
COMPLETE_SCHOOL_TASK() {
|
||||
@Override
|
||||
public void exec(ActivityBudget activityBudget, String option) {
|
||||
localProcessService.completeTask(
|
||||
"school_audit",
|
||||
"activity_budget@" + activityBudget.getId(),
|
||||
ShiroUtil.getUserId(),
|
||||
option
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 流程结束
|
||||
*/
|
||||
COMPLETE_PROCESS() {
|
||||
@Override
|
||||
public void exec(ActivityBudget activityBudget, String option) {
|
||||
localProcessService.completeProcess("activity_budget@" + activityBudget.getId());
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
DELETE_PROCESS() {
|
||||
@Override
|
||||
public void exec(ActivityBudget activityBudget, String option) {
|
||||
localProcessService.deleteProcessInstance("activity_budget@" + activityBudget.getId());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public abstract void exec(ActivityBudget activityBudget, String option);
|
||||
|
||||
public Dao dao = ViResource.dao;
|
||||
public SysLocalProcessService localProcessService = ViResource.ioc.get(SysLocalProcessServiceImpl.class);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package io.v.nutz.zhgh.activityBudget.models;
|
||||
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudget
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/12/3 10:09
|
||||
*/
|
||||
@Table
|
||||
@Data
|
||||
@Comment("活动预算")
|
||||
@Accessors(chain = true)
|
||||
public class ActivityBudget extends BaseModel implements Serializable {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("用户ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String userId;
|
||||
|
||||
@Column
|
||||
@Comment("用户姓名")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String userName;
|
||||
|
||||
@Column
|
||||
@Comment("用户工号")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String loginName;
|
||||
@Column
|
||||
@Comment("联系方式")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String mobile;
|
||||
|
||||
@Column
|
||||
@Comment("活动时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String activityDate;
|
||||
|
||||
@Column
|
||||
@Comment("活动事项")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String activityMatter;
|
||||
|
||||
@Column
|
||||
@Comment("活动内容")
|
||||
@ColDefine(type = ColType.TEXT)
|
||||
private String activityContent;
|
||||
|
||||
@Column
|
||||
@Comment("预算金额")
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal totalBudgetMoney;
|
||||
@Column
|
||||
@Comment("申报金额")
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal declareTotalBudgetMoney;
|
||||
|
||||
@Column
|
||||
@Comment("预算类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String budgetTypeCode;
|
||||
@Column
|
||||
@Comment("创建人工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("创建人所属社团")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("举办单位")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String helpUnitName;
|
||||
|
||||
@Column
|
||||
@Comment("申报时间")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String applyDate;
|
||||
|
||||
@Column
|
||||
@Comment("校工会审核")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String schoolAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("签字")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 200)
|
||||
private String applySign;
|
||||
|
||||
@Column
|
||||
@Comment("审核状态")
|
||||
@Default("0")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer auditState;
|
||||
|
||||
@Column
|
||||
@Comment("是否属于校工会预算")
|
||||
@Default("0")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isSchoolBudget;
|
||||
|
||||
@Column
|
||||
@Comment("是否属于校工会预算")
|
||||
@Default("1")
|
||||
@ColDefine(type = ColType.BOOLEAN)
|
||||
private Boolean isRepeatReimbursement;
|
||||
|
||||
@Column
|
||||
@Comment("校工会预算")
|
||||
@ColDefine(type = ColType.VARCHAR,width = 32)
|
||||
private String schoolBudgetId;
|
||||
|
||||
@Many(field = "budgetId")
|
||||
private List<ActivityBudgetDetails> budgetDetails;
|
||||
|
||||
private Audit schoolAudit;
|
||||
private List<Audit> allocationEditAuditList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package io.v.nutz.zhgh.activityBudget.models;
|
||||
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetDetails
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/12/3 10:15
|
||||
*/
|
||||
@Table
|
||||
@Data
|
||||
@Comment("活动预算记录详情")
|
||||
@Accessors(chain = true)
|
||||
public class ActivityBudgetDetails extends BaseModel implements Serializable {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("申报id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String budgetId;
|
||||
|
||||
@Column
|
||||
@Comment("类别")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
private String detailName;
|
||||
|
||||
@Column
|
||||
@Comment("预算金额")
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal budgetMoney;
|
||||
|
||||
@Column
|
||||
@Comment("金额")
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal money;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer detailsOrder;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package io.v.nutz.zhgh.activityBudget.models;
|
||||
|
||||
import cn.wizzer.framework.base.model.BaseModel;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetType
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/12/3 14:55
|
||||
*/
|
||||
@Table
|
||||
@Data
|
||||
@Comment("活动预算类型")
|
||||
@Accessors(chain = true)
|
||||
public class ActivityBudgetType extends BaseModel implements Serializable {
|
||||
|
||||
@Column
|
||||
@Name
|
||||
@Comment("ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
@Prev(els = {@EL("uuid()")})
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
@Comment("类型")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String budgetTypeName;
|
||||
|
||||
@Column
|
||||
@Comment("金额")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
|
||||
private Double budgetTypeMoney;
|
||||
|
||||
@Column
|
||||
@Comment("备注")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
private String note;
|
||||
|
||||
@Column
|
||||
@Comment("年度")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@Comment("排序")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer location;
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package io.v.nutz.zhgh.activityBudget.service;
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
|
||||
public interface ActivityBudgetApplyStatisticsService extends BaseService {
|
||||
|
||||
Sql getsql(Integer year, String unionId,String clubId, String budgetTypeCode,String activityMatter);
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package io.v.nutz.zhgh.activityBudget.service;
|
||||
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ActivityBudgetQueryStatisticsService extends BaseService {
|
||||
|
||||
List<NutMap> getDataByBudgetTypeCode(Integer year, String clubId, String unionId, String budgetTypeCode);
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package io.v.nutz.zhgh.activityBudget.service;
|
||||
|
||||
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
|
||||
public interface ActivityBudgetService extends ViService<ActivityBudget> {
|
||||
|
||||
ActivityBudget findOne(String id);
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package io.v.nutz.zhgh.activityBudget.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.activityBudget.service.ActivityBudgetApplyStatisticsService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetApplyStatisticsServiceImpl
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2025/3/5 下午8:21
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ActivityBudgetApplyStatisticsServiceImpl extends BaseServiceImpl implements ActivityBudgetApplyStatisticsService {
|
||||
public ActivityBudgetApplyStatisticsServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Sql getsql(Integer year, String unionId, String clubId, String budgetTypeCode, String activityMatter) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
YEAR(ab.applyDate) year,
|
||||
ab.*
|
||||
FROM
|
||||
activity_budget ab
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (StrUtil.isNotBlank(activityMatter)) {
|
||||
cnd.andEX("ab.activityMatter", "like", "%" + activityMatter + "%");
|
||||
}
|
||||
cnd.andEX("YEAR(ab.applyDate)", "=", year);
|
||||
cnd.andEX("ab.unionId", "=", unionId);
|
||||
/* if (budgetTypeCode.equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
cnd.andEX("ab.isSchoolBudget", "=", 0);
|
||||
}*/
|
||||
cnd.andEX("ab.clubId", "=", clubId);
|
||||
cnd.andEX("ab.budgetTypeCode", "=", budgetTypeCode);
|
||||
cnd.andEX("ab.auditState", "=", 4);
|
||||
cnd.desc("ab.applyDate");
|
||||
sql.setCondition(cnd);
|
||||
return sql;
|
||||
}
|
||||
|
||||
}
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
package io.v.nutz.zhgh.activityBudget.service.impl;
|
||||
|
||||
import io.v.nutz.base.service.impl.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.activityBudget.service.ActivityBudgetQueryStatisticsService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetQueryStatisticsServiceImpl
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2025/3/5 下午7:16
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ActivityBudgetQueryStatisticsServiceImpl extends BaseServiceImpl implements ActivityBudgetQueryStatisticsService {
|
||||
public ActivityBudgetQueryStatisticsServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getDataByBudgetTypeCode(Integer year, String clubId, String unionId, String budgetTypeCode) {
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_ONE", "ACTIVITY_BUDGET_TYPE_FOUR").contains(budgetTypeCode)) {
|
||||
Sql sql = Sqls.create("SELECT @year `year`,activityMatter,totalBudgetMoney FROM activity_budget $condition").setParam("year", year);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("YEAR(applyDate)", "=", year);
|
||||
cnd.andEX("budgetTypeCode", "=", budgetTypeCode);
|
||||
cnd.andEX("auditState", "=", 4);
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
} else if (budgetTypeCode.equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
//分工会
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@year `year`,
|
||||
un.unioncode AS unionCode,
|
||||
un.unionname AS unionName,
|
||||
it.`name` unitName,
|
||||
ab.unionId,
|
||||
COALESCE ( SUM( ab.totalBudgetMoney ), 0 ) AS totalBudgetMoney
|
||||
FROM
|
||||
activity_budget ab
|
||||
LEFT JOIN sys_union un ON ab.unionId = un.id
|
||||
LEFT JOIN sys_unit it ON it.id = ab.unionId
|
||||
$condition
|
||||
""").setParam("year", year);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("ab.unionId", "=", unionId);
|
||||
cnd.andEX("ab.isSchoolBudget", "=", 0);
|
||||
cnd.andEX("ab.budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_TWO");
|
||||
cnd.andEX("ab.auditState", "=", 4);
|
||||
cnd.andEX("YEAR(ab.applyDate)", "=", year);
|
||||
cnd.groupBy("ab.unionId");
|
||||
cnd.asc("un.unioncode");
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
|
||||
} else if (budgetTypeCode.equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@year `year`,
|
||||
sc.`code` AS clubCode,
|
||||
sc.`name` AS clubName,
|
||||
COALESCE ( SUM( ab.totalBudgetMoney ), 0 ) AS totalBudgetMoney
|
||||
FROM
|
||||
sys_club sc
|
||||
LEFT JOIN activity_budget ab ON ab.clubId = sc.id
|
||||
AND ab.budgetTypeCode = 'ACTIVITY_BUDGET_TYPE_THREE'
|
||||
AND ab.auditState = 4
|
||||
AND YEAR(ab.applyDate)=@year
|
||||
$condition
|
||||
""").setParam("year", year);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("sc.id", "=", clubId);
|
||||
cnd.groupBy("sc.id");
|
||||
cnd.asc("sc.`code`");
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package io.v.nutz.zhgh.activityBudget.service.impl;
|
||||
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.activityBudget.service.ActivityBudgetService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetServiceImpl
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2024/12/3 17:56
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ActivityBudgetServiceImpl extends ViServiceImpl<ActivityBudget> implements ActivityBudgetService {
|
||||
public ActivityBudgetServiceImpl(Dao dao) {
|
||||
super(dao);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActivityBudget findOne(String id) {
|
||||
ActivityBudget activityBudget = fetchLinks(fetch(id), "budgetDetails", Cnd.NEW().asc("detailsOrder"));
|
||||
activityBudget.setSchoolAudit(dao().fetch(Audit.class, Cnd.where("id", "=", activityBudget.getSchoolAuditId())));
|
||||
activityBudget.setAllocationEditAuditList(dao().query(Audit.class, Cnd.where("parentId", "=", activityBudget.getId())));
|
||||
return activityBudget;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package io.v.nutz.zhgh.activityBudget.template;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @ClassName ActivityBudgetTemp
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2025/3/12 上午11:13
|
||||
*/
|
||||
@Data
|
||||
public class ActivityBudgetTemp {
|
||||
|
||||
|
||||
@Excel(name = "活动时间", format = "yyyy-MM-dd", needMerge = true)
|
||||
private String activityDate;
|
||||
|
||||
@Excel(name = "活动项目名称")
|
||||
private String activityMatter;
|
||||
|
||||
@Excel(name = "活动内容概述")
|
||||
private String activityContent;
|
||||
|
||||
@Excel(name = "联系方式")
|
||||
private String mobile;
|
||||
|
||||
@Excel(name = "预算类型(请在下拉菜单中选择)")
|
||||
private String budgetTypeCode;
|
||||
|
||||
@Excel(name = "审核预算")
|
||||
private String totalBudgetMoney;
|
||||
|
||||
@Excel(name = "预算金额")
|
||||
private String declareTotalBudgetMoney;
|
||||
|
||||
@Excel(name = "审核意见")
|
||||
private String auditOpinion;
|
||||
|
||||
@Excel(name = "申报单位(仅社团申报时可在下拉菜单中选择,其他类型不用填写)")
|
||||
private String helpUnitName;
|
||||
|
||||
private String errorInfo;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -89,7 +89,7 @@ public class ClubDataInputController {
|
||||
@POST
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object doExport(TempFile file, String park_id) {
|
||||
int count = 0;
|
||||
/*int count = 0;
|
||||
int success_count = 0;
|
||||
try {
|
||||
// 查出现在已交协会表中的已交协会
|
||||
@@ -136,8 +136,8 @@ public class ClubDataInputController {
|
||||
} catch (Exception e) {
|
||||
} finally {
|
||||
return Result.success().addData(NutMap.NEW().setv("count", count).setv("success_count", success_count));
|
||||
}
|
||||
|
||||
}*/
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -4,33 +4,34 @@ package io.v.nutz.zhgh.jf.controller.club;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.zhgh.jf.model.CostsSet;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.service.CostsSetService;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2020/11/5 10:24
|
||||
* @description 协会活动经费分配
|
||||
* @description 社团活动经费分配
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/jf/st/fp")
|
||||
@@ -44,7 +45,7 @@ public class clubController {
|
||||
|
||||
@Inject
|
||||
private CostsSetService costsSetService;
|
||||
private int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||
private final int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/jf/club/clubys.html")
|
||||
@@ -55,8 +56,8 @@ public class clubController {
|
||||
// 获取最近的一年
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.st.fp")
|
||||
public Object lastYear() {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
select max(year) year from jf_club where state=1
|
||||
""");
|
||||
@@ -69,13 +70,15 @@ public class clubController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.st.fp")
|
||||
public Object reset() {
|
||||
return jfClubService.update(Chain.make("state", 0), Cnd.where("year", "=", year).and("state", "=", 1));
|
||||
jfClubService.clear(Cnd.where("year", "=", DateUtil.getYear()));
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
//查询是否已下发
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.st.fp")
|
||||
public Object isSet() {
|
||||
return jfClubService.count(Cnd.where("state", "=", 1).and("year", "=", year));
|
||||
}
|
||||
@@ -86,87 +89,57 @@ public class clubController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.st.fp")
|
||||
public Object issue() {
|
||||
Trans.exec(() -> {
|
||||
Sql sql = Sqls.create("""
|
||||
|
||||
SELECT
|
||||
jf.club_id,club.id cid,
|
||||
( SELECT count( 1 ) FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.`status` = 5 and scu.isNormal is true) cynum,
|
||||
( SELECT count( 1 ) FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.`status` = 5 and scu.isNormal is true and scu.giveMoney is true) bfnum,
|
||||
( SELECT count( 1 ) FROM sys_club_user scu WHERE scu.clubid = club.id AND scu.`status` = 5 and scu.isNormal is true and scu.giveMoney is false) wbfnum
|
||||
FROM
|
||||
`sys_club` club
|
||||
LEFT JOIN jf_club jf ON jf.club_id = club.id
|
||||
AND jf.`year` = @year
|
||||
|
||||
""");
|
||||
List<ActivityBudget> budgetList = jfClubService.dao().query(ActivityBudget.class,
|
||||
Cnd.where("YEAR(applyDate)", "=", DateUtil.getYear())
|
||||
.and("auditState", "=", 4)
|
||||
.and("isSchoolBudget", "=", false)
|
||||
.and("budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_THREE"));
|
||||
List<Sys_club> clubsList = jfClubService.dao().query(Sys_club.class,
|
||||
Cnd.where("state", "=", 930));
|
||||
|
||||
sql.setParam("year", year);
|
||||
CostsSet costsSet = costsSetService.fetch(Cnd.where("year", "=", this.year));
|
||||
List<Record> list = jfClubService.list(sql);
|
||||
list.forEach(record -> {
|
||||
String cid = record.getString("cid");
|
||||
int cynum = record.getInt("cynum");
|
||||
int bfnum = record.getInt("bfnum");
|
||||
int wbfnum = record.getInt("wbfnum");
|
||||
Double clubLeastMoney = costsSet.getClubLeastMoney();
|
||||
Double clubAtMostMoney = costsSet.getClubAtMostMoney();
|
||||
Double money = clubLeastMoney;
|
||||
//如果人数超过基础人数人
|
||||
if (bfnum > costsSet.getClubExceedNum()) {
|
||||
money = clubLeastMoney + (bfnum - costsSet.getClubExceedNum()) * costsSet.getClub_avg();
|
||||
}
|
||||
if (money > clubAtMostMoney) {
|
||||
money = clubAtMostMoney;
|
||||
}
|
||||
|
||||
Chain add = Chain.make("total_quota", money)
|
||||
.add("state", 1)
|
||||
.add("history_club_avg", costsSet.getClub_avg())
|
||||
.add("history_member", cynum)
|
||||
.add("history_y_giveMoney_member", bfnum)
|
||||
.add("history_w_giveMoney_member", wbfnum);
|
||||
jfClubService.update(add, Cnd.where("year", "=", year).and("club_id", "=", cid));
|
||||
});
|
||||
List<jf_club> jfClubList = new ArrayList<>();
|
||||
clubsList.forEach(v -> {
|
||||
BigDecimal totalBudgetMoney = budgetList.stream()
|
||||
.filter(budget -> budget.getClubId().equals(v.getId()))
|
||||
.map(ActivityBudget::getTotalBudgetMoney) // 提取 money 属性
|
||||
.filter(Objects::nonNull) // 过滤掉空值
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
jf_club yjgh = new jf_club();
|
||||
yjgh.setClub_id(v.getId());
|
||||
yjgh.setYear(DateUtil.getYear());
|
||||
yjgh.setTotalQuota(totalBudgetMoney);
|
||||
yjgh.setState(1);
|
||||
jfClubList.add(yjgh);
|
||||
});
|
||||
jfClubService.insert(jfClubList);
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.st.fp")
|
||||
public Object pageData(@Param(value = "pageNumber", required = false) int pageNumber,
|
||||
@Param(value = "pageSize", required = false) int pageSize,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "pageOrderName", required = false) String pageOrderName,
|
||||
@Param(value = "pageOrderBy", required = false) String pageOrderBy,
|
||||
@Param(value = "club_id", required = false) String club_id) {
|
||||
public Object pageData(int pageNumber, int pageSize, Integer year, String pageOrderName, String pageOrderBy, String club_id) {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
jf.*,
|
||||
club.`name`,
|
||||
club.id cid,
|
||||
club.code,
|
||||
(SELECT count( 1 ) FROM sys_club_user scu WHERE
|
||||
scu.clubid = club.id
|
||||
AND scu.`status` = 5
|
||||
AND scu.isNormal IS TRUE ) cynum
|
||||
club.code
|
||||
FROM
|
||||
`sys_club` club
|
||||
LEFT JOIN jf_club jf ON jf.club_id = club.id
|
||||
AND jf.`year` = @year
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (Strings.isNotBlank(pageOrderBy) && Strings.isNotBlank(pageOrderName)) {
|
||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
||||
} else if (Strings.isNotBlank(club_id)) {
|
||||
cnd.and("club_id", "=", club_id);
|
||||
cnd.and("club.id", "=", club_id);
|
||||
} else {
|
||||
cnd.asc("club.`name`");
|
||||
cnd.asc("club.`code`");
|
||||
}
|
||||
cnd.and("jf.state", "=", 1);
|
||||
cnd.and("club.state", "=", 930);
|
||||
cnd.and("jf.`year`", "=", year);
|
||||
sql.setParam("year", year);
|
||||
sql.setCondition(cnd);
|
||||
Pagination listPage = jfClubService.listPageMap(pageNumber, pageSize, sql);
|
||||
@@ -178,47 +151,14 @@ public class clubController {
|
||||
|
||||
@At
|
||||
@RequiresPermissions("sys.jf.st.fp")
|
||||
public Object changeYs(String club_id, Integer year, Double total_quota) {
|
||||
public Object changeYs(String clubId, Integer year, String totalQuota) {
|
||||
try {
|
||||
total_quota = total_quota == null ? 0 : total_quota;
|
||||
jf_club jf_club = jfClubService.fetch(Cnd.where("club_id", "=", club_id).and("year", "=", year));
|
||||
if (jf_club != null) {
|
||||
jf_club.setTotal_quota(total_quota);
|
||||
jfClubService.updateIgnoreNull(jf_club);
|
||||
} else {
|
||||
jf_club = new jf_club();
|
||||
jf_club.setClub_id(club_id);
|
||||
jf_club.setYear(year);
|
||||
jf_club.setTotal_quota(total_quota);
|
||||
jfClubService.insert(jf_club);
|
||||
}
|
||||
jf_club jf_club = jfClubService.fetch(Cnd.where("club_id", "=", clubId).and("year", "=", year));
|
||||
jf_club.setTotalQuota(new BigDecimal(totalQuota));
|
||||
jfClubService.updateIgnoreNull(jf_club);
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.st.fp")
|
||||
public Object doAdd(jf_club club){
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
sc.`name`,
|
||||
YEAR(sc.create_time) `year`,
|
||||
( SELECT count( 1 ) FROM `sys_club_user` scu WHERE scu.clubid = @clubId ) clubUser
|
||||
FROM
|
||||
`sys_club` sc
|
||||
WHERE
|
||||
sc.id = @clubId
|
||||
""").setParam("clubId",club.getClub_id());
|
||||
Record record = jfClubService.list(sql).get(0);
|
||||
club.setHistory_member(Integer.parseInt(record.getString("clubUser")));
|
||||
club.setHistory_y_giveMoney_member(Integer.parseInt(record.getString("clubUser")));
|
||||
club.setYear(Integer.parseInt(record.getString("year")));
|
||||
club.setState(1);
|
||||
jfClubService.dao().insert(club);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,10 @@ import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.utils.ExcelUtil;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import io.v.nutz.sys.models.Sys_user_role;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@@ -18,7 +19,9 @@ import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.log.Log;
|
||||
import org.nutz.log.Logs;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
@@ -28,7 +31,6 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -46,6 +48,11 @@ public class clubTzController {
|
||||
|
||||
@Inject
|
||||
private jfClubService jfClubService;
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
@Inject
|
||||
private Vi vi;
|
||||
|
||||
|
||||
@At("")
|
||||
@@ -56,7 +63,8 @@ public class clubTzController {
|
||||
|
||||
|
||||
@At
|
||||
public Object data(int pageNumber, int pageSize, Integer year, String club_id, String pageOrderName, String pageOrderBy) {
|
||||
@RequiresPermissions("sys.jf.st.tz")
|
||||
public Object data(int pageNumber, int pageSize, Integer year, String pageOrderName, String pageOrderBy) {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -67,26 +75,42 @@ public class clubTzController {
|
||||
FROM
|
||||
`sys_club` club
|
||||
LEFT JOIN jf_club jf ON jf.club_id = club.id
|
||||
AND jf.`year` = @year
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.andEX("club.id", "=", club_id);
|
||||
} else {
|
||||
List<Sys_user_role> roleids = jfClubService.dao().query(Sys_user_role.class, Cnd.where("roleId", "=", Roles.club01));
|
||||
List<String> ids = roleids.stream().map(Sys_user_role::getStid).collect(Collectors.toList());
|
||||
cnd.andEX("club.id", "in", ids);
|
||||
if (!ShiroUtil.hasRole("sysadmin") || ShiroUtil.hasRole("A06")) {
|
||||
Cnd cnd1 = Cnd.NEW();
|
||||
Sql sql1 = Sqls.create("""
|
||||
SELECT
|
||||
club.id
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN `sys_user_role` role ON club.id = role.stid
|
||||
$condition
|
||||
""");
|
||||
if (!ShiroUtil.hasRole("sysadmin")) {
|
||||
cnd.and("role.roleId", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04));
|
||||
cnd.and("role.userId", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
cnd1.and("club.isjs", "=", false);
|
||||
cnd1.and("club.state", "=", 930);
|
||||
cnd1.groupBy("club.id");
|
||||
cnd1.asc("club.`code`");
|
||||
sql.setCondition(cnd1);
|
||||
List<NutMap> nutMapList = jfClubService.listMap(sql1);
|
||||
List<String> ids = nutMapList.stream().map(v -> v.getString("id")).toList();
|
||||
cnd.and("club.id", "in", ids);
|
||||
}
|
||||
|
||||
cnd.and("jf.total_quota", "IS NOT", null);
|
||||
cnd.and("jf.totalQuota", "IS NOT", null);
|
||||
if (Strings.isNotBlank(pageOrderBy) && Strings.isNotBlank(pageOrderName)) {
|
||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
||||
} else {
|
||||
cnd.asc("club.`name`");
|
||||
}
|
||||
cnd.andEX("jf.`year`","=",year);
|
||||
sql.setParam("year", year);
|
||||
sql.setCondition(cnd);
|
||||
Pagination listPage = jfClubService.listPage(pageNumber, pageSize, sql);
|
||||
Pagination listPage = jfClubService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success().addData(listPage);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
@@ -94,6 +118,7 @@ public class clubTzController {
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("sys.jf.st.tz")
|
||||
public Object modifyJf(String id, Integer usedQuota, String reason) {
|
||||
try {
|
||||
Chain chain = Chain.make("usedQuota", usedQuota).add("reason", reason);
|
||||
@@ -106,28 +131,23 @@ public class clubTzController {
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("sys.jf.st.tz")
|
||||
public void exportExcel(HttpServletResponse response, Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
jf.*,
|
||||
club.`name`,
|
||||
club.`code`,
|
||||
club.id cid
|
||||
FROM
|
||||
`jf_club` jf
|
||||
LEFT JOIN `sys_club` club ON jf.club_id = club.id
|
||||
$condition
|
||||
""");
|
||||
Sql sql = Sqls.create("SELECT\n" +
|
||||
"\tjf.* ,club.`name`,club.id cid\n" +
|
||||
"FROM\n" +
|
||||
"`sys_club` club\n" +
|
||||
"LEFT JOIN jf_club jf ON jf.club_id = club.id\n" +
|
||||
"AND jf.`year` = @year $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (ShiroUtil.hasRole("sysadmin") || ShiroUtil.hasRole("A06")) {
|
||||
|
||||
} else {
|
||||
List<Sys_user_role> roleids = jfClubService.dao().query(Sys_user_role.class, Cnd.where("roleId", "=", Roles.club01));
|
||||
List<String> ids = roleids.stream().map(Sys_user_role::getStid).collect(Collectors.toList());
|
||||
cnd.andEX("club.id", "in", ids);
|
||||
} else if (ShiroUtil.hasRole("D02")) {
|
||||
//基层工会管理员
|
||||
cnd.and("club.fzr", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
cnd.asc("club.name");
|
||||
cnd.and("jf.`year`","=",year);
|
||||
sql.setParam("year", year);
|
||||
sql.setCondition(cnd);
|
||||
List<Record> list = jfClubService.list(sql);
|
||||
|
||||
@@ -139,13 +159,13 @@ public class clubTzController {
|
||||
String sheetName = year + "年协会经费使用情况表";
|
||||
String[][] content = new String[list.size()][title.length];
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Double zed = list.get(i).getDouble("total_quota");
|
||||
Double ysyed = list.get(i).getDouble("used_quota");
|
||||
Float zed = Strings.isBlank(list.get(i).getString("total_quota")) ? 0 : Float.parseFloat(list.get(i).getString("total_quota"));
|
||||
int ysyed = Strings.isBlank(list.get(i).getString("used_quota")) ? 0 : Integer.parseInt(list.get(i).getString("used_quota"));
|
||||
content[i][0] = list.get(i).getString("year");
|
||||
content[i][1] = list.get(i).getString("name");
|
||||
content[i][2] = String.valueOf(zed);
|
||||
content[i][3] = String.valueOf(ysyed);
|
||||
content[i][4] = String.valueOf(zed - ysyed);
|
||||
content[i][4] = String.format("%.2f", zed - ysyed);
|
||||
}
|
||||
HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook(sheetName, title, content, null);
|
||||
try {
|
||||
|
||||
@@ -1,118 +0,0 @@
|
||||
package io.v.nutz.zhgh.jf.controller.costsSet;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.CostsSet;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_school;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.zhgh.jf.service.CostsSetService;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.sys.services.SysUnionService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Author:xsb
|
||||
* @Description: 费用设置
|
||||
* @Date:Created in 9:25 2021/1/23
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/jf/costsSet/costsSet")
|
||||
@Ok("json:full")
|
||||
|
||||
public class CostsSetController {
|
||||
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfYjghService jfYjghService;
|
||||
|
||||
@Inject
|
||||
private SysUnionService sysUnionService;
|
||||
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfClubService jfClubService;
|
||||
|
||||
@Inject
|
||||
private SysClubService sysClubService;
|
||||
|
||||
|
||||
@Inject // 经费设置
|
||||
private CostsSetService costsSetService;
|
||||
private int year = Calendar.getInstance().get(Calendar.YEAR);
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/jf/costsSet/costsSet.html")
|
||||
@RequiresPermissions("sys.manager.jf.costsSet")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
// 设置人均额度
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.manager.jf.costsSet")
|
||||
public Object set(CostsSet costsSet) {
|
||||
Trans.exec(() -> {
|
||||
costsSet.setYear(DateUtil.getYear());
|
||||
costsSetService.insertOrUpdate(costsSet);
|
||||
jfYjghService.dao().clear(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
jf_school jf_school = new jf_school();
|
||||
jf_school.setTotalQuota(costsSet.getSchoolMoney());
|
||||
jf_school.setUsedQuota(0D);
|
||||
jf_school.setYear(this.year);
|
||||
jf_school.setState(1);
|
||||
jfYjghService.insert(jf_school);
|
||||
|
||||
|
||||
jfYjghService.clear(Cnd.where("year", "=", DateUtil.getYear()));
|
||||
List<Sys_union> query = sysUnionService.query();
|
||||
List<jf_yjgh> jfYjghList = new ArrayList<>();
|
||||
for (Sys_union sys_union : query) {
|
||||
jf_yjgh jf_yjgh = new jf_yjgh();
|
||||
jf_yjgh.setUnionId(sys_union.getId());
|
||||
jf_yjgh.setUsedQuota(0D);
|
||||
jf_yjgh.setYear(DateUtil.getYear());
|
||||
jfYjghList.add(jf_yjgh);
|
||||
}
|
||||
jfYjghService.insert(jfYjghList);
|
||||
|
||||
|
||||
jfClubService.clear(Cnd.where("year", "=", DateUtil.getYear()));
|
||||
List<Sys_club> Sys_clubs = sysClubService.query(Cnd.where("state", "=", 930));
|
||||
List<jf_club> jfClubList = new ArrayList<>();
|
||||
Sys_clubs.forEach(s -> {
|
||||
jf_club jf_club = new jf_club();
|
||||
jf_club.setClub_id(s.getId());
|
||||
jf_club.setUsed_quota(0D);
|
||||
jf_club.setYear(this.year);
|
||||
jfClubList.add(jf_club);
|
||||
});
|
||||
jfClubService.insert(jfClubList);
|
||||
|
||||
|
||||
});
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
// 回显额度
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.manager.jf.costsSet")
|
||||
public Object echo() {
|
||||
return costsSetService.fetch(Cnd.where("year", "=", year));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -59,7 +59,7 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class FinancialImportController {
|
||||
|
||||
@Inject
|
||||
/* @Inject
|
||||
private Dao dao;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@@ -71,10 +71,10 @@ public class FinancialImportController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*//**
|
||||
* 财务数据导入模版
|
||||
* @param response
|
||||
*/
|
||||
*//*
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("sys.jf.financial.import")
|
||||
@@ -95,12 +95,12 @@ public class FinancialImportController {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*//**
|
||||
* 读取excel数据
|
||||
*
|
||||
* @param tempFile 临时文件
|
||||
* @return {@link Object}
|
||||
*/
|
||||
*//*
|
||||
@At
|
||||
@ViReturn
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
@@ -142,11 +142,11 @@ public class FinancialImportController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*//**
|
||||
* 数据导入
|
||||
* @param excelModeArr
|
||||
* @return
|
||||
*/
|
||||
*//*
|
||||
@At
|
||||
@Ok("json:full")
|
||||
@RequiresPermissions("sys.jf.financial.import")
|
||||
@@ -175,7 +175,7 @@ public class FinancialImportController {
|
||||
jf_yjgh yjgh = dao.fetch(jf_yjgh.class, Cnd.where("unionId", "=", s).and("`year`","like", v.getYear()));
|
||||
if (!StringUtils.isEmpty(yjgh)){
|
||||
str=yjgh.getId();
|
||||
BigDecimal residueQuota = new BigDecimal(yjgh.getTotalQuota()).subtract(new BigDecimal(yjgh.getUsedQuota()));
|
||||
BigDecimal residueQuota = yjgh.getTotalQuota().subtract(new BigDecimal(yjgh.getUsedQuota()));
|
||||
if (residueQuota.compareTo(new BigDecimal(v.getAdjust_money())) > 0) {
|
||||
dao.update(jf_yjgh.class, Chain.make("usedQuota", yjgh.getUsedQuota() + v.getAdjust_money()), Cnd.where("id", "=", str));
|
||||
} else {
|
||||
@@ -225,5 +225,5 @@ public class FinancialImportController {
|
||||
Trans.rollback();
|
||||
return Result.error("财务数据导入失败");
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
package io.v.nutz.zhgh.jf.controller.jfbx;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.jf_bxyy;
|
||||
import io.v.nutz.zhgh.jf.service.jfBxYyFjService;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.sys.services.SysUserService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.log.Log;
|
||||
import org.nutz.log.Logs;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
/**
|
||||
* @author 1V
|
||||
* @date 2020/11/5 14:21
|
||||
* @description 经费报销审核
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@At("/platform/jf/jfbx/bxsh")
|
||||
@Ok("json:full")
|
||||
@RequiresAuthentication
|
||||
public class bxshController {
|
||||
|
||||
|
||||
private static final Log log = Logs.get();
|
||||
@Inject
|
||||
public jfBxYyFjService jfBxYyFjService;
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfBxyyService jfBxyyService;
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfYjghService jfYjghService;
|
||||
|
||||
@Inject
|
||||
private SysUserService sysUserService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/jf/bxyy/bxsh.html")
|
||||
@RequiresPermissions("sys.jf.bx.sh")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
//获取预约报销列表
|
||||
@At
|
||||
public Object data(String startTime, String endTime, String saerchsfsh, String searchName,
|
||||
String searchKeyword, int pageNumber, int pageSize) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sys_user user = (Sys_user) ShiroUtil.getPrincipal();
|
||||
int identity = 0;
|
||||
//07193 杜达金
|
||||
if (ShiroUtil.hasRole("gh01")) {
|
||||
identity = 1;
|
||||
int audit_status[] = {1, 2, 3, 4, 5};
|
||||
cnd.and("audit_status", "in", audit_status);
|
||||
}
|
||||
//07001 谢群泽
|
||||
else if (ShiroUtil.hasRole("gh12")) {
|
||||
identity = 2;
|
||||
int audit_status[] = {2, 3, 4, 5};
|
||||
cnd.and("audit_status", "in", audit_status);
|
||||
} else if (ShiroUtil.hasRole("sysadmin")) {
|
||||
identity = 3;
|
||||
int audit_status[] = {1, 2, 3, 4, 5};
|
||||
cnd.and("audit_status", "in", audit_status);
|
||||
}
|
||||
|
||||
//查询
|
||||
if (Strings.isNotBlank(saerchsfsh)) {
|
||||
if (identity == 1 && saerchsfsh.equals("1")) {
|
||||
cnd.and("audit_status", "=", "2");
|
||||
}
|
||||
if (identity == 1 && saerchsfsh.equals("2")) {
|
||||
int audit_status[] = {3, 4, 5};
|
||||
cnd.and("audit_status", "in", audit_status);
|
||||
}
|
||||
if (identity == 2 && saerchsfsh.equals("1")) {
|
||||
cnd.and("audit_status", "=", "1");
|
||||
}
|
||||
if (identity == 2 && saerchsfsh.equals("2")) {
|
||||
int audit_status[] = {2, 3, 4, 5};
|
||||
cnd.and("audit_status", "in", audit_status);
|
||||
}
|
||||
if (identity == 3 && saerchsfsh.equals("1")) {
|
||||
int audit_status[] = {1, 2};
|
||||
cnd.and("audit_status", "in", audit_status);
|
||||
}
|
||||
if (identity == 3 && saerchsfsh.equals("2")) {
|
||||
int audit_status[] = {3, 4, 5};
|
||||
cnd.and("audit_status", "in", audit_status);
|
||||
}
|
||||
}
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(searchName, "like", "%" + searchKeyword + "%");
|
||||
}
|
||||
if (Strings.isNotBlank(startTime)) {
|
||||
cnd.and("booking_time", ">=", startTime);
|
||||
}
|
||||
if (Strings.isNotBlank(endTime)) {
|
||||
cnd.and("booking_time", "<=", endTime);
|
||||
}
|
||||
|
||||
//只查询需要审核的预约报销
|
||||
Sql sql = Sqls.create("SELECT\n" +
|
||||
"\tbu.username userName,\n" +
|
||||
"\tch.username chName,\n" +
|
||||
"\tfi.username fiName,\n" +
|
||||
"\tbu.loginname,\n" +
|
||||
"\tbn.`name` unit,\n" +
|
||||
"\tb.* \n" +
|
||||
"FROM\n" +
|
||||
"\tjf_bxyy b\n" +
|
||||
"\tLEFT JOIN sys_user bu ON bu.id = b.booking_person_id\n" +
|
||||
"\tLEFT JOIN sys_user ch ON ch.id = b.chairman_id\n" +
|
||||
"\tLEFT JOIN sys_user fi ON fi.id = b.finance_id\n" +
|
||||
"\tLEFT JOIN sys_unit bn ON bn.id = bu.unitid $condition");
|
||||
|
||||
cnd.asc("audit_status").desc("booking_time");
|
||||
sql.setCondition(cnd);
|
||||
Pagination yybxlist = jfBxyyService.listPage(pageNumber, pageSize, sql);
|
||||
|
||||
NutMap map = new NutMap();
|
||||
map.put("bxShList", yybxlist);
|
||||
map.put("user", user);
|
||||
map.put("identity", identity);
|
||||
|
||||
return Result.success().addData(map);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 报销审核
|
||||
*
|
||||
* @param identity
|
||||
* @param audit_status
|
||||
* @param opinion
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@At
|
||||
@Ok("json")
|
||||
public Object bxSh(Integer identity, Integer audit_status, String opinion, String id) {
|
||||
try {
|
||||
//获取当前用户信息
|
||||
Sys_user user = (Sys_user) ShiroUtil.getPrincipal();
|
||||
jf_bxyy bxyy = jfBxyyService.fetch(id);
|
||||
bxyy.setAudit_status(audit_status);
|
||||
//主席审核
|
||||
if (identity == 1) {
|
||||
bxyy.setChairman_id(user.getId());
|
||||
bxyy.setChairman_opinion(opinion);
|
||||
bxyy.setChairman_time(DateUtil.getDate());
|
||||
}
|
||||
//财务审核
|
||||
if (identity == 2) {
|
||||
bxyy.setFinance_id(user.getId());
|
||||
bxyy.setFinance_opinion(opinion);
|
||||
bxyy.setFinance_time(DateUtil.getDate());
|
||||
}
|
||||
jfBxyyService.updateIgnoreNull(bxyy);
|
||||
// if (audit_status.equals(3)) {
|
||||
// if (bxyy.getActivity_type().equals("基层工会活动")) {
|
||||
// String unionid = sysUserService.fetch(bxyy.getBooking_person_id()).getUnionid();
|
||||
// jf_yjgh jf_yjgh = jfYjghService.fetch(Cnd.where("unionId", "=", unionid).and("year", "=", new SimpleDateFormat("yyyy").format(new Date())));
|
||||
//
|
||||
// jf_yjgh.setUsedQuota(jf_yjgh.getUsedQuota() == null ? 0 : jf_yjgh.getUsedQuota() + (int) Float.parseFloat(bxyy.getRei_money()));
|
||||
// jfYjghService.updateIgnoreNull(jf_yjgh);
|
||||
// }
|
||||
// }
|
||||
return Result.success().addMsg("审核完毕");
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
return Result.error().addMsg("审核失败!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,223 +0,0 @@
|
||||
package io.v.nutz.zhgh.jf.controller.jfbx;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.log.Log;
|
||||
import org.nutz.log.Logs;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.OutputStream;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 1V
|
||||
* @date 2020/11/5 14:23
|
||||
* @description 经费报销预览
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/jf/jfbx/bxyl")
|
||||
@Ok("json:full")
|
||||
@RequiresAuthentication
|
||||
public class bxylController {
|
||||
|
||||
private static final Log log = Logs.get();
|
||||
|
||||
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfBxyyService jfBxyyService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/jf/bxyy/bxyl.html")
|
||||
@RequiresPermissions("sys.jf.bx.ck")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
public Object data(String startTime, String endTime, String searchName,
|
||||
String searchKeyword, int pageNumber, int pageSize) {
|
||||
try {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sys_user user = (Sys_user) ShiroUtil.getPrincipal();
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(searchName, "like", "%" + searchKeyword + "%");
|
||||
}
|
||||
if (Strings.isNotBlank(startTime)) {
|
||||
cnd.and("booking_time", ">=", startTime);
|
||||
}
|
||||
if (Strings.isNotBlank(endTime)) {
|
||||
cnd.and("booking_time", "<=", endTime);
|
||||
}
|
||||
cnd.and("audit_status", "=", 3);
|
||||
//只查询需要审核的预约报销
|
||||
Sql sql = Sqls.create("SELECT\n" +
|
||||
"\tbu.username userName,\n" +
|
||||
"\tch.username chName,\n" +
|
||||
"\tfi.username fiName,\n" +
|
||||
"\tbu.loginname,\n" +
|
||||
"\tbn.`name` unit,\n" +
|
||||
"\tb.* \n" +
|
||||
"FROM\n" +
|
||||
"\tjf_bxyy b\n" +
|
||||
"\tLEFT JOIN sys_user bu ON bu.id = b.booking_person_id\n" +
|
||||
"\tLEFT JOIN sys_user ch ON ch.id = b.chairman_id\n" +
|
||||
"\tLEFT JOIN sys_user fi ON fi.id = b.finance_id\n" +
|
||||
"\tLEFT JOIN sys_unit bn ON bn.id = bu.unitid $condition");
|
||||
cnd.asc("audit_status").desc("booking_time");
|
||||
sql.setCondition(cnd);
|
||||
Pagination bxylList = jfBxyyService.listPage(pageNumber, pageSize, sql);
|
||||
NutMap map = new NutMap();
|
||||
map.put("bxylList", bxylList);
|
||||
map.put("user", user);
|
||||
return Result.success().addData(map);
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
return Result.error().addMsg("查询失败!");
|
||||
}
|
||||
}
|
||||
|
||||
//导出预约报销表
|
||||
@At
|
||||
public void export(@Param("startTime") String startTime, @Param("endTime") String endTime, @Param("searchName") String searchName, String searchKeyword, HttpServletResponse response) {
|
||||
|
||||
try {
|
||||
Cnd cnd = Cnd.NEW();//查询代表条件
|
||||
cnd.and("audit_status", "=", 3);
|
||||
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(searchName, "like", "%" + searchKeyword + "%");
|
||||
}
|
||||
if (Strings.isNotBlank(startTime)) {
|
||||
cnd.and("booking_time", ">=", startTime);
|
||||
}
|
||||
if (Strings.isNotBlank(endTime)) {
|
||||
cnd.and("booking_time", "<=", endTime);
|
||||
}
|
||||
|
||||
//只查询需要审核的预约报销
|
||||
Sql sqlc = Sqls.create("SELECT\n" +
|
||||
"\tbu.username userName,\n" +
|
||||
"\tbu.loginname,\n" +
|
||||
"\tbn.`name` unit,\n" +
|
||||
"\tb.* \n" +
|
||||
"FROM\n" +
|
||||
"\tjf_bxyy b\n" +
|
||||
"\tLEFT JOIN sys_user bu ON bu.id = b.booking_person_id\n" +
|
||||
"\tLEFT JOIN sys_unit bn ON bn.id = bu.unitid $condition");
|
||||
|
||||
cnd.desc("booking_time");
|
||||
sqlc.setCondition(cnd);
|
||||
List<Record> records = jfBxyyService.list(sqlc);
|
||||
|
||||
//创建HSSFWorkbook对象(excel的文档对象)
|
||||
HSSFWorkbook wb = new HSSFWorkbook();
|
||||
//建立新的sheet对象(excel的表单)
|
||||
HSSFSheet sheet = wb.createSheet("经费报销预约名单");
|
||||
sheet.setDefaultColumnWidth(20);
|
||||
sheet.setColumnWidth(4, 265 * 36);
|
||||
//sheet.setColumnWidth(5,265*38);
|
||||
//在sheet里创建第一行,参数为行索引(excel的行),可以是0~65535之间的任何一个
|
||||
HSSFRow row1 = sheet.createRow(0);
|
||||
row1.setHeight((short) 500);
|
||||
HSSFCellStyle cellStyle = wb.createCellStyle();
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||
|
||||
HSSFFont fontStyle = wb.createFont();
|
||||
//fontStyle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
||||
fontStyle.setFontHeightInPoints((short) 12);
|
||||
cellStyle.setFont(fontStyle);
|
||||
|
||||
//创建单元格(excel的单元格,参数为列索引,可以是0~255之间的任何一个
|
||||
HSSFCell cell1 = row1.createCell(0);
|
||||
cell1.setCellStyle(cellStyle);
|
||||
cell1.setCellValue("申请工号");
|
||||
HSSFCell cell2 = row1.createCell(1);
|
||||
cell2.setCellStyle(cellStyle);
|
||||
cell2.setCellValue("申请人");
|
||||
HSSFCell cell3 = row1.createCell(2);
|
||||
cell3.setCellStyle(cellStyle);
|
||||
cell3.setCellValue("联系电话");
|
||||
HSSFCell cell4 = row1.createCell(3);
|
||||
cell4.setCellStyle(cellStyle);
|
||||
cell4.setCellValue("预约时间");
|
||||
HSSFCell cell5 = row1.createCell(4);
|
||||
cell5.setCellStyle(cellStyle);
|
||||
cell5.setCellValue("报销事项");
|
||||
HSSFCell cell6 = row1.createCell(5);
|
||||
cell6.setCellStyle(cellStyle);
|
||||
cell6.setCellValue("报销金额");
|
||||
HSSFCell cell7 = row1.createCell(6);
|
||||
cell7.setCellStyle(cellStyle);
|
||||
cell7.setCellValue("报销卡号");
|
||||
|
||||
|
||||
HSSFCellStyle cellStyle1 = wb.createCellStyle();
|
||||
cellStyle1.setAlignment(HorizontalAlignment.CENTER);
|
||||
|
||||
//在sheet里创建第二行
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
HSSFRow row = sheet.createRow(i + 1);
|
||||
HSSFCell cella = row.createCell(0);
|
||||
cella.setCellStyle(cellStyle1);
|
||||
cella.setCellValue(records.get(i).getString("loginname"));
|
||||
HSSFCell cellb = row.createCell(1);
|
||||
cellb.setCellStyle(cellStyle1);
|
||||
cellb.setCellValue(records.get(i).getString("userName"));
|
||||
HSSFCell cellc = row.createCell(2);
|
||||
cellc.setCellStyle(cellStyle1);
|
||||
cellc.setCellValue(records.get(i).getString("booking_person_phone"));
|
||||
HSSFCell celld = row.createCell(3);
|
||||
celld.setCellStyle(cellStyle1);
|
||||
celld.setCellValue(records.get(i).getString("booking_time"));
|
||||
HSSFCell celle = row.createCell(4);
|
||||
celle.setCellStyle(cellStyle1);
|
||||
celle.setCellValue(records.get(i).getString("rei_matter"));
|
||||
HSSFCell cellf = row.createCell(5);
|
||||
cellf.setCellStyle(cellStyle1);
|
||||
cellf.setCellValue(records.get(i).getString("rei_money"));
|
||||
HSSFCell cellh = row.createCell(6);
|
||||
cellh.setCellStyle(cellStyle1);
|
||||
cellh.setCellValue(records.get(i).getString("rei_card_number"));
|
||||
}
|
||||
|
||||
String formFileName = "经费报销预约名单";
|
||||
// 针对IE或者以IE为内核的浏览器:
|
||||
formFileName = java.net.URLEncoder.encode(formFileName, "UTF-8");
|
||||
|
||||
// formFileName = new String(formFileName.getBytes("UTF-8"), "ISO-8859-1");
|
||||
|
||||
//输出Excel文件
|
||||
OutputStream output = response.getOutputStream();
|
||||
response.reset();
|
||||
response.setHeader("Content-disposition", "attachment; filename=" + formFileName + ".xls");
|
||||
response.setContentType("application/msexcel;charset=utf-8");
|
||||
response.setCharacterEncoding("UTF-8");
|
||||
wb.write(output);
|
||||
output.close();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,387 +0,0 @@
|
||||
package io.v.nutz.zhgh.jf.controller.jfbx;
|
||||
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.jf_bxyy;
|
||||
import io.v.nutz.zhgh.jf.model.jf_bxyy_fj;
|
||||
import io.v.nutz.sys.models.Sys_file;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.DocConverter;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.boot.starter.ftp.FtpService;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.log.Log;
|
||||
import org.nutz.log.Logs;
|
||||
import org.nutz.mvc.annotation.AdaptBy;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.mvc.upload.TempFile;
|
||||
import org.nutz.mvc.upload.UploadAdaptor;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author 1V
|
||||
* @date 2020/11/5 14:24
|
||||
* @description 经费报销预约
|
||||
*/
|
||||
@IocBean
|
||||
@At("/platform/jf/jfbx/bxyy")
|
||||
@Ok("json:full")
|
||||
@RequiresAuthentication
|
||||
public class bxyyController {
|
||||
|
||||
|
||||
private static final Log log = Logs.get();
|
||||
@Inject
|
||||
public io.v.nutz.zhgh.jf.service.jfBxYyFjService jfBxYyFjService;
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfBxyyService jfBxyyService;
|
||||
@Inject
|
||||
private FtpService ftpService;
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/jf/bxyy/bxyy.html")
|
||||
@RequiresPermissions("sys.jf.bx.yy")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
public Object data(int pageNumber, int pageSize, String searchName, String searchKeyword) {
|
||||
try {
|
||||
Sql sql = Sqls.create("SELECT\n" +
|
||||
"\tbu.username userName,\n" +
|
||||
"\tch.username chName,\n" +
|
||||
"\tfi.username fiName,\n" +
|
||||
"\tbu.loginname,\n" +
|
||||
"\tbn.`name` unit,\n" +
|
||||
"\tb.* \n" +
|
||||
"FROM\n" +
|
||||
"\tjf_bxyy b\n" +
|
||||
"\tLEFT JOIN sys_user bu ON bu.id = b.booking_person_id\n" +
|
||||
"\tLEFT JOIN sys_user ch ON ch.id = b.chairman_id\n" +
|
||||
"\tLEFT JOIN sys_user fi ON fi.id = b.finance_id\n" +
|
||||
"\tLEFT JOIN sys_unit bn ON bn.id = bu.unitid $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sys_user user = (Sys_user) ShiroUtil.getPrincipal();
|
||||
cnd.and("booking_person_id", "=", user.getId());
|
||||
if (Strings.isNotBlank(searchName) && Strings.isNotBlank(searchKeyword)) {
|
||||
cnd.and(searchName, "like", "%" + searchKeyword + "%");
|
||||
}
|
||||
cnd.desc("booking_time");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = jfBxyyService.listPage(pageNumber, pageSize, sql);
|
||||
NutMap nutMap = new NutMap();
|
||||
nutMap.put("list", pagination);
|
||||
nutMap.put("user", user);
|
||||
return Result.success().addData(nutMap);
|
||||
} catch (Exception e) {
|
||||
log.error(e);
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object add(jf_bxyy jf_bxyy, @Param("files") TempFile[] files) {
|
||||
try {
|
||||
//新增预约报销
|
||||
jf_bxyy.setBooking_time(DateUtil.getDate());
|
||||
jf_bxyy.setAudit_status(1);
|
||||
jf_bxyy.setBooking_person_id(ShiroUtil.getPrincipalProperty("id").toString());
|
||||
|
||||
jf_bxyy insert = jfBxyyService.insert(jf_bxyy);
|
||||
|
||||
for (TempFile file : files) {
|
||||
String rid = R.UU32();
|
||||
String suffixName = file.getSubmittedFileName().substring(file.getSubmittedFileName().lastIndexOf(".")).toLowerCase();
|
||||
String savepath = "jfbxyy";
|
||||
ftpService.upload(savepath, rid + suffixName, file.getInputStream());
|
||||
Sys_file sys_file = new Sys_file();
|
||||
sys_file.setId(R.UU32());
|
||||
sys_file.setReid(insert.getId());
|
||||
sys_file.setFilename(file.getSubmittedFileName());
|
||||
sys_file.setFilepath("/" + savepath + "/" + rid + suffixName);
|
||||
baseService.insert("sys_file", Chain.from(sys_file));
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error().addMsg("提交失败!");
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
public Object editYyBx(jf_bxyy jf_bxyy, @Param("files") TempFile[] files, String[] delFiles) {
|
||||
try {
|
||||
jf_bxyy.setAudit_status(1);
|
||||
jfBxyyService.updateIgnoreNull(jf_bxyy);
|
||||
|
||||
for (TempFile file : files) {
|
||||
String rid = R.UU32();
|
||||
String suffixName = file.getSubmittedFileName().substring(file.getSubmittedFileName().lastIndexOf(".")).toLowerCase();
|
||||
String savepath = "jfbxyy";
|
||||
ftpService.upload(savepath, rid + suffixName, file.getInputStream());
|
||||
Sys_file sys_file = new Sys_file();
|
||||
sys_file.setId(R.UU32());
|
||||
sys_file.setReid(jf_bxyy.getId());
|
||||
sys_file.setFilename(file.getSubmittedFileName());
|
||||
sys_file.setFilepath("/" + savepath + "/" + rid + suffixName);
|
||||
baseService.insert("sys_file", Chain.from(sys_file));
|
||||
}
|
||||
|
||||
for (String s : delFiles) {
|
||||
Sys_file file = baseService.dao().fetch(Sys_file.class, Cnd.where("id", "=", s));
|
||||
ftpService.delete(file.getFilepath());
|
||||
baseService.dao().delete(Sys_file.class, s);
|
||||
}
|
||||
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
@At
|
||||
public Object delYyBx(String id) {
|
||||
try {
|
||||
List<Record> files = baseService.dao().query("sys_file", Cnd.where("reid", "=", id));
|
||||
files.forEach(file -> {
|
||||
ftpService.delete(file.getString("filepath"));
|
||||
baseService.dao().delete(Sys_file.class, file.getString("id"));
|
||||
});
|
||||
jfBxyyService.clear(Cnd.where("id", "=", id));
|
||||
return Result.success().addMsg("成功删除预约报销申请!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error().addMsg("删除失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传附件
|
||||
*
|
||||
* @param map
|
||||
*/
|
||||
@At("/uploadFiles")
|
||||
@AdaptBy(type = UploadAdaptor.class, args = {"ioc:fileUpload"})
|
||||
@Ok("json:full")
|
||||
public Object uploadFiles(Map map) {
|
||||
try {
|
||||
TempFile tempFile = (TempFile) map.get("file");
|
||||
String booking_id = map.get("id").toString();//预约报销id
|
||||
String fileLocalName = ((TempFile) map.get("file")).getMeta().getFileLocalName();//原文件名
|
||||
String fjid = R.UU32();//附件ID
|
||||
String wjkzm = fileLocalName.substring(fileLocalName.lastIndexOf(".")); //文件扩展名
|
||||
String filepath = "upload/yybx/";
|
||||
savePic(tempFile.getInputStream(), fjid + wjkzm, filepath);
|
||||
/*Files.write(new File(filepath),tempFile.getInputStream());*/
|
||||
jfBxYyFjService.insert("jf_bxyy_fj", Chain.make("id", fjid).add("booking_id", booking_id)
|
||||
.add("name", fileLocalName).add("url", filepath + "/" + fjid + wjkzm).add("time", DateUtil.getDate()));
|
||||
//数据库的路径 为 FJID+文件名 防止重复
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
//保存文件
|
||||
private void savePic(InputStream inputStream, String fileName, String path) {
|
||||
|
||||
OutputStream os = null;
|
||||
try {
|
||||
//String path = "D:\\testFile\\";
|
||||
// 2、保存到临时文件
|
||||
// 1K的数据缓冲
|
||||
byte[] bs = new byte[1024];
|
||||
// 读取到的数据长度
|
||||
int len;
|
||||
// 输出的文件流保存到本地文件
|
||||
|
||||
File tempFile = new File(path);
|
||||
if (!tempFile.exists()) {
|
||||
tempFile.mkdirs();
|
||||
}
|
||||
os = new FileOutputStream(tempFile.getPath() + File.separator + fileName);
|
||||
// 开始读取
|
||||
while ((len = inputStream.read(bs)) != -1) {
|
||||
os.write(bs, 0, len);
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
// 完毕,关闭所有链接
|
||||
try {
|
||||
os.close();
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前选择预约单的附件列表
|
||||
@At
|
||||
public Object ViewFjList(String booking_id) {
|
||||
try {
|
||||
return Result.success(baseService.dao().query("sys_file", Cnd.where("reid", "=", booking_id)));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return Result.error("文件列表加载失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除已上传的附件
|
||||
*/
|
||||
@At
|
||||
public Object delFjById(@Param("fjid") String fjid) {
|
||||
try {
|
||||
int num = 0;
|
||||
String[] ids = fjid.split(",");
|
||||
for (int i = 0; i < ids.length; i++) {
|
||||
jf_bxyy_fj jfBxyyFj = jfBxYyFjService.fetch(ids[i]);
|
||||
String url = jfBxyyFj.getUrl(); //附件存放位置
|
||||
File file = new File("");
|
||||
String path = file.getCanonicalPath();
|
||||
File delfile = new File(path + "/" + url);
|
||||
if (delfile.exists() && delfile.isFile()) {
|
||||
if (delfile.delete()) {
|
||||
num++;
|
||||
}
|
||||
}
|
||||
jfBxYyFjService.clear("jf_bxyy_fj", Cnd.where("id", "=", ids[i]));
|
||||
}
|
||||
if (num == ids.length) {
|
||||
return Result.success();
|
||||
} else {
|
||||
return Result.error();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前预约报销的所有附件信息
|
||||
@At
|
||||
public Object viewFjInfoById(String booking_id) {
|
||||
try {
|
||||
return Result.success(baseService.dao().query("sys_file", Cnd.where("reid", "=", booking_id)));
|
||||
} catch (Exception e) {
|
||||
return Result.error("获取附件失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 将图片以文件流的形式在页面显示
|
||||
*/
|
||||
@At
|
||||
@Ok("void")
|
||||
public void showPic(String url, HttpServletResponse response) throws Exception {
|
||||
response.setContentType("image/jpeg");
|
||||
//获取路径
|
||||
File directory = new File("");// 参数为空
|
||||
String courseFile = directory.getCanonicalPath();
|
||||
// 获取图片
|
||||
File file = new File(courseFile + "\\" + url);
|
||||
//创建文件输入流
|
||||
FileInputStream is = new FileInputStream(file);
|
||||
// 响应输出流
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
// 创建缓冲区
|
||||
byte[] buffer = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = is.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, len);
|
||||
}
|
||||
is.close();
|
||||
out.flush();
|
||||
out.close();
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
public void preview(HttpServletRequest request, HttpServletResponse response, @Param("filePath") String filePath) throws IOException {
|
||||
//获取路径
|
||||
File directory = new File("");// 参数为空
|
||||
String courseFile = directory.getCanonicalPath();
|
||||
filePath = courseFile + "\\" + filePath;
|
||||
|
||||
DocConverter doc = new DocConverter(filePath);
|
||||
doc.conver();
|
||||
String newUrl = doc.getswfPath();
|
||||
File file = new File(newUrl);
|
||||
//创建文件输入流
|
||||
FileInputStream is = new FileInputStream(file);
|
||||
// 响应输出流
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
// 创建缓冲区
|
||||
byte[] buffer = new byte[1024];
|
||||
int len = 0;
|
||||
while ((len = is.read(buffer)) != -1) {
|
||||
out.write(buffer, 0, len);
|
||||
}
|
||||
new File(newUrl).delete();
|
||||
is.close();
|
||||
out.flush();
|
||||
out.close();
|
||||
}
|
||||
|
||||
//下载附件
|
||||
@At
|
||||
public void download(String path, String filename, String fname, HttpServletResponse response) {
|
||||
//取得文件
|
||||
try {
|
||||
//获取路径
|
||||
File directory = new File("");// 参数为空
|
||||
String courseFile = directory.getCanonicalPath();
|
||||
File file = new File(courseFile + "\\" + path);
|
||||
if (file.exists()) {
|
||||
response.setHeader("content-disposition", "attachment;filename=" + new String(fname.getBytes("utf-8"), "ISO8859-1"));
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
OutputStream os = response.getOutputStream();
|
||||
int len = -1;
|
||||
byte[] b = new byte[1024 * 100];
|
||||
while ((len = fis.read(b)) != -1) {
|
||||
os.write(b, 0, len);
|
||||
}
|
||||
os.flush();
|
||||
os.close();
|
||||
fis.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,12 +5,15 @@ import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_use;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.service.jfClubService;
|
||||
import io.v.nutz.zhgh.jf.service.jfUseService;
|
||||
import io.v.nutz.zhgh.jf.service.jfYjghService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
@@ -22,6 +25,8 @@ import org.nutz.log.Logs;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2020/11/5 14:28
|
||||
@@ -37,13 +42,13 @@ public class jsTzController {
|
||||
|
||||
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfUseService jfUseService;
|
||||
private jfUseService jfUseService;
|
||||
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfYjghService jfYjghService;
|
||||
private jfYjghService jfYjghService;
|
||||
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfClubService jfClubService;
|
||||
private jfClubService jfClubService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
@@ -52,23 +57,19 @@ public class jsTzController {
|
||||
@At
|
||||
public Object data(int pageNumber, int pageSize, Integer year, String pageOrderName, String pageOrderBy, String adjust_id) {
|
||||
try {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
ju.*,
|
||||
re.userId ,
|
||||
re.activity_number,
|
||||
su.username,
|
||||
YEAR(re.applyTime) `year`,
|
||||
us.unionname
|
||||
FROM
|
||||
`jf_use` ju
|
||||
LEFT JOIN jf_yjgh jf ON ju.adjust_id = jf.id
|
||||
LEFT JOIN sys_user su ON su.id = ju.adjust_person
|
||||
LEFT JOIN reimbursement_new re ON re.id = ju.apply_id
|
||||
LEFT JOIN `user` us ON us.id = re.userId
|
||||
$condition
|
||||
""");
|
||||
Sql sql = Sqls.create("SELECT\n" +
|
||||
"\tju.*,\n" +
|
||||
"\tbx.user_id,\n" +
|
||||
"\tbx.activity_number,\n" +
|
||||
"\tsu.username,\n" +
|
||||
"\tbx.`year`,\n" +
|
||||
"\tus.unionname \n" +
|
||||
"FROM\n" +
|
||||
"\t`jf_use` ju\n" +
|
||||
"\tLEFT JOIN jf_yjgh jf ON ju.adjust_id = jf.id\n" +
|
||||
"\tLEFT JOIN sys_user su ON su.id = ju.adjust_person\n" +
|
||||
"\tLEFT JOIN activity_bx bx ON bx.id = ju.apply_id\n" +
|
||||
"\tLEFT JOIN `user` us ON us.id = bx.user_id $condition");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (Strings.isNotBlank(pageOrderBy) && Strings.isNotBlank(pageOrderName)) {
|
||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
||||
@@ -100,6 +101,7 @@ public class jsTzController {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
public Object delUse(String id, boolean isClub) {
|
||||
try {
|
||||
@@ -125,15 +127,15 @@ public class jsTzController {
|
||||
|
||||
private void flushMoney(String id, boolean isClub) {
|
||||
Sql sql = Sqls.create("SELECT IFNULL(SUM(u.adjust_money),0) money from jf_use u WHERE u.adjust_id = @id").setParam("id", id);
|
||||
Double money = jfUseService.list(sql).get(0).getDouble("money");
|
||||
String money = jfUseService.list(sql).get(0).getString("money");
|
||||
|
||||
if (!isClub) {
|
||||
jf_yjgh yjgh = jfYjghService.fetch(id);
|
||||
yjgh.setUsedQuota(money);
|
||||
yjgh.setUsedQuota(new BigDecimal(money));
|
||||
jfYjghService.update(yjgh);
|
||||
} else {
|
||||
jf_club club = jfClubService.fetch(id);
|
||||
club.setUsed_quota(money);
|
||||
club.setUsedQuota(new BigDecimal(money));
|
||||
jfClubService.update(club);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package io.v.nutz.zhgh.jf.controller.school;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.CostsSet;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.jf.model.jf_school;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
@@ -15,7 +15,10 @@ import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
@@ -43,8 +46,9 @@ public class schoolBudgetController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
@RequiresPermissions("sys.jf.school.schoolBudgetList")
|
||||
public Object pageData(PageForm pageForm, @Param(value = "year",required = false) Integer year) {
|
||||
public Object pageData(PageForm pageForm, Integer year) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT * FROM `jf_school` $condition
|
||||
@@ -55,14 +59,52 @@ public class schoolBudgetController {
|
||||
}
|
||||
|
||||
|
||||
// 重置本年
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.school.schoolBudgetList")
|
||||
public Object doChangeYs(Double totalQuota2, String id) {
|
||||
public Object reset() {
|
||||
baseService.dao().clear(jf_school.class,Cnd.where("year", "=", DateUtil.getYear()));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.school.schoolBudgetList")
|
||||
public Object isSet() {
|
||||
return baseService.dao().count(jf_school.class, Cnd.where("state", "=", 1).and("year", "=", DateUtil.getYear()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
@RequiresPermissions("sys.jf.school.schoolBudgetList")
|
||||
public Object doChangeYs(String totalQuota, String id) {
|
||||
jf_school jf_school = baseService.dao().fetch(jf_school.class, id);
|
||||
jf_school.setTotalQuota(totalQuota2);
|
||||
jf_school.setTotalQuota(new BigDecimal(totalQuota));
|
||||
baseService.updateIgnoreNull(jf_school);
|
||||
baseService.dao().update(CostsSet.class, Chain.make("schoolMoney", totalQuota2), Cnd.where("year", "=", DateUtil.getYear()));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.school.schoolBudgetList")
|
||||
public Object issue() {
|
||||
List<ActivityBudget> budgetList = baseService.dao().query(ActivityBudget.class,
|
||||
Cnd.where("YEAR(applyDate)", "=", DateUtil.getYear())
|
||||
.and("auditState", "=", 4)
|
||||
.and("budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_ONE"));
|
||||
BigDecimal totalBudgetMoney = budgetList.stream()
|
||||
.map(ActivityBudget::getTotalBudgetMoney) // 提取 money 属性
|
||||
.filter(Objects::nonNull) // 过滤掉空值
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
jf_school school = new jf_school();
|
||||
school.setState(1);
|
||||
school.setYear(DateUtil.getYear());
|
||||
school.setTotalQuota(totalBudgetMoney);
|
||||
baseService.insert(school);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,27 @@
|
||||
package io.v.nutz.zhgh.jf.controller.school;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.service.BaseService;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.jf.model.jf_school;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
@@ -39,9 +48,7 @@ public class schoolBudgetUseController {
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.school.schoolBudgetUseList")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "activity_name", required = false) String activity_name) {
|
||||
public Object pageData(PageForm page, Integer year, String activity_name) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -62,4 +69,23 @@ public class schoolBudgetUseController {
|
||||
return baseService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.school.schoolBudgetUseList")
|
||||
public Object findInitData(Integer year, String activity_name) {
|
||||
jf_school school = baseService.dao().fetch(jf_school.class, Cnd.where("year", "=", year));
|
||||
if (StrUtil.isEmpty(activity_name)) {
|
||||
return Map.of("totalMoney", 0, "totalQuota", Lang.isNotEmpty(school) ? school.getTotalQuota() : 0, "usedQuota", Lang.isNotEmpty(school) ? school.getUsedQuota() : 0);
|
||||
}
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("State", "=", ReimbursementState.SUCCESSFUL_REIMBURSEMENT);
|
||||
cnd.where().andLike("activity_name", activity_name);
|
||||
List<ReimbursementNew> newList = baseService.dao().query(ReimbursementNew.class, cnd);
|
||||
BigDecimal totalMoney = newList.stream()
|
||||
.map(ReimbursementNew::getMoney)
|
||||
.filter(Objects::nonNull) // 避免 null 值导致计算错误
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
return Map.of("totalMoney", totalMoney, "totalQuota", school.getTotalQuota(), "usedQuota", school.getUsedQuota());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,31 +1,36 @@
|
||||
package io.v.nutz.zhgh.jf.controller.yjgh;
|
||||
|
||||
import cn.afterturn.easypoi.entity.BaseTypeConstants;
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import cn.wizzer.framework.page.Pagination;
|
||||
import io.v.nutz.base.utils.ExcelUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import io.v.nutz.zhgh.jf.service.jfYjghService;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.log.Log;
|
||||
import org.nutz.log.Logs;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -36,6 +41,7 @@ import java.util.List;
|
||||
@IocBean
|
||||
@At("/platform/jf/yjgh/jfsy")
|
||||
@Ok("json:full")
|
||||
@RequiresAuthentication
|
||||
public class jfsyController {
|
||||
|
||||
|
||||
@@ -43,7 +49,7 @@ public class jfsyController {
|
||||
|
||||
|
||||
@Inject
|
||||
private io.v.nutz.zhgh.jf.service.jfYjghService jfYjghService;
|
||||
private jfYjghService jfYjghService;
|
||||
|
||||
|
||||
@At("")
|
||||
@@ -55,40 +61,35 @@ public class jfsyController {
|
||||
|
||||
@At
|
||||
@RequiresPermissions("sys.jf.gh.tz")
|
||||
public Object data(int pageNumber, int pageSize,
|
||||
@Param(value = "year",required = false) Integer year,
|
||||
@Param(value = "pageOrderName",required = false) String pageOrderName,
|
||||
@Param(value = "pageOrderBy",required = false) String pageOrderBy,
|
||||
@Param(value = "unionId",required = false) String unionId) {
|
||||
public Object data(int pageNumber, int pageSize, Integer year, String pageOrderName, String pageOrderBy, String unionId) {
|
||||
try {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
jf.*,
|
||||
yjgh.id unid,
|
||||
yjgh.unionname,
|
||||
yjgh.unioncode
|
||||
jf.*,
|
||||
un.unioncode,
|
||||
it.unitcode unitCode
|
||||
FROM
|
||||
`sys_union` yjgh
|
||||
LEFT JOIN jf_yjgh jf ON jf.unionId = yjgh.id
|
||||
AND jf.`year` = @year
|
||||
jf_yjgh jf
|
||||
LEFT JOIN sys_union un ON un.id = jf.unionid
|
||||
LEFT JOIN sys_unit it ON it.unitcode = jf.unionid
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (ShiroUtil.hasRole("sysadmin") || ShiroUtil.hasRole("A06")) {
|
||||
cnd.andEX("yjgh.id", "=", unionId);
|
||||
} else if (ShiroUtil.hasRole("H04")) {
|
||||
cnd.andEX("jf.unionId", "=", unionId);
|
||||
} else if (ShiroUtil.hasAnyRoles("gh14,gh01")) {
|
||||
//基层工会管理员
|
||||
cnd.and("yjgh.id", "in", "(SELECT sur.`unionid` FROM sys_user_role AS sur WHERE sur.`userId`= '" + ShiroUtil.getPrincipalProperty("id") + "' AND sur.`roleId`= '" + Roles.UNION_MANGER + "')");
|
||||
cnd.and("jf.unionId", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.and("jf.totalQuota", "IS NOT", null);
|
||||
cnd.and("jf.year", "=", year);
|
||||
if (Strings.isNotBlank(pageOrderBy) && Strings.isNotBlank(pageOrderName)) {
|
||||
cnd.orderBy(pageOrderName, PageUtil.getOrder(pageOrderBy));
|
||||
} else {
|
||||
cnd.asc("yjgh.unionname");
|
||||
cnd.asc("un.unioncode");
|
||||
}
|
||||
sql.setParam("year", year);
|
||||
sql.setCondition(cnd);
|
||||
Pagination listPage = jfYjghService.listPage(pageNumber, pageSize, sql);
|
||||
Pagination listPage = jfYjghService.listPageMap(pageNumber, pageSize, sql);
|
||||
return Result.success().addData(listPage);
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
@@ -111,10 +112,60 @@ public class jfsyController {
|
||||
|
||||
// 导出
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("sys.jf.gh.tz")
|
||||
public void exportExcel(HttpServletResponse response, Integer year) {
|
||||
Sql sql = Sqls.create("SELECT jf.*, yjgh.id unid, yjgh.unionname \n" +
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
jf.*,
|
||||
un.unioncode,
|
||||
it.unitcode unitCode
|
||||
FROM
|
||||
jf_yjgh jf
|
||||
LEFT JOIN sys_union un ON un.id = jf.unionid
|
||||
LEFT JOIN sys_unit it ON it.unitcode = jf.unionid
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (!ShiroUtil.hasRole("sysadmin") || ShiroUtil.hasRole("A06")) {
|
||||
if (ShiroUtil.hasAnyRoles("gh14,gh01")) {
|
||||
//基层工会管理员
|
||||
cnd.and("jf.unionId", "=", Vi.getUnionId());
|
||||
}
|
||||
}
|
||||
cnd.and("jf.totalQuota", "IS NOT", null);
|
||||
cnd.and("jf.year", "=", year);
|
||||
cnd.asc("un.unioncode");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> list = jfYjghService.listMap(sql);
|
||||
list.forEach(l->{
|
||||
l.put("shenyu",l.getDouble("totalQuota")-l.getDouble("usedQuota"));
|
||||
});
|
||||
try {
|
||||
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
exportEntities.add(new ExcelExportEntity("年度", "year", 10));
|
||||
exportEntities.add(new ExcelExportEntity("院级工会名称", "unionName", 20));
|
||||
ExcelExportEntity totalQuota = new ExcelExportEntity("分配总额度(元)", "totalQuota", 20);
|
||||
totalQuota.setType(BaseTypeConstants.DOUBLE_TYPE);
|
||||
exportEntities.add(totalQuota);
|
||||
ExcelExportEntity usedQuota = new ExcelExportEntity("已使用额度(元)", "usedQuota", 20);
|
||||
usedQuota.setType(BaseTypeConstants.DOUBLE_TYPE);
|
||||
exportEntities.add(usedQuota);
|
||||
ExcelExportEntity shenyu = new ExcelExportEntity("剩余额度(元)", "shenyu", 20);
|
||||
shenyu.setType(BaseTypeConstants.DOUBLE_TYPE);
|
||||
exportEntities.add(shenyu);
|
||||
|
||||
response.setContentType("application/octet-stream");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + new String((year+"年院级工会经费使用情况表.xlsx").getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1));
|
||||
ExportParams exportParams = new ExportParams();
|
||||
exportParams.setType(ExcelType.XSSF);
|
||||
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, exportEntities, list);
|
||||
workbook.write(response.getOutputStream());
|
||||
|
||||
}catch (Exception e){
|
||||
|
||||
}
|
||||
/* Sql sql = Sqls.create("SELECT jf.*, yjgh.id unid, yjgh.unionname \n" +
|
||||
"FROM `sys_union` yjgh\n" +
|
||||
"LEFT JOIN jf_yjgh jf \n" +
|
||||
"ON jf.unionId = yjgh.id \n" +
|
||||
@@ -131,6 +182,7 @@ public class jfsyController {
|
||||
sql.setCondition(cnd);
|
||||
List<Record> list = jfYjghService.list(sql);
|
||||
|
||||
|
||||
//excel标题
|
||||
String[] title = {"年度", "院级工会名称", "分配总额度(元)", "已使用额度(元)", "剩余额度(元)"};
|
||||
//excel文件名
|
||||
@@ -139,13 +191,13 @@ public class jfsyController {
|
||||
String sheetName = year + "年院级工会经费使用情况表";
|
||||
String[][] content = new String[list.size()][title.length];
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Double zed = list.get(i).getDouble("totalquota");
|
||||
// int ysyed = Strings.isBlank(list.get(i).getString("usedquota")) ? 0 : Integer.parseInt(list.get(i).getString("usedquota"));
|
||||
Float zed = Strings.isBlank(list.get(i).getString("totalQuota")) ? 0 : Float.parseFloat(list.get(i).getString("totalQuota"));
|
||||
Float ysyed = Strings.isBlank(list.get(i).getString("usedQuota")) ? 0 : Float.parseFloat(list.get(i).getString("usedQuota"));
|
||||
content[i][0] = list.get(i).getString("year");
|
||||
content[i][1] = list.get(i).getString("unionname");
|
||||
content[i][2] = String.valueOf(zed);
|
||||
content[i][3] = String.valueOf(list.get(i).getDouble("usedquota"));
|
||||
content[i][4] = String.valueOf(zed - list.get(i).getDouble("usedquota"));
|
||||
content[i][3] = String.valueOf(ysyed);
|
||||
content[i][4] = String.format("%.2f", zed - ysyed);
|
||||
}
|
||||
HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook(sheetName, title, content, null);
|
||||
try {
|
||||
@@ -157,7 +209,27 @@ public class jfsyController {
|
||||
os.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getJfUnion(Integer year) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
yj.*,
|
||||
un.unioncode,
|
||||
it.unitcode unitCode
|
||||
FROM
|
||||
jf_yjgh yj
|
||||
LEFT JOIN sys_union un ON un.id = yj.unionid
|
||||
LEFT JOIN sys_unit it ON it.unitcode = yj.unionid
|
||||
WHERE yj.year=@year
|
||||
ORDER BY
|
||||
un.unioncode
|
||||
""").setParam("year", year);
|
||||
return jfYjghService.listMap(sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -3,30 +3,32 @@ package io.v.nutz.zhgh.jf.controller.yjgh;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.page.Pagination;
|
||||
import io.v.nutz.base.service.AsyncService;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.zhgh.jf.model.CostsSet;
|
||||
import io.v.nutz.sys.models.Sys_union;
|
||||
import io.v.nutz.sys.models.Sys_unit;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.zhgh.jf.service.CostsSetService;
|
||||
import io.v.nutz.zhgh.jf.service.jfYjghService;
|
||||
import io.v.nutz.base.service.AsyncService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.entity.Record;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -36,8 +38,10 @@ import java.util.List;
|
||||
@IocBean
|
||||
@At("/platform/jf/yjgh/ghys")
|
||||
@Ok("json:full")
|
||||
@RequiresAuthentication
|
||||
public class yjghController {
|
||||
|
||||
|
||||
@Inject
|
||||
private jfYjghService jfYjghService;
|
||||
|
||||
@@ -55,32 +59,13 @@ public class yjghController {
|
||||
public void index() {
|
||||
}
|
||||
|
||||
// 查询是否已经设置了值 设置值时才会向表中添加工会的记录和现在的年
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.gh.fp")
|
||||
public Object isSetUnionAvg() {
|
||||
return jfYjghService.count(Cnd.where("year", "=", DateUtil.getYear()));
|
||||
}
|
||||
|
||||
// 获取最近的一年
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.gh.fp")
|
||||
public Object lastYear() {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
select max(year) year from jf_yjgh where state=1
|
||||
""");
|
||||
return jfYjghService.fetch(sql);
|
||||
}
|
||||
|
||||
// 重置本年
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.gh.fp")
|
||||
public Object reset() {
|
||||
return jfYjghService.update(Chain.make("state", 0), Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
jfYjghService.clear(Cnd.where("year", "=", DateUtil.getYear()));
|
||||
return null;
|
||||
}
|
||||
|
||||
//查询是否已下发
|
||||
@@ -96,63 +81,42 @@ public class yjghController {
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.gh.fp")
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
public Object issue() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
jf.unionId,
|
||||
(
|
||||
SELECT
|
||||
COUNT( 1 )
|
||||
FROM
|
||||
sys_user u
|
||||
LEFT JOIN sys_unit unit ON u.unitid = unit.id
|
||||
LEFT JOIN sys_union hu ON hu.id = unit.unionid
|
||||
WHERE
|
||||
u.member = '1'
|
||||
AND hu.id = un.id
|
||||
) hyzs
|
||||
FROM
|
||||
sys_union un
|
||||
LEFT JOIN jf_yjgh jf ON jf.unionId = un.id
|
||||
AND jf.`year` = @year
|
||||
""");
|
||||
List<Sys_union> unionList = baseService.dao().query(Sys_union.class, Cnd.NEW());
|
||||
List<ActivityBudget> budgetList = baseService.dao().query(ActivityBudget.class,
|
||||
Cnd.where("YEAR(applyDate)", "=", DateUtil.getYear())
|
||||
.and("auditState", "=", 4)
|
||||
.and("isSchoolBudget", "=", false)
|
||||
.and("budgetTypeCode", "=", "ACTIVITY_BUDGET_TYPE_TWO"));
|
||||
|
||||
sql.setParam("year", DateUtil.getYear());
|
||||
// 经费设置
|
||||
CostsSet costsSet = costsSetService.fetch(Cnd.where("year", "=", DateUtil.getYear()));
|
||||
List<Record> list = jfYjghService.list(sql);
|
||||
|
||||
asyncService.exe2(list, record -> {
|
||||
String unionid = (String) record.get("unionid");
|
||||
Double union_avg = costsSet.getUnion_avg();
|
||||
int hyzs = record.getInt("hyzs");
|
||||
jfYjghService.update(Chain.make("totalquota", union_avg * hyzs).add("state", 1).add("history_member", hyzs).add("history_union_avg", union_avg), Cnd.where("year", "=", DateUtil.getYear()).and("state", "<", 1).and("unionid", "=", unionid));
|
||||
List<jf_yjgh> yjghList = new ArrayList<>();
|
||||
unionList.forEach(v -> {
|
||||
BigDecimal totalBudgetMoney = budgetList.stream()
|
||||
.filter(budget -> budget.getUnionId().equals(v.getId()))
|
||||
.map(ActivityBudget::getTotalBudgetMoney) // 提取 money 属性
|
||||
.filter(Objects::nonNull) // 过滤掉空值
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
jf_yjgh yjgh = new jf_yjgh();
|
||||
yjgh.setUnionId(v.getId());
|
||||
yjgh.setUnionName(v.getUnionname());
|
||||
yjgh.setYear(DateUtil.getYear());
|
||||
yjgh.setTotalQuota(totalBudgetMoney);
|
||||
yjgh.setState(1);
|
||||
yjghList.add(yjgh);
|
||||
});
|
||||
|
||||
baseService.insert(yjghList);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.gh.fp")
|
||||
public Object changeYs(@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "project", required = false) String project,
|
||||
@Param(value = "year", required = false) Integer year, Double totalQuota) {
|
||||
public Object changeYs(@Valid String unionId, Integer year, String totalQuota) {
|
||||
try {
|
||||
totalQuota = totalQuota == null ? 0 : totalQuota;
|
||||
jf_yjgh ghys = jfYjghService.fetch(Cnd.where("unionId", "=", unionId).and("year", "=", year));
|
||||
if (ghys != null) {
|
||||
ghys.setTotalQuota(totalQuota);
|
||||
jfYjghService.updateIgnoreNull(ghys);
|
||||
} else {
|
||||
ghys = new jf_yjgh();
|
||||
ghys.setUnionId(unionId);
|
||||
ghys.setYear(year);
|
||||
ghys.setTotalQuota(totalQuota);
|
||||
jfYjghService.insert(ghys);
|
||||
}
|
||||
ghys.setTotalQuota(new BigDecimal(totalQuota));
|
||||
ghys.setState(1);
|
||||
jfYjghService.updateIgnoreNull(ghys);
|
||||
return Result.success();
|
||||
} catch (Exception e) {
|
||||
return Result.error();
|
||||
@@ -163,32 +127,35 @@ public class yjghController {
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("sys.jf.gh.fp")
|
||||
public Object pageData(@Param(value = "pageNumber", required = false) Integer pageNumber,
|
||||
@Param(value = "pageSize", required = false) Integer pageSize,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "union_id", required = false) String union_id) {
|
||||
public Object pageData(Integer pageNumber, Integer pageSize, Integer year, String union_id) {
|
||||
Sql sql = Sqls.create(
|
||||
"""
|
||||
SELECT
|
||||
jf.*,
|
||||
un.id unid,
|
||||
un.unionname,
|
||||
un.unioncode
|
||||
FROM
|
||||
sys_union un
|
||||
LEFT JOIN jf_yjgh jf ON jf.unionId = un.id
|
||||
$condition
|
||||
"""
|
||||
SELECT
|
||||
jf.*,
|
||||
un.unioncode,
|
||||
it.unitcode unitCode
|
||||
FROM
|
||||
jf_yjgh jf
|
||||
LEFT JOIN sys_union un ON un.id = jf.unionid
|
||||
LEFT JOIN sys_unit it ON it.unitcode = jf.unionid
|
||||
$condition
|
||||
"""
|
||||
);
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (Strings.isNotBlank(union_id)) {
|
||||
cnd.and("jf.unionId", "=", union_id);
|
||||
}
|
||||
if (!ShiroUtil.hasRole("sysadmin")) {
|
||||
/*String unionId = Vi.getUnionId();
|
||||
if (StrUtil.isNotBlank(unionId)) {
|
||||
cnd.and("jf.unionId", "=", unionId);
|
||||
}*/
|
||||
}
|
||||
cnd.and("jf.year", "=", year);
|
||||
cnd.and("jf.state", "=", 1);
|
||||
cnd.asc("un.unioncode");
|
||||
sql.setCondition(cnd);
|
||||
Pagination pagination = baseService.listPage(pageNumber, pageSize, sql);
|
||||
Pagination pagination = baseService.listPageMap(pageNumber, pageSize, sql);
|
||||
return pagination;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ package io.v.nutz.zhgh.jf.model;
|
||||
import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.integration.json4excel.annotation.J4EIgnore;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
|
||||
@@ -5,11 +5,12 @@ import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
* @create: 2020-08-18 15:01
|
||||
* @description: 协会预算管理
|
||||
* @description: 社团预算管理
|
||||
**/
|
||||
@Table("jf_club")
|
||||
@Data
|
||||
@@ -26,7 +27,7 @@ public class jf_club implements Serializable {
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("协会ID")
|
||||
@Comment("社团ID")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String club_id;
|
||||
|
||||
@@ -36,30 +37,29 @@ public class jf_club implements Serializable {
|
||||
@ColDefine(type = ColType.INT, width = 4)
|
||||
private Integer year;
|
||||
|
||||
@Column
|
||||
@Comment("协会活动费")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer club_activity_cost;
|
||||
|
||||
@Column
|
||||
@Comment("六必访经费")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer lbf_cost;
|
||||
|
||||
@Excel(name = "总额度")
|
||||
@Column
|
||||
@Comment("总额度")
|
||||
@ColDefine(type = ColType.FLOAT)
|
||||
private Double total_quota;
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal totalQuota;
|
||||
|
||||
@Column
|
||||
@Comment("状态(>=1代表今年已经设置过,<1代表今年未设置,默认值是0)")
|
||||
@Default("0")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer state;
|
||||
|
||||
@Column
|
||||
@Comment("已使用额度")
|
||||
@Default("0")
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal usedQuota;
|
||||
|
||||
@Excel(name = "协会人数")
|
||||
@Column
|
||||
@Comment("历史会员人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer history_member;
|
||||
|
||||
@Excel(name = "标准")
|
||||
@Column
|
||||
@Comment("历史人均额度")
|
||||
@ColDefine(type = ColType.FLOAT)
|
||||
@@ -71,27 +71,10 @@ public class jf_club implements Serializable {
|
||||
private Integer history_y_giveMoney_member;
|
||||
|
||||
@Column
|
||||
@Excel(name = "历史未拨付人数")
|
||||
@Comment("历史未拨付人数")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer history_w_giveMoney_member;
|
||||
|
||||
@Excel(name = "协会名称")
|
||||
@Column
|
||||
@Comment("历史协会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String history_clubname;
|
||||
|
||||
@Column
|
||||
@Comment("状态(>=1代表今年已经设置过,<1代表今年未设置,默认值是0)")
|
||||
@Default("0")
|
||||
@ColDefine(type = ColType.INT)
|
||||
private Integer state;
|
||||
|
||||
@Column
|
||||
@Comment("已使用额度")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2,notNull = true)
|
||||
private Double used_quota;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* TODO
|
||||
*
|
||||
@@ -33,14 +35,16 @@ public class jf_school {
|
||||
@Excel(name = "总额度")
|
||||
@Column
|
||||
@Comment("总额度")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
|
||||
private Double totalQuota;
|
||||
@Default("0")
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal totalQuota;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("已使用额度")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2, notNull = true)
|
||||
private Double usedQuota;
|
||||
@Default("0")
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal usedQuota;
|
||||
|
||||
|
||||
@Column
|
||||
@@ -50,4 +54,5 @@ public class jf_school {
|
||||
private Integer state;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
@@ -34,15 +35,15 @@ public class jf_use implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 255)
|
||||
private String project;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("调整金额")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
|
||||
private Double adjust_money;
|
||||
@Default("0")
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal adjust_money;
|
||||
|
||||
@Column
|
||||
@Comment("调整事由")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 500)
|
||||
@ColDefine(type = ColType.VARCHAR, width = 2000)
|
||||
private String adjust_reason;
|
||||
|
||||
@Column
|
||||
@@ -69,10 +70,4 @@ public class jf_use implements Serializable {
|
||||
private String activitie_time;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("月份")
|
||||
@ColDefine(type = ColType.INT, width = 2)
|
||||
private Integer month;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
import org.nutz.dao.entity.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author: Aaron
|
||||
@@ -30,6 +31,11 @@ public class jf_yjgh implements Serializable {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionId;
|
||||
|
||||
@Column
|
||||
@Comment("院级工会名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionName;
|
||||
|
||||
|
||||
@Excel(name = "年度")
|
||||
@Column
|
||||
@@ -53,12 +59,14 @@ public class jf_yjgh implements Serializable {
|
||||
@Excel(name = "总额度")
|
||||
@Column
|
||||
@Comment("总额度")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
|
||||
private Double totalQuota;
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
@Default("0")
|
||||
private BigDecimal totalQuota;
|
||||
@Column
|
||||
@Comment("已使用额度")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2, notNull = true)
|
||||
private Double usedQuota;
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
@Default("0")
|
||||
private BigDecimal usedQuota;
|
||||
@Column
|
||||
@Comment("状态(>=1代表今年已经设置过,<1代表今年未设置,默认值是0)")
|
||||
@Default("0")
|
||||
@@ -72,8 +80,8 @@ public class jf_yjgh implements Serializable {
|
||||
@Excel(name = "标准")
|
||||
@Column
|
||||
@Comment("历史人均额度")
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
|
||||
private Double history_union_avg;
|
||||
@ColDefine(type = ColType.FLOAT)
|
||||
private Float history_union_avg;
|
||||
@Excel(name = "院级工会名称")
|
||||
@Column
|
||||
@Comment("历史院级工会名称")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package io.v.nutz.zhgh.jf.service.impl;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.wizzer.framework.base.service.BaseServiceImpl;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_use;
|
||||
@@ -31,11 +32,11 @@ public class jfUseServiceImpl extends BaseServiceImpl<jf_use> implements jfUseSe
|
||||
|
||||
if (isClub) {
|
||||
jf_club jf_club = jfClubService.fetch(jf_use.getAdjust_id()); //根据调整经费id查询
|
||||
jf_club.setUsed_quota(jf_club.getUsed_quota() + jf_use.getAdjust_money());
|
||||
jf_club.setUsedQuota(NumberUtil.add(jf_club.getUsedQuota(), jf_use.getAdjust_money()));
|
||||
update(jf_club);
|
||||
} else {
|
||||
jf_yjgh jf_yjgh = jfYjghService.fetch(jf_use.getAdjust_id());
|
||||
jf_yjgh.setUsedQuota(jf_yjgh.getUsedQuota() + jf_use.getAdjust_money());
|
||||
jf_yjgh.setUsedQuota(NumberUtil.add(jf_yjgh.getUsedQuota(), jf_use.getAdjust_money()));
|
||||
update(jf_yjgh);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,10 @@ package io.v.nutz.zhgh.reimbursement.constants;
|
||||
public interface ReimbursementState {
|
||||
|
||||
|
||||
/**
|
||||
* 待申请人提交
|
||||
*/
|
||||
Integer STAY_SUBMIT = 3030;
|
||||
/**
|
||||
* 待申请人修改
|
||||
*/
|
||||
@@ -23,6 +27,21 @@ public interface ReimbursementState {
|
||||
*/
|
||||
Integer SIGNATURE = 3045;
|
||||
|
||||
/**
|
||||
* 待协会审核
|
||||
*/
|
||||
Integer CLUB = 3046;
|
||||
|
||||
/**
|
||||
* 协会不通过
|
||||
*/
|
||||
Integer CLUB_FAIL = 3047;
|
||||
|
||||
/**
|
||||
* 协会退回
|
||||
*/
|
||||
Integer CLUB_GO_BACK = 3048;
|
||||
|
||||
/**
|
||||
* 待分工会审核
|
||||
*/
|
||||
@@ -32,47 +51,71 @@ public interface ReimbursementState {
|
||||
* 分工会审核不通过
|
||||
*/
|
||||
Integer UNION_FAIL = 3055;
|
||||
/**
|
||||
* 单位书记
|
||||
*/
|
||||
Integer UNIT_SECRETARY = 3060;
|
||||
|
||||
|
||||
/**
|
||||
* 单位书记审核不通过
|
||||
* 分工会审核退回
|
||||
*/
|
||||
Integer UNIT_SECRETARY_FAIL = 3065;
|
||||
|
||||
Integer UNION_GO_BACK = 3056;
|
||||
|
||||
/**
|
||||
* 待财务审核
|
||||
* 工会办公室主管
|
||||
*/
|
||||
Integer FINANCE = 3070;
|
||||
Integer UNION_MANAGE = 3060;
|
||||
|
||||
/**
|
||||
* 财务审核不通过
|
||||
* 工会办公室主管审核不通过
|
||||
*/
|
||||
Integer FINANCE_FAIL = 3075;
|
||||
Integer UNION_MANAGE_FAIL = 3065;
|
||||
|
||||
/**
|
||||
* 待分管副主席审核
|
||||
* 工会办公室主管退回
|
||||
*/
|
||||
Integer VICE_CHAIRMAN = 3080;
|
||||
Integer UNION_MANAGE_GO_BACK = 3066;
|
||||
|
||||
/**
|
||||
* 分管副主席审核不通过
|
||||
* 待工会副主席
|
||||
*/
|
||||
Integer VICE_CHAIRMAN_FAIL = 3085;
|
||||
Integer VICE_CHAIRMAN = 3070;
|
||||
|
||||
/**
|
||||
* 待常务副主席审核
|
||||
* 工会副主席审核不通过
|
||||
*/
|
||||
Integer STANDING_VICE_CHAIRMAN = 3090;
|
||||
Integer VICE_CHAIRMAN_FAIL = 3075;
|
||||
|
||||
/**
|
||||
* 常务副主席审核不通过
|
||||
* 工会副主席审核退回
|
||||
*/
|
||||
Integer STANDING_VICE_CHAIRMAN_FAIL = 3095;
|
||||
Integer VICE_CHAIRMAN_GO_BACK = 3076;
|
||||
|
||||
/**
|
||||
* 待校工会主席
|
||||
*/
|
||||
Integer STANDING_VICE_CHAIRMAN = 3080;
|
||||
|
||||
/**
|
||||
* 校工会主席退回不通过
|
||||
*/
|
||||
Integer STANDING_VICE_CHAIRMAN_FAIL = 3085;
|
||||
|
||||
/**
|
||||
* 校工会主席退回
|
||||
*/
|
||||
Integer STANDING_VICE_CHAIRMAN_GO_BACK = 3086;
|
||||
|
||||
/**
|
||||
* 待会计审核
|
||||
*/
|
||||
Integer FINANCE = 3090;
|
||||
|
||||
/**
|
||||
* 待会计审核
|
||||
*/
|
||||
Integer FINANCE_FAIL = 3095;
|
||||
|
||||
/**
|
||||
* 出会计核不通过
|
||||
*/
|
||||
Integer FINANCE_GO_BACK = 3096;
|
||||
|
||||
/**
|
||||
* 报销成功
|
||||
|
||||
@@ -1,207 +0,0 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.zhgh.jf.model.*;
|
||||
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
import org.nutz.trans.Trans;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/10/15 10:47
|
||||
* @description
|
||||
*/
|
||||
@At("/reimbursement/audit/confirm")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class AuditConfirmController {
|
||||
|
||||
|
||||
@Inject("ReimbursementNew")
|
||||
private ViService<ReimbursementNew> reimbursementNewViService;
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/AuditConfirm.html")
|
||||
@RequiresPermissions("reimbursement.audit.confirm")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.audit.confirm")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "isAudit", required = false) Boolean isAudit,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "reiItemId", required = false) String reiItemId) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("YEAR ( rei.applyTime )", "=", year);
|
||||
cnd.andEX("rei.unitId", "=", unitId);
|
||||
cnd.andEX("rei.unionId", "=", unionId);
|
||||
if (Strings.isNotBlank(reiItemId) && reiItemId.equals("ww")) {
|
||||
cnd.and("rei.reimbursementItemId", "in", "'fyww','zfww'");
|
||||
} else {
|
||||
cnd.andEX("rei.reimbursementItemId", "=", reiItemId);
|
||||
}
|
||||
if (isAudit != null) {
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.AUDIT_CONFIRM);
|
||||
}
|
||||
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementNewViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.audit.confirm")
|
||||
@SLog(tag = "工会报销", msg = "审核了一条记录", param = true, result = true)
|
||||
public Object doSubmit(String id, int flag, Audit audit) {
|
||||
ReimbursementNew reimbursementNew = reimbursementNewViService.fetch(id);
|
||||
audit.setAuditor(io.v.nutz.web.commons.utils.ShiroUtil.getPrincipalProperty("id").toString());
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit = reimbursementNewViService.insert(audit);
|
||||
String content = flag == 3 ? "您的报销已审核完毕,请前往智慧工会工会报销系统中的我的报销导出" : flag == 2 ? ("您的报销已被退回," + audit.getAuditOpinion() + "请前往智慧工会查看") : ("您的报销已被拒绝," + audit.getAuditOpinion() + "请前往智慧工会查看");
|
||||
Audit finalAudit = audit;
|
||||
Trans.exec(() -> {
|
||||
reimbursementNewViService.update(Chain.make("State", flag == 3 ? ReimbursementState.SUCCESSFUL_REIMBURSEMENT : flag == 2 ? ReimbursementState.MODIFY : ReimbursementState.FINANCE_FAIL).add("accountingAuditId", finalAudit.getId()), Cnd.where("id", "=", id));
|
||||
if (flag == 3) {
|
||||
if (reimbursementNew.getJf_source().equals("1")) {
|
||||
jf_school jfSchool = reimbursementNewViService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
SchoolUse schoolUse = new SchoolUse();
|
||||
schoolUse.setReimbursementId(reimbursementNew.getId());
|
||||
reimbursementNewViService.insert(schoolUse);
|
||||
//往预算分配表减钱
|
||||
jfSchool.setUsedQuota(jfSchool.getUsedQuota() + reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(jfSchool);
|
||||
} else if (reimbursementNew.getJf_source().equals("2")) {
|
||||
jf_yjgh yjgh = reimbursementNewViService.dao().fetch(jf_yjgh.class, Cnd.where("unionId", "=", reimbursementNew.getUnionId()).and("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
//往经费使用表中添加一条数据
|
||||
jf_use jf_use = new jf_use();
|
||||
jf_use.setAdjust_id(yjgh.getId());
|
||||
jf_use.setProject(reimbursementNew.getReimbursementItemName());
|
||||
jf_use.setAdjust_money(reimbursementNew.getMoney());
|
||||
jf_use.setAdjust_reason(reimbursementNew.getCause());
|
||||
jf_use.setAdjust_time(DateUtil.getDateTime());
|
||||
jf_use.setAdjust_person(ShiroUtil.getUserId());
|
||||
jf_use.setApply_id(reimbursementNew.getId());
|
||||
jf_use.setActivitie_number(reimbursementNew.getActivity_number());
|
||||
jf_use.setActivitie_time(Strings.isNotBlank(reimbursementNew.getActivity_time()) ? reimbursementNew.getActivity_time() : reimbursementNew.getOccur_time());
|
||||
reimbursementNewViService.insert(jf_use);
|
||||
//往预算分配表减钱
|
||||
yjgh.setUsedQuota((yjgh.getUsedQuota() != null ? yjgh.getUsedQuota() : 0) + reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(yjgh);
|
||||
} else {
|
||||
Sys_club_user clubUser = reimbursementNewViService.dao().fetch(Sys_club_user.class, Cnd.where("userid", "=", reimbursementNew.getUserId()));
|
||||
|
||||
jf_club jf_club = reimbursementNewViService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1).and("club_id", "=", clubUser.getClubid()));
|
||||
//往经费使用表中添加一条数据
|
||||
jf_use jf_use = new jf_use();
|
||||
jf_use.setAdjust_id(jf_club.getId());
|
||||
jf_use.setProject(reimbursementNew.getReimbursementItemName());
|
||||
jf_use.setAdjust_money(reimbursementNew.getMoney());
|
||||
jf_use.setAdjust_reason(reimbursementNew.getCause());
|
||||
jf_use.setAdjust_time(DateUtil.getDateTime());
|
||||
jf_use.setAdjust_person(ShiroUtil.getUserId());
|
||||
jf_use.setApply_id(reimbursementNew.getId());
|
||||
jf_use.setActivitie_number(reimbursementNew.getActivity_number());
|
||||
jf_use.setActivitie_time(Strings.isNotBlank(reimbursementNew.getActivity_time()) ? reimbursementNew.getActivity_time() : reimbursementNew.getOccur_time());
|
||||
reimbursementNewViService.insert(jf_use);
|
||||
//往预算分配表减钱
|
||||
jf_club.setUsed_quota(jf_club.getUsed_quota() + reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(jf_club);
|
||||
}
|
||||
}
|
||||
|
||||
//msgApi.sendWxMsg(content, reimbursementNew.getLoginName());
|
||||
});
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.audit.confirm")
|
||||
@SLog(tag = "工会报销", msg = "撤回了一条记录", param = true, result = true)
|
||||
public Object doRecall(String id) {
|
||||
Trans.exec(() -> {
|
||||
ReimbursementNew reimbursementNew = reimbursementNewViService.fetch(id);
|
||||
reimbursementNew.setState(ReimbursementState.AUDIT_CONFIRM);
|
||||
reimbursementNew.setAccountingAuditId(null);
|
||||
reimbursementNewViService.update(reimbursementNew);
|
||||
|
||||
if (reimbursementNew.getJf_source().equals("1")) {
|
||||
jf_school jfSchool = reimbursementNewViService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
jfSchool.setUsedQuota((jfSchool.getUsedQuota() != null ? jfSchool.getUsedQuota() : 0) - reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(jfSchool);
|
||||
reimbursementNewViService.dao().clear(SchoolUse.class, Cnd.where("reimbursementId", "=", reimbursementNew.getId()));
|
||||
|
||||
} else if (reimbursementNew.getJf_source().equals("2")) {
|
||||
jf_yjgh yjgh = reimbursementNewViService.dao().fetch(jf_yjgh.class, Cnd.where("unionId", "=", reimbursementNew.getUnionId()).and("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
yjgh.setUsedQuota(yjgh.getUsedQuota() - reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(yjgh);
|
||||
reimbursementNewViService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", reimbursementNew.getId()));
|
||||
|
||||
} else {
|
||||
Sys_club_user clubUser = reimbursementNewViService.dao().fetch(Sys_club_user.class, Cnd.where("userid", "=", reimbursementNew.getUserId()));
|
||||
|
||||
jf_club jf_club = reimbursementNewViService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1).and("club_id", "=", clubUser.getClubid()));
|
||||
jf_club.setUsed_quota(jf_club.getUsed_quota() - reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(jf_club);
|
||||
reimbursementNewViService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", reimbursementNew.getId()));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,160 +0,0 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Review;
|
||||
import io.v.nutz.base.service.ReviewService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.service.AuditService;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@At("/platform/reimbursement/dma")
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
public class DmaController {
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/dma.html")
|
||||
@RequiresPermissions("rei.dma")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("rei.dma")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "isAudit", required = false) boolean isAudit,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "reiItemId", required = false) Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
us.unioncode,
|
||||
us.unitcode,
|
||||
state.stateId,
|
||||
state.stateColor,
|
||||
state.stateName,
|
||||
con_user.username be_username,
|
||||
bx.activity_name
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON rei.reimbursementId = bx.id
|
||||
LEFT JOIN `user` con_user ON con_user.id=con.be_user
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.UNION);
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
Vi.cndPlus(cnd, "us.unionid", "=", unionId);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("us.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("rei.dma")
|
||||
public Object doReview(String id, Boolean flag, double money, Audit audit, Review review, Integer reimbursementItemId) {
|
||||
double Amount = 2000;
|
||||
Reimbursement reimbursementId = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
|
||||
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setUnion_audit_id(audit.getId());
|
||||
if (money >= Amount) {
|
||||
aid.setState_id(flag ? "3060" : "3055");
|
||||
} else {
|
||||
aid.setState_id(flag ? "3070" : "3055");
|
||||
}
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
|
||||
} else {
|
||||
|
||||
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
review.setTime(DateUtil.getDate());
|
||||
review = reviewService.insert(review);
|
||||
Condolence condolence = condolenceService.fetch(id);
|
||||
condolence.setUnion_chairman_review(review.getId());
|
||||
|
||||
if (money >= Amount) {
|
||||
condolence.setState_id(flag ? "3060" : "3055");
|
||||
} else {
|
||||
condolence.setState_id(flag ? "3070" : "3055");
|
||||
}
|
||||
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
|
||||
}
|
||||
|
||||
if (money >= Amount) {
|
||||
reimbursementId.setState(flag ? ReimbursementState.UNIT_SECRETARY : ReimbursementState.UNION_FAIL);
|
||||
} else {
|
||||
reimbursementId.setState(flag ? ReimbursementState.FINANCE : ReimbursementState.UNION_FAIL);
|
||||
}
|
||||
reimbursementViService.updateIgnoreNull(reimbursementId);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,348 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.sys.models.Sys_dict;
|
||||
import io.v.nutz.sys.services.SysDictService;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.jf.model.*;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.handler.ReimbursementToDoHandler;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementPageForm;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 14:23
|
||||
* @description 校工会会计审核
|
||||
*/
|
||||
|
||||
@At("/platform/reimbursement/financeAudit")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class FinanceAuditController {
|
||||
|
||||
@Inject
|
||||
private ReimbursementService reimbursementViService;
|
||||
@Inject
|
||||
private SysDictService sysDictService;
|
||||
|
||||
@Inject
|
||||
private SysLocalProcessService localProcessService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/financeAudit.html")
|
||||
@RequiresPermissions("reimbursement.financeAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.financeAudit")
|
||||
public Object pageData(ReimbursementPageForm page) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
cl.`name` clubName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.andEX("rei.unionId", "=", page.getUnionId());
|
||||
cnd.andEX("rei.unitId", "=", page.getUnitId());
|
||||
cnd.andEX("rei.clubId", "=", page.getClubId());
|
||||
cnd.andEX("rei.jf_source", "=", page.getJf_source());
|
||||
cnd.andEX("rei.detailsTypeId", "=", page.getDetailsTypeId());
|
||||
|
||||
if (page.getIsAudit() != 1) {
|
||||
cnd.and("rei.State", page.getIsAudit() == 2 ? ">" : "=", ReimbursementState.FINANCE);
|
||||
} else {
|
||||
cnd.and("rei.State", ">=", ReimbursementState.FINANCE);
|
||||
}
|
||||
if (StrUtil.isAllNotEmpty(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
cnd.andEX("YEAR(rei.applyTime)", "=", page.getYear());
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "工会报销", msg = "审核了一条记录", param = true, result = true)
|
||||
@RequiresPermissions("reimbursement.financeAudit")
|
||||
public Object doAudit(@Param("id") String id,
|
||||
@Param("flag") Integer flag,
|
||||
Audit audit,
|
||||
String detailsTypeId) {
|
||||
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditTime(new Date());
|
||||
reimbursementViService.insert(audit);
|
||||
|
||||
ReimbursementNew reimbursementNew = reimbursementViService.fetch(id);
|
||||
ReimbursementToDoHandler.COMPLETE_FINANCE_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
Integer auditState;
|
||||
if (flag == 1) {
|
||||
auditState = ReimbursementState.FINANCE_FAIL;
|
||||
ReimbursementToDoHandler.COMPLETE_PROCESS.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else if (flag == 2) {
|
||||
auditState = ReimbursementState.FINANCE_GO_BACK;
|
||||
//返回修改
|
||||
ReimbursementToDoHandler.CREATE_BACK_FINANCE_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else {
|
||||
auditState = ReimbursementState.SUCCESSFUL_REIMBURSEMENT;
|
||||
ReimbursementToDoHandler.COMPLETE_PROCESS.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
}
|
||||
Chain chain = Chain.make("financeAuditId", audit.getId())
|
||||
.add("state", auditState).add("detailsTypeId", detailsTypeId);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
|
||||
|
||||
|
||||
|
||||
if (flag == 3){
|
||||
// 更新校工会经费表
|
||||
if (reimbursementNew.getJf_source().equals("ACTIVITY_BUDGET_TYPE_ONE")) {
|
||||
jf_school school = reimbursementViService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isEmpty(school)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
school.setUsedQuota(school.getUsedQuota().add(reimbursementNew.getMoney()));
|
||||
reimbursementViService.updateIgnoreNull(school);
|
||||
SchoolUse schoolUse = new SchoolUse();
|
||||
schoolUse.setReimbursementId(reimbursementNew.getId());
|
||||
reimbursementViService.insert(schoolUse);
|
||||
} else if (reimbursementNew.getJf_source().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
//如果分工会报销了校工会的余额
|
||||
ActivityBudget budget = reimbursementViService.dao().fetch(ActivityBudget.class, Cnd.where("id", "=", reimbursementNew.getActivityId()));
|
||||
if (ObjectUtil.isNotEmpty(budget) && budget.getIsSchoolBudget()){
|
||||
jf_school school = reimbursementViService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isEmpty(school)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
school.setUsedQuota(school.getUsedQuota().add(reimbursementNew.getMoney()));
|
||||
reimbursementViService.updateIgnoreNull(school);
|
||||
SchoolUse schoolUse = new SchoolUse();
|
||||
schoolUse.setReimbursementId(reimbursementNew.getId());
|
||||
reimbursementViService.insert(schoolUse);
|
||||
}else{
|
||||
// 更新分工会活动经费表
|
||||
jf_yjgh jfYjgh = reimbursementViService.dao().fetch(jf_yjgh.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("unionId", "=", reimbursementNew.getUnionId()));
|
||||
|
||||
if (ObjectUtil.isEmpty(jfYjgh)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
if (jfYjgh.getTotalQuota().subtract(jfYjgh.getUsedQuota()).compareTo(reimbursementNew.getMoney()) < 0) {
|
||||
return Result.error("剩余配额不足!剩余:" + jfYjgh.getTotalQuota().subtract(jfYjgh.getUsedQuota()));
|
||||
}
|
||||
BigDecimal decimal = jfYjgh.getUsedQuota().add(reimbursementNew.getMoney());
|
||||
jfYjgh.setUsedQuota(decimal);
|
||||
reimbursementViService.updateIgnoreNull(jfYjgh);
|
||||
jf_use jfUse = new jf_use();
|
||||
jfUse.setAdjust_id(jfYjgh.getId());
|
||||
jfUse.setProject(reimbursementNew.getActivity_name());
|
||||
jfUse.setAdjust_money(reimbursementNew.getMoney());
|
||||
jfUse.setAdjust_reason(reimbursementNew.getCause());
|
||||
jfUse.setAdjust_time(DateUtil.getDateTime());
|
||||
jfUse.setAdjust_person(ShiroUtil.getUserId());
|
||||
jfUse.setActivitie_number(reimbursementNew.getActivity_number());
|
||||
jfUse.setActivitie_time(reimbursementNew.getActivity_time());
|
||||
jfUse.setApply_id(reimbursementNew.getId());
|
||||
reimbursementViService.insert(jfUse);
|
||||
}
|
||||
|
||||
} else if (reimbursementNew.getJf_source().equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
// 更新社团经费表
|
||||
jf_club jfClub = reimbursementViService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("club_id", "=", reimbursementNew.getClubId()));
|
||||
if (ObjectUtil.isEmpty(jfClub)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
if (jfClub.getTotalQuota().subtract(jfClub.getUsedQuota()).compareTo(reimbursementNew.getMoney()) < 0) {
|
||||
return Result.error("剩余配额不足!剩余:" + jfClub.getTotalQuota().subtract(jfClub.getUsedQuota()));
|
||||
}
|
||||
jfClub.setUsedQuota(jfClub.getUsedQuota().add(reimbursementNew.getMoney()));
|
||||
reimbursementViService.updateIgnoreNull(jfClub);
|
||||
jf_use jfUse = new jf_use();
|
||||
jfUse.setAdjust_id(jfClub.getId());
|
||||
jfUse.setProject(reimbursementNew.getActivity_name());
|
||||
jfUse.setAdjust_money(reimbursementNew.getMoney());
|
||||
jfUse.setAdjust_reason(reimbursementNew.getCause());
|
||||
jfUse.setAdjust_time(DateUtil.getDateTime());
|
||||
jfUse.setAdjust_person(ShiroUtil.getUserId());
|
||||
jfUse.setActivitie_number(reimbursementNew.getActivity_number());
|
||||
jfUse.setActivitie_time(reimbursementNew.getActivity_time());
|
||||
jfUse.setApply_id(reimbursementNew.getId());
|
||||
reimbursementViService.insert(jfUse);
|
||||
} else if (reimbursementNew.getJf_source().equals("ACTIVITY_BUDGET_TYPE_FOUR")) {
|
||||
// 更新其他经费表
|
||||
/* JfOther jfOther = reimbursementViService.dao().fetch(JfOther.class,
|
||||
Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("clubId","=",fetch.getClubId()));
|
||||
if (ObjectUtil.isEmpty(jfOther)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
if (jfOther.getTotalQuota().subtract(jfOther.getUsedQuota()).compareTo(fetch.getMoney()) < 0) {
|
||||
return Result.error("剩余配额不足!剩余:" + jfOther.getTotalQuota().subtract(jfOther.getUsedQuota()));
|
||||
}
|
||||
jfOther.setUsedQuota(jfOther.getUsedQuota().add(fetch.getMoney()));
|
||||
reimbursementViService.updateIgnoreNull(jfOther);
|
||||
OtherUse otherUse = new OtherUse();
|
||||
otherUse.setReimbursementId(fetch.getId());
|
||||
reimbursementViService.insert(otherUse);*/
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "工会报销", msg = "撤回了一条记录", param = true, result = true)
|
||||
@RequiresPermissions("reimbursement.financeAudit")
|
||||
public Object doRevoke(@Param("id") String id) {
|
||||
Chain chain = Chain.make("financeAuditId", null)
|
||||
.add("detailsTypeId", null)
|
||||
.add("state", ReimbursementState.FINANCE);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
localProcessService.revokeTask("reimbursement@" + id, "会计审核");
|
||||
|
||||
|
||||
ReimbursementNew fetch = reimbursementViService.fetch(id);
|
||||
if (fetch.getJf_source().equals("ACTIVITY_BUDGET_TYPE_ONE")) {
|
||||
jf_school school = reimbursementViService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isEmpty(school)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
school.setUsedQuota(school.getUsedQuota().subtract(fetch.getMoney()));
|
||||
reimbursementViService.updateIgnoreNull(school);
|
||||
reimbursementViService.dao().clear(SchoolUse.class, Cnd.where("reimbursementId", "=", id));
|
||||
} else if (fetch.getJf_source().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
//如果分工会报销了校工会的余额
|
||||
ActivityBudget budget = reimbursementViService.dao().fetch(ActivityBudget.class, Cnd.where("id", "=", fetch.getActivityId()));
|
||||
if (ObjectUtil.isNotEmpty(budget) && budget.getIsSchoolBudget()){
|
||||
jf_school school = reimbursementViService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isEmpty(school)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
school.setUsedQuota(school.getUsedQuota().subtract(fetch.getMoney()));
|
||||
reimbursementViService.updateIgnoreNull(school);
|
||||
reimbursementViService.dao().clear(SchoolUse.class, Cnd.where("reimbursementId", "=", id));
|
||||
}else{
|
||||
// 更新分工会活动经费表
|
||||
jf_yjgh jfYjgh= reimbursementViService.dao().fetch(jf_yjgh.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("unionId", "=", fetch.getUnionId()));
|
||||
|
||||
if (ObjectUtil.isEmpty(jfYjgh)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
jfYjgh.setUsedQuota(jfYjgh.getUsedQuota().subtract(fetch.getMoney()));
|
||||
reimbursementViService.updateIgnoreNull(jfYjgh);
|
||||
reimbursementViService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", id));
|
||||
}
|
||||
} else if (fetch.getJf_source().equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
// 更新社团经费表
|
||||
jf_club jfClub = reimbursementViService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("club_id", "=", fetch.getClubId()));
|
||||
if (ObjectUtil.isEmpty(jfClub)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
jfClub.setUsedQuota(jfClub.getUsedQuota().subtract(fetch.getMoney()));
|
||||
reimbursementViService.updateIgnoreNull(jfClub);
|
||||
reimbursementViService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", id));
|
||||
} else if (fetch.getJf_source().equals("ACTIVITY_BUDGET_TYPE_FOUR")) {
|
||||
// 更新其他经费表
|
||||
/* JfOther jfOther = reimbursementViService.dao().fetch(JfOther.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isEmpty(jfOther)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
jfOther.setUsedQuota(jfOther.getUsedQuota().subtract(fetch.getMoney()));
|
||||
reimbursementViService.updateIgnoreNull(jfOther);
|
||||
reimbursementViService.dao().clear(OtherUse.class, Cnd.where("reimbursementId", "=", id));*/
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.financeAudit")
|
||||
public Object getClubsByRole() {
|
||||
return reimbursementViService.getClubsByRole();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
|
||||
@RequiresPermissions("reimbursement.financeAudit")
|
||||
public Result doSubmitDetailsType(@Param("detailsTypeList") Sys_dict[] detailsTypeList) {
|
||||
Sys_dict fetch = sysDictService.fetch(Cnd.where("code", "=", "ACTIVITY_BUDGET_DETAILS_TYPE"));
|
||||
List<Sys_dict> dictList = sysDictService.getSubListByCode("ACTIVITY_BUDGET_DETAILS_TYPE");
|
||||
|
||||
if (ObjectUtil.isEmpty(fetch)) {
|
||||
return Result.error("字典父类不存在!");
|
||||
}
|
||||
for (Sys_dict dict : detailsTypeList) {
|
||||
if (ObjectUtil.isEmpty(dict.getId())) {
|
||||
sysDictService.save(dict, fetch.getId());
|
||||
} else {
|
||||
sysDictService.updateIgnoreNull(dict);
|
||||
}
|
||||
}
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.financeAudit")
|
||||
public Object doDeleteDetailsType(@Param("id") String id) {
|
||||
Sys_dict dict = sysDictService.fetch(id);
|
||||
sysDictService.deleteAndChild(dict);
|
||||
sysDictService.clearCache();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,141 +0,0 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.model.Review;
|
||||
import io.v.nutz.base.service.AuditService;
|
||||
import io.v.nutz.base.service.ReviewService;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 14:23
|
||||
* @description 财务审核
|
||||
*/
|
||||
|
||||
@At("/platform/reimbursement/finance")
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
public class FinanceController {
|
||||
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/finance.html")
|
||||
@RequiresPermissions("reimbursement.finance")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.finance")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "isAudit", required = false) boolean isAudit,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "reiItemId", required = false) Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
state.stateColor,
|
||||
state.stateName,
|
||||
bx.activity_money,
|
||||
con.money
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON bx.id = rei.reimbursementId
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId $condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.FINANCE);
|
||||
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
Vi.cndPlus(cnd, "us.unionid", "=", unionId);
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.finance")
|
||||
public Object doReview(String id, Boolean flag, Audit audit, Review review, Integer reimbursementItemId, double money) {
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setFinance_audit_id(audit.getId());
|
||||
aid.setState_id(flag ? "3080" : "3075");
|
||||
aid.setActivity_money(money);
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
} else {
|
||||
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
review.setTime(DateUtil.getDate());
|
||||
review = reviewService.insert(review);
|
||||
Condolence condolence = condolenceService.fetch(id);
|
||||
condolence.setFinance_review(review.getId());
|
||||
condolence.setState_id(flag ? "3080" : "3075");
|
||||
condolence.setMoney(money);
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
}
|
||||
Reimbursement reimbursement = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
reimbursement.setState(flag ? ReimbursementState.VICE_CHAIRMAN : ReimbursementState.FINANCE_FAIL);
|
||||
|
||||
reimbursementViService.updateIgnoreNull(reimbursement);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.model.Review;
|
||||
import io.v.nutz.base.service.AuditService;
|
||||
import io.v.nutz.base.service.ReviewService;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 10:24
|
||||
* @description 单位书记
|
||||
*/
|
||||
@At("/platform/reimbursement/secretary")
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
public class ReiSecretaryController {
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/secretary.html")
|
||||
@RequiresPermissions("reimbursement.secretary")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.secretary")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "isAudit", required = false) boolean isAudit,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "reiItemId", required = false) Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON bx.id = rei.reimbursementId
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId $condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
if (isAudit) {
|
||||
cnd.and(new Static("""
|
||||
(con.unit_secretary_review IS NOT NULL
|
||||
OR bx.unit_secretary_audit_id IS NOT NULL)
|
||||
"""));
|
||||
} else {
|
||||
cnd.and("rei.State", "=", ReimbursementState.UNIT_SECRETARY);
|
||||
}
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("us.unionid", "=", Vi.getUnionId());
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.secretary")
|
||||
public Object doReview(String id, Boolean flag, Audit audit, Review review, Integer reimbursementItemId) {
|
||||
|
||||
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setUnit_secretary_audit_id(audit.getId());
|
||||
aid.setState_id(flag ? "3070" : "3065");
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
} else {
|
||||
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
review.setTime(DateUtil.getDate());
|
||||
review = reviewService.insert(review);
|
||||
Condolence condolence = condolenceService.fetch(id);
|
||||
condolence.setUnit_secretary_review(review.getId());
|
||||
condolence.setState_id(flag ? "3070" : "3065");
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
}
|
||||
Reimbursement reimbursement = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
reimbursement.setState(flag ? ReimbursementState.FINANCE : ReimbursementState.UNIT_SECRETARY_FAIL);
|
||||
|
||||
reimbursementViService.updateIgnoreNull(reimbursement);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-180
@@ -1,180 +0,0 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/16 8:55
|
||||
* @description 报销待办
|
||||
*/
|
||||
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
@At("/platform/Reimbursement/Agent")
|
||||
public class ReimbursementAgentController {
|
||||
|
||||
private static final String MODIFY = "/activity/reimbursement/list";
|
||||
private static final String SIGNATURE = "/platform/fw/condolence/be";
|
||||
private static final String UNION = "/platform/reimbursement/dma";
|
||||
private static final String UNIT_SECRETARY = "/platform/reimbursement/secretary";
|
||||
private static final String FINANCE = "/platform/reimbursement/finance";
|
||||
private static final String VICE_CHAIRMAN = "/platform/reimbursement/ViceChairman";
|
||||
private static final String STANDING_VICE_CHAIRMAN = "/platform/reimbursement/StandingViceChairman";
|
||||
@Inject
|
||||
private Vi vi;
|
||||
@Inject
|
||||
private ReimbursementService reimbursementService;
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
public Object getAgenda() {
|
||||
final String title = "【职工报销】";
|
||||
|
||||
List<NutMap> result = new ArrayList<>();
|
||||
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", MODIFY).setv("iconClass", vi.getIconByPath(MODIFY)).setv("label", "待经办人修改").setv("number", getModifyCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", SIGNATURE).setv("iconClass", vi.getIconByPath(SIGNATURE)).setv("label", "待慰问人签字").setv("number", getSignatureCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", UNION).setv("iconClass", vi.getIconByPath(UNION)).setv("label", "待分工会审核").setv("number", getUcrCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", UNIT_SECRETARY).setv("iconClass", vi.getIconByPath(UNIT_SECRETARY)).setv("label", "待单位书记审核").setv("number", getUnit_secretaryCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", FINANCE).setv("iconClass", vi.getIconByPath(FINANCE)).setv("label", "待财务审核").setv("number", getFinanceCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", VICE_CHAIRMAN).setv("iconClass", vi.getIconByPath(VICE_CHAIRMAN)).setv("label", "待分管副主席审核").setv("number", getVice_chairmanCount()));
|
||||
result.add(new NutMap().setv("title", title).setv("url", STANDING_VICE_CHAIRMAN).setv("iconClass", vi.getIconByPath(STANDING_VICE_CHAIRMAN)).setv("label", "待分管副主席审核").setv("number", getStanding_vice_chairmanCount()));
|
||||
} else {
|
||||
if (ShiroUtil.hasAnyRoles("gh03")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", UNIT_SECRETARY).setv("iconClass", vi.getIconByPath(UNIT_SECRETARY)).setv("label", "待单位书记审核").setv("number", getUnit_secretaryCount()));
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("SchoolUnionAccountant")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", FINANCE).setv("iconClass", vi.getIconByPath(FINANCE)).setv("label", "待财务审核").setv("number", getFinanceCount()));
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("wyh03")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", VICE_CHAIRMAN).setv("iconClass", vi.getIconByPath(VICE_CHAIRMAN)).setv("label", "待分管副主席审核").setv("number", getVice_chairmanCount()));
|
||||
}
|
||||
if (ShiroUtil.hasAnyRoles("wyh02")) {
|
||||
result.add(new NutMap().setv("title", title).setv("url", STANDING_VICE_CHAIRMAN).setv("iconClass", vi.getIconByPath(STANDING_VICE_CHAIRMAN)).setv("label", "待分管副主席审核").setv("number", getStanding_vice_chairmanCount()));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 待申请人修改
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getModifyCount() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT COUNT(1) FROM reimbursement $condition
|
||||
""");
|
||||
cnd.and("State", "=", ReimbursementState.MODIFY);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementService.count(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 待慰问人签字
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getSignatureCount() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT COUNT(1) FROM reimbursement $condition
|
||||
""");
|
||||
cnd.and("State", "=", ReimbursementState.SIGNATURE);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementService.count(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 待工会主席审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private Integer getUcrCount() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT COUNT(1) FROM reimbursement re LEFT JOIN `user` us ON re.userId=us.id $condition
|
||||
""");
|
||||
cnd.and("re.State", "=", ReimbursementState.UNION);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("us.unionid", "=", vi.getUnionId());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementService.count(sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 待单位书记审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private Integer getUnit_secretaryCount() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT COUNT(1) FROM reimbursement re LEFT JOIN `user` us ON re.userId=us.id $condition
|
||||
""");
|
||||
cnd.and("re.State", "=", ReimbursementState.UNIT_SECRETARY);
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
cnd.and("us.unionid", "=", vi.getUnionId());
|
||||
}
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementService.count(sql);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 待财务审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getFinanceCount() {
|
||||
return reimbursementService.count(Cnd.where("State", "=", ReimbursementState.FINANCE));
|
||||
}
|
||||
|
||||
/**
|
||||
* 待分管副主席审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getVice_chairmanCount() {
|
||||
return reimbursementService.count(Cnd.where("State", "=", ReimbursementState.VICE_CHAIRMAN));
|
||||
}
|
||||
|
||||
/**
|
||||
* 待常务副主席审核
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Object getStanding_vice_chairmanCount() {
|
||||
return reimbursementService.count(Cnd.where("State", "=", ReimbursementState.STANDING_VICE_CHAIRMAN));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+155
@@ -0,0 +1,155 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.handler.ReimbursementToDoHandler;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementPageForm;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ReimbursementClubController
|
||||
* @Description 协会审核
|
||||
* @Author zhf
|
||||
* @Date 2025/3/20 上午8:57
|
||||
*/
|
||||
@At("/platform/reimbursement/clubAudit")
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
public class ReimbursementClubAuditController {
|
||||
@Inject
|
||||
private ReimbursementService reimbursementViService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/clubAudit.html")
|
||||
@RequiresPermissions("reimbursement.clubAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@Inject
|
||||
private SysLocalProcessService localProcessService;
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.clubAudit")
|
||||
public Object pageData(ReimbursementPageForm page) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
cl.`name` clubName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("rei.jf_source", "in", List.of("ACTIVITY_BUDGET_TYPE_THREE", "ACTIVITY_BUDGET_TYPE_FOUR"));
|
||||
if (page.getIsAudit() != 1) {
|
||||
cnd.and("rei.State", page.getIsAudit() == 2 ? ">" : "=", ReimbursementState.CLUB);
|
||||
} else {
|
||||
cnd.and("rei.State", ">=", ReimbursementState.CLUB);
|
||||
}
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06")) {
|
||||
Cnd cnd1 = Cnd.NEW();
|
||||
Sql sql1 = Sqls.create("""
|
||||
SELECT
|
||||
club.id
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN `sys_user_role` role ON club.id = role.stid
|
||||
$condition
|
||||
""");
|
||||
if (!ShiroUtil.hasRole("sysadmin")) {
|
||||
cnd1.and("role.roleId", "in", Lang.array(Roles.club01, Roles.club02, Roles.club03, Roles.club04));
|
||||
cnd1.and("role.userId", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
cnd1.and("club.isjs", "=", false);
|
||||
cnd1.and("club.state", "=", 930);
|
||||
cnd1.groupBy("club.id");
|
||||
cnd1.asc("club.`code`");
|
||||
sql1.setCondition(cnd1);
|
||||
List<NutMap> nutMapList = reimbursementViService.listMap(sql1);
|
||||
List<String> ids = nutMapList.stream().map(v -> v.getString("id")).toList();
|
||||
cnd.and("rei.clubId", "in", ids);
|
||||
}
|
||||
cnd.andEX("YEAR(rei.applyTime)", "=", page.getYear());
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("reimbursement.clubAudit")
|
||||
public Object doAudit(@Param("id") String id, @Param("flag") Integer flag, Audit audit) {
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditTime(new Date());
|
||||
reimbursementViService.insert(audit);
|
||||
|
||||
ReimbursementNew reimbursementNew = reimbursementViService.fetch(id);
|
||||
ReimbursementToDoHandler.COMPLETE_CLUB_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
Integer auditState;
|
||||
if (flag == 1) {
|
||||
auditState = ReimbursementState.CLUB_FAIL;
|
||||
//拒绝
|
||||
ReimbursementToDoHandler.COMPLETE_PROCESS.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else if (flag == 2) {
|
||||
auditState = ReimbursementState.CLUB_GO_BACK;
|
||||
//返回修改
|
||||
ReimbursementToDoHandler.CREATE_BACK_CLUB_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else {
|
||||
auditState = ReimbursementState.UNION;
|
||||
ReimbursementToDoHandler.CREATE_UNION_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
}
|
||||
Chain chain = Chain.make("clubAuditId", audit.getId()).add("state", auditState);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.clubAudit")
|
||||
public Object doRevoke(@Param("id") String id) {
|
||||
Chain chain = Chain.make("clubAuditId", null).add("state", ReimbursementState.CLUB);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
localProcessService.revokeTask("reimbursement@" + id, "协会会长审核");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+63
-28
@@ -1,30 +1,34 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.PageUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.model.jf_use;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.jf.model.*;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Cnd;
|
||||
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;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
@@ -34,6 +38,7 @@ import org.nutz.mvc.annotation.Param;
|
||||
@At("/activity/reimbursement/list")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class ReimbursementListController {
|
||||
|
||||
@Inject
|
||||
@@ -58,23 +63,20 @@ public class ReimbursementListController {
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.list")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "reiItemId", required = false) String reiItemId,
|
||||
@Param(value = "person", required = false) String person) {
|
||||
public Object pageData(Integer year, String unitId, String unionId, String reiItemId, PageForm page, String person) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
state.stateColor,
|
||||
cl.`name` clubName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
$condition
|
||||
""");
|
||||
cnd.andEX("YEAR ( rei.applyTime )", "=", year);
|
||||
@@ -86,14 +88,10 @@ public class ReimbursementListController {
|
||||
sqlExpressionGroup.orLike("rei.userName", person);
|
||||
cnd.and(sqlExpressionGroup);
|
||||
}
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
|
||||
if (!ShiroUtil.getPrincipalProperty("loginname").equals("superadmin")) {
|
||||
cnd.and("rei.userId", "=", ShiroUtil.getUserId());
|
||||
}
|
||||
if (Strings.isNotBlank(reiItemId) && reiItemId.equals("ww")) {
|
||||
cnd.and("rei.reimbursementItemId", "in", "'fyww','zfww'");
|
||||
} else {
|
||||
cnd.andEX("rei.reimbursementItemId", "=", reiItemId);
|
||||
}
|
||||
if (Strings.isNotBlank(page.getPageOrderName()) && Strings.isNotBlank(page.getPageOrderBy())) {
|
||||
cnd.orderBy(page.getPageOrderName(), PageUtil.getOrder(page.getPageOrderBy()));
|
||||
} else {
|
||||
@@ -106,22 +104,59 @@ public class ReimbursementListController {
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.list")
|
||||
public Object findOne(String id) {
|
||||
return reimbursementService.findOne(id);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("reimbursement.list")
|
||||
@SLog(tag = "工会报销", msg = "删除了一条记录", param = true, result = true)
|
||||
public Object doDelete(String id) {
|
||||
ReimbursementNew reimbursementNew = reimbursementNewViService.fetch(id);
|
||||
jf_yjgh yjgh = reimbursementNewViService.dao().fetch(jf_yjgh.class, Cnd.where("unionId", "=", Vi.getUnionId()).and("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
yjgh.setUsedQuota(yjgh.getUsedQuota() - reimbursementNew.getMoney());
|
||||
reimbursementNewViService.updateIgnoreNull(yjgh);
|
||||
reimbursementNewViService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", reimbursementNew.getId()));
|
||||
ReimbursementNew fetch = reimbursementService.fetch(id);
|
||||
if (fetch.getState().equals(ReimbursementState.SUCCESSFUL_REIMBURSEMENT)) {
|
||||
if (fetch.getJf_source().equals("ACTIVITY_BUDGET_TYPE_ONE")) {
|
||||
jf_school school = reimbursementService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isEmpty(school)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
school.setUsedQuota(school.getUsedQuota().subtract(fetch.getMoney()));
|
||||
reimbursementService.updateIgnoreNull(school);
|
||||
reimbursementService.dao().clear(SchoolUse.class, Cnd.where("reimbursementId", "=", id));
|
||||
} else if (fetch.getJf_source().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
// 更新分工会活动经费表
|
||||
jf_yjgh jfYjgh=reimbursementService.dao().fetch(jf_yjgh.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("unionId", "=", fetch.getUnionId()));;
|
||||
|
||||
if (ObjectUtil.isEmpty(jfYjgh)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
jfYjgh.setUsedQuota(jfYjgh.getUsedQuota().subtract(fetch.getMoney()));
|
||||
reimbursementService.updateIgnoreNull(jfYjgh);
|
||||
reimbursementService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", id));
|
||||
} else if (fetch.getJf_source().equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
// 更新社团经费表
|
||||
jf_club jfClub = reimbursementService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("club_id", "=", fetch.getClubId()));
|
||||
if (ObjectUtil.isEmpty(jfClub)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
jfClub.setUsedQuota(jfClub.getUsedQuota().subtract(fetch.getMoney()));
|
||||
reimbursementService.updateIgnoreNull(jfClub);
|
||||
reimbursementService.dao().clear(jf_use.class, Cnd.where("apply_id", "=", id));
|
||||
} else if (fetch.getJf_source().equals("ACTIVITY_BUDGET_TYPE_FOUR")) {
|
||||
// 更新其他经费表
|
||||
/*JfOther jfOther = reimbursementService.dao().fetch(JfOther.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
if (ObjectUtil.isEmpty(jfOther)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
jfOther.setUsedQuota(jfOther.getUsedQuota().subtract(fetch.getMoney()));
|
||||
reimbursementService.updateIgnoreNull(jfOther);
|
||||
reimbursementService.dao().clear(OtherUse.class, Cnd.where("reimbursementId", "=", id));*/
|
||||
}
|
||||
|
||||
}
|
||||
reimbursementNewViService.dao().clear(ReimbursementNew.class, Cnd.where("id", "=", id));
|
||||
|
||||
return null;
|
||||
|
||||
+76
-101
@@ -4,8 +4,8 @@ import cn.afterturn.easypoi.excel.ExcelExportUtil;
|
||||
import cn.afterturn.easypoi.excel.entity.ExportParams;
|
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
|
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.artofsolving.jodconverter.DocumentConverter;
|
||||
import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;
|
||||
@@ -19,23 +19,21 @@ import com.google.zxing.client.j2se.MatrixToImageWriter;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.qrcode.QRCodeWriter;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.OfficeTemplateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.utils.ViTool;
|
||||
import io.v.nutz.web.commons.base.Globals;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
|
||||
import io.v.nutz.sys.models.Sys_dict;
|
||||
import io.v.nutz.sys.services.SysDictService;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementPageForm;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.dao.util.cri.SqlExpressionGroup;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
@@ -44,11 +42,11 @@ import org.nutz.lang.random.R;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
@@ -62,73 +60,57 @@ import java.util.stream.Collectors;
|
||||
|
||||
@At("/platform/reimbursement/Summary")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class ReimbursementSummaryController {
|
||||
|
||||
|
||||
@Inject
|
||||
private ReimbursementService reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
private SysDictService sysDictService;
|
||||
|
||||
|
||||
@Inject
|
||||
private OfficeTemplateUtil officeTemplateUtil;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/Summary.html")
|
||||
@RequiresPermissions("reimbursement.Summary")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.Summary")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "jf_source", required = false) String jf_source,
|
||||
@Param(value = "reimbursementDate", required = false) String[] reimbursementDate,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "reiItemId", required = false) String reiItemId) {
|
||||
public Object pageData(ReimbursementPageForm page) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
state.stateColor,
|
||||
cl.`name` clubName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
Vi.cndPlus(cnd, "rei.jf_source", "=", jf_source);
|
||||
if (reimbursementDate.length > 0) {
|
||||
cnd.and("rei.applyTime", ">=", reimbursementDate[0]);
|
||||
cnd.and("rei.applyTime", "<=", reimbursementDate[1]);
|
||||
cnd.andEX("rei.jf_source", "=", page.getJf_source());
|
||||
cnd.andEX("rei.State", "=", ReimbursementState.SUCCESSFUL_REIMBURSEMENT);
|
||||
if (ObjectUtil.isNotEmpty(page.getReimbursementDate())) {
|
||||
cnd.and("rei.applyTime", ">=", page.getReimbursementDate().get(0));
|
||||
cnd.and("rei.applyTime", "<=", page.getReimbursementDate().get(1));
|
||||
}
|
||||
Vi.cndPlus(cnd, "rei.unitId", "=", unitId);
|
||||
Vi.cndPlus(cnd, "rei.unionId", "=", unionId);
|
||||
cnd.andEX("rei.unitId", "=", page.getUnitId());
|
||||
cnd.andEX("rei.unionId", "=", page.getUnionId());
|
||||
cnd.andEX("rei.clubId", "=", page.getClubId());
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
if (Strings.isNotBlank(reiItemId) && reiItemId.equals("ww")) {
|
||||
cnd.and("rei.reimbursementItemId", "in", "'fyww','zfww'");
|
||||
} else {
|
||||
cnd.andEX("rei.reimbursementItemId", "=", reiItemId);
|
||||
}
|
||||
/* Vi.cndPlus(cnd, "rei.State", "=", ReimbursementState.SUCCESSFUL_REIMBURSEMENT);*/
|
||||
if (!ShiroUtil.hasAnyRoles("sysadmin,A06,gh12,wyh02,wyh03")) {
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
if (ShiroUtil.hasAnyRoles("gh01,H04")) {
|
||||
group.or("rei.unionId", "=", Vi.getUnionId());
|
||||
} else {
|
||||
group.or("rei.userId", "=", ShiroUtil.getPrincipalProperty("id"));
|
||||
}
|
||||
cnd.and(group);
|
||||
}
|
||||
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
@@ -142,9 +124,8 @@ public class ReimbursementSummaryController {
|
||||
|
||||
@At
|
||||
@Ok("void")
|
||||
@RequiresPermissions("reimbursement.Summary")
|
||||
public void reiExport(String id, HttpServletResponse response, boolean Print) throws Exception {
|
||||
NutMap record = reimbursementViService.findOne(id);
|
||||
/* NutMap record = reimbursementViService.findOne(id);
|
||||
if ("3".equals(record.getString("jf_source"))) {
|
||||
Sql clubSql = Sqls.create("""
|
||||
SELECT
|
||||
@@ -171,9 +152,9 @@ public class ReimbursementSummaryController {
|
||||
PictureRenderData pictureRenderData = new PictureRenderData(80, 80, ".png", bufferedImage);
|
||||
record.setv("qrcode", pictureRenderData);
|
||||
record.setv("applyTime", record.getString("applyTime").substring(0, 10));
|
||||
record.setv("money_big", Convert.digitToChinese(record.getDouble("money")));
|
||||
record.setv("money_big", MoneyUtil.toRMBUpper(record.getString("money")));
|
||||
|
||||
String wtAct = "□慰问 □活动 □建家 □日常 □劳务 □专家";
|
||||
String wtAct = "□慰问 □活动 □建家 □日常 □劳务 □专家 □奖励";
|
||||
if (record.getString("reimbursementItemId").equals("fyww") || record.getString("reimbursementItemId").equals("zfww")) {
|
||||
wtAct = wtAct.replace("□慰问", "√慰问");
|
||||
} else if (record.getString("reimbursementItemId").equals("fyhd")) {
|
||||
@@ -186,6 +167,8 @@ public class ReimbursementSummaryController {
|
||||
wtAct = wtAct.replace("□劳务", "√劳务");
|
||||
} else if (record.getString("reimbursementItemId").equals("zfzj")) {
|
||||
wtAct = wtAct.replace("□专家", "√专家");
|
||||
} else if (record.getString("reimbursementItemId").equals("zfjl")) {
|
||||
wtAct = wtAct.replace("□奖励", "√奖励");
|
||||
}
|
||||
|
||||
record.setv("bxxm", wtAct);
|
||||
@@ -205,13 +188,13 @@ public class ReimbursementSummaryController {
|
||||
record.setv("accTime", audit.getAuditTime() != null ? DateUtil.formatDate(audit.getAuditTime()) : null);
|
||||
record.setv("accOpinion", audit.getAuditOpinion());
|
||||
}
|
||||
record.setv("schoolName", Globals.schoolName);
|
||||
|
||||
Configure config = Configure.newBuilder().build();
|
||||
String templateUrl;
|
||||
InputStream inputStream;
|
||||
if (record.getString("reimbursementItemSort").equals("zf")) {
|
||||
templateUrl = officeTemplateUtil.getPath("reimbursementMoney");
|
||||
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/reimbursement/reimbursementMoney.docx");
|
||||
} else {
|
||||
templateUrl = officeTemplateUtil.getPath("reimbursement");
|
||||
inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("docTemplate/reimbursement/reimbursement.docx");
|
||||
}
|
||||
if (Print) {
|
||||
String uuid = R.UU32();
|
||||
@@ -221,7 +204,8 @@ public class ReimbursementSummaryController {
|
||||
|
||||
OutputStream outputStream = new FileOutputStream(docx);
|
||||
|
||||
XWPFTemplate.compile(templateUrl, config).render(record).writeAndClose(outputStream);
|
||||
XWPFTemplate.compile(inputStream, config).render(record, outputStream);
|
||||
inputStream.close();
|
||||
outputStream.close();
|
||||
|
||||
//打开连接
|
||||
@@ -243,78 +227,66 @@ public class ReimbursementSummaryController {
|
||||
} else {
|
||||
String fileName = "";
|
||||
if (record.getString("reimbursementItemSort").equals("zf")) {
|
||||
fileName = Globals.schoolName + "支付凭证";
|
||||
fileName = "南京工业大学支付凭证";
|
||||
} else {
|
||||
fileName = Globals.schoolName + "工会凭证报销单";
|
||||
fileName = "南京工业大学工会凭证报销单";
|
||||
}
|
||||
|
||||
response.addHeader("Content-Type", "application/octet-stream");
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes("UTF-8"), "ISO-8859-1") + "\".docx");
|
||||
XWPFTemplate.compile(templateUrl, config).render(record).writeAndClose(response.getOutputStream());
|
||||
}
|
||||
response.addHeader("Content-Disposition", "attachment; filename=\"" + new String(fileName.getBytes(StandardCharsets.UTF_8), StandardCharsets.ISO_8859_1) + "\".docx");
|
||||
XWPFTemplate.compile(inputStream, config).render(record, response.getOutputStream());
|
||||
inputStream.close();
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At()
|
||||
@Ok("void")
|
||||
@RequiresPermissions("reimbursement.Summary")
|
||||
public void doExportUserExcel(HttpServletResponse response,
|
||||
@Param(value = "reiItemId", required = false) String reiItemId,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "searchKeyword", required = false) String searchKeyword,
|
||||
@Param(value = "searchName", required = false) String searchName,
|
||||
@Param(value = "reimbursementDate", required = false) String[] reimbursementDate) {
|
||||
public void doExportUserExcel(HttpServletResponse response, ReimbursementPageForm page) {
|
||||
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor
|
||||
state.stateColor,
|
||||
cl.`name` clubName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
$condition
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
$condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
if (reimbursementDate != null && reimbursementDate.length > 0) {
|
||||
Vi.cndPlus(cnd, "rei.applyTime", ">=", reimbursementDate[0]);
|
||||
Vi.cndPlus(cnd, "rei.applyTime", "<=", reimbursementDate[1]);
|
||||
cnd.andEX("rei.jf_source", "=", page.getJf_source());
|
||||
cnd.andEX("rei.State", "=", ReimbursementState.SUCCESSFUL_REIMBURSEMENT);
|
||||
if (ObjectUtil.isNotEmpty(page.getReimbursementDate())) {
|
||||
cnd.and("rei.applyTime", ">=", page.getReimbursementDate().get(0));
|
||||
cnd.and("rei.applyTime", "<=", page.getReimbursementDate().get(1));
|
||||
}
|
||||
Vi.cndPlus(cnd, "rei.unitId", "=", unitId);
|
||||
Vi.cndPlus(cnd, "rei.unionId", "=", unionId);
|
||||
if (Vi.isNotBlank(searchName, searchKeyword)) {
|
||||
cnd.where().andLike(searchName, searchKeyword);
|
||||
cnd.andEX("rei.unitId", "=", page.getUnitId());
|
||||
cnd.andEX("rei.unionId", "=", page.getUnionId());
|
||||
cnd.andEX("rei.clubId", "=", page.getClubId());
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
List<NutMap> mapList = reimbursementViService.listMap(sql);
|
||||
List<Sys_dict> dictList = sysDictService.getSubListByCode("ACTIVITY_BUDGET_TYPE");
|
||||
mapList.forEach(v -> {
|
||||
v.setv("description", Strings.isNotBlank(v.getString("activity_name")) ? ("活动名称:" + v.getString("activity_name")) : ("被慰问人:" + v.getString("be_username")));
|
||||
if ("3".equals(v.getString("jf_source"))) {
|
||||
Sql clubSql = Sqls.create("""
|
||||
SELECT
|
||||
cu.*,
|
||||
c.NAME as clubName
|
||||
FROM
|
||||
sys_club_user cu
|
||||
LEFT JOIN sys_club c ON c.id = cu.clubid
|
||||
$condition
|
||||
""");
|
||||
Cnd clubCnd = Cnd.NEW();
|
||||
clubCnd.and("userid", "=", v.getString("userId"));
|
||||
clubCnd.and("clubid", "=", v.getString("clubId"));
|
||||
clubSql.setCondition(clubCnd);
|
||||
List<NutMap> list = reimbursementViService.listMap(clubSql);
|
||||
if (Lang.isNotEmpty(list)) {
|
||||
String name = list.stream().map(o -> o.getString("clubName")).collect(Collectors.joining(","));
|
||||
v.put("unitName", name);
|
||||
}
|
||||
Sys_dict dict = dictList.stream().filter(sys_dict -> sys_dict.getCode().equals(v.getString("jf_source"))).findFirst().orElse(null);
|
||||
v.put("jf_source_name", dict.getName());
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_ONE", "ACTIVITY_BUDGET_TYPE_FOUR").contains(v.getString("jf_source"))) {
|
||||
v.put("helpUnitName", dict.getName());
|
||||
}else if (v.getString("jf_source").equals("ACTIVITY_BUDGET_TYPE_TWO")){
|
||||
v.put("helpUnitName", v.getString("unionName"));
|
||||
}else if (v.getString("jf_source").equals("ACTIVITY_BUDGET_TYPE_THREE")){
|
||||
v.put("helpUnitName", v.getString("clubName"));
|
||||
}
|
||||
});
|
||||
List<ExcelExportEntity> exportEntities = new ArrayList<>();
|
||||
@@ -322,10 +294,13 @@ public class ReimbursementSummaryController {
|
||||
exportEntities.add(new ExcelExportEntity("姓名", "userName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属工会", "unionName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("所属单位", "unitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申请时间", "applyTime", 20));
|
||||
exportEntities.add(new ExcelExportEntity("报销项目", "reimbursementItemName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("备注", "description", 20));
|
||||
exportEntities.add(new ExcelExportEntity("活动类型", "jf_source_name", 20));
|
||||
exportEntities.add(new ExcelExportEntity("活动项目", "activity_name", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申报单位", "helpUnitName", 20));
|
||||
exportEntities.add(new ExcelExportEntity("金额(元)", "money", 20));
|
||||
exportEntities.add(new ExcelExportEntity("申请时间", "applyTime", 20));
|
||||
exportEntities.add(new ExcelExportEntity("审核状态", "stateName", 20));
|
||||
|
||||
|
||||
try {
|
||||
ViTool.excelResponse(response, "报销汇总表.xlsx");
|
||||
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.handler.ReimbursementToDoHandler;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementPageForm;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
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;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ReimbursementUnionController
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2025/3/20 下午5:10
|
||||
*/
|
||||
@At("/platform/reimbursement/unionAudit")
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
public class ReimbursementUnionAuditController {
|
||||
@Inject
|
||||
private ReimbursementService reimbursementViService;
|
||||
@Inject
|
||||
private SysLocalProcessService localProcessService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/unionAudit.html")
|
||||
@RequiresPermissions("reimbursement.unionAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.unionAudit")
|
||||
public Object pageData(ReimbursementPageForm page) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
cl.`name` clubName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (page.getIsAudit() != 1) {
|
||||
cnd.and("rei.State", page.getIsAudit() == 2 ? ">" : "=", ReimbursementState.UNION);
|
||||
} else {
|
||||
cnd.and("rei.State", ">=", ReimbursementState.UNION);
|
||||
}
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
SqlExpressionGroup group = new SqlExpressionGroup();
|
||||
|
||||
List<Sys_club> clubList = reimbursementViService.dao().query(Sys_club.class, Cnd.where("belongUnionId", "=", Vi.getUnionId()));
|
||||
List<String> ids = clubList.stream().map(Sys_club::getId).toList();
|
||||
SqlExpressionGroup group1 = new SqlExpressionGroup();
|
||||
group1.and("rei.clubId", "in", ids);
|
||||
group1.and("rei.jf_source", "=", "ACTIVITY_BUDGET_TYPE_THREE");
|
||||
group.or(group1);
|
||||
|
||||
SqlExpressionGroup group2 = new SqlExpressionGroup();
|
||||
group2.and("rei.unionId", "=", Vi.getUnionId());
|
||||
group2.and("rei.jf_source", "=", "ACTIVITY_BUDGET_TYPE_TWO");
|
||||
group.or(group2);
|
||||
cnd.and(group);
|
||||
|
||||
|
||||
cnd.andEX("YEAR(rei.applyTime)", "=", page.getYear());
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.unionAudit")
|
||||
public Object doAudit(@Param("id") String id, @Param("flag") Integer flag, Audit audit) {
|
||||
ReimbursementNew reimbursementNew = reimbursementViService.fetch(id);
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditTime(new Date());
|
||||
reimbursementViService.insert(audit);
|
||||
|
||||
ReimbursementToDoHandler.COMPLETE_UNION_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
Integer auditState;
|
||||
if (flag == 1) {
|
||||
auditState = ReimbursementState.UNION_FAIL;
|
||||
//拒绝
|
||||
ReimbursementToDoHandler.COMPLETE_PROCESS.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else if (flag == 2) {
|
||||
auditState = ReimbursementState.UNION_GO_BACK;
|
||||
//返回修改
|
||||
ReimbursementToDoHandler.CREATE_BACK_UNION_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else {
|
||||
auditState = ReimbursementState.UNION_MANAGE;
|
||||
ReimbursementToDoHandler.CREATE_UNION_MANAGE_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
}
|
||||
Chain chain = Chain.make("unionAuditId", audit.getId()).add("state", auditState);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("reimbursement.unionAudit")
|
||||
public Object doRevoke(@Param("id") String id) {
|
||||
Chain chain = Chain.make("unionAuditId", null).add("state", ReimbursementState.UNION);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
localProcessService.revokeTask("reimbursement@" + id, "分工会主席审核");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.base.service.AuditService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.jf.model.*;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.handler.ReimbursementToDoHandler;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementPageForm;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 16:58
|
||||
* @description 常务副主席审核
|
||||
*/
|
||||
|
||||
@At("/platform/reimbursement/standingViceChairmanAudit")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
@Ok("json")
|
||||
public class StandingViceChairmanAuditController {
|
||||
|
||||
|
||||
@Inject
|
||||
private ReimbursementService reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private SysLocalProcessService localProcessService;
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/standingViceChairmanAudit.html")
|
||||
@RequiresPermissions("reimbursement.standingViceChairmanAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.standingViceChairmanAudit")
|
||||
public Object pageData(ReimbursementPageForm page) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
cl.`name` clubName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.andEX("rei.unionId", "=", page.getUnionId());
|
||||
cnd.andEX("rei.unitId", "=", page.getUnitId());
|
||||
cnd.andEX("rei.clubId", "=", page.getClubId());
|
||||
cnd.andEX("rei.jf_source", "=", page.getJf_source());
|
||||
cnd.andEX("rei.detailsTypeId", "=", page.getDetailsTypeId());
|
||||
|
||||
if (page.getIsAudit() != 1) {
|
||||
cnd.and("rei.State", page.getIsAudit() == 2 ? ">" : "=", ReimbursementState.STANDING_VICE_CHAIRMAN);
|
||||
} else {
|
||||
cnd.and("rei.State", ">=", ReimbursementState.STANDING_VICE_CHAIRMAN);
|
||||
}
|
||||
if (StrUtil.isAllNotEmpty(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
cnd.andEX("YEAR(rei.applyTime)", "=", page.getYear());
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "工会报销", msg = "审核了一条记录", param = true, result = true)
|
||||
@RequiresPermissions("reimbursement.standingViceChairmanAudit")
|
||||
public Object doAudit(@Param("id") String id,
|
||||
@Param("flag") Integer flag,
|
||||
Audit audit) {
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditTime(new Date());
|
||||
reimbursementViService.insert(audit);
|
||||
|
||||
ReimbursementNew reimbursementNew = reimbursementViService.fetch(id);
|
||||
ReimbursementToDoHandler.COMPLETE_STANDING_VICE_CHAIRMAN_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
Integer auditState;
|
||||
if (flag == 1) {
|
||||
auditState = ReimbursementState.STANDING_VICE_CHAIRMAN_FAIL;
|
||||
//拒绝
|
||||
ReimbursementToDoHandler.COMPLETE_PROCESS.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else if (flag == 2) {
|
||||
auditState = ReimbursementState.STANDING_VICE_CHAIRMAN_GO_BACK;
|
||||
//返回修改
|
||||
ReimbursementToDoHandler.CREATE_BACK_STANDING_VICE_CHAIRMAN_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else {
|
||||
auditState = ReimbursementState.FINANCE;
|
||||
ReimbursementToDoHandler.CREATE_FINANCE_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
}
|
||||
|
||||
Chain chain = Chain.make("standingViceChairmanAuditId", audit.getId()).add("state", auditState);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "工会报销", msg = "撤回了一条记录", param = true, result = true)
|
||||
@RequiresPermissions("reimbursement.standingViceChairmanAudit")
|
||||
public Object doRevoke(@Param("id") String id) {
|
||||
|
||||
Chain chain = Chain.make("standingViceChairmanAuditId", null)
|
||||
.add("state", ReimbursementState.STANDING_VICE_CHAIRMAN);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
|
||||
localProcessService.revokeTask("reimbursement@" + id, "工会主席审核");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
-142
@@ -1,142 +0,0 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.model.Review;
|
||||
import io.v.nutz.base.service.AuditService;
|
||||
import io.v.nutz.base.service.ReviewService;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 16:58
|
||||
* @description 常务副主席审核
|
||||
*/
|
||||
|
||||
@At("/platform/reimbursement/StandingViceChairman")
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
public class StandingViceChairmanController {
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/StandingViceChairman.html")
|
||||
@RequiresPermissions("reimbursement.StandingViceChairman")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.StandingViceChairman")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "isAudit", required = false) boolean isAudit,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "reiItemId", required = false) Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON bx.id = rei.reimbursementId
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId $condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.STANDING_VICE_CHAIRMAN);
|
||||
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
Vi.cndPlus(cnd, "us.unionid", "=", unionId);
|
||||
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.StandingViceChairman")
|
||||
public Object doReview(String id, Boolean flag, Audit audit, Review review, Integer reimbursementItemId) {
|
||||
|
||||
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setStanding_vice_chairman_audit_id(audit.getId());
|
||||
aid.setState_id(flag ? "3100" : "3095");
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
} else {
|
||||
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
review.setTime(DateUtil.getDate());
|
||||
review = reviewService.insert(review);
|
||||
Condolence condolence = condolenceService.fetch(id);
|
||||
condolence.setExecutive_chairman_review(review.getId());
|
||||
condolence.setState_id(flag ? "3100" : "3095");
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
}
|
||||
Reimbursement reimbursement = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
reimbursement.setState(flag ? ReimbursementState.SUCCESSFUL_REIMBURSEMENT : ReimbursementState.STANDING_VICE_CHAIRMAN_FAIL);
|
||||
|
||||
reimbursementViService.updateIgnoreNull(reimbursement);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.services.SysClubService;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.handler.ReimbursementToDoHandler;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementPageForm;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/30 16:19
|
||||
* @description 工会办公室主管审核
|
||||
*/
|
||||
@At("/platform/reimbursement/unionManageAudit")
|
||||
@IocBean
|
||||
@Ok("json:full")
|
||||
public class UnionManageAuditController {
|
||||
|
||||
|
||||
@Inject
|
||||
private ReimbursementService reimbursementViService;
|
||||
@Inject
|
||||
private SysLocalProcessService localProcessService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/unionManageAudit.html")
|
||||
@RequiresPermissions("reimbursement.unionManageAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.unionManageAudit")
|
||||
public Object pageData(ReimbursementPageForm page) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
cl.`name` clubName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
if (page.getIsAudit() != 1) {
|
||||
cnd.and("rei.State", page.getIsAudit() == 2 ? ">" : "=", ReimbursementState.UNION_MANAGE);
|
||||
} else {
|
||||
cnd.and("rei.State", ">=", ReimbursementState.UNION_MANAGE);
|
||||
}
|
||||
cnd.andEX("rei.unionId", "=", page.getUnionId());
|
||||
cnd.andEX("rei.unitId", "=", page.getUnitId());
|
||||
cnd.andEX("rei.clubId", "=", page.getClubId());
|
||||
cnd.andEX("rei.jf_source", "=", page.getJf_source());
|
||||
if (Vi.isNotBlank(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
cnd.andEX("YEAR(rei.applyTime)", "=", page.getYear());
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.unionManageAudit")
|
||||
public Object doAudit(@Param("id") String id, @Param("flag") Integer flag, Audit audit) {
|
||||
ReimbursementNew reimbursementNew = reimbursementViService.fetch(id);
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditTime(new Date());
|
||||
reimbursementViService.insert(audit);
|
||||
ReimbursementToDoHandler.COMPLETE_UNION_MANAGE_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
|
||||
Integer auditState;
|
||||
if (flag == 1) {
|
||||
auditState = ReimbursementState.UNION_MANAGE_FAIL;
|
||||
//拒绝
|
||||
ReimbursementToDoHandler.COMPLETE_PROCESS.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else if (flag == 2) {
|
||||
auditState = ReimbursementState.UNION_MANAGE_GO_BACK;
|
||||
//返回修改
|
||||
ReimbursementToDoHandler.CREATE_BACK_UNION_MANAGE_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else {
|
||||
auditState = ReimbursementState.VICE_CHAIRMAN;
|
||||
ReimbursementToDoHandler.CREATE_VICE_CHAIRMAN_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
}
|
||||
Chain chain = Chain.make("unionManageAuditId", audit.getId()).add("state", auditState);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@RequiresPermissions("reimbursement.unionManageAudit")
|
||||
public Object doRevoke(@Param("id") String id) {
|
||||
Chain chain = Chain.make("unionManageAuditId", null).add("state", ReimbursementState.UNION_MANAGE);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
localProcessService.revokeTask("reimbursement@" + id, "工会办公室主管审核");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+152
@@ -0,0 +1,152 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.result.Result;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.handler.ReimbursementToDoHandler;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementPageForm;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.aop.interceptor.ioc.TransAop;
|
||||
import org.nutz.dao.Chain;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.aop.Aop;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 15:27
|
||||
* @description 工会副主席
|
||||
*/
|
||||
@At("/platform/reimbursement/viceChairmanAudit")
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
public class ViceChairmanAuditController {
|
||||
|
||||
|
||||
@Inject
|
||||
private ReimbursementService reimbursementViService;
|
||||
@Inject
|
||||
private SysLocalProcessService localProcessService;
|
||||
|
||||
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/viceChairmanAudit.html")
|
||||
@RequiresPermissions("reimbursement.viceChairmanAudit")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.viceChairmanAudit")
|
||||
public Object pageData(ReimbursementPageForm page) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
be.username be_username,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
cl.`name` clubName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
|
||||
cnd.andEX("rei.unionId", "=", page.getUnionId());
|
||||
cnd.andEX("rei.unitId", "=", page.getUnitId());
|
||||
cnd.andEX("rei.clubId", "=", page.getClubId());
|
||||
cnd.andEX("rei.jf_source", "=", page.getJf_source());
|
||||
|
||||
if (page.getIsAudit() != 1) {
|
||||
cnd.and("rei.State", page.getIsAudit() == 2 ? ">" : "=", ReimbursementState.VICE_CHAIRMAN);
|
||||
} else {
|
||||
cnd.and("rei.State", ">=", ReimbursementState.VICE_CHAIRMAN);
|
||||
}
|
||||
if (StrUtil.isAllNotEmpty(page.getSearchName(), page.getSearchKeyword())) {
|
||||
cnd.where().andLike(page.getSearchName(), page.getSearchKeyword());
|
||||
}
|
||||
cnd.andEX("YEAR(rei.applyTime)", "=", page.getYear());
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "工会报销", msg = "审核了一条记录", param = true, result = true)
|
||||
@RequiresPermissions("reimbursement.viceChairmanAudit")
|
||||
public Object doAudit(@Param("id") String id, @Param("flag") Integer flag, Audit audit) {
|
||||
ReimbursementNew reimbursementNew = reimbursementViService.fetch(id);
|
||||
ReimbursementToDoHandler.COMPLETE_VICE_CHAIRMAN_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
Integer auditState;
|
||||
if (flag == 1) {
|
||||
auditState = ReimbursementState.VICE_CHAIRMAN_FAIL;
|
||||
//拒绝
|
||||
ReimbursementToDoHandler.COMPLETE_PROCESS.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else if (flag == 2) {
|
||||
auditState = ReimbursementState.VICE_CHAIRMAN_GO_BACK;
|
||||
//返回修改
|
||||
ReimbursementToDoHandler.CREATE_BACK_VICE_CHAIRMAN_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
} else {
|
||||
if (reimbursementNew.getMoney().compareTo(BigDecimal.valueOf(50000)) > 0) {
|
||||
auditState = ReimbursementState.STANDING_VICE_CHAIRMAN;
|
||||
ReimbursementToDoHandler.CREATE_STANDING_VICE_CHAIRMAN_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
}else{
|
||||
auditState = ReimbursementState.FINANCE;
|
||||
ReimbursementToDoHandler.CREATE_FINANCE_TASK.exec(reimbursementNew, audit.getAuditOpinion());
|
||||
}
|
||||
|
||||
}
|
||||
audit.setLoginname(ShiroUtil.getPlatformLoginname());
|
||||
audit.setUsername(ShiroUtil.getPlatformUsername());
|
||||
audit.setAuditTime(new Date());
|
||||
reimbursementViService.insert(audit);
|
||||
reimbursementViService.update(Chain.make("viceChairmanAuditId", audit.getId())
|
||||
.add("state", auditState), Cnd.where("id", "=", id));
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@Aop(TransAop.READ_COMMITTED)
|
||||
@SLog(tag = "工会报销", msg = "撤回了一条记录", param = true, result = true)
|
||||
@RequiresPermissions("reimbursement.viceChairmanAudit")
|
||||
public Result doRevoke(@Param("id") String id) {
|
||||
Chain chain = Chain.make("viceChairmanAuditId", null)
|
||||
.add("state", ReimbursementState.VICE_CHAIRMAN);
|
||||
reimbursementViService.update(chain, Cnd.where("id", "=", id));
|
||||
localProcessService.revokeTask("reimbursement@" + id, "工会办公室主管审核");
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.viceChairmanAudit")
|
||||
public Object getClubsByRole() {
|
||||
return reimbursementViService.getClubsByRole();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.dao.CndPlus;
|
||||
import io.v.nutz.zhgh.jf.model.ActivityBx;
|
||||
import io.v.nutz.zhgh.jf.service.ActivityBxService;
|
||||
import io.v.nutz.base.model.Audit;
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import io.v.nutz.base.model.Review;
|
||||
import io.v.nutz.base.service.AuditService;
|
||||
import io.v.nutz.base.service.ReviewService;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.sys.services.SysSignatureService;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.zgfw.model.condolence.Condolence;
|
||||
import io.v.nutz.zhgh.zgfw.service.CondolenceService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/7 15:27
|
||||
* @description 分管副主席
|
||||
*/
|
||||
@At("/platform/reimbursement/ViceChairman")
|
||||
@IocBean
|
||||
@Ok("json")
|
||||
public class ViceChairmanController {
|
||||
|
||||
@Inject("Reimbursement")
|
||||
private ViService<Reimbursement> reimbursementViService;
|
||||
|
||||
@Inject
|
||||
private ActivityBxService activityBxService;
|
||||
|
||||
@Inject
|
||||
private SysSignatureService sysSignatureService;
|
||||
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@Inject
|
||||
private ReviewService reviewService;
|
||||
|
||||
@Inject
|
||||
private CondolenceService condolenceService;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/ViceChairman.html")
|
||||
@RequiresPermissions("reimbursement.ViceChairman")
|
||||
public void index() {
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.ViceChairman")
|
||||
public Object pageData(PageForm page,
|
||||
@Param(value = "isAudit", required = false) boolean isAudit,
|
||||
@Param(value = "year", required = false) Integer year,
|
||||
@Param(value = "unitId", required = false) String unitId,
|
||||
@Param(value = "unionId", required = false) String unionId,
|
||||
@Param(value = "reiItemId", required = false) Integer reiItemId) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
rei.*,
|
||||
us.unionname,
|
||||
state.stateColor,
|
||||
state.stateName
|
||||
FROM
|
||||
`reimbursement` rei
|
||||
LEFT JOIN `user` us ON us.id = rei.userid
|
||||
LEFT JOIN condolence con ON con.id = rei.reimbursementId
|
||||
LEFT JOIN activity_bx bx ON bx.id = rei.reimbursementId
|
||||
LEFT JOIN audit_state state ON rei.State = state.stateId $condition
|
||||
""");
|
||||
CndPlus cnd = CndPlus.create();
|
||||
cnd.and("rei.State", isAudit ? ">" : "=", ReimbursementState.VICE_CHAIRMAN);
|
||||
|
||||
Vi.cndPlus(cnd, "rei.reimbursementItemId", "=", reiItemId);
|
||||
Vi.cndPlus(cnd, "YEAR(rei.applyTime)", "=", year);
|
||||
Vi.cndPlus(cnd, "us.unitid", "=", unitId);
|
||||
Vi.cndPlus(cnd, "us.unionid", "=", unionId);
|
||||
cnd.desc("rei.applyTime");
|
||||
sql.setCondition(cnd);
|
||||
return reimbursementViService.listPageMap(page.getPageNumber(), page.getPageSize(), sql);
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.ViceChairman")
|
||||
public Object doReview(String id, Boolean flag, Audit audit, Review review, Integer reimbursementItemId) {
|
||||
|
||||
|
||||
if (reimbursementItemId != 4) {
|
||||
audit.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
audit.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
audit.setAuditTime(new Date());
|
||||
audit = auditService.insert(audit);
|
||||
ActivityBx aid = activityBxService.fetch(id);
|
||||
aid.setVice_chairman_audit_id(audit.getId());
|
||||
aid.setState_id(flag ? "3090" : "3085");
|
||||
activityBxService.updateIgnoreNull(aid);
|
||||
} else {
|
||||
review.setLoginname(ShiroUtil.getPrincipalProperty("loginname").toString());
|
||||
review.setUsername(ShiroUtil.getPrincipalProperty("username").toString());
|
||||
review.setTime(DateUtil.getDate());
|
||||
review = reviewService.insert(review);
|
||||
Condolence condolence = condolenceService.fetch(id);
|
||||
condolence.setVice_chairman_review(review.getId());
|
||||
condolence.setState_id(flag ? "3090" : "3085");
|
||||
condolenceService.updateIgnoreNull(condolence);
|
||||
}
|
||||
Reimbursement reimbursement = reimbursementViService.fetch(Cnd.where("reimbursementId", "=", id));
|
||||
reimbursement.setState(flag ? ReimbursementState.STANDING_VICE_CHAIRMAN : ReimbursementState.VICE_CHAIRMAN_FAIL);
|
||||
|
||||
reimbursementViService.updateIgnoreNull(reimbursement);
|
||||
return null;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,35 +1,40 @@
|
||||
package io.v.nutz.zhgh.reimbursement.controller;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.annontation.Valid;
|
||||
import io.v.nutz.base.annontation.ViReturn;
|
||||
import io.v.nutz.base.service.BaseService;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.MsgApi;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activityBudget.handler.ActivityBudgetUserApplyToDoHandler;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.jf.model.jf_school;
|
||||
import io.v.nutz.zhgh.jf.model.jf_yjgh;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.handler.ReimbursementToDoHandler;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.sys.models.Sys_club_user;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.web.commons.slog.annotation.SLog;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import org.apache.shiro.authz.annotation.RequiresAuthentication;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
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.Static;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
import org.nutz.mvc.annotation.At;
|
||||
import org.nutz.mvc.annotation.Ok;
|
||||
import org.nutz.mvc.annotation.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -42,16 +47,17 @@ import java.util.List;
|
||||
@At("/platform/reimbursement/applyNew")
|
||||
@Ok("json:full")
|
||||
@IocBean
|
||||
@RequiresAuthentication
|
||||
public class applyNewController {
|
||||
|
||||
@Inject
|
||||
private BaseService baseService;
|
||||
@Inject
|
||||
private ReimbursementService reimbursementService;
|
||||
|
||||
@Inject
|
||||
private Dao dao;
|
||||
|
||||
@Inject
|
||||
private MsgApi msgApi;
|
||||
|
||||
@At("")
|
||||
@Ok("beetl:/platform/reimbursement/applyNew.html")
|
||||
@@ -59,11 +65,13 @@ public class applyNewController {
|
||||
public void index() {
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresAuthentication
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
@SLog(tag = "工会报销", msg = "新增一条记录", param = true, result = true)
|
||||
public Object doAdd(@Param("data") ReimbursementNew reimbursementNew) {
|
||||
public Object doAdd(@Param("data") ReimbursementNew reimbursementNew, Boolean flag) {
|
||||
//查询发票号码有没有重复的
|
||||
String billNumber = reimbursementNew.getBillNumber();
|
||||
if (StrUtil.isNotBlank(billNumber)) {
|
||||
@@ -81,28 +89,43 @@ public class applyNewController {
|
||||
reimbursementNew.setUserId(ShiroUtil.getUserId());
|
||||
reimbursementNew.setUnitId(ShiroUtil.getUnitId());
|
||||
reimbursementNew.setUnionId(Vi.getUnionId());
|
||||
reimbursementNew.setState(ReimbursementState.AUDIT_CONFIRM);
|
||||
if (flag) {
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_THREE", "ACTIVITY_BUDGET_TYPE_FOUR").contains(reimbursementNew.getJf_source())) {
|
||||
reimbursementNew.setState(ReimbursementState.CLUB);
|
||||
} else if (reimbursementNew.getJf_source().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
reimbursementNew.setState(ReimbursementState.UNION);
|
||||
} else {
|
||||
reimbursementNew.setState(ReimbursementState.UNION_MANAGE);
|
||||
}
|
||||
} else {
|
||||
reimbursementNew.setState(ReimbursementState.STAY_SUBMIT);
|
||||
}
|
||||
reimbursementNew.setApplyTime(DateUtil.getDateTime());
|
||||
baseService.insert(reimbursementNew);
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname
|
||||
FROM
|
||||
sys_user_role role
|
||||
LEFT JOIN sys_user u ON u.id = role.userId
|
||||
WHERE
|
||||
role.roleId = @kj
|
||||
""").setParam("kj", Roles.XGHKJ);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
list.forEach(v -> {
|
||||
//msgApi.sendWxMsg("%s(%s)提交了一条报销申请待您审核,请前往智慧工会查看!".formatted(reimbursementNew.getUserName(), reimbursementNew.getLoginName()), v.getString("loginname"));
|
||||
});
|
||||
|
||||
|
||||
if (flag) {
|
||||
//插入后,发起待办流程
|
||||
ReimbursementToDoHandler.START_PROCESS.exec(reimbursementNew, null);
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_THREE", "ACTIVITY_BUDGET_TYPE_FOUR").contains(reimbursementNew.getJf_source())) {
|
||||
//发任务给分工会主席审核
|
||||
ReimbursementToDoHandler.CREATE_CLUB_TASK.exec(reimbursementNew, null);
|
||||
} else if (reimbursementNew.getJf_source().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
//发任务给分工会主席审核
|
||||
ReimbursementToDoHandler.CREATE_UNION_TASK.exec(reimbursementNew, null);
|
||||
} else {
|
||||
//发任务给工会办公室主管审核
|
||||
ReimbursementToDoHandler.CREATE_UNION_MANAGE_TASK.exec(reimbursementNew, null);
|
||||
}
|
||||
//完成申请人的任务(申请拒绝的情况)
|
||||
ReimbursementToDoHandler.COMPLETE_APPLY_TASK.exec(reimbursementNew, null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
@RequiresAuthentication
|
||||
public Object findOne(String id) {
|
||||
ReimbursementNew fetch = baseService.dao().fetch(ReimbursementNew.class, id);
|
||||
return fetch;
|
||||
@@ -112,7 +135,7 @@ public class applyNewController {
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
@SLog(tag = "工会报销", msg = "编辑一条记录", param = true, result = true)
|
||||
public Object doEdit(@Param("data") ReimbursementNew reimbursementNew) {
|
||||
public Object doEdit(@Param("data") ReimbursementNew reimbursementNew, Boolean flag) {
|
||||
//查询发票号码有没有重复的
|
||||
String billNumber = reimbursementNew.getBillNumber();
|
||||
if (StrUtil.isNotBlank(billNumber)) {
|
||||
@@ -128,72 +151,42 @@ public class applyNewController {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (reimbursementNew.getState().equals(ReimbursementState.MODIFY)) {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname
|
||||
FROM
|
||||
sys_user_role role
|
||||
LEFT JOIN sys_user u ON u.id = role.userId
|
||||
WHERE
|
||||
role.roleId = @kj
|
||||
""").setParam("kj", Roles.XGHKJ);
|
||||
List<NutMap> list = baseService.listMap(sql);
|
||||
list.forEach(v -> {
|
||||
//msgApi.sendWxMsg("%s(%s)提交了一条报销申请待您审核,请前往智慧工会查看!".formatted(reimbursementNew.getUserName(), reimbursementNew.getLoginName()), v.getString("loginname"));
|
||||
});
|
||||
if (flag) {
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_THREE", "ACTIVITY_BUDGET_TYPE_FOUR").contains(reimbursementNew.getJf_source())) {
|
||||
reimbursementNew.setState(ReimbursementState.CLUB);
|
||||
} else if (reimbursementNew.getJf_source().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
reimbursementNew.setState(ReimbursementState.UNION);
|
||||
} else {
|
||||
reimbursementNew.setState(ReimbursementState.UNION_MANAGE);
|
||||
}
|
||||
} else {
|
||||
reimbursementNew.setState(ReimbursementState.STAY_SUBMIT);
|
||||
}
|
||||
reimbursementNew.setState(ReimbursementState.AUDIT_CONFIRM);
|
||||
baseService.updateIgnoreNull(reimbursementNew);
|
||||
|
||||
if (flag) {
|
||||
//插入后,发起待办流程
|
||||
ReimbursementToDoHandler.START_PROCESS.exec(reimbursementNew, null);
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_THREE", "ACTIVITY_BUDGET_TYPE_FOUR").contains(reimbursementNew.getJf_source())) {
|
||||
//发任务给分工会主席审核
|
||||
ReimbursementToDoHandler.CREATE_CLUB_TASK.exec(reimbursementNew, null);
|
||||
} else if (reimbursementNew.getJf_source().equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
//发任务给分工会主席审核
|
||||
ReimbursementToDoHandler.CREATE_UNION_TASK.exec(reimbursementNew, null);
|
||||
} else {
|
||||
//发任务给工会办公室主管审核
|
||||
ReimbursementToDoHandler.CREATE_UNION_MANAGE_TASK.exec(reimbursementNew, null);
|
||||
}
|
||||
//完成申请人的任务(申请拒绝的情况)
|
||||
ReimbursementToDoHandler.COMPLETE_APPLY_TASK.exec(reimbursementNew, null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
public Object getBalance() {
|
||||
jf_yjgh yjgh = baseService.dao().fetch(jf_yjgh.class, Cnd.where("unionId", "=", Vi.getUnionId()).and("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
if (yjgh != null) {
|
||||
double balance = yjgh.getTotalQuota() - (yjgh.getUsedQuota() != null ? yjgh.getUsedQuota() : 0);
|
||||
BigDecimal bigDecimal = new BigDecimal(balance);
|
||||
double value = bigDecimal.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
return Result.success(value);
|
||||
}
|
||||
return Result.success(0f);
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
public Object getSchoolBudget() {
|
||||
jf_school jfSchool = baseService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1));
|
||||
if (jfSchool != null) {
|
||||
double balance = jfSchool.getTotalQuota() - (jfSchool.getUsedQuota() != null ? jfSchool.getUsedQuota() : 0);
|
||||
BigDecimal bigDecimal = new BigDecimal(balance);
|
||||
double value = bigDecimal.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
return Result.success(value);
|
||||
}
|
||||
return Result.success(0f);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
public Object getClubBudget(@Param(value = "clubId", required = false) String clubId) {
|
||||
jf_club jf_club = baseService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear()).and("state", "=", 1).and("club_id", "=", clubId));
|
||||
if (jf_club != null) {
|
||||
double balance = jf_club.getTotal_quota() - jf_club.getUsed_quota();
|
||||
BigDecimal bigDecimal = new BigDecimal(balance);
|
||||
double value = bigDecimal.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||
return Result.success(value);
|
||||
}
|
||||
return Result.success(0f);
|
||||
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
public Object getLastData(@Param(value = "queryString", required = false) String queryString) {
|
||||
public Object getLastData(String queryString) {
|
||||
Sql sql = Sqls.create("""
|
||||
select
|
||||
bankUserName,
|
||||
@@ -214,23 +207,81 @@ public class applyNewController {
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@At
|
||||
public Object getBudgetMoneyOrActivity(@Param(value = "jf_source") String jf_source, String clubId, String unionId, String id) {
|
||||
List<String> budgetIds = baseService.dao().query(ActivityBudget.class, Cnd.where("isRepeatReimbursement", "=", 1)).stream().map(ActivityBudget::getId).toList();
|
||||
List<ReimbursementNew> reimbursementNewList = baseService.dao().query(ReimbursementNew.class,
|
||||
Cnd.NEW().andEX("id", "!=", id).and("activityId", "not in", budgetIds).and("activityId", "is not", null));
|
||||
List<String> ids = reimbursementNewList.stream().map(ReimbursementNew::getActivityId).toList();
|
||||
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and("budgetTypeCode", "=", jf_source);
|
||||
cnd.and("auditState", "=", 4);
|
||||
if (jf_source.equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
cnd.and("unionId", "=", StrUtil.isNotBlank(unionId) ? unionId : Vi.getUnionId());
|
||||
} else if (List.of("ACTIVITY_BUDGET_TYPE_THREE", "ACTIVITY_BUDGET_TYPE_FOUR").contains(jf_source)) {
|
||||
cnd.and("clubId", "=", clubId);
|
||||
}
|
||||
|
||||
cnd.andEX("id", "not in", ids);
|
||||
List<ActivityBudget> budgetList = baseService.dao().query(ActivityBudget.class, cnd);
|
||||
NutMap map = new NutMap();
|
||||
|
||||
|
||||
if (jf_source.equals("ACTIVITY_BUDGET_TYPE_ONE")) {
|
||||
jf_school school = baseService.dao().fetch(jf_school.class, Cnd.where("year", "=", DateUtil.getYear()));
|
||||
map.put("budgetMoney", school.getTotalQuota().subtract(school.getUsedQuota()));
|
||||
} else if (jf_source.equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
Cnd twoCnd = Cnd.NEW();
|
||||
twoCnd.and("year", "=", DateUtil.getYear());
|
||||
twoCnd.and("unionId", "=", StrUtil.isNotBlank(unionId) ? unionId : Vi.getUnionId());
|
||||
jf_yjgh yjgh = baseService.dao().fetch(jf_yjgh.class, twoCnd);
|
||||
map.put("budgetMoney", ObjectUtil.isNotEmpty(yjgh) ? yjgh.getTotalQuota().subtract(yjgh.getUsedQuota()) : 0);
|
||||
} else if (jf_source.equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
jf_club club = baseService.dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("club_id", "=", clubId));
|
||||
map.put("budgetMoney", ObjectUtil.isNotEmpty(club) ? club.getTotalQuota().subtract(club.getUsedQuota()) : 0);
|
||||
} else if (jf_source.equals("ACTIVITY_BUDGET_TYPE_FOUR")) {
|
||||
/* JfOther other = baseService.dao().fetch(JfOther.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("clubId", "=", clubId));
|
||||
map.put("budgetMoney", ObjectUtil.isNotEmpty(other) ? other.getTotalQuota().subtract(other.getUsedQuota()) : 0);*/
|
||||
}
|
||||
map.put("activityList", budgetList);
|
||||
return Result.success(map);
|
||||
}
|
||||
|
||||
@At
|
||||
@ViReturn
|
||||
public Object getClubsByUser() {
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
id as clubid,
|
||||
name as clubName
|
||||
FROM
|
||||
sys_club
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.and(new Static(" id in (select clubid from sys_club_user where userid = '%s')"
|
||||
.formatted(ShiroUtil.getPrincipalProperty("id"))));
|
||||
cnd.and("state", "=", 930);
|
||||
sql.setCondition(cnd);
|
||||
List list = baseService.listMap(sql);
|
||||
return list;
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
public Object validRole(String val) {
|
||||
if (ShiroUtil.hasAnyRoles("sysadmin")) {
|
||||
return Result.success();
|
||||
}
|
||||
if ("2".equals(val)) {
|
||||
if (!ShiroUtil.hasAnyRoles("gh01, H04")) {
|
||||
return Result.error("分工会报销只能由分工会主席操作");
|
||||
}
|
||||
} else if ("3".equals(val)) {
|
||||
int count = baseService.dao().count(Sys_club_user.class, Cnd.where("userid", "=", ShiroUtil.getPrincipalProperty("id"))
|
||||
.and("sf", "=", 1));
|
||||
if (count == 0) {
|
||||
return Result.error("协会/协会报销只能由会长操作");
|
||||
}
|
||||
}
|
||||
return Result.success();
|
||||
public Result getBxMoneyByActivityId(String activityId, String jf_source) {
|
||||
return Result.success(reimbursementService.getBxMoneyByActivityId(activityId, jf_source));
|
||||
}
|
||||
|
||||
@At
|
||||
@RequiresPermissions("reimbursement.applyNew")
|
||||
public Result bxAddValidate(String activityId, String money, String jf_source, String clubId) {
|
||||
return reimbursementService.bxAddValidate(activityId, money, jf_source, clubId);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,502 @@
|
||||
package io.v.nutz.zhgh.reimbursement.handler;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.base.utils.Vi;
|
||||
import io.v.nutz.base.utils.ViResource;
|
||||
import io.v.nutz.sys.models.Sys_club;
|
||||
import io.v.nutz.sys.models.Sys_user;
|
||||
import io.v.nutz.sys.services.SysLocalProcessService;
|
||||
import io.v.nutz.sys.services.impl.SysLocalProcessServiceImpl;
|
||||
import io.v.nutz.web.commons.utils.ShiroUtil;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.lang.Lang;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2025/8/30 14:27
|
||||
* @description
|
||||
*/
|
||||
public enum ReimbursementToDoHandler {
|
||||
|
||||
|
||||
/**
|
||||
* 流程开始
|
||||
*/
|
||||
START_PROCESS() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
Sys_user sysUser = dao.fetch(Sys_user.class, reimbursementNew.getUserId());
|
||||
|
||||
localProcessService.startProcess(
|
||||
"【费用报销管理】" + sysUser.getUsername(),
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"费用报销申请",
|
||||
sysUser.getId(),
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list"
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 完成申请人的任务(申请拒绝的情况)
|
||||
*/
|
||||
COMPLETE_APPLY_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
localProcessService.completeTask(
|
||||
"apply_reimbursement_modify",
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
ShiroUtil.getUserId(),
|
||||
""
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 创建协会负责人任务
|
||||
*/
|
||||
CREATE_CLUB_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
List<String> loginNames = this.getLoginNames(Roles.club01, null, reimbursementNew.getClubId());
|
||||
if (Lang.isEmpty(loginNames)) {
|
||||
throw new RuntimeException("找不到下一步审核人,请联系管理员设置。");
|
||||
}
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"club_audit",
|
||||
"协会负责人审核",
|
||||
ShiroUtil.getUserId(),
|
||||
loginNames,
|
||||
"/platform/reimbursement/clubAudit",
|
||||
"/platform/reimbursement/clubAudit",
|
||||
"/platform/reimbursement/clubAudit",
|
||||
"/platform/reimbursement/clubAudit"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "协会负责人审核");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 协会负责人完成
|
||||
*/
|
||||
COMPLETE_CLUB_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
localProcessService.completeTask(
|
||||
"club_audit",
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
ShiroUtil.getUserId(),
|
||||
option
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 协会负责人退回,退回给个人节点
|
||||
*/
|
||||
CREATE_BACK_CLUB_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"club_audit_back",
|
||||
"协会负责人退回",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of(reimbursementNew.getLoginName()),
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "协会负责人退回");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建分工会任务
|
||||
*/
|
||||
CREATE_UNION_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
List<String> loginNames;
|
||||
Sys_club club = dao.fetch(Sys_club.class, Cnd.where("id", "=", reimbursementNew.getClubId()));
|
||||
//如果是协会活动就发协会挂靠的分工会主席
|
||||
if (reimbursementNew.getJf_source().equals("ACTIVITY_BUDGET_TYPE_THREE")) {
|
||||
if (StrUtil.isBlank(club.getBelongUnionId())){
|
||||
throw new RuntimeException("找不到协会所关联的分工会,请联系管理员设置。");
|
||||
}
|
||||
loginNames = this.getLoginNames(Roles.GH01, club.getBelongUnionId(), null);
|
||||
} else {
|
||||
loginNames = this.getLoginNames(Roles.GH01, Vi.getUnionId(), null);
|
||||
}
|
||||
if (Lang.isEmpty(loginNames)) {
|
||||
throw new RuntimeException("找不到下一步审核人,请联系管理员设置。");
|
||||
}
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"union_audit",
|
||||
"分工会主席审核",
|
||||
ShiroUtil.getUserId(),
|
||||
loginNames,
|
||||
"/platform/reimbursement/unionAudit",
|
||||
"/platform/reimbursement/unionAudit",
|
||||
"/platform/reimbursement/unionAudit",
|
||||
"/platform/reimbursement/unionAudit"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "分工会主席审核");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 分工会完成
|
||||
*/
|
||||
COMPLETE_UNION_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
localProcessService.completeTask(
|
||||
"union_audit",
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
ShiroUtil.getUserId(),
|
||||
option
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 分工会主席退回,退回给个人节点
|
||||
*/
|
||||
CREATE_BACK_UNION_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"union_back",
|
||||
"分工会主席退回",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of(reimbursementNew.getLoginName()),
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "分工会主席退回");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建工会办公室主管任务
|
||||
*/
|
||||
CREATE_UNION_MANAGE_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
List<String> loginNames = this.getLoginNames(Roles.XCYWT, null, null);
|
||||
if (Lang.isEmpty(loginNames)) {
|
||||
throw new RuntimeException("找不到下一步审核人,请联系管理员设置。");
|
||||
}
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"union_manage_audit",
|
||||
"工会办公室主管审核",
|
||||
ShiroUtil.getUserId(),
|
||||
loginNames,
|
||||
"/platform/reimbursement/unionManageAudit",
|
||||
"/platform/reimbursement/unionManageAudit",
|
||||
"/platform/reimbursement/unionManageAudit",
|
||||
"/platform/reimbursement/unionManageAudit"
|
||||
);
|
||||
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "工会办公室主管审核");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 工会办公室主管完成
|
||||
*/
|
||||
COMPLETE_UNION_MANAGE_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
localProcessService.completeTask(
|
||||
"union_manage_audit",
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
ShiroUtil.getUserId(),
|
||||
option
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 工会办公室主管退回,退回给个人节点
|
||||
*/
|
||||
CREATE_BACK_UNION_MANAGE_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"union_manage_audit_back",
|
||||
"工会办公室主管退回",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of(reimbursementNew.getLoginName()),
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "工会办公室主管退回");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建工会副主席任务
|
||||
*/
|
||||
CREATE_VICE_CHAIRMAN_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
List<String> loginNames = this.getLoginNames(Roles.WYH01, null, null);
|
||||
if (Lang.isEmpty(loginNames)) {
|
||||
throw new RuntimeException("找不到下一步审核人,请联系管理员设置。");
|
||||
}
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"vice_chairman_audit",
|
||||
"工会副主席审核",
|
||||
ShiroUtil.getUserId(),
|
||||
loginNames,
|
||||
"/platform/reimbursement/viceChairmanAudit",
|
||||
"/platform/reimbursement/viceChairmanAudit",
|
||||
"/platform/reimbursement/viceChairmanAudit",
|
||||
"/platform/reimbursement/viceChairmanAudit"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "工会副主席审核");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 工会副主席完成
|
||||
*/
|
||||
COMPLETE_VICE_CHAIRMAN_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
localProcessService.completeTask(
|
||||
"vice_chairman_audit",
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
ShiroUtil.getUserId(),
|
||||
option
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 工会副主席退回,退回给个人节点
|
||||
*/
|
||||
CREATE_BACK_VICE_CHAIRMAN_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"vice_chairman_audit_back",
|
||||
"工会副主席退回",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of(reimbursementNew.getLoginName()),
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "工会副主席退回");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 创建工会主席任务
|
||||
*/
|
||||
CREATE_STANDING_VICE_CHAIRMAN_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
List<String> loginNames = this.getLoginNames(Roles.XGH02, null, null);
|
||||
if (Lang.isEmpty(loginNames)) {
|
||||
throw new RuntimeException("找不到下一步审核人,请联系管理员设置。");
|
||||
}
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"standing_vice_chairman_audit",
|
||||
"工会主席审核",
|
||||
ShiroUtil.getUserId(),
|
||||
loginNames,
|
||||
"/platform/reimbursement/standingViceChairmanAudit",
|
||||
"/platform/reimbursement/standingViceChairmanAudit",
|
||||
"/platform/reimbursement/standingViceChairmanAudit",
|
||||
"/platform/reimbursement/standingViceChairmanAudit"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "工会主席审核");
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 工会主席完成
|
||||
*/
|
||||
COMPLETE_STANDING_VICE_CHAIRMAN_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
localProcessService.completeTask(
|
||||
"standing_vice_chairman_audit",
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
ShiroUtil.getUserId(),
|
||||
option
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 工会主席退回,退回给个人节点
|
||||
*/
|
||||
CREATE_BACK_STANDING_VICE_CHAIRMAN_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"standing_vice_chairman_audit_back",
|
||||
"工会主席退回",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of(reimbursementNew.getLoginName()),
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "工会主席退回");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 创建会计审核任务
|
||||
*/
|
||||
CREATE_FINANCE_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
List<String> loginNames = this.getLoginNames(Roles.SCHOOL_UNION_ACCOUNTANT, null, null);
|
||||
if (Lang.isEmpty(loginNames)) {
|
||||
throw new RuntimeException("找不到下一步审核人,请联系管理员设置。");
|
||||
}
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"finance_audit",
|
||||
"会计审核",
|
||||
ShiroUtil.getUserId(),
|
||||
loginNames,
|
||||
"/platform/reimbursement/financeAudit",
|
||||
"/platform/reimbursement/financeAudit",
|
||||
"/platform/reimbursement/financeAudit",
|
||||
"/platform/reimbursement/financeAudit"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "会计审核");
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 会计审核完成
|
||||
*/
|
||||
COMPLETE_FINANCE_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
localProcessService.completeTask(
|
||||
"finance_audit",
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
ShiroUtil.getUserId(),
|
||||
option
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 会计审核退回,退回给个人节点
|
||||
*/
|
||||
CREATE_BACK_FINANCE_TASK() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
|
||||
localProcessService.createTask(
|
||||
"reimbursement@" + reimbursementNew.getId(),
|
||||
"finance_audit",
|
||||
"会计退回",
|
||||
ShiroUtil.getUserId(),
|
||||
List.of(reimbursementNew.getLoginName()),
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list",
|
||||
"/activity/reimbursement/list"
|
||||
);
|
||||
localProcessService.updateProcessNodeName("reimbursement@" + reimbursementNew.getId(), "会计退回");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 流程结束
|
||||
*/
|
||||
COMPLETE_PROCESS() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
localProcessService.completeProcess("reimbursement@" + reimbursementNew.getId());
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
DELETE_PROCESS() {
|
||||
@Override
|
||||
public void exec(ReimbursementNew reimbursementNew, String option) {
|
||||
localProcessService.deleteProcessInstance("reimbursement@" + reimbursementNew.getId());
|
||||
}
|
||||
};
|
||||
|
||||
public List<String> getLoginNames(String roleCode, String unionId, String clubId) {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
cnd.andEX("sur.unionid", "=", unionId);
|
||||
cnd.andEX("sur.roleId", "=", roleCode);
|
||||
cnd.andEX("sur.stid", "=", clubId);
|
||||
cnd.groupBy("sur.userId");
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
u.loginname
|
||||
FROM
|
||||
sys_user_role sur
|
||||
LEFT JOIN sys_user u ON u.id = sur.userid
|
||||
$condition
|
||||
""");
|
||||
sql.setCondition(cnd);
|
||||
sql.setCallback(Sqls.callback.strs());
|
||||
dao.execute(sql);
|
||||
List<String> loginNames = sql.getList(String.class);
|
||||
return loginNames;
|
||||
}
|
||||
|
||||
;
|
||||
|
||||
|
||||
public abstract void exec(ReimbursementNew reimbursementNew, String option);
|
||||
|
||||
public Dao dao = ViResource.dao;
|
||||
public SysLocalProcessService localProcessService = ViResource.ioc.get(SysLocalProcessServiceImpl.class);
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import org.nutz.dao.entity.annotation.*;
|
||||
import org.nutz.dao.interceptor.annotation.PrevInsert;
|
||||
import org.nutz.integration.json4excel.annotation.J4EIgnore;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -60,10 +61,15 @@ public class ReimbursementNew {
|
||||
private String unitId;
|
||||
|
||||
@Column
|
||||
@Comment("协会id")
|
||||
@Comment("社团id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String clubId;
|
||||
|
||||
@Column
|
||||
@Comment("社团id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String newClubId;
|
||||
|
||||
@Column
|
||||
@Comment("工会")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 30)
|
||||
@@ -79,6 +85,11 @@ public class ReimbursementNew {
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String jf_source;
|
||||
|
||||
@Column
|
||||
@Comment("新报销经费来源")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String new_jf_source;
|
||||
|
||||
|
||||
@Column
|
||||
@Comment("慰问人电话")
|
||||
@@ -164,14 +175,39 @@ public class ReimbursementNew {
|
||||
private List<Sys_file> files;
|
||||
|
||||
@Column
|
||||
@Comment("经办人签字id")
|
||||
@Comment("经办人签字")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String signUrl;
|
||||
|
||||
@Column
|
||||
@Comment("协会审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String signId;
|
||||
private String clubAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("分工会审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("会计审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String accountingAuditId;
|
||||
private String financeAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("出纳审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String viceChairmanAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("工会办公室主管审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String unionManageAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("校工会主席审核id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String standingViceChairmanAuditId;
|
||||
|
||||
@Column
|
||||
@Comment("单据号")
|
||||
@@ -224,9 +260,8 @@ public class ReimbursementNew {
|
||||
|
||||
@Column
|
||||
@Comment("慰问金额")
|
||||
@J4EIgnore
|
||||
@ColDefine(type = ColType.FLOAT, width = 10, precision = 2)
|
||||
private Double money;
|
||||
@ColDefine(customType = "decimal(10,2)")
|
||||
private BigDecimal money;
|
||||
|
||||
@Column
|
||||
@Comment("住院开始时间")
|
||||
@@ -290,7 +325,7 @@ public class ReimbursementNew {
|
||||
|
||||
@Column
|
||||
@Comment("活动名称")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 50)
|
||||
@ColDefine(type = ColType.VARCHAR, width = 100)
|
||||
private String activity_name;
|
||||
|
||||
@Column
|
||||
@@ -299,7 +334,7 @@ public class ReimbursementNew {
|
||||
private String activity_number;
|
||||
|
||||
@Column
|
||||
@Comment("活动类型(1.基层工会,2.校工会,3.协会)")
|
||||
@Comment("活动类型(1.基层工会,2.校工会,3.社团)")
|
||||
@ColDefine(type = ColType.INT, width = 2)
|
||||
private Integer activity_type;
|
||||
|
||||
@@ -307,4 +342,19 @@ public class ReimbursementNew {
|
||||
@Comment("发票号码")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 300)
|
||||
private String billNumber;
|
||||
|
||||
@Column
|
||||
@Comment("活动id")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String activityId;
|
||||
|
||||
@Column
|
||||
@Comment("明细类")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String detailsTypeId;
|
||||
|
||||
@Column
|
||||
@Comment("上账明细")
|
||||
@ColDefine(type = ColType.VARCHAR, width = 32)
|
||||
private String accountViewId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package io.v.nutz.zhgh.reimbursement.models;
|
||||
|
||||
import io.v.nutz.base.query.PageForm;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName ReimbursementPageForm
|
||||
* @Description TODO
|
||||
* @Author zhf
|
||||
* @Date 2025/3/20 上午8:59
|
||||
*/
|
||||
@Data
|
||||
public class ReimbursementPageForm extends PageForm {
|
||||
|
||||
String unitId;
|
||||
|
||||
String unionId;
|
||||
|
||||
String clubId;
|
||||
|
||||
Integer year;
|
||||
|
||||
String jf_source;
|
||||
|
||||
String detailsTypeId;
|
||||
|
||||
Integer isAudit;
|
||||
|
||||
List<String> reimbursementDate;
|
||||
|
||||
String accountViewId;
|
||||
|
||||
|
||||
}
|
||||
@@ -1,16 +1,35 @@
|
||||
package io.v.nutz.zhgh.reimbursement.services;
|
||||
|
||||
import io.v.nutz.zhgh.reimbursement.models.Reimbursement;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.service.ViService;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/3 10:16
|
||||
* @description
|
||||
*/
|
||||
public interface ReimbursementService extends ViService<Reimbursement> {
|
||||
public interface ReimbursementService extends ViService<ReimbursementNew> {
|
||||
|
||||
NutMap findOne(String id);
|
||||
|
||||
List<NutMap> getClubsByRole();
|
||||
|
||||
|
||||
Result bxAddValidate(String activityId, String money, String jf_source,String clubId);
|
||||
|
||||
/**
|
||||
* 查询已经报销了的金额
|
||||
* 1.如果是校工会进来的,就查询这个项目关联的分工会预算总额
|
||||
* 2.如果是其他,就查这个项目已经报销了的
|
||||
* @param activityId
|
||||
* @param jf_source
|
||||
* @return
|
||||
*/
|
||||
BigDecimal getBxMoneyByActivityId(String activityId,String jf_source);
|
||||
|
||||
}
|
||||
|
||||
+212
-10
@@ -1,25 +1,38 @@
|
||||
package io.v.nutz.zhgh.reimbursement.services.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.wizzer.framework.base.Result;
|
||||
import io.v.nutz.base.service.AuditService;
|
||||
import io.v.nutz.zhgh.reimbursement.models.Reimbursement;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import io.v.nutz.base.service.impl.ViServiceImpl;
|
||||
import io.v.nutz.base.utils.DateUtil;
|
||||
import io.v.nutz.base.utils.Roles;
|
||||
import io.v.nutz.zhgh.activityBudget.models.ActivityBudget;
|
||||
import io.v.nutz.zhgh.jf.model.jf_club;
|
||||
import io.v.nutz.zhgh.reimbursement.constants.ReimbursementState;
|
||||
import io.v.nutz.zhgh.reimbursement.models.ReimbursementNew;
|
||||
import io.v.nutz.zhgh.reimbursement.services.ReimbursementService;
|
||||
import org.nutz.dao.Cnd;
|
||||
import org.nutz.dao.Dao;
|
||||
import org.nutz.dao.Sqls;
|
||||
import org.nutz.dao.sql.Sql;
|
||||
import org.nutz.ioc.loader.annotation.Inject;
|
||||
import org.nutz.ioc.loader.annotation.IocBean;
|
||||
import org.nutz.lang.Lang;
|
||||
import org.nutz.lang.Strings;
|
||||
import org.nutz.lang.util.NutMap;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhf
|
||||
* @date 2021/6/3 10:17
|
||||
* @description
|
||||
*/
|
||||
@IocBean(args = {"refer:dao"})
|
||||
public class ReimbursementServiceImpl extends ViServiceImpl<Reimbursement> implements ReimbursementService {
|
||||
public class ReimbursementServiceImpl extends ViServiceImpl<ReimbursementNew> implements ReimbursementService {
|
||||
@Inject
|
||||
private AuditService auditService;
|
||||
|
||||
@@ -37,15 +50,16 @@ public class ReimbursementServiceImpl extends ViServiceImpl<Reimbursement> imple
|
||||
be.loginname be_loginname,
|
||||
state.stateName,
|
||||
state.stateColor,
|
||||
type.`name` typeName,
|
||||
type.`code` typeCode,
|
||||
sign.`data` jbrSignData
|
||||
cl.`name` clubName,
|
||||
cl2.`name` nweClubName,
|
||||
un.unionname AS newUnionName
|
||||
FROM
|
||||
`reimbursement_new` rei
|
||||
LEFT JOIN sys_user be ON be.id = rei.be_user
|
||||
LEFT JOIN audit_state state ON state.stateId = rei.state
|
||||
LEFT JOIN sys_signature sign ON sign.id = rei.signId
|
||||
LEFT JOIN condolence_type type ON type.id=rei.type
|
||||
LEFT JOIN sys_club cl ON cl.id = rei.clubId
|
||||
LEFT JOIN sys_club cl2 ON cl2.id = rei.newClubId
|
||||
LEFT JOIN sys_union un ON un.id = rei.unionId
|
||||
$condition
|
||||
""");
|
||||
Cnd cnd = Cnd.NEW();
|
||||
@@ -53,11 +67,199 @@ public class ReimbursementServiceImpl extends ViServiceImpl<Reimbursement> imple
|
||||
sql.setCondition(cnd);
|
||||
NutMap record = listMap(sql).get(0);
|
||||
|
||||
if (Strings.isNotBlank(record.getString("accountingAuditId"))) {
|
||||
record.setv("accounting", auditService.fetch(record.getString("accountingAuditId")));
|
||||
if (Strings.isNotBlank(record.getString("clubAuditId"))) {
|
||||
record.setv("clubAudit", auditService.fetch(record.getString("clubAuditId")));
|
||||
}
|
||||
if (Strings.isNotBlank(record.getString("unionAuditId"))) {
|
||||
record.setv("unionAudit", auditService.fetch(record.getString("unionAuditId")));
|
||||
}
|
||||
if (Strings.isNotBlank(record.getString("unionManageAuditId"))) {
|
||||
record.setv("unionManageAudit", auditService.fetch(record.getString("unionManageAuditId")));
|
||||
}
|
||||
if (Strings.isNotBlank(record.getString("financeAuditId"))) {
|
||||
record.setv("financeAudit", auditService.fetch(record.getString("financeAuditId")));
|
||||
}
|
||||
|
||||
if (Strings.isNotBlank(record.getString("viceChairmanAuditId"))) {
|
||||
record.setv("viceChairmanAudit", auditService.fetch(record.getString("viceChairmanAuditId")));
|
||||
}
|
||||
if (Strings.isNotBlank(record.getString("standingViceChairmanAuditId"))) {
|
||||
record.setv("standingViceChairmanAudit", auditService.fetch(record.getString("standingViceChairmanAuditId")));
|
||||
}
|
||||
|
||||
|
||||
return record;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NutMap> getClubsByRole() {
|
||||
Cnd cnd = Cnd.NEW();
|
||||
Sql sql = Sqls.create("""
|
||||
SELECT
|
||||
club.id as stid,
|
||||
role.userId,
|
||||
club.`name`,
|
||||
club.foundTime,
|
||||
club.dues_standard,
|
||||
club.`code`
|
||||
FROM
|
||||
sys_club club
|
||||
LEFT JOIN `sys_user_role` role ON club.id = role.stid
|
||||
$condition
|
||||
""");
|
||||
cnd.and("club.isjs", "=", false);
|
||||
cnd.and("club.state", "=", 930);
|
||||
cnd.groupBy("club.id");
|
||||
cnd.asc("club.`code`");
|
||||
sql.setCondition(cnd);
|
||||
return listMap(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result bxAddValidate(String activityId, String money, String jf_source, String clubId) {
|
||||
if (StrUtil.hasEmpty(jf_source, money)) {
|
||||
return Result.error("请填写【活动类型、金额】");
|
||||
}
|
||||
BigDecimal moneyBig = new BigDecimal(money);
|
||||
if (List.of("ACTIVITY_BUDGET_TYPE_TWO", "ACTIVITY_BUDGET_TYPE_ONE").contains(jf_source)) {
|
||||
ActivityBudget budget = dao().fetch(ActivityBudget.class, Cnd.where("id", "=", activityId));
|
||||
if (jf_source.equals("ACTIVITY_BUDGET_TYPE_TWO")) {
|
||||
//判断是否可以重复报
|
||||
if (budget.getIsRepeatReimbursement()) {
|
||||
//1.查询已经报销了的总金额
|
||||
BigDecimal bXMoney = getBxMoneyByActivityId(activityId, jf_source);
|
||||
if (budget.getIsSchoolBudget()) {
|
||||
//如果是分工会进来并且报销的活动是校会预算
|
||||
// 1. 计算本次加上之前的报销总金额
|
||||
BigDecimal totalReimbursement = bXMoney.add(moneyBig);
|
||||
// 2. 判断是否超出预算
|
||||
if (totalReimbursement.compareTo(budget.getTotalBudgetMoney()) > 0) {
|
||||
return Result.error("该活动预算金额不足!");
|
||||
} else {
|
||||
return Result.success();
|
||||
}
|
||||
} else {
|
||||
//如果是自己的项目就能超20%
|
||||
//1.算出现在还能报销多少钱
|
||||
BigDecimal twentyPercent = budget.getTotalBudgetMoney().multiply(new BigDecimal("20")).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal totalBudgetMoney = budget.getTotalBudgetMoney().add(twentyPercent);
|
||||
// 2. 计算本次加上之前的报销总金额
|
||||
BigDecimal totalReimbursement = bXMoney.add(moneyBig);
|
||||
// 3. 判断是否超出预算的 20%
|
||||
if (totalReimbursement.compareTo(totalBudgetMoney) > 0) {
|
||||
return Result.error("该活动预算金额不足!");
|
||||
} else {
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//分工会进来报销自己的预算
|
||||
//正常判断这个活动是否超出预算
|
||||
//算出现在还能报销多少钱
|
||||
//判断是否超出预算的 20%
|
||||
BigDecimal twentyPercent = budget.getTotalBudgetMoney().multiply(new BigDecimal("20")).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal totalBudgetMoney = budget.getTotalBudgetMoney().add(twentyPercent);
|
||||
if (moneyBig.compareTo(totalBudgetMoney) > 0) {
|
||||
return Result.error("该活动预算金额不足!");
|
||||
} else {
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//如果是校工会进来
|
||||
|
||||
//如果报销的项目是可以重复报销的
|
||||
if (budget.getIsRepeatReimbursement()) {
|
||||
List<ReimbursementNew> newList = dao().query(ReimbursementNew.class, Cnd.where("activityId", "=", activityId)
|
||||
.and("State", "=", ReimbursementState.SUCCESSFUL_REIMBURSEMENT));
|
||||
//已报销l的金额
|
||||
BigDecimal totalMoney = newList.stream()
|
||||
.map(ReimbursementNew::getMoney)
|
||||
.filter(Objects::nonNull) // 避免 null 值导致计算错误
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
if (budget.getIsSchoolBudget()) {
|
||||
//如果报销的项目是分工会也能报校工会也能报,就要减去所有已分配分工会的钱在算能报销多少钱。
|
||||
//分配分工会的钱在算能报销多少钱
|
||||
BigDecimal unionTotalMoney = getBxMoneyByActivityId(activityId, jf_source);
|
||||
//找出能报销多少钱
|
||||
BigDecimal totalBudgetMoney = budget.getTotalBudgetMoney().subtract(unionTotalMoney);
|
||||
//已报销加上现在的钱
|
||||
BigDecimal totalReimbursement = totalMoney.add(moneyBig);
|
||||
if (totalReimbursement.compareTo(totalBudgetMoney) > 0) {
|
||||
return Result.error("该活动预算金额不足!");
|
||||
} else {
|
||||
return Result.success();
|
||||
}
|
||||
} else {
|
||||
//正常判断这个活动是否超出预算
|
||||
//算出现在还能报销多少钱,判断是否超出预算的 20%
|
||||
|
||||
//1.算出现在还能报销多少钱
|
||||
BigDecimal twentyPercent = budget.getTotalBudgetMoney().multiply(new BigDecimal("20")).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal totalBudgetMoney = budget.getTotalBudgetMoney().add(twentyPercent);
|
||||
//2. 计算本次加上之前的报销总金额
|
||||
BigDecimal totalReimbursement = totalMoney.add(moneyBig);
|
||||
// 3. 判断是否超出预算的 20%
|
||||
if (totalReimbursement.compareTo(totalBudgetMoney) > 0) {
|
||||
return Result.error("该活动预算金额不足!");
|
||||
} else {
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
//正常判断这个活动是否超出预算
|
||||
//算出现在还能报销多少钱,判断是否超出预算的 20%
|
||||
BigDecimal twentyPercent = budget.getTotalBudgetMoney().multiply(new BigDecimal("20")).divide(new BigDecimal("100"), 2, BigDecimal.ROUND_HALF_UP);
|
||||
BigDecimal totalBudgetMoney = budget.getTotalBudgetMoney().add(twentyPercent);
|
||||
if (moneyBig.compareTo(totalBudgetMoney) > 0) {
|
||||
return Result.error("该活动预算金额不足!");
|
||||
} else {
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
} else if ("ACTIVITY_BUDGET_TYPE_THREE".equals(jf_source)) {
|
||||
//如果进来的是协会
|
||||
jf_club jfClub = dao().fetch(jf_club.class, Cnd.where("year", "=", DateUtil.getYear())
|
||||
.and("club_id", "=", clubId));
|
||||
if (ObjectUtil.isEmpty(jfClub)) {
|
||||
return Result.error("该年份没有设置金额!");
|
||||
}
|
||||
if (jfClub.getTotalQuota().subtract(jfClub.getUsedQuota()).compareTo(moneyBig) < 0) {
|
||||
return Result.error("剩余配额不足!剩余:" + jfClub.getTotalQuota().subtract(jfClub.getUsedQuota()));
|
||||
} else {
|
||||
return Result.success();
|
||||
}
|
||||
} else if ("ACTIVITY_BUDGET_TYPE_FOUR".equals(jf_source)) {
|
||||
//如果进来的是其他项目
|
||||
} else {
|
||||
return Result.error("暂时不能报销!");
|
||||
}
|
||||
return Result.error("参数错误");
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal getBxMoneyByActivityId(String activityId, String jf_source) {
|
||||
if ("ACTIVITY_BUDGET_TYPE_ONE".equals(jf_source)) {
|
||||
ActivityBudget budget = dao().fetch(ActivityBudget.class, Cnd.where("id", "=", activityId));
|
||||
List<ActivityBudget> budgetList = dao().query(ActivityBudget.class, Cnd.where("schoolBudgetId", "=", budget.getId()));
|
||||
BigDecimal totalMoney = budgetList.stream()
|
||||
.map(ActivityBudget::getTotalBudgetMoney)
|
||||
.filter(Objects::nonNull) // 避免 null 值导致计算错误
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
return totalMoney;
|
||||
} else {
|
||||
List<ReimbursementNew> newList = dao().query(ReimbursementNew.class, Cnd.where("activityId", "=", activityId)
|
||||
.and("State", "=", ReimbursementState.SUCCESSFUL_REIMBURSEMENT));
|
||||
BigDecimal totalMoney = newList.stream()
|
||||
.map(ReimbursementNew::getMoney)
|
||||
.filter(Objects::nonNull) // 避免 null 值导致计算错误
|
||||
.reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
return totalMoney;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
<template>
|
||||
|
||||
<div class="activityBudget">
|
||||
<vi-title title="申报信息"></vi-title>
|
||||
<el-descriptions :column="3" border class="table_fixed">
|
||||
<el-descriptions-item label="申报人">
|
||||
{{ viewData.userName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">
|
||||
{{ viewData.loginName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系方式">
|
||||
{{ viewData.mobile }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="预算类型">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="viewData.budgetTypeCode"></dict-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申报(承办)单位">
|
||||
{{ viewData.helpUnitName }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动项目">
|
||||
{{ viewData.activityMatter }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="活动时间">
|
||||
{{ viewData.activityDate }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申报预算金额(元)">
|
||||
{{ viewData.declareTotalBudgetMoney }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="最终预算金额(元)">
|
||||
{{ viewData.totalBudgetMoney }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="申报时间">
|
||||
{{ viewData.applyDate }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2"></el-descriptions-item>
|
||||
<el-descriptions-item label="活动内容(如训练、装备等)" :span="3">
|
||||
<div v-html="viewData.activityContent"></div>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="项目明细" span="3"
|
||||
v-if="viewData.budgetDetails&&viewData.budgetDetails.length>0">
|
||||
<el-table :data="viewData.budgetDetails"
|
||||
:summary-method="getSummaries"
|
||||
border
|
||||
show-summary
|
||||
size="mini"
|
||||
style="width: 100%">
|
||||
<el-table-column label="序号" sortable type="index"
|
||||
width="100"></el-table-column>
|
||||
<el-table-column label="类别" prop="detailName"></el-table-column>
|
||||
<el-table-column label="预算金额(元)" prop="budgetMoney"></el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div v-if="viewData.auditState>1&&viewData.schoolAuditId" class="mt20">
|
||||
<vi-title title="校工会审核信息"></vi-title>
|
||||
<el-descriptions :column="3" border class="table_fixed">
|
||||
<el-descriptions-item label="审核人">
|
||||
{{ viewData.schoolAudit.username }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">
|
||||
{{ viewData.schoolAudit.loginname }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间">
|
||||
{{ viewData.schoolAudit.auditTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见">
|
||||
{{ viewData.schoolAudit.auditOpinion }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div v-if="viewData.allocationEditAuditList&&viewData.allocationEditAuditList.length>0" class="mt20">
|
||||
<vi-title title="管理员编辑信息"></vi-title>
|
||||
<div v-for="(item,index) in viewData.allocationEditAuditList" :key="index">
|
||||
<el-descriptions :column="3" border class="table_fixed">
|
||||
<el-descriptions-item label="审核人">
|
||||
{{ item.username }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">
|
||||
{{ item.loginname }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间">
|
||||
{{ item.auditTime }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="编辑前金额">
|
||||
{{ item.ext.money }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item span="2"></el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见" span="3">
|
||||
{{ item.auditOpinion }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核附件" span="3">
|
||||
<file-upload :files.sync="item.ext.files" view></file-upload>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="handle">
|
||||
|
||||
<slot name="handle"></slot>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
module.exports = {
|
||||
props: {
|
||||
handle: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
default: '审核'
|
||||
},
|
||||
panes: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName: "1",
|
||||
viewData: {},
|
||||
budgetTypeOption: [],
|
||||
loading: true,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasPane(name) {
|
||||
if (!this.handle) {
|
||||
return true
|
||||
}
|
||||
return this.panes.includes(name)
|
||||
},
|
||||
async getInfo(id) {
|
||||
this.loading = true
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
const {data, code, msg} = await $.get("/platform/activity/budget/applyList/findOne", {id})
|
||||
this.loading = false
|
||||
if (data) {
|
||||
this.activeName = this.handle ? "999" : "1"
|
||||
this.viewData = data
|
||||
|
||||
} else {
|
||||
this.viewData = {}
|
||||
this.$message({
|
||||
message: "获取信息失败",
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (index === 2 || index === 3) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0).toFixed(2);
|
||||
sums[index] += ' 元';
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,29 +1,8 @@
|
||||
/**
|
||||
*Desc:
|
||||
*Create by: jug
|
||||
*Create time:2023/7/28/9:55
|
||||
*/
|
||||
<template>
|
||||
<div>
|
||||
<template v-for="(item, index) in options">
|
||||
<template v-if="values.includes(item.value)">
|
||||
<span
|
||||
v-if="item.raw.listClass == 'default' || item.raw.listClass == ''"
|
||||
:key="item.value"
|
||||
:index="index"
|
||||
:class="item.raw.cssClass"
|
||||
>{{ item.label }}</span
|
||||
>
|
||||
<van-tag
|
||||
v-else
|
||||
:disable-transitions="true"
|
||||
:key="item.value"
|
||||
:index="index"
|
||||
:type="item.raw.listClass == 'primary' ? '' : item.raw.listClass"
|
||||
:class="item.raw.cssClass"
|
||||
>
|
||||
{{ item.label }}
|
||||
</van-tag>
|
||||
<template v-if="values.includes(item[option_value])">
|
||||
<span :key="item.value">{{ item[option_label] }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</div>
|
||||
@@ -35,19 +14,27 @@ module.exports = {
|
||||
props: {
|
||||
options: {
|
||||
type: Array,
|
||||
default: null,
|
||||
default: null
|
||||
},
|
||||
value: [Number, String, Array],
|
||||
option_value: {
|
||||
type: String,
|
||||
default: "code"
|
||||
},
|
||||
option_label: {
|
||||
type: String,
|
||||
default: "name"
|
||||
},
|
||||
value: [Number, String, Array]
|
||||
},
|
||||
computed: {
|
||||
values() {
|
||||
if (this.value !== null && typeof this.value !== 'undefined') {
|
||||
return Array.isArray(this.value) ? this.value : [String(this.value)];
|
||||
if (this.value !== null && typeof this.value !== "undefined") {
|
||||
return Array.isArray(this.value) ? this.value : [String(this.value)]
|
||||
} else {
|
||||
return [];
|
||||
return []
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -55,4 +42,4 @@ module.exports = {
|
||||
.el-tag + .el-tag {
|
||||
margin-left: 10px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
<div>
|
||||
<el-tabs tab-position="top" v-model="activeName" v-loading="loading" class="ml25">
|
||||
<el-tab-pane label="申请信息" name="1">
|
||||
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" class="ml25">
|
||||
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" class="ml25"
|
||||
label-width="140px">
|
||||
<el-row gutter="60">
|
||||
|
||||
<el-col :span="12">
|
||||
@@ -17,47 +18,73 @@
|
||||
{{ viewData.mobile }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销类别">
|
||||
{{ viewData.reimbursementItemSort === 'fy' ? '费用报销' : '支付凭证' }}
|
||||
<el-form-item label="活动类型">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="viewData.jf_source"></dict-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销类别">
|
||||
{{ viewData.reimbursementItemSort === 'fy' ? '费用报销' : '支付凭证' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销项目">
|
||||
{{ viewData.reimbursementItemName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="支付方式">
|
||||
{{ viewData.paymentMethodName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
-->
|
||||
|
||||
<!--
|
||||
<el-col :span="12">
|
||||
<el-form-item label="户名">
|
||||
{{ viewData.bankUserName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
-->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销项目">
|
||||
{{ viewData.reimbursementItemName }}
|
||||
<el-form-item label="申报单位">
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_ONE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(viewData.jf_source)">校工会</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(viewData.jf_source)&&['4270', '4330', '4450'].includes(viewData.unitId)">{{viewData.unitName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(viewData.jf_source)&&!['4270', '4330', '4450'].includes(viewData.unitId)">{{viewData.unionName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_THREE'].includes(viewData.jf_source)">{{viewData.clubName}}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12" v-if="viewData.jf_source==='ACTIVITY_BUDGET_TYPE_TWO'">
|
||||
<el-form-item label="所属工会">
|
||||
{{ viewData.newUnionName }}
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<!--
|
||||
<el-col :span="12">
|
||||
<el-form-item label="银行账号">
|
||||
{{ viewData.bankCardNumber }}
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="支付方式">
|
||||
{{ viewData.paymentMethodName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户行">
|
||||
{{ viewData.bankOfDeposit }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="户名">
|
||||
{{ viewData.bankUserName }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="银行账号">
|
||||
{{ viewData.bankCardNumber }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户行">
|
||||
{{ viewData.bankOfDeposit }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
-->
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-row gutter="60" v-if="viewData.reimbursementItemId==='fyww'||viewData.reimbursementItemId==='zfww'">
|
||||
<el-row gutter="60"
|
||||
v-if="viewData.reimbursementItemId==='fyww'||viewData.reimbursementItemId==='zfww'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="慰问对象">
|
||||
{{ viewData.be_username }}({{ viewData.be_loginname }})
|
||||
@@ -185,11 +212,11 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col v-if="viewData.reimbursementItemId=='fyhd'" :span="12">
|
||||
<el-form-item label="活动类型">
|
||||
{{ viewData.activity_type === '1' ? '分工会活动' : viewData.activity_type === '2' ? '校工会活动' : '协会活动' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col v-if="viewData.reimbursementItemId=='fyhd'" :span="12">
|
||||
<el-form-item label="活动类型">
|
||||
{{ viewData.activity_type === '1' ? '分工会活动' : viewData.activity_type === '2' ? '校工会活动' : '协会(社团)活动' }}
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
|
||||
<el-col :span="12" v-if="viewData.activity_number">
|
||||
@@ -199,11 +226,11 @@
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动地点">
|
||||
{{ viewData.venue }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="活动地点">
|
||||
{{ viewData.venue }}
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销金额">
|
||||
@@ -217,17 +244,17 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票张数">
|
||||
{{ viewData.files_num }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="发票张数">
|
||||
{{ viewData.files_num }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票号码">
|
||||
{{ viewData.billNumber }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="发票号码">
|
||||
{{ viewData.billNumber }}
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
</el-row>
|
||||
|
||||
|
||||
@@ -239,11 +266,11 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ viewData.remark }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="备注">
|
||||
{{ viewData.remark }}
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
<el-col :span="24">
|
||||
|
||||
@@ -253,30 +280,191 @@
|
||||
<span v-else>暂无</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字">
|
||||
<el-image style="width: 200px;height:auto"
|
||||
:src="'/signature/getSignData?path=' +viewData.signUrl"></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="审核信息" name="2" v-if="viewData.accountingAuditId">
|
||||
<el-tab-pane label="协会审核信息" name="2" v-if="viewData.clubAuditId">
|
||||
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" class="ml25">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人">
|
||||
{{ viewData.accounting.username }}({{ viewData.accounting.loginname }})
|
||||
{{ viewData.clubAudit.username }}({{ viewData.clubAudit.loginname }})
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间">
|
||||
{{ viewData.accounting.auditTime }}
|
||||
{{ viewData.clubAudit.auditTime }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见">
|
||||
{{ viewData.accounting.auditOpinion ? viewData.accounting.auditOpinion : '暂无' }}
|
||||
{{ viewData.clubAudit.auditOpinion ? viewData.clubAudit.auditOpinion : '暂无' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字">
|
||||
<el-image style="width: 200px;height:auto"
|
||||
:src="'/signature/getSignData?path=' +viewData.clubAudit.auditSign"></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="分工会主席审核信息" name="3" v-if="viewData.unionAuditId">
|
||||
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" class="ml25">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人">
|
||||
{{ viewData.unionAudit.username }}({{ viewData.unionAudit.loginname }})
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间">
|
||||
{{ viewData.unionAudit.auditTime }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见">
|
||||
{{ viewData.unionAudit.auditOpinion ? viewData.unionAudit.auditOpinion : '暂无' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字">
|
||||
<el-image style="width: 200px;height:auto"
|
||||
:src="'/signature/getSignData?path=' +viewData.unionAudit.auditSign"></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="工会办公室主管审核信息" name="4" v-if="viewData.unionManageAuditId">
|
||||
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" class="ml25">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人">
|
||||
{{ viewData.unionManageAudit.username }}({{ viewData.unionManageAudit.loginname }})
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间">
|
||||
{{ viewData.unionManageAudit.auditTime }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见">
|
||||
{{ viewData.unionManageAudit.auditOpinion ? viewData.unionManageAudit.auditOpinion : '暂无' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字">
|
||||
<el-image style="width: 200px;height:auto"
|
||||
:src="'/signature/getSignData?path=' +viewData.unionManageAudit.auditSign"></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="工会副主席审核信息" name="5" v-if="viewData.viceChairmanAuditId">
|
||||
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" class="ml25">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人">
|
||||
{{ viewData.viceChairmanAudit.username }}({{ viewData.viceChairmanAudit.loginname }})
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间">
|
||||
{{ viewData.viceChairmanAudit.auditTime }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见">
|
||||
{{ viewData.viceChairmanAudit.auditOpinion ? viewData.viceChairmanAudit.auditOpinion : '暂无' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字">
|
||||
<el-image style="width: 200px;height:auto"
|
||||
:src="'/signature/getSignData?path=' +viewData.viceChairmanAudit.auditSign"></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="工会主席信息" name="6" v-if="viewData.standingViceChairmanAuditId">
|
||||
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" class="ml25">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人">
|
||||
{{ viewData.standingViceChairmanAudit.username }}({{ viewData.standingViceChairmanAudit.loginname }})
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间">
|
||||
{{ viewData.standingViceChairmanAudit.auditTime }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见">
|
||||
{{ viewData.standingViceChairmanAudit.auditOpinion ? viewData.standingViceChairmanAudit.auditOpinion : '暂无' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字">
|
||||
<el-image style="width: 200px;height:auto"
|
||||
:src="'/signature/getSignData?path=' +viewData.standingViceChairmanAudit.auditSign"></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="会计审核信息" name="7" v-if="viewData.financeAuditId">
|
||||
<el-form label-suffix=":" label-position="left" style="padding: 20px 0" class="ml25">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人">
|
||||
{{ viewData.financeAudit.username }}({{ viewData.financeAudit.loginname }})
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间">
|
||||
{{ viewData.financeAudit.auditTime }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="明细类">
|
||||
<dict-tag :options="detailsTypeOption"
|
||||
:value="viewData.detailsTypeId"></dict-tag>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="上账明细">
|
||||
{{viewData.accountViewName}}
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="会计核对扣款分类">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="viewData.new_jf_source"></dict-tag>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<!--
|
||||
<el-col :span="12" v-if="viewData.newClubId">
|
||||
<el-form-item label="会计核对扣款协会">
|
||||
{{ viewData.nweClubName }}
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见">
|
||||
{{ viewData.financeAudit.auditOpinion ? viewData.financeAudit.auditOpinion : '暂无' }}
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字">
|
||||
<el-image style="width: 200px;height:auto"
|
||||
:src="'/signature/getSignData?path=' +viewData.financeAudit.auditSign"></el-image>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form>
|
||||
</el-tab-pane>
|
||||
|
||||
|
||||
|
||||
|
||||
<el-tab-pane v-if="handle" :label="label" name="999">
|
||||
@@ -304,6 +492,8 @@ module.exports = {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
budgetTypeOption: [],
|
||||
detailsTypeOption: [],
|
||||
activeName: "1",
|
||||
viewData: {},
|
||||
loading: true,
|
||||
@@ -321,14 +511,14 @@ module.exports = {
|
||||
},
|
||||
async getInfo(id) {
|
||||
this.loading = true
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
this.detailsTypeOption = await getDictByCode("ACTIVITY_BUDGET_DETAILS_TYPE");
|
||||
const {data, code, msg} = await $.get("/activity/reimbursement/list/findOne", {id})
|
||||
this.loading = false
|
||||
if (data) {
|
||||
this.activeName = this.handle ? "999" : "1"
|
||||
condolence.toFormData(data)
|
||||
this.viewData = data
|
||||
console.log(this.viewData)
|
||||
|
||||
} else {
|
||||
this.viewData = {}
|
||||
this.$message({
|
||||
|
||||
@@ -0,0 +1,300 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
.budgetAudit .el-form-item__content {
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动项目:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input v-model="pageForm.activityMatter" placeholder="请输入活动项目"
|
||||
clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item"
|
||||
v-if="!pageForm.budgetTypeCode||pageForm.budgetTypeCode==='ACTIVITY_BUDGET_TYPE_THREE'">
|
||||
<div class="search-item-label">协会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable
|
||||
placeholder="请选择协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item"
|
||||
v-if="!pageForm.budgetTypeCode||pageForm.budgetTypeCode==='ACTIVITY_BUDGET_TYPE_TWO'">
|
||||
<div class="search-item-label">分工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionId" filterable
|
||||
clearable
|
||||
placeholder="请选择工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionList" :label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch();getApplyMoney()">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #label_end>
|
||||
<div style="margin-left: 10px;">
|
||||
<el-tag style="font-size: 15px;">
|
||||
申报预算金额:{{declareTotalBudgetMoney}}元,审核预算金额:{{totalBudgetMoney}}元
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template #func>
|
||||
|
||||
<el-radio-group @change="budgetTypeCodeChange" size="small"
|
||||
v-model="pageForm.budgetTypeCode">
|
||||
<el-radio-button :label="item.code" v-for="item in budgetTypeOption">
|
||||
{{item.name}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
ref="table"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
fixed
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:width="column.width"
|
||||
:fixed="column.fixed"
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
<template scope="{row}" v-if="column.prop==='budgetTypeCode'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.budgetTypeCode"></dict-tag>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='auditState'">
|
||||
<span v-if="row.auditState===0">未提交</span>
|
||||
<span v-if="row.auditState===1">待校工会审核</span>
|
||||
<span v-if="row.auditState===2">校工会拒绝</span>
|
||||
<span v-if="row.auditState===3">校工会退回</span>
|
||||
<span v-if="row.auditState===4">已通过</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
||||
width="200">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<template #view>
|
||||
<info ref="viewInfo"></info>
|
||||
</template>
|
||||
<template #edit>
|
||||
<info handle label="管理员编辑" ref="editInfo">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<vi-title title="管理员编辑信息"></vi-title>
|
||||
<el-descriptions :column="3" border class="table_fixed budgetAudit">
|
||||
<el-descriptions-item label="审核人">
|
||||
{{formData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">
|
||||
{{formData.loginname}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间">
|
||||
{{formData.auditTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核金额">
|
||||
<el-form-item label="" prop="totalBudgetMoney">
|
||||
<el-input-number :min="0" :precision="2"
|
||||
placeholder="请输入预算金额"
|
||||
style="width: 100%"
|
||||
v-model="formData.totalBudgetMoney"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2"></el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见" span="3">
|
||||
<el-form-item label="" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见"
|
||||
rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核附件" span="3">
|
||||
<el-form-item label="" prop="auditOpinion">
|
||||
<file-upload :files.sync="formData.files" card></file-upload>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<el-button :loading="formLoading" @click="doSubmit" type="primary">提交
|
||||
</el-button>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("./common/apply.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
declareTotalBudgetMoney: 0,
|
||||
totalBudgetMoney: 0,
|
||||
budgetTypeOption: [],
|
||||
clubOption: [],
|
||||
unionList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + "",
|
||||
budgetTypeCode: "",
|
||||
unionId: "",
|
||||
clubId: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度', width: '80'},
|
||||
{prop: 'userName', label: '申报人姓名', fixed: "left"},
|
||||
{prop: 'loginName', label: '申报人工号', fixed: "left"},
|
||||
{prop: 'budgetTypeCode', label: '申报类型'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'activityMatter', label: '活动项目', width: '300'},
|
||||
{prop: 'totalBudgetMoney', label: '审核预算金额'},
|
||||
{prop: 'applyDate', label: '申报时间'},
|
||||
],
|
||||
formRules: {
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
declareTotalBudgetMoney: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/activityBudget/info.vue?v=' + Date.now()),
|
||||
},
|
||||
methods: {
|
||||
doSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确认提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.formLoading = true
|
||||
this.formData.files = JSON.stringify(this.formData.files)
|
||||
const resp = await $.post(loc() + "/doSubmit", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功!'
|
||||
})
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
}
|
||||
this.formLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
openEdit(row) {
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
totalBudgetMoney: row.declareTotalBudgetMoney,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
loginname: "${@shiro.getPrincipalProperty('loginname')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.editInfo.getInfo(row.id)
|
||||
},
|
||||
budgetTypeCodeChange() {
|
||||
this.$set(this.pageForm, "unionId", '')
|
||||
this.$set(this.pageForm, "clubId", '')
|
||||
this.doSearch()
|
||||
this.getApplyMoney()
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.viewInfo.getInfo(row.id)
|
||||
},
|
||||
getApplyMoney() {
|
||||
$.get(loc() + "/getApplyMoney", this.pageForm).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.declareTotalBudgetMoney = resp.data.declareTotalBudgetMoney
|
||||
this.totalBudgetMoney = resp.data.totalBudgetMoney
|
||||
} else {
|
||||
this.$message.error(resp.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
this.budgetTypeOption.unshift({name: "全部类型", code: ""})
|
||||
this.clubOption = await getClubsByRole()
|
||||
this.unionList = await getUnionList(null)
|
||||
this.getApplyMoney()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,40 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
|
||||
</style>
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<budget-apply ref="budgetApply" @go_back="go_back"></budget-apply>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("./common/apply.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
components: {
|
||||
'budget-apply': BUDGET_APPLY
|
||||
},
|
||||
methods: {
|
||||
go_back(){
|
||||
sublime.jumpPagePjax("/platform/activity/budget/applyList")
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
setTimeout(()=>{
|
||||
this.$refs.budgetApply.info("", "applyList")
|
||||
},500)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,287 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动项目:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input v-model="pageForm.activityMatter" placeholder="请输入活动项目"
|
||||
clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch();getApplyMoney()" icon="el-icon-search" type="primary">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #label_end>
|
||||
<div style="margin-left: 10px;">
|
||||
<el-tag style="font-size: 15px;">
|
||||
申报预算金额:{{declareTotalBudgetMoney}}元,审核预算金额:{{totalBudgetMoney}}元
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template #func>
|
||||
|
||||
<!-- <el-button type="primary" icon="el-icon-check" @click="batchSubmit"
|
||||
size="small" :disabled="auditIds&&auditIds.length===0">
|
||||
批量提交
|
||||
</el-button>-->
|
||||
<el-button type="danger" icon="el-icon-check" @click="batchDelete"
|
||||
size="small" :disabled="auditIds&&auditIds.length===0">
|
||||
批量删除
|
||||
</el-button>
|
||||
<el-button @click="doExport" size="small" class="ml10"
|
||||
type="primary"
|
||||
icon="el-icon-download">导出
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
ref="table"
|
||||
@selection-change="handleSelectionChange"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column
|
||||
reserve-selection
|
||||
:selectable="(row)=>{return row.auditState==0||row.auditState==1}"
|
||||
type="selection"
|
||||
fixed
|
||||
width="60">
|
||||
</el-table-column>
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
fixed
|
||||
type="index"
|
||||
width="50"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:width="column.width"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
<template scope="{row}" v-if="column.prop==='budgetTypeCode'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.budgetTypeCode"></dict-tag>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='auditState'">
|
||||
<span v-if="row.auditState===0">未提交</span>
|
||||
<span v-if="row.auditState===1">待校工会审核</span>
|
||||
<span v-if="row.auditState===2">校工会拒绝</span>
|
||||
<span v-if="row.auditState===3">校工会退回</span>
|
||||
<span v-if="row.auditState===4">已通过</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
||||
width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary"
|
||||
:disabled="![0,1,3].includes(row.auditState)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger"
|
||||
:disabled="![0,1].includes(row.auditState)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
<template #view>
|
||||
<info ref="viewInfo"></info>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<budget-apply ref="budgetApply" @go_back="go_back"></budget-apply>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
<!--#include("./common/apply.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
declareTotalBudgetMoney: 0,
|
||||
totalBudgetMoney: 0,
|
||||
pageForm: {year: new Date().getFullYear() + ""},
|
||||
budgetTypeOption: [],
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度', width: '80'},
|
||||
{prop: 'userName', label: '申报人姓名'},
|
||||
{prop: 'loginName', label: '申报人工号'},
|
||||
{prop: 'mobile', label: '联系方式', width: '120'},
|
||||
{prop: 'budgetTypeCode', label: '申报类型'},
|
||||
// {prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'activityMatter', label: '活动项目', width: '300'},
|
||||
{prop: 'declareTotalBudgetMoney', label: '申报预算金额'},
|
||||
{prop: 'totalBudgetMoney', label: '审核预算金额'},
|
||||
{prop: 'applyDate', label: '申报时间'},
|
||||
{prop: 'auditState', label: '审核状态'},
|
||||
],
|
||||
|
||||
auditIds: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/activityBudget/info.vue?v=' + Date.now()),
|
||||
'budget-apply': BUDGET_APPLY
|
||||
},
|
||||
methods: {
|
||||
doExport() {
|
||||
const {year} = this.pageForm
|
||||
window.open("/platform/activity/budget/applyList/doExport?year=" + year)
|
||||
},
|
||||
batchDelete() {
|
||||
if (this.auditIds.length === 0) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请选择要删除的数据!'
|
||||
});
|
||||
return
|
||||
}
|
||||
this.$confirm('确定要批量提交选择的数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.post("/platform/activity/budget/applyList/batchDelete", {
|
||||
ids: this.auditIds
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功!'
|
||||
});
|
||||
this.doSearch();
|
||||
this.getApplyMoney()
|
||||
this.$refs.table.clearSelection();
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
batchSubmit() {
|
||||
if (this.auditIds.length === 0) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: '请选择要提交的数据!'
|
||||
});
|
||||
return
|
||||
}
|
||||
this.$confirm('确定要批量提交选择的数据吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.post("/platform/activity/budget/applyList/batchSubmit", {
|
||||
ids: this.auditIds
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功!'
|
||||
});
|
||||
this.doSearch();
|
||||
this.getApplyMoney()
|
||||
this.$refs.table.clearSelection();
|
||||
} else {
|
||||
this.$alert(res.msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning'
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.auditIds = val.map(item => item.id)
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.viewInfo.getInfo(row.id)
|
||||
},
|
||||
go_back() {
|
||||
this.$refs.guava.index()
|
||||
this.pageData()
|
||||
},
|
||||
openEdit(row) {
|
||||
this.$refs.guava.edit()
|
||||
setTimeout(() => {
|
||||
this.$refs.budgetApply.info(row.id, "applyList")
|
||||
|
||||
}, 500)
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定删除该条数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.post(loc() + "/doDelete", {id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
this.doSearch();
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
getApplyMoney() {
|
||||
$.get(loc() + "/getApplyMoney", this.pageForm).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.declareTotalBudgetMoney = resp.data.declareTotalBudgetMoney
|
||||
this.totalBudgetMoney = resp.data.totalBudgetMoney
|
||||
} else {
|
||||
this.$message.error(resp.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.getApplyMoney()
|
||||
this.pageData()
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,263 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动项目:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input v-model="pageForm.activityMatter" placeholder="请输入活动项目"
|
||||
clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item"
|
||||
v-if="!pageForm.budgetTypeCode||pageForm.budgetTypeCode==='ACTIVITY_BUDGET_TYPE_THREE'">
|
||||
<div class="search-item-label">协会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable
|
||||
placeholder="请选择协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item"
|
||||
v-if="!pageForm.budgetTypeCode||pageForm.budgetTypeCode==='ACTIVITY_BUDGET_TYPE_TWO'">
|
||||
<div class="search-item-label">分工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionId" filterable
|
||||
clearable
|
||||
placeholder="请选择工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionList" :label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch();getApplyMoney()">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #label_end>
|
||||
<div style="margin-left: 10px;">
|
||||
<el-tag style="font-size: 15px;">
|
||||
申报预算金额:{{declareTotalBudgetMoney}}元,审核预算金额:{{totalBudgetMoney}}元
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
<template #func>
|
||||
|
||||
<el-radio-group @change="budgetTypeCodeChange" size="small"
|
||||
v-model="pageForm.budgetTypeCode">
|
||||
<el-radio-button :label="item.code" v-for="item in budgetTypeOption">
|
||||
{{item.name}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-button @click="doExport" size="small" class="ml10"
|
||||
type="primary"
|
||||
icon="el-icon-download">导出
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
ref="table"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
fixed
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:width="column.width"
|
||||
:fixed="column.fixed"
|
||||
show-overflow-tooltip
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
<template scope="{row}" v-if="column.prop==='budgetTypeCode'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.budgetTypeCode"></dict-tag>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='auditState'">
|
||||
<span v-if="row.auditState===0">未提交</span>
|
||||
<span v-if="row.auditState===1">待校工会审核</span>
|
||||
<span v-if="row.auditState===2">校工会拒绝</span>
|
||||
<span v-if="row.auditState===3">校工会退回</span>
|
||||
<span v-if="row.auditState===4">已通过</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
||||
width="300">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary"
|
||||
:disabled="!['9810051','superadmin'].includes('${@shiro.getPrincipalProperty('loginname')}')">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger"
|
||||
:disabled="!['9810051','superadmin'].includes('${@shiro.getPrincipalProperty('loginname')}')">
|
||||
删除
|
||||
</el-button>
|
||||
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
<template #view>
|
||||
<info ref="viewInfo"></info>
|
||||
</template>
|
||||
<template #edit>
|
||||
<budget-apply ref="budgetApply" @go_back="go_back"></budget-apply>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
<!--#include("./common/apply.js"){}#-->
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
declareTotalBudgetMoney: 0,
|
||||
totalBudgetMoney: 0,
|
||||
budgetTypeOption: [],
|
||||
clubOption: [],
|
||||
unionList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + "",
|
||||
budgetTypeCode: "",
|
||||
unionId: "",
|
||||
clubId: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度', width: '80'},
|
||||
{prop: 'userName', label: '申报人姓名', fixed: "left"},
|
||||
{prop: 'loginName', label: '申报人工号', fixed: "left"},
|
||||
{prop: 'mobile', label: '联系方式', width: '120'},
|
||||
{prop: 'budgetTypeCode', label: '申报类型'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'activityMatter', label: '活动项目', width: '300'},
|
||||
{prop: 'declareTotalBudgetMoney', label: '申报预算金额'},
|
||||
{prop: 'totalBudgetMoney', label: '审核预算金额'},
|
||||
{prop: 'applyDate', label: '申报时间'},
|
||||
{prop: 'auditState', label: '审核状态'},
|
||||
],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/activityBudget/info.vue?v=' + Date.now()),
|
||||
'budget-apply': BUDGET_APPLY
|
||||
},
|
||||
methods: {
|
||||
go_back() {
|
||||
this.$refs.guava.index()
|
||||
this.pageData()
|
||||
},
|
||||
openEdit(row) {
|
||||
this.$refs.guava.edit()
|
||||
setTimeout(() => {
|
||||
this.$refs.budgetApply.info(row.id, "applyStatistics")
|
||||
|
||||
}, 500)
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定删除该条数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.post(loc() + "/doDelete", {id}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
this.doSearch();
|
||||
this.getApplyMoney()
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
doExport() {
|
||||
const {year, budgetTypeCode, unionId, clubId} = this.pageForm
|
||||
window.open("/platform/activity/budget/applyStatistics/doExport?year=" + year
|
||||
+ "&budgetTypeCode=" + budgetTypeCode
|
||||
+ "&unionId=" + unionId
|
||||
+ "&clubId=" + clubId
|
||||
)
|
||||
},
|
||||
budgetTypeCodeChange() {
|
||||
this.$set(this.pageForm, "unionId", '')
|
||||
this.$set(this.pageForm, "clubId", '')
|
||||
this.doSearch()
|
||||
this.getApplyMoney()
|
||||
},
|
||||
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.viewInfo.getInfo(row.id)
|
||||
},
|
||||
getApplyMoney() {
|
||||
$.get(loc() + "/getApplyMoney", this.pageForm).then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.declareTotalBudgetMoney = resp.data.declareTotalBudgetMoney
|
||||
this.totalBudgetMoney = resp.data.totalBudgetMoney
|
||||
} else {
|
||||
this.$message.error(resp.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
this.budgetTypeOption.unshift({name: "全部类型", code: ""})
|
||||
this.clubOption = await getClubsByRole()
|
||||
this.unionList = await getUnionList(null)
|
||||
this.getApplyMoney()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,467 @@
|
||||
const BUDGET_APPLY = {
|
||||
template: /*language=HTML*/ `
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="card-title">
|
||||
<span class="title-left">填写申报信息</span>
|
||||
</span>
|
||||
<span class="title-right" @click="openDialogVisible">
|
||||
批量导入
|
||||
<span slot="suffix">
|
||||
<i class="el-icon-upload"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<el-form :model="formData" :rules="formRules" label-suffix=":" label-width="160px"
|
||||
ref="form">
|
||||
<el-row gutter="20">
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申报人姓名" prop="userName">
|
||||
<el-input disabled type="text"
|
||||
v-model="formData.userName"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申报时间" prop="applyDate">
|
||||
<el-input disabled type="text"
|
||||
v-model="formData.applyDate"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input type="text" v-model="formData.mobile"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="预算类型" prop="budgetTypeCode">
|
||||
<el-select @change="budgetTypeCodeChange"
|
||||
placeholder="请选择预算类型"
|
||||
style="width: 100%;"
|
||||
v-model="formData.budgetTypeCode">
|
||||
<el-option
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code"
|
||||
v-for="item in budgetTypeOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="申报(承办)单位" prop="helpUnitName"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(formData.budgetTypeCode)">
|
||||
<el-input placeholder="请输入申报(承办)单位" readonly
|
||||
type="text" v-model="formData.helpUnitName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="申报(承办)单位" prop="unionId"
|
||||
v-if="formData.budgetTypeCode==='ACTIVITY_BUDGET_TYPE_TWO'">
|
||||
<el-select v-model="formData.unionId" filterable @change="unionChange"
|
||||
clearable
|
||||
:disabled="!['superadmin'].includes('${@shiro.getPrincipalProperty('loginname')}')"
|
||||
placeholder="请选择工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionList" :label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申报(承办)单位" prop="clubId"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_THREE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(formData.budgetTypeCode)">
|
||||
<el-select @change="clubChange"
|
||||
placeholder="请选择申报(承办)单位"
|
||||
style="width: 100%;" v-model="formData.clubId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.clubName"
|
||||
:value="item.id"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
prop="activityMatter" label="活动项目"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input maxlength="50" placeholder="请输入活动项目"
|
||||
v-model="formData.activityMatter"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
prop="activityDate" label="活动时间">
|
||||
<el-input maxlength="50" placeholder="请输入活动时间"
|
||||
v-model="formData.activityDate"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
prop="declareTotalBudgetMoney" label="预算金额(元)"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-input-number :min="0" :precision="2"
|
||||
:disabled="formData.budgetDetails&&formData.budgetDetails.length>0"
|
||||
placeholder="请输入预算金额"
|
||||
style="width: 100%"
|
||||
v-model="formData.declareTotalBudgetMoney"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template
|
||||
v-if="['superadmin'].includes('${@shiro.getPrincipalProperty('loginname')}')">
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
prop="isRepeatReimbursement" label="是否可以重复报销"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.isRepeatReimbursement">
|
||||
<el-radio-button :label="true">可以</el-radio-button>
|
||||
<el-radio-button :label="false">不可以</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
prop="isSchoolBudget" label="是否属于校工会预算"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
|
||||
<el-radio-group v-model="formData.isSchoolBudget">
|
||||
<el-radio-button :label="true">属于</el-radio-button>
|
||||
<el-radio-button :label="false">不属于</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
prop="schoolBudgetId" label="校工会预算"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"
|
||||
v-if="formData.isSchoolBudget">
|
||||
<el-select v-model="formData.schoolBudgetId" filterable
|
||||
default-first-option
|
||||
placeholder="请选择校工会预算" style="width: 100%">
|
||||
<el-option :label="item.activityMatter"
|
||||
:value="item.id"
|
||||
v-for="item in activityList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
prop="activityContent" label="活动内容(如训练、装备等)">
|
||||
<text-editor v-model="formData.activityContent"></text-editor>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="项目明细" prop="budgetDetails">
|
||||
<el-table :data="formData.budgetDetails"
|
||||
border
|
||||
max-height="500"
|
||||
size="mini"
|
||||
style="width: 100%">
|
||||
<el-table-column label="序号" sortable type="index"
|
||||
width="100">
|
||||
<template scope="{row,$index}">
|
||||
{{row.detailsOrder=$index+1}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="类别" prop="detailName">
|
||||
<template scope="{row,$index}">
|
||||
<el-form-item
|
||||
:prop="'budgetDetails.'+$index+'.detailName'"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"
|
||||
label-width="0">
|
||||
<el-input maxlength="50"
|
||||
placeholder="请输入类别"
|
||||
v-model="row.detailName"></el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="预算金额(元)" prop="budgetMoney">
|
||||
<template scope="{row,$index}">
|
||||
<el-form-item
|
||||
:prop="'budgetDetails.'+$index+'.budgetMoney'"
|
||||
:rules="[{required:true,message:'必填',trigger:['change','blur']}]"
|
||||
label-width="0">
|
||||
<el-input-number :min="0" :precision="2"
|
||||
placeholder="请输入预算金额"
|
||||
style="width: 100%"
|
||||
@change="budgetMoneyChange"
|
||||
v-model="row.budgetMoney"></el-input-number>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center"
|
||||
label="操作"
|
||||
width="150px">
|
||||
<template slot="header" slot-scope="scope">
|
||||
<el-button @click="formData.budgetDetails.push({})"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
type="primary">添加
|
||||
</el-button>
|
||||
</template>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@click="deleteDetail(scope.$index,scope.row)"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
type="danger"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-row justify="end" type="flex">
|
||||
<el-button :loading="formLoading" @click="doSubmit(false)" type="primary"
|
||||
v-if="editType==='applyList'">保 存
|
||||
</el-button>
|
||||
<el-button :loading="formLoading" @click="doSubmit(true)" type="primary">提 交
|
||||
</el-button>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog title="申报数据导入" :visible.sync="dialogVisible" width="50%"
|
||||
:close-on-click-modal="false">
|
||||
<vi-title2 title="如果是协会活动,上传的表格文件请一定要选择申报单位。"></vi-title2>
|
||||
<file-import ref="viewImport" temp_url="/platform/activity/budget/applyList/downloadImport"
|
||||
post_url="/platform/activity/budget/applyList/doImport"
|
||||
:is_show_radio="false" @flush="flush"></file-import>
|
||||
</el-dialog>
|
||||
`,
|
||||
mixins: [initTableMixins],
|
||||
components: {
|
||||
'file-import': httpVueLoader('/components/plugins/FileImport.vue')
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activityList: [],
|
||||
budgetTypeOption: [],
|
||||
unionList: [],
|
||||
clubOption: [],
|
||||
formRules: {
|
||||
budgetTypeCode: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
fundsUnitName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
clubId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
helpUnitName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
unionId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
formData: {
|
||||
budgetDetails: []
|
||||
},
|
||||
dialogVisible: false,
|
||||
editType: "applyList"
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
flush() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
openDialogVisible() {
|
||||
this.dialogVisible = true;
|
||||
console.log(this.$refs.viewImport)
|
||||
setTimeout(()=>{
|
||||
this.$refs.viewImport.importData = {
|
||||
fileList: [],
|
||||
isFlag: false
|
||||
}
|
||||
this.$refs.viewImport.errorInfoData = {
|
||||
totalCount: 0,
|
||||
successCount: 0,
|
||||
errorCount: 0,
|
||||
errorList: 0,
|
||||
}
|
||||
},300)
|
||||
|
||||
},
|
||||
|
||||
deleteDetail(index, row) {
|
||||
this.formData.budgetDetails.splice(index, 1)
|
||||
this.$set(this.formData, "declareTotalBudgetMoney", this.formData.declareTotalBudgetMoney - row.budgetMoney)
|
||||
},
|
||||
budgetMoneyChange() {
|
||||
const totalBudget = this.formData.budgetDetails
|
||||
.filter(value => value.budgetMoney > 0)
|
||||
.map(v => v.budgetMoney)
|
||||
.reduce((sum, current) => sum + current, 0);
|
||||
this.$set(this.formData, "declareTotalBudgetMoney", totalBudget)
|
||||
},
|
||||
doSubmit(flag) {
|
||||
if (['ACTIVITY_BUDGET_TYPE_TWO'].includes(this.formData.budgetTypeCode) && !this.formData.activityMatter) {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: "请输入活动项目!"
|
||||
})
|
||||
return
|
||||
}
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确认提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.formLoading = true
|
||||
const formData = clone(this.formData)
|
||||
const resp = await $.post("/platform/activity/budget/apply/doSubmit", {
|
||||
activityBudget: JSON.stringify(formData),
|
||||
flag: flag
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功'
|
||||
})
|
||||
this.formLoading = false
|
||||
this.$emit('go_back')
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: resp.msg
|
||||
})
|
||||
this.formLoading = false
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
});
|
||||
},
|
||||
clubChange(val) {
|
||||
const club = this.clubOption.find(c => c.id === val)
|
||||
this.formData.helpUnitName = club.clubName
|
||||
},
|
||||
unionChange(id) {
|
||||
if (id) {
|
||||
const union = this.unionList.find(c => c.id === id)
|
||||
this.$set(this.formData, "helpUnitName", union.unionname)
|
||||
} else {
|
||||
this.$set(this.formData, "helpUnitName", '')
|
||||
}
|
||||
},
|
||||
budgetTypeCodeChange(val) {
|
||||
if (val === "ACTIVITY_BUDGET_TYPE_ONE") {
|
||||
this.$set(this.formData, "helpUnitName", "校工会")
|
||||
} else if (val === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
this.$set(this.formData, "helpUnitName", '${@shiro.getPrincipalProperty("union").getUnionname()}')
|
||||
this.$set(this.formData, "unionId", '${@shiro.getPrincipalProperty("union").getId()}')
|
||||
} else if (["ACTIVITY_BUDGET_TYPE_THREE", "ACTIVITY_BUDGET_TYPE_FOUR"].includes(val)) {
|
||||
this.$set(this.formData, "helpUnitName", '')
|
||||
this.$set(this.formData, "clubId", '')
|
||||
} else {
|
||||
this.$set(this.formData, "helpUnitName", "校工会")
|
||||
}
|
||||
if (val) {
|
||||
const budgetType = this.budgetTypeOption.find(b => b.code === val)
|
||||
this.$set(this.formData, "budgetTypeId", budgetType.code)
|
||||
}
|
||||
},
|
||||
async getActivityBudgetType() {
|
||||
const data = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
let budgetTypeOption = []
|
||||
if ("${@shiro.hasRole('sysadmin')}" === 'true') {
|
||||
this.budgetTypeOption = data
|
||||
} else {
|
||||
if ("${@shiro.hasRole('A06')||@shiro.hasRole('xghjf')}" === 'true') {
|
||||
data.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_ONE"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
if ("${@shiro.hasRole('gh14')||@shiro.hasRole('gh01')}" === 'true') {
|
||||
data.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_TWO"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
if ("${@shiro.hasRole('club01')||@shiro.hasRole('club05')}" === 'true') {
|
||||
data.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_THREE", "ACTIVITY_BUDGET_TYPE_FOUR"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
this.budgetTypeOption = budgetTypeOption
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
info(id, editType) {
|
||||
this.editType = editType
|
||||
if (id) {
|
||||
this.openEdit(id)
|
||||
} else {
|
||||
this.formData = {
|
||||
isSchoolBudget: false,
|
||||
isRepeatReimbursement: true,
|
||||
budgetDetails: [],
|
||||
applyDate: moment().format('YYYY-MM-DD'),
|
||||
userName: '${@shiro.getPrincipalProperty("username")}',
|
||||
mobile: '${@shiro.getPrincipalProperty("mobile")}',
|
||||
}
|
||||
}
|
||||
},
|
||||
async findOne(id) {
|
||||
const resp = await $.get('/platform/activity/budget/applyList/findOne', {id})
|
||||
if (resp.code === 0) {
|
||||
if (resp.data.budgets) {
|
||||
resp.data.budgets = JSON.parse(resp.data.budgets)
|
||||
}
|
||||
return resp.data
|
||||
}
|
||||
},
|
||||
async openEdit(id) {
|
||||
const data = await this.findOne(id)
|
||||
this.formData = data
|
||||
},
|
||||
async getClubsByUser() {
|
||||
const {data} = await $.get("/platform/activity/budget/apply/getClubsByUser", {})
|
||||
return data
|
||||
},
|
||||
async getSchoolBudget() {
|
||||
const {data} = await $.get("/platform/activity/budget/apply/getSchoolBudget", {})
|
||||
this.activityList = data
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.clubOption = await this.getClubsByUser()
|
||||
await this.getActivityBudgetType()
|
||||
await this.getSchoolBudget()
|
||||
this.unionList = await getUnionList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
},
|
||||
style: /*language=CSS*/ `
|
||||
.card-title {
|
||||
margin-bottom: 20px;
|
||||
letter-spacing: 2px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.card-title .title-left {
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
.card-title .title-right {
|
||||
text-align: right;
|
||||
font-size: 15px;
|
||||
color: #0e78c5;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.card-title .title-right:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,217 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
@change="doSearch"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item"
|
||||
v-if="pageForm.budgetTypeCode==='ACTIVITY_BUDGET_TYPE_THREE'">
|
||||
<div class="search-item-label">协会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="doSearch"
|
||||
clearable
|
||||
placeholder="请选择协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item"
|
||||
v-if="pageForm.budgetTypeCode==='ACTIVITY_BUDGET_TYPE_TWO'">
|
||||
<div class="search-item-label">分工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionId" @change="doSearch" filterable
|
||||
clearable
|
||||
placeholder="请选择工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionList" :label="item.unionName"
|
||||
:value="item.unionId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<vi-title2 title="类型列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="budgetTypeCodeChange" size="small"
|
||||
v-model="pageForm.budgetTypeCode">
|
||||
<el-radio-button :label="item.code" v-for="item in budgetTypeOption">
|
||||
{{item.name}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
<el-button @click="doExport" size="small" class="ml10"
|
||||
type="primary"
|
||||
icon="el-icon-download">导出汇总表
|
||||
</el-button>
|
||||
</template>
|
||||
</vi-title2>
|
||||
<el-table :data="tableData" :summary-method="getSummaries" @sort-change="pageOrder"
|
||||
row-key="id"
|
||||
show-summary
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
v-for="column in tableColumns">
|
||||
<template scope="{row}" v-if="column.prop==='year'">
|
||||
{{moment(row.applyDate).format("YYYY")}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
budgetTypeOption: [],
|
||||
clubOption: [],
|
||||
unionList: [],
|
||||
pageForm: {
|
||||
year: new Date().getFullYear() + "",
|
||||
budgetTypeCode: "ACTIVITY_BUDGET_TYPE_ONE",
|
||||
unionId: "",
|
||||
clubId: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'activityMatter', label: '活动项目'},
|
||||
{prop: 'totalBudgetMoney', label: '预算金额'},
|
||||
],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doExport() {
|
||||
const {year, budgetTypeCode, unionId, clubId} = this.pageForm
|
||||
window.open("/platform/activity/budget/queryStatistics/doExport?year=" + year
|
||||
+ "&budgetTypeCode=" + budgetTypeCode
|
||||
+ "&unionId=" + unionId
|
||||
+ "&clubId=" + clubId
|
||||
)
|
||||
},
|
||||
budgetTypeCodeChange(val) {
|
||||
this.$set(this.pageForm, "unionId", '')
|
||||
this.$set(this.pageForm, "clubId", '')
|
||||
this.tableData = []
|
||||
if (["ACTIVITY_BUDGET_TYPE_ONE", "ACTIVITY_BUDGET_TYPE_FOUR"].includes(val)) {
|
||||
this.tableColumns = [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'activityMatter', label: '活动项目'},
|
||||
{prop: 'totalBudgetMoney', label: '预算金额'},
|
||||
]
|
||||
} else if (val === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
this.tableColumns = [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'unionName', label: '分工会'},
|
||||
{prop: 'totalBudgetMoney', label: '预算金额'},
|
||||
]
|
||||
} else if (val === "ACTIVITY_BUDGET_TYPE_THREE") {
|
||||
this.tableColumns = [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'clubName', label: '协会名称'},
|
||||
{prop: 'totalBudgetMoney', label: '预算金额'},
|
||||
]
|
||||
}
|
||||
this.doSearch()
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (index === 3) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0).toFixed(2);
|
||||
sums[index] += ' 元';
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
},
|
||||
pageData() {
|
||||
sublime.showLoadingbar();
|
||||
this.tableLoading = true
|
||||
$.post(loc() + "/pageData", this.pageForm, (data) => {
|
||||
sublime.closeLoadingbar();
|
||||
this.tableLoading = false
|
||||
if (data.code === 0) {
|
||||
if (this.pageForm.budgetTypeCode === 'ACTIVITY_BUDGET_TYPE_TWO') {
|
||||
data.data.map(v => {
|
||||
if (!v.unionName) {
|
||||
v.unionName = v.unitName
|
||||
}
|
||||
})
|
||||
this.unionList = data.data
|
||||
}
|
||||
this.tableData = data.data;
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
this.clubOption = await getClubsByRole()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,388 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.budgetAudit .el-form-item__content {
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
</style>
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">申报人:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input v-model="pageForm.searchKeyword" placeholder="请输入工号/姓名"
|
||||
clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动项目:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input v-model="pageForm.activityMatter" placeholder="请输入活动项目"
|
||||
clearable></el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item"
|
||||
v-if="!pageForm.budgetTypeCode||pageForm.budgetTypeCode==='ACTIVITY_BUDGET_TYPE_THREE'">
|
||||
<div class="search-item-label">协会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable
|
||||
placeholder="请选择协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item"
|
||||
v-if="!pageForm.budgetTypeCode||pageForm.budgetTypeCode==='ACTIVITY_BUDGET_TYPE_TWO'">
|
||||
<div class="search-item-label">分工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select v-model="pageForm.unionId" filterable
|
||||
clearable
|
||||
placeholder="请选择工会" style="width: 100%;">
|
||||
<el-option v-for="item in unionList" :label="item.unionname"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch()">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="budgetTypeCodeChange" size="small"
|
||||
v-model="pageForm.budgetTypeCode">
|
||||
<el-radio-button :label="item.code" v-for="item in budgetTypeOption">
|
||||
{{item.name}}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-radio-group @change="doSearch" size="small" class="ml5"
|
||||
v-model="pageForm.auditState">
|
||||
<el-radio-button :label="0">全部</el-radio-button>
|
||||
<el-radio-button :label="1">已审核</el-radio-button>
|
||||
<el-radio-button :label="2">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
ref="table"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
<template scope="{row}" v-if="column.prop==='budgetTypeCode'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.budgetTypeCode"></dict-tag>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='auditState'">
|
||||
<span v-if="row.auditState===0">未提交</span>
|
||||
<span v-if="row.auditState===1">待校工会审核</span>
|
||||
<span v-if="row.auditState===2">校工会拒绝</span>
|
||||
<span v-if="row.auditState===3">校工会退回</span>
|
||||
<span v-if="row.auditState===4">已通过</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
||||
width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openView(row)" size="mini" type="primary">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button :disabled="row.auditState!==1" @click="openAudit(row)"
|
||||
size="mini"
|
||||
type="primary">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button :disabled="row.auditState<=1" @click="doRevoke(row)"
|
||||
size="mini" :loading="row.loading"
|
||||
type="danger">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
<template #view>
|
||||
<info ref="viewInfo"></info>
|
||||
</template>
|
||||
<template #edit>
|
||||
<info handle label="校工会审核" ref="editInfo">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<vi-title title="校工会审核信息"></vi-title>
|
||||
<el-descriptions :column="3" border class="table_fixed budgetAudit">
|
||||
<el-descriptions-item label="审核人">
|
||||
{{formData.username}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="工号">
|
||||
{{formData.loginname}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核时间">
|
||||
{{formData.auditTime}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核金额">
|
||||
<el-form-item label="" prop="totalBudgetMoney">
|
||||
<el-input-number :min="0" :precision="2"
|
||||
placeholder="请输入预算金额"
|
||||
style="width: 100%"
|
||||
v-model="formData.totalBudgetMoney"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2"></el-descriptions-item>
|
||||
<el-descriptions-item label="审核意见" span="3">
|
||||
<el-form-item label="" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见"
|
||||
rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-row class="mt20" justify="end" type="flex">
|
||||
<!-- <el-button :loading="formLoading" @click="doSubmit(2)" type="danger">拒绝-->
|
||||
<!-- </el-button>-->
|
||||
<el-button :loading="formLoading" @click="doSubmit(3)" type="danger">
|
||||
退回修改
|
||||
</el-button>
|
||||
<el-button :loading="formLoading" @click="doSubmit(4)" type="primary">通过
|
||||
</el-button>
|
||||
</el-row>
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
budgetTypeOption: [],
|
||||
clubOption: [],
|
||||
unionList : [],
|
||||
pageForm: {
|
||||
year: moment().format("YYYY"), auditState: 2,
|
||||
budgetTypeCode: "",
|
||||
activityMatter: "",
|
||||
unionId: "",
|
||||
clubId: "",
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'userName', label: '申报人姓名'},
|
||||
{prop: 'loginName', label: '申报人工号'},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'budgetTypeCode', label: '申报类型'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'activityMatter', label: '活动项目'},
|
||||
{prop: 'declareTotalBudgetMoney', label: '申报预算金额'},
|
||||
{prop: 'applyDate', label: '申报时间'},
|
||||
{prop: 'auditState', label: '审核状态'},
|
||||
],
|
||||
formRules: {
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
declareTotalBudgetMoney: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/activityBudget/info.vue?v=' + Date.now()),
|
||||
},
|
||||
methods: {
|
||||
budgetTypeCodeChange() {
|
||||
this.$set(this.pageForm, "unionId", '')
|
||||
this.$set(this.pageForm, "clubId", '')
|
||||
this.doSearch()
|
||||
},
|
||||
openSubmit() {
|
||||
this.formData = {
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
loginname: "${@shiro.getPrincipalProperty('loginname')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
this.$refs.guava.public()
|
||||
},
|
||||
doRevoke(row) {
|
||||
this.$confirm('确认要撤回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
row.loading = true
|
||||
const resp = await $.post(loc() + "/doRevoke", {id: row.id})
|
||||
if (resp.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '撤回成功!'
|
||||
})
|
||||
this.doSearch()
|
||||
}
|
||||
row.loading = false
|
||||
})
|
||||
},
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (index === 2 || index === 3) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0).toFixed(2);
|
||||
sums[index] += ' 元';
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
},
|
||||
doSubmit(auditState) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确认提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.formLoading = true
|
||||
this.formData.auditState = auditState
|
||||
const resp = await $.post(loc() + "/doSubmit", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功!'
|
||||
})
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
}
|
||||
this.formLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
doAllSubmit(auditState) {
|
||||
this.$refs.form2.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确认提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.formLoading = true
|
||||
this.formData.auditState = auditState
|
||||
const resp = await $.post(loc() + "/doSubmit", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '提交成功!'
|
||||
})
|
||||
this.doSearch()
|
||||
this.$refs.guava.index()
|
||||
this.$refs.table.clearSelection();
|
||||
}
|
||||
this.formLoading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.viewInfo.getInfo(row.id)
|
||||
},
|
||||
async findOne(id) {
|
||||
const {
|
||||
data,
|
||||
code,
|
||||
msg
|
||||
} = await $.get("/platform/activity/budget/applyList/findOne", {id})
|
||||
return data
|
||||
},
|
||||
async openAudit(row) {
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
totalBudgetMoney: row.declareTotalBudgetMoney,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
loginname: "${@shiro.getPrincipalProperty('loginname')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.editInfo.getInfo(row.id)
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
this.budgetTypeOption.unshift({name: "全部类型", code: ""})
|
||||
this.clubOption = await getClubsByRole()
|
||||
this.unionList = await getUnionList(null)
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,179 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
:clearable="false"
|
||||
@change="doSearch"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="类型列表">
|
||||
<template #func>
|
||||
<el-button @click="openAdd" icon="el-icon-s-tools"
|
||||
size="small" type="primary">
|
||||
新增类型
|
||||
</el-button>
|
||||
</template>
|
||||
</table-tool>
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
</el-table-column>
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
||||
width="150px">
|
||||
<template scope="{row}">
|
||||
<el-button @click="openEdit(row)" size="mini" type="primary">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%">
|
||||
|
||||
|
||||
<el-form :model="formData" :rules="formRules" label-width="100px" ref="form">
|
||||
<el-form-item label="类型名称:" prop="budgetTypeName">
|
||||
<el-input maxlength="15" placeholder="请输入类型名称"
|
||||
v-model="formData.budgetTypeName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="类型编号:" prop="location">
|
||||
<el-input maxlength="15" placeholder="请输入类型编号"
|
||||
v-model="formData.location"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="预算金额:" prop="budgetTypeMoney">
|
||||
<el-input-number min="0" placeholder="请输入预算金额" style="width: 100%"
|
||||
v-model="formData.budgetTypeMoney"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注:" prop="note">
|
||||
<el-input :rows="3" maxlength="150"
|
||||
placeholder="请输入备注" type="textarea" v-model="formData.note"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span class="dialog-footer" slot="footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button @click="doSubmit" type="primary">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
pageForm: {year: new Date().getFullYear() + ""},
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'location', label: '编号'},
|
||||
{prop: 'budgetTypeName', label: '类型'},
|
||||
{prop: 'budgetTypeMoney', label: '金额'},
|
||||
],
|
||||
dialogVisible: false,
|
||||
title: "新增类型",
|
||||
formRules: {
|
||||
budgetTypeName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
budgetTypeMoney: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
location: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
openEdit(row) {
|
||||
this.title = "编辑类型"
|
||||
const formData = clone(row)
|
||||
this.formData = formData
|
||||
this.dialogVisible = true
|
||||
},
|
||||
openAdd() {
|
||||
this.title = "新增类型"
|
||||
this.formData = {}
|
||||
this.dialogVisible = true
|
||||
},
|
||||
doSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
$.post(loc() + (this.formData.id ? "/doEdit" : "/doAdd"), this.formData).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '保存成功!'
|
||||
});
|
||||
this.dialogVisible = false
|
||||
this.doSearch()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
doDelete(id) {
|
||||
this.$confirm('确定删除该条数据?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
$.post(loc() + "/doDelete", {id}).then(res => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '删除成功!'
|
||||
});
|
||||
this.doSearch();
|
||||
})
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -27,28 +27,17 @@ layout("/layouts/platform.html"){
|
||||
placeholder="选择年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="pageForm.club_id" filterable placeholder="按协会名称"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="item in clubOptions"
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button icon="el-icon-search" type="primary"
|
||||
@click="doSearch"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button slot="append" icon="el-icon-download" type="primary" @click="exportExcel">
|
||||
<!-- <div class="pull-right offscreen-right mt5">
|
||||
<el-button slot="append" icon="el-icon-download" @click="exportExcel">
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
</div>-->
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
@@ -59,8 +48,8 @@ layout("/layouts/platform.html"){
|
||||
<template scope="scope"><span>{{scope.$index+(pageForm.pageNumber - 1) * pageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="年度" show-overflow-tooltip header-align="center"
|
||||
align="center">
|
||||
<el-table-column label="年度" show-overflow-tooltip
|
||||
header-align="center" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.year}}</span>
|
||||
</template>
|
||||
@@ -88,18 +77,18 @@ layout("/layouts/platform.html"){
|
||||
align="center"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.total_quota">暂未分配</span>
|
||||
<span v-else><i>{{scope.row.total_quota}}</i> 元</span>
|
||||
<span v-if="!scope.row.totalQuota">暂未分配</span>
|
||||
<span v-else><i>{{scope.row.totalQuota}}</i> 元</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="已使用额度" sortable="custom" prop="used_quota"
|
||||
<el-table-column label="已使用额度" sortable="custom" prop="usedQuota"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
header-align="center" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.used_quota">暂未使用</span>
|
||||
<span v-else><i>{{scope.row.used_quota}}</i> 元</span>
|
||||
<span v-if="!scope.row.usedQuota">暂未使用</span>
|
||||
<span v-else><i>{{scope.row.usedQuota}}</i> 元</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -108,16 +97,16 @@ layout("/layouts/platform.html"){
|
||||
align="center"
|
||||
header-align="center" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.used_quota">{{scope.row.total_quota}}元</span>
|
||||
<span v-else><i>{{scope.row.total_quota-parseIntNum(scope.row.used_quota)}}</i> 元</span>
|
||||
<span v-if="!scope.row.usedQuota">{{scope.row.totalQuota}}元</span>
|
||||
<span v-else><i>{{scope.row.totalQuota-scope.row.usedQuota}}</i> 元</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" header-align="center" width="180px"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" @click="use(scope.row)" type="primary"
|
||||
>使用详情
|
||||
<el-button size="mini" @click="use(scope.row)" type="primary">
|
||||
使用详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -159,11 +148,11 @@ layout("/layouts/platform.html"){
|
||||
<el-button icon="el-icon-search" type="primary"
|
||||
@click="doUseSearch"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button slot="append" @click="openView" type="primary">
|
||||
<!--<div class="pull-right offscreen-right mt5">
|
||||
<el-button slot="append" @click="openView">
|
||||
<i class="ti-plus"></i>新增使用记录
|
||||
</el-button>
|
||||
</div>
|
||||
</div>-->
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
@@ -183,7 +172,7 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column label="活动名称" prop="project" header-align="center"
|
||||
align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="所属协会" prop="name" header-align="center"
|
||||
<el-table-column label="所属社团" prop="name" header-align="center"
|
||||
align="center">
|
||||
<template scope="scope"><span>{{clubInfo.name}} </span></template>
|
||||
</el-table-column>
|
||||
@@ -194,7 +183,8 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column label="活动人数" prop="activitie_number"
|
||||
header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column label="活动费用" prop="adjust_money" header-align="center"
|
||||
<el-table-column label="活动费用" prop="adjust_money"
|
||||
header-align="center"
|
||||
align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="调整人" prop="username" header-align="center"
|
||||
@@ -212,7 +202,7 @@ layout("/layouts/platform.html"){
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
<!-- <el-table-column align="center" header-align="center" label="操作"
|
||||
fixed="right"
|
||||
width="120px">
|
||||
<template slot-scope="{row}">
|
||||
@@ -234,7 +224,7 @@ layout("/layouts/platform.html"){
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
|
||||
</el-table>
|
||||
|
||||
@@ -360,7 +350,7 @@ layout("/layouts/platform.html"){
|
||||
el: "#app",
|
||||
data: function () {
|
||||
return {
|
||||
clubOptions: [],
|
||||
|
||||
showYsTz: false,
|
||||
tab_loading: false,
|
||||
pageForm: {
|
||||
@@ -407,8 +397,7 @@ layout("/layouts/platform.html"){
|
||||
editFormData: {},
|
||||
editDialogVisible: false,
|
||||
|
||||
clubInfo: {},
|
||||
clickUserInfo: {},
|
||||
clubInfo: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -441,24 +430,25 @@ layout("/layouts/platform.html"){
|
||||
|
||||
this.editFormData.isClub = true
|
||||
const resp = await $.post("/platform/jf/tz/doEdit", this.editFormData)
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
|
||||
closeLoadingFunc(loading, resp, async () => {
|
||||
this.editDialogVisible = false
|
||||
this.use({id: this.formData.id, year: this.clickUserInfo.year, name: this.clickUserInfo.name})
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
this.use({id: this.formData.id})
|
||||
}, (data, msg) => {
|
||||
this.$message.error(msg);
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
use(scope) {
|
||||
console.log(scope)
|
||||
let that = this
|
||||
this.formData.id = scope.id
|
||||
this.usePageForm.adjust_id = scope.id
|
||||
this.clickUserInfo = scope
|
||||
this.clubInfo.year = scope.year
|
||||
|
||||
this.clubInfo.name = scope.name
|
||||
|
||||
that.showYsTz = true
|
||||
$.post(base + "/platform/jf/tz/data", this.usePageForm, function (res) {
|
||||
if (res.code === 0) {
|
||||
@@ -541,6 +531,7 @@ layout("/layouts/platform.html"){
|
||||
this.tab_loading = true
|
||||
$.post(base + "/platform/jf/club/tz/data", this.pageForm, function (res) {
|
||||
if (res.code === 0) {
|
||||
console.log(res)
|
||||
that.tableData = res.data.list;
|
||||
that.pageForm.totalCount = res.data.totalCount;
|
||||
}
|
||||
@@ -591,7 +582,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
},
|
||||
async created() {
|
||||
this.clubOptions = await getClubsByRole();
|
||||
this.unionOptions = await getUnions();
|
||||
this.pageData();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -17,25 +17,21 @@ layout("/layouts/platform.html"){
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
style="width: 100%"
|
||||
:clearable="false"
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
format="yyyy"
|
||||
format="yyyy年"
|
||||
placeholder="选择年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
|
||||
<!--按院级工会-->
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="pageForm.club_id" filterable
|
||||
@change="doSearch"
|
||||
placeholder="按协会名称" clearable>
|
||||
<el-select v-model="pageForm.club_id" filterable placeholder="按协会名称" clearable>
|
||||
<el-option
|
||||
v-for="item in unionOptions"
|
||||
:key="item.stid"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.stid">
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -45,21 +41,19 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
|
||||
<!--文件上传按钮-->
|
||||
<!-- <div class="btn-group tool-button mt5" style="float: right;padding-right: 5px">
|
||||
<el-button type="primary" icon="el-icon-edit" @click="exportVisible = true">导入数据
|
||||
</el-button>
|
||||
</div>-->
|
||||
|
||||
|
||||
<div class="btn-group tool-button mt5" style="float: right;padding-right: 5px">
|
||||
<el-button type="primary" icon="el-icon-edit" @click="openExport">导入数据
|
||||
<el-button type="primary" @click="issue" v-if="!this.flag">年度分配</el-button>
|
||||
<el-button type="danger" @click="reset" v-else>
|
||||
分配重置
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="btn-group tool-button mt5" style="float: right;padding-right: 5px">
|
||||
<el-button type="success" @click="issue" v-if="!this.flag">年度分配</el-button>
|
||||
<el-button type="danger" @click="reset" v-else>分配重置</el-button>
|
||||
</div>
|
||||
|
||||
<div class="btn-group tool-button mt5" style="float: right;padding-right: 5px">
|
||||
<el-button v-if="clubList.length" type="primary" icon="el-icon-plus" @click="openAdd">添加数据</el-button>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
@@ -81,40 +75,18 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column label="协会编码" prop="code" sortable show-overflow-tooltip
|
||||
header-align="center"
|
||||
align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="协会人数" align="center" sortable header-align="center"
|
||||
show-overflow-tooltip
|
||||
prop="history_member"></el-table-column>
|
||||
|
||||
|
||||
<!-- <el-table-column label="人均额度" show-overflow-tooltip header-align="center" align="center">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <span>{{scope.row.total_quota>0?+' 元':'暂未分配总额度'}}</span>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
|
||||
<el-table-column label="标准" show-overflow-tooltip header-align="center"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.history_club_avg!=null?scope.row.history_club_avg+' 元':'暂未分配平均额度'}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="总额度" sortable="custom" prop="total_quota"
|
||||
show-overflow-tooltip align="center"
|
||||
header-align="center"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.edit" maxlength="8" min="0" type="number"
|
||||
style="width: 70%"
|
||||
size="small"
|
||||
onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
|
||||
v-model="scope.row.total_quota2" placeholder="填写总额度">
|
||||
<el-table-column label="总额度" sortable="custom" prop="totalQuota"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<el-input-number v-if="row.edit" max="100000" min="0"
|
||||
style="width: 70%"
|
||||
size="small"
|
||||
v-model="row.totalQuota2" placeholder="填写总额度">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
</el-input-number>
|
||||
<div v-else>
|
||||
<span v-if="!scope.row.total_quota">暂未分配</span>
|
||||
<span v-else><i>{{scope.row.total_quota}}</i> 元</span>
|
||||
<span v-if="!row.totalQuota">暂未分配</span>
|
||||
<span v-else><i>{{row.totalQuota}}</i> 元</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -130,21 +102,14 @@ layout("/layouts/platform.html"){
|
||||
circle></el-button>
|
||||
</div>
|
||||
<el-button v-else size="mini"
|
||||
@click="$set(scope.row,'edit',true);$set(scope.row,'total_quota2',scope.row.total_quota);"
|
||||
@click="$set(scope.row,'edit',true);$set(scope.row,'totalQuota2',scope.row.totalQuota);"
|
||||
type="primary">
|
||||
{{!scope.row.club_id?'分配':'编辑'}}
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
@current-change="pageNumberChange"
|
||||
:current-page="pageForm.pageNumber"
|
||||
layout="total, prev, pager, next, jumper"
|
||||
:total="pageForm.totalCount">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</guava>
|
||||
@@ -154,100 +119,19 @@ layout("/layouts/platform.html"){
|
||||
title="导入数据"
|
||||
:visible.sync="exportVisible" :close-on-click-modal="false"
|
||||
width="60%">
|
||||
<file-import ref="viewImport" temp_url="/platform/jf/club/dataInput/downLoadTemp"
|
||||
post_url="/platform/jf/club/dataInput/doImport"
|
||||
:is_show_radio="false" @flush="doSearch"></file-import>
|
||||
|
||||
|
||||
<el-steps :active="exportActive" finish-status="success" simple>
|
||||
<el-step title="下载模板"></el-step>
|
||||
<el-step title="上传文件"></el-step>
|
||||
<el-step title="导入结果"></el-step>
|
||||
</el-steps>
|
||||
|
||||
<div v-if="exportActive==0"
|
||||
style="padding: 20px ;display: flex;justify-content: center;align-content: center;align-items: center;;width: 100%">
|
||||
<div class="el-upload-dragger" @click="downloadTemplate">
|
||||
<i class="el-icon-download"></i>
|
||||
<div class="el-upload__text">点击下载模板</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="exportActive==1"
|
||||
style="padding: 20px ;display: flex;justify-content: center;align-content: center;align-items: center;;width: 100%">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
drag
|
||||
:on-change="tempFileChange"
|
||||
:file-list="tempFileList" :auto-upload="false" accept=".xls,.xlsx"
|
||||
:limit="1">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
</div>
|
||||
|
||||
<div v-if="exportActive==2"
|
||||
style="padding: 20px ;display: flex;justify-content: center;align-content: center;align-items: center;;width: 100%">
|
||||
<div class="el-upload-dragger">
|
||||
<i class="el-icon-success"></i>
|
||||
<div class="el-upload__text">共检出 <span class="text-info">{{exportData.count}}</span>
|
||||
条数据,入库成功
|
||||
<span
|
||||
class="text-success">{{exportData.success_count}}</span> 条。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="exportVisible = false">取 消</el-button>
|
||||
|
||||
<el-button v-if="exportActive>0" @click="exportActive -= 1">上一步</el-button>
|
||||
|
||||
<el-button type="primary" v-if="exportActive==0"
|
||||
@click="exportActive = 1">我已下载</el-button>
|
||||
|
||||
<el-button type="primary" v-if="exportActive==1" @click="doExport">导入</el-button>
|
||||
|
||||
<el-button type="primary" v-if="exportActive==2"
|
||||
@click="exportVisible = false;window.location.reload();">完成</el-button>
|
||||
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<template>
|
||||
<el-dialog title="添加协会预算分配信息" :visible.sync="addDialogVisible" :close-on-click-modal="false" width="40%">
|
||||
<el-form :model="formData" ref="addForm" :rules="rules" label-width="100px">
|
||||
<el-form-item label="协会名称" prop="club_id">
|
||||
<el-select v-model="formData.club_id" filterable
|
||||
style="width: 90%;"
|
||||
placeholder="请选择协会名称" clearable>
|
||||
<el-option
|
||||
v-for="item in clubList"
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="标准" prop="history_club_avg">
|
||||
<el-input-number maxlength="100" placeholder="请填写标准" style="width: 90%;"
|
||||
type="text" v-model="formData.history_club_avg"></el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="总额度" prop="total_quota">
|
||||
<el-input-number maxlength="100" placeholder="请填写总额度" style="width: 90%;"
|
||||
type="text" v-model="formData.total_quota"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="addDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doAdd">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data: function () {
|
||||
data() {
|
||||
return {
|
||||
textView: "本年下发",
|
||||
flag: false,
|
||||
@@ -264,200 +148,78 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
tableData: [],
|
||||
|
||||
//数据文件导入
|
||||
tempFileList: [],
|
||||
exportActive: 0,
|
||||
exportVisible: false,
|
||||
|
||||
formData: {},
|
||||
addDialogVisible: false,
|
||||
rules: {
|
||||
club_id: [{required: true, message: "请选择协会信息", trigger: ['blur', 'change']}],
|
||||
history_club_avg: [{required: true, message: "请填写标准", trigger: ['blur', 'change']}],
|
||||
total_quota: [{required: true, message: "请填写总额度", trigger: ['blur', 'change']}],
|
||||
},
|
||||
clubList:[],
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doExport() {
|
||||
if (!this.tempFileList.length) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请先选择文件',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
}
|
||||
|
||||
let formData = new FormData();
|
||||
const f = this.tempFileList[0]
|
||||
formData.append("file", f.raw, f.raw.name);
|
||||
// formData.append("park_id", parkId);
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据提交中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "/platform/jf/club/dataInput/doExport",
|
||||
type: "post",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: (data) => {
|
||||
loading.close()
|
||||
if (data.code === 0) {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
this.exportData = {...data.data}
|
||||
this.exportActive = 2
|
||||
window.vue.pageData()
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: data => {
|
||||
loading.close()
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
tempFileChange(file, fileList) {
|
||||
this.tempFileList = fileList
|
||||
},
|
||||
// 模板下载
|
||||
downloadTemplate() {
|
||||
console.log(this.nowData)
|
||||
location.href = '/platform/jf/club/dataInput/downLoadTemp'
|
||||
},
|
||||
|
||||
//数据文件弹出框
|
||||
openExport() {
|
||||
this.tempFileList = []
|
||||
this.exportActive = 0
|
||||
this.exportVisible = true
|
||||
|
||||
},
|
||||
|
||||
// 重置下发
|
||||
async reset() {
|
||||
// 确认弹出框
|
||||
this.$confirm('您确定要重置年度费用吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.get("/platform/jf/st/fp/reset")
|
||||
const resp = await $.post("/platform/jf/st/fp/reset")
|
||||
if (resp.code === 0) {
|
||||
this.flag = false;
|
||||
this.$message.success("操作成功")
|
||||
} else {
|
||||
this.$message.warning("操作失败")
|
||||
this.$message.success(resp.msg);
|
||||
await this.isSet();
|
||||
this.pageData()
|
||||
}
|
||||
this.doSearch()
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消'
|
||||
});
|
||||
});
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
// 判断是否已经下发并改变下发按钮的状态
|
||||
async isSet() {
|
||||
const resp = await $.get("/platform/jf/st/fp/isSet")
|
||||
// console.log(resp.data)
|
||||
if (resp.data > 0) {
|
||||
this.textView = "今年已下发"
|
||||
this.flag = true
|
||||
if (resp.code === 0) {
|
||||
this.flag = (resp.data > 0)
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 下发
|
||||
async issue() {
|
||||
this.$confirm('生成年度费用前,请确认协会已在会员管理系统中调整。', '提示', {
|
||||
this.$confirm('生成年度费用前,请确认已经申报完成。', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.get("/platform/jf/st/fp/issue")
|
||||
const resp = await $.post("/platform/jf/st/fp/issue")
|
||||
if (resp.code === 0) {
|
||||
this.flag = true;
|
||||
this.$message.success("操作成功")
|
||||
this.$message.success(resp.msg);
|
||||
await this.isSet();
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.warning("操作失败")
|
||||
}
|
||||
this.doSearch()
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
doChangeYs(row) {
|
||||
let self = this;
|
||||
$.post(base + "/platform/jf/st/fp/changeYs", {
|
||||
club_id: row.cid,
|
||||
year: self.pageForm.year,
|
||||
total_quota: row.total_quota2,
|
||||
}, function (data) {
|
||||
if (data.code === 0) {
|
||||
vue.$message.success("分配成功!");
|
||||
row.edit = false
|
||||
self.pageData()
|
||||
} else {
|
||||
vue.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
openAdd() {
|
||||
this.formData = {}
|
||||
this.addDialogVisible = true
|
||||
},
|
||||
async doAdd() {
|
||||
console.log(this.formData)
|
||||
const resp = await $.post('/platform/jf/st/fp/doAdd',this.formData)
|
||||
if (resp.code === 0){
|
||||
this.formData={}
|
||||
this.addDialogVisible = false;
|
||||
this.$notify.success(resp.msg)
|
||||
this.pageData();
|
||||
await this.showOrAddClub();
|
||||
}else {
|
||||
this.addDialogVisible = false;
|
||||
this.$notify.warning(resp.msg)
|
||||
}
|
||||
},
|
||||
async showOrAddClub() {
|
||||
const clubList = await getClubsByRole();
|
||||
clubList.forEach(v => {
|
||||
if (this.tableData.find(o => v.name === o.name)){
|
||||
this.unionOptions.push(v);
|
||||
}else{
|
||||
this.clubList.push(v);
|
||||
this.$message.error(resp.msg);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
doChangeYs(row) {
|
||||
if (row.totalquota2 < 0) {
|
||||
this.$message.warning("请检查总额度!");
|
||||
return
|
||||
}
|
||||
$.post("/platform/jf/st/fp/changeYs", {
|
||||
clubId: row.cid,
|
||||
year: this.pageForm.year,
|
||||
totalQuota: row.totalQuota2,
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("分配成功!");
|
||||
row.edit = false
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
async created() {
|
||||
this.unionOptions = await getClubs();
|
||||
this.pageData();
|
||||
await this.isSet();
|
||||
await this.showOrAddClub();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.text {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.clearfix:before,
|
||||
.clearfix:after {
|
||||
display: table;
|
||||
content: "";
|
||||
}
|
||||
|
||||
.clearfix:after {
|
||||
clear: both
|
||||
}
|
||||
|
||||
.box-card {
|
||||
width: 700px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
<guava>
|
||||
<el-card shadow="never" style="width: 40%;margin: 0 auto">
|
||||
<h3 slot="header" style="color: rgb(24, 103, 176); ">设置年度费用额度</h3>
|
||||
<div style="padding-bottom: 50px;">
|
||||
<vi-title class="mt10" title="校工会预算设置"></vi-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-input :disabled="schoolDisabled" :placeholder="this.schoolInput"
|
||||
clearable placeholder="校工会"
|
||||
style="width:400px" v-model="formData.schoolMoney">
|
||||
<template slot="prepend">校工会</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<vi-title class="mt20" title="分工会预算设置"></vi-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-input :disabled="unionDisabled" :placeholder="this.unionInput"
|
||||
clearable placeholder="分工会"
|
||||
style="width:400px" v-model="formData.union_avg">
|
||||
<template slot="prepend">分工会</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<vi-title class="mt20" title="协会/协会预算设置"></vi-title>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-input :disabled="clubDisabled" placeholder="基础人数"
|
||||
clearable
|
||||
style="width:400px" v-model="formData.clubExceedNum">
|
||||
<template slot="prepend">基础人数</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mt10">
|
||||
<el-input :disabled="clubDisabled" placeholder="每人费用"
|
||||
clearable
|
||||
style="width:400px" v-model="formData.club_avg">
|
||||
<template slot="prepend">每人费用</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24" class="mt10">
|
||||
<el-input clearable style="width:400px" v-model="formData.clubLeastMoney"
|
||||
placeholder="基础额度">
|
||||
<template slot="prepend">基础额度
|
||||
</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mt10">
|
||||
<el-input clearable style="width:400px" v-model="formData.clubAtMostMoney"
|
||||
placeholder="最高限额">
|
||||
<template slot="prepend">最高限额
|
||||
</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row class="mt20" type="flex" justify="end">
|
||||
<el-button @click="set" type="primary" v-loading="loading">确认</el-button>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-card>
|
||||
</guava>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
data() {
|
||||
return {
|
||||
loading: "",
|
||||
schoolDisabled: false,
|
||||
unionDisabled: false,
|
||||
schoolInput: "",
|
||||
unionInput: "",
|
||||
clubDisabled: false,
|
||||
clubInput: "",
|
||||
union: 2,
|
||||
club: 3,
|
||||
formData: {},
|
||||
formRules: {
|
||||
schoolMoney: [{
|
||||
required: true,
|
||||
message: '请选择是否启用',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
avglocalUnion: [{
|
||||
required: true,
|
||||
message: '请选择是否启用',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
avgAssociation: [{
|
||||
required: true,
|
||||
message: '请选择是否启用',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
|
||||
// 回显
|
||||
async echo() {
|
||||
const {data} = await $.get("/platform/jf/costsSet/costsSet/echo")
|
||||
if (data) {
|
||||
this.formData = data
|
||||
}
|
||||
},
|
||||
|
||||
// 设置是否
|
||||
async set() {
|
||||
const confirm = await this.$confirm('设置年度费用将清空前一次设置的预算是否继续!!!!', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
if (confirm === "confirm") {
|
||||
this.loading = true;
|
||||
const resp = await $.post("/platform/jf/costsSet/costsSet/set", this.formData)
|
||||
if (resp.code == 0) {
|
||||
this.loading = false;
|
||||
this.$notify({
|
||||
title: '成功',
|
||||
message: '操作成功',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
this.$notify.error({
|
||||
title: '错误',
|
||||
message: '操作失败'
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.echo();
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -14,9 +14,16 @@ layout("/layouts/platform.html"){
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
format="yyyy年"
|
||||
placeholder="选择年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5" style="float: right;padding-right: 5px">
|
||||
<el-button type="primary" @click="issue" v-if="!flag">年度分配</el-button>
|
||||
<el-button type="danger" @click="reset" v-else>
|
||||
分配重置
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
@@ -55,7 +62,8 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" header-align="center" label="操作" fixed="right">
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
fixed="right">
|
||||
<template scope="{row}">
|
||||
<div v-if="row.edit">
|
||||
<el-button type="success" icon="el-icon-check" size="mini"
|
||||
@@ -92,24 +100,65 @@ layout("/layouts/platform.html"){
|
||||
pageForm: {
|
||||
year: moment().format("YYYY")
|
||||
},
|
||||
flag: false,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 重置下发
|
||||
async reset() {
|
||||
this.$confirm('您确定要重置年度费用吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.post("/platform/jf/schoolBudget/list/reset")
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg);
|
||||
await this.isSet();
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
},
|
||||
// 下发
|
||||
async issue() {
|
||||
this.$confirm('生成年度费用前,请确认已经申报完成。', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.post("/platform/jf/schoolBudget/list/issue")
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg);
|
||||
await this.isSet();
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(resp.msg);
|
||||
}
|
||||
})
|
||||
},
|
||||
async doChangeYs(row) {
|
||||
const data = await $.post(loc() + "/doChangeYs", {
|
||||
totalQuota2: row.totalQuota2,
|
||||
totalQuota: row.totalQuota2,
|
||||
id: row.id
|
||||
})
|
||||
if (data.code == 0) {
|
||||
if (data.code === 0) {
|
||||
row.edit = false
|
||||
this.doSearch()
|
||||
this.$message.success("编辑成功");
|
||||
} else {
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
// 判断是否已经下发并改变下发按钮的状态
|
||||
async isSet() {
|
||||
const resp = await $.get("/platform/jf/schoolBudget/list/isSet")
|
||||
if (resp.code === 0) {
|
||||
this.flag = (resp.data > 0)
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
await this.isSet();
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
@@ -118,4 +167,4 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -9,7 +9,7 @@ layout("/layouts/platform.html"){
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
@change="doSearch();findInitData()"
|
||||
style="width: 100%"
|
||||
v-model="pageForm.year"
|
||||
type="year"
|
||||
@@ -22,12 +22,24 @@ layout("/layouts/platform.html"){
|
||||
<el-input placeholder="请输入内容" v-model="pageForm.activity_name">
|
||||
<template slot="prepend">活动名称</template>
|
||||
<el-button slot="append" icon="el-icon-search"
|
||||
@click="doSearch"></el-button>
|
||||
@click="doSearch();findInitData()"></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<vi-title2 title="明细列表">
|
||||
<template #label_end>
|
||||
<div style="margin-left: 10px;">
|
||||
<el-tag style="font-size: 15px;">
|
||||
{{pageForm.year}}年总经费 {{initData.totalQuota}} 元 ,已使用 {{initData.usedQuota}}
|
||||
剩余:{{initData.totalQuota-initData.usedQuota}}元
|
||||
<template v-if="initData.totalMoney>0">当前项目已使用:{{initData.totalMoney}}</template>
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</vi-title2>
|
||||
<el-table :data="tableData" style="width: 100%" row-key="id"
|
||||
@sort-change="pageOrder"
|
||||
v-loading="tableLoading" :size="tableSize" class="vi-table">
|
||||
@@ -46,8 +58,9 @@ layout("/layouts/platform.html"){
|
||||
:width="column.width"
|
||||
min-width="50"
|
||||
>
|
||||
<template v-if="column.prop=='holdUnit'" scope="{row}">
|
||||
校工会
|
||||
<template v-if="column.prop=='unitName'" scope="{row}">
|
||||
<span v-if="row.jf_source==='ACTIVITY_BUDGET_TYPE_TWO'">{{row.unionName}}</span>
|
||||
<span v-if="row.jf_source==='ACTIVITY_BUDGET_TYPE_ONE'">校工会</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -64,17 +77,32 @@ layout("/layouts/platform.html"){
|
||||
return {
|
||||
tableColumns: [
|
||||
{prop: 'year', label: '年度'},
|
||||
{prop: 'activity_name', label: '项目'},
|
||||
{prop: 'activity_name', label: '活动名称'},
|
||||
{prop: 'venue', label: '活动地点'},
|
||||
{prop: 'holdUnit', label: '举办单位'},
|
||||
{prop: 'unitName', label: '报销单位'},
|
||||
{prop: 'activity_time', label: '活动时间'},
|
||||
{prop: 'money', label: '费用'},
|
||||
],
|
||||
pageForm: {
|
||||
year: moment().format("YYYY")
|
||||
},
|
||||
initData: {},
|
||||
}
|
||||
}, async created() {
|
||||
},
|
||||
methods: {
|
||||
findInitData() {
|
||||
$.get("/platform/jf/schoolBudget/use/list/findInitData", {
|
||||
year: this.pageForm.year,
|
||||
activity_name: this.pageForm.activity_name
|
||||
}, (res) => {
|
||||
if (res.code === 0) {
|
||||
this.initData = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.findInitData()
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
@@ -83,4 +111,4 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
<style>
|
||||
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
|
||||
-webkit-appearance: none !important;
|
||||
}
|
||||
|
||||
input[type="number"] {
|
||||
-moz-appearance: textfield;
|
||||
}
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<guava>
|
||||
<el-card shadow="never">
|
||||
<div class="btn-group tool-button mt5">
|
||||
@@ -18,12 +28,13 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<!--按院级工会-->
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="pageForm.union_id" filterable placeholder="按院级工会" clearable>
|
||||
<el-select v-model="pageForm.union_id" filterable placeholder="按院级工会"
|
||||
clearable>
|
||||
<el-option
|
||||
v-for="item in unionOptions"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
:key="item.unionId"
|
||||
:label="item.unionName"
|
||||
:value="item.unionId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
@@ -34,14 +45,16 @@ layout("/layouts/platform.html"){
|
||||
|
||||
|
||||
<!--文件上传弹出框-->
|
||||
<div class="btn-group tool-button mt5" style="float: right;padding-right: 5px">
|
||||
<el-button type="primary" icon="el-icon-edit" @click="openExport">导入数据
|
||||
</el-button>
|
||||
</div>
|
||||
<!-- <div class="btn-group tool-button mt5" style="float: right;padding-right: 5px">
|
||||
<el-button type="primary" icon="el-icon-edit" @click="openExport" plain>导入数据
|
||||
</el-button>
|
||||
</div>-->
|
||||
|
||||
<div class="btn-group tool-button mt5" style="float: right;padding-right: 5px">
|
||||
<el-button type="primary" @click="issue" v-if="!this.flag" v-loading="tab_loading">年度分配</el-button>
|
||||
<el-button type="primary" @click="reset" v-else>分配重置</el-button>
|
||||
<el-button type="primary" @click="issue" v-if="!this.flag">年度分配</el-button>
|
||||
<el-button type="danger" @click="reset" v-else>
|
||||
分配重置
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
@@ -54,52 +67,32 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="年度" show-overflow-tooltip header-align="center"
|
||||
align="center">
|
||||
<el-table-column label="年度" show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span>{{scope.row.year}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="院级工会名称" prop="unionname" show-overflow-tooltip
|
||||
header-align="center"
|
||||
align="center">
|
||||
<el-table-column label="院级工会名称" prop="unionName" show-overflow-tooltip>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="院级工会编码" prop="unioncode" sortable show-overflow-tooltip
|
||||
header-align="center"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="会员人数" prop="history_member" show-overflow-tooltip
|
||||
header-align="center"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
|
||||
|
||||
<el-table-column label="标准" show-overflow-tooltip header-align="center"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<!-- <span>{{scope.row.totalquota>0?(scope.row.totalquota/scope.row.hyzs).toFixed(2)+' 元':'暂未分配总额度'}}</span>-->
|
||||
<span>{{scope.row.history_union_avg!=null?scope.row.history_union_avg+' 元':'暂未分配平均额度'}}</span>
|
||||
<el-table-column label="院级工会编码" prop="unioncode" sortable
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="{row}">
|
||||
<span>{{row.unioncode?row.unioncode:row.unitCode}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="总额度" sortable="custom" prop="totalquota"
|
||||
show-overflow-tooltip align="center"
|
||||
header-align="center"
|
||||
align="center">
|
||||
<el-table-column label="预算总额度" sortable="custom" prop="totalQuota"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<el-input v-if="scope.row.edit" maxlength="8" min="0" type="number"
|
||||
style="width: 70%"
|
||||
size="small"
|
||||
onKeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)))"
|
||||
v-model="scope.row.totalquota2" placeholder="填写总额度">
|
||||
<template slot="append">元</template>
|
||||
</el-input>
|
||||
<el-input-number v-if="scope.row.edit" maxlength="8" min="0"
|
||||
style="width: 70%"
|
||||
v-model="scope.row.totalquota2"
|
||||
placeholder="填写预算总额度">
|
||||
</el-input-number>
|
||||
<div v-else>
|
||||
<span v-if="!scope.row.totalquota">暂未分配</span>
|
||||
<span v-else><i>{{scope.row.totalquota}}</i> 元</span>
|
||||
{{scope.row.totalQuota}}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -115,9 +108,9 @@ layout("/layouts/platform.html"){
|
||||
circle></el-button>
|
||||
</div>
|
||||
<el-button v-else size="mini"
|
||||
@click="$set(scope.row,'edit',true);$set(scope.row,'totalquota2',scope.row.totalquota);"
|
||||
@click="$set(scope.row,'edit',true);$set(scope.row,'totalquota2',scope.row.totalQuota);"
|
||||
type="primary">
|
||||
{{!scope.row.unid?'分配':'编辑'}}
|
||||
编辑
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -131,61 +124,9 @@ layout("/layouts/platform.html"){
|
||||
title="导入数据"
|
||||
:visible.sync="exportVisible" :close-on-click-modal="false"
|
||||
width="60%">
|
||||
|
||||
|
||||
<el-steps :active="exportActive" finish-status="success" simple>
|
||||
<el-step title="下载模板"></el-step>
|
||||
<el-step title="上传文件"></el-step>
|
||||
<el-step title="导入结果"></el-step>
|
||||
</el-steps>
|
||||
|
||||
<div v-if="exportActive==0"
|
||||
style="padding: 20px ;display: flex;justify-content: center;align-content: center;align-items: center;;width: 100%">
|
||||
<div class="el-upload-dragger"
|
||||
style="display: flex;justify-content: center;align-items: center"
|
||||
@click="downloadTemplate">
|
||||
<i class="el-icon-download"></i>
|
||||
<div class="el-upload__text">点击下载模板</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="exportActive==1"
|
||||
style="padding: 20px ;display: flex;justify-content: center;align-content: center;align-items: center;;width: 100%">
|
||||
<el-upload
|
||||
class="upload-demo"
|
||||
drag
|
||||
:on-change="tempFileChange"
|
||||
:file-list="tempFileList" :auto-upload="false" accept=".xls,.xlsx"
|
||||
:limit="1">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
</div>
|
||||
|
||||
<div v-if="exportActive==2"
|
||||
style="padding: 20px ;display: flex;justify-content: center;align-content: center;align-items: center;;width: 100%">
|
||||
<div class="el-upload-dragger">
|
||||
<i class="el-icon-success"></i>
|
||||
<div class="el-upload__text">共检出 <span class="text-info">{{exportData.count}}</span>
|
||||
条数据,入库成功 <span
|
||||
class="text-success">{{exportData.success_count}}</span> 条。
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="exportVisible = false">取 消</el-button>
|
||||
|
||||
<el-button v-if="exportActive>0" @click="exportActive -= 1">上一步</el-button>
|
||||
|
||||
<el-button type="primary" v-if="exportActive==0"
|
||||
@click="exportActive = 1">我已下载</el-button>
|
||||
|
||||
<el-button type="primary" v-if="exportActive==1" @click="doExport">导入</el-button>
|
||||
|
||||
<el-button type="primary" v-if="exportActive==2"
|
||||
@click="exportVisible = false; window.location.reload();">完成</el-button>
|
||||
|
||||
</span>
|
||||
<file-import ref="viewImport" temp_url="/platform/jf/yjgh/dataInput/downLoadTemp"
|
||||
post_url="/platform/jf/yjgh/dataInput/doImport"
|
||||
:is_show_radio="false" @flush="doSearch"></file-import>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
@@ -194,7 +135,7 @@ layout("/layouts/platform.html"){
|
||||
const vue = new Vue({
|
||||
el: "#app",
|
||||
mixins: [initTableMixins],
|
||||
data: function () {
|
||||
data() {
|
||||
return {
|
||||
flag: false,
|
||||
unionOptions: [],
|
||||
@@ -209,215 +150,86 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
tableData: [],
|
||||
|
||||
//数据文件导入
|
||||
tempFileList: [],
|
||||
exportActive: 0,
|
||||
exportVisible: false,
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
methods: {
|
||||
|
||||
doExport() {
|
||||
if (!this.tempFileList.length) {
|
||||
this.$notify({
|
||||
title: '警告',
|
||||
message: '请先选择文件',
|
||||
type: 'warning'
|
||||
});
|
||||
return
|
||||
|
||||
}
|
||||
|
||||
let formData = new FormData();
|
||||
const f = this.tempFileList[0]
|
||||
formData.append("file", f.raw, f.raw.name);
|
||||
// formData.append("park_id", parkId);
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '数据提交中...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "/platform/jf/yjgh/dataInput/doExport",
|
||||
type: "post",
|
||||
data: formData,
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: (data) => {
|
||||
loading.close()
|
||||
if (data.code === 0) {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'success'
|
||||
});
|
||||
this.exportData = {...data.data}
|
||||
this.exportActive = 2
|
||||
window.vue.pageData()
|
||||
|
||||
} else {
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: data => {
|
||||
loading.close()
|
||||
this.$message({
|
||||
message: data.msg,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
tempFileChange(file, fileList) {
|
||||
this.tempFileList = fileList
|
||||
},
|
||||
// 模板下载
|
||||
downloadTemplate() {
|
||||
location.href = '/platform/jf/yjgh/dataInput/downLoadTemp'
|
||||
},
|
||||
|
||||
//数据文件弹出框
|
||||
openExport() {
|
||||
this.tempFileList = []
|
||||
this.exportActive = 0
|
||||
this.exportVisible = true
|
||||
this.exportVisible = true;
|
||||
},
|
||||
|
||||
|
||||
// 查询今年是否已经设置了人均额度
|
||||
async isSetUnionAvg() {
|
||||
const resp = await $.get("/platform/jf/yjgh/ghys/isSetUnionAvg")
|
||||
if (resp.data == 0) {
|
||||
this.$confirm('暂未设置人均额度无法下发,是否立即前往人均额度设置页面?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 重定向到设置页面
|
||||
window.location.href = "/platform/jf/costsSet/costsSet";
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
// 查询当前最大的一年
|
||||
async lastYear() {
|
||||
const resp = await $.get("/platform/jf/yjgh/ghys/lastYear")
|
||||
if (resp.data.year != new Date().getFullYear() + "") {
|
||||
this.pageForm.year = resp.data.year;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// 重置下发
|
||||
async reset() {
|
||||
// 确认弹出框
|
||||
this.$confirm('您确定要重置年度费用吗, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.get("/platform/jf/yjgh/ghys/reset")
|
||||
const resp = await $.post("/platform/jf/yjgh/ghys/reset")
|
||||
if (resp.code === 0) {
|
||||
this.flag = false;
|
||||
this.$message.success("操作成功")
|
||||
} else {
|
||||
this.$message.warning("操作失败")
|
||||
this.$message.success(resp.msg);
|
||||
await this.isSet()
|
||||
this.pageData()
|
||||
}
|
||||
this.doSearch()
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
|
||||
})
|
||||
},
|
||||
|
||||
// 判断是否已经下发并改变下发按钮的状态
|
||||
async isSet() {
|
||||
const resp = await $.get("/platform/jf/yjgh/ghys/isSet")
|
||||
if (resp.data > 0) {
|
||||
this.textView = "已下发"
|
||||
this.flag = true
|
||||
if (resp.code === 0) {
|
||||
this.flag = (resp.data > 0)
|
||||
}
|
||||
},
|
||||
|
||||
// 下发
|
||||
async issue() {
|
||||
this.$confirm('生成年度费用前,请确认基层工会是否已在会员管理系统中调整会员数量。', '提示', {
|
||||
this.$confirm('生成年度费用前,请确认已经申报完成。', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
this.tab_loading = true
|
||||
// 查询是否设置了人均值
|
||||
const resp = await $.get("/platform/jf/yjgh/ghys/isSetUnionAvg")
|
||||
if (resp.data == 0) {
|
||||
this.$confirm('暂未设置人均额度无法下发,是否立即前往人均额度设置页面?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
// 重定向到设置页面
|
||||
window.location.href = "/platform/jf/costsSet/costsSet";
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
|
||||
} else {
|
||||
if ("confirm" == a) {
|
||||
const resp = await $.get("/platform/jf/yjgh/ghys/issue")
|
||||
if (resp.code === 0) {
|
||||
this.flag = true;
|
||||
this.$message.success("操作成功")
|
||||
} else {
|
||||
this.$message.warning("操作失败")
|
||||
}
|
||||
this.doSearch()
|
||||
}
|
||||
}
|
||||
this.tab_loading = false
|
||||
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
const resp = await $.post("/platform/jf/yjgh/ghys/issue")
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg);
|
||||
await this.isSet();
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(resp.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
|
||||
doChangeYs(row) {
|
||||
let self = this;
|
||||
// self.avg= parseDouble(row.totalquota2)>0?parseDouble(row.totalquota2)/(row.hyzs):"暂未分配总额度"
|
||||
$.post(base + "/platform/jf/yjgh/ghys/changeYs", {
|
||||
unionId: row.unid,
|
||||
year: self.pageForm.year,
|
||||
if (row.totalquota2 < 0) {
|
||||
this.$message.warning("请检查总额度!");
|
||||
return
|
||||
}
|
||||
$.post("/platform/jf/yjgh/ghys/changeYs", {
|
||||
unionId: row.unionId,
|
||||
year: this.pageForm.year,
|
||||
totalQuota: row.totalquota2,
|
||||
|
||||
}, function (data) {
|
||||
// console.log(row)
|
||||
if (data.code === 0) {
|
||||
vue.$message.success("分配成功!");
|
||||
}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success("分配成功!");
|
||||
row.edit = false
|
||||
self.pageData()
|
||||
this.pageData()
|
||||
} else {
|
||||
vue.$message.error(data.msg);
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
getJfUnion() {
|
||||
$.post("/platform/jf/yjgh/jfsy/getJfUnion", {year: this.pageForm.year}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.unionOptions = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
// 弹框 生成年度费用前,请确认基层工会已在会员管理系统中调整会员数量
|
||||
// alert("生成年度费用前,请确认基层工会已在会员管理系统中调整会员数量")
|
||||
/* await this.lastYear();*/
|
||||
await this.isSet();
|
||||
this.unionOptions = await getUnions();
|
||||
this.getJfUnion();
|
||||
this.pageData();
|
||||
|
||||
},
|
||||
|
||||
@@ -24,26 +24,29 @@ layout("/layouts/platform.html"){
|
||||
type="year"
|
||||
value-format="yyyy"
|
||||
format="yyyy年"
|
||||
:clearable="false"
|
||||
placeholder="选择年度">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
<!--# if(@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')){ #-->
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-select v-model="pageForm.unionId" filterable placeholder="按院级工会"
|
||||
clearable>
|
||||
<el-select v-model="pageForm.unionId" filterable
|
||||
placeholder="按院级工会" clearable>
|
||||
<el-option
|
||||
v-for="item in unionOptions"
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id">
|
||||
:key="item.unionId"
|
||||
:label="item.unionName"
|
||||
:value="item.unionId">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<!--# } #-->
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button icon="el-icon-search" type="primary"
|
||||
@click="doSearch"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button slot="append" icon="el-icon-download" type="primary" @click="exportExcel">
|
||||
<el-button slot="append" icon="el-icon-download" @click="exportExcel" type="primary">
|
||||
导出
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -63,11 +66,10 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="院级工会名称" prop="unionname" show-overflow-tooltip
|
||||
header-align="center"
|
||||
align="center">
|
||||
<el-table-column label="院级工会名称" prop="unionname"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.unionname}}
|
||||
{{scope.row.unionName}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -75,43 +77,38 @@ layout("/layouts/platform.html"){
|
||||
show-overflow-tooltip
|
||||
header-align="center"
|
||||
align="center">
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="分配总额度" sortable="custom" prop="totalquota"
|
||||
show-overflow-tooltip
|
||||
header-align="center"
|
||||
align="center"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.totalquota">暂未分配</span>
|
||||
<span v-else><i>{{scope.row.totalquota}}</i> 元</span>
|
||||
<template slot-scope="{row}">
|
||||
<span>{{row.unioncode?row.unioncode:row.unitCode}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="已使用额度" sortable="custom" prop="usedquota"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
header-align="center" align="center">
|
||||
<el-table-column label="分配总额度" sortable="custom" prop="totalQuota"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.usedquota">暂未使用</span>
|
||||
<span v-else><i>{{scope.row.usedquota}}</i> 元</span>
|
||||
{{scope.row.totalQuota}}元
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="剩余额度" sortable="custom" prop="usedquota"
|
||||
show-overflow-tooltip
|
||||
align="center"
|
||||
header-align="center" align="center">
|
||||
<el-table-column label="已使用额度" sortable="custom" prop="usedQuota"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.usedquota">{{scope.row.totalquota}}元</span>
|
||||
<span v-else><i>{{scope.row.totalquota-parseIntNum(scope.row.usedquota)}}</i> 元</span>
|
||||
<span v-if="!scope.row.usedQuota">暂未使用</span>
|
||||
<span v-else><i>{{scope.row.usedQuota}}</i> 元</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="剩余额度" sortable="custom" prop="totalQuota"
|
||||
show-overflow-tooltip>
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.totalQuota">{{scope.row.totalQuota}}元</span>
|
||||
<span v-else><i>{{(scope.row.totalQuota-scope.row.usedQuota).toFixed(2)}}</i> 元</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" header-align="center" width="180px"
|
||||
align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" @click="use(scope.row)"
|
||||
<el-button size="mini" @click="use(scope.row)" plain
|
||||
type="primary">使用详情
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -156,11 +153,11 @@ layout("/layouts/platform.html"){
|
||||
<el-button icon="el-icon-search" type="primary"
|
||||
@click="doUseSearch"></el-button>
|
||||
</div>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-button slot="append" @click="openView" type="primary">
|
||||
<!-- <div class="pull-right offscreen-right mt5">
|
||||
<el-button slot="append" @click="openView">
|
||||
<i class="ti-plus"></i>新增使用记录
|
||||
</el-button>
|
||||
</div>
|
||||
</div>-->
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt10">
|
||||
@@ -175,13 +172,13 @@ layout("/layouts/platform.html"){
|
||||
align="center">
|
||||
<template scope="scope"><span>{{unionInfo.year}} </span></template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目" prop="project" header-align="center"
|
||||
<el-table-column label="活动名称" prop="project" header-align="center"
|
||||
align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="所属工会" prop="name" header-align="center"
|
||||
<!--<el-table-column label="所属工会" prop="name" header-align="center"
|
||||
align="center">
|
||||
<template scope="scope"><span>{{unionInfo.name}} </span></template>
|
||||
</el-table-column>
|
||||
</el-table-column>-->
|
||||
|
||||
<el-table-column label="活动时间" prop="activitie_time"
|
||||
header-align="center"
|
||||
@@ -189,10 +186,11 @@ layout("/layouts/platform.html"){
|
||||
<el-table-column label="活动人数" prop="activitie_number"
|
||||
header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column label="活动费用" prop="adjust_money" header-align="center"
|
||||
<el-table-column label="活动费用" prop="adjust_money"
|
||||
header-align="center"
|
||||
align="center"></el-table-column>
|
||||
|
||||
<el-table-column label="调整人" prop="username" header-align="center"
|
||||
<el-table-column label="审核人" prop="username" header-align="center"
|
||||
align="center"></el-table-column>
|
||||
<el-table-column label="事由" prop="adjust_reason" header-align="center"
|
||||
show-overflow-tooltip
|
||||
@@ -337,7 +335,6 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<el-dialog :visible.sync="editDialogVisible" title="编辑">
|
||||
<el-form :model="editFormData" :rules="rules" label-width="80px" ref="form">
|
||||
|
||||
<el-row>
|
||||
<el-col span="12">
|
||||
<el-form-item prop="project" label="活动名称">
|
||||
@@ -448,8 +445,7 @@ layout("/layouts/platform.html"){
|
||||
editFormData: {},
|
||||
editDialogVisible: false,
|
||||
|
||||
unionInfo: {},
|
||||
clickUserInfo: {},
|
||||
unionInfo: {}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -473,16 +469,22 @@ layout("/layouts/platform.html"){
|
||||
editDo() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
this.editFormData.isClub = false
|
||||
const resp = await $.post("/platform/jf/tz/doEdit", this.editFormData)
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
|
||||
closeLoadingFunc(loading, resp, async () => {
|
||||
this.editDialogVisible = false
|
||||
this.use({id: this.formData.id, year: this.clickUserInfo.year, unionname: this.clickUserInfo.unionname})
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
}
|
||||
this.use({id: this.formData.id})
|
||||
}, (data, msg) => {
|
||||
this.$message.error(msg);
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -491,9 +493,10 @@ layout("/layouts/platform.html"){
|
||||
this.formData.id = scope.id
|
||||
this.usePageForm.adjust_id = scope.id
|
||||
that.showYsTz = true
|
||||
this.clickUserInfo = scope
|
||||
this.unionInfo.year = scope.year
|
||||
this.unionInfo.name = scope.unionname
|
||||
this.unionInfo.year = scope.year ? scope.year : this.unionInfo.year
|
||||
this.unionInfo.name = scope.unionname ? scope.unionname : this.unionInfo.name
|
||||
|
||||
|
||||
$.post(base + "/platform/jf/tz/data", this.usePageForm, function (res) {
|
||||
if (res.code === 0) {
|
||||
that.useTableData = res.data.list
|
||||
@@ -622,11 +625,18 @@ layout("/layouts/platform.html"){
|
||||
this.pageForm.pageOrderBy = column.order;
|
||||
this.pageData();
|
||||
},
|
||||
|
||||
getJfUnion() {
|
||||
$.post("/platform/jf/yjgh/jfsy/getJfUnion", {year: this.pageForm.year}).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.unionOptions = res.data;
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
$(".gallery-loader").fadeOut();
|
||||
this.pageData();
|
||||
this.unionOptions = await getUnions();
|
||||
this.getJfUnion();
|
||||
|
||||
},
|
||||
|
||||
|
||||
@@ -1,413 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
|
||||
.el-input-number input {
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.el-input-number__decrease, .el-input-number__increase {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年  度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">经 办 人:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable placeholder="请输入内容"
|
||||
v-model="pageForm.searchKeyword">
|
||||
<el-select placeholder="查询类型" slot="prepend" style="width: 100px;"
|
||||
v-model="pageForm.searchName">
|
||||
<el-option label="姓名" value="rei.userName"></el-option>
|
||||
<el-option label="工号" value="rei.loginName"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属单位:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable="true" filterable="true" placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">报销项目:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable style="width: 100%" v-model="pageForm.reiItemId">
|
||||
<el-option value="ww" label="慰问"></el-option>
|
||||
<el-option value="fyhd" label="活动"></el-option>
|
||||
<el-option value="fyjj" label="建家"></el-option>
|
||||
<el-option value="fyrc" label="日常"></el-option>
|
||||
<el-option value="zflw" label="劳务"></el-option>
|
||||
<el-option value="zfzj" label="专家"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-radio-group @change="doSearch" size="medium" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="null">全部</el-radio-button>
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tabLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='unitName'">
|
||||
{{isDisPlayCode?'('+row.unitcode+')':null}}{{row.unitName}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='unionname'">
|
||||
{{isDisPlayCode?'('+row.unioncode+')':null}}{{row.unionname}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='reimbursementItemSort'">
|
||||
{{row.reimbursementItemSort==='fy'?'费用报销':'支付报销'}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='description'">
|
||||
<span>{{row.activity_name!=null?'活动名称:'+row.activity_name:'被慰问人:'+row.be_username}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
||||
width="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button :loading="row.loading" size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'doRecall',data:row}"
|
||||
:disabled="row.State<=3043">
|
||||
撤回
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'Review',data:row}"
|
||||
:disabled="row.State!=3043">
|
||||
审核
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-row>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
<template #edit>
|
||||
|
||||
<reimbursement-new ref="rei_info2" handle label="审核">
|
||||
<template #handle>
|
||||
<el-form :model="formData" ref="form" :rules="formRules" label-position="right"
|
||||
style="padding: 20px 0"
|
||||
label-width="120px">
|
||||
<el-form-item label="审核信息 " label-width="135px" class="view-header">
|
||||
</el-form-item>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="username" label="审核人员">
|
||||
<el-input v-model="formData.username"
|
||||
disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item prop="auditTime" label="审核时间">
|
||||
<el-input v-model="formData.auditTime" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item prop="auditOpinion" label="审核意见">
|
||||
<el-input type="textarea" v-model="formData.auditOpinion" rows="4"
|
||||
maxlength="500"
|
||||
placeholder="请填写您的审核意见"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="danger" @click="doReview(1)">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button type="warning" @click="doReview(2)">退回
|
||||
</el-button>
|
||||
<el-button type="success" @click="doReview(3)">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</reimbursement-new>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<!--<activity-bx-info ref="act_info" v-show="reimbursementItemId!=4"></activity-bx-info>
|
||||
<info ref="info" v-show="reimbursementItemId==4"></info>-->
|
||||
<reimbursement-new ref="rei_info"></reimbursement-new>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
ReimbursementIsSign: false,
|
||||
reimbursementItemId: "",
|
||||
unions: [],
|
||||
units: [],
|
||||
tabLoading: false,
|
||||
userOptions: [],
|
||||
formData: {},
|
||||
tableData: [],
|
||||
typeOptions: [],
|
||||
pageForm: {
|
||||
searchName: "rei.userName",
|
||||
isAudit: false,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
/* auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
opinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],*/
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '经办人工号'},
|
||||
{prop: 'userName', label: '经办人'},
|
||||
{prop: 'unionName', label: '所在工会'},
|
||||
{prop: 'unitName', label: '所在单位', sortable: true},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'reimbursementItemSort', label: '报销类别', sortable: true},
|
||||
{prop: 'reimbursementItemName', label: '报销项目', sortable: true},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态'},
|
||||
{prop: 'description', label: '备注'},
|
||||
],
|
||||
subDis: false,
|
||||
subLoading1: false,
|
||||
subLoading2: false,
|
||||
subLoading3: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.1'),
|
||||
'info': httpVueLoader('/components/condolence/Info.vue'),
|
||||
'activity-bx-info': httpVueLoader('/components/activityBx/ActivityBxInfo.vue'),
|
||||
'reimbursement-new': httpVueLoader('/components/reimbursement/reimbursementNew.vue?v=4.0.0'),
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'doRecall') {
|
||||
this.doRecall(data)
|
||||
} else if (type == 'Review') {
|
||||
this.openReview(data)
|
||||
}
|
||||
},
|
||||
async doRecall(row) {
|
||||
const confirm = await this.$confirm('您确定要撤回吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
if ("confirm" === confirm) {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
const resp = await $.post(loc() + "/doRecall", {
|
||||
id: row.id
|
||||
});
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
|
||||
}
|
||||
loading.close()
|
||||
|
||||
}
|
||||
},
|
||||
async doReview(flag) {
|
||||
const confirm = await this.$confirm('您确定要审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
});
|
||||
if ("confirm" === confirm) {//确认后再执行
|
||||
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
|
||||
const resp = await $.post(loc() + "/doSubmit", {
|
||||
id: this.formData.id,
|
||||
flag: flag,
|
||||
auditOpinion: this.formData.auditOpinion
|
||||
});
|
||||
if (resp.code === 0) {
|
||||
this.doSearch()
|
||||
this.$message.success(resp.msg)
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
|
||||
}
|
||||
loading.close()
|
||||
|
||||
}
|
||||
|
||||
},
|
||||
openReview(row) {
|
||||
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD')
|
||||
}
|
||||
|
||||
this.$refs.rei_info2.getInfo(row.id)
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
openView(row) {
|
||||
this.$refs.rei_info.getInfo(row.id)
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async getTypeOptions() {
|
||||
const {code, data} = await $.get("/platform/condolence/type/getAll")
|
||||
if (code == 0) {
|
||||
this.typeOptions = data
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
|
||||
},
|
||||
async pageData() {
|
||||
let form = clone(this.pageForm)
|
||||
if (form.isAudit === null) {
|
||||
delete form.isAudit
|
||||
}
|
||||
const resp = await $.post(loc() + "/pageData", form)
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data.list;
|
||||
this.pageForm.totalCount = resp.data.totalCount;
|
||||
} else {
|
||||
this.$message.error(resp.msg);
|
||||
}
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.getTypeOptions()
|
||||
|
||||
if ("${@shiro.hasAnyRoles('sysadmin','A06','xghkj')}" === 'true') {
|
||||
this.unions = await getUnionList(null)
|
||||
} else {
|
||||
this.unions = await getUnionList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
this.pageForm.unionId = this.unions[0].id
|
||||
}
|
||||
|
||||
this.flushUnits()
|
||||
this.pageData();
|
||||
const aa = await getDictState("ReimbursementIsSign")
|
||||
this.ReimbursementIsSign = aa.disabled
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -21,50 +21,6 @@ layout("/layouts/platform.html"){
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">工会名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable filterable
|
||||
placeholder="请选择工会" style="width: 100%"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option
|
||||
:key="item.id"
|
||||
:label="item.unionname"
|
||||
:value="item.id"
|
||||
v-for="item in unionList">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">单位名称:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="doSearch" clearable="true" filterable="true"
|
||||
placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id"
|
||||
v-for="item in unitList"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">报销项目:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="doSearch" clearable
|
||||
style="width: 100%" v-model="pageForm.reiItemId">
|
||||
<el-option value="ww" label="慰问"></el-option>
|
||||
<el-option value="fyhd" label="活动"></el-option>
|
||||
<el-option value="fyjj" label="建家"></el-option>
|
||||
<el-option value="fyrc" label="日常"></el-option>
|
||||
<el-option value="zflw" label="劳务"></el-option>
|
||||
<el-option value="zfzj" label="专家"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item"
|
||||
v-if="${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')}">
|
||||
<div class="search-item-label">经 办 人:</div>
|
||||
@@ -85,21 +41,16 @@ layout("/layouts/platform.html"){
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<el-button :disabled="selectRows.length!==1" @click="printPdf" size="mini"
|
||||
type="primary">打印
|
||||
</el-button>
|
||||
<!--<el-button :disabled="selectRows.length!==1" @click="printPdf" size="mini" type="primary">打印
|
||||
</el-button>-->
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" :size="tableSize"
|
||||
@selection-change="(val)=>{this.selectRows = val}"
|
||||
@sort-change="pageOrder"
|
||||
class="vi-table" row-key="id" style="width: 100%;margin-bottom: 20px"
|
||||
v-loading="tableLoading">
|
||||
|
||||
<el-table-column align="center" header-align="center"
|
||||
type="selection"></el-table-column>
|
||||
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
@@ -122,56 +73,46 @@ layout("/layouts/platform.html"){
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='reimbursementItemSort'">
|
||||
{{row.reimbursementItemSort==='fy'?'费用报销':'支付报销'}}
|
||||
<template scope="{row}" v-else-if="column.prop=='jf_source'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.jf_source"></dict-tag>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='description'">
|
||||
<span>{{row.activity_name!=null?'活动名称:'+row.activity_name:'被慰问人:'+row.be_username}}</span>
|
||||
<template scope="{row}" v-else-if="column.prop=='activity_name'">
|
||||
<span>{{row.activity_name}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop==='unitname'">
|
||||
{{isDisPlayCode?'('+row.unitcode+')':null}}{{row.unitName}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='unionname'">
|
||||
{{isDisPlayCode?'('+row.unioncode+')':null}}{{row.unionName}}
|
||||
<template scope="{row}" v-else-if="column.prop=='helpUnitName'">
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(row.jf_source)">校工会</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)&&['4270', '4330', '4450'].includes(row.unitId)">{{row.unitName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)&&!['4270', '4330', '4450'].includes(row.unitId)">{{row.unionName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_THREE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(row.jf_source)">{{row.clubName}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
prop="userOnline" width="150px">
|
||||
prop="userOnline" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button :loading="row.loading" size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<!-- <el-dropdown-item :disabled="row.stateId!=3040"
|
||||
:command="{type:'submit',data:row}">
|
||||
提交
|
||||
</el-dropdown-item>-->
|
||||
<el-dropdown-item :command="{type:'view',data:row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'edit',data:row}"
|
||||
:disabled="row.State>3043">
|
||||
修改
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:disabled="row.State>3043"
|
||||
:command="{type:'delete',data:row}">
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:disabled="row.State<3100"
|
||||
:command="{type:'export',data:row}">
|
||||
导出报销表
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-button size="mini" type="primary" @click="openView(row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openEdit(row.id)"
|
||||
v-if="[3030,3046,3048,3050,3056,3066,3076,3086,3096].includes(row.State)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger"
|
||||
:disabled="![3030].includes(row.State)"
|
||||
v-if="${!@shiro.hasRole('sysadmin')}">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button @click="doDelete(row.id)" size="mini" type="danger"
|
||||
v-if="${@shiro.hasRole('sysadmin')}">
|
||||
删除
|
||||
</el-button>
|
||||
<!-- <el-button size="mini" type="primary" @click="doExport(row.id)"
|
||||
:disabled="row.State!=3100">
|
||||
导出报销表
|
||||
</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -183,8 +124,6 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<template #view>
|
||||
<reimbursement-new ref="rei_info"></reimbursement-new>
|
||||
<!--<activity-bx-info ref="act_info" v-show="reimbursementItemId!=4"></activity-bx-info>
|
||||
<info ref="info" v-show="reimbursementItemId==4"></info>-->
|
||||
</template>
|
||||
|
||||
|
||||
@@ -212,11 +151,11 @@ layout("/layouts/platform.html"){
|
||||
{prop: 'userName', label: '姓名', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'reimbursementItemSort', label: '报销类别', sortable: true},
|
||||
{prop: 'reimbursementItemName', label: '报销项目', sortable: true},
|
||||
{prop: 'description', label: '备注'},
|
||||
{prop: 'jf_source', label: '活动类型', sortable: true},
|
||||
{prop: 'activity_name', label: '活动项目'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'money', label: '金额'},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态', sortable: true}
|
||||
],
|
||||
formRules: {
|
||||
@@ -226,45 +165,38 @@ layout("/layouts/platform.html"){
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
venue: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
activity_money: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
activity_money: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
activity_card_number: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
activity_time: [{required: false, message: '必填', trigger: ['blur', 'change']}],
|
||||
}
|
||||
activity_time: [{
|
||||
required: false,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
|
||||
},
|
||||
budgetTypeOption: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.1'),
|
||||
'info': httpVueLoader('/components/condolence/Info.vue'),
|
||||
'activity-bx-info': httpVueLoader('/components/activityBx/ActivityBxInfo.vue'),
|
||||
'reimbursement-new': httpVueLoader('/components/reimbursement/reimbursementNew.vue?v=4.0.0'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.0'),
|
||||
'reimbursement-new': httpVueLoader('/components/reimbursement/reimbursementNew.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
printPdf() {
|
||||
window.open("/platform/reimbursement/Summary/reiExport?id=" + this.selectRows[0].id + "&Print=true")
|
||||
},
|
||||
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'submit') {
|
||||
this.doSubmit(data)
|
||||
} else if (type == 'edit') {
|
||||
this.openEdit(data)
|
||||
} else if (type == 'delete') {
|
||||
this.doDelete(data)
|
||||
} else if (type == 'export') {
|
||||
this.export(data)
|
||||
}
|
||||
},
|
||||
export(data) {
|
||||
window.open("/platform/reimbursement/Summary/reiExport?id=" + data.id + "&Print=false")
|
||||
doExport(id) {
|
||||
window.open("/platform/reimbursement/Summary/reiExport?id=" + id + "&Print=true")
|
||||
},
|
||||
doSubmit(row) {
|
||||
const {reimbursementId} = row
|
||||
@@ -278,70 +210,46 @@ layout("/layouts/platform.html"){
|
||||
this.$set(row, "delLoading", true)
|
||||
|
||||
const resp = await $.post(loc() + "/doSubmit", {id: reimbursementId});
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
}else{
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.$set(row, "delLoading", false)
|
||||
|
||||
requestLaterMsgFun(vue, resp, async () => {
|
||||
this.pageData()
|
||||
}, () => {
|
||||
}, () => {
|
||||
this.$set(row, "delLoading", false)
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
doDelete(row) {
|
||||
const {id} = row
|
||||
doDelete(id) {
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
callback: async (a, b) => {
|
||||
if ("confirm" == a) {//确认后再执行
|
||||
this.$set(row, "delLoading", true)
|
||||
this.submitLoading = true
|
||||
const resp = await $.post(loc() + "/doDelete", {id: id});
|
||||
this.submitLoading = false
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$message.success(resp.msg)
|
||||
}else{
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.$set(row, "delLoading", false)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openView(row) {
|
||||
/* const {reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info.getInfo(reimbursementId)
|
||||
}*/
|
||||
this.$refs.rei_info.getInfo(row.id)
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.rei_info.getInfo(id)
|
||||
},
|
||||
openEdit(row) {
|
||||
window.location.href = "/platform/reimbursement/applyNew?id=" + row.id
|
||||
/* const {bxId, reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
this.formData = {}
|
||||
this.$set(row, "editLoading", true)
|
||||
if (reimbursementItemId != 4) {
|
||||
this.actOpenEdit(row, bxId)
|
||||
} else {
|
||||
this.conOpenEdit(row, reimbursementId)
|
||||
}
|
||||
|
||||
this.$refs.guava.edit()*/
|
||||
openEdit(id) {
|
||||
sublime.jumpPagePjax("/platform/reimbursement/applyNew?id=" + id)
|
||||
|
||||
},
|
||||
async conOpenEdit(row, id) {
|
||||
const resp = await $.get("/platform/fw/condolence/info/findOne", {id})
|
||||
if (resp.code === 0) {
|
||||
const v = resp.data
|
||||
requestLaterFun(resp, async (v) => {
|
||||
condolence.toFormData(v)
|
||||
v.bankUserName = row.bankUserName
|
||||
v.bankCardNumber = row.bankCardNumber
|
||||
@@ -352,7 +260,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
this.formData.sign = v.manager_sign
|
||||
await this.userChange(v.be_user)
|
||||
}
|
||||
})
|
||||
},
|
||||
async getUserData(userId) {
|
||||
const {data} = await $.get("/platform/fw/condolence/apply/getUserData", {userId})
|
||||
@@ -366,14 +274,13 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
async actOpenEdit(row, id) {
|
||||
const resp = await $.get(loc() + "/findOne", {id})
|
||||
if (resp.code === 0) {
|
||||
const v = resp.data
|
||||
requestLaterFun(resp, async (v) => {
|
||||
v.bankUserName = row.bankUserName
|
||||
v.bankCardNumber = row.bankCardNumber
|
||||
v.bankOfDeposit = row.bankOfDeposit
|
||||
this.formData = v
|
||||
this.formData.files = JSON.parse(v.files)
|
||||
}
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
@@ -421,12 +328,6 @@ layout("/layouts/platform.html"){
|
||||
this.$set(this.formData, "way", data.way)
|
||||
}
|
||||
},
|
||||
async getTypeOptions() {
|
||||
const {code, data} = await $.get("/platform/condolence/type/getAll")
|
||||
if (code == 0) {
|
||||
this.typeOptions = data
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('A06')||@shiro.hasRole('H03')}" === 'true') {
|
||||
@@ -438,10 +339,8 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.unionList = await getUnionList("${@shiro.getPrincipalProperty('union').getId()}")
|
||||
this.getTypeOptions()
|
||||
this.flushUnits()
|
||||
this.pageData()
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,346 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava padding="0% 5%" ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search>
|
||||
<search-item label="年  度:">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 150px"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会:">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属单位:">
|
||||
<el-select clearable="true" filterable="true" placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<search-item label="报销项目">
|
||||
<el-select clearable style="width: 100%" v-model="pageForm.reiItemId">
|
||||
<el-option :value="4" label="慰问"></el-option>
|
||||
<el-option :value="1" label="文体活动"></el-option>
|
||||
<el-option :value="2" label="日常活动"></el-option>
|
||||
<el-option :value="3" label="其它活动"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</template>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
|
||||
<more v-model="searchMore"></more>
|
||||
</div>
|
||||
|
||||
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-radio-group @change="doSearch" size="medium" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id" style="width: 100%"
|
||||
v-loading="tabLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button :loading="row.loading" size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'Review',data:row}"
|
||||
:disabled="row.State!=3090">
|
||||
审核
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<activity-bx-info handle label="常务副主席审核" ref="act_info2" v-show="reimbursementItemId!=4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
</el-form-item>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.time"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="auditSign" v-if="!ReimbursementIsSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</activity-bx-info>
|
||||
|
||||
<info handle label="常务副主席审核" ref="info2" v-show="reimbursementItemId==4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
</el-form-item>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.time"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="opinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.opinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="sign" v-if="!ReimbursementIsSign">
|
||||
<sign :qz.sync="formData.sign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<activity-bx-info ref="act_info" v-show="reimbursementItemId!=4"></activity-bx-info>
|
||||
<info ref="info" v-show="reimbursementItemId==4"></info>
|
||||
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
ReimbursementIsSign: false,
|
||||
reimbursementItemId: "",
|
||||
unions: [],
|
||||
units: [],
|
||||
tabLoading: false,
|
||||
userOptions: [],
|
||||
formData: {},
|
||||
tableData: [],
|
||||
typeOptions: [],
|
||||
pageForm: {
|
||||
isAudit: false,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
/*auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
opinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],*/
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'userName', label: '经办人'},
|
||||
{prop: 'unionname', label: '所在工会'},
|
||||
{prop: 'unitName', label: '所在单位', sortable: true},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'reimbursementItemName', label: '报销项目', sortable: true},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态'},
|
||||
],
|
||||
subDis: false,
|
||||
subLoading1: false,
|
||||
subLoading2: false,
|
||||
subLoading3: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.1'),
|
||||
'info': httpVueLoader('/components/condolence/Info.vue'),
|
||||
'activity-bx-info': httpVueLoader('/components/activityBx/ActivityBxInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'Review') {
|
||||
this.openReview(data)
|
||||
}
|
||||
},
|
||||
openView(row) {
|
||||
const {reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info.getInfo(reimbursementId)
|
||||
}
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
openReview(row) {
|
||||
const {reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
this.formData = {
|
||||
id: reimbursementId,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
time: moment().format('YYYY-MM-DD'),
|
||||
reimbursementItemId: reimbursementItemId,
|
||||
}
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
this.subLoading3 = false
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info2.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info2.getInfo(reimbursementId)
|
||||
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doReview(flag) {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
const conMoney = this.$refs.info2.viewData.money
|
||||
const actMoney = this.$refs.act_info2.viewData.activity_money
|
||||
this.formData.money = this.formData.reimbursementItemId != 4 ? actMoney : conMoney
|
||||
if (valid) {
|
||||
this.formData.flag = flag
|
||||
this.subDis = true
|
||||
flag ? this.subLoading2 = true : this.subLoading1 = true
|
||||
const resp = await $.post(loc() + "/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(resp.msg)
|
||||
}else{
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.subDis = false
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
}
|
||||
})
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.unions = await getUnionList()
|
||||
this.flushUnits()
|
||||
const aa = await getDictState("ReimbursementIsSign")
|
||||
this.ReimbursementIsSign = aa.disabled
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -14,7 +14,8 @@ layout("/layouts/platform.html"){
|
||||
<div class="search-item-option">
|
||||
<el-date-picker type="daterange" style="width: 100%" range-separator="——"
|
||||
v-model="pageForm.reimbursementDate"
|
||||
value-format="yyyy-MM-dd" format="yyyy-MM-dd" start-placeholder="开始日期"
|
||||
value-format="yyyy-MM-dd" format="yyyy-MM-dd"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"></el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
@@ -40,7 +41,8 @@ layout("/layouts/platform.html"){
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -51,36 +53,43 @@ layout("/layouts/platform.html"){
|
||||
<el-select clearable="true" filterable="true" placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
|
||||
<el-option :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">报销项目:</div>
|
||||
<div class="search-item-label">所属协会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable style="width: 100%" v-model="pageForm.reiItemId">
|
||||
<el-option value="ww" label="慰问"></el-option>
|
||||
<el-option value="fyhd" label="活动"></el-option>
|
||||
<el-option value="fyjj" label="建家"></el-option>
|
||||
<el-option value="fyrc" label="日常"></el-option>
|
||||
<el-option value="zflw" label="劳务"></el-option>
|
||||
<el-option value="zfzj" label="专家"></el-option>
|
||||
<el-select v-model="pageForm.clubId"
|
||||
clearable
|
||||
style="width: 100%"
|
||||
placeholder="请选择所属协会">
|
||||
<el-option
|
||||
v-for="item in clubList"
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">经费来源:</div>
|
||||
<div class="search-item-label">活动类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable style="width: 100%" v-model="pageForm.jf_source">
|
||||
<el-option value="1" label="校工会"></el-option>
|
||||
<el-option value="2" label="分工会"></el-option>
|
||||
<el-option value="3" label="协会"></el-option>
|
||||
<el-select clearable placeholder="活动类型"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.jf_source">
|
||||
<el-option :label="item.name" :value="item.code"
|
||||
v-for="item in budgetTypeOption"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -94,9 +103,13 @@ layout("/layouts/platform.html"){
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id" style="width: 100%"
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
show-summary
|
||||
:summary-method="getSummaries"
|
||||
v-loading="tabLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号"
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
@@ -113,11 +126,17 @@ layout("/layouts/platform.html"){
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='reimbursementItemSort'">
|
||||
{{row.reimbursementItemSort==='fy'?'费用报销':'支付报销'}}
|
||||
<template scope="{row}" v-else-if="column.prop=='jf_source'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.jf_source"></dict-tag>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='description'">
|
||||
<span>{{row.activity_name!=null?'活动名称:'+row.activity_name:'被慰问人:'+row.be_username}}</span>
|
||||
<template scope="{row}" v-else-if="column.prop=='activity_name'">
|
||||
<span>{{row.activity_name}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='helpUnitName'">
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(row.jf_source)">校工会</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)">{{row.unionName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_THREE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(row.jf_source)">{{row.clubName}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='money'">
|
||||
<span>{{row.money}}元</span>
|
||||
@@ -125,23 +144,13 @@ layout("/layouts/platform.html"){
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="150px">
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作"
|
||||
width="200">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button :loading="row.loading" size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
:command="{type:'export',data:row}">
|
||||
打印
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
<el-button type="primary" size="mini" @click="openView(row.id)">查看
|
||||
</el-button>
|
||||
<!-- <el-button type="primary" size="mini" @click="doExport(row.id)">打印
|
||||
</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -150,8 +159,6 @@ layout("/layouts/platform.html"){
|
||||
</el-card>
|
||||
|
||||
<template #view>
|
||||
<!-- <activity-bx-info ref="act_info" v-show="reimbursementItemId!=4"></activity-bx-info>
|
||||
<info ref="info" v-show="reimbursementItemId==4"></info>-->
|
||||
<reimbursement-new ref="rei_info"></reimbursement-new>
|
||||
|
||||
</template>
|
||||
@@ -164,86 +171,93 @@ layout("/layouts/platform.html"){
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
reimbursementItemId: "",
|
||||
unions: [],
|
||||
units: [],
|
||||
tabLoading: false,
|
||||
userOptions: [],
|
||||
formData: {},
|
||||
tableData: [],
|
||||
typeOptions: [],
|
||||
clubList: [],
|
||||
pageForm: {
|
||||
reimbursementDate: [],
|
||||
searchName: "rei.userName",
|
||||
searchKeyword: '',
|
||||
jf_source: '',
|
||||
unionId: '',
|
||||
unitId: '',
|
||||
reiItemId: '',
|
||||
isAudit: false,
|
||||
},
|
||||
formRules: {
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
opinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
clubId: '',
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '经办人工号', sortable: true},
|
||||
{prop: 'userName', label: '姓名', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'reimbursementItemSort', label: '报销类别', sortable: true},
|
||||
{prop: 'reimbursementItemName', label: '报销项目', sortable: true},
|
||||
{prop: 'description', label: '备注'},
|
||||
{prop: 'jf_source', label: '活动类型', sortable: true},
|
||||
{prop: 'activity_name', label: '活动项目'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'money', label: '金额'},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态', sortable: true}
|
||||
],
|
||||
subDis: false,
|
||||
subLoading1: false,
|
||||
subLoading2: false,
|
||||
subLoading3: false,
|
||||
budgetTypeOption:[]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.1'),
|
||||
'info': httpVueLoader('/components/condolence/Info.vue'),
|
||||
'activity-bx-info': httpVueLoader('/components/activityBx/ActivityBxInfo.vue'),
|
||||
'reimbursement-new': httpVueLoader('/components/reimbursement/reimbursementNew.vue'),
|
||||
},
|
||||
methods: {
|
||||
getSummaries(param) {
|
||||
const {columns, data} = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
} else if ([1].includes(index)) {
|
||||
sums[index] = '';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
let num = sums[index].toFixed(2)
|
||||
num += '元';
|
||||
sums[index] = num
|
||||
} else {
|
||||
sums[index] = '';
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
},
|
||||
doExportUserExcel() {
|
||||
const {searchKeyword, searchName, unionId, unitId, reiItemId, reimbursementDate} = this.pageForm
|
||||
window.open(loc() + "/doExportUserExcel?searchKeyword=" + searchKeyword + "&searchName=" + searchName + "&unionId=" + unionId + "&unitId" + unitId + "&reiItemId=" + reiItemId + "&reimbursementDate=" + JSON.stringify(reimbursementDate))
|
||||
const {
|
||||
searchKeyword,
|
||||
searchName,
|
||||
unionId,
|
||||
unitId,
|
||||
clubId,
|
||||
reimbursementDate,
|
||||
jf_source
|
||||
} = this.pageForm
|
||||
window.open(loc() + "/doExportUserExcel?searchKeyword=" + searchKeyword +
|
||||
"&searchName=" + searchName +
|
||||
"&jf_source=" + jf_source +
|
||||
"&unionId=" + unionId +
|
||||
"&unitId" + unitId +
|
||||
"&clubId=" + clubId +
|
||||
"&reimbursementDate=" + JSON.stringify(reimbursementDate))
|
||||
},
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'export') {
|
||||
this.export(data)
|
||||
}
|
||||
doExport(id) {
|
||||
window.open("/platform/reimbursement/Summary/reiExport?id=" + id + "&Print=true")
|
||||
},
|
||||
export(data) {
|
||||
const {reimbursementItemId, id} = data
|
||||
if (reimbursementItemId != 4) {
|
||||
window.open("/platform/reimbursement/Summary/reiExport?id=" + id + "&Print=true")
|
||||
} else {
|
||||
window.open("/platform/reimbursement/Summary/reiExport?id=" + id + "&Print=true")
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
openView(row) {
|
||||
/* const {reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info.getInfo(reimbursementId)
|
||||
}*/
|
||||
this.$refs.rei_info.getInfo(row.id)
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.rei_info.getInfo(id)
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
@@ -269,13 +283,10 @@ layout("/layouts/platform.html"){
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
if ("${@shiro.hasRole('sysadmin')||@shiro.hasRole('wyh02')||@shiro.hasRole('wyh03')||@shiro.hasRole('xghkj')}" === 'true') {
|
||||
this.unions = await getUnionList()
|
||||
} else {
|
||||
this.unions = await getUnionList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
this.pageForm.unionId = this.unions[0].id
|
||||
}
|
||||
this.flushUnits()
|
||||
this.unions = await getUnionList()
|
||||
this.clubList = await getClubsByRole()
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -1,346 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava padding="0% 5%" ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search>
|
||||
<search-item label="年  度:">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 150px"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会:">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属单位:">
|
||||
<el-select clearable="true" filterable="true" placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<search-item label="报销项目">
|
||||
<el-select clearable style="width: 100%" v-model="pageForm.reiItemId">
|
||||
<el-option :value="4" label="慰问"></el-option>
|
||||
<el-option :value="1" label="文体活动"></el-option>
|
||||
<el-option :value="2" label="日常活动"></el-option>
|
||||
<el-option :value="3" label="其它活动"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</template>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
|
||||
<more v-model="searchMore"></more>
|
||||
</div>
|
||||
|
||||
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-radio-group @change="doSearch" size="medium" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id" style="width: 100%"
|
||||
v-loading="tabLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button :loading="row.loading" size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'Review',data:row}"
|
||||
:disabled="row.State!=3080">
|
||||
审核
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<activity-bx-info handle label="分管副主席审核" ref="act_info2" v-show="reimbursementItemId!=4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
</el-form-item>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.time"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="签  字" prop="auditSign" v-if="!ReimbursementIsSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</activity-bx-info>
|
||||
|
||||
<info handle label="分管副主席审核" ref="info2" v-show="reimbursementItemId==4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
</el-form-item>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.time"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="opinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.opinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="sign" v-if="!ReimbursementIsSign">
|
||||
<sign :qz.sync="formData.sign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<activity-bx-info ref="act_info" v-show="reimbursementItemId!=4"></activity-bx-info>
|
||||
<info ref="info" v-show="reimbursementItemId==4"></info>
|
||||
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
ReimbursementIsSign: false,
|
||||
reimbursementItemId: "",
|
||||
unions: [],
|
||||
units: [],
|
||||
tabLoading: false,
|
||||
userOptions: [],
|
||||
formData: {},
|
||||
tableData: [],
|
||||
typeOptions: [],
|
||||
pageForm: {
|
||||
isAudit: false,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
/* auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
opinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],*/
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'userName', label: '经办人'},
|
||||
{prop: 'unionname', label: '所在工会'},
|
||||
{prop: 'unitName', label: '所在单位', sortable: true},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'reimbursementItemName', label: '报销项目', sortable: true},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态'},
|
||||
],
|
||||
subDis: false,
|
||||
subLoading1: false,
|
||||
subLoading2: false,
|
||||
subLoading3: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.1'),
|
||||
'info': httpVueLoader('/components/condolence/Info.vue'),
|
||||
'activity-bx-info': httpVueLoader('/components/activityBx/ActivityBxInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'Review') {
|
||||
this.openReview(data)
|
||||
}
|
||||
},
|
||||
openView(row) {
|
||||
const {reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info.getInfo(reimbursementId)
|
||||
}
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
openReview(row) {
|
||||
const {reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
this.formData = {
|
||||
id: reimbursementId,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
time: moment().format('YYYY-MM-DD'),
|
||||
reimbursementItemId: reimbursementItemId,
|
||||
}
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
this.subLoading3 = false
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info2.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info2.getInfo(reimbursementId)
|
||||
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doReview(flag) {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
const conMoney = this.$refs.info2.viewData.money
|
||||
const actMoney = this.$refs.act_info2.viewData.activity_money
|
||||
this.formData.money = this.formData.reimbursementItemId != 4 ? actMoney : conMoney
|
||||
if (valid) {
|
||||
this.formData.flag = flag
|
||||
this.subDis = true
|
||||
flag ? this.subLoading2 = true : this.subLoading1 = true
|
||||
const resp = await $.post(loc() + "/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(resp.msg)
|
||||
}else{
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.subDis = false
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
}
|
||||
})
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.unions = await getUnionList()
|
||||
this.flushUnits()
|
||||
const aa = await getDictState("ReimbursementIsSign")
|
||||
this.ReimbursementIsSign = aa.disabled
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -22,7 +22,15 @@ layout("/layouts/platform.html"){
|
||||
<el-form :model="formData" label-position="right" label-suffix=":"
|
||||
label-width="130px" :rules="rules" ref="addForm">
|
||||
<el-row gutter="60">
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="活动类型" prop="jf_source">
|
||||
<el-radio-group v-model="formData.jf_source" @change="jfSourceChange">
|
||||
<el-radio border :label="i.code" v-for="i in budgetTypeOption">
|
||||
{{i.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="经办人" prop="userName">
|
||||
<el-input readonly type="text" v-model="formData.userName"></el-input>
|
||||
@@ -35,52 +43,6 @@ layout("/layouts/platform.html"){
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销类别" prop="reimbursementItemSort">
|
||||
<el-radio-group v-model="formData.reimbursementItemSort"
|
||||
@change="reimbursementItemSortChange">
|
||||
<el-radio label="fy" border>费用报销</el-radio>
|
||||
<el-radio label="zf" border>支付凭证</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销项目" prop="reimbursementItemId">
|
||||
<el-radio-group v-model="formData.reimbursementItemId"
|
||||
@change="reimbursementItemChange">
|
||||
<el-radio :label="item.key" border
|
||||
v-for="item in reimbursementItem.filter(v=>v.type==formData.reimbursementItemSort)">
|
||||
{{item.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="支付方式" prop="paymentMethodId">
|
||||
<el-radio-group v-model="formData.paymentMethodId"
|
||||
@change="paymentMethodChange">
|
||||
<el-radio :label="item.key" border v-for="item in paymentMethod">
|
||||
{{item.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销经费来源" prop="jf_source">
|
||||
<el-radio-group v-model="formData.jf_source" @change="jfSourceChange">
|
||||
<el-radio border :label="i.key" v-for="i in jfSourceList">
|
||||
{{i.name}}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="mobile">
|
||||
<el-input type="text" v-model="formData.mobile"
|
||||
@@ -88,9 +50,11 @@ layout("/layouts/platform.html"){
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" v-if="formData.jf_source === '3'">
|
||||
|
||||
<el-col :span="12"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_FOUR','ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.jf_source)">
|
||||
<el-form-item label="所属协会" prop="clubId">
|
||||
<el-select v-model="formData.clubId" @change="clubChange"
|
||||
<el-select v-model="formData.clubId" @change="getBudgetMoneyOrActivity"
|
||||
style="width: 100%"
|
||||
placeholder="请选择所属协会">
|
||||
<el-option
|
||||
@@ -104,255 +68,33 @@ layout("/layouts/platform.html"){
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="经费余额" prop="balance">
|
||||
<el-input type="text" v-model="balance" readonly></el-input>
|
||||
<el-form-item label="经费余额" prop="budgetMoney">
|
||||
<el-input type="text" v-model="budgetMoney" readonly></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="户名" prop="bankUserName">
|
||||
<!--<el-input type="text" placeholder="请输入户名" style="width: 99%"
|
||||
v-model="formData.bankUserName"></el-input>-->
|
||||
<el-autocomplete style="width: 100%"
|
||||
v-model="formData.bankUserName"
|
||||
:fetch-suggestions="querySearchAsync"
|
||||
placeholder="请输入户名"
|
||||
@select="handleSelect"
|
||||
></el-autocomplete>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="银行账号" prop="bankCardNumber">
|
||||
<el-input type="text" placeholder="请输入银行账号"
|
||||
v-model="formData.bankCardNumber"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="开户行" prop="bankOfDeposit">
|
||||
<el-input type="text" placeholder="请输入开户行"
|
||||
v-model="formData.bankOfDeposit"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<template
|
||||
v-if="formData.reimbursementItemId==='fyww'||formData.reimbursementItemId==='zfww'">
|
||||
<template>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="慰问对象" prop="be_user">
|
||||
<el-select
|
||||
v-model="formData.be_user"
|
||||
:remote-method="userRemoteMethod"
|
||||
clearable
|
||||
filterable
|
||||
placeholder="请输入姓名或工号查找"
|
||||
remote
|
||||
reserve-keyword
|
||||
style="width: 100%"
|
||||
@change="userChange">
|
||||
<el-option
|
||||
v-for="item in userOptions"
|
||||
:key="item.id"
|
||||
:label="item.username+'('+item.loginname+')'"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
<el-form-item label="项目名称" prop="activity_name"
|
||||
v-if="['ACTIVITY_BUDGET_TYPE_FOUR','ACTIVITY_BUDGET_TYPE_THREE'].includes(formData.jf_source)">
|
||||
<el-input v-model="formData.activity_name" placeholder="请输入项目名称"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="项目名称" prop="activityId" v-else>
|
||||
<el-select v-model="formData.activityId" filterable
|
||||
@change="activityNameChange"
|
||||
default-first-option
|
||||
placeholder="请选择项目名称" style="width: 100%">
|
||||
<el-option :label="item.activityMatter"
|
||||
:value="item.id"
|
||||
v-for="item in activityList"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!--<el-col :span="12">
|
||||
<el-form-item label="性  别" prop="sex">
|
||||
<el-input v-model="formData.sex" readonly maxlength="30" placeholder="输入慰问对象查询"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生  日" prop="birthday">
|
||||
<el-input v-model="formData.birthday" readonly maxlength="30" placeholder="输入慰问对象查询"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="formData.idCard" maxlength="30" placeholder="输入慰问对象查询"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系方式" prop="conMobile">
|
||||
<el-input v-model="formData.conMobile" maxlength="30"
|
||||
placeholder="请输入慰问对象联系方式"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="慰问类型" prop="type">
|
||||
<el-select v-model="formData.type" style="width: 100%"
|
||||
@change="typeChange"
|
||||
placeholder="请选择慰问类型">
|
||||
<el-option v-for="item in typeOptions2"
|
||||
:label="item.name+' ('+item.code+')'"
|
||||
:value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<template v-if="formData.typeCode === 'D'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住院病由">
|
||||
<el-input v-model="formData.hospital_by"
|
||||
placeholder="请填写住院病由"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="住院时间">
|
||||
<el-date-picker
|
||||
v-model="formData.hospital_time"
|
||||
end-placeholder="结束日期"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
style="width: 100%"
|
||||
type="daterange"
|
||||
value-format="yyyy-MM-dd" placeholder="请选择住院时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入住医院" prop="the_hospital">
|
||||
<el-input v-model="formData.the_hospital"
|
||||
placeholder="请填写入住医院"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="当年次数">
|
||||
<el-input v-model="formData.hospital_yearNum"
|
||||
placeholder="填写当年次数"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="慰问金额" prop="money">
|
||||
<el-input-number v-model="formData.money" :controls="false"
|
||||
:max="1000000000" :min="0"
|
||||
controls-position="right"
|
||||
placeholder="请填写慰问金额"
|
||||
precision="2"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="慰问时间" prop="occur_time">
|
||||
<el-date-picker
|
||||
v-model="formData.occur_time"
|
||||
clearable
|
||||
placeholder="慰问时间"
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<template v-if="formData.typeCode==='E'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="去逝时间" prop="dead_time">
|
||||
<el-date-picker
|
||||
v-model="formData.dead_time"
|
||||
clearable
|
||||
placeholder="去逝时间"
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="与被慰问人关系" prop="dead_gx">
|
||||
<el-select v-model="formData.dead_gx" style="width: 100%"
|
||||
placeholder="请选择与被慰问人关系">
|
||||
<el-option label="配偶" value="配偶"></el-option>
|
||||
<el-option label="父亲" value="父亲"></el-option>
|
||||
<el-option label="母亲" value="母亲"></el-option>
|
||||
<el-option label="子女" value="子女"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<template v-if="formData.typeCode==='A'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="结婚时间" prop="marry_time">
|
||||
<el-date-picker
|
||||
v-model="formData.marry_time"
|
||||
clearable
|
||||
placeholder="结婚时间"
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
|
||||
<template v-if="formData.typeCode==='B'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="生育时间" prop="birth_time">
|
||||
<el-date-picker
|
||||
v-model="formData.birth_time"
|
||||
clearable
|
||||
placeholder="生育时间"
|
||||
style="width: 100%"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动名称" prop="activity_name">
|
||||
<el-input type="text" v-model="formData.activity_name"
|
||||
placeholder="请输入活动名称"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col v-if="formData.reimbursementItemId=='fyhd'" :span="12">
|
||||
<el-form-item label="活动类型" prop="activity_type">
|
||||
<el-select v-model="formData.activity_type" placeholder="请选择活动类型"
|
||||
style="width: 100%">
|
||||
<el-option label="分工会活动" value="1"></el-option>
|
||||
<el-option label="校工会活动" value="2"></el-option>
|
||||
<el-option label="协会活动" value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动人数" prop="activity_number"
|
||||
v-if="formData.reimbursementItemId=='fyhd'">
|
||||
<el-input v-model="formData.activity_number" placeholder="请输入活动人数"
|
||||
type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="活动地点" prop="venue">
|
||||
<el-input v-model="formData.venue" placeholder="请输入活动地点"
|
||||
type="text"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销金额" prop="money">
|
||||
<el-input v-model="formData.money" placeholder="输入报销金额"
|
||||
<el-form-item label="金额" prop="money">
|
||||
<el-input v-model="formData.money" :placeholder="moneyPlaceholder"
|
||||
type="number"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -369,29 +111,6 @@ layout("/layouts/platform.html"){
|
||||
|
||||
</template>
|
||||
|
||||
<el-col :span="12" v-if="formData.reimbursementItemSort === 'fy'">
|
||||
<el-form-item label="发票张数" prop="files_num">
|
||||
<el-input-number v-model="formData.files_num" :controls="false"
|
||||
:max="1000000000" :min="0" controls-position="right"
|
||||
placeholder="请填写发票张数"
|
||||
style="width: 100%"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12" v-if="formData.reimbursementItemSort === 'fy'">
|
||||
<el-form-item id="billNumber" label="发票号码" prop="billNumber">
|
||||
<el-input v-model="formData.billNumber"
|
||||
placeholder="请填写发票号码,如有多个请用逗号分隔"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<!-- <el-col :span="24">
|
||||
<el-form-item label="参加随行人员" prop="personnel">
|
||||
<el-input v-model="formData.personnel" :autosize="{ minRows: 4, maxRows: 8}" maxlength="500"
|
||||
placeholder="请填写参加随行人员" type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>-->
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="支付内容" prop="cause">
|
||||
@@ -403,28 +122,21 @@ layout("/layouts/platform.html"){
|
||||
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark"
|
||||
:autosize="{ minRows: 4, maxRows: 8}" maxlength="500"
|
||||
placeholder="需要填写: 发票编号、开具方、金额" type="textarea"></el-input>
|
||||
<el-form-item label="附件" prop="files">
|
||||
<file-upload card :max="50" :files.sync="formData.files">
|
||||
<template #el-upload__tip>
|
||||
<div class="el-upload__tip" slot="tip"
|
||||
style="color: red;display: contents;font-size: 13px">
|
||||
附件需上传本人签名的发票照片或者PDF
|
||||
</div>
|
||||
</template>
|
||||
</file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col v-if="!ReimbursementIsSign" :span="24">
|
||||
<el-form-item label="签  字" prop="sign">
|
||||
<sign :qz.sync="formData.sign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item v-if="['zfzj', 'zflw'].includes(formData.reimbursementItemId)"
|
||||
label="附件"
|
||||
prop="files">
|
||||
<file-upload card :max="50" :files.sync="formData.files"></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item v-else label="附件" prop="files">
|
||||
<file-upload card :max="50" :files.sync="formData.files"></file-upload>
|
||||
<el-form-item label="签  字" prop="signUrl">
|
||||
<sign :qz.sync="formData.signUrl" prefix="reimbursement"
|
||||
:is_value_base64="false"></sign>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -432,7 +144,11 @@ layout("/layouts/platform.html"){
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button type="primary" :disabled="roleDisabled" @click="doAdd()">确 定</el-button>
|
||||
<el-button plain type="primary" :disabled="roleDisabled" @click="doAdd(false)">保
|
||||
存
|
||||
</el-button>
|
||||
<el-button type="primary" :disabled="roleDisabled" @click="doAdd(true)">提 交
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -450,7 +166,8 @@ layout("/layouts/platform.html"){
|
||||
let self = this
|
||||
let checkFiles = function (rule, value, callback) {
|
||||
if (self.formData.reimbursementItemId === 'fyww' || self.formData.reimbursementItemId === 'zfww'
|
||||
|| self.formData.reimbursementItemId === 'zfzj' || self.formData.reimbursementItemId === 'zflw') {
|
||||
|| self.formData.reimbursementItemId === 'zfzj' || self.formData.reimbursementItemId === 'zflw'
|
||||
|| self.formData.reimbursementItemId === 'zfjl') {
|
||||
callback()
|
||||
} else {
|
||||
if (self.formData.files === undefined || self.formData.files === null) {
|
||||
@@ -461,8 +178,7 @@ layout("/layouts/platform.html"){
|
||||
};
|
||||
return {
|
||||
clubList: [],
|
||||
balance: 0,
|
||||
ReimbursementIsSign: false,
|
||||
budgetMoney: 0,
|
||||
jfSourceList: [],
|
||||
typeOptions: [],
|
||||
typeOptions2: [],
|
||||
@@ -475,6 +191,7 @@ layout("/layouts/platform.html"){
|
||||
{key: "zfww", name: '慰问', type: "zf"},
|
||||
{key: "zfzj", name: '专家', type: "zf"},
|
||||
{key: "zflw", name: '劳务', type: "zf"},
|
||||
{key: "zfjl", name: '奖励', type: "zf"},
|
||||
],
|
||||
paymentMethod: [
|
||||
{key: "dgzf", name: '对公支付'},
|
||||
@@ -482,7 +199,7 @@ layout("/layouts/platform.html"){
|
||||
],
|
||||
rules: {
|
||||
jf_source: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
be_user: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
//be_user: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
reimbursementItemSort: [{
|
||||
required: true,
|
||||
message: '请选择报销类别',
|
||||
@@ -498,39 +215,130 @@ layout("/layouts/platform.html"){
|
||||
message: '请输入支付方式',
|
||||
trigger: ['change', 'blur']
|
||||
}],
|
||||
mobile: [{required: true, message: '请输入联系方式', trigger: ['change', 'blur']}],
|
||||
conMobile: [{
|
||||
required: true,
|
||||
message: '请输入慰问人联系方式',
|
||||
mobile: [{
|
||||
required: false,
|
||||
message: '请输入联系方式',
|
||||
trigger: ['change', 'blur']
|
||||
}],
|
||||
type: [{required: true, message: '请选择慰问类型', trigger: ['change']}],
|
||||
occur_time: [{required: true, message: '请输入慰问时间', trigger: ['change', 'blur']}],
|
||||
money: [{required: true, message: '请输入慰问金额', trigger: ['change', 'blur']}],
|
||||
conMobile: [{
|
||||
required: true,
|
||||
message: '请输入联系方式',
|
||||
trigger: ['change', 'blur']
|
||||
}],
|
||||
//type: [{required: true, message: '请选择慰问类型', trigger: ['change']}],
|
||||
occur_time: [{
|
||||
required: true,
|
||||
message: '请输入时间',
|
||||
trigger: ['change', 'blur']
|
||||
}],
|
||||
money: [{required: true, message: '请输入金额', trigger: ['change', 'blur']}],
|
||||
activityId: [{required: true, message: '请输入金额', trigger: ['change', 'blur']}],
|
||||
personnel: [{
|
||||
required: true,
|
||||
message: '请填写参加随行人员',
|
||||
trigger: ['change', 'blur']
|
||||
}],
|
||||
cause: [{required: true, message: '请填写支付内容', trigger: ['change', 'blur']}],
|
||||
cause: [{
|
||||
required: true,
|
||||
message: '请填写支付内容',
|
||||
trigger: ['change', 'blur']
|
||||
}],
|
||||
//remark: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
files_num: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
bankUserName: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
bankCardNumber: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
bankCardNumber: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['change', 'blur']
|
||||
}],
|
||||
bankOfDeposit: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
activity_name: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
clubId: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
unionId: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
billNumber: [{
|
||||
required: true,
|
||||
message: '请填写发票号码,如有多个请用逗号分隔',
|
||||
trigger: ['change', 'blur']
|
||||
}],
|
||||
files: [{required: true, validator: checkFiles, trigger: ['blur', 'change']}],
|
||||
signUrl: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
activity_time: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
activity_number: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['change', 'blur']
|
||||
}],
|
||||
},
|
||||
roleDisabled: false,
|
||||
|
||||
activityList: [],
|
||||
budgetTypeOption: [],
|
||||
moneyPlaceholder: "请输入金额",
|
||||
totalBudgetMoney: 0
|
||||
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async getBxMoneyByActivityId(activityId, jf_source) {
|
||||
const resp = await $.post("/platform/reimbursement/applyNew/getBxMoneyByActivityId", {
|
||||
activityId,
|
||||
jf_source
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
return resp.data
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
},
|
||||
async activityNameChange(val) {
|
||||
if (val) {
|
||||
if (["ACTIVITY_BUDGET_TYPE_TWO", "ACTIVITY_BUDGET_TYPE_ONE"].includes(this.formData.jf_source)) {
|
||||
const data = this.activityList.find(a => a.id === val)
|
||||
if (this.formData.jf_source === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
if (data.isSchoolBudget) {
|
||||
this.moneyPlaceholder = "预算金额" + data.totalBudgetMoney + "元"
|
||||
} else {
|
||||
if (data.isRepeatReimbursement) {
|
||||
const money = await this.getBxMoneyByActivityId(val, this.formData.jf_source)
|
||||
if (money > 0) {
|
||||
this.moneyPlaceholder = "预算金额:" + data.totalBudgetMoney + "元,已报销金额:" + money + ",不能超过20%"
|
||||
} else {
|
||||
this.moneyPlaceholder = "预算金额:" + data.totalBudgetMoney + "元,不能超过20%"
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (data.isRepeatReimbursement) {
|
||||
const money = await this.getBxMoneyByActivityId(val, this.formData.jf_source)
|
||||
if (money > 0) {
|
||||
this.moneyPlaceholder = "预算金额:" + data.totalBudgetMoney + "元,已报销金额:" + money + ",不能超过20%"
|
||||
} else {
|
||||
this.moneyPlaceholder = "预算金额:" + data.totalBudgetMoney + "元,不能超过20%"
|
||||
}
|
||||
} else {
|
||||
const money = await this.getBxMoneyByActivityId(val, this.formData.jf_source)
|
||||
if (money > 0) {
|
||||
this.moneyPlaceholder = "预算金额:" + (data.totalBudgetMoney - money) + "元"
|
||||
} else {
|
||||
this.moneyPlaceholder = "预算金额:" + data.totalBudgetMoney + "元,不能超过20%"
|
||||
}
|
||||
}
|
||||
}
|
||||
this.totalBudgetMoney = data.totalBudgetMoney
|
||||
this.$set(this.formData, 'activity_name', data.activityMatter)
|
||||
} else {
|
||||
this.moneyPlaceholder = "预算金额" + this.budgetMoney + "元"
|
||||
this.totalBudgetMoney = this.budgetMoney
|
||||
this.$set(this.formData, 'activity_name', val)
|
||||
}
|
||||
} else {
|
||||
this.moneyPlaceholder = "请输入金额"
|
||||
this.totalBudgetMoney = 0
|
||||
this.$set(this.formData, 'activity_name', null)
|
||||
}
|
||||
},
|
||||
async querySearchAsync(queryString, cb) {
|
||||
const resp = await $.get(loc() + "/getLastData", {
|
||||
queryString: queryString
|
||||
@@ -545,67 +353,77 @@ layout("/layouts/platform.html"){
|
||||
this.$set(this.formData, 'bankOfDeposit', item.bankOfDeposit)
|
||||
},
|
||||
async jfSourceChange(val) {
|
||||
//判断权限
|
||||
const resp = await $.get(loc() + '/validRole', {val: val})
|
||||
this.roleDisabled = resp.code !== 0
|
||||
if (resp.code !== 0) {
|
||||
this.$alert(resp.msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'warning'
|
||||
});
|
||||
//this.formData.jf_source = ''
|
||||
return
|
||||
}
|
||||
if (!val) {
|
||||
this.balance = 0
|
||||
this.budgetMoney = 0
|
||||
return
|
||||
}
|
||||
if (val == "1") {
|
||||
const {data} = await $.get(loc() + "/getSchoolBudget")
|
||||
this.balance = data
|
||||
} else if (val == "2") {
|
||||
await this.getBalance()
|
||||
} else {
|
||||
//this.balance = 0
|
||||
await this.clubChange(this.formData.clubId)
|
||||
this.$set(this.formData, "activityId", null)
|
||||
await this.getBudgetMoneyOrActivity()
|
||||
if (val === "ACTIVITY_BUDGET_TYPE_TWO") {
|
||||
this.$set(this.formData, "unionId", "${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
}
|
||||
},
|
||||
async clubChange(val) {
|
||||
const {data} = await $.get(loc() + "/getClubBudget", {
|
||||
clubId: val
|
||||
async getBudgetMoneyOrActivity() {
|
||||
const {data} = await $.get(loc() + "/getBudgetMoneyOrActivity", {
|
||||
clubId: this.formData.clubId,
|
||||
unionId: this.formData.unionId,
|
||||
id: this.formData.id,
|
||||
jf_source: this.formData.jf_source
|
||||
})
|
||||
this.balance = data
|
||||
this.budgetMoney = data.budgetMoney
|
||||
this.activityList = data.activityList
|
||||
},
|
||||
doAdd() {
|
||||
this.$refs["addForm"].validate(async (valid) => {
|
||||
if (valid) {
|
||||
if (this.balance < this.formData.money) {
|
||||
this.$message.warning("余额不足,请联系校工会")
|
||||
return
|
||||
}
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
const data = this.formData
|
||||
data.starting_time = data.hospital_time ? data.hospital_time[0] : ''
|
||||
data.end_time = data.hospital_time ? data.hospital_time[1] : ''
|
||||
const resp = await $.post(loc() + (this.formData.id ? "/doEdit" : "/doAdd"), {
|
||||
data: JSON.stringify(data),
|
||||
sign: this.formData.sign
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.$message.success(resp.msg)
|
||||
window.location.href = '/activity/reimbursement/list'
|
||||
} else {
|
||||
this.$message.warning(resp.msg)
|
||||
loading.close()
|
||||
}
|
||||
}
|
||||
async addValidate() {
|
||||
const {activityId, jf_source, money, clubId} = this.formData
|
||||
const resp = await $.post("/platform/reimbursement/applyNew/bxAddValidate", {
|
||||
activityId,
|
||||
jf_source,
|
||||
money,
|
||||
clubId
|
||||
})
|
||||
return resp
|
||||
},
|
||||
async doAdd(flag) {
|
||||
let valid = false
|
||||
if (flag) {
|
||||
valid = await this.$refs["addForm"].validate()
|
||||
if (!valid) {
|
||||
return
|
||||
}
|
||||
)
|
||||
}
|
||||
const validateResp = await this.addValidate()
|
||||
if (validateResp.code !== 0) {
|
||||
this.$alert(validateResp.msg, '温馨提示', {
|
||||
confirmButtonText: '确定',
|
||||
callback: action => {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
return
|
||||
}
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: '正在提交...',
|
||||
spinner: 'el-icon-loading',
|
||||
background: COVER_LAYER_COLOR
|
||||
});
|
||||
const data = this.formData
|
||||
data.starting_time = data.hospital_time ? data.hospital_time[0] : ''
|
||||
data.end_time = data.hospital_time ? data.hospital_time[1] : ''
|
||||
const resp = await $.post(loc() + (this.formData.id ? "/doEdit" : "/doAdd"), {
|
||||
data: JSON.stringify(data),
|
||||
sign: this.formData.sign,
|
||||
flag: flag
|
||||
})
|
||||
loading.close()
|
||||
if (resp.code === 0) {
|
||||
this.notifySuccess(resp.msg)
|
||||
window.location.href="/activity/reimbursement/list"
|
||||
} else {
|
||||
this.notifyWarning(resp.msg)
|
||||
|
||||
}
|
||||
},
|
||||
reimbursementItemSortChange(val) {
|
||||
this.$set(this.formData, "type", null)
|
||||
@@ -632,25 +450,20 @@ layout("/layouts/platform.html"){
|
||||
} else {
|
||||
this.rules.files[0].required = true
|
||||
}
|
||||
|
||||
if (this.$refs["addForm"])
|
||||
this.$refs["addForm"].clearValidate();
|
||||
},
|
||||
async initData() {
|
||||
this.$set(this.formData, "reimbursementItemSort", "fy")
|
||||
this.$set(this.formData, "userName", "${@shiro.getPrincipalProperty('username')}")
|
||||
this.$set(this.formData, "loginName", "${@shiro.getPrincipalProperty('loginname')}")
|
||||
this.$set(this.formData, "unitName", "${@shiro.getPrincipalProperty('unit').getName()}")
|
||||
this.$set(this.formData, "unionName", "${@shiro.getPrincipalProperty('union').getUnionname()}")
|
||||
this.$set(this.formData, "mobile", "${@shiro.getPrincipalProperty('mobile')}")
|
||||
this.$set(this.formData, "reimbursementItemId", "fyhd")
|
||||
await this.getTypeOptions()
|
||||
this.reimbursementItemSortChange(this.formData.reimbursementItemSort)
|
||||
this.reimbursementItemChange(this.formData.reimbursementItemId)
|
||||
},
|
||||
async getBalance() {
|
||||
const {data} = await $.get(loc() + "/getBalance")
|
||||
this.balance = data
|
||||
this.$set(this.formData, "goods", [])
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
},
|
||||
|
||||
async userRemoteMethod(query) {
|
||||
if (query) {
|
||||
const {data} = await $.get("/platform/fw/condolence/apply/queryUser", {query})
|
||||
@@ -685,42 +498,55 @@ layout("/layouts/platform.html"){
|
||||
this.$set(this.formData, 'job_title', userData.jobtitle)
|
||||
},
|
||||
async findData(id) {
|
||||
|
||||
const refs = await $.get(loc() + "/findOne", {id})
|
||||
|
||||
if(refs.data.be_user) {
|
||||
if (refs.data.be_user) {
|
||||
const userData = await this.getUserData(refs.data.be_user);
|
||||
this.userOptions.push(userData)
|
||||
}
|
||||
// await this.userChange()
|
||||
await this.jfSourceChange(refs.data.jf_source)
|
||||
|
||||
this.formData = refs.data
|
||||
await this.getBudgetMoneyOrActivity()
|
||||
this.activityNameChange(this.formData.activityId ? this.formData.activityId : this.formData.activity_name)
|
||||
},
|
||||
async getClubsByUser() {
|
||||
const {data} = await $.get("/platform/reimbursement/applyNew/getClubsByUser", {})
|
||||
return data
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
this.initData()
|
||||
await this.initData()
|
||||
this.clubList = await this.getClubsByUser()
|
||||
let budgetTypeOption = []
|
||||
if ("${@shiro.hasRole('sysadmin')}" === 'true') {
|
||||
this.jfSourceList.push({key: "1", name: "校工会"})
|
||||
this.jfSourceList.push({key: "2", name: "分工会"})
|
||||
this.jfSourceList.push({key: "3", name: "协会/协会"})
|
||||
|
||||
} else {
|
||||
if ("${@shiro.hasRole('A06')}" === 'true') {
|
||||
this.jfSourceList.push({key: "1", name: "校工会"})
|
||||
if ("${@shiro.hasRole('A06')||@shiro.hasRole('xghjf')}" === 'true') {
|
||||
this.budgetTypeOption.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_ONE"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
if ("${@shiro.hasAnyRoles('H04', 'gh01')}" === 'true') {
|
||||
this.jfSourceList.push({key: "2", name: "分工会"})
|
||||
if ("${@shiro.hasRole('H01')}" === 'true') {
|
||||
this.budgetTypeOption.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_TWO"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
if ("${@shiro.hasRole('club01')}" === 'true') {
|
||||
this.jfSourceList.push({key: "3", name: "协会/协会"})
|
||||
|
||||
if (this.clubList.length>0) {
|
||||
this.budgetTypeOption.map(v => {
|
||||
if (["ACTIVITY_BUDGET_TYPE_THREE", "ACTIVITY_BUDGET_TYPE_FOUR"].includes(v.code)) {
|
||||
budgetTypeOption.push(v)
|
||||
}
|
||||
})
|
||||
}
|
||||
this.budgetTypeOption = budgetTypeOption
|
||||
}
|
||||
|
||||
const id = getQueryVariable("id")
|
||||
if (id) await this.findData(id)
|
||||
this.clubList = await getClubsByUser()
|
||||
await this.jfSourceChange(this.formData.jf_source)
|
||||
const aa = await getDictState("ReimbursementIsSign")
|
||||
this.ReimbursementIsSign = aa.disabled
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年  度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" size="small" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">已审核</el-radio-button>
|
||||
<el-radio-button :label="3">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" :size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
class="vi-table" row-key="id" style="width: 100%;margin-bottom: 20px"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='jf_source'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.jf_source"></dict-tag>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='activity_name'">
|
||||
<span>{{row.activity_name}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='helpUnitName'">
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(row.jf_source)">校工会</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)">{{row.unionName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_THREE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(row.jf_source)">{{row.clubName}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
prop="userOnline" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openAudit(row.id)"
|
||||
:disabled="row.State!=3046">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doRevoke(row.id)"
|
||||
v-if="[3047,3048,3050].includes(row.State)">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
<template #edit>
|
||||
<info handle label="协会会长审核" ref="info2">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<vi-title2 title="审核信息"></vi-title2>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.auditTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="auditSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="clubAudit"
|
||||
:is_value_base64="false"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :loading="submitLoading"
|
||||
@click="doAudit(1)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(2)"
|
||||
type="info">退回修改
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(3)"
|
||||
type="primary">通 过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
|
||||
pageForm: {
|
||||
isAudit: 3,
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '经办人工号', sortable: true},
|
||||
{prop: 'userName', label: '姓名', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'jf_source', label: '活动类型', sortable: true},
|
||||
{prop: 'activity_name', label: '活动项目'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'money', label: '金额'},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态', sortable: true}
|
||||
],
|
||||
budgetTypeOption: [],
|
||||
formRules: {
|
||||
auditSign: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/reimbursement/reimbursementNew.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.info.getInfo(id)
|
||||
},
|
||||
openAudit(id) {
|
||||
this.formData = {
|
||||
id: id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.info2.getInfo(id)
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doRevoke(id) {
|
||||
this.$confirm('确定要撤回审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
const res = await $.post('/platform/reimbursement/clubAudit/doRevoke', {id})
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
doAudit(flag) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确定要提交审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
this.formData.flag = flag
|
||||
const res = await $.post('/platform/reimbursement/clubAudit/doAudit', this.formData)
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -1,383 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
input[type="file"] {
|
||||
display: none
|
||||
}
|
||||
|
||||
.el-input-number input {
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.el-input-number__decrease, .el-input-number__increase {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava padding="0% 5%" ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search>
|
||||
<search-item label="年  度:">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 150px"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会:">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属单位:">
|
||||
<el-select clearable="true" filterable="true" placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<search-item label="报销项目">
|
||||
<el-select clearable style="width: 100%" v-model="pageForm.reiItemId">
|
||||
<el-option :value="4" label="慰问"></el-option>
|
||||
<el-option :value="1" label="文体活动"></el-option>
|
||||
<el-option :value="2" label="日常活动"></el-option>
|
||||
<el-option :value="3" label="其它活动"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</template>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
|
||||
<more v-model="searchMore"></more>
|
||||
</div>
|
||||
|
||||
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-radio-group @change="doSearch" size="medium" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id" style="width: 100%"
|
||||
v-loading="tabLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop==='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='unitName'">
|
||||
{{isDisPlayCode?'('+row.unitcode+')':null}}{{row.unitName}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop==='unionname'">
|
||||
{{isDisPlayCode?'('+row.unioncode+')':null}}{{row.unionname}}
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='description'">
|
||||
<span>{{row.activity_name!=null?'活动名称:'+row.activity_name:'被慰问人:'+row.be_username}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button :loading="row.loading" size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'Review',data:row}"
|
||||
:disabled="row.State!=3050">
|
||||
审核
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
</el-row>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
|
||||
<activity-bx-info handle label="分工会审核" ref="act_info2" v-show="reimbursementItemId!=4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
</el-form-item>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.time"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="auditSign" v-if="!ReimbursementIsSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</activity-bx-info>
|
||||
|
||||
<info handle label="分工会审核" ref="info2" v-show="reimbursementItemId==4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
</el-form-item>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.time"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.opinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="sign" v-if="!ReimbursementIsSign">
|
||||
<sign :qz.sync="formData.sign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<activity-bx-info ref="act_info" v-show="reimbursementItemId!=4"></activity-bx-info>
|
||||
<info ref="info" v-show="reimbursementItemId==4"></info>
|
||||
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
ReimbursementIsSign: false,
|
||||
reimbursementItemId: "",
|
||||
unions: [],
|
||||
units: [],
|
||||
tabLoading: false,
|
||||
userOptions: [],
|
||||
formData: {},
|
||||
tableData: [],
|
||||
typeOptions: [],
|
||||
pageForm: {
|
||||
isAudit: false,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
/* auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
opinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],*/
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'userName', label: '经办人'},
|
||||
{prop: 'unionname', label: '所在工会'},
|
||||
{prop: 'unitName', label: '所在单位', sortable: true},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'reimbursementItemName', label: '报销项目', sortable: true},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态'},
|
||||
{prop: 'description', label: '备注'},
|
||||
],
|
||||
subDis: false,
|
||||
subLoading1: false,
|
||||
subLoading2: false,
|
||||
subLoading3: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.1'),
|
||||
'info': httpVueLoader('/components/condolence/Info.vue'),
|
||||
'activity-bx-info': httpVueLoader('/components/activityBx/ActivityBxInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'Review') {
|
||||
this.openReview(data)
|
||||
}
|
||||
},
|
||||
doReview(flag) {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
const conMoney = this.$refs.info2.viewData.money
|
||||
const actMoney = this.$refs.act_info2.viewData.activity_money
|
||||
this.formData.money = this.formData.reimbursementItemId != 4 ? actMoney : conMoney
|
||||
if (valid) {
|
||||
this.formData.flag = flag
|
||||
this.subDis = true
|
||||
flag ? this.subLoading2 = true : this.subLoading1 = true
|
||||
const resp = await $.post(loc() + "/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(resp.msg)
|
||||
}else{
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.subDis = false
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
}
|
||||
})
|
||||
},
|
||||
openReview(row) {
|
||||
const {reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
this.formData = {
|
||||
id: reimbursementId,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
time: moment().format('YYYY-MM-DD'),
|
||||
reimbursementItemId: reimbursementItemId,
|
||||
}
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
this.subLoading3 = false
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info2.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info2.getInfo(reimbursementId)
|
||||
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
openView(row) {
|
||||
const {reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info.getInfo(reimbursementId)
|
||||
}
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
async getTypeOptions() {
|
||||
const {code, data} = await $.get("/platform/condolence/type/getAll")
|
||||
if (code == 0) {
|
||||
this.typeOptions = data
|
||||
}
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.getTypeOptions()
|
||||
if ("${@shiro.hasRole('sysadmin')}" === 'true') {
|
||||
this.unions = await getUnionList(null)
|
||||
} else {
|
||||
this.unions = await getUnionList("${@shiro.getPrincipalProperty('unit').getUnionid()}")
|
||||
this.pageForm.unionId = this.unions[0].id
|
||||
}
|
||||
|
||||
this.flushUnits()
|
||||
const aa = await getDictState("ReimbursementIsSign")
|
||||
this.ReimbursementIsSign = aa.disabled
|
||||
}
|
||||
})
|
||||
</script>
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -1,358 +0,0 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava padding="0% 5%" ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<search>
|
||||
<search-item label="年  度:">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 150px"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属工会:">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<search-item label="所属单位:">
|
||||
<el-select clearable="true" filterable="true" placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
<template v-if="searchMore">
|
||||
<search-item label="报销项目">
|
||||
<el-select clearable style="width: 100%" v-model="pageForm.reiItemId">
|
||||
<el-option :value="4" label="慰问"></el-option>
|
||||
<el-option :value="1" label="文体活动"></el-option>
|
||||
<el-option :value="2" label="日常活动"></el-option>
|
||||
<el-option :value="3" label="其它活动"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
</template>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
|
||||
<more v-model="searchMore"></more>
|
||||
</div>
|
||||
|
||||
|
||||
</search>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-radio-group @change="doSearch" size="medium" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id" style="width: 100%"
|
||||
v-loading="tabLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button :loading="row.loading" size="mini">
|
||||
<i class="ti-settings"></i>
|
||||
<span class="ti-angle-down"></span>
|
||||
</el-button>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-item :command="{type:'view',data:row}">
|
||||
查看
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :command="{type:'Review',data:row}"
|
||||
:disabled="row.State!=3070">
|
||||
审核
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<activity-bx-info handle label="财务审核" ref="act_info2" v-show="reimbursementItemId!=4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
</el-form-item>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.time"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销金额" prop="activity_money">
|
||||
<el-input v-model="formData.activity_money"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="auditSign" v-if="!ReimbursementIsSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</activity-bx-info>
|
||||
|
||||
<info handle label="财务审核" ref="info2" v-show="reimbursementItemId==4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
</el-form-item>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.time"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="报销金额" prop="money">
|
||||
<el-input v-model="formData.money"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="opinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.opinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="sign" v-if="!ReimbursementIsSign">
|
||||
<sign :qz.sync="formData.sign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<activity-bx-info ref="act_info" v-show="reimbursementItemId!=4"></activity-bx-info>
|
||||
<info ref="info" v-show="reimbursementItemId==4"></info>
|
||||
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
ReimbursementIsSign: false,
|
||||
reimbursementItemId: "",
|
||||
unions: [],
|
||||
units: [],
|
||||
tabLoading: false,
|
||||
userOptions: [],
|
||||
formData: {},
|
||||
tableData: [],
|
||||
typeOptions: [],
|
||||
pageForm: {
|
||||
isAudit: false,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
/* auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
opinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],*/
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'userName', label: '经办人'},
|
||||
{prop: 'unionname', label: '所在工会'},
|
||||
{prop: 'unitName', label: '所在单位', sortable: true},
|
||||
{prop: 'mobile', label: '联系方式'},
|
||||
{prop: 'reimbursementItemName', label: '报销项目', sortable: true},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态'},
|
||||
],
|
||||
subDis: false,
|
||||
subLoading1: false,
|
||||
subLoading2: false,
|
||||
subLoading3: false,
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.1'),
|
||||
'info': httpVueLoader('/components/condolence/Info.vue'),
|
||||
'activity-bx-info': httpVueLoader('/components/activityBx/ActivityBxInfo.vue'),
|
||||
},
|
||||
methods: {
|
||||
dropdownCommand(command) {
|
||||
const {type, data} = command
|
||||
if (type == 'view') {
|
||||
this.openView(data)
|
||||
} else if (type == 'Review') {
|
||||
this.openReview(data)
|
||||
}
|
||||
},
|
||||
openView(row) {
|
||||
const {reimbursementId, reimbursementItemId} = row
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info.getInfo(reimbursementId)
|
||||
}
|
||||
this.$refs.guava.view()
|
||||
},
|
||||
openReview(row) {
|
||||
const {reimbursementId, reimbursementItemId, activity_money, money} = row
|
||||
|
||||
this.reimbursementItemId = reimbursementItemId
|
||||
this.formData = {
|
||||
id: reimbursementId,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
time: moment().format('YYYY-MM-DD'),
|
||||
reimbursementItemId: reimbursementItemId,
|
||||
activity_money: activity_money,
|
||||
money: money
|
||||
}
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
this.subLoading3 = false
|
||||
if (reimbursementItemId != 4) {
|
||||
this.$refs.act_info2.getActInfo(reimbursementId)
|
||||
} else {
|
||||
this.$refs.info2.getInfo(reimbursementId)
|
||||
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doReview(flag) {
|
||||
this.$refs["form"].validate(async (valid) => {
|
||||
this.formData.money = this.formData.reimbursementItemId != 4 ? this.formData.activity_money : this.formData.money
|
||||
if (valid) {
|
||||
console.log(1)
|
||||
this.formData.flag = flag
|
||||
this.subDis = true
|
||||
flag ? this.subLoading2 = true : this.subLoading1 = true
|
||||
const resp = await $.post(loc() + "/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(resp.msg)
|
||||
}else{
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.subDis = false
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
}
|
||||
})
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.unions = await getUnionList()
|
||||
this.flushUnits()
|
||||
const aa = await getDictState("ReimbursementIsSign")
|
||||
this.ReimbursementIsSign = aa.disabled
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,505 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年  度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">经办人:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable
|
||||
placeholder="请输入内容"
|
||||
v-model="pageForm.searchKeyword">
|
||||
<el-select placeholder="查询类型" slot="prepend"
|
||||
style="width: 100px;"
|
||||
v-model="pageForm.searchName">
|
||||
<el-option label="姓名" value="rei.userName"></el-option>
|
||||
<el-option label="工号" value="rei.loginName"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">协会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable
|
||||
placeholder="请选择协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.jf_source">
|
||||
<el-option :label="item.name" :value="item.code"
|
||||
v-for="item in budgetTypeOption"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">明细类:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable placeholder="请选择明细类"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.detailsTypeId">
|
||||
<el-option :label="item.name" :value="item.code"
|
||||
v-for="item in detailsTypeOption"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" size="small"
|
||||
v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">已审核</el-radio-button>
|
||||
<el-radio-button :label="3">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='jf_source'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.jf_source"></dict-tag>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='activity_name'">
|
||||
<span>{{row.activity_name}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='detailsTypeId'">
|
||||
<dict-tag :options="detailsTypeOption"
|
||||
:value="row.detailsTypeId"></dict-tag>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='helpUnitName'">
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(row.jf_source)">校工会</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)">{{row.unionName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_THREE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(row.jf_source)">{{row.clubName}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center"
|
||||
label="操作" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openAudit(row)"
|
||||
:disabled="row.State!=3090">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doRevoke(row.id)"
|
||||
v-if="[3095,3096,3100].includes(row.State)">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<info handle label="校工会会计审核" ref="info2">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<vi-title2 title="审核信息"></vi-title2>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.auditTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核状态" prop="flag">
|
||||
<el-radio-group v-model="formData.flag">
|
||||
<el-radio border label="1">拒绝</el-radio>
|
||||
<el-radio border label="2">退回修改</el-radio>
|
||||
<el-radio border label="3">通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<template v-if="formData.flag==='3'">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="明细类" prop="detailsTypeId">
|
||||
<el-row >
|
||||
<el-col :span="20">
|
||||
<el-select v-model="formData.detailsTypeId"
|
||||
style="width: 100%"
|
||||
placeholder="请选择明细类">
|
||||
<el-option
|
||||
v-for="item in detailsTypeOption"
|
||||
:key="item.code"
|
||||
:label="item.name"
|
||||
:value="item.code">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="4">
|
||||
<el-button class="ml5" type="primary"
|
||||
@click="dialogVisible = true">设置类型
|
||||
</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<!-- <el-form-item label="上账明细" prop="accountViewId">
|
||||
<el-select v-model="formData.accountViewId"
|
||||
style="width: 100%"
|
||||
placeholder="请选择明细类">
|
||||
<el-option
|
||||
v-for="item in accountViewOption"
|
||||
:key="item.id"
|
||||
:label="item.notes"
|
||||
:value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
</el-col>
|
||||
</template>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见"
|
||||
rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字" prop="auditSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="finance"
|
||||
:is_value_base64="false"></sign>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :loading="submitLoading" @click="doAudit"
|
||||
type="primary">提 交
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
title="编辑明细类"
|
||||
:visible.sync="dialogVisible"
|
||||
width="50%">
|
||||
<el-table
|
||||
:data="detailsTypeList"
|
||||
border
|
||||
row-key="id"
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
type="index"
|
||||
width="50" label="序号">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="code"
|
||||
label="编码">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.code" placeholder="请输入编码" disabled></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="name"
|
||||
label="名称" width="200">
|
||||
<template slot-scope="{row}">
|
||||
<el-input v-model="row.name" placeholder="请输入名称"
|
||||
style="width: 100%"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column>
|
||||
<template slot="header" slot-scope="{row}">
|
||||
<el-button type="primary" size="mini"
|
||||
@click="detailsTypeList.push({code:'ACTIVITY_BUDGET_DETAILS_TYPE_'+(detailsTypeList.length+1),name:''})">
|
||||
添加
|
||||
</el-button>
|
||||
</template>
|
||||
<template slot-scope="{row,$index}">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="doDeleteDetailsType($index,row)">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="doSubmitDetailsType">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
clubOption: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
searchName: "rei.userName",
|
||||
isAudit: 3,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
clubId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
jf_source: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
flag: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
accountViewId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
detailsTypeId: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '经办人工号', sortable: true},
|
||||
{prop: 'userName', label: '姓名', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'jf_source', label: '活动类型', sortable: true},
|
||||
{prop: 'activity_name', label: '活动项目'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'money', label: '金额'},
|
||||
{prop: 'detailsTypeId', label: '明细类'},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态', sortable: true}
|
||||
],
|
||||
budgetTypeOption: [],
|
||||
detailsTypeOption: [],
|
||||
detailsTypeList: [],
|
||||
dialogVisible: false,
|
||||
accountViewOption:[]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/reimbursement/reimbursementNew.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
doDeleteDetailsType(index, row) {
|
||||
this.$confirm('确定要删除吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.detailsTypeList.splice(index, 1)
|
||||
if (row.id) {
|
||||
const res = await $.post('/platform/reimbursement/financeAudit/doDeleteDetailsType', {id: row.id})
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.detailsTypeOption = await getDictByCode("ACTIVITY_BUDGET_DETAILS_TYPE");
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
async doSubmitDetailsType() {
|
||||
const res = await $.post(loc() + "/doSubmitDetailsType", {detailsTypeList: JSON.stringify(this.detailsTypeList)})
|
||||
if (res.code === 0) {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '保存成功!'
|
||||
});
|
||||
this.detailsTypeOption = await getDictByCode("ACTIVITY_BUDGET_DETAILS_TYPE");
|
||||
this.detailsTypeList = clone(this.detailsTypeOption)
|
||||
this.dialogVisible = false
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: res.msg
|
||||
});
|
||||
}
|
||||
},
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.info.getInfo(id)
|
||||
},
|
||||
openAudit(row) {
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
jf_source: row.jf_source,
|
||||
flag: "3",
|
||||
clubId: row.clubId,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.info2.getInfo(row.id)
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doRevoke(id) {
|
||||
this.$confirm('确定要撤回审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
const res = await $.post('/platform/reimbursement/financeAudit/doRevoke', {id})
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
doAudit(flag) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确定要提交审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
const res = await $.post('/platform/reimbursement/financeAudit/doAudit', this.formData)
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
getAccountViewOption() {
|
||||
$.get(loc()+"/getAccountViewOption").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.accountViewOption = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.getAccountViewOption();
|
||||
this.unions = await getUnionList()
|
||||
this.unions.unshift({"id": "4330", "unionname": "大学外语部"})
|
||||
this.unions.unshift({"id": "4070", "unionname": "外国语学院"})
|
||||
this.unions.unshift({"id": "4270", "unionname": "软件学院"})
|
||||
this.unions.unshift({"id": "4450", "unionname": "国际关系学院"})
|
||||
this.clubOption = await getClubsByRole()
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
this.detailsTypeOption = await getDictByCode("ACTIVITY_BUDGET_DETAILS_TYPE");
|
||||
this.detailsTypeList = clone(this.detailsTypeOption)
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -23,8 +23,7 @@ layout("/layouts/platform.html"){
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
<el-option :label="item.unionname" :value="item.id" v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
@@ -32,8 +31,7 @@ layout("/layouts/platform.html"){
|
||||
<el-select clearable="true" filterable="true" placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.unitId">
|
||||
<el-option :label="item.name" :value="item.id"
|
||||
v-for="item in units"></el-option>
|
||||
<el-option :label="item.name" :value="item.id" v-for="item in units"></el-option>
|
||||
</el-select>
|
||||
</search-item>
|
||||
|
||||
@@ -50,8 +48,7 @@ layout("/layouts/platform.html"){
|
||||
</template>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索
|
||||
</el-button>
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
|
||||
<more v-model="searchMore"></more>
|
||||
</div>
|
||||
@@ -64,8 +61,7 @@ layout("/layouts/platform.html"){
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<div class="pull-right offscreen-right mt5">
|
||||
<el-radio-group @change="doSearch" size="medium"
|
||||
v-model="pageForm.isAudit">
|
||||
<el-radio-group @change="doSearch" size="medium" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="true">已审核</el-radio-button>
|
||||
<el-radio-button :label="false">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
@@ -74,11 +70,9 @@ layout("/layouts/platform.html"){
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id" style="width: 100%"
|
||||
v-loading="tabLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center" label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
@@ -97,8 +91,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center"
|
||||
label="操作" width="150px">
|
||||
<el-table-column align="center" fixed="right" header-align="center" label="操作" width="150px">
|
||||
<template scope="{row}">
|
||||
<el-dropdown @command="dropdownCommand">
|
||||
<el-button :loading="row.loading" size="mini">
|
||||
@@ -127,8 +120,7 @@ layout("/layouts/platform.html"){
|
||||
<template #edit>
|
||||
<activity-bx-info handle label="书记审核" ref="act_info2" v-show="reimbursementItemId!=4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
@@ -149,25 +141,21 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4"
|
||||
type="textarea"
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="auditSign"
|
||||
v-if="!ReimbursementIsSign">
|
||||
<el-form-item label="签  字" prop="auditSign" v-if="!ReimbursementIsSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="condolence"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1"
|
||||
@click="doReview(false)" type="danger">拒
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)"
|
||||
type="success">通
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -176,8 +164,7 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<info handle label="书记审核" ref="info2" v-show="reimbursementItemId==4">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
<el-form :model="formData" :rules="formRules" label-position="right" label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<el-form-item class="view-header" label="审核信息 " label-width="135px">
|
||||
@@ -198,8 +185,7 @@ layout("/layouts/platform.html"){
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="opinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4"
|
||||
type="textarea"
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4" type="textarea"
|
||||
v-model="formData.opinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
@@ -210,12 +196,10 @@ layout("/layouts/platform.html"){
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :disabled="subDis" :loading="subLoading1"
|
||||
@click="doReview(false)" type="danger">拒
|
||||
<el-button :disabled="subDis" :loading="subLoading1" @click="doReview(false)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)"
|
||||
type="success">通
|
||||
<el-button :disabled="subDis" :loading="subLoading2" @click="doReview(true)" type="success">通
|
||||
过
|
||||
</el-button>
|
||||
</div>
|
||||
@@ -273,7 +257,7 @@ layout("/layouts/platform.html"){
|
||||
components: {
|
||||
'guava': httpVueLoader('/components/plugins/Guava.vue'),
|
||||
'file-upload': httpVueLoader('/components/plugins/FileUpload.vue'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.1'),
|
||||
'sign': httpVueLoader('/components/sign/sign.vue?v=2.0.0'),
|
||||
'info': httpVueLoader('/components/condolence/Info.vue'),
|
||||
'activity-bx-info': httpVueLoader('/components/activityBx/ActivityBxInfo.vue'),
|
||||
},
|
||||
@@ -329,16 +313,15 @@ layout("/layouts/platform.html"){
|
||||
this.subDis = true
|
||||
flag ? this.subLoading2 = true : this.subLoading1 = true
|
||||
const resp = await $.post(loc() + "/doReview", this.formData)
|
||||
if (resp.code === 0) {
|
||||
requestLaterMsgFun(vue, resp, null, null, (v) => {
|
||||
|
||||
this.subDis = false
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
this.$message.success(resp.msg)
|
||||
} else {
|
||||
this.notifyError(resp.msg)
|
||||
}
|
||||
this.subDis = false
|
||||
this.subLoading1 = false
|
||||
this.subLoading2 = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -365,4 +348,4 @@ layout("/layouts/platform.html"){
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
#-->
|
||||
@@ -0,0 +1,364 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年  度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">经办人:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable
|
||||
placeholder="请输入内容"
|
||||
v-model="pageForm.searchKeyword">
|
||||
<el-select placeholder="查询类型" slot="prepend"
|
||||
style="width: 100px;"
|
||||
v-model="pageForm.searchName">
|
||||
<el-option label="姓名" value="rei.userName"></el-option>
|
||||
<el-option label="工号" value="rei.loginName"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">协会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable
|
||||
placeholder="请选择协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.jf_source">
|
||||
<el-option :label="item.name" :value="item.code"
|
||||
v-for="item in budgetTypeOption"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="search-item">
|
||||
<div class="search-item-label">明细类:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable placeholder="请选择明细类"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.detailsTypeId">
|
||||
<el-option :label="item.name" :value="item.code"
|
||||
v-for="item in detailsTypeOption"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>-->
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" size="small"
|
||||
v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">已审核</el-radio-button>
|
||||
<el-radio-button :label="3">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='jf_source'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.jf_source"></dict-tag>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='activity_name'">
|
||||
<span>{{row.activity_name}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='detailsTypeId'">
|
||||
<dict-tag :options="detailsTypeOption"
|
||||
:value="row.detailsTypeId"></dict-tag>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='helpUnitName'">
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(row.jf_source)">校工会</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)">{{row.unionName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_THREE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(row.jf_source)">{{row.clubName}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center"
|
||||
label="操作" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openAudit(row)"
|
||||
:disabled="row.State!=3080">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doRevoke(row.id)"
|
||||
v-if="[3085,3086,3090].includes(row.State)&&row.money>50000">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<info handle label="工会主席审核" ref="info2">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<vi-title2 title="审核信息"></vi-title2>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.auditTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见"
|
||||
rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字" prop="auditSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="StandingViceChairman"
|
||||
:is_value_base64="false"></sign>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :loading="submitLoading"
|
||||
@click="doAudit(1)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(2)"
|
||||
type="info">退回修改
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(3)"
|
||||
type="primary">通 过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
clubOption: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
searchName: "rei.userName",
|
||||
isAudit: 3,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
clubId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
jf_source: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
flag: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
accountViewId: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
detailsTypeId: [{
|
||||
required: true,
|
||||
message: '必填',
|
||||
trigger: ['blur', 'change']
|
||||
}],
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '经办人工号', sortable: true},
|
||||
{prop: 'userName', label: '姓名', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'jf_source', label: '活动类型', sortable: true},
|
||||
{prop: 'activity_name', label: '活动项目'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'money', label: '金额'},
|
||||
// {prop: 'detailsTypeId', label: '明细类'},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态', sortable: true}
|
||||
],
|
||||
budgetTypeOption: [],
|
||||
detailsTypeOption: [],
|
||||
detailsTypeList: [],
|
||||
dialogVisible: false,
|
||||
accountViewOption:[]
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/reimbursement/reimbursementNew.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.info.getInfo(id)
|
||||
},
|
||||
openAudit(row) {
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.info2.getInfo(row.id)
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doRevoke(id) {
|
||||
this.$confirm('确定要撤回审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
const res = await $.post('/platform/reimbursement/standingViceChairmanAudit/doRevoke', {id})
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
doAudit(flag) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确定要提交审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
this.formData.flag = flag
|
||||
const res = await $.post('/platform/reimbursement/standingViceChairmanAudit/doAudit', this.formData)
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.unions = await getUnionList()
|
||||
this.unions.unshift({"id": "4330", "unionname": "大学外语部"})
|
||||
this.unions.unshift({"id": "4070", "unionname": "外国语学院"})
|
||||
this.unions.unshift({"id": "4270", "unionname": "软件学院"})
|
||||
this.unions.unshift({"id": "4450", "unionname": "国际关系学院"})
|
||||
this.clubOption = await getClubsByRole()
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
this.detailsTypeOption = await getDictByCode("ACTIVITY_BUDGET_DETAILS_TYPE");
|
||||
this.detailsTypeList = clone(this.detailsTypeOption)
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,264 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年  度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
@change="doSearch"
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" size="small" v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">已审核</el-radio-button>
|
||||
<el-radio-button :label="3">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-table :data="tableData" :size="tableSize"
|
||||
@sort-change="pageOrder"
|
||||
class="vi-table" row-key="id" style="width: 100%;margin-bottom: 20px"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号" type="index"
|
||||
width="80px"></el-table-column>
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='jf_source'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.jf_source"></dict-tag>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='activity_name'">
|
||||
<span>{{row.activity_name}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='helpUnitName'">
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(row.jf_source)">校工会</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)">{{row.unionName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_THREE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(row.jf_source)">{{row.clubName}}</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" header-align="center" label="操作"
|
||||
prop="userOnline" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openAudit(row.id)"
|
||||
:disabled="row.State!=3050">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doRevoke(row.id)"
|
||||
v-if="[3055,3056,3060].includes(row.State)">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
<template #edit>
|
||||
<info handle label="分工会主席审核" ref="info2">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<vi-title2 title="审核信息"></vi-title2>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.auditTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见" rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="签  字" prop="auditSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="clubAudit"
|
||||
:is_value_base64="false"></sign>
|
||||
</el-form-item>
|
||||
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :loading="submitLoading"
|
||||
@click="doAudit(1)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(2)"
|
||||
type="info">退回修改
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(3)"
|
||||
type="primary">通 过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
unionList: [],
|
||||
unitList: [],
|
||||
|
||||
pageForm: {
|
||||
isAudit: 3,
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '经办人工号', sortable: true},
|
||||
{prop: 'userName', label: '姓名', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'jf_source', label: '活动类型', sortable: true},
|
||||
{prop: 'activity_name', label: '活动项目'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'money', label: '金额'},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态', sortable: true}
|
||||
],
|
||||
budgetTypeOption: [],
|
||||
formRules: {
|
||||
auditSign: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['change', 'blur']}],
|
||||
}
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/reimbursement/reimbursementNew.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.info.getInfo(id)
|
||||
},
|
||||
openAudit(id) {
|
||||
this.formData = {
|
||||
id: id,
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.info2.getInfo(id)
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doRevoke(id) {
|
||||
this.$confirm('确定要撤回审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
const res = await $.post('/platform/reimbursement/unionAudit/doRevoke', {id})
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
doAudit(flag) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确定要提交审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
this.formData.flag = flag
|
||||
const res = await $.post('/platform/reimbursement/unionAudit/doAudit', this.formData)
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData()
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,347 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年  度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">经办人:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable
|
||||
placeholder="请输入内容"
|
||||
v-model="pageForm.searchKeyword">
|
||||
<el-select placeholder="查询类型" slot="prepend"
|
||||
style="width: 100px;"
|
||||
v-model="pageForm.searchName">
|
||||
<el-option label="姓名" value="rei.userName"></el-option>
|
||||
<el-option label="工号" value="rei.loginName"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">协会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable
|
||||
placeholder="请选择协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.jf_source">
|
||||
<el-option :label="item.name" :value="item.code"
|
||||
v-for="item in budgetTypeOption"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" size="small"
|
||||
v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">已审核</el-radio-button>
|
||||
<el-radio-button :label="3">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='jf_source'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.jf_source"></dict-tag>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='activity_name'">
|
||||
<span>{{row.activity_name}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='helpUnitName'">
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(row.jf_source)">校工会</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)">{{row.unionName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_THREE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(row.jf_source)">{{row.clubName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center"
|
||||
label="操作" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openAudit(row)"
|
||||
:disabled="row.State!=3060">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doRevoke(row.id)"
|
||||
v-if="[3065,3066,3070].includes(row.State)">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<info handle label="工会办公室主管审核" ref="info2">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<vi-title2 title="审核信息"></vi-title2>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.auditTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见"
|
||||
rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字" prop="auditSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="finance"
|
||||
:is_value_base64="false"></sign>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :loading="submitLoading"
|
||||
@click="doAudit(1)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(2)"
|
||||
type="info">退回修改
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(3)"
|
||||
type="primary">通 过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
clubList: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
searchName: "rei.userName",
|
||||
isAudit: 3,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '经办人工号', sortable: true},
|
||||
{prop: 'userName', label: '姓名', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'jf_source', label: '活动类型', sortable: true},
|
||||
{prop: 'activity_name', label: '活动项目'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'money', label: '金额'},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态', sortable: true}
|
||||
],
|
||||
budgetTypeOption: [],
|
||||
clubOption: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/reimbursement/reimbursementNew.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.info.getInfo(id)
|
||||
},
|
||||
openAudit(row) {
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
jf_source: row.jf_source,
|
||||
flag: "3",
|
||||
clubId: row.clubId,
|
||||
unionId: row.unionId,
|
||||
auditOpinion:"同意",
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.info2.getInfo(row.id)
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doRevoke(id) {
|
||||
this.$confirm('确定要撤回审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
const res = await $.post('/platform/reimbursement/unionManageAudit/doRevoke', {id})
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
doAudit(flag) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确定要提交审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
this.formData.flag = flag
|
||||
const res = await $.post('/platform/reimbursement/unionManageAudit/doAudit', this.formData)
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
},
|
||||
getClubsByRole() {
|
||||
$.get("/platform/reimbursement/unionManageAudit/getClubsByRole").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.clubList = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.getClubsByRole();
|
||||
this.unions = await getUnionList()
|
||||
this.clubOption = await getClubsByRole()
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
@@ -0,0 +1,352 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
|
||||
<div class="platform" id="app" v-cloak>
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年  度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
placeholder="选择年"
|
||||
style="width: 100%"
|
||||
type="year" v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">经办人:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input @keyup.enter.native="doSearch" clearable
|
||||
placeholder="请输入内容"
|
||||
v-model="pageForm.searchKeyword">
|
||||
<el-select placeholder="查询类型" slot="prepend"
|
||||
style="width: 100px;"
|
||||
v-model="pageForm.searchName">
|
||||
<el-option label="姓名" value="rei.userName"></el-option>
|
||||
<el-option label="工号" value="rei.loginName"></el-option>
|
||||
</el-select>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">所属工会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select @change="flushUnits" @clear="flushUnits" clearable="true"
|
||||
filterable="true"
|
||||
placeholder="所属工会" style="width: 100%;"
|
||||
v-model="pageForm.unionId">
|
||||
<el-option :label="item.unionname" :value="item.id"
|
||||
v-for="item in unions"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">协会:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable
|
||||
placeholder="请选择协会"
|
||||
style="width: 100%;" v-model="pageForm.clubId">
|
||||
<el-option
|
||||
:key="item.stid"
|
||||
:label="item.name"
|
||||
:value="item.stid"
|
||||
v-for="item in clubOption">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">活动类型:</div>
|
||||
<div class="search-item-option">
|
||||
<el-select clearable placeholder="所属单位"
|
||||
style="width: 100%;"
|
||||
v-model="pageForm.jf_source">
|
||||
<el-option :label="item.name" :value="item.code"
|
||||
v-for="item in budgetTypeOption"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-query">
|
||||
<el-button type="primary" icon="el-icon-search" @click="doSearch">搜索
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</el-card>
|
||||
|
||||
<el-card class="mt10" shadow="never">
|
||||
<table-tool :app="this" label="报销列表">
|
||||
<template #func>
|
||||
<el-radio-group @change="doSearch" size="small"
|
||||
v-model="pageForm.isAudit">
|
||||
<el-radio-button :label="1">全部</el-radio-button>
|
||||
<el-radio-button :label="2">已审核</el-radio-button>
|
||||
<el-radio-button :label="3">未审核</el-radio-button>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</table-tool>
|
||||
|
||||
<el-row class="el-table-container">
|
||||
<el-table :data="tableData" @sort-change="pageOrder" row-key="id"
|
||||
style="width: 100%"
|
||||
v-loading="tableLoading">
|
||||
<el-table-column :index="indexMethod" align="center" header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
width="80px"></el-table-column>
|
||||
|
||||
|
||||
<el-table-column
|
||||
:label="column.label"
|
||||
:prop="column.prop"
|
||||
:sortable="column.sortable"
|
||||
align="center"
|
||||
header-align="center"
|
||||
show-overflow-tooltip
|
||||
v-for="column in tableColumns">
|
||||
|
||||
<template scope="{row}" v-if="column.prop=='stateId'">
|
||||
<span :style="'color:'+row.stateColor">{{row.stateName}}</span>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='jf_source'">
|
||||
<dict-tag :options="budgetTypeOption"
|
||||
:value="row.jf_source"></dict-tag>
|
||||
</template>
|
||||
|
||||
<template scope="{row}" v-else-if="column.prop=='activity_name'">
|
||||
<span>{{row.activity_name}}</span>
|
||||
</template>
|
||||
<template scope="{row}" v-else-if="column.prop=='helpUnitName'">
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_ONE'].includes(row.jf_source)">校工会</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)&&['4270', '4330', '4450'].includes(row.unitId)">{{row.unitName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_TWO'].includes(row.jf_source)&&!['4270', '4330', '4450'].includes(row.unitId)">{{row.unionName}}</span>
|
||||
<span v-if="['ACTIVITY_BUDGET_TYPE_THREE','ACTIVITY_BUDGET_TYPE_FOUR'].includes(row.jf_source)">{{row.clubName}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed="right" header-align="center"
|
||||
label="操作" width="300px">
|
||||
<template scope="{row}">
|
||||
<el-button size="mini" type="primary" @click="openView(row.id)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button size="mini" type="primary" @click="openAudit(row)"
|
||||
:disabled="row.State!=3070">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doRevoke(row.id)"
|
||||
v-if="[3075,3076,3080].includes(row.State)&&row.money>50000">
|
||||
撤回
|
||||
</el-button>
|
||||
<el-button size="mini" type="danger" @click="doRevoke(row.id)"
|
||||
v-if="[3075,3076,3090].includes(row.State)&&row.money<50000">
|
||||
撤回
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit>
|
||||
<info handle label="工会副主席审核" ref="info2">
|
||||
<template #handle>
|
||||
<el-form :model="formData" :rules="formRules" label-position="right"
|
||||
label-width="120px"
|
||||
ref="form"
|
||||
style="padding: 20px 0">
|
||||
<vi-title2 title="审核信息"></vi-title2>
|
||||
|
||||
<el-row gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核人员" prop="username">
|
||||
<el-input disabled
|
||||
v-model="formData.username"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="审核时间" prop="time">
|
||||
<el-input disabled v-model="formData.auditTime"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="24">
|
||||
<el-form-item label="审核意见" prop="auditOpinion">
|
||||
<el-input maxlength="500" placeholder="请填写您的审核意见"
|
||||
rows="4"
|
||||
type="textarea"
|
||||
v-model="formData.auditOpinion"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="签字" prop="auditSign">
|
||||
<sign :qz.sync="formData.auditSign" prefix="finance"
|
||||
:is_value_base64="false"></sign>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
<div style="float: right;margin: 20px 0">
|
||||
<el-button :loading="submitLoading"
|
||||
@click="doAudit(1)" type="danger">拒
|
||||
绝
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(2)"
|
||||
type="info">退回修改
|
||||
</el-button>
|
||||
<el-button :loading="submitLoading" @click="doAudit(3)"
|
||||
type="primary">通 过
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</info>
|
||||
</template>
|
||||
|
||||
|
||||
<template #view>
|
||||
<info ref="info"></info>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
</div>
|
||||
<script>
|
||||
const vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
clubList: [],
|
||||
unions: [],
|
||||
units: [],
|
||||
pageForm: {
|
||||
searchName: "rei.userName",
|
||||
isAudit: 3,
|
||||
year: new Date().getFullYear() + ""
|
||||
},
|
||||
formRules: {
|
||||
auditSign: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
auditOpinion: [{required: true, message: '必填', trigger: ['blur', 'change']}],
|
||||
},
|
||||
tableColumns: [
|
||||
{prop: 'loginName', label: '经办人工号', sortable: true},
|
||||
{prop: 'userName', label: '姓名', sortable: true},
|
||||
{prop: 'unionName', label: '所属工会', sortable: true},
|
||||
{prop: 'unitName', label: '所属单位', sortable: true},
|
||||
{prop: 'jf_source', label: '活动类型', sortable: true},
|
||||
{prop: 'activity_name', label: '活动项目'},
|
||||
{prop: 'helpUnitName', label: '申报单位'},
|
||||
{prop: 'money', label: '金额'},
|
||||
{prop: 'applyTime', label: '申请时间', sortable: true},
|
||||
{prop: 'stateId', label: '申请状态', sortable: true}
|
||||
],
|
||||
budgetTypeOption: [],
|
||||
clubOption: [],
|
||||
}
|
||||
},
|
||||
components: {
|
||||
'info': httpVueLoader('/components/reimbursement/reimbursementNew.vue?v=' + new Date().getTime()),
|
||||
},
|
||||
methods: {
|
||||
openView(id) {
|
||||
this.$refs.guava.view()
|
||||
this.$refs.info.getInfo(id)
|
||||
},
|
||||
openAudit(row) {
|
||||
this.formData = {
|
||||
id: row.id,
|
||||
jf_source: row.jf_source,
|
||||
flag: "3",
|
||||
clubId: row.clubId,
|
||||
unionId: row.unionId,
|
||||
auditOpinion:"同意",
|
||||
username: "${@shiro.getPrincipalProperty('username')}",
|
||||
auditTime: moment().format('YYYY-MM-DD'),
|
||||
}
|
||||
this.$refs.guava.edit()
|
||||
this.$refs.info2.getInfo(row.id)
|
||||
if (this.$refs['form']) {
|
||||
this.$refs['form'].resetFields()
|
||||
}
|
||||
},
|
||||
doRevoke(id) {
|
||||
this.$confirm('确定要撤回审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
const res = await $.post('/platform/reimbursement/viceChairmanAudit/doRevoke', {id})
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
},
|
||||
doAudit(flag) {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.$confirm('确定要提交审核吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(async () => {
|
||||
this.submitLoading = true
|
||||
this.formData.flag = flag
|
||||
const res = await $.post('/platform/reimbursement/viceChairmanAudit/doAudit', this.formData)
|
||||
this.submitLoading = false
|
||||
if (res.code === 0) {
|
||||
this.$message.success('操作成功')
|
||||
this.pageData()
|
||||
this.$refs.guava.index()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
async flushUnits() {
|
||||
this.$set(this.pageForm, "unitId", "")
|
||||
this.units = await getUnits(this.pageForm.unionId)
|
||||
},
|
||||
getClubsByRole() {
|
||||
$.get("/platform/reimbursement/viceChairmanAudit/getClubsByRole").then(resp => {
|
||||
if (resp.code === 0) {
|
||||
this.clubList = resp.data
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.pageData();
|
||||
this.getClubsByRole();
|
||||
this.unions = await getUnionList()
|
||||
this.clubOption = await getClubsByRole()
|
||||
this.budgetTypeOption = await getDictByCode("ACTIVITY_BUDGET_TYPE");
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user