feat: 特殊慰问-职工慰问优化4

This commit is contained in:
2026-10-31 16:38:27 +08:00
parent 42c5f4acd7
commit f30dbcaa21
14 changed files with 84 additions and 21 deletions
@@ -172,16 +172,16 @@ public class CondolenceReadController {
} }
private void applyReadScope(Cnd cnd, String alias) { private void applyReadScope(Cnd cnd, String alias) {
if (AuthUtil.hasPermission("all_school")) { if (AuthUtil.hasPermission("condolence_all_school")) {
return; return;
} }
if (AuthUtil.hasPermission("branch_union")) { if (AuthUtil.hasPermission("condolence_branch_union")) {
String unionId = SecurityUtil.getUnionId(); String unionId = SecurityUtil.getUnionId();
if (StrUtil.isNotBlank(unionId)) { if (StrUtil.isNotBlank(unionId)) {
cnd.and(alias + ".applyUnionId", "=", unionId); cnd.and(alias + ".applyUnionId", "=", unionId);
return; return;
} }
} else if (AuthUtil.hasPermission("self")) { } else if (AuthUtil.hasPermission("condolence_self")) {
cnd.and(alias + ".createdBy", "=", SecurityUtil.getUserId()); cnd.and(alias + ".createdBy", "=", SecurityUtil.getUserId());
return; return;
} }
@@ -154,7 +154,7 @@ public class DifficultHelpReadingController {
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
cnd.and("ins.state", "=", 20); cnd.and("ins.state", "=", 20);
pageParam.buildSearch(cnd, "info.", false); pageParam.buildReadingSearch(cnd, "info.");
cnd.groupBy("info.id"); cnd.groupBy("info.id");
sql.setCondition(cnd); sql.setCondition(cnd);
Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql); Pagination<NutMap> pagination = difficultHelpCommonService.listPageMap(pageParam.getPageNumber(), pageParam.getPageSize(), sql);
@@ -269,7 +269,7 @@ public class DifficultHelpReadingController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
pageParam.buildSearch(cnd, "info.", false); pageParam.buildReadingSearch(cnd, "info.");
cnd.groupBy("info.id"); cnd.groupBy("info.id");
sql.setCondition(cnd); sql.setCondition(cnd);
List<NutMap> list = difficultHelpCommonService.listMap(sql); List<NutMap> list = difficultHelpCommonService.listMap(sql);
@@ -500,7 +500,7 @@ public class DifficultHelpReadingController {
$condition $condition
"""); """);
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
pageParam.buildSearch(cnd, "info.", false); pageParam.buildReadingSearch(cnd, "info.");
cnd.groupBy("info.id"); cnd.groupBy("info.id");
sql.setCondition(cnd); sql.setCondition(cnd);
List<NutMap> list = difficultHelpCommonService.listMap(sql); List<NutMap> list = difficultHelpCommonService.listMap(sql);
@@ -129,6 +129,7 @@ public class DifficultHelpCommonServiceImpl extends BaseServiceImpl<DifficultHel
// 2. 查询符合条件的 DifficultHelpInfo 记录 // 2. 查询符合条件的 DifficultHelpInfo 记录
Cnd cnd = Cnd.NEW(); Cnd cnd = Cnd.NEW();
pageForm.applyReadingScope(cnd, "");
if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) { if (StrUtil.isNotBlank(pageForm.getSearchKeyword())) {
cnd.and(Cnd.exps("loginName", "LIKE", "%" + pageForm.getSearchKeyword() + "%") cnd.and(Cnd.exps("loginName", "LIKE", "%" + pageForm.getSearchKeyword() + "%")
.or("userName", "LIKE", "%" + pageForm.getSearchKeyword() + "%")); .or("userName", "LIKE", "%" + pageForm.getSearchKeyword() + "%"));
@@ -32,6 +32,26 @@ public class DifficultHelpPageParam extends PageForm {
private List<String> dateRange; private List<String> dateRange;
public void buildReadingSearch(Cnd cnd, String prefix) {
buildSearch(cnd, prefix, false);
applyReadingScope(cnd, prefix);
}
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){ public void buildSearch(Cnd cnd, String prefix){
buildSearch(cnd, prefix, true); buildSearch(cnd, prefix, true);
} }
@@ -25,10 +25,7 @@ module.exports = {
watch: { watch: {
value: { value: {
handler(val) { handler(val) {
if (val) { this.signatureContent = val || null
this.signatureContent = val
this.$emit("input", this.signatureContent)
}
}, },
immediate: true immediate: true
} }
@@ -62,8 +59,11 @@ module.exports = {
if (res.code !== 0) { if (res.code !== 0) {
throw new Error("签字信息加载失败") 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秒或组件销毁时结束等待。 // 返回等待完成的 Promise;连接成功、等待30秒或组件销毁时结束等待。
@@ -247,7 +247,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true) 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() { confirmPendingAction() {
@@ -264,7 +264,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true) 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() { confirmPendingAction() {
@@ -247,7 +247,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true) 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() { confirmPendingAction() {
@@ -247,7 +247,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("condolence-action-confirm")) return
this.$set(this, "confirmVisible", true) 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() { confirmPendingAction() {
@@ -257,7 +257,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-action-confirm")) return if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-action-confirm")) return
this.$set(this, "confirmVisible", true) 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)
})
})
}, },
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。 // 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
@@ -318,7 +318,7 @@ layout("/layouts/platform_h5.html"){
</style> </style>
<div id="app"> <div id="app">
<div class="difficult-help-list-page"> <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"> <van-sticky offset-top="46px">
<div class="difficult-help-list-sticky"> <div class="difficult-help-list-sticky">
<van-search <van-search
@@ -251,7 +251,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-action-confirm")) return if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-action-confirm")) return
this.$set(this, "confirmVisible", true) 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)
})
})
}, },
// 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。 // 确认操作时先回退确认框历史,再根据操作类型调用办理或撤回接口。
@@ -265,7 +265,13 @@ layout("/layouts/platform_h5.html"){
if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-action-confirm")) return if (window.h5HistoryLayerManager && window.h5HistoryLayerManager.open("difficult-help-action-confirm")) return
this.$set(this, "confirmVisible", true) 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: { methods: {
showInvalidApplicationTab(errors) { showInvalidApplicationTab(errors) {
if (!Array.isArray(errors) || !errors.length) return 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 name = String(error.name || '')
const recipient = name.match(/^recipients\.(\d+)\./) const recipient = name.match(/^recipients\.(\d+)\./)
this.activeApplicationTab = name.startsWith('recipients') ? 'recipients' : 'form' this.activeApplicationTab = name.startsWith('recipients') ? 'recipients' : 'form'