员工入职机构
This commit is contained in:
parent
5d20fd2669
commit
cc568ab44d
|
|
@ -2,7 +2,7 @@
|
|||
VITE_USE_MOCK = false
|
||||
|
||||
# 发布路径
|
||||
VITE_PUBLIC_PATH = /biz103
|
||||
VITE_PUBLIC_PATH = /biz101
|
||||
|
||||
# 是否启用gzip或brotli压缩
|
||||
# 选项值: gzip | brotli | none
|
||||
|
|
@ -13,10 +13,10 @@ VITE_BUILD_COMPRESS = 'gzip'
|
|||
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
||||
|
||||
#后台接口父地址(必填)
|
||||
VITE_GLOB_API_URL=/nursingunit103
|
||||
VITE_GLOB_API_URL=/nursingunit101
|
||||
|
||||
#后台接口全路径地址(必填)
|
||||
VITE_GLOB_DOMAIN_URL=https://www.focusnu.com/nursingunit103
|
||||
VITE_GLOB_DOMAIN_URL=https://www.focusnu.com/nursingunit101
|
||||
|
||||
# 接口父路径前缀
|
||||
VITE_GLOB_API_URL_PREFIX=
|
||||
|
|
|
|||
|
|
@ -11,114 +11,20 @@ export const columns: BasicColumn[] = [
|
|||
align: 'center',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
align: 'center',
|
||||
dataIndex: 'tel',
|
||||
},
|
||||
{
|
||||
title: '入驻时间',
|
||||
align: 'center',
|
||||
dataIndex: 'createTime',
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
align: 'center',
|
||||
dataIndex: 'sex',
|
||||
},
|
||||
{
|
||||
title: '民族',
|
||||
align: 'center',
|
||||
dataIndex: 'national',
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '出生日期',
|
||||
title: '年龄',
|
||||
align: 'center',
|
||||
dataIndex: 'birthDate',
|
||||
customRender: ({ text }) => {
|
||||
text = !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
|
||||
return text;
|
||||
},
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '住址',
|
||||
title: '联系电话',
|
||||
align: 'center',
|
||||
dataIndex: 'idCardAddress',
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '身份证号',
|
||||
align: 'center',
|
||||
dataIndex: 'idCard',
|
||||
},
|
||||
{
|
||||
title: '婚否',
|
||||
align: 'center',
|
||||
dataIndex: 'maritalStatus',
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '身高',
|
||||
align: 'center',
|
||||
dataIndex: 'height',
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '体重',
|
||||
align: 'center',
|
||||
dataIndex: 'weight',
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '健康状况',
|
||||
align: 'center',
|
||||
dataIndex: 'healthStatus',
|
||||
},
|
||||
{
|
||||
title: '政治面貌',
|
||||
align: 'center',
|
||||
dataIndex: 'politicalAppearance',
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '紧急联系人姓名',
|
||||
align: 'center',
|
||||
dataIndex: 'contactName',
|
||||
},
|
||||
{
|
||||
title: '紧急联系人电话',
|
||||
align: 'center',
|
||||
dataIndex: 'contactTel',
|
||||
},
|
||||
{
|
||||
title: '健康证正面',
|
||||
align: 'center',
|
||||
dataIndex: 'healthZmPath',
|
||||
customRender: render.renderImage,
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '健康证反面',
|
||||
align: 'center',
|
||||
dataIndex: 'healthFmPath',
|
||||
customRender: render.renderImage,
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '资质证',
|
||||
align: 'center',
|
||||
dataIndex: 'qualificationPath',
|
||||
customRender: render.renderImage,
|
||||
defaultHidden: true,
|
||||
},
|
||||
{
|
||||
title: '无犯罪正面',
|
||||
align: 'center',
|
||||
dataIndex: 'noCrimeCertificate',
|
||||
customRender: render.renderImage,
|
||||
defaultHidden: true,
|
||||
dataIndex: 'tel',
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,9 @@
|
|||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex === 'birthDate'">
|
||||
<span>{{ handleComputedAge(text) }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
|
|
@ -56,12 +59,16 @@ import { downloadFile } from '/@/utils/common/renderUtils';
|
|||
import NuEmployeesAdvisoryInfoModal from './components/NuEmployeesAdvisoryInfoModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
import { invide } from '/@/views/admin/employeesapply/EmployeesApply.api'
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
|
||||
const { createMessage, createConfirm } = useMessage();
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
const emit = defineEmits(['reload']);
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
|
|
@ -158,42 +165,63 @@ function handleSuccess() {
|
|||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 邀请
|
||||
*/
|
||||
function handleInvite(data) {
|
||||
let params = {
|
||||
...data,
|
||||
dateOfBirth: data.birthDate,
|
||||
marriedOrNot: data.maritalStatus,
|
||||
address: data.address,
|
||||
emergencyContact: data.contactName,
|
||||
emergencyTel: data.contactTel,
|
||||
emergencyRelationship: data.contactRelationship,
|
||||
hukouNature: data.hukouType,
|
||||
idCardPositive: data.cardZmPath,
|
||||
idCardNegative: data.cardFmPath,
|
||||
healthCertificatePositive: data.healthZmPath,
|
||||
healthCertificateNegative: data.healthFmPath,
|
||||
bankPositive: data.bankZmPath,
|
||||
bankNegative: data.bankFmPath,
|
||||
qualification: data.qualificationPath,
|
||||
noCrimeCertificate: data.noCrimeCertificate,
|
||||
houseAddress: data.idCardAddress,
|
||||
employeeId: data.id,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
}
|
||||
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认操作',
|
||||
content: '是否确认邀请',
|
||||
onOk: async () => {
|
||||
invide(params).then(res => {
|
||||
reload()
|
||||
emit('reload')
|
||||
})
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
// {
|
||||
// label: '审核',
|
||||
// onClick: handleEdit.bind(null, record),
|
||||
// ifShow: record.status == '1'
|
||||
// },
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
},
|
||||
{
|
||||
label: '邀请',
|
||||
onClick: handleInvite.bind(null, record),
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉操作栏
|
||||
*/
|
||||
function getDropDownAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}, {
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
auth: 'nuEmployeesAdvisoryInfo:nu_employees_advisory_info:delete'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
|
|
@ -213,7 +241,32 @@ function searchReset() {
|
|||
}
|
||||
|
||||
|
||||
function handleComputedAge(ageText) {
|
||||
// 检查输入是否有效
|
||||
if (!ageText || typeof ageText !== 'string') {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
// 解析日期字符串
|
||||
const birthDate = new Date(ageText);
|
||||
|
||||
// 检查日期是否合法(例如防止 '2025-99-99' 这类无效日期)
|
||||
if (isNaN(birthDate.getTime())) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - birthDate.getFullYear();
|
||||
const monthDiff = today.getMonth() - birthDate.getMonth();
|
||||
const dayDiff = today.getDate() - birthDate.getDate();
|
||||
|
||||
// 如果还没到生日,则年龄减1
|
||||
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
|
||||
age--;
|
||||
}
|
||||
|
||||
return age >= 0 ? age : 0; // 防止返回负数
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,352 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuEmployeesAdvisoryInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'基本信息'" />
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身份证正面" v-bind="validateInfos.cardZmPath" id="NuEmployeesAdvisoryInfoForm-cardZmPath" name="cardZmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.cardZmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身份证反面" v-bind="validateInfos.cardFmPath" id="NuEmployeesAdvisoryInfoForm-cardFmPath" name="cardFmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.cardFmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="咨询人姓名" v-bind="validateInfos.name" id="NuEmployeesAdvisoryInfoForm-name" name="name">
|
||||
<!-- <a-input v-model:value="formData.name" placeholder="请输入咨询人姓名" allow-clear disabled ></a-input> -->
|
||||
{{formData.name}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="性别" v-bind="validateInfos.sex" id="NuEmployeesAdvisoryInfoForm-sex" name="sex">
|
||||
<!-- <a-input v-model:value="formData.sex" placeholder="请输入性别" allow-clear disabled ></a-input> -->
|
||||
{{formData.sex}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="民族" v-bind="validateInfos.national" id="NuEmployeesAdvisoryInfoForm-national" name="national">
|
||||
<!-- <a-input v-model:value="formData.national" placeholder="请输入民族" allow-clear disabled ></a-input> -->
|
||||
{{formData.national}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="出生日期" v-bind="validateInfos.birthDate" id="NuEmployeesAdvisoryInfoForm-birthDate" name="birthDate">
|
||||
<!-- <a-date-picker placeholder="请选择出生日期" v-model:value="formData.birthDate" disabled value-format="YYYY-MM-DD" style="width: 100%" allow-clear /> -->
|
||||
{{formData.birthDate}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="住址" v-bind="validateInfos.idCardAddress" id="NuEmployeesAdvisoryInfoForm-idCardAddress" name="idCardAddress">
|
||||
<!-- <a-input v-model:value="formData.idCardAddress" placeholder="请输入住址" allow-clear disabled ></a-input> -->
|
||||
{{formData.idCardAddress}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身份证号" v-bind="validateInfos.idCard" id="NuEmployeesAdvisoryInfoForm-idCard" name="idCard">
|
||||
<!-- <a-input v-model:value="formData.idCard" placeholder="请输入身份证号" allow-clear disabled ></a-input> -->
|
||||
{{formData.idCard}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="签发机关" v-bind="validateInfos.issuingAuthority" id="NuEmployeesAdvisoryInfoForm-issuingAuthority" name="issuingAuthority">
|
||||
<!-- <a-input v-model:value="formData.issuingAuthority" placeholder="请输入签发机关" allow-clear disabled ></a-input> -->
|
||||
{{formData.issuingAuthority}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="有效开始日期" v-bind="validateInfos.startTime" id="NuEmployeesAdvisoryInfoForm-startTime" name="startTime">
|
||||
<!-- <a-date-picker placeholder="请选择有效开始日期" v-model:value="formData.startTime" disabled value-format="YYYY-MM-DD" style="width: 100%" allow-clear /> -->
|
||||
{{formData.startTime}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="有效结束日期" v-bind="validateInfos.endTime" id="NuEmployeesAdvisoryInfoForm-endTime" name="endTime">
|
||||
<!-- <a-date-picker placeholder="请选择有效结束日期" v-model:value="formData.endTime" disabled value-format="YYYY-MM-DD" style="width: 100%" allow-clear /> -->
|
||||
{{formData.endTime}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="联系电话" v-bind="validateInfos.tel" id="NuEmployeesAdvisoryInfoForm-tel" name="tel">
|
||||
<!-- <a-input v-model:value="formData.tel" placeholder="请输入联系电话" allow-clear disabled ></a-input> -->
|
||||
{{formData.tel}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'其他信息'" />
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="婚否" v-bind="validateInfos.maritalStatus" id="NuEmployeesAdvisoryInfoForm-maritalStatus" name="maritalStatus">
|
||||
<!-- <a-input v-model:value="formData.maritalStatus" placeholder="请输入婚否" allow-clear disabled ></a-input> -->
|
||||
{{formData.maritalStatus}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身高" v-bind="validateInfos.height" id="NuEmployeesAdvisoryInfoForm-height" name="height">
|
||||
<!-- <a-input v-model:value="formData.height" placeholder="请输入身高" allow-clear disabled ></a-input> -->
|
||||
{{formData.height}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="体重" v-bind="validateInfos.weight" id="NuEmployeesAdvisoryInfoForm-weight" name="weight">
|
||||
<!-- <a-input v-model:value="formData.weight" placeholder="请输入体重" allow-clear disabled ></a-input> -->
|
||||
{{formData.weight}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="健康状况" v-bind="validateInfos.healthStatus" id="NuEmployeesAdvisoryInfoForm-healthStatus" name="healthStatus">
|
||||
<!-- <a-input v-model:value="formData.healthStatus" placeholder="请输入健康状况" allow-clear disabled ></a-input> -->
|
||||
{{formData.healthStatus}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="政治面貌" v-bind="validateInfos.politicalAppearance" id="NuEmployeesAdvisoryInfoForm-politicalAppearance" name="politicalAppearance">
|
||||
<!-- <a-input v-model:value="formData.politicalAppearance" placeholder="请输入政治面貌" allow-clear disabled ></a-input> -->
|
||||
{{formData.politicalAppearance}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="户口性质" v-bind="validateInfos.hukouType" id="NuEmployeesAdvisoryInfoForm-hukouType" name="hukouType">
|
||||
<!-- <a-input v-model:value="formData.hukouType" placeholder="请输入户口性质" allow-clear disabled ></a-input> -->
|
||||
{{formData.hukouType}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'联系人信息'" />
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="紧急联系人姓名" v-bind="validateInfos.contactName" id="NuEmployeesAdvisoryInfoForm-contactName" name="contactName">
|
||||
<!-- <a-input v-model:value="formData.contactName" placeholder="请输入紧急联系人姓名" allow-clear disabled ></a-input> -->
|
||||
{{formData.contactName}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="紧急联系人电话" v-bind="validateInfos.contactTel" id="NuEmployeesAdvisoryInfoForm-contactTel" name="contactTel">
|
||||
<!-- <a-input v-model:value="formData.contactTel" placeholder="请输入紧急联系人电话" allow-clear disabled ></a-input> -->
|
||||
{{formData.contactTel}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="与本人关系" v-bind="validateInfos.contactRelationship" id="NuEmployeesAdvisoryInfoForm-contactRelationship" name="contactRelationship">
|
||||
<!-- <a-input v-model:value="formData.contactRelationship" placeholder="请输入紧急联系人与本人关系" allow-clear disabled ></a-input> -->
|
||||
{{formData.contactRelationship}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'银行卡信息'" />
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="银行卡正面" v-bind="validateInfos.bankZmPath" id="NuEmployeesAdvisoryInfoForm-bankZmPath" name="bankZmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.bankZmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="银行卡反面" v-bind="validateInfos.bankFmPath" id="NuEmployeesAdvisoryInfoForm-bankFmPath" name="bankFmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.bankFmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuEmployeesAdvisoryInfoForm-openingBank" name="openingBank">
|
||||
<!-- <a-input v-model:value="formData.openingBank" placeholder="请输入开户行" allow-clear disabled ></a-input> -->
|
||||
{{formData.openingBank}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="银行卡号" v-bind="validateInfos.bankCard" id="NuEmployeesAdvisoryInfoForm-bankCard" name="bankCard">
|
||||
<!-- <a-input v-model:value="formData.bankCard" placeholder="请输入银行卡号" allow-clear disabled ></a-input> -->
|
||||
{{formData.bankCard}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'证件信息'" />
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="健康证正面" v-bind="validateInfos.healthZmPath" id="NuEmployeesAdvisoryInfoForm-healthZmPath" name="healthZmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.healthZmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="健康证反面" v-bind="validateInfos.healthFmPath" id="NuEmployeesAdvisoryInfoForm-healthFmPath" name="healthFmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.healthFmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="资质证" v-bind="validateInfos.qualificationPath" id="NuEmployeesAdvisoryInfoForm-qualificationPath" name="qualificationPath">
|
||||
<j-image-upload :fileMax="0" text="无" v-model:value="formData.qualificationPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="无犯罪正面" v-bind="validateInfos.noCrimeCertificate" id="NuEmployeesAdvisoryInfoForm-noCrimeCertificate" name="noCrimeCertificate">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.noCrimeCertificate" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
</JFormContainer>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../NuEmployeesAdvisoryInfo.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({})},
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
tel: '',
|
||||
name: '',
|
||||
sex: '',
|
||||
national: '',
|
||||
birthDate: '',
|
||||
idCardAddress: '',
|
||||
idCard: '',
|
||||
issuingAuthority: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
cardZmPath: '',
|
||||
cardFmPath: '',
|
||||
maritalStatus: '',
|
||||
height: '',
|
||||
weight: '',
|
||||
healthStatus: '',
|
||||
politicalAppearance: '',
|
||||
contactName: '',
|
||||
contactTel: '',
|
||||
contactRelationship: '',
|
||||
hukouType: '',
|
||||
bankZmPath: '',
|
||||
bankFmPath: '',
|
||||
openingBank: '',
|
||||
bankCard: '',
|
||||
healthZmPath: '',
|
||||
healthFmPath: '',
|
||||
qualificationPath: '',
|
||||
noCrimeCertificate: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 8 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 12 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -2,190 +2,127 @@
|
|||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuEmployeesAdvisoryInfoForm">
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
|
||||
name="NuEmployeesAdvisoryInfoForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'基本信息'" />
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身份证正面" v-bind="validateInfos.cardZmPath" id="NuEmployeesAdvisoryInfoForm-cardZmPath" name="cardZmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.cardZmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身份证反面" v-bind="validateInfos.cardFmPath" id="NuEmployeesAdvisoryInfoForm-cardFmPath" name="cardFmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.cardFmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="咨询人姓名" v-bind="validateInfos.name" id="NuEmployeesAdvisoryInfoForm-name" name="name">
|
||||
<!-- <a-input v-model:value="formData.name" placeholder="请输入咨询人姓名" allow-clear disabled ></a-input> -->
|
||||
{{formData.name}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="性别" v-bind="validateInfos.sex" id="NuEmployeesAdvisoryInfoForm-sex" name="sex">
|
||||
<!-- <a-input v-model:value="formData.sex" placeholder="请输入性别" allow-clear disabled ></a-input> -->
|
||||
{{formData.sex}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="民族" v-bind="validateInfos.national" id="NuEmployeesAdvisoryInfoForm-national" name="national">
|
||||
<!-- <a-input v-model:value="formData.national" placeholder="请输入民族" allow-clear disabled ></a-input> -->
|
||||
{{formData.national}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="出生日期" v-bind="validateInfos.birthDate" id="NuEmployeesAdvisoryInfoForm-birthDate" name="birthDate">
|
||||
<!-- <a-date-picker placeholder="请选择出生日期" v-model:value="formData.birthDate" disabled value-format="YYYY-MM-DD" style="width: 100%" allow-clear /> -->
|
||||
{{formData.birthDate}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="住址" v-bind="validateInfos.idCardAddress" id="NuEmployeesAdvisoryInfoForm-idCardAddress" name="idCardAddress">
|
||||
<!-- <a-input v-model:value="formData.idCardAddress" placeholder="请输入住址" allow-clear disabled ></a-input> -->
|
||||
{{formData.idCardAddress}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身份证号" v-bind="validateInfos.idCard" id="NuEmployeesAdvisoryInfoForm-idCard" name="idCard">
|
||||
<!-- <a-input v-model:value="formData.idCard" placeholder="请输入身份证号" allow-clear disabled ></a-input> -->
|
||||
{{formData.idCard}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="签发机关" v-bind="validateInfos.issuingAuthority" id="NuEmployeesAdvisoryInfoForm-issuingAuthority" name="issuingAuthority">
|
||||
<!-- <a-input v-model:value="formData.issuingAuthority" placeholder="请输入签发机关" allow-clear disabled ></a-input> -->
|
||||
{{formData.issuingAuthority}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="有效开始日期" v-bind="validateInfos.startTime" id="NuEmployeesAdvisoryInfoForm-startTime" name="startTime">
|
||||
<!-- <a-date-picker placeholder="请选择有效开始日期" v-model:value="formData.startTime" disabled value-format="YYYY-MM-DD" style="width: 100%" allow-clear /> -->
|
||||
{{formData.startTime}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="有效结束日期" v-bind="validateInfos.endTime" id="NuEmployeesAdvisoryInfoForm-endTime" name="endTime">
|
||||
<!-- <a-date-picker placeholder="请选择有效结束日期" v-model:value="formData.endTime" disabled value-format="YYYY-MM-DD" style="width: 100%" allow-clear /> -->
|
||||
{{formData.endTime}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="联系电话" v-bind="validateInfos.tel" id="NuEmployeesAdvisoryInfoForm-tel" name="tel">
|
||||
<!-- <a-input v-model:value="formData.tel" placeholder="请输入联系电话" allow-clear disabled ></a-input> -->
|
||||
{{formData.tel}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'其他信息'" />
|
||||
<a-col :span="12">
|
||||
<a-form-item label="姓名" v-bind="validateInfos.name" id="NuEmployeesAdvisoryInfoForm-name" name="name">
|
||||
<!-- <a-input v-model:value="formData.name" placeholder="请输入咨询人姓名" allow-clear disabled ></a-input> -->
|
||||
{{ formData.name }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="婚否" v-bind="validateInfos.maritalStatus" id="NuEmployeesAdvisoryInfoForm-maritalStatus" name="maritalStatus">
|
||||
<!-- <a-input v-model:value="formData.maritalStatus" placeholder="请输入婚否" allow-clear disabled ></a-input> -->
|
||||
{{formData.maritalStatus}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身高" v-bind="validateInfos.height" id="NuEmployeesAdvisoryInfoForm-height" name="height">
|
||||
<!-- <a-input v-model:value="formData.height" placeholder="请输入身高" allow-clear disabled ></a-input> -->
|
||||
{{formData.height}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="体重" v-bind="validateInfos.weight" id="NuEmployeesAdvisoryInfoForm-weight" name="weight">
|
||||
<!-- <a-input v-model:value="formData.weight" placeholder="请输入体重" allow-clear disabled ></a-input> -->
|
||||
{{formData.weight}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="健康状况" v-bind="validateInfos.healthStatus" id="NuEmployeesAdvisoryInfoForm-healthStatus" name="healthStatus">
|
||||
<!-- <a-input v-model:value="formData.healthStatus" placeholder="请输入健康状况" allow-clear disabled ></a-input> -->
|
||||
{{formData.healthStatus}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="政治面貌" v-bind="validateInfos.politicalAppearance" id="NuEmployeesAdvisoryInfoForm-politicalAppearance" name="politicalAppearance">
|
||||
<!-- <a-input v-model:value="formData.politicalAppearance" placeholder="请输入政治面貌" allow-clear disabled ></a-input> -->
|
||||
{{formData.politicalAppearance}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="户口性质" v-bind="validateInfos.hukouType" id="NuEmployeesAdvisoryInfoForm-hukouType" name="hukouType">
|
||||
<!-- <a-input v-model:value="formData.hukouType" placeholder="请输入户口性质" allow-clear disabled ></a-input> -->
|
||||
{{formData.hukouType}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'联系人信息'" />
|
||||
<a-col :span="12">
|
||||
<a-form-item label="联系电话" v-bind="validateInfos.tel" id="NuEmployeesAdvisoryInfoForm-tel" name="tel">
|
||||
<!-- <a-input v-model:value="formData.tel" placeholder="请输入联系电话" allow-clear disabled ></a-input> -->
|
||||
{{ formData.tel }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="紧急联系人姓名" v-bind="validateInfos.contactName" id="NuEmployeesAdvisoryInfoForm-contactName" name="contactName">
|
||||
<!-- <a-input v-model:value="formData.contactName" placeholder="请输入紧急联系人姓名" allow-clear disabled ></a-input> -->
|
||||
{{formData.contactName}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="紧急联系人电话" v-bind="validateInfos.contactTel" id="NuEmployeesAdvisoryInfoForm-contactTel" name="contactTel">
|
||||
<!-- <a-input v-model:value="formData.contactTel" placeholder="请输入紧急联系人电话" allow-clear disabled ></a-input> -->
|
||||
{{formData.contactTel}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="与本人关系" v-bind="validateInfos.contactRelationship" id="NuEmployeesAdvisoryInfoForm-contactRelationship" name="contactRelationship">
|
||||
<!-- <a-input v-model:value="formData.contactRelationship" placeholder="请输入紧急联系人与本人关系" allow-clear disabled ></a-input> -->
|
||||
{{formData.contactRelationship}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'银行卡信息'" />
|
||||
<a-col :span="12">
|
||||
<a-form-item label="性别" v-bind="validateInfos.sex" id="NuEmployeesAdvisoryInfoForm-sex" name="sex">
|
||||
<!-- <a-input v-model:value="formData.sex" placeholder="请输入性别" allow-clear disabled ></a-input> -->
|
||||
{{ formData.sex }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="银行卡正面" v-bind="validateInfos.bankZmPath" id="NuEmployeesAdvisoryInfoForm-bankZmPath" name="bankZmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.bankZmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="银行卡反面" v-bind="validateInfos.bankFmPath" id="NuEmployeesAdvisoryInfoForm-bankFmPath" name="bankFmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.bankFmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuEmployeesAdvisoryInfoForm-openingBank" name="openingBank">
|
||||
<!-- <a-input v-model:value="formData.openingBank" placeholder="请输入开户行" allow-clear disabled ></a-input> -->
|
||||
{{formData.openingBank}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="银行卡号" v-bind="validateInfos.bankCard" id="NuEmployeesAdvisoryInfoForm-bankCard" name="bankCard">
|
||||
<!-- <a-input v-model:value="formData.bankCard" placeholder="请输入银行卡号" allow-clear disabled ></a-input> -->
|
||||
{{formData.bankCard}}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<SectionDivider :title="'证件信息'" />
|
||||
<a-col :span="12">
|
||||
<a-form-item label="年龄">
|
||||
{{ handleComputedAge(formData.birthDate) }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="出生日期" v-bind="validateInfos.birthDate" id="NuEmployeesAdvisoryInfoForm-birthDate"
|
||||
name="birthDate">
|
||||
<!-- <a-date-picker placeholder="请选择出生日期" v-model:value="formData.birthDate" disabled value-format="YYYY-MM-DD" style="width: 100%" allow-clear /> -->
|
||||
{{ formData.birthDate }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="民族" v-bind="validateInfos.national" id="NuEmployeesAdvisoryInfoForm-national"
|
||||
name="national">
|
||||
<!-- <a-input v-model:value="formData.national" placeholder="请输入民族" allow-clear disabled ></a-input> -->
|
||||
{{ formData.national }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="住址" v-bind="validateInfos.idCardAddress"
|
||||
id="NuEmployeesAdvisoryInfoForm-idCardAddress" name="idCardAddress">
|
||||
<!-- <a-input v-model:value="formData.idCardAddress" placeholder="请输入住址" allow-clear disabled ></a-input> -->
|
||||
{{ formData.idCardAddress }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身份证号" v-bind="validateInfos.idCard" id="NuEmployeesAdvisoryInfoForm-idCard"
|
||||
name="idCard">
|
||||
<!-- <a-input v-model:value="formData.idCard" placeholder="请输入身份证号" allow-clear disabled ></a-input> -->
|
||||
{{ formData.idCard }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="婚否" v-bind="validateInfos.maritalStatus"
|
||||
id="NuEmployeesAdvisoryInfoForm-maritalStatus" name="maritalStatus">
|
||||
<!-- <a-input v-model:value="formData.maritalStatus" placeholder="请输入婚否" allow-clear disabled ></a-input> -->
|
||||
{{ formData.maritalStatus }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="身高" v-bind="validateInfos.height" id="NuEmployeesAdvisoryInfoForm-height"
|
||||
name="height">
|
||||
<!-- <a-input v-model:value="formData.height" placeholder="请输入身高" allow-clear disabled ></a-input> -->
|
||||
{{ formData.height }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="体重" v-bind="validateInfos.weight" id="NuEmployeesAdvisoryInfoForm-weight"
|
||||
name="weight">
|
||||
<!-- <a-input v-model:value="formData.weight" placeholder="请输入体重" allow-clear disabled ></a-input> -->
|
||||
{{ formData.weight }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="健康状况" v-bind="validateInfos.healthStatus"
|
||||
id="NuEmployeesAdvisoryInfoForm-healthStatus" name="healthStatus">
|
||||
<!-- <a-input v-model:value="formData.healthStatus" placeholder="请输入健康状况" allow-clear disabled ></a-input> -->
|
||||
{{ formData.healthStatus }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="政治面貌" v-bind="validateInfos.politicalAppearance"
|
||||
id="NuEmployeesAdvisoryInfoForm-politicalAppearance" name="politicalAppearance">
|
||||
<!-- <a-input v-model:value="formData.politicalAppearance" placeholder="请输入政治面貌" allow-clear disabled ></a-input> -->
|
||||
{{ formData.politicalAppearance }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<a-col :span="12">
|
||||
<a-form-item label="紧急联系人" v-bind="validateInfos.contactName" id="NuEmployeesAdvisoryInfoForm-contactName"
|
||||
name="contactName">
|
||||
<!-- <a-input v-model:value="formData.contactName" placeholder="请输入紧急联系人姓名" allow-clear disabled ></a-input> -->
|
||||
{{ formData.contactName }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="紧急联系人电话" v-bind="validateInfos.contactTel" id="NuEmployeesAdvisoryInfoForm-contactTel"
|
||||
name="contactTel">
|
||||
<!-- <a-input v-model:value="formData.contactTel" placeholder="请输入紧急联系人电话" allow-clear disabled ></a-input> -->
|
||||
{{ formData.contactTel }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="与本人关系" v-bind="validateInfos.contactRelationship"
|
||||
id="NuEmployeesAdvisoryInfoForm-contactRelationship" name="contactRelationship">
|
||||
<!-- <a-input v-model:value="formData.contactRelationship" placeholder="请输入紧急联系人与本人关系" allow-clear disabled ></a-input> -->
|
||||
{{ formData.contactRelationship }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="户口性质" v-bind="validateInfos.hukouType" id="NuEmployeesAdvisoryInfoForm-hukouType"
|
||||
name="hukouType">
|
||||
<!-- <a-input v-model:value="formData.hukouType" placeholder="请输入户口性质" allow-clear disabled ></a-input> -->
|
||||
{{ formData.hukouType }}
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="健康证正面" v-bind="validateInfos.healthZmPath" id="NuEmployeesAdvisoryInfoForm-healthZmPath" name="healthZmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.healthZmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="健康证反面" v-bind="validateInfos.healthFmPath" id="NuEmployeesAdvisoryInfoForm-healthFmPath" name="healthFmPath">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.healthFmPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="资质证" v-bind="validateInfos.qualificationPath" id="NuEmployeesAdvisoryInfoForm-qualificationPath" name="qualificationPath">
|
||||
<j-image-upload :fileMax="0" text="无" v-model:value="formData.qualificationPath" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="无犯罪正面" v-bind="validateInfos.noCrimeCertificate" id="NuEmployeesAdvisoryInfoForm-noCrimeCertificate" name="noCrimeCertificate">
|
||||
<j-image-upload :fileMax="1" text="无" v-model:value="formData.noCrimeCertificate" disabled ></j-image-upload>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
|
|
@ -194,159 +131,185 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../NuEmployeesAdvisoryInfo.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../NuEmployeesAdvisoryInfo.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({})},
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
tel: '',
|
||||
name: '',
|
||||
sex: '',
|
||||
national: '',
|
||||
birthDate: '',
|
||||
idCardAddress: '',
|
||||
idCard: '',
|
||||
issuingAuthority: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
cardZmPath: '',
|
||||
cardFmPath: '',
|
||||
maritalStatus: '',
|
||||
height: '',
|
||||
weight: '',
|
||||
healthStatus: '',
|
||||
politicalAppearance: '',
|
||||
contactName: '',
|
||||
contactTel: '',
|
||||
contactRelationship: '',
|
||||
hukouType: '',
|
||||
bankZmPath: '',
|
||||
bankFmPath: '',
|
||||
openingBank: '',
|
||||
bankCard: '',
|
||||
healthZmPath: '',
|
||||
healthFmPath: '',
|
||||
qualificationPath: '',
|
||||
noCrimeCertificate: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 8 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 12 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: () => ({}) },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
tel: '',
|
||||
name: '',
|
||||
sex: '',
|
||||
national: '',
|
||||
birthDate: '',
|
||||
idCardAddress: '',
|
||||
idCard: '',
|
||||
issuingAuthority: '',
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
cardZmPath: '',
|
||||
cardFmPath: '',
|
||||
maritalStatus: '',
|
||||
height: '',
|
||||
weight: '',
|
||||
healthStatus: '',
|
||||
politicalAppearance: '',
|
||||
contactName: '',
|
||||
contactTel: '',
|
||||
contactRelationship: '',
|
||||
hukouType: '',
|
||||
bankZmPath: '',
|
||||
bankFmPath: '',
|
||||
openingBank: '',
|
||||
bankCard: '',
|
||||
healthZmPath: '',
|
||||
healthFmPath: '',
|
||||
qualificationPath: '',
|
||||
noCrimeCertificate: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 8 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 12 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
});
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
// 表单禁用
|
||||
const disabled = computed(() => {
|
||||
if (props.formBpm === true) {
|
||||
if (props.formData.disabled === false) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if (record.hasOwnProperty(key)) {
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
const tmpData = {};
|
||||
Object.keys(formData).forEach((key) => {
|
||||
if(record.hasOwnProperty(key)){
|
||||
tmpData[key] = record[key]
|
||||
}
|
||||
})
|
||||
//赋值
|
||||
Object.assign(formData, tmpData);
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function handleComputedAge(ageText) {
|
||||
// 检查输入是否有效
|
||||
if (!ageText || typeof ageText !== 'string') {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
try {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
} catch ({ errorFields }) {
|
||||
if (errorFields) {
|
||||
const firstField = errorFields[0];
|
||||
if (firstField) {
|
||||
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
|
||||
}
|
||||
}
|
||||
return Promise.reject(errorFields);
|
||||
}
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
// 解析日期字符串
|
||||
const birthDate = new Date(ageText);
|
||||
|
||||
// 检查日期是否合法(例如防止 '2025-99-99' 这类无效日期)
|
||||
if (isNaN(birthDate.getTime())) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - birthDate.getFullYear();
|
||||
const monthDiff = today.getMonth() - birthDate.getMonth();
|
||||
const dayDiff = today.getDate() - birthDate.getDate();
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
// 如果还没到生日,则年龄减1
|
||||
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
|
||||
age--;
|
||||
}
|
||||
|
||||
return age >= 0 ? age : 0; // 防止返回负数
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ enum Api {
|
|||
deleteBatch = '/admin/employeesapply/deleteBatch',
|
||||
importExcel = '/admin/employeesapply/importExcel',
|
||||
exportXls = '/admin/employeesapply/exportXls',
|
||||
invide = '/admin/employeesapply/invide',
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -70,3 +71,11 @@ export const saveOrUpdate = (params, isUpdate) => {
|
|||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
};
|
||||
|
||||
/**
|
||||
* 邀请加入
|
||||
* @param params
|
||||
*/
|
||||
export const invide = (params) => {
|
||||
return defHttp.post({ url: Api.invide, params });
|
||||
};
|
||||
|
|
|
|||
|
|
@ -15,6 +15,11 @@ export const columns: BasicColumn[] = [
|
|||
align: "center",
|
||||
dataIndex: 'sex'
|
||||
},
|
||||
{
|
||||
title: '年龄',
|
||||
align: "center",
|
||||
dataIndex: 'dateOfBirth'
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
align: "center",
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@
|
|||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex === 'dateOfBirth'">
|
||||
<span>{{ handleComputedAge(text) }}</span>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
|
|
@ -82,6 +85,7 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
|||
pageSizeOptions: ['15', '50', '70', '100'],
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
queryParam.sta
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
|
|
@ -175,7 +179,32 @@ function searchReset() {
|
|||
}
|
||||
|
||||
|
||||
function handleComputedAge(ageText) {
|
||||
// 检查输入是否有效
|
||||
if (!ageText || typeof ageText !== 'string') {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
// 解析日期字符串
|
||||
const birthDate = new Date(ageText);
|
||||
|
||||
// 检查日期是否合法(例如防止 '2025-99-99' 这类无效日期)
|
||||
if (isNaN(birthDate.getTime())) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - birthDate.getFullYear();
|
||||
const monthDiff = today.getMonth() - birthDate.getMonth();
|
||||
const dayDiff = today.getDate() - birthDate.getDate();
|
||||
|
||||
// 如果还没到生日,则年龄减1
|
||||
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
|
||||
age--;
|
||||
}
|
||||
|
||||
return age >= 0 ? age : 0; // 防止返回负数
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,246 @@
|
|||
<template>
|
||||
<div class="p-2">
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="name">
|
||||
<template #label><span title="姓名">姓名</span></template>
|
||||
<JInput v-model:value="queryParam.name" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="sex">
|
||||
<template #label><span title="性别">性别</span></template>
|
||||
<a-input placeholder="请输入性别" v-model:value="queryParam.sex" allow-clear></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
<a-col :lg="6">
|
||||
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
|
||||
style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleInvidedList" preIcon="ant-design:user-add-outlined">邀请</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex === 'dateOfBirth'">
|
||||
<span>{{ handleComputedAge(text) }}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'status_dictText'">
|
||||
<span v-if="record.status == '1'">待确认</span>
|
||||
<span v-else-if="record.status == '2'">已同意</span>
|
||||
<span v-else-if="record.status == '3'">已拒绝</span>
|
||||
<span v-else></span>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<EmployeesApplyModal ref="registerModal" @success="handleSuccess"></EmployeesApplyModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="employeesapply-employeesApply" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './EmployeesApply.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './EmployeesApply.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import EmployeesApplyModal from './components/EmployeesApplyModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JInput from "/@/components/Form/src/jeecg/components/JInput.vue";
|
||||
|
||||
const formRef = ref();
|
||||
const queryParam = reactive<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
const userStore = useUserStore();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '员工申请',
|
||||
api: list,
|
||||
columns,
|
||||
canResize: false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
scroll: { y: '58vh' },
|
||||
pagination: {
|
||||
current: 1,
|
||||
pageSize: 15,
|
||||
pageSizeOptions: ['15', '50', '70', '100'],
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
queryParam.isInvited = '0'
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "员工申请",
|
||||
url: getExportUrl,
|
||||
params: queryParam,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: 24,
|
||||
sm: 4,
|
||||
xl: 6,
|
||||
xxl: 4
|
||||
});
|
||||
const wrapperCol = reactive({
|
||||
xs: 24,
|
||||
sm: 20,
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
function handleDetail(record: Recordable) {
|
||||
registerModal.value.disableSubmit = true;
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
/**
|
||||
* 成功回调
|
||||
*/
|
||||
function handleSuccess() {
|
||||
(selectedRowKeys.value = []) && reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '详情',
|
||||
onClick: handleDetail.bind(null, record),
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
function searchQuery() {
|
||||
reload();
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置
|
||||
*/
|
||||
function searchReset() {
|
||||
formRef.value.resetFields();
|
||||
selectedRowKeys.value = [];
|
||||
//刷新数据
|
||||
reload();
|
||||
}
|
||||
|
||||
|
||||
function handleComputedAge(ageText) {
|
||||
// 检查输入是否有效
|
||||
if (!ageText || typeof ageText !== 'string') {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
// 解析日期字符串
|
||||
const birthDate = new Date(ageText);
|
||||
|
||||
// 检查日期是否合法(例如防止 '2025-99-99' 这类无效日期)
|
||||
if (isNaN(birthDate.getTime())) {
|
||||
return NaN;
|
||||
}
|
||||
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - birthDate.getFullYear();
|
||||
const monthDiff = today.getMonth() - birthDate.getMonth();
|
||||
const dayDiff = today.getDate() - birthDate.getDate();
|
||||
|
||||
// 如果还没到生日,则年龄减1
|
||||
if (monthDiff < 0 || (monthDiff === 0 && dayDiff < 0)) {
|
||||
age--;
|
||||
}
|
||||
|
||||
return age >= 0 ? age : 0; // 防止返回负数
|
||||
}
|
||||
|
||||
function handleInvidedList() {
|
||||
registerModal.value.openInvidedList();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.jeecg-basic-table-form-container {
|
||||
padding: 0;
|
||||
margin-bottom: 14px;
|
||||
|
||||
.table-page-search-submitButtons {
|
||||
display: block;
|
||||
margin-bottom: 14px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.query-group-cust {
|
||||
min-width: 100px !important;
|
||||
}
|
||||
|
||||
.query-group-split-cust {
|
||||
width: 30px;
|
||||
display: inline-block;
|
||||
text-align: center
|
||||
}
|
||||
|
||||
.ant-form-item:not(.ant-form-item-with-help) {
|
||||
margin-bottom: 14px;
|
||||
height: 32px;
|
||||
}
|
||||
|
||||
:deep(.ant-picker),
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -5,23 +5,34 @@
|
|||
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
|
||||
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
|
||||
</template>
|
||||
<EmployeesApplyForm v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false">
|
||||
<EmployeesApplyForm v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
|
||||
:formBpm="false">
|
||||
</EmployeesApplyForm>
|
||||
</a-drawer>
|
||||
<!-- 可邀请邀请列表 -->
|
||||
<a-drawer :title="'邀请'" width="70vw" :visible="invidedVisible" :closable="true" :footer-style="{ textAlign: 'right' }"
|
||||
@close="handleInvidedCancel">
|
||||
<template #footer>
|
||||
<a-button type="primary" style="margin-right: 8px" @click="handleInvidedCancel">关闭</a-button>
|
||||
</template>
|
||||
<NuEmployeesAdvisoryInfoList v-if="invidedVisible" ref="invidedRef" @reload="submitCallback"/>
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import EmployeesApplyForm from './EmployeesApplyForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
import NuEmployeesAdvisoryInfoList from '/@/views/admin/employeesadvisoryinfo/NuEmployeesAdvisoryInfoList.vue'
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const invidedVisible = ref<boolean>(false);
|
||||
const invidedRef = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
|
|
@ -67,10 +78,19 @@ function handleCancel() {
|
|||
visible.value = false;
|
||||
}
|
||||
|
||||
function handleInvidedCancel() {
|
||||
invidedVisible.value = false
|
||||
}
|
||||
|
||||
function openInvidedList() {
|
||||
invidedVisible.value = true
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
openInvidedList,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue