first commit

This commit is contained in:
2026-08-26 14:25:17 +08:00
commit 06debfd1fc
10595 changed files with 1836924 additions and 0 deletions
@@ -0,0 +1,625 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
</style>
<div id="app" v-cloak>
<van-nav-bar title="生育休假申请" left-text="返回" left-arrow @click-left="historyBack" placeholder fixed z-index="999"
class="custom-nav"></van-nav-bar>
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="人员信息" class="form-section">
<van-field label="职工姓名" v-model="formData.userName" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="性别" v-model="formData.sex" placeholder="从信息中心获取" readonly></van-field>
<van-field label="民族" v-model="formData.nation" placeholder="从信息中心获取" readonly></van-field>
<van-field label="出生年月" v-model="formData.birthday" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="工作单位" v-model="formData.unitName" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="电话" v-model="formData.mobile" placeholder="从信息中心获取" readonly></van-field>
<van-field label="爱人姓名" v-model="formData.loverName" placeholder="请输入爱人姓名" required></van-field>
<van-field
v-model="formData.loverSex"
name="loverSex"
label="性别"
readonly
placeholder="请选择性别"
@click="showLoverSexPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showLoverSexPicker">
<van-picker :columns="loverSexColumns" @cancel="showLoverSexPicker = false"
@confirm="onLoverSexConfirm" show-toolbar></van-picker>
</van-popup>
<van-field
v-model="formData.loverNationName"
name="loverNationName"
label="民族"
readonly
placeholder="请选择民族"
@click="showLoverNationPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showLoverNationPicker">
<van-picker :columns="loverNationColumns" @cancel="showLoverNationPicker = false"
@confirm="onLoverNationConfirm" show-toolbar></van-picker>
</van-popup>
<van-field label="出生年月"
v-model="formData.loverBirthday"
placeholder="请选择出生年月"
readonly
@click="showLoverBirthdayPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showLoverBirthdayPicker">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onLoverBirthdayConfirm"
@cancel="showLoverBirthdayPicker = false"
show-toolbar
/>
</van-popup>
<van-field label="工作单位" v-model="formData.loverUnitName" placeholder="请输入工作单位" required></van-field>
</van-cell-group>
<van-cell-group title="假期类型" class="form-section">
<van-field label="陪产假" v-model="formData.withLeave" readonly type="number"
v-if="isMale" required></van-field>
<van-field label="育儿假" v-model="formData.parentalLeave" readonly type="number"
v-if="isMale" required></van-field>
<van-field label="产假" v-model="formData.maternityLeave" placeholder="请输入天数" type="number"
v-if="isFemale" required></van-field>
<van-field label="延长假" v-model="formData.extendLeave" placeholder="请输入天数" type="number"
v-if="isFemale" required></van-field>
<!-- 替换原有的多胞胎和难产假输入框 -->
<van-field
v-if="isFemale"
label="多胞胎"
v-model="formData.birthsLeave"
readonly
placeholder="请选择天数"
@click="showBirthsLeavePicker = true"
clickable
></van-field>
<van-popup position="bottom" round v-model:show="showBirthsLeavePicker">
<van-picker
:columns="[{value: 15, text: '15天'}]"
@cancel="showBirthsLeavePicker = false"
@confirm="onBirthsLeaveConfirm"
show-toolbar
></van-picker>
</van-popup>
<van-field
v-if="isFemale"
label="难产假"
v-model="formData.difficultLeave"
readonly
placeholder="请选择天数"
@click="showDifficultLeavePicker = true"
clickable
></van-field>
<van-popup position="bottom" round v-model:show="showDifficultLeavePicker">
<van-picker
:columns="[{value: 15, text: '15天'}]"
@cancel="showDifficultLeavePicker = false"
@confirm="onDifficultLeaveConfirm"
show-toolbar
></van-picker>
</van-popup>
<van-field label="寒假" v-model="formData.winterLeave" placeholder="请输入天数"
type="number" ></van-field>
<van-field label="暑假" v-model="formData.summerLeave" placeholder="请输入天数"
type="number" ></van-field>
<van-field label="合计天数" :value="totalLeaveDays" readonly></van-field>
<van-field label="休假时间起"
v-model="formData.startTime"
placeholder="请选择休假开始时间"
readonly
@click="showStartTimePicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showStartTimePicker">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onStartTimeConfirm"
@cancel="showStartTimePicker = false"
show-toolbar
/>
</van-popup>
<van-field label="休假时间止"
v-model="formData.endTime"
placeholder="请选择休假结束时间"
readonly
@click="showEndTimePicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showEndTimePicker">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onEndTimeConfirm"
@cancel="showEndTimePicker = false"
show-toolbar
/>
</van-popup>
<van-field label="子女出生日"
v-model="formData.childrenBirthday"
placeholder="请选择子女出生日期"
readonly
@click="showChildrenBirthdayPicker = true"
clickable
required
></van-field>
<van-popup position="bottom" round v-model:show="showChildrenBirthdayPicker">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onChildrenBirthdayConfirm"
@cancel="showChildrenBirthdayPicker = false"
show-toolbar
/>
</van-popup>
</van-cell-group>
<!-- 提交按钮 -->
<div class="form-actions">
<van-button plain @click="onSave" type="info">保存</van-button>
<van-button @click="onSubmit" type="primary" v-if="!taskId">提交</van-button>
<van-button @click="onSubmitAgain" type="primary" v-else>提交</van-button>
</div>
</van-form>
</div>
</div>
<script nonce="${cspNonce!}">
new Vue({
store,
el: '#app',
dicts: ["USER_NATION"],
data() {
return {
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
formData: {},
// 民族
showLoverNationPicker: false,
loverNationColumns: [],
// 性别
showLoverSexPicker: false,
loverSexColumns: [
{ value: '男', text: '男' },
{ value: '女', text: '女' }
],
showLoverBirthdayPicker: false,
showStartTimePicker: false,
showEndTimePicker: false,
showChildrenBirthdayPicker: false,
showBirthsLeavePicker: false,
showDifficultLeavePicker: false,
minDate: new Date(1950, 0, 1), // 设置最小日期为1950年1月1日
maxDate: new Date(2040, 12, 31), // 设置最大日期为2040年12月31日
// 表单验证规则
formRules: {
loverName: [{ required: true, message: '请输入爱人姓名' }],
loverSex: [{ required: true, message: '请选择爱人性别' }],
loverNationName: [{ required: true, message: '请选择爱人民族' }],
loverBirthday: [{ required: true, message: '请选择爱人出生年月' }],
loverUnitName: [{ required: true, message: '请输入爱人工作单位' }],
withLeave: [{ required: true, message: '请输入陪产假天数' }],
parentalLeave: [{ required: true, message: '请输入育儿假天数' }],
maternityLeave: [{ required: true, message: '请输入产假天数' }],
extendLeave: [{ required: true, message: '请输入延长假天数' }],
startTime: [{ required: true, message: '请选择休假开始时间' }],
endTime: [{ required: true, message: '请选择休假结束时间' }],
childrenBirthday: [{ required: true, message: '请选择子女出生日期' }]
}
}
},
computed: {
totalLeaveDays() {
const fields = [
'withLeave', // 陪产假
'parentalLeave', // 育儿假
'maternityLeave', // 产假
'extendLeave', // 延长假
'birthsLeave', // 多胞胎
'difficultLeave', // 难产假
'winterLeave', // 寒假
'summerLeave' // 暑假
];
let total = 0;
fields.forEach(field => {
const value = parseFloat(this.formData[field]) || 0;
total += value;
});
// 同时更新 formData.leaveDays,以便保存到后端
this.$set(this.formData, 'leaveDays', total);
return total;
},
// 是否为男
isMale() {
return this.formData.sex === '男';
},
// 是否为女
isFemale() {
return 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: {
// 格式化日期为 yyyy-MM-dd 格式
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');
this.$set(this.formData, 'endTime', year + '-' + month + '-' + day);
}
}
},
async onSave() {
// 保存时不需要验证,直接提交数据
this.$axios.post("/platform/maternityLeave/apply/save", {data: JSON.stringify(this.formData)})
.then((res) => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success(res.msg);
pjaxReplace('/platform/maternityLeave/mine/h5')
} else {
this.$toast.fail(res.msg || '保存失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 提交前进行表单验证
async validateForm() {
const errors = [];
// 根据性别确定需要验证的字段
const isMale = this.formData.sex === '男';
const isFemale = this.formData.sex === '女';
// 必填字段验证
if (!this.formData.loverName) {
errors.push('请输入爱人姓名');
}
if (!this.formData.loverSex) {
errors.push('请选择爱人性别');
}
if (!this.formData.loverNationName) {
errors.push('请选择爱人民族');
}
if (!this.formData.loverBirthday) {
errors.push('请选择爱人出生年月');
}
if (!this.formData.loverUnitName) {
errors.push('请输入爱人工作单位');
}
// 根据性别验证假期字段
if (isMale) {
if (!this.formData.withLeave && this.formData.withLeave !== 0) {
errors.push('请输入陪产假天数');
}
if (!this.formData.parentalLeave && this.formData.parentalLeave !== 0) {
errors.push('请输入育儿假天数');
}
}
if (isFemale) {
if (!this.formData.maternityLeave && this.formData.maternityLeave !== 0) {
errors.push('请输入产假天数');
}
if (!this.formData.extendLeave && this.formData.extendLeave !== 0) {
errors.push('请输入延长假天数');
}
}
if (!this.formData.startTime) {
errors.push('请选择休假开始时间');
}
if (!this.formData.endTime) {
errors.push('请选择休假结束时间');
}
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;
},
// 提交
async onSubmit() {
// 提交时进行表单验证
const errors = await this.validateForm();
if (errors.length > 0) {
this.$toast.fail(errors[0]); // 显示第一条错误信息
return;
}
this.$axios.post('/platform/maternityLeave/apply/submit', {data: JSON.stringify(this.formData)})
.then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
pjaxReplace('/platform/maternityLeave/mine/h5')
} else {
this.$toast.fail(res.msg || '提交失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 再次提交
async onSubmitAgain() {
// 提交时进行表单验证
const errors = await this.validateForm();
if (errors.length > 0) {
this.$toast.fail(errors[0]); // 显示第一条错误信息
return;
}
this.$axios.post('/platform/maternityLeave/apply/submitAgain', {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
}).then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
setTimeout(() => {
pjaxReplace('/platform/maternityLeave/mine/h5')
}, 1500);
} else {
this.$toast.fail(res.msg || '提交失败');
}
}).catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 出生日期确认事件 - 格式化为 yyyy-MM-dd
onLoverBirthdayConfirm(value) {
this.$set(this.formData, "loverBirthday", this.formatDate(value));
this.showLoverBirthdayPicker = false;
},
// 休假开始时间确认事件 - 格式化为 yyyy-MM-dd
onStartTimeConfirm(value) {
this.$set(this.formData, "startTime", this.formatDate(value));
this.showStartTimePicker = false;
},
// 休假结束时间确认事件 - 格式化为 yyyy-MM-dd
onEndTimeConfirm(value) {
this.$set(this.formData, "endTime", this.formatDate(value));
this.showEndTimePicker = false;
},
// 子女出生日期确认事件 - 格式化为 yyyy-MM-dd
onChildrenBirthdayConfirm(value) {
this.$set(this.formData, "childrenBirthday", this.formatDate(value));
this.showChildrenBirthdayPicker = false;
},
onBirthsLeaveConfirm(value) {
this.$set(this.formData, "birthsLeave", value.value);
this.showBirthsLeavePicker = false;
},
onDifficultLeaveConfirm(value) {
this.$set(this.formData, "difficultLeave", value.value);
this.showDifficultLeavePicker = false;
},
onLoverNationConfirm(o) {
this.$set(this.formData, "loverNationName", o.text); // 显示名称
this.$set(this.formData, "loverNation", o.value); // 字典值
this.showLoverNationPicker = false;
},
// 添加性别确认方法
onLoverSexConfirm(o) {
this.$set(this.formData, "loverSex", o.text);
this.showLoverSexPicker = false;
},
async initDictOptions() {
// 民族
const loverNationData = await this.$businessTool.getDictOptions('USER_NATION')
this.loverNationColumns = loverNationData.map(item => {
return {value: item.code, text: item.name}
})
},
init() {
this.bizId = GetQueryString("bizId")
if (this.bizId) {
this.$axios.post("/platform/maternityLeave/apply/findOne", {id: this.bizId}).then((res) => {
if (res.code === 0) {
// 先保存原始数据
const originalData = {...res.data};
this.formData = res.data;
// 处理支付方式显示
if (this.loverNationColumns.length > 0) {
const matched = this.loverNationColumns.find(item =>
item.value === originalData.loverNation
)
if (matched) {
this.$set(this.formData, "loverNationName", matched.text)
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 {
const user = this.$store.state.user
this.$set(this.formData, "userId", user.id)
this.$set(this.formData, "userName", user.username)
this.$set(this.formData, "loginName", user.loginname)
this.$set(this.formData, "unitId", user.unitId)
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, "sex", user.sex)
this.$set(this.formData, "nation", user.nation)
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);
}
}
}
},
async created() {
await this.initDictOptions();
await this.init();
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,127 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="查询统计" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="yearList" @change="doSearch" v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入职工姓名搜索"
v-model="pageForm.userName"
></van-search>
</van-sticky>
<table-list api="/platform/maternityLeave/collect/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="休假天数">{{row.leaveDays}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn delete" @click="onDelete(row)" v-if="$auth.hasRole('SYSADMIN')">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</template>
</table-list>
<maternity-leave-info ref="maternityLeaveInfoRef"></maternity-leave-info>
</div>
<script nonce="${cspNonce!}">
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"maternity-leave-info":MATERNITY_LEAVE_INFO
},
data() {
return {
viewShow: false,
yearList: [],
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
year: "",
},
infoShow: false
}
},
methods: {
onView(row) {
this.showApprovalForm = false
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
onRevoke(row){
this.$dialog
.confirm({
title: "提示",
message: "您确定要撤销申请吗?"
})
.then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((resp) => {
this.$toast.success(resp.msg)
this.doSearch()
})
})
},
onDelete(row) {
this.$dialog
.confirm({
title: "提示",
message: "您确定要删除吗?"
})
.then(() => {
this.$axios.post("/platform/maternityLeave/mine/delete", {id: row.id}).then((resp) => {
if (resp.code === 0) {
this.$toast.success(resp.msg)
this.doSearch()
}
})
})
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
initData() {
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearList.unshift({value: i, text: i + "年"})
}
this.$set(this.pageForm, "year", this.yearList[0].value)
},
},
created() {
this.initData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,126 @@
const MATERNITY_LEAVE_INFO = {
template:
/*language=HTML*/`
<van-action-sheet v-model="visible" title="查看详情">
<div class="detail-container">
<van-cell-group title="人员信息">
<van-cell title="职工姓名">{{ viewData.userName }}</van-cell>
<van-cell title="性别">{{ viewData.sex }}</van-cell>
<van-cell title="民族">{{ viewData.nation }}</van-cell>
<van-cell title="出生年月">{{$moment(viewData.birthday).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="单位">{{ viewData.unitName }}</van-cell>
<van-cell title="电话">{{ viewData.mobile }}</van-cell>
<van-cell title="爱人姓名">{{ viewData.loverName }}</van-cell>
<van-cell title="性别">{{ viewData.loverSex }}</van-cell>
<van-cell title="民族">{{ viewData.loverNation }}</van-cell>
<van-cell title="出生年月">{{$moment(viewData.loverBirthday).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="单位">{{ viewData.loverUnitName }}</van-cell>
</van-cell-group>
<van-cell-group title="假期类型">
<van-cell title="陪产假" v-if="viewData.sex === '男'">{{ viewData.withLeave }}</van-cell>
<van-cell title="育儿假" v-if="viewData.sex === '男'">{{ viewData.parentalLeave }}</van-cell>
<van-cell title="产假" v-if="viewData.sex === '女'">{{ viewData.maternityLeave }}</van-cell>
<van-cell title="延长假" v-if="viewData.sex === '女'">{{ viewData.extendLeave }}</van-cell>
<van-cell title="多胞胎" v-if="viewData.sex === '女'">{{ viewData.birthsLeave }}</van-cell>
<van-cell title="难产假" v-if="viewData.sex === '女'">{{ viewData.difficultLeave }}</van-cell>
<van-cell title="寒假">{{ viewData.winterLeave }}</van-cell>
<van-cell title="暑假">{{ viewData.summerLeave }}</van-cell>
<van-cell title="合计">{{ viewData.leaveDays }}</van-cell>
<van-cell title="休假时间起">{{$moment(viewData.startTime).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="休假时间止">{{$moment(viewData.endTime).format('YYYY-MM-DD')}}</van-cell>
<van-cell title="子女出生日">{{$moment(viewData.childrenBirthday).format('YYYY-MM-DD')}}</van-cell>
</van-cell-group>
<template v-for="(task,index) in doneTasks">
<div class="process-title">
{{ task.displayName }}
</div>
<van-cell-group v-if="task.ext.isFirstTaskNode">
<van-cell title="申请用户">
{{ task.ext.initiatorName}}({{task.ext.initiatorAccount}})
</van-cell>
<van-cell title="申请时间">
{{ task.finishTime}}
</van-cell>
<van-cell title="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</van-cell>
</van-cell-group>
<van-cell-group v-else>
<van-cell title="办理用户">
{{ task.taskFormData.userName}}({{task.taskFormData.loginName}})
</van-cell>
<van-cell title="办理时间">
{{ task.finishTime}}
</van-cell>
<van-cell title="办理结果">
<dict-tag :options="dict.type.PROCESS_TASK_SUBMIT_TYPE"
:value="task.ext.submitType"></dict-tag>
</van-cell>
<van-cell title="办理意见" v-if="!task.ext.isFirstTaskNode">
<template #label>
{{
task.taskFormData.opinion
}}
</template>
</van-cell>
<van-cell title="签字" v-if="!task.ext.isFirstTaskNode">
<van-image :src="task.ext.tf_userSign"
v-if="task.ext.tf_userSign"
class="signature-image"></van-image>
</van-cell>
</van-cell-group>
</template>
</div>
<slot></slot>
</van-action-sheet>
`,
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()
},
// 关闭
onClose(){
this.visible = false
},
// 获取申请信息
getInfo() {
this.$axios.post("/platform/maternityLeave/apply/findOne", {id: this.row.id}).then((res) => {
if (res.code === 0) {
this.viewData = res.data
}
})
},
// 查看
openView(id) {
this.$nextTick(() => {
this.$refs.infoDialogRef.onOpen(id)
})
},
// 获取已办任务审批记录
getDoneTasks() {
this.$axios.post("/flow/common/doneTasks", {bizId: this.row.id}).then((res) => {
if (res.code === 0) {
this.doneTasks = res.data
}
})
},
},
}
@@ -0,0 +1,133 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="我的申请" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-dropdown-menu :close-on-click-outside="false" :close-on-click-overlay="false">
<van-dropdown-item :options="yearList" @change="doSearch" v-model="pageForm.year"></van-dropdown-item>
</van-dropdown-menu>
</van-sticky>
<table-list api="/platform/maternityLeave/mine/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="休假天数">{{row.leaveDays}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.taskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" @click="onEdit(row)" v-if="row.taskKey === 'startTask' || !row.instanceId">
<i class="fa fa-edit"></i>
<span>编辑</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
<i class="fa fa-undo"></i>
<span>撤回</span>
</div>
<div class="action-btn delete" @click="onDelete(row)" v-if="row.taskKey === 'startTask' || !row.instanceId">
<i class="fa fa-trash"></i>
<span>删除</span>
</div>
</template>
</table-list>
<maternity-leave-info ref="maternityLeaveInfoRef"></maternity-leave-info>
</div>
<script nonce="${cspNonce!}">
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"maternity-leave-info":MATERNITY_LEAVE_INFO
},
data() {
return {
viewShow: false,
yearList: [],
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
year: "",
},
infoShow: false
}
},
methods: {
onView(row) {
this.showApprovalForm = false
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
onEdit(row) {
this.$pjaxReplace('/platform/maternityLeave/apply/h5?taskId=' + (row.startTaskId || '') + "&bizId=" + row.id)
},
onRevoke(row){
this.$dialog
.confirm({
title: "提示",
message: "您确定要撤销申请吗?"
})
.then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.startTaskId}).then((resp) => {
this.$toast.success(resp.msg)
this.doSearch()
})
})
},
onDelete(row) {
this.$dialog
.confirm({
title: "提示",
message: "您确定要删除吗?"
})
.then(() => {
this.$axios.post("/platform/maternityLeave/mine/delete", {id: row.id}).then((resp) => {
if (resp.code === 0) {
this.$toast.success(resp.msg)
this.doSearch()
}
})
})
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
initData() {
for (let i = new Date().getFullYear() - 10; i <= new Date().getFullYear(); i++) {
this.yearList.unshift({value: i, text: i + "年"})
}
this.$set(this.pageForm, "year", this.yearList[0].value)
},
},
created() {
this.initData()
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,187 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="校工会审核" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入职工姓名搜索"
v-model="pageForm.userName"
></van-search>
<van-tabs v-model="pageForm.approvalText"
@change="(val)=>{this.pageForm.approval = val==='1';this.doSearch();}">
<van-tab title="已审核" name="1"></van-tab>
<van-tab title="未审核" name="0"></van-tab>
</van-tabs>
</van-sticky>
<table-list api="/platform/maternityLeave/schoolAudit/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="休假天数">{{row.leaveDays}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskState === 10" @click="onAudit(row)">
<i class="fa fa-edit"></i>
<span>审核</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
<i class="fa fa-undo"></i>
<span>撤回</span>
</div>
</template>
</table-list>
<maternity-leave-info ref="maternityLeaveInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
校工会审核
</div>
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="审批意见">
<van-field label=""
:rules="[{ required: true,message:'请填审批意见' }]"
v-model="formData.tf_opinion"
required
type="textarea"
name="tf_opinion"
rows="4"
autosize
class="more-text"
placeholder="请填审批意见"></van-field>
</van-cell-group>
<van-cell-group title="电子签名" class="form-section">
<van-field class="more-text" name="tf_userSign" label="">
<template #input>
<h5-signature v-model="formData.tf_userSign" slot="input"></h5-signature>
</template>
</van-field>
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
</div>
</van-form>
</div>
</div>
</maternity-leave-info>
</div>
<script nonce="${cspNonce!}">
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"maternity-leave-info":MATERNITY_LEAVE_INFO
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
approvalText: "0",
approval: false,
year: new Date().getFullYear(),
},
formData: {},
showApprovalForm: false,
infoShow: false
}
},
methods: {
onRevoke(row) {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要撤回吗?',
}).then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then(res => {
if (res.code === 0) {
this.$toast.success("提交成功")
this.doSearch()
this.infoShow = false
}
})
}).catch(() => {
// on cancel
});
},
handleTaskAction(val) {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要提交吗?',
}).then(() => {
this.$axios.post('/flow/common/executeTask', {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then(res => {
if (res.code === 0) {
this.$toast.success("提交成功")
this.doSearch()
this.$refs.maternityLeaveInfoRef.onClose()
}
})
}).catch(() => {
// on cancel
});
}).catch();
},
onView(row) {
this.showApprovalForm = false
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
onAudit(row) {
this.showApprovalForm = true
this.formData = {
tf_opinion: null,
tf_userSign: null,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,187 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<div id="app" v-cloak>
<van-nav-bar @click-left="historyBack" left-arrow left-text="返回" title="分工会审核" placeholder fixed></van-nav-bar>
<van-sticky offset-top="46px">
<van-search
:reverse-color="false"
:show-action="false"
@search="doSearch"
input-align="left"
placeholder="请输入职工姓名搜索"
v-model="pageForm.userName"
></van-search>
<van-tabs v-model="pageForm.approvalText"
@change="(val)=>{this.pageForm.approval = val==='1';this.doSearch();}">
<van-tab title="已审核" name="1"></van-tab>
<van-tab title="未审核" name="0"></van-tab>
</van-tabs>
</van-sticky>
<table-list api="/platform/maternityLeave/unionAudit/pageData" :page_form.sync="pageForm" ref="tableListRef"
@ready="doSearch" >
<template v-slot="{index,row}">
<table-column label="职工姓名">{{row.userName}}</table-column>
<table-column label="性别">{{row.sex}}</table-column>
<table-column label="工会">{{row.unionName}}</table-column>
<table-column label="所属单位">{{row.unitName}}</table-column>
<table-column label="休假天数">{{row.leaveDays}}</table-column>
<table-column label="申请时间">{{row.applyTime}}</table-column>
<table-column label="当前节点">{{row.curTaskName}}</table-column>
</template>
<template #actions="{index,row}">
<div class="action-btn" @click="onView(row)">
<i class="fa fa-eye"></i>
<span>查看</span>
</div>
<div class="action-btn" v-if="row.taskState === 10" @click="onAudit(row)">
<i class="fa fa-edit"></i>
<span>审核</span>
</div>
<div class="action-btn delete" v-if="row.canRevoke" @click="onRevoke(row)">
<i class="fa fa-undo"></i>
<span>撤回</span>
</div>
</template>
</table-list>
<maternity-leave-info ref="maternityLeaveInfoRef">
<div v-if="showApprovalForm">
<div class="process-title">
分工会审核
</div>
<div class="form-container">
<van-form ref="formRef">
<van-cell-group title="审批意见">
<van-field label=""
:rules="[{ required: true,message:'请填审批意见' }]"
v-model="formData.tf_opinion"
required
type="textarea"
name="tf_opinion"
rows="4"
autosize
class="more-text"
placeholder="请填审批意见"></van-field>
</van-cell-group>
<van-cell-group title="电子签名" class="form-section">
<van-field class="more-text" name="tf_userSign" label="">
<template #input>
<h5-signature v-model="formData.tf_userSign" slot="input"></h5-signature>
</template>
</van-field>
</van-cell-group>
<!-- 按钮区域 -->
<div class="form-actions">
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
</div>
</van-form>
</div>
</div>
</maternity-leave-info>
</div>
<script nonce="${cspNonce!}">
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"maternity-leave-info":MATERNITY_LEAVE_INFO
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
approvalText: "0",
approval: false,
year: new Date().getFullYear(),
},
formData: {},
showApprovalForm: false,
infoShow: false
}
},
methods: {
onRevoke(row) {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要撤回吗?',
}).then(() => {
this.$axios.post("/flow/common/revokeTask", {taskId: row.taskId}).then(res => {
if (res.code === 0) {
this.$toast.success("提交成功")
this.doSearch()
this.infoShow = false
}
})
}).catch(() => {
// on cancel
});
},
handleTaskAction(val) {
this.$refs.formRef.validate().then(() => {
this.$dialog.confirm({
title: '温馨提示',
message: '您确定要提交吗?',
}).then(() => {
this.$axios.post('/flow/common/executeTask', {
data: JSON.stringify({
...this.formData,
submitType: val
})
}).then(res => {
if (res.code === 0) {
this.$toast.success("提交成功")
this.doSearch()
this.$refs.maternityLeaveInfoRef.onClose()
}
})
}).catch(() => {
// on cancel
});
}).catch();
},
onView(row) {
this.showApprovalForm = false
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
onAudit(row) {
this.showApprovalForm = true
this.formData = {
tf_opinion: null,
tf_userSign: null,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$refs.maternityLeaveInfoRef.onOpen(row)
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
}
})
</script>
<!--#
}
#-->