bug修改

This commit is contained in:
=
2025-10-10 08:59:32 +08:00
parent 761ade5916
commit dc55b0701d
25 changed files with 323 additions and 128 deletions
@@ -32,6 +32,7 @@ import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
@IocBean
@@ -80,7 +81,7 @@ public class CadreTrainingSignUpController {
@ApiOperation("提交申请")
@SaCheckPermission(value = {"cadreTraining.branchUnionSignUp", "h5.cadreTraining.branchUnionSignUp"}, mode = SaMode.OR)
public Result submit(@Param("data") CadreTrainingSignUp cadreTrainingSignUp) {
if (StrUtil.isBlank(cadreTrainingSignUp.getId())) cadreTrainingSignUp.setApplyTime(DateUtil.now());
if (StrUtil.isBlank(cadreTrainingSignUp.getId())) cadreTrainingSignUp.setApplyTime(new Date());
dao.insertOrUpdate(cadreTrainingSignUp);
// 开启流程实例
@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
import java.util.List;
@Data
@@ -80,8 +81,8 @@ public class CadreTrainingSignUp extends BaseModel {
@Column
@Comment("报名时间")
@ColDefine(type = ColType.VARCHAR, width = 100)
private String applyTime;
@ColDefine(type = ColType.DATETIME)
private Date applyTime;
@Column
@Comment("备注")
@@ -84,7 +84,7 @@ public class UnionReimburseApplyController {
@SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR)
@SLog(type = "unionReimburse", tag = "工会报销-报销申请", msg = "保存报销申请")
public Result save(@Param("data") UnionReimburse unionReimburse) {
if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(DateUtil.now());
if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date());
dao.insertOrUpdate(unionReimburse);
return Result.success();
}
@@ -93,7 +93,7 @@ public class UnionReimburseApplyController {
@ApiOperation("提交申请")
@SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR)
public Result submit(@Param("data") UnionReimburse unionReimburse) {
if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(DateUtil.now());
if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date());
dao.insertOrUpdate(unionReimburse);
// 开启流程实例
@@ -115,7 +115,7 @@ public class UnionReimburseApplyController {
@Aop(TransAop.READ_COMMITTED)
@SaCheckPermission(value = {"unionReimburse.apply", "h5.unionReimburse.apply"}, mode = SaMode.OR)
public Result submitAgain(@Param("data") UnionReimburse unionReimburse, @Param("taskId") Long taskId) {
if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(DateUtil.now());
if (StrUtil.isBlank(unionReimburse.getId())) unionReimburse.setCreateTime(new Date());
dao.insertOrUpdate(unionReimburse);
@@ -50,7 +50,7 @@ public class UnionReimburseFundSourceInterceptor implements FlowInterceptor {
detail.setAdjustReason(unionReimburse.getReimburseProject());
detail.setProjectName(unionReimburse.getActivityName());
detail.setActivityNumber(unionReimburse.getActivityNumber());
detail.setActivityTime(unionReimburse.getCreateTime());
detail.setActivityTime(String.valueOf(unionReimburse.getCreateTime()));
detail.setOutlayManageId(outlayManageSchool.getId());
dao.insert(detail);
@@ -74,7 +74,7 @@ public class UnionReimburseFundSourceInterceptor implements FlowInterceptor {
detail.setAdjustReason(unionReimburse.getReimburseProject());
detail.setProjectName(unionReimburse.getActivityName());
detail.setActivityNumber(unionReimburse.getActivityNumber());
detail.setActivityTime(unionReimburse.getCreateTime());
detail.setActivityTime(String.valueOf(unionReimburse.getCreateTime()));
detail.setOutlayManageId(outlayManageUnion.getId());
dao.insert(detail);
@@ -98,7 +98,7 @@ public class UnionReimburseFundSourceInterceptor implements FlowInterceptor {
detail.setAdjustReason(unionReimburse.getReimburseProject());
detail.setProjectName(unionReimburse.getActivityName());
detail.setActivityNumber(unionReimburse.getActivityNumber());
detail.setActivityTime(unionReimburse.getCreateTime());
detail.setActivityTime(String.valueOf(unionReimburse.getCreateTime()));
detail.setOutlayManageId(outlayManageClub.getId());
dao.insert(detail);
@@ -172,7 +172,7 @@ public class UnionReimburse extends BaseModel {
@Column
@Comment("慰问时间")
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATETIME)
private Date condolenceTime;
@@ -198,7 +198,7 @@ public class UnionReimburse extends BaseModel {
@Column
@Comment("活动时间")
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATETIME)
private Date activityTime;
@Column
@@ -222,7 +222,7 @@ public class UnionReimburse extends BaseModel {
@Column
@Comment("申请时间")
@ColDefine(type = ColType.VARCHAR, width = 30)
private String createTime;
@ColDefine(type = ColType.DATETIME)
private Date createTime;
}
@@ -6,6 +6,7 @@ import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
import java.util.Date;
@@ -24,11 +25,10 @@ import java.util.List;
@Comment("独生子女父母退休")
public class Dsznfmtx extends BaseModel implements Serializable {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
@PrevInsert(uu32 = true)
private String id;
@Column
@@ -47,7 +47,7 @@ public class Dsznfmtx extends BaseModel implements Serializable {
private String sex;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("出生年月")
private Date birthday;
@@ -77,7 +77,7 @@ public class Dsznfmtx extends BaseModel implements Serializable {
private String unitName;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("退休时间")
private Date retireTime;
@@ -97,17 +97,17 @@ public class Dsznfmtx extends BaseModel implements Serializable {
private String loverUnitName;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("结婚日期")
private Date marryTime;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("子女出生日期")
private Date childrenBirthday;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("领独生子女证时间")
private Date getCertificateTime;
@@ -117,7 +117,7 @@ public class Dsznfmtx extends BaseModel implements Serializable {
private String bonus;
@Column
@ColDefine(type = ColType.DATETIME,width = 50)
@ColDefine(type = ColType.DATETIME)
@Comment("申请时间")
private Date applyTime;
@@ -1,9 +1,11 @@
package com.budwk.app.zhgh.staffbenefit.maternityLeave.models;
import com.aspose.slides.internal.og.all;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
import java.util.Date;
@@ -21,11 +23,10 @@ import java.util.Date;
@Comment("生育休假")
public class MaternityLeave extends BaseModel implements Serializable {
@Column
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
@PrevInsert(uu32 = true)
private String id;
@Column
@@ -49,7 +50,7 @@ public class MaternityLeave extends BaseModel implements Serializable {
private String nation;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("出生年月")
private Date birthday;
@@ -99,7 +100,7 @@ public class MaternityLeave extends BaseModel implements Serializable {
private String loverNation;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("出生年月")
private Date loverBirthday;
@@ -154,22 +155,22 @@ public class MaternityLeave extends BaseModel implements Serializable {
private String leaveDays;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("子女出生日期")
private Date childrenBirthday;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("休假开始时间")
private Date startTime;
@Column
@ColDefine(type = ColType.DATETIME, width = 30)
@ColDefine(type = ColType.DATE)
@Comment("休假结束时间")
private Date endTime;
@Column
@ColDefine(type = ColType.VARCHAR,width = 50)
@ColDefine(type = ColType.DATETIME)
@Comment("填写时间")
private Date applyTime;
@@ -140,7 +140,7 @@ public class MutualInsuranceUserInfo extends BaseModel implements Serializable {
@Column
@Comment("出险时间")
@ColDefine(type = ColType.DATE)
@ColDefine(type = ColType.DATETIME)
private Date dangerTime;
@Column
@@ -29,6 +29,8 @@ import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.Param;
import java.util.Date;
@IocBean
@At("/platform/childManage/write")
@Ok("json:full")
@@ -58,7 +60,7 @@ public class ChildManageWriteController {
@SaCheckPermission(value = {"childManage.write", "h5.childManage.write"}, mode = SaMode.OR)
@SLog(tag = "子女信息管理-信息填写", msg = "保存子女信息")
public Result save(@Param("data") ChildManage childManage) {
if(StrUtil.isBlank(childManage.getId())) childManage.setApplyTime(DateUtil.now());
if(StrUtil.isBlank(childManage.getId())) childManage.setApplyTime(new Date());
dao.insertOrUpdate(childManage);
return Result.success();
}
@@ -6,8 +6,10 @@ import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@@ -31,7 +33,7 @@ public class ChildManage extends BaseModel implements Serializable {
@Name
@Comment("id")
@ColDefine(type = ColType.VARCHAR, width = 32)
@Prev(els = {@EL("uuid()")})
@PrevInsert(uu32 = true)
private String id;
@@ -137,9 +139,9 @@ public class ChildManage extends BaseModel implements Serializable {
private String childrenIdCard;
@Column
@ColDefine(type = ColType.VARCHAR,width = 30)
@ColDefine(type = ColType.DATE)
@Comment("出身年月")
private String childrenBirthday;
private Date childrenBirthday;
@Column
@ColDefine(type = ColType.VARCHAR,width = 30)
@@ -178,9 +180,9 @@ public class ChildManage extends BaseModel implements Serializable {
private String note;
@Column
@ColDefine(type = ColType.VARCHAR,width = 50)
@ColDefine(type = ColType.DATETIME)
@Comment("填写时间")
private String applyTime;
private Date applyTime;
}
@@ -252,9 +252,9 @@ layout("/layouts/platform.html"){
reimburseProject: [{required: true, message: '请选择报销项目', trigger: ["change", "blur"]}],
reimburseFundSource: [{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"]},{ pattern: /^([1-9]{1})(\d{15}|\d{18})$/, message: '请输入正确的银行卡号', trigger: 'blur' }],
bankOfDeposit: [{required: true, message: '请填写开户行', trigger: ["change", "blur"]}],
condolencePeopleMobile: [{required: true, message: '请填写联系方式', trigger: ["change", "blur"]}],
condolenceMobile: [{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }],
condolenceTime: [{required: true, message: '请选择慰问时间', trigger: ["change", "blur"]}],
invoiceNumber: [{required: true, message: '请填写发票张数', trigger: ["change", "blur"]}],
invoice: [{required: true, message: '请填写发票号码', trigger: ["change", "blur"]}],
@@ -547,9 +547,6 @@ layout("/layouts/platform.html"){
id: this.formData.condolenceId,
userName: this.formData.condolenceName,
mobile: this.formData.condolenceMobile || '',
loginName: this.formData.condolenceLoginName || '',
unitName: this.formData.condolenceUnitName || '',
sex: this.formData.condolenceSex || ''
});
}
}
@@ -40,13 +40,13 @@ const unionReimburseInfo = {
<el-descriptions-item label="联系方式" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{viewData.condolenceMobile}}</el-descriptions-item>
<el-descriptions-item label="慰问类型" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{viewData.typeName}}</el-descriptions-item>
<el-descriptions-item label="慰问金额" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{viewData.money}}</el-descriptions-item>
<el-descriptions-item label="慰问时间" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{viewData.condolenceTime}}</el-descriptions-item>
<el-descriptions-item label="慰问时间" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{formatDate(viewData.condolenceTime)}}</el-descriptions-item>
<el-descriptions-item label="活动名称" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{viewData.activityName}}</el-descriptions-item>
<el-descriptions-item label="活动类型" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">{{viewData.activityType}}</el-descriptions-item>
<el-descriptions-item label="活动人数" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">{{viewData.activityNumber}}</el-descriptions-item>
<el-descriptions-item label="活动地点" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{viewData.activityPlace}}</el-descriptions-item>
<el-descriptions-item label="报销金额" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{viewData.money}}</el-descriptions-item>
<el-descriptions-item label="活动时间" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{viewData.activityTime}}</el-descriptions-item>
<el-descriptions-item label="活动时间" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{formatDate(viewData.activityTime)}}</el-descriptions-item>
<el-descriptions-item label="发票张数" v-if="viewData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">{{viewData.invoiceNumber}}</el-descriptions-item>
<el-descriptions-item label="发票号码" v-if="viewData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">{{viewData.invoice}}</el-descriptions-item>
<el-descriptions-item label="支付内容" :span="2">{{viewData.paymentNotes}}</el-descriptions-item>
@@ -110,6 +110,31 @@ const unionReimburseInfo = {
this.getInfo()
this.getDoneTasks()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 获取申请信息
getInfo() {
@@ -244,6 +244,26 @@ layout("/layouts/platform.html"){
});
});
},
// 添加检查用户状态的方法
async checkUserStatus() {
// 检查是否为退休人员
const isRetired = await this.checkRetirementStatus();
if (!isRetired) {
this.$message.warning('您不是退休人员,无法申请此项福利');
return false;
}
// 如果不是编辑状态,检查是否已申请过
if (!this.bizId) {
const isApplied = await this.checkUserApplication();
if (isApplied) {
this.$message.warning('您已经提交过申请,不能重复申请');
return false;
}
}
return true; // 返回 true 表示检查通过
},
// 添加检查是否为退休人员的方法
async checkRetirementStatus() {
try {
@@ -274,20 +294,10 @@ layout("/layouts/platform.html"){
},
// 提交
async onSubmit() {
// 检查是否为退休人员
const isRetired = await this.checkRetirementStatus();
if (!isRetired) {
this.$message.warning('您不是退休人员,无法申请此项福利');
return;
}
// 检查用户状态,如果检查失败则直接返回
const statusCheckPassed = await this.checkUserStatus();
if (!statusCheckPassed) return;
if (!this.bizId) {
const isApplied = await this.checkUserApplication();
if (isApplied) {
this.$message.warning('您已经提交过申请,不能重复申请');
return;
}
}
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
@@ -356,7 +366,8 @@ layout("/layouts/platform.html"){
}
},
created() {
this.init()
this.init();
this.checkUserStatus();
}
})
</script>
@@ -12,7 +12,6 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="职工姓名">{{formData.userName}}</el-descriptions-item>
<el-descriptions-item label="性别">{{formData.sex}}</el-descriptions-item>
<el-descriptions-item label="民族">{{formData.nation}}</el-descriptions-item>
<!-- 修改出生年月的显示方式 -->
<el-descriptions-item label="出生年月">{{formatDate(formData.birthday)}}</el-descriptions-item>
<el-descriptions-item label="工作单位" >{{formData.unitName}}</el-descriptions-item>
<el-descriptions-item label="电话" >{{formData.mobile}}</el-descriptions-item>
@@ -32,23 +31,19 @@ layout("/layouts/platform.html"){
</el-descriptions-item>
<el-descriptions-item label="民族">
<el-form-item label="民族" prop="loverNation">
<el-select clearable placeholder="请选择民族"
style="width: 100%;"
v-model="formData.loverNation">
<el-option :label="item.name" :value="item.code"
v-for="item in dict.type.USER_NATION"></el-option>
</el-select>
<dict-select v-model="formData.loverNation" code="USER_NATION" style="width: 100%" placeholder="请选择民族">
</dict-select>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="出生年月" >
<el-form-item label="出生年月" prop="loverBirthday">
<el-date-picker type="date"
v-model="formData.loverBirthday"
placeholder="请选择"
clearable
style="width: 100%"
value-format="yyyy-MM-dd"
></el-date-picker>
<el-form-item prop="loverBirthday">
<el-date-picker
v-model="formData.loverBirthday"
type="date"
placeholder="请选择出生年月"
style="width: 100%;"
value-format="yyyy-MM-dd">
</el-date-picker>
</el-form-item>
</el-descriptions-item>
<el-descriptions-item label="工作单位" span="2">
@@ -167,7 +162,6 @@ layout("/layouts/platform.html"){
new Vue({
el: '#app',
store,
dicts: ["USER_NATION"],
data() {
return {
bizId: GetQueryString("bizId"),
@@ -180,9 +174,26 @@ layout("/layouts/platform.html"){
loverBirthday: [{ required: true, message: '请选择爱人出生年月', trigger: 'change' }],
loverUnitName: [{ required: true, message: '请输入爱人工作单位', trigger: 'blur' }],
startTime: [{ required: true, message: '请选择休假开始时间', trigger: 'change' }],
endTime: [{ required: true, message: '请选择休假结束时间', trigger: 'change' }],
endTime: [{ required: true, message: '请选择休假结束时间', trigger: 'change' },
{validator: (rule, value, callback) => {
if (this.formData.startTime && value) {
const startDate = new Date(this.formData.startTime);
const endDate = new Date(value);
if (endDate < startDate) {
callback(new Error('休假结束时间不能早于开始时间'));
} else {
callback();
}
} else {
callback();
}
},
trigger: 'change'
}
],
childrenBirthday: [{ required: true, message: '请选择子女出生日期', trigger: 'change' }]
},
}
,
}
},
computed: {
@@ -284,13 +295,13 @@ layout("/layouts/platform.html"){
const year = endDate.getFullYear();
const month = String(endDate.getMonth() + 1).padStart(2, '0');
const day = String(endDate.getDate()).padStart(2, '0');
// 使用字符串拼接代替模板字符串,避免与Beetl冲突
this.$set(this.formData, 'endTime', year + '-' + month + '-' + day);
}
}
},
// 保存
onSave() {
console.log(this.formData);
this.$confirm("您确定保存吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -384,8 +395,6 @@ layout("/layouts/platform.html"){
birthday: birthday,
mobile:mobile
}
console.log('FormData birthday:', this.formData.birthday);
// 根据性别设置默认值
if (this.isMale) {
// 男性默认设置
@@ -99,6 +99,14 @@ const maternityLeaveInfo = {
}
},
methods: {
// 打开
onOpen(row) {
this.row = row
this.visible = true
this.getInfo()
this.getDoneTasks()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
@@ -124,13 +132,6 @@ const maternityLeaveInfo = {
return date;
}
},
// 打开
onOpen(row) {
this.row = row
this.visible = true
this.getInfo()
this.getDoneTasks()
},
// 获取申请信息
getInfo() {
@@ -105,7 +105,7 @@ layout("/layouts/platform.html"){
<el-col :span="12">
<el-form-item prop="age" label="年龄">
<el-input v-model="formData.age" placeholder="请输入年龄"></el-input>
<el-input v-model="formData.age" placeholder="请输入年龄" type="number"></el-input>
</el-form-item>
</el-col>
@@ -192,7 +192,7 @@ layout("/layouts/platform.html"){
<el-col :span="12">
<el-form-item prop="bankCardNumber" label="银行卡账号">
<el-input v-model="formData.bankCardNumber" placeholder="请输入银行卡账号"></el-input>
<el-input v-model="formData.bankCardNumber" placeholder="请输入银行卡账号" type="number"></el-input>
</el-form-item>
</el-col>
@@ -250,10 +250,10 @@ layout("/layouts/platform.html"){
unitName: [{ required: true, message: '请填写所属单位', trigger: 'blur' }],
unionName: [{ required: true, message: '请填写所属工会', trigger: 'blur' }],
sex: [{ required: true, message: '请填写性别', trigger: 'blur' }],
mobile: [{ required: true, message: '请填写手机号', trigger: 'blur' }],
idCard: [{ required: true, message: '请填写身份证号', trigger: 'blur' }],
medicalInsuranceState: [{ required: true, message: '请选择医保状态', trigger: 'change' }],
insuranceUserState: [{ required: true, message: '请选择在职状态', trigger: 'change' }],
mobile: [{ required: true, message: '请填写手机号', trigger: 'blur' },{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }],
idCard: [{ required: true, message: '请填写身份证号', trigger: 'blur' }, {pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '请输入正确的身份证号码', trigger: 'blur'}],
age: [{ required: true, message: '请输入年龄', trigger: 'blur' }, { type: 'number', min: 16, max: 60, message: '年龄必须在16-60岁之间', trigger: 'blur', transform: (value) => Number(value) }],
bankCardNumber: [ { pattern: /^([1-9]{1})(\d{15}|\d{18})$/, message: '请输入正确的银行卡号', trigger: 'blur' }],
sign: [{ required: true, message: '请签字', trigger: 'change' }]
},
projectList: [],
@@ -13,7 +13,7 @@ const childManageInfo = {
<el-descriptions-item label="入学年份">{{viewData.childrenYear}}</el-descriptions-item>
<el-descriptions-item label="姓名">{{viewData.childrenName}}</el-descriptions-item>
<el-descriptions-item label="身份证号">{{viewData.childrenIdCard}}</el-descriptions-item>
<el-descriptions-item label="出生日期">{{viewData.childrenBirthday}}</el-descriptions-item>
<el-descriptions-item label="出生日期">{{formatDate(viewData.childrenBirthday)}}</el-descriptions-item>
<el-descriptions-item label="性别">{{viewData.childrenSex}}</el-descriptions-item>
<el-descriptions-item label="国籍">{{viewData.childrenCountry}}</el-descriptions-item>
<el-descriptions-item label="就读学校">{{viewData.childrenCurrentSchool}}</el-descriptions-item>
@@ -45,6 +45,31 @@ const childManageInfo = {
this.row = row
this.getInfo()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 获取申请信息
getInfo() {
this.$axios.post('/platform/childManage/write/findOne', {id: this.row.id}).then((res) => {
@@ -123,7 +123,7 @@ layout("/layouts/platform.html"){
new Vue({
el: "#app",
store,
dicts: ["CHILD_MANAGE_GRADE", "CHILD_MANAGE_GRADE"],
dicts: ["CHILD_MANAGE_GRADE"],
mixins: [initTableMixins],
components: {
"child-manage-info": childManageInfo
@@ -11,12 +11,8 @@ layout("/layouts/platform.html"){
<el-descriptions :column="2" border>
<el-descriptions-item label="就读年级">
<el-form-item prop="childRelationship">
<el-select clearable placeholder="请选择就读年级"
style="width: 100%;"
v-model="formData.childrenGrade">
<el-option :label="item.name" :value="item.code"
v-for="item in dict.type.CHILD_MANAGE_GRADE"></el-option>
</el-select>
<dict-select v-model="formData.childRelationship" code="CHILD_MANAGE_GRADE" style="width: 100%" placeholder="请选择就读年级">
</dict-select>
</el-form-item></el-descriptions-item>
<el-descriptions-item label="入学年份">
<el-form-item prop="childrenBirthday">
@@ -72,7 +68,7 @@ layout("/layouts/platform.html"){
<el-descriptions-item label="中考总成绩">
<el-form-item prop="childrenMiddleScore">
<el-input v-model="formData.childrenMiddleScore" placeholder="请输入中考总成绩"
maxlength="30"></el-input>
maxlength="30" type="number"></el-input>
</el-form-item></el-descriptions-item></el-descriptions-item>
<el-descriptions-item label="学科组合">
<el-form-item prop="childrenSubjectCombination">
@@ -181,15 +177,22 @@ layout("/layouts/platform.html"){
new Vue({
el: '#app',
store,
dicts: ["CHILD_MANAGE_GRADE"],
data() {
return {
bizId: GetQueryString("bizId"),
formData: {},
userOptions: [],
userOptions2: [], // 添加母亲的用户选项
userOptions2: [],
formRules: {
},
childRelationship: [{ required: true, message: '请选择就读年级', trigger: 'change' }],
childrenYear: [{ required: true, message: '请选择入学年份', trigger: 'change' }],
childrenName: [{ required: true, message: '请输入子女姓名', trigger: 'blur' }],
childrenIdCard: [{ required: true, message: '请输入子女身份证号', trigger: 'blur' }, {pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '请输入正确的身份证号码', trigger: 'blur'}],
childrenBirthday: [{ required: true, message: '请选择子女出生日期', trigger: 'change' }],
childrenSex: [{ required: true, message: '请选择性别', trigger: 'change' }],
guardianMobile1: [{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }],
guardianMobile2: [{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码', trigger: 'blur' }]
}
}
},
methods: {
@@ -589,6 +589,15 @@ layout("/layouts/platform_h5.html"){
return false;
}
// 银行卡号格式验证
if (this.formData.bankCardNumber) {
const bankCardRegex = /^([1-9]{1})(\d{15}|\d{18})$/;
if (!bankCardRegex.test(this.formData.bankCardNumber)) {
this.$toast.fail("请输入正确的银行卡号");
return false;
}
}
if (!this.formData.bankOfDeposit) {
this.$toast.fail("请填写开户行");
return false;
@@ -604,6 +613,14 @@ layout("/layouts/platform_h5.html"){
this.$toast.fail("请填写慰问对象联系方式");
return false;
}
// 慰问对象手机号验证
if (this.formData.condolenceMobile) {
const mobileRegex = /^1[3-9]\d{9}$/;
if (!mobileRegex.test(this.formData.condolenceMobile)) {
this.$toast.fail("请输入正确的慰问对象手机号码");
return false;
}
}
if (!this.formData.condolenceType) {
this.$toast.fail("请选择慰问类型");
return false;
@@ -34,13 +34,13 @@ const UNION_REIMBURSE_INFO = {
<van-cell title="联系方式" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.condolenceMobile }}</van-cell>
<van-cell title="慰问类型" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.typeName }}</van-cell>
<van-cell title="慰问金额" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.money }}</van-cell>
<van-cell title="慰问时间" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.condolenceTime }}</van-cell>
<van-cell title="慰问时间" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_1'">{{ formatDate(viewData.condolenceTime) }}</van-cell>
<van-cell title="活动名称" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.activityName }}</van-cell>
<van-cell title="活动类型" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">{{ viewData.activityType }}</van-cell>
<van-cell title="活动人数" v-if="viewData.reimburseProject === 'UNION_REIMBURSE_PROJECT_2'">{{ viewData.activityNumber }}</van-cell>
<van-cell title="活动地点" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.activityPlace }}</van-cell>
<van-cell title="报销金额" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.money }}</van-cell>
<van-cell title="活动时间" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{ viewData.activityTime }}</van-cell>
<van-cell title="活动时间" v-if="viewData.reimburseProject !== 'UNION_REIMBURSE_PROJECT_1'">{{ formatDate(viewData.activityTime) }}</van-cell>
<van-cell title="发票张数" v-if="viewData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">{{ viewData.invoiceNumber }}</van-cell>
<van-cell title="发票号码" v-if="viewData.reimburseType === 'UNION_REIMBURSE_TYPE_1'">{{ viewData.invoice }}</van-cell>
<van-cell title="支付内容">{{ viewData.paymentNotes }}</van-cell>
@@ -111,6 +111,31 @@ const UNION_REIMBURSE_INFO = {
this.getInfo()
this.getDoneTasks()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 关闭
onClose(){
this.visible = false
@@ -267,9 +267,9 @@ layout("/layouts/platform_h5.html"){
if (!this.formData.retireFiles || this.formData.retireFiles.length === 0) {
errors.push('请上传退休证');
}
if (!this.formData.sign) {
errors.push('请签字');
}
// if (!this.formData.sign) {
// errors.push('请签字');
// }
if (!this.formData.declarationAgreed) {
errors.push('请阅读并同意声明');
}
@@ -407,7 +407,22 @@ layout("/layouts/platform_h5.html"){
},
async created() {
await this.init();
// 页面初始化完成后立即检查退休状态和申请状态
const isRetired = await this.checkRetirementStatus();
if (!isRetired) {
this.$toast.fail('您不是退休人员,无法申请此项福利');
return false;
}
if (!this.bizId) { // 如果不是编辑已有记录,则检查是否已申请
const isApplied = await this.checkUserApplication();
if (isApplied) {
this.$toast.fail('您已经提交过申请,不能重复申请');
}
}
}
})
</script>
@@ -416,6 +416,14 @@ layout("/layouts/platform_h5.html"){
if (!this.formData.childrenBirthday) {
errors.push('请选择子女出生日期');
}
// 添加时间顺序验证
if (this.formData.startTime && this.formData.endTime) {
const startDate = new Date(this.formData.startTime);
const endDate = new Date(this.formData.endTime);
if (endDate < startDate) {
errors.push('休假结束时间不能早于开始时间');
}
}
return errors;
},
@@ -11,7 +11,7 @@
</dict-tag></van-cell>
<van-cell title="入学年份">{{ viewData.childrenYear }}</van-cell>
<van-cell title="身份证号">{{ viewData.childrenIdCard }}</van-cell>
<van-cell title="出生日期">{{ viewData.childrenBirthday }}</van-cell>
<van-cell title="出生日期">{{ formatDate(viewData.childrenBirthday) }}</van-cell>
<van-cell title="性别">{{ viewData.childrenSex }}</van-cell>
<van-cell title="国籍">{{ viewData.childrenCountry }}</van-cell>
<van-cell title="就读学校">{{ viewData.childrenCurrentSchool }}</van-cell>
@@ -50,6 +50,31 @@
this.visible = true
this.getInfo()
},
// 添加日期格式化方法
formatDate(date) {
if (!date) return '';
// 如果已经是 yyyy-MM-dd 格式,直接返回
if (typeof date === 'string' && /^\d{4}-\d{2}-\d{2}/.test(date)) {
// 如果包含时间,只取日期部分
if (date.length > 10) {
return date.substring(0, 10);
}
return date;
}
// 否则转换为 yyyy-MM-dd 格式
try {
const d = new Date(date);
if (isNaN(d.getTime())) {
return date;
}
const year = d.getFullYear();
const month = String(d.getMonth() + 1).padStart(2, '0');
const day = String(d.getDate()).padStart(2, '0');
return year + '-' + month + '-' + day;
} catch (e) {
return date;
}
},
// 关闭
onClose(){
this.visible = false
@@ -46,8 +46,13 @@ layout("/layouts/platform_h5.html"){
show-toolbar
></van-picker>
</van-popup>
<van-field label="身份证号" v-model="formData.childrenIdCard" placeholder="请输入身份证号"></van-field>
<van-field
label="身份证号"
v-model="formData.childrenIdCard"
placeholder="请输入身份证号"
:rules="formRules.childrenIdCard"
required
></van-field> <van-field
label="出生年月"
v-model="formData.childrenBirthday"
placeholder="请选择出生年月"
@@ -96,16 +101,25 @@ layout("/layouts/platform_h5.html"){
<van-field label="监护人1" v-model="formData.guardianUserName1" readonly placeholder="读取信息中心数据"></van-field>
<van-field label="工号" v-model="formData.guardianLoginName1" readonly placeholder="读取信息中心数据"></van-field>
<van-field label="手机号码" v-model="formData.guardianMobile1" readonly placeholder="读取信息中心数据"></van-field>
<van-field
label="手机号码"
v-model="formData.guardianMobile1"
readonly
placeholder="读取信息中心数据"
:rules="formRules.guardianMobile1"
></van-field>
<van-field label="所在单位" v-model="formData.guardianUnitName1" readonly placeholder="读取信息中心数据"></van-field>
<van-field
label="监护人2"
v-model="formData.guardianUserName2"
placeholder="请输入监护人姓名"
></van-field>
<van-field label="工号" v-model="formData.guardianLoginName2" placeholder="没有则不填" ></van-field>
<van-field label="手机号码" v-model="formData.guardianMobile2" placeholder="请输入手机号码"></van-field>
<van-field
label="手机号码"
v-model="formData.guardianMobile2"
placeholder="请输入手机号码"
></van-field>
<van-field label="所在单位" v-model="formData.guardianUnitName2" placeholder="请输入所在单位"></van-field>
<van-field
label="备注"
@@ -190,28 +204,41 @@ layout("/layouts/platform_h5.html"){
currentDate: new Date(), // 添加这一行
minDate: new Date(1900, 0, 1),
maxDate: new Date(),
formRules: {
childrenIdCard: [
{ pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: '请输入正确的身份证号码' }
],
guardianMobile1: [
{ pattern: /^1[3-9]\d{9}$/, message: '请输入正确的手机号码' }
],
}
}
},
methods: {
onSave() {
this.$dialog.confirm({
title: "提示",
message: "您确定保存吗?"
}).then(() => {
// 创建提交数据的副本
const submitData = {...this.formData};
// 如果有年级代码值,则使用代码值提交
if (this.formData.childrenGradeCode) {
submitData.childrenGrade = this.formData.childrenGradeCode;
}
this.$axios.post("/platform/childManage/write/save", { data: JSON.stringify(submitData) }).then(res => {
if (res.code === 0) {
this.$toast(res.msg)
this.$pjaxReplace('/platform/childManage/mine/h5')
// 先进行表单验证
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: "提示",
message: "您确定保存吗?"
}).then(() => {
// 创建提交数据的副本
const submitData = {...this.formData};
// 如果有年级代码值,则使用代码值提交
if (this.formData.childrenGradeCode) {
submitData.childrenGrade = this.formData.childrenGradeCode;
}
this.$axios.post("/platform/childManage/write/save", { data: JSON.stringify(submitData) }).then(res => {
if (res.code === 0) {
this.$toast(res.msg)
this.$pjaxReplace('/platform/childManage/mine/h5')
}
})
})
})
}).catch(() => {
// 验证失败,Vant 会自动显示错误信息
});
},
onChildrenGradeConfirm(o) {
// 显示名称给用户看