生育休假、独生子女父母退休移动端

This commit is contained in:
=
2025-09-19 09:37:26 +08:00
parent d377676758
commit 90f37ef369
27 changed files with 2708 additions and 79 deletions
@@ -353,8 +353,21 @@ layout("/layouts/platform.html"){
})
})
},
// 提交验证
validateBeforeSubmit() {
return new Promise((resolve) => {
this.$refs.formRef.validate((valid) => {
if (valid) {
resolve(true);
} else {
this.$message.error('请完善必填信息');
resolve(false);
}
});
});
},
// 提交
onSubmit() {
async onSubmit() {
// 余额校验
if (this.formData.money && this.formData.fundBalance) {
const balance = parseFloat(this.formData.fundBalance);
@@ -364,6 +377,10 @@ layout("/layouts/platform.html"){
return;
}
}
// 表单验证
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -380,7 +397,7 @@ layout("/layouts/platform.html"){
})
},
// 再次提交
onFinishTask() {
async onFinishTask() {
// 余额校验
if (this.formData.money && this.formData.fundBalance) {
const balance = parseFloat(this.formData.fundBalance);
@@ -390,6 +407,10 @@ layout("/layouts/platform.html"){
return;
}
}
// 表单验证
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -120,16 +120,8 @@ layout("/layouts/platform.html"){
placeholder="请输入办证机关"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="奖励金额" prop="bonus">
<el-input type="text" v-model="formData.bonus"
placeholder="请输入奖励金额"></el-input>
</el-form-item>
</el-col>
</el-row>
<!-- 以下项目保持单独一行 -->
<el-form-item prop="honorFiles" label="独生子女父母光荣证">
<file-upload :upload_number="5" :value.sync="formData.honorFiles"
@@ -176,9 +168,23 @@ layout("/layouts/platform.html"){
taskId: GetQueryString("taskId"),
formData: {},
formRules: {
declarationAgreed: [
{ required: true, message: '请勾选申报理由', trigger: 'change' }
]
userName: [{ required: true, message: '职工姓名不能为空', trigger: 'blur' }],
sex: [{ required: true, message: '性别不能为空', trigger: 'blur' }],
birthday: [{ required: true, message: '出生年月不能为空', trigger: 'blur' }],
unitName: [{ required: true, message: '原工作单位不能为空', trigger: 'blur' }],
retireTime: [{ required: true, message: '请选择退休时间', trigger: 'change' }],
loverName: [{ required: true, message: '请输入爱人姓名', trigger: 'blur' }],
loverSex: [{ required: true, message: '请选择爱人性别', trigger: 'change' }],
loverUnitName: [{ required: true, message: '请输入爱人工作单位', trigger: 'blur' }],
marryTime: [{ required: true, message: '请选择结婚日期', trigger: 'change' }],
childrenBirthday: [{ required: true, message: '请选择子女出生日', trigger: 'change' }],
getCertificateTime: [{ required: true, message: '请选择领独生子女证日', trigger: 'change' }],
childrenGraceNumber: [{ required: true, message: '请输入独生子女光荣证号', trigger: 'blur' }],
office: [{ required: true, message: '请输入办证机关', trigger: 'blur' }],
honorFiles: [{ required: true, message: '请上传独生子女父母光荣证', trigger: 'change' }],
retireFiles: [{ required: true, message: '请上传退休证', trigger: 'change' }],
sign: [{ required: true, message: '请签字', trigger: 'change' }],
declarationAgreed: [{ required: true, message: '请勾选申报理由', trigger: 'change', type: 'enum', enum: [true] }]
},
}
},
@@ -195,59 +201,105 @@ layout("/layouts/platform.html"){
if (res.code === 0) {
this.$message.success(res.msg)
window.location.href = '/platform/dsznfmtx/mine/index'
//commonUtil.pjaxPush('/platform/dsznfmtx/mine/index')
}
})
})
},
// 提交
onSubmit() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/dsznfmtx/apply/submit', {
data: JSON.stringify(this.formData)
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
window.location.href = '/platform/dsznfmtx/mine/index'
}
})
})
} else {
this.$message.error('请完善表单信息并勾选申报理由');
return false;
}
// 提交验证
validateBeforeSubmit() {
return new Promise((resolve) => {
this.$refs.formRef.validate((valid) => {
if (valid) {
resolve(true);
} else {
this.$message.error('请完善表单信息并勾选申报理由');
resolve(false);
}
});
});
},
// 再次提交
onFinishTask() {
this.$refs.formRef.validate((valid) => {
if (valid) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/dsznfmtx/apply/submitAgain', {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
window.location.href = '/platform/dsznfmtx/mine/index'
}
})
})
} else {
this.$message.error('请完善表单信息并勾选申报理由');
return false;
// 添加检查是否为退休人员的方法
async checkRetirementStatus() {
try {
const resp = await this.$axios.post('/platform/dsznfmtx/apply/checkRetirementStatus');
// 如果返回code为0且data为true,表示用户是退休人员
if (resp.code === 0 && resp.data === true) {
return true;
}
});
return false;
} catch (error) {
console.error('检查退休状态失败:', error);
return false;
}
},
// 检查用户是否已申请过
async checkUserApplication() {
try {
const resp = await this.$axios.post('/platform/dsznfmtx/apply/checkUserApplied');
// 如果返回code为0且data为true,表示用户已申请过
if (resp.code === 0 && resp.data === true) {
return true;
}
return false;
} catch (error) {
console.error('检查用户申请状态失败:', error);
return false;
}
},
// 提交
async onSubmit() {
// 检查是否为退休人员
const isRetired = await this.checkRetirementStatus();
if (!isRetired) {
this.$message.warning('您不是退休人员,无法申请此项福利');
return;
}
if (!this.bizId) {
const isApplied = await this.checkUserApplication();
if (isApplied) {
this.$message.warning('您已经提交过申请,不能重复申请');
return;
}
}
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/dsznfmtx/apply/submit', {
data: JSON.stringify(this.formData)
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
window.location.href = '/platform/dsznfmtx/mine/index'
}
})
})
},
// 再次提交
async onFinishTask() {
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.$axios.post('/platform/dsznfmtx/apply/submitAgain', {
data: JSON.stringify(this.formData),
taskId: GetQueryString("taskId")
}).then(res => {
if (res.code === 0) {
this.$message.success("提交成功")
window.location.href = '/platform/dsznfmtx/mine/index'
}
})
})
},
async findOne(id) {
const resp = await $.get('/platform/dsznfmtx/apply/findOne', {id})
@@ -273,9 +325,7 @@ layout("/layouts/platform.html"){
sex: sex,
birthday: birthday,
}
}
}
},
created() {
@@ -285,6 +335,7 @@ layout("/layouts/platform.html"){
</script>
<!--#
}
#-->
@@ -86,7 +86,7 @@ layout("/layouts/platform.html"){
//分页数据
mixins: [initTableMixins],
components: {
"dsznfmtx-info": dsznfmtxInfo
"dsznfmtx-info": DSZNFMTX_INFO
},
data() {
return {
@@ -1,4 +1,4 @@
const dsznfmtxInfo = {
const DSZNFMTX_INFO = {
template: /*language=HTML*/ `
<div>
<div class="process-title">
@@ -17,7 +17,7 @@ const dsznfmtxInfo = {
<el-descriptions-item label="工作单位" :span="2">{{viewData.loverUnitName}}</el-descriptions-item>
<el-descriptions-item label="结婚日期">{{viewData.marryTime}}</el-descriptions-item>
<el-descriptions-item label="子女出生日">{{viewData.childrenBirthday}}</el-descriptions-item>
<el-descriptions-item label="领独生子女证时间">{{viewData.startTime}}</el-descriptions-item>
<el-descriptions-item label="领独生子女证时间">{{viewData.getCertificateTime}}</el-descriptions-item>
<el-descriptions-item label="独生子女光荣证号">{{viewData.childrenGraceNumber}}</el-descriptions-item>
<el-descriptions-item label="办证机关">{{viewData.office}}</el-descriptions-item>
<el-descriptions-item label="奖励金额">{{viewData.bonus}}</el-descriptions-item>
@@ -34,7 +34,7 @@ layout("/layouts/platform.html"){
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onEdit(row)" size="mini" type="primary">编辑</el-button>
<el-button v-if="row.canRevoke" @click="onRevoke(row)" size="mini" type="danger">撤回
</el-button>
<el-button v-if="row.taskKey === 'startTask' || !row.instanceId" @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
<el-button @click="onDelete(row.id)" size="mini" type="danger">删除</el-button>
</template>
</el-table-column>
</el-table>
@@ -57,7 +57,7 @@ layout("/layouts/platform.html"){
//分页数据
mixins: [initTableMixins],
components: {
"dsznfmtx-info": dsznfmtxInfo
"dsznfmtx-info": DSZNFMTX_INFO
},
data() {
return {
@@ -88,6 +88,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<!-- <el-form-item label="电子签名" prop="approvalSignature" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">-->
<!-- <pc-signature v-model="consolidationFormData.approvalSignature"></pc-signature>-->
<!-- </el-form-item>-->
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -99,6 +102,19 @@ layout("/layouts/platform.html"){
</dsznfmtx-info>
</template>
</guava>
<el-dialog title="输入奖励金额" :visible.sync="bonusDialogVisible" width="400px">
<el-form label-width="80px">
<el-form-item label="奖励金额">
<el-input v-model="bonusFormData.bonus" placeholder="请输入奖励金额">
<template slot="append"></template>
</el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelBonusInput">取 消</el-button>
<el-button type="primary" @click="confirmBonusInput">确 定</el-button>
</div>
</el-dialog>
</div>
@@ -111,7 +127,7 @@ layout("/layouts/platform.html"){
//分页数据
mixins: [initTableMixins],
components: {
"dsznfmtx-info": dsznfmtxInfo
"dsznfmtx-info": DSZNFMTX_INFO
},
data() {
return {
@@ -124,6 +140,13 @@ layout("/layouts/platform.html"){
unionOptions: [],
unitOptions: [],
userOptions: [],
// 奖励金额输入对话框相关数据
bonusDialogVisible: false,
bonusFormData: {
bonus: ''
},
currentRow: null,
currentSubmitType: null
}
}
,
@@ -140,6 +163,7 @@ layout("/layouts/platform.html"){
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.currentRow = row;
this.$refs.dsznfmtxInfoRef.onOpen(row)
})
},
@@ -157,7 +181,77 @@ layout("/layouts/platform.html"){
})
})
},
// 显示奖励金额输入对话框
showBonusInputDialog(submitType) {
this.currentSubmitType = submitType;
this.bonusFormData.bonus = '';
this.bonusDialogVisible = true;
},
// 确认奖励金额输入并提交
confirmBonusInput() {
if (!this.bonusFormData.bonus) {
this.$message.warning('请输入奖励金额');
return;
}
// 验证金额格式
const bonusPattern = /^([0-9]*[.]{0,1}[0-9]{0,2})$/;
if (!bonusPattern.test(this.bonusFormData.bonus)) {
this.$message.warning('请输入有效的金额格式');
return;
}
this.bonusDialogVisible = false;
// 调用申请页面的保存方法来更新奖励金额
this.saveBonusAndApprove();
},
// 取消奖励金额输入
cancelBonusInput() {
this.bonusDialogVisible = false;
},
// 保存奖励金额并执行审批
// 保存奖励金额并执行审批
saveBonusAndApprove() {
// 先获取完整的申请数据
this.$axios.post('/platform/dsznfmtx/apply/findOne', {id: this.currentRow.id}).then(res => {
if (res.code === 0) {
// 获取完整的数据后,更新奖励金额
const fullData = res.data;
fullData.bonus = this.bonusFormData.bonus;
// 调用申请页面的保存方法,传递完整数据
this.$axios.post('/platform/dsznfmtx/apply/save', {data: JSON.stringify(fullData)}).then(saveRes => {
if (saveRes.code === 0) {
// 保存成功后执行审批操作
this.executeTaskAction(this.currentSubmitType);
} else {
this.$message.error(saveRes.msg || '保存奖励金额失败');
}
}).catch(error => {
this.$message.error('保存奖励金额失败');
console.error('保存奖励金额失败:', error);
});
} else {
this.$message.error(res.msg || '获取申请数据失败');
}
}).catch(error => {
this.$message.error('获取申请数据失败');
console.error('获取申请数据失败:', error);
});
},
handleTaskAction(val) {
// 如果是同意申请操作(val=1),需要先输入奖励金额
if (val === 1) {
this.showBonusInputDialog(val);
return;
}
// 其他操作直接执行
this.executeTaskAction(val);
},
// 执行任务操作
executeTaskAction(val) {
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -170,9 +264,9 @@ layout("/layouts/platform.html"){
})
}).then((res) => {
if (res.code === 0) {
this.$refs.guava.index()
this.$message.success(res.msg)
this.doSearch()
this.$refs.guava.index();
this.$message.success(res.msg);
this.doSearch();
}
})
})
@@ -86,6 +86,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<!-- <el-form-item label="电子签名" prop="approvalSignature" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">-->
<!-- <pc-signature v-model="consolidationFormData.approvalSignature"></pc-signature>-->
<!-- </el-form-item>-->
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -109,7 +112,7 @@ layout("/layouts/platform.html"){
//分页数据
mixins: [initTableMixins],
components: {
"dsznfmtx-info": dsznfmtxInfo
"dsznfmtx-info": DSZNFMTX_INFO
},
data() {
return {
@@ -172,7 +172,16 @@ layout("/layouts/platform.html"){
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
formData: {},
formRules: {},
formRules: {
loverName: [{ required: true, message: '请输入爱人姓名', trigger: 'blur' }],
loverSex: [{ required: true, message: '请选择爱人性别', trigger: 'change' }],
loverNation: [{ required: true, message: '请选择爱人民族', trigger: 'change' }],
loverBirthday: [{ required: true, message: '请选择爱人出生年月', trigger: 'change' }],
loverUnitName: [{ required: true, message: '请输入爱人工作单位', trigger: 'blur' }],
startTime: [{ required: true, message: '请选择休假开始时间', trigger: 'change' }],
endTime: [{ required: true, message: '请选择休假结束时间', trigger: 'change' }],
childrenBirthday: [{ required: true, message: '请选择子女出生日期', trigger: 'change' }]
},
}
},
computed: {
@@ -216,8 +225,24 @@ layout("/layouts/platform.html"){
})
})
},
// 提交验证
validateBeforeSubmit() {
return new Promise((resolve) => {
this.$refs.formRef.validate((valid) => {
if (valid) {
resolve(true);
} else {
this.$message.error('请完善必填信息');
resolve(false);
}
});
});
},
// 提交
onSubmit() {
async onSubmit() {
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -234,7 +259,10 @@ layout("/layouts/platform.html"){
})
},
// 再次提交
onFinishTask() {
async onFinishTask() {
const isValid = await this.validateBeforeSubmit();
if (!isValid) return;
this.$confirm("您确定要提交吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
@@ -289,6 +317,7 @@ layout("/layouts/platform.html"){
</script>
<!--#
}
#-->
@@ -87,6 +87,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="电子签名" prop="approvalSignature" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="consolidationFormData.approvalSignature"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -86,6 +86,9 @@ layout("/layouts/platform.html"){
:rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<user-opinion-textarea v-model="formData.tf_opinion"></user-opinion-textarea>
</el-form-item>
<el-form-item label="电子签名" prop="approvalSignature" :rules="[{required:true,message:'必填',trigger:['change','blur']}]">
<pc-signature v-model="consolidationFormData.approvalSignature"></pc-signature>
</el-form-item>
</el-form>
<el-row type="flex" justify="end">
<el-button @click="$refs.guava.index()" size="small">取消</el-button>
@@ -5,6 +5,9 @@ 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"
@@ -13,9 +16,6 @@ layout("/layouts/platform_h5.html"){
placeholder="请输入经办人搜索"
v-model="pageForm.userName"
></van-search>
<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>
@@ -0,0 +1,377 @@
<!--#
layout("/layouts/platform_h5.html"){
#-->
<style>
.signature-image {
max-width: 200px;
max-height: 100px;
}
</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.birthday" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="原工作单位" v-model="formData.unitName" placeholder="从信息中心获取"
readonly></van-field>
<van-field label="退休时间"
v-model="formData.retireTime"
placeholder="请选择退休时间"
readonly
@click="showDatePicker('retireTime')"
clickable
required
></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 label="工作单位" v-model="formData.loverUnitName" placeholder="请输入工作单位" required></van-field>
<van-field label="结婚日期"
v-model="formData.marryTime"
placeholder="请选择结婚日期"
readonly
@click="showDatePicker('marryTime')"
clickable
required
></van-field>
<van-field label="子女出生日"
v-model="formData.childrenBirthday"
placeholder="请选择子女出生日"
readonly
@click="showDatePicker('childrenBirthday')"
clickable
required
></van-field>
<van-field label="领独生子女证日"
v-model="formData.getCertificateTime"
placeholder="请选择日期"
readonly
@click="showDatePicker('getCertificateTime')"
clickable
required
></van-field>
<van-field label="独生子女光荣证号" v-model="formData.childrenGraceNumber" placeholder="请输入独生子女光荣证号" required></van-field>
<van-field label="办证机关" v-model="formData.office" placeholder="请输入办证机关" required></van-field>
<van-field class="more-text" name="honorFiles"
label="独生子女父母光荣证" required>
<template #input>
<h5-file-upload
slot="input"
:value.sync="formData.honorFiles"
:upload_number="10"
upload_mode="file"
upload_result_category="array"
upload_result_type="url"
complete_result
></h5-file-upload>
</template>
</van-field>
<van-field class="more-text" name="retireFiles"
label="退休证" required>
<template #input>
<h5-file-upload
slot="input"
:value.sync="formData.retireFiles"
:upload_number="10"
upload_mode="file"
upload_result_category="array"
upload_result_type="url"
complete_result
></h5-file-upload>
</template>
</van-field>
<!-- <van-cell title="签字" >-->
<!-- <van-image :src="formData.sign"-->
<!-- class="signature-image"></van-image>-->
<!-- </van-cell>-->
</van-cell-group>
<van-field name="declarationAgreed" class="declaration-checkbox">
<template #input>
<van-checkbox v-model="formData.declarationAgreed" checked-color="#ee0a24">
我已阅读并同意以下声明
</van-checkbox>
</template>
</van-field>
<van-cell class="declaration-text">
根据《河北省人口与计划生育条例》第四章第三十四条第四款"独生子女父母是国家工作人员、企事业单位员工的,退休时分别给予不低于三千元一次性奖励"的规定。<br/>
说明:1. 本人应如实填写各项情况。2. 申报时需持《独生子女父母光荣证》、《退休证》原件及其复印件各一份。
</van-cell>
</van-cell-group>
<!-- 日期选择器弹窗 -->
<van-popup position="bottom" round v-model:show="showDatePopup">
<van-datetime-picker
type="date"
:min-date="minDate"
:max-date="maxDate"
@confirm="onDateConfirm"
@cancel="showDatePopup = false"
show-toolbar
/>
</van-popup>
<!-- 提交按钮 -->
<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>提交1</van-button>
</div>
</van-form>
</div>
</div>
<script>
new Vue({
store,
el: '#app',
dicts: ["USER_NATION"],
data() {
return {
bizId: GetQueryString("bizId"),
taskId: GetQueryString("taskId"),
formData: {},
// 性别选择器
showLoverSexPicker: false,
loverSexColumns: [
{ value: '男性', text: '男性' },
{ value: '女性', text: '女性' }
],
// 日期选择器
showDatePopup: false,
currentDatePickerField: '', // 当前正在选择日期的字段名
minDate: new Date(1950, 0, 1),
maxDate: new Date(2040, 11, 31)
}
},
methods: {
// 显示日期选择器
showDatePicker(fieldName) {
this.currentDatePickerField = fieldName;
this.showDatePopup = true;
},
// 日期确认事件
onDateConfirm(value) {
const formattedDate = this.$moment(value).format("YYYY-MM-DD");
this.$set(this.formData, this.currentDatePickerField, formattedDate);
this.showDatePopup = false;
},
async onSave() {
// 保存时不需要验证,直接提交数据
this.$axios.post("/platform/dsznfmtx/apply/save", {data: JSON.stringify(this.formData)})
.then((res) => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success(res.msg);
pjaxReplace('/platform/dsznfmtx/mine/h5')
} else {
this.$toast.fail(res.msg || '保存失败');
}
})
.catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 提交前进行表单验证
async validateForm() {
const errors = [];
// 必填字段验证
if (!this.formData.retireTime) {
errors.push('请选择退休时间');
}
if (!this.formData.loverName) {
errors.push('请输入爱人姓名');
}
if (!this.formData.loverSex) {
errors.push('请选择爱人性别');
}
if (!this.formData.loverUnitName) {
errors.push('请输入爱人工作单位');
}
if (!this.formData.marryTime) {
errors.push('请选择结婚日期');
}
if (!this.formData.childrenBirthday) {
errors.push('请选择子女出生日');
}
if (!this.formData.getCertificateTime) {
errors.push('请选择领独生子女证日');
}
if (!this.formData.childrenGraceNumber) {
errors.push('请输入独生子女光荣证号');
}
if (!this.formData.office) {
errors.push('请输入办证机关');
}
if (!this.formData.honorFiles || this.formData.honorFiles.length === 0) {
errors.push('请上传独生子女父母光荣证');
}
if (!this.formData.retireFiles || this.formData.retireFiles.length === 0) {
errors.push('请上传退休证');
}
if (!this.formData.sign) {
errors.push('请签字');
}
if (!this.formData.declarationAgreed) {
errors.push('请阅读并同意声明');
}
return errors;
},
// 添加检查是否为退休人员的方法
async checkRetirementStatus() {
try {
const resp = await this.$axios.post('/platform/dsznfmtx/apply/checkRetirementStatus');
// 如果返回code为0且data为true,表示用户是退休人员
if (resp.code === 0 && resp.data === true) {
return true;
}
return false;
} catch (error) {
console.error('检查退休状态失败:', error);
return false;
}
},
// 检查用户是否已申请过
async checkUserApplication() {
try {
const resp = await this.$axios.post('/platform/dsznfmtx/apply/checkUserApplied');
// 如果返回code为0且data为true,表示用户已申请过
if (resp.code === 0 && resp.data === true) {
return true;
}
return false;
} catch (error) {
console.error('检查用户申请状态失败:', error);
return false;
}
},
// 提交
async onSubmit() {
// 检查是否为退休人员
const isRetired = await this.checkRetirementStatus();
if (!isRetired) {
this.$message.warning('您不是退休人员,无法申请此项福利');
return;
}
if (!this.bizId) {
const isApplied = await this.checkUserApplication();
if (isApplied) {
this.$message.warning('您已经提交过申请,不能重复申请');
return;
}
}
// 提交时进行表单验证
const errors = await this.validateForm();
if (errors.length > 0) {
this.$toast.fail(errors[0]); // 显示第一条错误信息
return;
}
this.$axios.post('/platform/dsznfmtx/apply/submit', {data: JSON.stringify(this.formData)})
.then(res => {
this.$toast.clear();
if (res.code === 0) {
this.$toast.success("提交成功");
pjaxReplace('/platform/dsznfmtx/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/dsznfmtx/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/dsznfmtx/mine/h5')
}, 1500);
} else {
this.$toast.fail(res.msg || '提交失败');
}
}).catch(err => {
this.$toast.clear();
this.$toast.fail('网络错误,请稍后重试');
});
},
// 添加性别确认方法
onLoverSexConfirm(o) {
this.$set(this.formData, "loverSex", o.text);
this.showLoverSexPicker = false;
},
init() {
this.bizId = GetQueryString("bizId")
if (this.bizId) {
this.$axios.post("/platform/dsznfmtx/apply/findOne", {id: this.bizId}).then((res) => {
if (res.code === 0) {
this.formData = res.data;
}
})
} 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, "birthday", user.birthday)
}
}
},
async created() {
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/dsznfmtx/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.retireTime}}</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>
<dsznfmtx-info ref="dsznfmtxInfoRef"></dsznfmtx-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"dsznfmtx-info":DSZNFMTX_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.dsznfmtxInfoRef.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/dsznfmtx/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,122 @@
const DSZNFMTX_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.birthday }}</van-cell>
<van-cell title="原工作单位">{{ viewData.unitName }}</van-cell>
<van-cell title="退休时间">{{ viewData.retireTime }}</van-cell>
<van-cell title="爱人姓名">{{ viewData.loverName }}</van-cell>
<van-cell title="性别">{{ viewData.loverSex }}</van-cell>
<van-cell title="工作单位">{{ viewData.loverUnitName }}</van-cell>
<van-cell title="结婚日期">{{ viewData.loverBirthday }}</van-cell>
<van-cell title="子女出生日">{{ viewData.loverBirthday }}</van-cell>
<van-cell title="领独生子女光时间">{{ viewData.getCertificateTime }}</van-cell>
<van-cell title="独生子女光荣证号">{{ viewData.childrenGraceNumber }}</van-cell>
<van-cell title="办证机关">{{ viewData.office }}</van-cell>
<van-cell title="奖励金额">{{ viewData.bonus }}</van-cell>
<van-cell title="独生子女父母光荣证">
<file-preview :files="viewData.honorFiles" complete_result></file-preview>
</van-cell>
<van-cell title="退休证">
<file-preview :files="viewData.retireFiles" complete_result></file-preview>
</van-cell>
<!-- <van-cell title="签字">-->
<!-- <van-image :src="viewData.sign" v-if="viewData.sign" class="sign-image"></van-image>-->
<!-- <span v-else>暂无签字</span>-->
<!-- </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/dsznfmtx/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,134 @@
<!--#
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/dsznfmtx/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.retireTime}}</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>
<dsznfmtx-info ref="dsznfmtxInfoRef"></dsznfmtx-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"dsznfmtx-info":DSZNFMTX_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.dsznfmtxInfoRef.onOpen(row)
},
onEdit(row) {
this.$pjaxReplace('/platform/dsznfmtx/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/dsznfmtx/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,257 @@
<!--#
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/dsznfmtx/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.bonus}}</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>
</template>
</table-list>
<dsznfmtx-info ref="dsznfmtxInfoRef">
<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="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
</van-form>
</div>
</div>
</dsznfmtx-info>
<!-- 奖励金额输入弹窗 -->
<van-dialog v-model="bonusDialogVisible" title="输入奖励金额" show-cancel-button
@confirm="confirmBonusInput" @cancel="cancelBonusInput">
<van-field v-model="bonusFormData.bonus" placeholder="请输入奖励金额" type="number">
<template #right-icon>
<span></span>
</template>
</van-field>
</van-dialog>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"dsznfmtx-info":DSZNFMTX_INFO
},
data() {
return {
pageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
searchKeyword: "",
approvalText: "0",
approval: false,
year: new Date().getFullYear(),
},
formData: {},
showApprovalForm: false,
infoShow: false,
// 奖励金额输入弹窗相关数据
bonusDialogVisible: false,
bonusFormData: {
bonus: ''
},
currentRow: null,
currentSubmitType: null
}
},
methods: {
// 显示奖励金额输入弹窗
showBonusInputDialog(submitType) {
this.currentSubmitType = submitType;
this.bonusFormData.bonus = '';
this.bonusDialogVisible = true;
},
// 确认奖励金额输入
confirmBonusInput() {
if (!this.bonusFormData.bonus) {
this.$toast.fail('请输入奖励金额');
return false; // 阻止弹窗关闭
}
// 验证金额格式
const bonusPattern = /^([0-9]*[.]{0,1}[0-9]{0,2})$/;
if (!bonusPattern.test(this.bonusFormData.bonus)) {
this.$toast.fail('请输入有效的金额格式');
return false; // 阻止弹窗关闭
}
this.bonusDialogVisible = false;
// 保存奖励金额并执行审批操作
this.saveBonusAndApprove();
return true; // 允许弹窗关闭
},
// 取消奖励金额输入
cancelBonusInput() {
this.bonusDialogVisible = false;
},
// 保存奖励金额并执行审批
saveBonusAndApprove() {
// 先获取完整的申请数据
this.$axios.post('/platform/dsznfmtx/apply/findOne', {id: this.currentRow.id}).then(res => {
if (res.code === 0) {
// 获取完整的数据后,更新奖励金额
const fullData = res.data;
fullData.bonus = this.bonusFormData.bonus;
// 调用申请页面的保存方法,传递完整数据
this.$axios.post('/platform/dsznfmtx/apply/save', {data: JSON.stringify(fullData)}).then(saveRes => {
if (saveRes.code === 0) {
// 保存成功后执行审批操作
this.executeTaskAction(this.currentSubmitType);
} else {
this.$toast.fail(saveRes.msg || '保存奖励金额失败');
}
}).catch(error => {
this.$toast.fail('保存奖励金额失败');
console.error('保存奖励金额失败:', error);
});
} else {
this.$toast.fail(res.msg || '获取申请数据失败');
}
}).catch(error => {
this.$toast.fail('获取申请数据失败');
console.error('获取申请数据失败:', error);
});
},
// 执行任务操作
executeTaskAction(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.dsznfmtxInfoRef.onClose()
}
})
}).catch(() => {
// on cancel
});
}).catch();
},
handleTaskAction(val) {
// 如果是同意申请操作(val=1),需要先输入奖励金额
if (val === 1) {
this.showBonusInputDialog(val);
return;
}
// 其他操作直接执行
this.executeTaskAction(val);
},
onView(row) {
this.showApprovalForm = false
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
onAudit(row) {
this.showApprovalForm = true
this.currentRow = row;
this.formData = {
tf_opinion: null,
tf_userSign: null,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,167 @@
<!--#
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/dsznfmtx/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.retireTime}}</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>
</template>
</table-list>
<dsznfmtx-info ref="dsznfmtxInfoRef">
<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="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
</van-form>
</div>
</div>
</dsznfmtx-info>
</div>
<script>
<!--#include('../common/info.js'){}#-->
const vue = new Vue({
el: "#app",
store,
dicts: [],
components: {
"dsznfmtx-info":DSZNFMTX_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: {
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.dsznfmtxInfoRef.onClose()
}
})
}).catch(() => {
// on cancel
});
}).catch();
},
onView(row) {
this.showApprovalForm = false
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
onAudit(row) {
this.showApprovalForm = true
this.formData = {
tf_opinion: null,
tf_userSign: null,
processTaskId: row.taskId,
taskName: row.curTaskName
}
this.$refs.dsznfmtxInfoRef.onOpen(row)
},
doSearch() {
this.$nextTick(() => {
this.pageForm.pageNumber = 1
this.pageForm.totalCount = 0
this.$refs.tableListRef.doSearch()
})
},
},
created() {
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,465 @@
<!--#
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" placeholder="请输入天数" type="number"
v-if="formData.sex === '男性' || formData.sex === '男'" required></van-field>
<van-field label="育儿假" v-model="formData.parentalLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '男性' || formData.sex === '男'" required></van-field>
<van-field label="产假" v-model="formData.maternityLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '女性' || formData.sex === '女'" required></van-field>
<van-field label="延长假" v-model="formData.extendLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '女性' || formData.sex === '女'" required></van-field>
<van-field label="多胞胎" v-model="formData.birthsLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '女性' || formData.sex === '女'" required></van-field>
<van-field label="难产假" v-model="formData.difficultLeave" placeholder="请输入天数" type="number"
v-if="formData.sex === '女性' || formData.sex === '女'" required></van-field>
<van-field label="寒假" v-model="formData.winterLeave" placeholder="请输入天数"
type="number" required></van-field>
<van-field label="暑假" v-model="formData.summerLeave" placeholder="请输入天数"
type="number" required></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>提交1</van-button>
</div>
</van-form>
</div>
</div>
<script>
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,
minDate: new Date(1950, 0, 1), // 设置最小日期为2000年1月1日
maxDate: new Date(2040, 12, 31), // 设置最大日期为2030年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: '请输入延长假天数' }],
birthsLeave: [{ required: true, message: '请输入多胞胎天数' }],
difficultLeave: [{ required: true, message: '请输入难产假天数' }],
winterLeave: [{ required: true, message: '请输入寒假天数' }],
summerLeave: [{ 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;
}
},
methods: {
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 === '男性' || this.formData.sex === '男';
const isFemale = this.formData.sex === '女性' || 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.birthsLeave && this.formData.birthsLeave !== 0) {
errors.push('请输入多胞胎天数');
}
if (!this.formData.difficultLeave && this.formData.difficultLeave !== 0) {
errors.push('请输入难产假天数');
}
}
// 所人性别都需要填写的字段
if (!this.formData.winterLeave && this.formData.winterLeave !== 0) {
errors.push('请输入寒假天数');
}
if (!this.formData.summerLeave && this.formData.summerLeave !== 0) {
errors.push('请输入暑假天数');
}
if (!this.formData.startTime) {
errors.push('请选择休假开始时间');
}
if (!this.formData.endTime) {
errors.push('请选择休假结束时间');
}
if (!this.formData.childrenBirthday) {
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('网络错误,请稍后重试');
});
},
// 出生日期确认事件
onLoverBirthdayConfirm(value) {
this.$set(this.formData, "loverBirthday", this.$moment(value).format("YYYY-MM-DD"));
this.showLoverBirthdayPicker = false;
},
// 休假开始时间确认事件
onStartTimeConfirm(value) {
this.$set(this.formData, "startTime", this.$moment(value).format("YYYY-MM-DD"));
this.showStartTimePicker = false;
},
// 休假结束时间确认事件
onEndTimeConfirm(value) {
this.$set(this.formData, "endTime", this.$moment(value).format("YYYY-MM-DD"));
this.showEndTimePicker = false;
},
// 子女出生日期确认事件
onChildrenBirthdayConfirm(value) {
this.$set(this.formData, "childrenBirthday", this.$moment(value).format("YYYY-MM-DD"));
this.showChildrenBirthdayPicker = 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)
}
}
}
})
} 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", user.birthday)
this.$set(this.formData, "mobile", user.mobile)
}
}
},
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>
<!--#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,125 @@
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="出生年月">{{ viewData.birthday }}</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="出生年月">{{ viewData.loverBirthday }}</van-cell>
<van-cell title="单位">{{ viewData.loverUnitName }}</van-cell>
</van-cell-group>
<van-cell-group title="假期类型">
<van-cell title="陪产假" v-if="viewData.sex === '男性' || viewData.sex === '男'">{{ viewData.withLeave }}</van-cell>
<van-cell title="育儿假" v-if="viewData.sex === '男性' || viewData.sex === '男'">{{ viewData.parentalLeave }}</van-cell>
<van-cell title="产假" v-if="viewData.sex === '女性' || viewData.sex === '女'">{{ viewData.maternityLeave }}</van-cell>
<van-cell title="延长假" v-if="viewData.sex === '女性' || viewData.sex === '女'">{{ viewData.extendLeave }}</van-cell>
<van-cell title="多胞胎" v-if="viewData.sex === '女性' || viewData.sex === '女'">{{ viewData.birthsLeave }}</van-cell>
<van-cell title="难产假" v-if="viewData.sex === '女性' || 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="休假时间起">{{ viewData.startTime }}</van-cell>
<van-cell title="休假时间止">{{ viewData.endTime }}</van-cell>
<van-cell title="子女出生日">{{ viewData.childrenBirthday }}</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>
<!--#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,167 @@
<!--#
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>
</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="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
</van-form>
</div>
</div>
</maternity-leave-info>
</div>
<script>
<!--#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: {
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,167 @@
<!--#
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>
</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="danger" @click="handleTaskAction(6)">退回到发起人</van-button>
<van-button type="danger" @click="handleTaskAction(2)">拒绝申请</van-button>
<van-button type="primary" @click="handleTaskAction(1)">同意申请</van-button>
</div>
</van-form>
</div>
</div>
</maternity-leave-info>
</div>
<script>
<!--#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: {
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>
<!--#
}
#-->