feat: 优化人员拉取和数据字典部分4

This commit is contained in:
2026-11-02 11:22:39 +08:00
parent d1050db6b3
commit 0f460e6b1a
16 changed files with 296 additions and 155 deletions
@@ -127,6 +127,7 @@ public class CondolenceApplyController {
username as userName,
loginname as loginName,
sex,
mobile,
technicalTitle,
IFNULL(unitname, '暂无') as unitName,
unitid as unitId,
@@ -184,6 +184,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,
@@ -1,6 +1,7 @@
package com.budwk.app.zhgh.staffbenefit.difficulthelp.controller;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaMode;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.annotation.SLog;
import com.budwk.app.base.page.Pagination;
@@ -68,6 +69,7 @@ public class DifficultHelpMineController {
Sql sql = Sqls.create("""
SELECT
info.id,
info.createdBy,
info.proxyUserName,
info.proxyLoginName,
info.userName,
@@ -103,7 +105,8 @@ public class DifficultHelpMineController {
""");
Cnd cnd = Cnd.NEW();
pageParam.buildSearch(cnd, "info.");
cnd.and("info.createdBy", "=", SecurityUtil.getUserId());
cnd.and(Cnd.exps("info.createdBy", "=", SecurityUtil.getUserId())
.or("info.userId", "=", SecurityUtil.getUserId()));
if (StrUtil.isAllBlank(pageParam.getPageOrderName(), pageParam.getPageOrderBy())) {
cnd.desc("info.applyTime");
} else {
@@ -121,6 +124,10 @@ public class DifficultHelpMineController {
@SaCheckPermission("difficultHelp.mine")
@SLog(tag = "困难补助申请", msg = "删除困难补助申请,id: ${args[0]}")
public Result onDelete(@Valid String id){
DifficultHelpInfo helpInfo = dao.fetch(DifficultHelpInfo.class, id);
if (helpInfo == null || !SecurityUtil.getUserId().equals(helpInfo.getCreatedBy())) {
return Result.error("只能删除自己创建的申请记录");
}
dao.clear(DifficultHelpInfo.class, Cnd.where("id", "=", id));
// 删除流程相关操作
flowEngine.processInstanceService().deleteProcessInstanceByBusinessKey(id);
@@ -130,7 +137,7 @@ public class DifficultHelpMineController {
@At
@ApiModelProperty("获取困难补助申请")
@SaCheckPermission("difficultHelp.mine")
@SaCheckPermission(value = {"difficultHelp.mine", "difficultHelp.reading"}, mode = SaMode.OR)
public Result findOne(String id) {
DifficultHelpInfo helpInfo = dao.fetch(DifficultHelpInfo.class, id);
return Result.success().addData(helpInfo);
@@ -55,7 +55,7 @@ layout("/layouts/platform.html"){
</el-select>
</el-form-item>
</el-descriptions-item>-->
<el-descriptions-item label="证明人">
<!-- <el-descriptions-item label="证明人">
<el-form-item prop="certifierUserId" label="证明人">
<el-select
style="width: 100%"
@@ -75,7 +75,7 @@ layout("/layouts/platform.html"){
</el-option>
</el-select>
</el-form-item>
</el-descriptions-item>
</el-descriptions-item> -->
<el-descriptions-item label="慰问类型">
<el-form-item prop="type" label="慰问类型">
<el-select v-model="formData.type" @change="typeChange" style="width: 100%"
@@ -112,14 +112,14 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="收款账户">
<el-descriptions-item label="收款账户" v-if="!['A', 'D'].includes(formData.typeCode)">
<el-form-item prop="bankCardNumber" label="收款账户">
<el-input maxlength="20" v-model="formData.bankCardNumber" placeholder="请填写收款账户"
<el-input maxlength="30" v-model="formData.bankCardNumber" placeholder="请填写银行卡号或对公账户号"
></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="户名">
<el-descriptions-item label="户名" v-if="!['A', 'D'].includes(formData.typeCode)">
<el-form-item prop="bankUserName" label="户名">
<el-input maxlength="20" v-model="formData.bankUserName"
placeholder="请填写户名"
@@ -127,7 +127,7 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="开户行" >
<el-descriptions-item label="开户行" v-if="!['A', 'D'].includes(formData.typeCode)">
<el-form-item prop="bankOfDeposit" label="开户行">
<el-input maxlength="20" v-model="formData.bankOfDeposit"
placeholder="请填写开户行"
@@ -173,10 +173,12 @@ layout("/layouts/platform.html"){
</template>
</el-descriptions>
<el-descriptions :column="3" border>
<el-descriptions-item label="申请事由" :span="3">
<el-form-item prop="remark" label="申请事由">
<el-input maxlength="500" v-model="formData.remark" placeholder="请填写申请事由"
type="textarea" :autosize="{ minRows: 4, maxRows: 8}"></el-input>
type="textarea" :rows="3" resize="none"></el-input>
</el-form-item>
</el-descriptions-item>
@@ -219,6 +221,15 @@ layout("/layouts/platform.html"){
new Vue({
el: "#app",
store,
components: {
ElDatePicker: {
extends: ELEMENT.DatePicker,
mounted() {
// 手动输入触发 change 前初始化日期面板,避免 picker 尚未创建。
if (!this.picker) this.mountPicker()
}
}
},
data() {
return {
bizId: GetQueryString("bizId"),
@@ -229,7 +240,10 @@ layout("/layouts/platform.html"){
payUserId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
type: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
way: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
money: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
money: [
{ required: true, message: "请填写慰问金额", trigger: ["change", "blur"] },
{ validator: (rule, value, callback) => callback(this.validateMoney(value) ? undefined : new Error("慰问金额须大于0且不超过10000元,最多两位小数")), trigger: ["change", "blur"] }
],
occurTime: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
child: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
hospital: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
@@ -238,14 +252,20 @@ layout("/layouts/platform.html"){
hospitalBy: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
deadImmediateFamily: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
remark: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
files: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
files: [{ required: true, type: "array", min: 1, max: 5, message: "请上传1至5个附件", trigger: ["change", "blur"] }],
signature: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
handlerUserId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
certifierUserId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
bankCardNumber: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
// certifierUserId: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
bankCardNumber: [
{ required: true, message: "请填写银行卡号或对公账户号", trigger: ["change", "blur"] },
{ pattern: /^[0-9]{6,30}$/, message: "收款账户须为6至30位数字(银行卡号或对公账户号)", trigger: ["change", "blur"] }
],
bankUserName: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
bankOfDeposit: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
thisYearHospitalizationNum: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
thisYearHospitalizationNum: [
{ required: true, message: "必填", trigger: ["change", "blur"] },
{ type: "integer", min: 0, max: 10000, message: "住院次数须为0至10000的整数", trigger: ["change", "blur"] }
],
leaveHospitalTime: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
hospitalizationTime: [{ required: true, message: "必填", trigger: ["change", "blur"] }],
},
@@ -259,6 +279,9 @@ layout("/layouts/platform.html"){
}
},
methods: {
validateMoney(value) {
return /^(0|[1-9][0-9]*)(\.[0-9]{1,2})?$/.test(String(value)) && Number(value) > 0 && Number(value) <= 10000
},
createRemoteMethod(options) {
return (keyword) => {
this.selectQueryUser(keyword, options)
@@ -65,6 +65,9 @@ const condolenceInfo = {
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</el-descriptions-item>
<el-descriptions-item label="审批签字" :span="3" v-if="task.taskFormData && task.taskFormData.sign">
<el-image :src="task.taskFormData.sign" style="height: 80px" fit="contain"></el-image>
</el-descriptions-item>
<el-descriptions-item label="办理意见" v-if="!task.ext.isFirstTaskNode">{{
task.taskFormData.opinion }}
</el-descriptions-item>
@@ -37,12 +37,12 @@ const basicForm = {
<el-radio-button :label="false">不上传</el-radio-button>
</el-radio-group>
</el-form-item>-->
<!-- <el-form-item label="是否上传附件" prop="isUploadFile">-->
<!-- <el-radio-group v-model="formData.isUploadFile">-->
<!-- <el-radio-button :label="true">是</el-radio-button>-->
<!-- <el-radio-button :label="false">否</el-radio-button>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<el-form-item label="是否上传附件" prop="isUploadFile">
<el-radio-group v-model="formData.isUploadFile">
<el-radio-button :label="true">是</el-radio-button>
<el-radio-button :label="false">否</el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="上传附件说明" prop="uploadFileDesc" v-if="formData.isUploadFile">
<el-input v-model="formData.uploadFileDesc" maxlength="50" clearable placeholder="请填写上传附件说明"></el-input>
</el-form-item>
@@ -17,7 +17,7 @@
@change="modeChange"
:disabled="formData.id" style="width: 100%">
<el-option label="本人申请" value="1"></el-option>
<el-option v-if="$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')"
<el-option v-if="$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')"
label="替他人申请" value="2"></el-option>
</el-select>
</el-form-item>
@@ -263,6 +263,9 @@
methods: {
// 查询受助人
queryRecipients(key) {
if (String(this.formData.mode) !== "2" || !this.$auth.hasRoleOr('BRANCH_UNION_CHAIRMAN')) {
return
}
this.$axios.get("/platform/difficultHelp/apply/queryRecipients", {
key
}).then(res => {
@@ -417,10 +420,10 @@
this.$set(this.formData, 'proxyLoginName', user.loginname)
this.$set(this.formData, 'mode', "1")
this.$set(this.formData, 'sex', user.sex)
this.$set(this.formData, 'unitId', user.unit.id)
this.$set(this.formData, 'unitName', user.unit.name)
this.$set(this.formData, 'unionId', user.union.id)
this.$set(this.formData, 'unionName', user.union.name)
this.$set(this.formData, 'unitId', (user.unit || {}).id || user.unitId || null)
this.$set(this.formData, 'unitName', (user.unit || {}).name || '')
this.$set(this.formData, 'unionId', (user.union || {}).id || (user.unit || {}).unionId || null)
this.$set(this.formData, 'unionName', (user.union || {}).name || '')
this.$set(this.formData, 'monthlyIncome', null)
this.$set(this.formData, 'birthday', user.birthday)
this.$set(this.formData, 'mobile', user.mobile)
@@ -1,8 +1,9 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app">
<el-card shadow="never" v-if="isShow">
<div id="app" v-cloak>
<el-card shadow="never" v-if="pageLoading" v-loading="pageLoading" element-loading-text="正在加载申请信息" style="min-height: 300px"></el-card>
<el-card shadow="never" v-else-if="isShow">
<snaker-start slot="header" label="困难帮扶申请" define_key="KNBF"></snaker-start>
<el-form :model="formData" ref="formRef" :rules="formRules" label-width="0" label-suffix=":" class="flow-task-form">
<el-descriptions :column="3" border>
@@ -15,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('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')"
<el-option v-if="canApplyForOthers"
label="替他人申请" value="2"></el-option>
</el-select>
</el-form-item>
@@ -26,7 +27,7 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="受补助人">
<el-form-item prop="userName">
<el-form-item prop="userId">
<template v-if="formData.mode == 2">
<el-select :remote-method="queryRecipients"
@change="userChange" clearable filterable
@@ -51,7 +52,7 @@ layout("/layouts/platform.html"){
</el-descriptions-item>
<el-descriptions-item label="身份证号" :span="2">
<el-form-item prop="idCard">
<el-input maxlength="20" clearable placeholder="请填写身份证号"
<el-input clearable placeholder="请填写身份证号"
v-model="formData.idCard" maxlength="18"></el-input>
</el-form-item>
</el-descriptions-item>
@@ -84,7 +85,7 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="手机号码">
<el-form-item prop="mobile">
<el-input maxlength="11" clearable placeholder="请填写手机号码"
v-model="formData.mobile" maxlength="11"></el-input>
v-model="formData.mobile"></el-input>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="家庭年总收入(万元)">
@@ -103,6 +104,7 @@ layout("/layouts/platform.html"){
<el-input-number
v-model="formData.homeNumber"
:min="1"
:precision="0"
:step="1"
style="width: 100%"
placeholder="请填写家庭人数">
@@ -113,7 +115,7 @@ layout("/layouts/platform.html"){
<el-form-item prop="homeAddress">
<el-input clearable
style="width: 100%"
v-model="formData.homeAddress"
v-model="formData.homeAddress" maxlength="200"
placeholder="请填写家庭住址">
</el-input>
</el-form-item>
@@ -132,7 +134,7 @@ layout("/layouts/platform.html"){
<!-- </el-descriptions-item>-->
<el-descriptions-item label="银行卡号" >
<el-form-item prop="bankCardNum">
<el-input maxlength="20" clearable placeholder="请填写银行卡号"
<el-input maxlength="19" clearable placeholder="请填写银行卡号"
v-model="formData.bankCardNum"></el-input>
</el-form-item>
</el-descriptions-item>
@@ -151,7 +153,7 @@ layout("/layouts/platform.html"){
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="生活致困原因" :span="3">
<el-descriptions-item label="生活致困原因" :span="3">
<el-form-item prop="reason">
<el-input maxlength="500" :autosize="{ minRows: 5, maxRows: 10}"
placeholder="请简述生活致困原因"
@@ -193,8 +195,8 @@ layout("/layouts/platform.html"){
<template slot-scope="{row,$index}">
<el-form-item label-width="0"
:prop="'familyList.'+$index+'.relation'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="row.relation" placeholder="请填写与本人关系" clearable></el-input>
:rules="textRules('与本人关系', 50)">
<el-input v-model="row.relation" maxlength="50" placeholder="请填写与本人关系" clearable></el-input>
</el-form-item>
</template>
</el-table-column>
@@ -202,8 +204,8 @@ layout("/layouts/platform.html"){
<template slot-scope="{row,$index}">
<el-form-item label-width="0"
:prop="'familyList.'+$index+'.name'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="row.name" placeholder="请填写姓名" clearable></el-input>
:rules="textRules('姓名', 100)">
<el-input v-model="row.name" maxlength="100" placeholder="请填写姓名" clearable></el-input>
</el-form-item>
</template>
</el-table-column>
@@ -211,9 +213,9 @@ layout("/layouts/platform.html"){
<template slot-scope="{row,$index}">
<el-form-item label-width="0"
:prop="'familyList.'+$index+'.age'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
:rules="[{required:true,type:'integer',min:1,max:100,message:'年龄须为1至100的整数',trigger:['change','blur']}]">
<el-input-number v-model="row.age" placeholder="年龄" :min="1"
:max="100" :step="1" style="width: 100%" clearable></el-input-number>
:max="100" :precision="0" :step="1" style="width: 100%" clearable></el-input-number>
</el-form-item>
</template>
</el-table-column>
@@ -221,8 +223,8 @@ layout("/layouts/platform.html"){
<template slot-scope="{row,$index}">
<el-form-item label-width="0"
:prop="'familyList.'+$index+'.homeUnit'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="row.homeUnit" placeholder="请填写工作单位" clearable></el-input>
:rules="textRules('工作单位', 200)">
<el-input v-model="row.homeUnit" maxlength="200" placeholder="请填写工作单位" clearable></el-input>
</el-form-item>
</template>
</el-table-column>
@@ -230,9 +232,9 @@ layout("/layouts/platform.html"){
<template slot-scope="{row,$index}">
<el-form-item label-width="0"
:prop="'familyList.'+$index+'.yearIncome'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
:rules="[{validator:validateIncome,required:true,trigger:['change','blur']}]">
<el-input-number v-model="row.yearIncome" placeholder="年收入"
:min="0" :step="1" style="width: 100%" clearable></el-input-number>
:min="0" :precision="2" :step="1" style="width: 100%" clearable></el-input-number>
</el-form-item>
</template>
</el-table-column>
@@ -240,8 +242,8 @@ layout("/layouts/platform.html"){
<template slot-scope="{row,$index}">
<el-form-item label-width="0"
:prop="'familyList.'+$index+'.remarks'"
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<el-input v-model="row.remarks" placeholder="请填写备注" clearable></el-input>
:rules="textRules('备注', 500)">
<el-input v-model="row.remarks" maxlength="500" placeholder="请填写备注" clearable></el-input>
</el-form-item>
</template>
</el-table-column>
@@ -292,7 +294,7 @@ layout("/layouts/platform.html"){
</el-card>
<div v-else>
<el-card class="box-card" style="height: 92vh" shadow="never">
<el-result icon="warning" title="温馨提醒" subTitle="">
<el-result icon="warning" title="温馨提醒" sub-title="">
<template slot="extra">
<span v-if="blockMessage">{{blockMessage}}</span>
<span v-else>抱歉,当前时间不能申请,可申请时间为{{time}}。</span>
@@ -312,6 +314,7 @@ layout("/layouts/platform.html"){
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
isShow: false,
pageLoading: true,
time: '',
blockMessage: '',
formData: {
@@ -320,30 +323,55 @@ layout("/layouts/platform.html"){
applyCount: '1',
},
formRules: {
proxyUserName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
proxyLoginName: [{required: true, message: '必填', trigger: ['blur', 'change']}],
sex: [{required: true, message: '请填写性别', trigger: ['blur', 'change']}],
userName: [{required: true, message: '请填写受补助人', trigger: ['blur', 'change']}],
unitName: [{required: true, message: '请填写所属单位', trigger: ['blur', 'change']}],
proxyUserName: this.textRules('填写人姓名', 100),
proxyLoginName: this.textRules('填写人工号', 100),
mode: [{required: true, type: 'enum', enum: ['1', '2'], message: '请选择申请模式', trigger: ['blur', 'change']}],
sex: [{required: true, type: 'enum', enum: ['男', '女'], message: '请选择性别', trigger: ['blur', 'change']}],
userId: [{required: true, message: '请选择受补助人', trigger: ['blur', 'change']}],
unitName: this.textRules('所属单位', 500),
unionName: [{required: true, message: '请填写所属工会', trigger: ['blur', 'change']}],
homeAddress: [{required: true, message: '请填写家庭住址', trigger: ['blur', 'change']}],
mobile: [{required: true, message: '请填写手机号码', trigger: ['blur', 'change']}],
idCard: [{required: true, message: '请填写身份证号', trigger: ['blur', 'change']}],
bankCardNum: [{required: true, message: '请填写收款账户卡号', trigger: ['blur', 'change']}],
homeAddress: this.textRules('家庭住址', 200),
mobile: [
{required: true, message: '请填写手机号码', trigger: ['blur', 'change']},
{pattern: /^1[3-9]\d{9}$/, message: '请输入正确的11位手机号码', trigger: ['blur', 'change']}
],
idCard: [{validator: (rule, value, callback) => {
const result = this.isValidIdCard(value || '')
callback(result.status === 0 ? new Error(result.msg) : undefined)
}, required: true, trigger: ['blur', 'change']}],
bankCardNum: [{validator: (rule, value, callback) => {
const result = this.validateCard(value || '')
callback(result.status === 0 ? new Error(result.msg) : undefined)
}, required: true, trigger: ['blur', 'change']}],
bankUserName: [{required: true, message: '请填写户名', trigger: ['blur', 'change']}],
bankOfDeposit: [{required: true, message: '请填写开户行', trigger: ['blur', 'change']}],
position: [{required: true, message: '请填写职务', trigger: ['blur', 'change']}],
officialCapacity: [{required: true, message: '请填写职称', trigger: ['blur', 'change']}],
subsidyStandards: [{required: true, message: '请选择困难类型', trigger: ['blur', 'change']}],
reason: [{required: true, message: '请填写申请原因', trigger: ['blur', 'change']}],
sign: [{required: true, message: '请签字', trigger: ['blur', 'change']}]
bankOfDeposit: this.textRules('开户行', 30),
position: this.textRules('职务', 20),
officialCapacity: this.textRules('职称', 20),
homeIncome: [{validator: this.validateIncome, required: true, trigger: ['blur', 'change']}],
homeNumber: [{required: true, type: 'integer', min: 1, message: '家庭人数须为大于零的整数', trigger: ['blur', 'change']}],
subsidy: this.textRules('补助类型', 500),
subsidyStandards: this.textRules('困难类型', 500),
reason: this.textRules('生活致困原因', 500),
sign: [{required: true, whitespace: true, message: '请完成签字', trigger: ['blur', 'change']}],
},
// 替他人申请相关
subsidizedList: []
}
},
computed: {
canApplyForOthers() {
return this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')
}
},
methods: {
textRules(label, max) {
return [{required: true, whitespace: true, max, message: '请填写' + label + ',且不超过' + max + '个字符', trigger: ['blur', 'change']}]
},
validateIncome(rule, value, callback) {
const valid = typeof value === 'number' && Number.isFinite(value) && value >= 0 && /^\d+(\.\d{1,2})?$/.test(String(value))
callback(valid ? undefined : new Error('收入须为不小于零的数字,最多保留两位小数'))
},
// 保存
onSave() {
this.$confirm("您确定保存吗?", "提示", {
@@ -362,24 +390,13 @@ layout("/layouts/platform.html"){
// 提交
async onSubmit() {
this.$refs.formRef.validate().then((valid) => {
this.$refs.formRef.validate().catch(() => false).then((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
const result = this.isValidIdCard(this.formData.idCard)
if (result.status === 0) {
this.$message.warning(result.msg)
return
}
const bankRes = this.validateCard(this.formData.bankCardNum)
if (bankRes.status === 0) {
this.$message.warning(bankRes.msg)
return;
}
this.$axios.post('/platform/difficultHelp/apply/submit', {
data: JSON.stringify(this.formData)
}).then(res => {
@@ -394,7 +411,7 @@ layout("/layouts/platform.html"){
},
async onFinishTask() {
this.$refs.formRef.validate().then((valid) => {
this.$refs.formRef.validate().catch(() => false).then((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
@@ -402,17 +419,6 @@ layout("/layouts/platform.html"){
type: "warning"
}).then(() => {
const result = this.isValidIdCard(this.formData.idCard)
if (result.status === 0) {
this.$message.warning(result.msg)
return
}
const bankRes = this.validateCard(this.formData.bankCardNum)
if (bankRes.status === 0) {
this.$message.warning(bankRes.msg)
return;
}
this.$axios.post('/platform/difficultHelp/apply/submitAgain', {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
@@ -429,6 +435,9 @@ layout("/layouts/platform.html"){
// 查询受助人
queryRecipients(key) {
if (String(this.formData.mode) !== "2" || !this.canApplyForOthers) {
return
}
this.$axios.post("/platform/difficultHelp/apply/queryRecipients", {
key
}).then(res => {
@@ -438,10 +447,12 @@ layout("/layouts/platform.html"){
})
},
findOne(id) {
this.$axios.post('/platform/difficultHelp/mine/findOne', { id }).then(res => {
return this.$axios.post('/platform/difficultHelp/mine/findOne', { id }).then(res => {
if (res.code === 0) {
this.formData = res.data
this.queryRecipients(res.data.loginName)
} else {
throw new Error(res.msg || '申请信息加载失败,请刷新页面重试')
}
})
},
@@ -459,6 +470,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)
@@ -471,6 +485,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', '')
}
},
// 申请模式
@@ -486,15 +504,17 @@ layout("/layouts/platform.html"){
this.$set(this.formData, 'proxyLoginName', user.loginname)
this.$set(this.formData, 'mode', "1")
this.$set(this.formData, 'sex', user.sex)
this.$set(this.formData, 'unitId', user.unit.id)
this.$set(this.formData, 'unitName', user.unit.name)
this.$set(this.formData, 'unionId', user.union.id)
this.$set(this.formData, 'unionName', user.union.name)
this.$set(this.formData, 'unitId', (user.unit || {}).id || user.unitId || null)
this.$set(this.formData, 'unitName', (user.unit || {}).name || '')
this.$set(this.formData, 'unionId', (user.union || {}).id || (user.unit || {}).unionId || null)
this.$set(this.formData, 'unionName', (user.union || {}).name || '')
this.$set(this.formData, 'yearIncome', null)
this.$set(this.formData, 'birthday', user.birthday)
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)
@@ -602,10 +622,10 @@ layout("/layouts/platform.html"){
return { status: 200, msg: "卡号有效。" };
},
async getIsCanPlay() {
this.$axios.post('/platform/difficultHelp/apply/getIsCanPlay').then(res => {
return this.$axios.post('/platform/difficultHelp/apply/getIsCanPlay').then(res => {
if (res.code === 0) {
// 新增申请进入页面时,优先校验当前登录人本年度是否已经申请过,已申请则直接拦截新增。
if (!this.bizId && res.data.hasCurrentYearApply) {
if (!this.bizId && res.data.hasCurrentYearApply && !this.canApplyForOthers) {
this.isShow = false
this.$set(this, 'blockMessage', '抱歉,您本年度已申请困难帮扶,不能重复申请。')
} else {
@@ -616,16 +636,25 @@ layout("/layouts/platform.html"){
if (res.data.applyCount !== null && res.data.applyCount !== undefined && res.data.applyCount !== 0) {
this.$set(this.formData, 'applyCount', res.data.applyCount)
}
} else {
throw new Error(res.msg || '申请资格加载失败,请刷新页面重试')
}
})
}
},
async created() {
await this.getIsCanPlay();
if (this.bizId) {
this.findOne(this.bizId)
} else {
this.modeChange("1")
try {
await this.getIsCanPlay();
if (this.bizId) {
await this.findOne(this.bizId)
} else {
this.modeChange("1")
}
} catch (error) {
this.isShow = false
this.blockMessage = error.message || '申请信息加载失败,请刷新页面重试'
} finally {
this.pageLoading = false
}
}
})
@@ -24,6 +24,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">
@@ -106,7 +112,7 @@ const INFO = {
</div>
`,
store,
dicts: ["PROCESS_TASK_SUBMIT_TYPE"],
dicts: ["PROCESS_TASK_SUBMIT_TYPE", "DIFFICULT_SUBSIDY_TYPE", "DIFFICULT_TYPE"],
data() {
return {
viewData: {},
@@ -64,16 +64,16 @@ layout("/layouts/platform.html"){
size="small"></enum-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" width="300px">
<el-table-column label="操作" fixed="right" width="300px" class-name="difficult-help-mine-actions">
<template slot-scope="{row}">
<el-button @click="openView(row)" size="mini" type="primary">查看</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary">
<el-button v-if="row.createdBy === $store.state.user.id && (row.taskKey === 'startTask' || !row.instanceId)" @click="onEdit(row)" size="mini" type="primary">
编辑
</el-button>
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
<el-button v-if="row.createdBy === $store.state.user.id && row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
</el-button>
<el-button @click="doExportApply(row)" size="mini" type="primary">打印</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
<el-button v-if="row.createdBy === $store.state.user.id && row.instanceState == 20" @click="doExportApply(row)" size="mini" type="primary">导出</el-button>
<el-button v-if="row.createdBy === $store.state.user.id && (row.taskKey === 'startTask' || !row.instanceId)" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -87,6 +87,18 @@ layout("/layouts/platform.html"){
</div>
<style nonce="${cspNonce!}">
#app .difficult-help-mine-actions .cell {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
#app .difficult-help-mine-actions .cell > .el-button {
margin-left: 0;
}
</style>
<script nonce="${cspNonce!}">
<!--#include("../common/info.js"){}#-->
@@ -165,11 +177,11 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.units = await this.$businessTool.listUnit(this.pageForm.unionId)
} else {
this.units = await this.$businessTool.listUnit(this.$store.state.user.union.id)
this.units = await this.$businessTool.listUnit((this.$store.state.user.union || {}).id || this.pageForm.unionId)
}
},
doExportApply(row) {
this.$downLoad('/platform/difficultHelp/reading/doExportApply?id=' + row.id + '&print=true')
this.$downLoad('/platform/difficultHelp/reading/doExportApply?id=' + row.id + '&print=false')
}
},
async created() {
@@ -177,7 +189,7 @@ layout("/layouts/platform.html"){
if (this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN')) {
this.unions = await this.$businessTool.listUnion()
} else {
this.unions = await this.$businessTool.listUnion(this.$store.state.user.union.id)
this.unions = await this.$businessTool.listUnion((this.$store.state.user.union || {}).id)
}
}
})
@@ -255,7 +255,7 @@ layout("/layouts/platform_h5.html"){
<van-empty description="暂无数据" v-else></van-empty>
</van-action-sheet>-->
<van-field
<!-- <van-field
v-model="formData.certifierUserName"
name="certifierUserName"
label="证明人"
@@ -288,7 +288,7 @@ layout("/layouts/platform_h5.html"){
</template>
</div>
<van-empty description="暂无数据" v-else></van-empty>
</van-action-sheet>
</van-action-sheet> -->
<van-field
v-model="formData.typeName"
@@ -322,7 +322,7 @@ layout("/layouts/platform_h5.html"){
name="money"
label="慰问金额"
required
:rules="[{ required: true }]"
:rules="[{ required: true, message: '请填写慰问金额' }, { validator: validateMoney, message: '慰问金额须大于0且不超过10000元,最多两位小数' }]"
placeholder="选择慰问类型自动匹配金额"
clickable
type="number"
@@ -353,17 +353,19 @@ layout("/layouts/platform_h5.html"){
</van-popup>
<van-field
v-if="!['A', 'D'].includes(formData.typeCode)"
v-model="formData.bankCardNumber"
label="收款账户"
maxlength="20"
maxlength="30"
clearable
name="bankCardNumber"
placeholder="请填写收款账户"
:rules="[{ required: true }]"
placeholder="请填写银行卡号或对公账户号"
:rules="[{ required: true, message: '请填写银行卡号或对公账户号' }, { pattern: /^[0-9]{6,30}$/, message: '收款账户须为6至30位数字(银行卡号或对公账户号)' }]"
required
></van-field>
<van-field
v-if="!['A', 'D'].includes(formData.typeCode)"
v-model="formData.bankUserName"
label="户名"
placeholder="请填写户名"
@@ -373,12 +375,10 @@ layout("/layouts/platform_h5.html"){
name="bankUserName"
></van-field>
<van-field
v-if="!['A', 'D'].includes(formData.typeCode)"
v-model="formData.bankOfDeposit"
label="开户行"
maxlength="30"
type="textarea"
rows="4"
autosize
maxlength="20"
placeholder="请填写开户行"
:rules="[{ required: true }]"
required
@@ -433,8 +433,8 @@ layout("/layouts/platform_h5.html"){
></van-datetime-picker>
</van-popup>
<van-field type="digit" label="当年第几次住院"
:rules="[{ required: true }]"
<van-field type="digit" label="当年第几次住院" name="thisYearHospitalizationNum"
:rules="[{ required: true }, { validator: value => /^[0-9]+$/.test(String(value)) && Number(value) <= 10000, message: '住院次数须为0至10000的整数' }]"
required
placeholder="请输入当年第几次住院"
v-model="formData.thisYearHospitalizationNum"></van-field>
@@ -443,6 +443,7 @@ layout("/layouts/platform_h5.html"){
<van-field
v-model="formData.remark"
name="remark"
maxlength="500"
label="申请事由"
type="textarea"
rows="4"
@@ -460,15 +461,18 @@ layout("/layouts/platform_h5.html"){
{{ '附件说明:' + chooseType.uploadFileDesc }}
</div>
<van-cell-group :border="false">
<van-field class="direction-column-field" name="avatar" label="">
<van-field class="direction-column-field" name="files" label="附件" required
:rules="[{ validator: () => Array.isArray(formData.files) && formData.files.length > 0 && formData.files.length <= 5, message: '请上传1至5个附件' }]">
<template #input>
<h5-file-upload
slot="input"
:value.sync="formData.files"
:upload_number="5"
upload_text="上传附件"
upload_result_category="array"
complete_result
></h5-file-upload>
<div class="condolence-card__desc">最多上传 5 个文件</div>
</template>
</van-field>
</van-cell-group>
@@ -477,7 +481,8 @@ layout("/layouts/platform_h5.html"){
<section class="form-section">
<h2 class="condolence-card__title">签字确认</h2>
<van-cell-group :border="false">
<van-field class="direction-column-field" name="signature" label="">
<van-field class="direction-column-field" name="signature" label="" :value="formData.signature"
:rules="[{ required: true, message: '请填写签字' }]">
<template #input>
<h5-signature v-model="formData.signature" slot="input"></h5-signature>
</template>
@@ -532,6 +537,9 @@ layout("/layouts/platform_h5.html"){
}
},
methods: {
validateMoney(value) {
return /^(0|[1-9][0-9]*)(\.[0-9]{1,2})?$/.test(String(value)) && Number(value) > 0 && Number(value) <= 10000
},
// 选择出院时间
showLeaveHospitalTimePickerClick() {
if (this.formData.leaveHospitalTime) {
@@ -158,19 +158,44 @@
}
.condolence-info-long-cell {
display: flex;
align-items: flex-start;
}
.condolence-info-card .condolence-attachments .empty-container {
height: auto;
justify-content: flex-start;
color: inherit;
}
.condolence-info-card .condolence-attachments .empty-text {
font-size: inherit;
line-height: inherit;
}
.condolence-info-opinion > :first-child {
margin-top: 0;
}
.condolence-info-opinion > :last-child {
margin-bottom: 0;
}
.condolence-signature-image,
.condolence-approval-signature-image {
display: block;
}
.condolence-info-long-cell .van-cell__title {
width: auto;
width: 100%;
max-width: 100%;
height: 80px;
}
.condolence-info-long-cell .van-cell__value {
margin-top: 7px;
.condolence-signature-image .van-image__img,
.condolence-approval-signature-image {
object-fit: contain;
object-position: left center;
}
.condolence-signature-image {
display: block;
.condolence-info-opinion img {
max-width: 100%;
height: auto;
}
@@ -25,13 +25,13 @@ const condolenceInfo = {
<van-cell title="申请人单位">{{ viewData.applyUnitName || '--' }}</van-cell>
<van-cell title="申请人工会">{{ viewData.applyUnionName || '--' }}</van-cell>
<van-cell title="慰问对象">{{ viewData.helpUserName || '--' }}</van-cell>
<van-cell title="证明人">{{ viewData.certifierUserName || '--' }}</van-cell>
<!-- <van-cell title="证明人">{{ viewData.certifierUserName || '--' }}</van-cell> -->
<van-cell title="慰问类型">{{ viewData.typeName || '--' }}</van-cell>
<van-cell title="慰问金额">{{ viewData.money || '--' }}</van-cell>
<van-cell title="慰问时间">{{ viewData.occurTime || '--' }}</van-cell>
<van-cell title="收款账户">{{ viewData.bankCardNumber || '--' }}</van-cell>
<van-cell title="户名">{{ viewData.bankUserName || '--' }}</van-cell>
<van-cell class="condolence-info-long-cell" title="开户行">
<van-cell title="开户行">
{{ viewData.bankOfDeposit || '暂无' }}
</van-cell>
<template v-if="['2'].includes(viewData.typeCode)">
@@ -39,17 +39,18 @@ const condolenceInfo = {
<van-cell title="出院时间">{{ viewData.leaveHospitalTime || '--' }}</van-cell>
<van-cell title="当年第几次住院(次)">{{ viewData.thisYearHospitalizationNum || '--' }}</van-cell>
</template>
<van-cell class="condolence-info-long-cell" title="申请事由">
<van-cell title="申请事由">
{{ viewData.remark || '暂无' }}
</van-cell>
<van-cell class="condolence-info-long-cell" title="附件">
<file-preview :files="viewData.files" complete_result></file-preview>
<file-preview class="condolence-attachments" :files="viewData.files" complete_result></file-preview>
</van-cell>
<van-cell class="condolence-info-long-cell" title="签字">
<van-image
v-if="viewData.signature"
:src="viewData.signature"
class="condolence-signature-image"
fit="contain"
></van-image>
<span v-else>暂无签字</span>
</van-cell>
@@ -85,8 +86,11 @@ const condolenceInfo = {
:value="task.ext && task.ext.submitType"
></dict-tag>
</van-cell>
<van-cell class="condolence-info-long-cell" title="办理意见">
<div v-html="task.taskFormData && task.taskFormData.tf_opinion || '暂无'"></div>
<van-cell v-if="task.taskFormData && task.taskFormData.sign" title="审批签字">
<img :src="task.taskFormData.sign" class="condolence-approval-signature-image">
</van-cell>
<van-cell title="办理意见">
<div class="condolence-info-opinion" v-html="task.taskFormData && task.taskFormData.tf_opinion || '暂无'"></div>
</van-cell>
</van-cell-group>
</section>
@@ -94,6 +94,22 @@ layout("/layouts/platform_h5.html"){
color: #f06464;
}
.difficult-help-apply-form .difficult-help-apply-mode {
flex-wrap: nowrap;
gap: 8px;
}
.difficult-help-apply-form .difficult-help-apply-mode .van-radio {
flex-shrink: 0;
margin-right: 0;
}
.difficult-help-apply-form .difficult-help-apply-mode .van-radio__label {
margin-left: 4px;
font-size: 12px;
white-space: nowrap;
}
.difficult-help-apply-actions {
position: fixed;
z-index: 100;
@@ -308,10 +324,10 @@ layout("/layouts/platform_h5.html"){
required name="proxyLoginName"></van-field>
<van-field label="申请模式" name="mode" required :rules="[{ required: true }]">
<template #input>
<van-radio-group v-model="formData.mode" @change="modeChange" direction="horizontal">
<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('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')"
v-if="canApplyForOthers"
name="2" shape="square">替他人申请
</van-radio>
</van-radio-group>
@@ -707,11 +723,16 @@ layout("/layouts/platform_h5.html"){
return false;
}
},
computed: {
canApplyForOthers() {
return this.$auth.hasRoleOr('SYSADMIN, SCHOOL_UNION_ADMIN, BRANCH_UNION_CHAIRMAN, BRANCH_UNION_OPERATOR')
}
},
methods: {
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", [])
@@ -975,7 +996,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()
@@ -1024,6 +1045,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)
@@ -1088,6 +1110,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)
@@ -167,11 +167,11 @@
}
.difficult-help-info-card .van-cell__title {
width: 112px;
width: 102px;
color: #596779;
font-size: 12px;
line-height: 24px;
flex: 0 0 112px;
flex: 0 0 102px;
}
.difficult-help-info-card .van-cell__value {
@@ -184,16 +184,8 @@
}
.difficult-help-info-long-cell {
display: block;
}
.difficult-help-info-long-cell .van-cell__title {
width: auto;
max-width: 100%;
}
.difficult-help-info-long-cell .van-cell__value {
margin-top: 7px;
display: flex;
align-items: flex-start;
}
.difficult-help-info-pre-line {
@@ -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
@@ -388,16 +388,16 @@ layout("/layouts/platform_h5.html"){
<van-icon name="eye-o"></van-icon>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskKey === 'startTask' || !row.instanceId"
<div class="action-btn" v-if="row.createdBy === $store.state.user.id && (row.taskKey === 'startTask' || !row.instanceId)"
@click="onEdit(row)">
<van-icon name="edit"></van-icon>
<span>编辑</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
<div class="action-btn delete" v-if="row.createdBy === $store.state.user.id && row.canRevoke" @click="onRevoke(row)">
<van-icon name="revoke"></van-icon>
<span>撤回</span>
</div>
<div class="action-btn delete" v-if="row.taskKey === 'startTask' || !row.instanceId"
<div class="action-btn delete" v-if="row.createdBy === $store.state.user.id && (row.taskKey === 'startTask' || !row.instanceId)"
@click="onDelete(row.id)">
<van-icon name="delete-o"></van-icon>
<span>删除</span>