3 Commits
Author SHA1 Message Date
c-chenxs1 a1fa323420 feat: 困难帮扶优化2 2026-10-31 17:48:30 +08:00
c-chenxs1 7b7f1f61f9 feat: 困难帮扶优化 2026-10-31 17:13:47 +08:00
c-chenxs1 f30dbcaa21 feat: 特殊慰问-职工慰问优化4 2026-10-31 16:38:27 +08:00
29 changed files with 264 additions and 84 deletions
@@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.sys.models.Sys_file;
import com.budwk.app.sys.models.Sys_office_template;
import com.budwk.app.sys.services.SysFileService;
import com.budwk.app.sys.utils.SysFileMinIoUtil;
import com.deepoove.poi.XWPFTemplate;
import com.deepoove.poi.config.Configure;
@@ -22,6 +23,7 @@ import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.ArrayList;
import java.util.LinkedHashSet;
@@ -39,6 +41,9 @@ public class SysOfficeTemplateUtil {
@Inject
private Dao dao;
@Inject
private SysFileService sysFileService;
public String getTemplateFileName(String templateCode) {
Sys_office_template officeTemplate = dao.fetch(Sys_office_template.class, Cnd.where(Sys_office_template::getTemplateCode, "=", templateCode));
if (ObjectUtil.isNull(officeTemplate)) {
@@ -70,7 +75,16 @@ public class SysOfficeTemplateUtil {
if (ObjectUtil.isEmpty(sysFile)) {
throw new BaseException("模板文件不存在");
}
byte[] fileBytes = SysFileMinIoUtil.getFileBytes(sysFile.getBucket(), sysFile.getStoragePath());
byte[] fileBytes;
try {
fileBytes = sysFileService.download(id);
} catch (IOException e) {
log.error("模板文件读取失败,templateCode={},fileId={}", templateCode, id, e);
throw new BaseException("模板 {} 的文件读取失败:{}", templateCode, e.getMessage());
}
if (fileBytes == null || fileBytes.length == 0) {
throw new BaseException("模板 {} 的文件为空或读取失败,文件名:{}", templateCode, sysFile.getName());
}
return new ByteArrayInputStream(fileBytes);
}
@@ -172,16 +172,16 @@ public class CondolenceReadController {
}
private void applyReadScope(Cnd cnd, String alias) {
if (AuthUtil.hasPermission("all_school")) {
if (AuthUtil.hasPermission("condolence_all_school")) {
return;
}
if (AuthUtil.hasPermission("branch_union")) {
if (AuthUtil.hasPermission("condolence_branch_union")) {
String unionId = SecurityUtil.getUnionId();
if (StrUtil.isNotBlank(unionId)) {
cnd.and(alias + ".applyUnionId", "=", unionId);
return;
}
} else if (AuthUtil.hasPermission("self")) {
} else if (AuthUtil.hasPermission("condolence_self")) {
cnd.and(alias + ".createdBy", "=", SecurityUtil.getUserId());
return;
}
@@ -1,10 +1,10 @@
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.lang.Dict;
import cn.hutool.core.util.ObjectUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.result.Result;
import com.budwk.app.flow.constant.FlowConst;
@@ -177,12 +177,13 @@ public class DifficultHelpApplyController {
@At
@ApiOperation("获取受助人")
@SaCheckPermission("difficultHelp.apply")
@SaCheckPermission(value = {"difficultHelp.apply", "h5.difficultHelp.apply"}, mode = SaMode.OR)
public Result queryRecipients(String key){
if (!AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
return Result.error("只有分工会主席可以替他人申请");
boolean schoolScope = AuthUtil.hasPermission("difficult_assistance_school");
if (!schoolScope && !AuthUtil.hasPermission("difficult_assistance_union")) {
return Result.error("没有代申请权限");
}
if (Strings.isBlank(SecurityUtil.getUnionId())) {
if (!schoolScope && Strings.isBlank(SecurityUtil.getUnionId())) {
return Result.error("当前用户未设置所属分工会");
}
Sql sql = Sqls.create("""
@@ -193,6 +194,10 @@ public class DifficultHelpApplyController {
birthday,
mobile,
sex,
idCard,
position,
professionalTitle AS officialCapacity,
(SELECT u.homeAddress FROM sys_user u WHERE u.id = vw_user.id) AS homeAddress,
unitName,
unionName,
unionId,
@@ -203,7 +208,9 @@ public class DifficultHelpApplyController {
""");
Cnd cnd = Cnd.NEW();
cnd.and("id", "<>", SecurityUtil.getUserId());
cnd.and("unionid", "=", SecurityUtil.getUnionId());
if (!schoolScope) {
cnd.and("unionid", "=", SecurityUtil.getUnionId());
}
if (Strings.isNotBlank(key)) {
SqlExpressionGroup group = new SqlExpressionGroup();
@@ -43,7 +43,8 @@ public class DifficultHelpApprovalController {
}
ProcessTask task = dao.fetch(ProcessTask.class, args.getLong(FlowConst.PROCESS_TASK_ID_KEY));
if (task == null) throw new BaseException("审批任务不存在");
boolean amountApproval = "715ece82-4ae3-433c-ad18-ed875f45d1e3".equals(task.getTaskName());
boolean actualAmountApproval = "e405f96c-5fc0-4f63-b323-e69dfe853253".equals(task.getTaskName());
boolean amountApproval = "715ece82-4ae3-433c-ad18-ed875f45d1e3".equals(task.getTaskName()) || actualAmountApproval;
if (!amountApproval && !"36ebafda-44c2-4bd3-bd7f-10839a575a0d".equals(task.getTaskName())
&& !"e405f96c-5fc0-4f63-b323-e69dfe853253".equals(task.getTaskName())) {
throw new BaseException("当前任务不是困难帮扶审批任务");
@@ -56,12 +57,17 @@ public class DifficultHelpApprovalController {
args.remove("level");
args.remove("tf_level");
args.remove("tf_actualMoney");
Double money = amountApproval ? args.getDouble("money") : null;
if (amountApproval) {
if (money == null || !Double.isFinite(money) || money < 0) {
throw new BaseException("请填写有效的帮扶金额");
throw new BaseException(actualAmountApproval ? "请填写有效的实际审批金额" : "请填写有效的帮扶金额");
}
if (actualAmountApproval && java.math.BigDecimal.valueOf(money).stripTrailingZeros().scale() > 2) {
throw new BaseException("实际审批金额最多保留两位小数");
}
args.put("tf_money", money);
if (actualAmountApproval) args.put("tf_actualMoney", money);
} else {
args.remove("money");
args.remove("tf_money");
@@ -78,6 +78,7 @@ public class DifficultHelpFirstApprovalController {
info.subsidyStandards,
LEFT(info.applyTime, 10) AS applyTime,
info.applyCount,
info.applyMoney,
info.mobile,
ins.id AS instanceId,
ins.businessNo,
@@ -2,7 +2,6 @@ package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
import cn.dev33.satoken.annotation.SaCheckLogin;
@@ -154,7 +153,7 @@ public class DifficultHelpReadingController {
""");
Cnd cnd = Cnd.NEW();
cnd.and("ins.state", "=", 20);
pageParam.buildSearch(cnd, "info.", false);
pageParam.buildReadingSearch(cnd, "info.");
cnd.groupBy("info.id");
sql.setCondition(cnd);
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
@@ -269,7 +268,7 @@ public class DifficultHelpReadingController {
$condition
""");
Cnd cnd = Cnd.NEW();
pageParam.buildSearch(cnd, "info.", false);
pageParam.buildReadingSearch(cnd, "info.");
cnd.groupBy("info.id");
sql.setCondition(cnd);
List<NutMap> list = difficultHelpCommonService.listMap(sql);
@@ -327,11 +326,33 @@ public class DifficultHelpReadingController {
@At
@Ok("void")
@SaCheckPermission("difficultHelp.reading")
public void exportReadingApply(String id, DifficultHelpPageParam pageParam, HttpServletResponse response, Boolean print) throws Exception {
Cnd cnd = Cnd.where("id", "=", id);
pageParam.buildReadingSearch(cnd, "");
if (difficultHelpCommonService.count(cnd) == 0) {
throw new RuntimeException("该记录不在当前可查看的范围内,无法导出");
}
doExportApply(id, response, print);
}
@At
@Ok("void")
@SaCheckLogin
public void doExportApply(String id, HttpServletResponse response, Boolean print) throws Exception {
DifficultHelpInfo difficultHelp = difficultHelpCommonService.fetch(id);
if (difficultHelp == null) {
throw new RuntimeException("该条记录不存在");
}
boolean ownApply = AuthUtil.hasPermission("difficultHelp.mine")
&& SecurityUtil.getUserId().equals(difficultHelp.getCreatedBy());
if (!ownApply) {
Cnd cnd = Cnd.where("id", "=", id);
new DifficultHelpPageParam().buildReadingSearch(cnd, "");
if (!AuthUtil.hasPermission("difficultHelp.reading") || difficultHelpCommonService.count(cnd) == 0) {
throw new RuntimeException("该记录不在当前可查看的范围内,无法导出");
}
}
HashMap<String, Object> docData = new HashMap<>();
docData.put("unionName", difficultHelp.getUnitName());
@@ -493,6 +514,7 @@ public class DifficultHelpReadingController {
info.subsidyStandards,
info.bankOfDeposit,
info.bankCardNum,
info.money,
info.applyCount
FROM
difficult_help_info info
@@ -500,16 +522,44 @@ public class DifficultHelpReadingController {
$condition
""");
Cnd cnd = Cnd.NEW();
pageParam.buildSearch(cnd, "info.", false);
pageParam.buildReadingSearch(cnd, "info.");
cnd.groupBy("info.id");
sql.setCondition(cnd);
List<NutMap> list = difficultHelpCommonService.listMap(sql);
Sys_user user = sysUserService.fetch(SecurityUtil.getUserId());
for (int i = 0; i < list.size(); i++) {
list.get(i).put("index", (i + 1));
}
String fileName = "困难慰问汇总表_" + DateUtil.format(new Date(), "yyyyMMdd");
if ("xlsx".equals(flag)) {
String[][] columns = {
{"序号", "index"}, {"姓名", "userName"}, {"工号", "loginName"},
{"性别", "sex"}, {"身份证号", "idCard"}, {"年龄", "age"},
{"职务", "position"}, {"职称", "officialCapacity"}, {"所属单位", "unitName"},
{"手机号码", "mobile"}, {"生活致困原因", "reason"}, {"级别", "level"},
{"家庭年总收入", "homeIncome"}, {"家庭人数", "homeNumber"},
{"困难类型", "subsidyStandards"}, {"开户行", "bankOfDeposit"},
{"银行卡号", "bankCardNum"}, {"实际金额(元)", "money"}, {"申请次数", "applyCount"}
};
List<ExcelExportEntity> entities = new ArrayList<>();
for (String[] column : columns) {
entities.add(new ExcelExportEntity(column[0], column[1], 20));
}
ExportParams exportParams = new ExportParams();
exportParams.setType(ExcelType.XSSF);
exportParams.setTitle("困难帮扶汇总表");
exportParams.setSheetName("汇总数据");
try (Workbook workbook = ExcelExportUtil.exportExcel(exportParams, entities, list)) {
CommonDownloadUtil.download(fileName + ".xlsx", workbook, response);
} catch (Exception e) {
log.error("导出Excel汇总表失败", e);
throw new RuntimeException("导出Excel汇总表失败:" + e.getMessage(), e);
}
return;
}
Sys_user user = sysUserService.fetch(SecurityUtil.getUserId());
result.put("schoolName", "中国地址大学(武汉)");
result.put("year", DateUtil.format(new Date(), "yyyy"));
result.put("applyTime", DateUtil.format(new Date(), "yyyy年MM月dd日"));
@@ -517,32 +567,12 @@ public class DifficultHelpReadingController {
result.put("mobile", user.getMobile());
result.put("da", list);
String resource;
if ("xlsx".equals(flag)) {
resource = "difficulty_summary_xlsx";
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
resource = "difficulty_summary_school_xlsx";
}
} else {
resource = "difficulty_summary";
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
resource = "difficulty_summary_school";
}
String resource = "difficulty_summary";
if (AuthUtil.hasRoleOr(RoleConstant.SYSADMIN.name(), RoleConstant.SCHOOL_UNION_ADMIN.name())) {
resource = "difficulty_summary_school";
}
String fileName = "困难慰问汇总表_" + DateUtil.format(new Date(), "yyyyMMdd");
if ("xlsx".equals(flag)) {
try {
InputStream is = sysOfficeTemplateUtil.getTemplate(resource);
TemplateExportParams exportParams = new TemplateExportParams(is, null);
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, result);
CommonDownloadUtil.download(fileName + ".xlsx", workbook, response);
} catch (Exception e) {
log.error("导出Excel汇总表失败", e);
throw new RuntimeException("导出Excel汇总表失败:" + e.getMessage());
}
} else if ("docx".equals(flag)) {
if ("docx".equals(flag)) {
try (InputStream input = sysOfficeTemplateUtil.getTemplate(resource)) {
Configure config = Configure.builder()
.bind("da", new LoopRowTableRenderPolicy())
@@ -79,6 +79,7 @@ public class DifficultHelpSecondApprovalController {
info.subsidyStandards,
LEFT(info.applyTime, 10) AS applyTime,
info.applyCount,
info.applyMoney,
info.mobile,
ins.id AS instanceId,
ins.businessNo,
@@ -82,6 +82,7 @@ public class DifficultHelpThirdApprovalController {
info.subsidyStandards,
LEFT(info.applyTime, 10) AS applyTime,
info.applyCount,
info.applyMoney,
info.mobile,
ins.id AS instanceId,
ins.businessNo,
@@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.base.constant.RoleConstant;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.web.commons.auth.utils.AuthUtil;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
@@ -76,14 +75,23 @@ public class DifficultHelpCommonServiceImpl extends BaseServiceImpl<DifficultHel
throw new BaseException("请填写大于零的申请金额");
}
if (difficultHelpInfo.getUserId().equals(SecurityUtil.getUserId())) {
if (!AuthUtil.hasPermission("difficult_assistance_self")
&& !AuthUtil.hasPermission("difficult_assistance_school")
&& !AuthUtil.hasPermission("difficult_assistance_union")) {
throw new BaseException("没有帮扶申请权限");
}
return;
}
if (!AuthUtil.hasRoleOr(RoleConstant.BRANCH_UNION_CHAIRMAN.name())) {
throw new BaseException("只有分工会主席可以替他人申请");
boolean schoolScope = AuthUtil.hasPermission("difficult_assistance_school");
if (!schoolScope && !AuthUtil.hasPermission("difficult_assistance_union")) {
throw new BaseException("没有代申请权限");
}
View_user recipient = dao().fetch(View_user.class, Cnd.where("id", "=", difficultHelpInfo.getUserId()));
if (recipient == null || StrUtil.isBlank(SecurityUtil.getUnionId())
|| !SecurityUtil.getUnionId().equals(recipient.getUnionId())) {
if (recipient == null) {
throw new BaseException("受助人不存在");
}
if (!schoolScope && (StrUtil.isBlank(SecurityUtil.getUnionId())
|| !SecurityUtil.getUnionId().equals(recipient.getUnionId()))) {
throw new BaseException("只能替本分工会人员申请");
}
}
@@ -129,10 +137,7 @@ public class DifficultHelpCommonServiceImpl extends BaseServiceImpl<DifficultHel
// 2. 查询符合条件的 DifficultHelpInfo 记录
Cnd cnd = Cnd.NEW();
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.exps("loginName", "LIKE", "%" + pageForm.getSearchKeyword() + "%")
.or("userName", "LIKE", "%" + pageForm.getSearchKeyword() + "%"));
}
pageForm.buildReadingSearch(cnd, "");
List<DifficultHelpInfo> infoList = dao().query(DifficultHelpInfo.class, cnd);
// 3. 构建用户缴费索引 (userId -> year -> money)
@@ -9,6 +9,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.Cnd;
import org.nutz.dao.util.cri.SqlExpressionGroup;
import org.nutz.dao.util.cri.Static;
import org.nutz.lang.Lang;
import java.util.List;
@@ -32,6 +33,29 @@ public class DifficultHelpPageParam extends PageForm {
private List<String> dateRange;
public void buildReadingSearch(Cnd cnd, String prefix) {
buildSearch(cnd, prefix, false);
applyReadingScope(cnd, prefix);
String recordPrefix = StrUtil.isBlank(prefix) ? "difficult_help_info." : prefix;
cnd.and(new Static("EXISTS (SELECT 1 FROM wf_process_instance reading_instance WHERE reading_instance.businessNo = "
+ recordPrefix + "id AND reading_instance.state = 20)"));
}
public void applyReadingScope(Cnd cnd, String prefix) {
if (AuthUtil.hasPermission("difficult_all_school")) {
return;
}
if (AuthUtil.hasPermission("difficult_branch_union") && StrUtil.isNotBlank(SecurityUtil.getUnionId())) {
cnd.and(prefix + "unionId", "=", SecurityUtil.getUnionId());
return;
}
if (AuthUtil.hasPermission("difficult_self") && StrUtil.isNotBlank(SecurityUtil.getUserId())) {
cnd.and(prefix + "userId", "=", SecurityUtil.getUserId());
return;
}
cnd.and("1", "=", 0);
}
public void buildSearch(Cnd cnd, String prefix){
buildSearch(cnd, prefix, true);
}
@@ -25,10 +25,7 @@ module.exports = {
watch: {
value: {
handler(val) {
if (val) {
this.signatureContent = val
this.$emit("input", this.signatureContent)
}
this.signatureContent = val || null
},
immediate: true
}
@@ -62,8 +59,11 @@ module.exports = {
if (res.code !== 0) {
throw new Error("签字信息加载失败")
}
this.signatureContent = res.data && res.data.signature
this.$emit("input", this.signatureContent)
// 已保存的业务签字或刚收到的扫码签字优先,默认签名仅补充空值。
if (!this.value && !this.signatureContent && res.data && res.data.signature) {
this.signatureContent = res.data.signature
this.$emit("input", this.signatureContent)
}
})
},
// 返回等待完成的 Promise;连接成功、等待30秒或组件销毁时结束等待。
@@ -16,7 +16,7 @@ layout("/layouts/platform.html"){
<el-form-item prop="mode">
<el-select v-model="formData.mode" placeholder="申请模式" @change="modeChange" style="width: 100%">
<el-option label="本人申请" value="1"></el-option>
<el-option v-if="$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')"
<el-option v-if="canApplyForOthers"
label="替他人申请" value="2"></el-option>
</el-select>
</el-form-item>
@@ -366,6 +366,11 @@ layout("/layouts/platform.html"){
subsidizedList: []
}
},
computed: {
canApplyForOthers() {
return this.$auth.hasPermissionOr(['difficult_assistance_school', 'difficult_assistance_union'])
}
},
methods: {
textRules(label, max) {
return [{required: true, whitespace: true, max, message: '请填写' + label + ',且不超过' + max + '个字符', trigger: ['blur', 'change']}]
@@ -441,7 +446,7 @@ layout("/layouts/platform.html"){
// 查询受助人
queryRecipients(key) {
if (String(this.formData.mode) !== "2" || !this.$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')) {
if (String(this.formData.mode) !== "2" || !this.canApplyForOthers) {
return
}
this.$axios.post("/platform/difficultHelp/apply/queryRecipients", {
@@ -476,6 +481,9 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'birthday', user.birthday)
this.$set(this.formData, 'mobile', user.mobile)
this.$set(this.formData, 'idCard', user.idCard)
this.$set(this.formData, 'position', user.position || '')
this.$set(this.formData, 'officialCapacity', user.officialCapacity || '')
this.$set(this.formData, 'homeAddress', user.homeAddress || '')
} else {
this.$set(this.formData, 'userId', null)
@@ -488,6 +496,10 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'unionName', null)
this.$set(this.formData, 'birthday', null)
this.$set(this.formData, 'mobile', null)
this.$set(this.formData, 'idCard', null)
this.$set(this.formData, 'position', '')
this.$set(this.formData, 'officialCapacity', '')
this.$set(this.formData, 'homeAddress', '')
}
},
// 申请模式
@@ -512,6 +524,8 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'idCard', user.idCard)
this.$set(this.formData, 'mobile', user.mobile)
this.$set(this.formData, 'homeAddress', user.homeAddress)
this.$set(this.formData, 'position', user.position || '')
this.$set(this.formData, 'officialCapacity', user.professionalTitle || '')
this.$set(this.formData, 'subsidyStandards', null)
this.$set(this.formData, 'reason', null)
this.$set(this.formData, 'remarks', null)
@@ -622,7 +636,7 @@ layout("/layouts/platform.html"){
return this.$axios.post('/platform/difficultHelp/apply/getIsCanPlay').then(res => {
if (res.code === 0) {
// 新增申请进入页面时,优先校验当前登录人本年度是否已经申请过,已申请则直接拦截新增。
if (!this.bizId && res.data.hasCurrentYearApply && !this.$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')) {
if (!this.bizId && res.data.hasCurrentYearApply && !this.canApplyForOthers) {
this.isShow = false
this.$set(this, 'blockMessage', '抱歉,您本年度已申请困难帮扶,不能重复申请。')
} else {
@@ -42,7 +42,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10">
<table-tool :app="this" label="审批列表">
<el-button type="primary" size="small" @click="allAudit" :disabled="pageForm.audit === 'true'">一键审核</el-button>
<!-- <el-button type="primary" size="small" @click="allAudit" :disabled="pageForm.audit === 'true'">一键审核</el-button> -->
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</el-radio-button>
@@ -145,7 +145,7 @@ layout("/layouts/platform.html"){
{ prop: "mobile", label: "联系方式", sortable: true },
{ prop: "subsidyStandards", label: "困难类型", sortable: true },
{ prop: "applyTime", label: "申请时间", sortable: true },
{ prop: "applyCount", label: "申请次数", sortable: true },
{ prop: "applyMoney", label: "申请金额(元)", sortable: true },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
@@ -8,6 +8,7 @@ const INFO = {
<el-descriptions-item label="填写人姓名">{{ viewData.proxyUserName }}</el-descriptions-item>
<el-descriptions-item label="申请金额(元)">{{ viewData.applyMoney }}</el-descriptions-item>
<el-descriptions-item label="性别">{{ viewData.sex }}</el-descriptions-item>
<el-descriptions-item label="身份证号">{{ viewData.idCard }}</el-descriptions-item>
<el-descriptions-item label="填写人工号">{{ viewData.proxyLoginName }}</el-descriptions-item>
<!--\t\t<el-descriptions-item label="申请模式">{{ viewData.mode == 1 ? '本人申请' : '替他人申请' }}</el-descriptions-item>-->
<el-descriptions-item label="所属单位">{{ viewData.unitName }}</el-descriptions-item>
@@ -25,6 +26,12 @@ const INFO = {
<el-descriptions-item label="申请次数" >{{ 1 }}</el-descriptions-item>
<el-descriptions-item label="家庭住址" :span="2">{{ viewData.homeAddress }}</el-descriptions-item>
<el-descriptions-item label="补助类型">
<dict-tag :options="dict.type.DIFFICULT_SUBSIDY_TYPE" :value="viewData.subsidy"></dict-tag>
</el-descriptions-item>
<el-descriptions-item label="困难类型">
<dict-tag :options="dict.type.DIFFICULT_TYPE" :value="viewData.subsidyStandards"></dict-tag>
</el-descriptions-item>
<el-descriptions-item label="家庭主要成员(在一起生活的直系亲属)经济收入情况" :span="3">
@@ -90,8 +97,9 @@ const INFO = {
<template v-if="task.taskFormData.level != null">
<el-descriptions-item label="审批级别">{{ task.taskFormData.level }}</el-descriptions-item>
<el-descriptions-item label="帮扶金额(元)">{{ task.taskFormData.money }}</el-descriptions-item>
</template>
<el-descriptions-item v-if="task.taskFormData.money != null"
:label="task.taskFormData.actualMoney != null ? '实际审批金额(元)' : '帮扶金额(元)'">{{ task.taskFormData.money }}</el-descriptions-item>
<el-descriptions-item label="审批签字" :span="3" v-if="task.taskFormData && task.taskFormData.sign">
@@ -110,7 +118,7 @@ const INFO = {
</div>
`,
store,
dicts: ["PROCESS_TASK_SUBMIT_TYPE"],
dicts: ["PROCESS_TASK_SUBMIT_TYPE", "DIFFICULT_SUBSIDY_TYPE", "DIFFICULT_TYPE"],
data() {
return {
viewData: {},
@@ -45,8 +45,8 @@ layout("/layouts/platform.html"){
<el-button type="primary" size="small" @click="importMoney">导入实际金额</el-button>
<el-button @click="exportYearPayRecord" size="small" icon="el-icon-download" type="primary">导出补助金额</el-button>
<el-button @click="exportAllApply" size="small" type="primary">导出申请表(压缩包)</el-button>
<el-button @click="exportSummaryXlsx" size="small" type="primary">导出汇总表(excel)</el-button>
<el-button @click="exportSummaryDocx" size="small" type="primary">导出汇总表(word)</el-button>
<el-button @click="exportSummaryXlsx" size="small" type="primary">导出汇总表(Excel)</el-button>
<!-- <el-button @click="exportSummaryDocx" size="small" type="primary">导出汇总表(Word)</el-button> -->
</table-tool>
<el-table :data="tableData" :size="tableSize" @sort-change="pageOrder"
@@ -195,7 +195,7 @@ layout("/layouts/platform.html"){
this.$downLoad('/platform/difficultHelp/reading/exportSummary', params)
},
doExportApply(row) {
this.$downLoad('/platform/difficultHelp/reading/doExportApply?id=' + row.id + '&print=false')
this.$downLoad('/platform/difficultHelp/reading/exportReadingApply', {...this.pageForm, id: row.id, print: false})
}
},
async created() {
@@ -1,5 +1,8 @@
<div id="difficult_help_school_union_approval_form">
<el-form :model="formData" ref="formRef" label-width="100px" label-suffix=":">
<el-form-item label="实际审批金额(元)" prop="money" :rules="[{required:true,type:'number',min:0,message:'请填写不小于零的实际审批金额',trigger:['change','blur']}]">
<el-input-number v-model="formData.money" :precision="2" :min="0" placeholder="请输入实际审批金额"></el-input-number>
</el-form-item>
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,whitespace:true,message:'请填写审批意见',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
@@ -17,6 +20,7 @@
return {
businessId: GetQueryString("businessId"),
formData: {
money: undefined,
tf_sign: "", tf_opinion: "",
},
}
@@ -42,7 +42,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10">
<table-tool :app="this" label="审批列表">
<el-button type="primary" size="small" @click="allAudit" :disabled="pageForm.audit === 'true'">一键审核</el-button>
<!-- <el-button type="primary" size="small" @click="allAudit" :disabled="pageForm.audit === 'true'">一键审核</el-button> -->
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</el-radio-button>
@@ -83,6 +83,9 @@ layout("/layouts/platform.html"){
<el-dialog title="设置审核信息" :visible.sync="dialogVisible" width="30%" center>
<el-form :model="formData" ref="formData" label-width="100px">
<el-form-item label="实际审批金额(元)" prop="money" :rules="[{required:true,type:'number',min:0,message:'请填写不小于零的实际审批金额',trigger:['change','blur']}]">
<el-input-number v-model="formData.money" :precision="2" :min="0" placeholder="请输入实际审批金额"></el-input-number>
</el-form-item>
<el-form-item label="审批意见" prop="tf_opinion" :rules="[{required:true,whitespace:true,message:'请填写审批意见',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
@@ -103,6 +106,9 @@ layout("/layouts/platform.html"){
{{formData.taskName}}
</div>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="100px" label-suffix=":">
<el-form-item label="实际审批金额(元)" prop="money" :rules="[{required:true,type:'number',min:0,message:'请填写不小于零的实际审批金额',trigger:['change','blur']}]">
<el-input-number v-model="formData.money" :precision="2" :min="0" placeholder="请输入实际审批金额"></el-input-number>
</el-form-item>
<el-form-item label="审批意见" prop="tf_opinion"
:rules="[{required:true,whitespace:true,message:'请填写审批意见',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
@@ -146,7 +152,7 @@ layout("/layouts/platform.html"){
{ prop: "mobile", label: "联系方式", sortable: true },
{ prop: "subsidyStandards", label: "困难类型", sortable: true },
{ prop: "applyTime", label: "申请时间", sortable: true },
{ prop: "applyCount", label: "申请次数", sortable: true },
{ prop: "applyMoney", label: "申请金额(元)", sortable: true },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
@@ -154,6 +160,7 @@ layout("/layouts/platform.html"){
units: [],
formData: {
money: undefined,
tf_sign: "", tf_opinion: "",
},
showApprovalForm: false,
@@ -178,6 +185,7 @@ layout("/layouts/platform.html"){
this.$message.warning('请至少选择一条记录进行审核!');
return;
}
this.$set(this.formData, 'money', undefined)
this.dialogVisible = true;
},
submitAudit() {
@@ -240,7 +248,7 @@ layout("/layouts/platform.html"){
async approveSingleItem(item) {
const res = await this.$axios.post("/platform/difficultHelp/approval/executeTask", {
data: JSON.stringify({processTaskId: item.taskId, tf_opinion: this.formData.tf_opinion, tf_sign: this.formData.tf_sign, submitType: 1})
data: JSON.stringify({processTaskId: item.taskId, money: this.formData.money, tf_opinion: this.formData.tf_opinion, tf_sign: this.formData.tf_sign, submitType: 1})
})
if (res.code !== 0) throw new Error(res.msg || '审批失败')
},
@@ -248,6 +256,7 @@ layout("/layouts/platform.html"){
this.$refs.guava.edit(()=>{
this.showApprovalForm = true
this.formData = {
money: undefined,
tf_sign: "",
processTaskId: row.taskId,
taskName: row.curTaskName,
@@ -42,7 +42,7 @@ layout("/layouts/platform.html"){
<el-card shadow="never" class="mt10">
<table-tool :app="this" label="审批列表">
<el-button type="primary" size="small" @click="allAudit" :disabled="pageForm.audit === 'true'">一键审核</el-button>
<!-- <el-button type="primary" size="small" @click="allAudit" :disabled="pageForm.audit === 'true'">一键审核</el-button> -->
<el-radio-group @change="doSearch" class="mr5" size="small" v-model="pageForm.audit">
<el-radio-button label="true">已审核</el-radio-button>
<el-radio-button label="false">未审核</el-radio-button>
@@ -158,7 +158,7 @@ layout("/layouts/platform.html"){
{ prop: "mobile", label: "联系方式", sortable: true },
{ prop: "subsidyStandards", label: "困难类型", sortable: true },
{ prop: "applyTime", label: "申请时间", sortable: true },
{ prop: "applyCount", label: "申请次数", sortable: true },
{ prop: "applyMoney", label: "申请金额(元)", sortable: true },
{ prop: "curTaskName", label: "当前节点" },
{ prop: "instanceState", label: "流程状态" }
],
@@ -247,7 +247,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true)
})
.catch(() => {})
.catch(errors => {
if (!Array.isArray(errors) || !errors.length) return
this.$toast(errors[0].message || '请完善审批信息')
this.$nextTick(() => {
this.$refs.formRef.scrollToField(errors[0].name)
})
})
},
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
confirmPendingAction() {
@@ -264,7 +264,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true)
})
.catch(() => {})
.catch(errors => {
if (!Array.isArray(errors) || !errors.length) return
this.$toast(errors[0].message || '请完善审批信息')
this.$nextTick(() => {
this.$refs.formRef.scrollToField(errors[0].name)
})
})
},
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
confirmPendingAction() {
@@ -247,7 +247,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true)
})
.catch(() => {})
.catch(errors => {
if (!Array.isArray(errors) || !errors.length) return
this.$toast(errors[0].message || '请完善审批信息')
this.$nextTick(() => {
this.$refs.formRef.scrollToField(errors[0].name)
})
})
},
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
confirmPendingAction() {
@@ -247,7 +247,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true)
})
.catch(() => {})
.catch(errors => {
if (!Array.isArray(errors) || !errors.length) return
this.$toast(errors[0].message || '请完善审批信息')
this.$nextTick(() => {
this.$refs.formRef.scrollToField(errors[0].name)
})
})
},
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
confirmPendingAction() {
@@ -327,7 +327,7 @@ layout("/layouts/platform_h5.html"){
<van-radio-group class="difficult-help-apply-mode" :value="formData.mode" @input="formData.mode !== $event && modeChange($event)" direction="horizontal" icon-size="14px">
<van-radio name="1" shape="square">本人申请</van-radio>
<van-radio
v-if="$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')"
v-if="canApplyForOthers"
name="2" shape="square">替他人申请
</van-radio>
</van-radio-group>
@@ -723,6 +723,9 @@ layout("/layouts/platform_h5.html"){
}
},
computed: {
canApplyForOthers() {
return this.$auth.hasPermissionOr(['difficult_assistance_school', 'difficult_assistance_union'])
},
canImportFamilyInfo() {
return false;
}
@@ -731,7 +734,7 @@ layout("/layouts/platform_h5.html"){
historyBack,
// 替他人申请时由只读字段主动打开受助人选择,已有业务数据时保持原禁止更换规则。
openRecipientPopup() {
if (this.formData.mode !== "2" || this.formData.id) return
if (this.formData.mode !== "2" || this.formData.id || !this.canApplyForOthers) return
this.$set(this, "recipientSearchKey", "")
this.$set(this, "recipientHasSearched", false)
this.$set(this, "subsidizedList", [])
@@ -995,7 +998,7 @@ layout("/layouts/platform_h5.html"){
* recipientSearchKey 传搜索关键词;接口返回用户数组,列表仅展示姓名和单位。
*/
queryRecipients() {
if (this.formData.mode !== "2") {
if (this.formData.mode !== "2" || !this.canApplyForOthers) {
return
}
const key = (this.recipientSearchKey || "").trim()
@@ -1044,6 +1047,7 @@ layout("/layouts/platform_h5.html"){
this.$set(this.formData, "userName", null)
this.$set(this.formData, "loginName", null)
this.$set(this.formData, "sex", null)
this.$set(this.formData, "birthday", null)
this.$set(this.formData, "unitId", null)
this.$set(this.formData, "unitName", null)
this.$set(this.formData, "unionId", null)
@@ -1108,6 +1112,8 @@ layout("/layouts/platform_h5.html"){
this.$set(this.formData, 'idCard', user.idCard)
this.$set(this.formData, 'mobile', user.mobile)
this.$set(this.formData, 'homeAddress', user.homeAddress)
this.$set(this.formData, 'position', user.position || '')
this.$set(this.formData, 'officialCapacity', user.professionalTitle || '')
this.$set(this.formData, 'subsidyStandards', null)
this.$set(this.formData, 'reason', null)
this.$set(this.formData, 'remarks', null)
@@ -80,6 +80,7 @@ layout("/layouts/platform_h5.html"){
<table-column label="工作单位">{{row.unitName}}</table-column>
<table-column label="困难类型">{{row.subsidyStandards}}</table-column>
<table-column label="填报时间">{{row.applyTime}}</table-column>
<table-column label="申请金额(元)">{{row.applyMoney}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
@@ -257,7 +258,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-action-confirm")) return
this.$set(this, "confirmVisible", true)
})
.catch(() => {})
.catch(errors => {
if (!Array.isArray(errors) || !errors.length) return
this.$toast(errors[0].message || '请完善审批信息')
this.$nextTick(() => {
this.$refs.formRef.scrollToField(errors[0].name)
})
})
},
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
@@ -27,6 +27,7 @@ const INFO = {
<van-cell title="填写人工号">{{ viewData.proxyLoginName || '--' }}</van-cell>
<van-cell title="申请金额(元)">{{ viewData.applyMoney }}</van-cell>
<van-cell title="性别">{{ viewData.sex || '--' }}</van-cell>
<van-cell title="身份证号">{{ viewData.idCard || '--' }}</van-cell>
<van-cell title="受助人">
{{ viewData.userName || '--' }}{{ viewData.loginName ? '(' + viewData.loginName + ')' : '' }}
</van-cell>
@@ -195,7 +196,7 @@ const INFO = {
<van-cell v-if="task.taskFormData && task.taskFormData.level != null" title="审批级别">
{{ task.taskFormData.level }}
</van-cell>
<van-cell v-if="task.taskFormData && task.taskFormData.money != null" title="帮扶金额(元)">
<van-cell v-if="task.taskFormData && task.taskFormData.money != null" :title="task.taskFormData.actualMoney != null ? '实际审批金额(元)' : '帮扶金额(元)'">
{{ task.taskFormData.money }}
</van-cell>
<van-cell title="办理结果">
@@ -318,7 +318,7 @@ layout("/layouts/platform_h5.html"){
</style>
<div id="app">
<div class="difficult-help-list-page">
<van-nav-bar title="帮扶申请记录" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
<van-nav-bar title="我的申请" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<div class="difficult-help-list-sticky">
<van-search
@@ -80,6 +80,7 @@ layout("/layouts/platform_h5.html"){
<table-column label="工作单位">{{row.unitName}}</table-column>
<table-column label="困难类型">{{row.subsidyStandards}}</table-column>
<table-column label="填报时间">{{row.applyTime}}</table-column>
<table-column label="申请金额(元)">{{row.applyMoney}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
@@ -110,6 +111,9 @@ layout("/layouts/platform_h5.html"){
<info ref="infoRef" page-key="difficult-help-school-union-detail" full-screen>
<div v-if="showApprovalForm">
<van-form ref="formRef">
<van-field v-model="formData.money" name="money" label="实际审批金额(元)" type="number" required
placeholder="请输入实际审批金额"
:rules="[{validator: value => /^(0|[1-9][0-9]*)(\.[0-9]{1,2})?$/.test(String(value)) && Number.isFinite(Number(value)), message:'请填写不小于零的实际审批金额,最多两位小数'}]"></van-field>
<section class="difficult-help-info-card">
<h2 class="difficult-help-info-card__title">
@@ -234,6 +238,7 @@ layout("/layouts/platform_h5.html"){
onApproval(row) {
this.$set(this, "showApprovalForm", true)
this.$set(this, "formData", {
money: undefined,
processTaskId: row.taskId,
taskName: row.curTaskName,
id: row.id,
@@ -251,7 +256,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-action-confirm")) return
this.$set(this, "confirmVisible", true)
})
.catch(() => {})
.catch(errors => {
if (!Array.isArray(errors) || !errors.length) return
this.$toast(errors[0].message || '请完善审批信息')
this.$nextTick(() => {
this.$refs.formRef.scrollToField(errors[0].name)
})
})
},
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
@@ -80,6 +80,7 @@ layout("/layouts/platform_h5.html"){
<table-column label="工作单位">{{row.unitName}}</table-column>
<table-column label="困难类型">{{row.subsidyStandards}}</table-column>
<table-column label="填报时间">{{row.applyTime}}</table-column>
<table-column label="申请金额(元)">{{row.applyMoney}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
@@ -265,7 +266,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-action-confirm")) return
this.$set(this, "confirmVisible", true)
})
.catch(() => {})
.catch(errors => {
if (!Array.isArray(errors) || !errors.length) return
this.$toast(errors[0].message || '请完善审批信息')
this.$nextTick(() => {
this.$refs.formRef.scrollToField(errors[0].name)
})
})
},
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
@@ -328,7 +328,7 @@ layout("/layouts/platform_h5.html"){
methods: {
showInvalidApplicationTab(errors) {
if (!Array.isArray(errors) || !errors.length) return
const error = errors[0]
const error = errors.find(item => !String(item.name || '').startsWith('recipients')) || errors[0]
const name = String(error.name || '')
const recipient = name.match(/^recipients\.(\d+)\./)
this.activeApplicationTab = name.startsWith('recipients') ? 'recipients' : 'form'