From c3db9628fd1bd1c39086f4d2bcc291bb6cb4b69b Mon Sep 17 00:00:00 2001 From: Paidax Date: Tue, 23 Sep 2025 13:50:57 +0800 Subject: [PATCH 1/2] commit --- .../param/pageform/MemberApplyPageForm.java | 14 +++++----- .../param/pageform/MemberChangePageForm.java | 14 +++++----- .../components/plugins/sysDict/DictSelect.vue | 2 +- .../member/apply/common/commonQuery.js | 22 ++++++++++----- .../member/apply/submit/index.html | 4 +-- .../branch/verification/check/index.html | 2 +- .../member/change/common/commonQuery.js | 27 ++++++++++--------- .../member/change/common/memberChange.js | 4 +-- .../member/change/submit/form.html | 4 +-- .../member/change/submit/index.html | 4 +-- .../verification/check/schoolViewAndHandle.js | 2 +- .../verification/check/viewChangeTypeUser.js | 2 +- .../manage/verificationSetUserList.js | 2 +- .../manage/verificationShowSelectionUsers.js | 2 +- .../sourcechange/manage/index.html | 2 +- 15 files changed, 60 insertions(+), 47 deletions(-) diff --git a/src/main/java/com/budwk/app/zhgh/staffmanage/member/param/pageform/MemberApplyPageForm.java b/src/main/java/com/budwk/app/zhgh/staffmanage/member/param/pageform/MemberApplyPageForm.java index e1e8fd6f..9a70a625 100644 --- a/src/main/java/com/budwk/app/zhgh/staffmanage/member/param/pageform/MemberApplyPageForm.java +++ b/src/main/java/com/budwk/app/zhgh/staffmanage/member/param/pageform/MemberApplyPageForm.java @@ -7,6 +7,8 @@ import lombok.EqualsAndHashCode; import org.nutz.dao.Cnd; import org.nutz.dao.util.cri.SqlExpressionGroup; +import java.util.List; + /** * @version 1.0 * @Author zzr @@ -22,11 +24,11 @@ public class MemberApplyPageForm extends PageForm { private String unitId; - private String userState; + private List userStates; - private String personType; + private List personTypes; - private String preparedBy; + private List preparedBys; public static void buildSearch(Cnd cnd, MemberApplyPageForm pageForm) { if (cnd == null) { @@ -40,8 +42,8 @@ public class MemberApplyPageForm extends PageForm { } cnd.andEX("info.unionId","=",pageForm.getUnionId()); cnd.andEX("info.unitId","=",pageForm.getUnitId()); - cnd.andEX("info.userState","=",pageForm.getUserState()); - cnd.andEX("info.personType","=",pageForm.getPersonType()); - cnd.andEX("info.preparedBy","=",pageForm.getPreparedBy()); + cnd.andEX("info.userState","in",pageForm.getUserStates()); + cnd.andEX("info.personType","in",pageForm.getPersonTypes()); + cnd.andEX("info.preparedBy","in",pageForm.getPreparedBys()); } } diff --git a/src/main/java/com/budwk/app/zhgh/staffmanage/member/param/pageform/MemberChangePageForm.java b/src/main/java/com/budwk/app/zhgh/staffmanage/member/param/pageform/MemberChangePageForm.java index f6ae3c32..7e095f10 100644 --- a/src/main/java/com/budwk/app/zhgh/staffmanage/member/param/pageform/MemberChangePageForm.java +++ b/src/main/java/com/budwk/app/zhgh/staffmanage/member/param/pageform/MemberChangePageForm.java @@ -8,6 +8,8 @@ import lombok.EqualsAndHashCode; import org.nutz.dao.Cnd; import org.nutz.dao.util.cri.SqlExpressionGroup; +import java.util.List; + /** * @version 1.0 * @Author zzr @@ -29,15 +31,15 @@ public class MemberChangePageForm extends PageForm { // 在职状态 @ApiModelProperty("在职状态") - private String userState; + private List userStates; // 在职状态 @ApiModelProperty("编制类型") - private String preparedBy; + private List preparedBys; // 人员类型 @ApiModelProperty("人员类型") - private String personType; + private List personTypes; public void buildSearch(Cnd cnd, String prefix){ @@ -54,8 +56,8 @@ public class MemberChangePageForm extends PageForm { cnd.andEX(prefix + "unionId", "=", this.getUnionId()); cnd.andEX(prefix + "unitId", "=", this.getUnitId()); - cnd.andEX(prefix + "userState", "=", this.getUserState()); - cnd.andEX(prefix + "preparedBy", "=", this.getPreparedBy()); - cnd.andEX(prefix + "personType", "=", this.getPersonType()); + cnd.andEX(prefix + "userState", "in", this.getUserStates()); + cnd.andEX(prefix + "preparedBy", "in", this.getPreparedBys()); + cnd.andEX(prefix + "personType", "in", this.getPersonTypes()); } } diff --git a/src/main/resources/static/components/plugins/sysDict/DictSelect.vue b/src/main/resources/static/components/plugins/sysDict/DictSelect.vue index fbba3f2a..29d8c7e6 100644 --- a/src/main/resources/static/components/plugins/sysDict/DictSelect.vue +++ b/src/main/resources/static/components/plugins/sysDict/DictSelect.vue @@ -24,7 +24,7 @@ + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/collect/index.html b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/collect/index.html new file mode 100644 index 00000000..506b42b5 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/collect/index.html @@ -0,0 +1,176 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 导出 + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/common/info.js b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/common/info.js new file mode 100644 index 00000000..d6b48236 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/common/info.js @@ -0,0 +1,114 @@ +const cadreTrainingInfo = { + template: /*language=HTML*/ ` +
+
+ 报名信息 + 点击查看流程图 +
+ + + {{viewData.name}} + {{viewData.signUpStartTime}} + {{viewData.signUpEndTime}} + {{viewData.startTime}} + {{viewData.endTime}} +
+
+ + + {{viewData.userName}} + {{viewData.unionName}} + {{viewData.unitName}} + {{viewData.sex}} + {{viewData.mobile}} + {{viewData.remark}} + + + + + + +
+ `, + store, + dicts: ["PROCESS_TASK_SUBMIT_TYPE"], + data() { + return { + visible: false, + viewData: {}, + doneTasks: [], + row: null + } + }, + methods: { + // 打开 + onOpen(row) { + this.row = row + this.visible = true + this.getInfo() + this.getDoneTasks() + }, + + // 获取申请信息 + getInfo() { + this.viewData = { ...this.row }; + // this.$axios.post('/platform/cadreTraining/activity/get', {id: this.row.id}).then((res) => { + // if (res.code === 0) { + // this.viewData = res.data + // } + // }) + }, + + // 获取已办任务审批记录 + getDoneTasks() { + this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => { + if (res.code === 0) { + this.doneTasks = res.data + } + }) + }, + + // 查看流程图 + openChart(){ + this.$refs.snakerChartRef.onOpenFull(this.row.instanceProcessDefineId,this.row.instanceId) + } + + } + + +} diff --git a/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/mine/index.html b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/mine/index.html new file mode 100644 index 00000000..4b7babd9 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/mine/index.html @@ -0,0 +1,114 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/schoolAudit/index.html b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/schoolAudit/index.html new file mode 100644 index 00000000..03423b8b --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/schoolAudit/index.html @@ -0,0 +1,246 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 已审核 + 未审核 + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/signUp/index.html b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/signUp/index.html new file mode 100644 index 00000000..f785f9ce --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/signUp/index.html @@ -0,0 +1,135 @@ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/signUp/signForm.js b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/signUp/signForm.js new file mode 100644 index 00000000..39f0b380 --- /dev/null +++ b/src/main/resources/views/platform/zhgh/dayofficework/cadreTraining/signUp/signForm.js @@ -0,0 +1,226 @@ +const signForm = { + template: /*language=HTML*/ ` + +
+ +
+ + + {{ viewData.name }} + + + {{ viewData.signUpStartTime }} + + + {{ viewData.signUpEndTime }} + + + {{ viewData.startTime }} + + + {{ viewData.endTime }} + + + {{ quota }}人 / 剩余: {{ remainingQuota }}人 + + +
+
+
+ + +
个人报名信息
+ + + + + + + + + + + + + + 取消 + 确认报名 + +
+ `, + store, + data() { + return { + dialogVisible: false, + viewData: {}, + formData: {}, // 将 signUpData 改为 formData + id: null, + //表格用户(实际上只包含当前用户) + teamUsers: [], + quota: 0, // 报名名额限制 + signedUsers: [], // 已报名人员列表 + submitLoading: false, // 提交按钮加载状态 + isSignUp: false // 是否已报名 + } + }, + computed: { + remainingQuota() { + // 如果 quota 为 null 或 undefined,显示"不限" + if (this.quota == null) return "不限" + // 如果 quota 为具体数值(包括0),则计算剩余名额 + const remaining = Math.max(0, this.quota - this.signedUsers.length) + return remaining + }, + }, + methods: { + onOpen(row) { + this.row = row + this.dialogVisible = true + this.id = row.id; + }, + + handleDialogOpen() { + this.getActivityInfo() + this.getQuota(this.id) + this.loadUserData() + }, + + // 加载用户数据 + async loadUserData() { + try { + // 获取已报名人员 + const signedResponse = await this.$axios.post("/platform/cadreTraining/branchUnionSignUp/listSignUser", { activityId: this.id }) + if (signedResponse.code === 0) { + this.signedUsers = Array.isArray(signedResponse.data) ? signedResponse.data : [] + + // 检查当前用户是否已报名 + const currentUser = this.signedUsers.find(user => user.userId === this.$store.state.user.id) + this.isSignUp = !!currentUser + + // 显示当前用户信息 + if (currentUser) { + this.teamUsers = [currentUser] + } else { + // 如果当前用户未报名,显示当前用户信息用于报名 + this.teamUsers = [{ + userId: this.$store.state.user.id, + userName: this.$store.state.user.username, + loginName: this.$store.state.user.loginname, + unitId: this.$store.state.user?.unit?.id, + unitName: this.$store.state.user?.unit?.name, + unionId: this.$store.state.user?.union?.id, + unionName: this.$store.state.user?.union?.name, + sex: this.$store.state.user.sex, + mobile: this.$store.state.user.mobile, + remark: '' + }] + } + + // 初始化表单数据 + this.initFormData(); + } + } catch (error) { + this.$message.error("获取用户数据失败") + } + }, + + // 初始化表单数据 + initFormData() { + if (this.teamUsers.length > 0) { + const user = this.teamUsers[0]; + this.formData = { + cadreTrainingActId: this.id, + userId: user.userId, + userName: user.userName, + loginName: user.loginName, + unitId: user.unitId, + unitName: user.unitName, + unionId: user.unionId, + unionName: user.unionName, + sex: user.sex, + mobile: user.mobile, + remark: user.remark || '' + }; + } + }, + + // 获取名额限制 + async getQuota(id) { + try { + const { code, data } = await this.$axios.post("/platform/cadreTraining/branchUnionSignUp/quota", { activityId: id }) + if (code === 0) { + this.quota = data + } + } catch (error) { + this.$message.error("获取名额限制失败") + } + }, + + //活动信息 + getActivityInfo() { + this.$axios.post("/platform/cadreTraining/activity/get", {id: this.id}).then((res) => { + if (res.code === 0) { + this.viewData = res.data + } + }) + }, + + //提交报名 + async onConfirm() { + // 检查是否已报名 + if (this.isSignUp) { + this.$message.warning("您已报名该活动!") + return + } + + // 检查名额限制 + if (this.quota > 0 && this.signedUsers.length >= this.quota) { + this.$message.warning("该活动报名名额已满!") + return + } + + // 更新表单数据中的备注信息 + if (this.teamUsers.length > 0) { + this.formData.remark = this.teamUsers[0].remark || ''; + } + + try { + this.submitLoading = true; + + this.$confirm("您确定要提交吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning" + }).then(async () => { + try { + const { code, msg } = await this.$axios.post('/platform/cadreTraining/branchUnionSignUp/submit', { + data: JSON.stringify(this.formData) + }) + + if (code === 0) { + this.$message.success("报名成功") + this.isSignUp = true + this.dialogVisible = false + this.$emit("refresh", null) + } else { + this.$message.error(msg || "报名失败") + } + } catch (error) { + this.$message.error("操作失败") + } finally { + this.submitLoading = false; + } + }).catch(() => { + this.submitLoading = false; + }) + } catch (error) { + this.$message.error("操作失败") + this.submitLoading = false; + } + }, + + } +} diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/apply/index.html b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/apply/index.html index 034e96a2..92bd1d91 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/apply/index.html +++ b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/apply/index.html @@ -12,7 +12,8 @@ layout("/layouts/platform.html"){ {{formData.userName}} {{formData.sex}} {{formData.nation}} - {{formData.birthday}} + + {{formatDate(formData.birthday)}} {{formData.unitName}} {{formData.mobile}} @@ -60,41 +61,45 @@ layout("/layouts/platform.html"){ - + + type="number" :disabled="true"> - + + type="number" :disabled="true"> - + + type="number" :disabled="true"> - + + type="number" :disabled="true"> - + - + + + - + - + + + @@ -198,14 +203,92 @@ layout("/layouts/platform.html"){ }); return total; - } + }, + // 是否为男性 + isMale() { + return this.formData.sex === '男性' || this.formData.sex === '男'; + }, + // 是否为女性 + isFemale() { + return this.formData.sex === '女性' || this.formData.sex === '女'; + }, }, watch: { totalLeaveDays(newVal) { this.$set(this.formData, 'leaveDays', newVal); + // 当合计天数或开始时间变化时,自动计算结束时间 + this.calculateEndTime(); + }, + 'formData.startTime'() { + // 当开始时间变化时,自动计算结束时间 + this.calculateEndTime(); + }, + // 监听性别变化,设置默认值 + isMale(newVal) { + if (newVal) { + // 男性默认设置 + this.$set(this.formData, 'loverSex', '女性'); + this.$set(this.formData, 'withLeave', 15); + this.$set(this.formData, 'parentalLeave', 10); + } + }, + isFemale(newVal) { + if (newVal) { + // 女性默认设置 + this.$set(this.formData, 'loverSex', '男性'); + this.$set(this.formData, 'maternityLeave', 98); + this.$set(this.formData, 'extendLeave', 60); + } } }, methods: { + // 添加日期格式化方法 + 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; + } + }, + // 计算休假时间止 + calculateEndTime() { + // 如果是男性,则不自动计算结束时间 + if (this.isMale) { + return; + } + if (this.formData.startTime && this.formData.leaveDays) { + const startDate = new Date(this.formData.startTime); + if (!isNaN(startDate.getTime())) { + // 创建新的日期对象,避免修改原始日期 + const endDate = new Date(startDate); + // 添加天数(leaveDays - 1,因为包含开始日期) + endDate.setDate(endDate.getDate() + this.formData.leaveDays - 1); + // 格式化为 yyyy-MM-dd + 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() { this.$confirm("您确定保存吗?", "提示", { @@ -301,9 +384,27 @@ layout("/layouts/platform.html"){ birthday: birthday, mobile:mobile } + console.log('FormData birthday:', this.formData.birthday); + // 根据性别设置默认值 + if (this.isMale) { + // 男性默认设置 + this.$set(this.formData, 'loverSex', '女性'); + this.$set(this.formData, 'withLeave', 15); + this.$set(this.formData, 'parentalLeave', 10); + // 男性默认产假和延长假为0,因为男性不休产假 + this.$set(this.formData, 'maternityLeave', 0); + this.$set(this.formData, 'extendLeave', 0); + } else if (this.isFemale) { + // 女性默认设置 + this.$set(this.formData, 'loverSex', '男性'); + this.$set(this.formData, 'maternityLeave', 98); + this.$set(this.formData, 'extendLeave', 60); + // 女性默认陪产假和育儿假为0 + this.$set(this.formData, 'withLeave', 0); + this.$set(this.formData, 'parentalLeave', 0); + } } - } }, created() { diff --git a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/common/info.js b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/common/info.js index 25ba9588..aa175adf 100644 --- a/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/common/info.js +++ b/src/main/resources/views/platform/zhgh/staffbenefit/maternityLeave/common/info.js @@ -10,15 +10,13 @@ const maternityLeaveInfo = { {{viewData.userName}} {{viewData.sex}} {{viewData.nation}} - {{viewData.birthday}} - {{viewData.unitName}} + {{formatDate(viewData.birthday)}} {{viewData.unitName}} {{viewData.mobile}} {{viewData.loverName}} {{viewData.loverSex}} {{viewData.loverNation}} - {{viewData.loverBirthday}} - {{viewData.loverUnitName}} + {{formatDate(viewData.loverBirthday)}} {{viewData.loverUnitName}} @@ -43,10 +41,10 @@ const maternityLeaveInfo = { {{viewData.winterLeave}} {{viewData.summerLeave}} {{viewData.leaveDays}} - - {{viewData.startTime}} - {{viewData.endTime}} - {{viewData.childrenBirthday}} + + {{formatDate(viewData.startTime)}} + {{formatDate(viewData.endTime)}} + {{formatDate(viewData.childrenBirthday)}} @@ -69,6 +70,10 @@ layout("/layouts/platform.html"){ } , methods: { + // 导出示例 + doExportApply(row){ + this.$downLoad('/platform/maternityLeave/mine/doExportApply?id=' + row.id) + }, onView(row) { this.$refs.guava.view(()=>{ this.$refs.maternityLeaveInfoRef.onOpen(row) diff --git a/src/main/resources/views/platform/zhghh5/staffbenefit/maternityLeave/apply/index.html b/src/main/resources/views/platform/zhghh5/staffbenefit/maternityLeave/apply/index.html index 52f2e65d..4a9a3e32 100644 --- a/src/main/resources/views/platform/zhghh5/staffbenefit/maternityLeave/apply/index.html +++ b/src/main/resources/views/platform/zhghh5/staffbenefit/maternityLeave/apply/index.html @@ -74,17 +74,17 @@ layout("/layouts/platform_h5.html"){ + v-if="isMale" required> + v-if="isMale" required> + v-if="isFemale" required> + v-if="isFemale" required> + v-if="isFemale" required> + v-if="isFemale" required> 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; + } + }, + // 计算休假时间止 + calculateEndTime() { + // 如果是男性,则不自动计算结束时间 + if (this.isMale) { + return; + } + if (this.formData.startTime && this.formData.leaveDays) { + const startDate = new Date(this.formData.startTime); + if (!isNaN(startDate.getTime())) { + // 创建新的日期对象,避免修改原始日期 + const endDate = new Date(startDate); + // 添加天数(leaveDays - 1,因为包含开始日期) + endDate.setDate(endDate.getDate() + this.formData.leaveDays - 1); + // 格式化为 yyyy-MM-dd + const year = endDate.getFullYear(); + const month = String(endDate.getMonth() + 1).padStart(2, '0'); + const day = String(endDate.getDate()).padStart(2, '0'); + this.$set(this.formData, 'endTime', year + '-' + month + '-' + day); + } + } + }, async onSave() { // 保存时不需要验证,直接提交数据 this.$axios.post("/platform/maternityLeave/apply/save", {data: JSON.stringify(this.formData)}) @@ -298,7 +380,7 @@ layout("/layouts/platform_h5.html"){ } } - // 所人性别都需要填写的字段 + // 所有人需要填写的字段 if (!this.formData.winterLeave && this.formData.winterLeave !== 0) { errors.push('请输入寒假天数'); } @@ -373,26 +455,26 @@ layout("/layouts/platform_h5.html"){ }); }, - // 出生日期确认事件 + // 出生日期确认事件 - 格式化为 yyyy-MM-dd onLoverBirthdayConfirm(value) { - this.$set(this.formData, "loverBirthday", this.$moment(value).format("YYYY-MM-DD")); + this.$set(this.formData, "loverBirthday", this.formatDate(value)); this.showLoverBirthdayPicker = false; }, - // 休假开始时间确认事件 + // 休假开始时间确认事件 - 格式化为 yyyy-MM-dd onStartTimeConfirm(value) { - this.$set(this.formData, "startTime", this.$moment(value).format("YYYY-MM-DD")); + this.$set(this.formData, "startTime", this.formatDate(value)); this.showStartTimePicker = false; }, - // 休假结束时间确认事件 + // 休假结束时间确认事件 - 格式化为 yyyy-MM-dd onEndTimeConfirm(value) { - this.$set(this.formData, "endTime", this.$moment(value).format("YYYY-MM-DD")); + this.$set(this.formData, "endTime", this.formatDate(value)); this.showEndTimePicker = false; }, - // 子女出生日期确认事件 + // 子女出生日期确认事件 - 格式化为 yyyy-MM-dd onChildrenBirthdayConfirm(value) { - this.$set(this.formData, "childrenBirthday", this.$moment(value).format("YYYY-MM-DD")); + this.$set(this.formData, "childrenBirthday", this.formatDate(value)); this.showChildrenBirthdayPicker = false; }, @@ -435,6 +517,31 @@ layout("/layouts/platform_h5.html"){ this.$set(this.formData, "loverNation", matched.value) } } + + // 格式化所有日期字段,确保不包含时分秒 + const dateFields = ['birthday', 'loverBirthday', 'startTime', 'endTime', 'childrenBirthday']; + dateFields.forEach(field => { + if (this.formData[field]) { + this.$set(this.formData, field, this.formatDate(this.formData[field])); + } + }); + + // 根据性别设置默认值 + if (this.isMale) { + // 男性默认设置 + if (!this.formData.withLeave) this.$set(this.formData, 'withLeave', 15); + if (!this.formData.parentalLeave) this.$set(this.formData, 'parentalLeave', 10); + // 男性默认产假和延长假为0 + if (!this.formData.maternityLeave) this.$set(this.formData, 'maternityLeave', 0); + if (!this.formData.extendLeave) this.$set(this.formData, 'extendLeave', 0); + } else if (this.isFemale) { + // 女性默认设置 + if (!this.formData.maternityLeave) this.$set(this.formData, 'maternityLeave', 98); + if (!this.formData.extendLeave) this.$set(this.formData, 'extendLeave', 60); + // 女性默认陪产假和育儿假为0 + if (!this.formData.withLeave) this.$set(this.formData, 'withLeave', 0); + if (!this.formData.parentalLeave) this.$set(this.formData, 'parentalLeave', 0); + } } }) } else { @@ -448,8 +555,27 @@ layout("/layouts/platform_h5.html"){ this.$set(this.formData, "unionName", user.union.name) this.$set(this.formData, "sex", user.sex) this.$set(this.formData, "nation", user.nation) - this.$set(this.formData, "birthday", user.birthday) + this.$set(this.formData, "birthday", this.formatDate(user.birthday)) // 格式化日期 this.$set(this.formData, "mobile", user.mobile) + + // 根据性别设置默认值 + if (this.isMale) { + // 男性默认设置 + this.$set(this.formData, 'loverSex', '女性'); + this.$set(this.formData, 'withLeave', 15); + this.$set(this.formData, 'parentalLeave', 10); + // 男性默认产假和延长假为0 + this.$set(this.formData, 'maternityLeave', 0); + this.$set(this.formData, 'extendLeave', 0); + } else if (this.isFemale) { + // 女性默认设置 + this.$set(this.formData, 'loverSex', '男性'); + this.$set(this.formData, 'maternityLeave', 98); + this.$set(this.formData, 'extendLeave', 60); + // 女性默认陪产假和育儿假为0 + this.$set(this.formData, 'withLeave', 0); + this.$set(this.formData, 'parentalLeave', 0); + } } } }, diff --git a/src/main/resources/views/platform/zhghh5/staffbenefit/maternityLeave/common/info.js b/src/main/resources/views/platform/zhghh5/staffbenefit/maternityLeave/common/info.js index 72dc1276..f3b21b55 100644 --- a/src/main/resources/views/platform/zhghh5/staffbenefit/maternityLeave/common/info.js +++ b/src/main/resources/views/platform/zhghh5/staffbenefit/maternityLeave/common/info.js @@ -3,17 +3,17 @@ const MATERNITY_LEAVE_INFO = { /*language=HTML*/`
- + {{ viewData.userName }} {{ viewData.sex }} {{ viewData.nation }} - {{ viewData.birthday }} + {{ formatDate(viewData.birthday) }} {{ viewData.unitName }} {{ viewData.mobile }} {{ viewData.loverName }} {{ viewData.loverSex }} {{ viewData.loverNation }} - {{ viewData.loverBirthday }} + {{ formatDate(viewData.loverBirthday) }} {{ viewData.loverUnitName }} @@ -27,11 +27,12 @@ const MATERNITY_LEAVE_INFO = { {{ viewData.winterLeave }} {{ viewData.summerLeave }} {{ viewData.leaveDays }} - {{ viewData.startTime }} - {{ viewData.endTime }} - {{ viewData.childrenBirthday }} + {{ formatDate(viewData.startTime) }} + {{ formatDate(viewData.endTime) }} + {{ formatDate(viewData.childrenBirthday) }} +