长者变更信息流程
This commit is contained in:
parent
d344d4f8cd
commit
7a52d9a149
|
|
@ -210,7 +210,9 @@ function handleInvite(data) {
|
||||||
* 获取身份证
|
* 获取身份证
|
||||||
*/
|
*/
|
||||||
function handleAcquireIdenCard(record) {
|
function handleAcquireIdenCard(record) {
|
||||||
acquireIdenCard(record)
|
acquireIdenCard(record).then(res => {
|
||||||
|
reload()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ function handleEdit(record: Recordable) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情
|
* 审核
|
||||||
*/
|
*/
|
||||||
function handleUpEdit(record: Recordable) {
|
function handleUpEdit(record: Recordable) {
|
||||||
registerModal.value.disableSubmit = true;
|
registerModal.value.disableSubmit = true;
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,10 @@ enum Api {
|
||||||
deleteBatch = '/admin/elderInfo/deleteBatch',
|
deleteBatch = '/admin/elderInfo/deleteBatch',
|
||||||
importExcel = '/admin/elderInfo/importExcel',
|
importExcel = '/admin/elderInfo/importExcel',
|
||||||
exportXls = '/admin/elderInfo/exportXls',
|
exportXls = '/admin/elderInfo/exportXls',
|
||||||
|
modifyList = '/admin/elderInfo/modifyList',
|
||||||
|
getModifyInfo = '/admin/elderInfo/getModifyInfo',
|
||||||
|
guaAudit = '/admin/elderInfo/guaAudit',
|
||||||
|
elderAudit = '/admin/elderInfo/elderAudit',
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -70,3 +74,35 @@ export const saveOrUpdate = (params, isUpdate) => {
|
||||||
let url = isUpdate ? Api.edit : Api.save;
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 变更列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const modifyList = (params) => defHttp.get({ url: Api.modifyList, params });
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取变更信息
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getModifyInfo = (params) => {
|
||||||
|
return defHttp.post({ url: Api.getModifyInfo, params });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监护人信息变更审批提交
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const guaAudit = (params) => {
|
||||||
|
return defHttp.post({ url: Api.guaAudit, params });
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长者信息变更审批提交
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const elderAudit = (params) => {
|
||||||
|
return defHttp.post({ url: Api.elderAudit, params });
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,82 @@ export const columns: BasicColumn[] = [
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const elderColumns: BasicColumn[] = [
|
||||||
|
{
|
||||||
|
title: '护理单元',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'nuId',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '长者姓名',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '性别',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'sex',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '年龄',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'age',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: '监护人姓名',
|
||||||
|
// align: 'center',
|
||||||
|
// dataIndex: 'guardianName',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '关系',
|
||||||
|
// align: 'center',
|
||||||
|
// dataIndex: 'relationship',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '监护人电话',
|
||||||
|
// align: 'center',
|
||||||
|
// dataIndex: 'guardianPhone',
|
||||||
|
// },
|
||||||
|
];
|
||||||
|
|
||||||
|
export const guaColumns: BasicColumn[] = [
|
||||||
|
// {
|
||||||
|
// title: '护理单元',
|
||||||
|
// align: 'center',
|
||||||
|
// dataIndex: 'nuId',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '性别',
|
||||||
|
// align: 'center',
|
||||||
|
// dataIndex: 'sex',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// title: '年龄',
|
||||||
|
// align: 'center',
|
||||||
|
// dataIndex: 'age',
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: '监护人姓名',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'guardianName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '关系',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'relationship',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '监护人电话',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'guardianPhone',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '长者姓名',
|
||||||
|
align: 'center',
|
||||||
|
dataIndex: 'name',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
// 高级查询数据
|
// 高级查询数据
|
||||||
export const superQuerySchema = {
|
export const superQuerySchema = {
|
||||||
nuId: { title: '护理单元', order: 0, view: 'text', type: 'string' },
|
nuId: { title: '护理单元', order: 0, view: 'text', type: 'string' },
|
||||||
|
|
@ -64,3 +140,56 @@ export const superQuerySchema = {
|
||||||
startTime: { title: '有效开始日期', order: 17, view: 'datetime', type: 'string' },
|
startTime: { title: '有效开始日期', order: 17, view: 'datetime', type: 'string' },
|
||||||
endTime: { title: '有效结束日期', order: 18, view: 'datetime', type: 'string' },
|
endTime: { title: '有效结束日期', order: 18, view: 'datetime', type: 'string' },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const applyObj = {
|
||||||
|
id: 'id',
|
||||||
|
nuId: '护理单元',
|
||||||
|
name: '姓名',
|
||||||
|
sex: '性别',
|
||||||
|
age: '年龄',
|
||||||
|
idCard: '身份证号码',
|
||||||
|
dateOfBirth: '出生日期',
|
||||||
|
national: '民族',
|
||||||
|
houseAddress: '住址',
|
||||||
|
avatarPath: '头像',
|
||||||
|
medicalType: '医保类型',
|
||||||
|
reimbType: '报销类型',
|
||||||
|
medicalCard: '医保卡号',
|
||||||
|
educationLevel: '文化程度',
|
||||||
|
maritalStatus: '婚姻状况',
|
||||||
|
religiousBeliefs: '宗教信仰',
|
||||||
|
idCardPositive: '身份证正面',
|
||||||
|
idCardNegative: '身份证反面',
|
||||||
|
accountBookHimself: '户口本本人页',
|
||||||
|
frontMedical: '医保卡正面',
|
||||||
|
negaticeMedical: '医保卡反面',
|
||||||
|
content: '备注',
|
||||||
|
currentState: '当前状态 0咨询 1入住 2留床 3退住',
|
||||||
|
guardianOpenId: '监护人openId',
|
||||||
|
guardianName: '监护人姓名',
|
||||||
|
relationship: '监护人与老人关系',
|
||||||
|
guardianIdCard: '监护人身份证号',
|
||||||
|
guardianPhone: '监护人联系电话',
|
||||||
|
guardianDateOfBirth: '监护人出生日期',
|
||||||
|
guardianHomeAddress: '监护人家庭住址',
|
||||||
|
guardianWorkUnit: '监护人工作单位',
|
||||||
|
homeAddress: '住址',
|
||||||
|
delFlag: '是否删除 0未删除 1删除',
|
||||||
|
createBy: '创建人',
|
||||||
|
createTime: '创建日期',
|
||||||
|
updateBy: '更新人',
|
||||||
|
updateTime: '更新日期',
|
||||||
|
sysOrgCode: '所属部门',
|
||||||
|
issuingAuthority: '签发机关',
|
||||||
|
startTime: '有效开始日期',
|
||||||
|
endTime: '有效结束日期',
|
||||||
|
cardIssuing: '发卡日期',
|
||||||
|
bloodType: '血型',
|
||||||
|
militaryType: '兵役状况',
|
||||||
|
guardianModifyStatus: '监护人信息变更状态 1修改申请中 2通过 3驳回',
|
||||||
|
guardianModifyContent: '监护人信息变更驳回原因',
|
||||||
|
guardianModifyId: '监护人变更信息对应子表id nu_biz_elder_modify_info.id',
|
||||||
|
elderModifyStatus: '长者信息变更状态 1修改申请中 2通过 3驳回',
|
||||||
|
elderModifyContent: '长者信息变更驳回原因',
|
||||||
|
elderModifyId: '长者变更信息对应子表id nu_biz_elder_modify_info.id',
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,221 @@
|
||||||
|
<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 :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>
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" />
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
<template v-if="column.dataIndex === 'age'">
|
||||||
|
<span>{{ handleComputedAge(record.dateOfBirth) }}</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<ElderInfoModal ref="registerModal" @success="handleSuccess"></ElderInfoModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="elderinfo-elderInfo" setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import { elderColumns, superQuerySchema } from './ElderInfo.data';
|
||||||
|
import { modifyList, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ElderInfo.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import ElderInfoModal from './components/ElderInfoModal.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: modifyList,
|
||||||
|
columns:elderColumns,
|
||||||
|
canResize: false,
|
||||||
|
useSearchForm: false,
|
||||||
|
actionColumn: {
|
||||||
|
width: 120,
|
||||||
|
fixed: 'right',
|
||||||
|
},
|
||||||
|
beforeFetch: async (params) => {
|
||||||
|
queryParam.queryModifyType = 'zz'
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 高级查询配置
|
||||||
|
const superQueryConfig = reactive(superQuerySchema);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
function handleDetail(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = true;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核
|
||||||
|
*/
|
||||||
|
function handleAudit(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = true;
|
||||||
|
registerModal.value.upElderInfoEdit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
// {
|
||||||
|
// label: '详情',
|
||||||
|
// onClick: handleDetail.bind(null, record),
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
label: '审核',
|
||||||
|
onClick: handleAudit.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; // 防止返回负数
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.jeecg-basic-table-form-container {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.table-page-search-submitButtons {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
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: 16px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-picker),
|
||||||
|
:deep(.ant-input-number) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,221 @@
|
||||||
|
<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="guardianName">
|
||||||
|
<template #label><span title="姓名">姓名</span></template>
|
||||||
|
<JInput v-model:value="queryParam.guardianName" />
|
||||||
|
</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>
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" />
|
||||||
|
</template>
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
<template v-if="column.dataIndex === 'age'">
|
||||||
|
<span>{{ handleComputedAge(record.dateOfBirth) }}</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<ElderInfoModal ref="registerModal" @success="handleSuccess"></ElderInfoModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="elderinfo-elderInfo" setup>
|
||||||
|
import { ref, reactive } from 'vue';
|
||||||
|
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage';
|
||||||
|
import { guaColumns, superQuerySchema } from './ElderInfo.data';
|
||||||
|
import { modifyList, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ElderInfo.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import ElderInfoModal from './components/ElderInfoModal.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: modifyList,
|
||||||
|
columns: guaColumns,
|
||||||
|
canResize: false,
|
||||||
|
useSearchForm: false,
|
||||||
|
actionColumn: {
|
||||||
|
width: 120,
|
||||||
|
fixed: 'right',
|
||||||
|
},
|
||||||
|
beforeFetch: async (params) => {
|
||||||
|
queryParam.queryModifyType = 'jhr'
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
// 高级查询配置
|
||||||
|
const superQueryConfig = reactive(superQuerySchema);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
function handleDetail(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = true;
|
||||||
|
registerModal.value.edit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核
|
||||||
|
*/
|
||||||
|
function handleAudit(record: Recordable) {
|
||||||
|
registerModal.value.disableSubmit = true;
|
||||||
|
registerModal.value.upInfoEdit(record);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record) {
|
||||||
|
return [
|
||||||
|
// {
|
||||||
|
// label: '详情',
|
||||||
|
// onClick: handleDetail.bind(null, record),
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
label: '审核',
|
||||||
|
onClick: handleAudit.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; // 防止返回负数
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.jeecg-basic-table-form-container {
|
||||||
|
padding: 0;
|
||||||
|
|
||||||
|
.table-page-search-submitButtons {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
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: 16px;
|
||||||
|
height: 32px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-picker),
|
||||||
|
:deep(.ant-input-number) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -9,18 +9,44 @@
|
||||||
:formBpm="false">
|
:formBpm="false">
|
||||||
</ElderInfoForm>
|
</ElderInfoForm>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
|
<!-- 长者信息变更审核 -->
|
||||||
|
<a-drawer :title="title" width="70vw" :visible="elderUpInfoVisible" :closable="true"
|
||||||
|
:footer-style="{ textAlign: 'right' }" @close="handleElderUpInfoCancel">
|
||||||
|
<template #footer>
|
||||||
|
<a-button type="primary" style="margin-right: 8px" @click="handleElderUpInfoCancel">关闭</a-button>
|
||||||
|
<a-button type="primary" @click="handleElderUpInfoOk">确认</a-button>
|
||||||
|
</template>
|
||||||
|
<ElderUpInfoForm v-if="elderUpInfoVisible" ref="elderUpInfoForm" @ok="handleElderUpInfoCancel" :formBpm="false">
|
||||||
|
</ElderUpInfoForm>
|
||||||
|
</a-drawer>
|
||||||
|
<!-- 监护人信息变更审核 -->
|
||||||
|
<a-drawer :title="title" width="70vw" :visible="upInfoVisible" :closable="true" :footer-style="{ textAlign: 'right' }"
|
||||||
|
@close="handleUpInfoCancel">
|
||||||
|
<template #footer>
|
||||||
|
<a-button type="primary" style="margin-right: 8px" @click="handleUpInfoCancel">关闭</a-button>
|
||||||
|
<a-button type="primary" @click="handleUpInfoOk">确认</a-button>
|
||||||
|
</template>
|
||||||
|
<GuaUpInfoForm v-if="upInfoVisible" ref="upInfoForm" @ok="handleUpInfoCancel" :formBpm="false">
|
||||||
|
</GuaUpInfoForm>
|
||||||
|
</a-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, nextTick, defineExpose } from 'vue';
|
import { ref, nextTick, defineExpose } from 'vue';
|
||||||
import ElderInfoForm from './ElderInfoForm.vue'
|
import ElderInfoForm from './ElderInfoForm.vue'
|
||||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||||
|
import GuaUpInfoForm from '/@/views/elder/elderinfo/components/GuaUpInfoForm.vue'
|
||||||
|
import ElderUpInfoForm from '/@/views/elder/elderinfo/components/ElderUpInfoForm.vue'
|
||||||
|
|
||||||
const title = ref<string>('');
|
const title = ref<string>('');
|
||||||
const width = ref<number>(800);
|
const width = ref<number>(800);
|
||||||
const visible = ref<boolean>(false);
|
const visible = ref<boolean>(false);
|
||||||
const disableSubmit = ref<boolean>(false);
|
const disableSubmit = ref<boolean>(false);
|
||||||
const registerForm = ref();
|
const registerForm = ref();
|
||||||
|
const upInfoForm = ref();
|
||||||
|
const upInfoVisible = ref<boolean>(false);
|
||||||
|
const elderUpInfoForm = ref();
|
||||||
|
const elderUpInfoVisible = ref<boolean>(false);
|
||||||
const emit = defineEmits(['register', 'success']);
|
const emit = defineEmits(['register', 'success']);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -68,10 +94,68 @@ function handleCancel() {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监护人信息变更审核
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function upInfoEdit(record) {
|
||||||
|
title.value = '审核';
|
||||||
|
upInfoVisible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
upInfoForm.value.show(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监护人信息变更确认
|
||||||
|
*/
|
||||||
|
function handleUpInfoOk() {
|
||||||
|
upInfoForm.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监护人信息变更-关闭
|
||||||
|
*/
|
||||||
|
function handleUpInfoCancel() {
|
||||||
|
console.log(123123)
|
||||||
|
upInfoVisible.value = false
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长者审核
|
||||||
|
* @param record
|
||||||
|
*/
|
||||||
|
function upElderInfoEdit(record) {
|
||||||
|
title.value = '审核';
|
||||||
|
elderUpInfoVisible.value = true;
|
||||||
|
nextTick(() => {
|
||||||
|
elderUpInfoForm.value.show(record);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长者信息变更确认
|
||||||
|
*/
|
||||||
|
function handleElderUpInfoOk() {
|
||||||
|
elderUpInfoForm.value.submitForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 长者信息变更-关闭
|
||||||
|
*/
|
||||||
|
function handleElderUpInfoCancel() {
|
||||||
|
console.log(123123)
|
||||||
|
elderUpInfoVisible.value = false
|
||||||
|
emit('success');
|
||||||
|
}
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
disableSubmit,
|
disableSubmit,
|
||||||
|
upInfoEdit,
|
||||||
|
upElderInfoEdit,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,270 @@
|
||||||
|
<template>
|
||||||
|
<div class="container2">
|
||||||
|
<a-form ref="formRef" layout="horizontal" :model="formData" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="16">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="审核结果" name="status" v-bind="validateInfos.status">
|
||||||
|
<a-select v-model:value="formData.status" style="width: 200px" placeholder="请选择审核结果">
|
||||||
|
<a-select-option value="modifyPass">审核通过</a-select-option>
|
||||||
|
<a-select-option value="modifyFail">审核驳回</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12" v-if="formData.status == 'modifyFail'">
|
||||||
|
<a-form-item label="驳回原因" name="auditContent" v-bind="validateInfos.auditContent">
|
||||||
|
<a-textarea :maxlength="50" show-count v-model:value="formData.auditContent" placeholder="请输入驳回原因(如驳回)"
|
||||||
|
style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24" style="padding-top: 10px;padding-left: 30px;padding-right: 30px;">
|
||||||
|
<a-table :dataSource="filteredTableData" :columns="columns" :pagination="false" bordered size="small"
|
||||||
|
:rowClassName="setRowClassName">
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.dataIndex === 'd1'">
|
||||||
|
<span>{{ applyObj[record.d1] }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd2' && isImg(record.d1)">
|
||||||
|
<JImageUpload :fileMax="1" v-model:value="record.d2" disabled></JImageUpload>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd3' && isImg(record.d1)">
|
||||||
|
<JImageUpload :fileMax="1" v-model:value="record.d3" disabled></JImageUpload>
|
||||||
|
</template>
|
||||||
|
<template
|
||||||
|
v-if="column.dataIndex === 'd2' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
|
||||||
|
<span>{{ provinceOptions[record.d2] }}</span>
|
||||||
|
</template>
|
||||||
|
<template
|
||||||
|
v-if="column.dataIndex === 'd3' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
|
||||||
|
<span>{{ provinceOptions[record.d3] }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd2' && record.d1 == 'orgBuildingArea'">
|
||||||
|
<span>{{ record.d2 }}㎡</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd3' && record.d1 == 'orgBuildingArea'">
|
||||||
|
<span>{{ record.d3 }}㎡</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd2' && record.d1 == 'endTime'">
|
||||||
|
<span>{{ record.d2 == '9999-12-31' ? '长期' : record.d2 }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd3' && record.d1 == 'endTime'">
|
||||||
|
<span>{{ record.d3 == '9999-12-31' ? '长期' : record.d3 }}</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, computed, onMounted } from 'vue';
|
||||||
|
import { Table as ATable, Input, Row, Col, Form } from 'ant-design-vue';
|
||||||
|
import { applyObj } from '../ElderInfo.data'
|
||||||
|
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||||
|
import { getModifyInfo, elderAudit } from '../ElderInfo.api'
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { initDictOptions } from '/@/utils/dict';
|
||||||
|
|
||||||
|
const formRef = ref();
|
||||||
|
const AForm = Form;
|
||||||
|
const AFormItem = Form.Item;
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
// 表单标签布局配置
|
||||||
|
const labelCol = { span: 4 }; // 标签宽度
|
||||||
|
const wrapperCol = { span: 18 }; // 控件宽度
|
||||||
|
const isImg = (v_) => {
|
||||||
|
return v_ == 'idCardPositive' || v_ == 'idCardNegative' || v_ == 'healthCertificatePositive' || v_ == 'bankPositive' || v_ == 'bankNegative' || v_ == 'qualification' || v_ == 'noCrimeCertificate'
|
||||||
|
}
|
||||||
|
const provinceOptions = ref({})
|
||||||
|
const formData = reactive<Record<string, any>>({
|
||||||
|
status: undefined,
|
||||||
|
auditContent: '',
|
||||||
|
id: '',
|
||||||
|
pkId: ''
|
||||||
|
});
|
||||||
|
const validatorRules = reactive({
|
||||||
|
status: [{ required: true, message: '请选择审核结果!' },],
|
||||||
|
auditContent: [
|
||||||
|
{
|
||||||
|
validator: async (_rule, value) => {
|
||||||
|
if (formData.status === 'modifyFail' && !value) {
|
||||||
|
return Promise.reject('请输入驳回原因!');
|
||||||
|
}
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||||
|
const tableData = ref([]);
|
||||||
|
const emit = defineEmits(['ok']);
|
||||||
|
// 计算属性,过滤掉不需要显示的字段
|
||||||
|
const filteredTableData = computed(() => {
|
||||||
|
return tableData.value.filter(item =>
|
||||||
|
item.d1 !== 'id'
|
||||||
|
&& item.d1 !== 'nuId'
|
||||||
|
// && item.d1 !== 'name'
|
||||||
|
// && item.d1 !== 'sex'
|
||||||
|
&& item.d1 !== 'age'
|
||||||
|
// && item.d1 !== 'idCard'
|
||||||
|
// && item.d1 !== 'dateOfBirth'
|
||||||
|
// && item.d1 !== 'national'
|
||||||
|
// && item.d1 !== 'houseAddress'
|
||||||
|
&& item.d1 !== 'avatarPath'
|
||||||
|
&& item.d1 !== 'medicalType'
|
||||||
|
&& item.d1 !== 'reimbType'
|
||||||
|
&& item.d1 !== 'medicalCard'
|
||||||
|
&& item.d1 !== 'educationLevel'
|
||||||
|
&& item.d1 !== 'maritalStatus'
|
||||||
|
&& item.d1 !== 'religiousBeliefs'
|
||||||
|
// && item.d1 !== 'idCardPositive'
|
||||||
|
// && item.d1 !== 'idCardNegative'
|
||||||
|
&& item.d1 !== 'accountBookHimself'
|
||||||
|
&& item.d1 !== 'frontMedical'
|
||||||
|
&& item.d1 !== 'negaticeMedical'
|
||||||
|
&& item.d1 !== 'content'
|
||||||
|
&& item.d1 !== 'currentState'
|
||||||
|
&& item.d1 !== 'guardianOpenId'
|
||||||
|
&& item.d1 !== 'guardianName'
|
||||||
|
&& item.d1 !== 'relationship'
|
||||||
|
&& item.d1 !== 'guardianIdCard'
|
||||||
|
&& item.d1 !== 'guardianPhone'
|
||||||
|
&& item.d1 !== 'guardianDateOfBirth'
|
||||||
|
&& item.d1 !== 'guardianHomeAddress'
|
||||||
|
&& item.d1 !== 'guardianWorkUnit'
|
||||||
|
&& item.d1 !== 'homeAddress'
|
||||||
|
&& item.d1 !== 'delFlag'
|
||||||
|
&& item.d1 !== 'createBy'
|
||||||
|
&& item.d1 !== 'createTime'
|
||||||
|
&& item.d1 !== 'updateBy'
|
||||||
|
&& item.d1 !== 'updateTime'
|
||||||
|
&& item.d1 !== 'sysOrgCode'
|
||||||
|
// && item.d1 !== 'issuingAuthority'
|
||||||
|
// && item.d1 !== 'startTime'
|
||||||
|
// && item.d1 !== 'endTime'
|
||||||
|
&& item.d1 !== 'cardIssuing'
|
||||||
|
&& item.d1 !== 'bloodType'
|
||||||
|
&& item.d1 !== 'militaryType'
|
||||||
|
// && item.d1 !== 'guardianModifyStatus'
|
||||||
|
// && item.d1 !== 'guardianModifyContent'
|
||||||
|
// && item.d1 !== 'guardianModifyId'
|
||||||
|
// && item.d1 !== 'elderModifyStatus'
|
||||||
|
// && item.d1 !== 'elderModifyContent'
|
||||||
|
// && item.d1 !== 'elderModifyId'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'd1',
|
||||||
|
key: 'd1',
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '变更前',
|
||||||
|
dataIndex: 'd2',
|
||||||
|
key: 'd2',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '变更后',
|
||||||
|
dataIndex: 'd3',
|
||||||
|
key: 'd3',
|
||||||
|
ellipsis: true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// 设置行类名
|
||||||
|
const setRowClassName = (record) => {
|
||||||
|
return record.d2 !== record.d3 && record.d1 !== 'createTime' ? 'highlight-row' : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
async function show(record) {
|
||||||
|
console.log("🌊 ~ show ~ record:", record)
|
||||||
|
let data = await getModifyInfo({ id: record.id, queryModifyType: 'elder' })
|
||||||
|
console.log("🌊 ~ show ~ data:", data)
|
||||||
|
|
||||||
|
formData.id = record.id
|
||||||
|
formData.elderModifyId = record.elderModifyId
|
||||||
|
formData.guardianOpenId = record.guardianOpenId
|
||||||
|
formData.name = record.name
|
||||||
|
formData.sysOrgCode = record.sysOrgCode
|
||||||
|
|
||||||
|
tableData.value = data.map(item => ({
|
||||||
|
...item,
|
||||||
|
// 处理null/undefined显示为空字符串
|
||||||
|
d2: item.d2 ?? '',
|
||||||
|
d3: item.d3 ?? ''
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
elderAudit(formData)
|
||||||
|
.then((res) => {
|
||||||
|
emit('ok');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化numberValues
|
||||||
|
onMounted(async () => {
|
||||||
|
const dictData = await initDictOptions('sys_category,name,id,first_letter is not null order by code asc', '');
|
||||||
|
dictData.reduce((prev, next) => {
|
||||||
|
if (next) {
|
||||||
|
provinceOptions.value[next['value']] = next['text'] || next['label']
|
||||||
|
}
|
||||||
|
return prev;
|
||||||
|
}, []);
|
||||||
|
});
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
show,
|
||||||
|
submitForm
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.container2 {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.antd-modal-form {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-table-cell) {
|
||||||
|
padding: 8px 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 高亮行样式
|
||||||
|
:deep(.highlight-row) {
|
||||||
|
background-color: #fff1f0 !important; // 浅红色背景
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单样式调整
|
||||||
|
:deep(.ant-form-item) {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-table-cell-row-hover) {
|
||||||
|
// border: 1px solid red;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,270 @@
|
||||||
|
<template>
|
||||||
|
<div class="container2">
|
||||||
|
<a-form ref="formRef" layout="horizontal" :model="formData" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||||
|
<a-row :gutter="16">
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-form-item label="审核结果" name="status" v-bind="validateInfos.status">
|
||||||
|
<a-select v-model:value="formData.status" style="width: 200px" placeholder="请选择审核结果">
|
||||||
|
<a-select-option value="modifyPass">审核通过</a-select-option>
|
||||||
|
<a-select-option value="modifyFail">审核驳回</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12" v-if="formData.status == 'modifyFail'">
|
||||||
|
<a-form-item label="驳回原因" name="auditContent" v-bind="validateInfos.auditContent">
|
||||||
|
<a-textarea :maxlength="50" show-count v-model:value="formData.auditContent" placeholder="请输入驳回原因(如驳回)"
|
||||||
|
style="width: 100%" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24" style="padding-top: 10px;padding-left: 30px;padding-right: 30px;">
|
||||||
|
<a-table :dataSource="filteredTableData" :columns="columns" :pagination="false" bordered size="small"
|
||||||
|
:rowClassName="setRowClassName">
|
||||||
|
<template #bodyCell="{ column, record }">
|
||||||
|
<template v-if="column.dataIndex === 'd1'">
|
||||||
|
<span>{{ applyObj[record.d1] }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd2' && isImg(record.d1)">
|
||||||
|
<JImageUpload :fileMax="1" v-model:value="record.d2" disabled></JImageUpload>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd3' && isImg(record.d1)">
|
||||||
|
<JImageUpload :fileMax="1" v-model:value="record.d3" disabled></JImageUpload>
|
||||||
|
</template>
|
||||||
|
<template
|
||||||
|
v-if="column.dataIndex === 'd2' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
|
||||||
|
<span>{{ provinceOptions[record.d2] }}</span>
|
||||||
|
</template>
|
||||||
|
<template
|
||||||
|
v-if="column.dataIndex === 'd3' && (record.d1 == 'orgProvince' || record.d1 == 'orgCity' || record.d1 == 'orgDistrict')">
|
||||||
|
<span>{{ provinceOptions[record.d3] }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd2' && record.d1 == 'orgBuildingArea'">
|
||||||
|
<span>{{ record.d2 }}㎡</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd3' && record.d1 == 'orgBuildingArea'">
|
||||||
|
<span>{{ record.d3 }}㎡</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd2' && record.d1 == 'endTime'">
|
||||||
|
<span>{{ record.d2 == '9999-12-31' ? '长期' : record.d2 }}</span>
|
||||||
|
</template>
|
||||||
|
<template v-if="column.dataIndex === 'd3' && record.d1 == 'endTime'">
|
||||||
|
<span>{{ record.d3 == '9999-12-31' ? '长期' : record.d3 }}</span>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</a-table>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, computed, onMounted } from 'vue';
|
||||||
|
import { Table as ATable, Input, Row, Col, Form } from 'ant-design-vue';
|
||||||
|
import { applyObj } from '../ElderInfo.data'
|
||||||
|
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
|
||||||
|
import { getModifyInfo, guaAudit } from '../ElderInfo.api'
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import { initDictOptions } from '/@/utils/dict';
|
||||||
|
|
||||||
|
const formRef = ref();
|
||||||
|
const AForm = Form;
|
||||||
|
const AFormItem = Form.Item;
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
// 表单标签布局配置
|
||||||
|
const labelCol = { span: 4 }; // 标签宽度
|
||||||
|
const wrapperCol = { span: 18 }; // 控件宽度
|
||||||
|
const isImg = (v_) => {
|
||||||
|
return v_ == 'idCardPositive' || v_ == 'idCardNegative' || v_ == 'healthCertificatePositive' || v_ == 'bankPositive' || v_ == 'bankNegative' || v_ == 'qualification' || v_ == 'noCrimeCertificate'
|
||||||
|
}
|
||||||
|
const provinceOptions = ref({})
|
||||||
|
const formData = reactive<Record<string, any>>({
|
||||||
|
status: undefined,
|
||||||
|
auditContent: '',
|
||||||
|
id: '',
|
||||||
|
pkId: ''
|
||||||
|
});
|
||||||
|
const validatorRules = reactive({
|
||||||
|
status: [{ required: true, message: '请选择审核结果!' },],
|
||||||
|
auditContent: [
|
||||||
|
{
|
||||||
|
validator: async (_rule, value) => {
|
||||||
|
if (formData.status === 'modifyFail' && !value) {
|
||||||
|
return Promise.reject('请输入驳回原因!');
|
||||||
|
}
|
||||||
|
return Promise.resolve();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
})
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
|
||||||
|
const tableData = ref([]);
|
||||||
|
const emit = defineEmits(['ok']);
|
||||||
|
// 计算属性,过滤掉不需要显示的字段
|
||||||
|
const filteredTableData = computed(() => {
|
||||||
|
return tableData.value.filter(item =>
|
||||||
|
item.d1 !== 'id'
|
||||||
|
&& item.d1 !== 'nuId'
|
||||||
|
&& item.d1 !== 'name'
|
||||||
|
&& item.d1 !== 'sex'
|
||||||
|
&& item.d1 !== 'age'
|
||||||
|
&& item.d1 !== 'idCard'
|
||||||
|
&& item.d1 !== 'dateOfBirth'
|
||||||
|
&& item.d1 !== 'national'
|
||||||
|
&& item.d1 !== 'houseAddress'
|
||||||
|
&& item.d1 !== 'avatarPath'
|
||||||
|
&& item.d1 !== 'medicalType'
|
||||||
|
&& item.d1 !== 'reimbType'
|
||||||
|
&& item.d1 !== 'medicalCard'
|
||||||
|
&& item.d1 !== 'educationLevel'
|
||||||
|
&& item.d1 !== 'maritalStatus'
|
||||||
|
&& item.d1 !== 'religiousBeliefs'
|
||||||
|
&& item.d1 !== 'idCardPositive'
|
||||||
|
&& item.d1 !== 'idCardNegative'
|
||||||
|
&& item.d1 !== 'accountBookHimself'
|
||||||
|
&& item.d1 !== 'frontMedical'
|
||||||
|
&& item.d1 !== 'negaticeMedical'
|
||||||
|
&& item.d1 !== 'content'
|
||||||
|
&& item.d1 !== 'currentState'
|
||||||
|
&& item.d1 !== 'guardianOpenId'
|
||||||
|
// && item.d1 !== 'guardianName'
|
||||||
|
// && item.d1 !== 'relationship'
|
||||||
|
// && item.d1 !== 'guardianIdCard'
|
||||||
|
// && item.d1 !== 'guardianPhone'
|
||||||
|
&& item.d1 !== 'guardianDateOfBirth'
|
||||||
|
// && item.d1 !== 'guardianHomeAddress'
|
||||||
|
// && item.d1 !== 'guardianWorkUnit'
|
||||||
|
&& item.d1 !== 'homeAddress'
|
||||||
|
&& item.d1 !== 'delFlag'
|
||||||
|
&& item.d1 !== 'createBy'
|
||||||
|
&& item.d1 !== 'createTime'
|
||||||
|
&& item.d1 !== 'updateBy'
|
||||||
|
&& item.d1 !== 'updateTime'
|
||||||
|
&& item.d1 !== 'sysOrgCode'
|
||||||
|
&& item.d1 !== 'issuingAuthority'
|
||||||
|
&& item.d1 !== 'startTime'
|
||||||
|
&& item.d1 !== 'endTime'
|
||||||
|
&& item.d1 !== 'cardIssuing'
|
||||||
|
&& item.d1 !== 'bloodType'
|
||||||
|
&& item.d1 !== 'militaryType'
|
||||||
|
&& item.d1 !== 'guardianModifyStatus'
|
||||||
|
&& item.d1 !== 'guardianModifyContent'
|
||||||
|
&& item.d1 !== 'guardianModifyId'
|
||||||
|
&& item.d1 !== 'elderModifyStatus'
|
||||||
|
&& item.d1 !== 'elderModifyContent'
|
||||||
|
&& item.d1 !== 'elderModifyId'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: '名称',
|
||||||
|
dataIndex: 'd1',
|
||||||
|
key: 'd1',
|
||||||
|
width: 150,
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '变更前',
|
||||||
|
dataIndex: 'd2',
|
||||||
|
key: 'd2',
|
||||||
|
ellipsis: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '变更后',
|
||||||
|
dataIndex: 'd3',
|
||||||
|
key: 'd3',
|
||||||
|
ellipsis: true
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
// 设置行类名
|
||||||
|
const setRowClassName = (record) => {
|
||||||
|
return record.d2 !== record.d3 && record.d1 !== 'createTime' ? 'highlight-row' : '';
|
||||||
|
};
|
||||||
|
|
||||||
|
async function show(record) {
|
||||||
|
console.log("🌊 ~ show ~ record:", record)
|
||||||
|
let data = await getModifyInfo({ id: record.id, queryModifyType: 'gua' })
|
||||||
|
console.log("🌊 ~ show ~ data:", data)
|
||||||
|
|
||||||
|
formData.id = record.id
|
||||||
|
formData.guardianModifyId = record.guardianModifyId
|
||||||
|
formData.guardianOpenId = record.guardianOpenId
|
||||||
|
formData.name = record.name
|
||||||
|
formData.sysOrgCode = record.sysOrgCode
|
||||||
|
|
||||||
|
tableData.value = data.map(item => ({
|
||||||
|
...item,
|
||||||
|
// 处理null/undefined显示为空字符串
|
||||||
|
d2: item.d2 ?? '',
|
||||||
|
d3: item.d3 ?? ''
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
guaAudit(formData)
|
||||||
|
.then((res) => {
|
||||||
|
emit('ok');
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 初始化numberValues
|
||||||
|
onMounted(async () => {
|
||||||
|
const dictData = await initDictOptions('sys_category,name,id,first_letter is not null order by code asc', '');
|
||||||
|
dictData.reduce((prev, next) => {
|
||||||
|
if (next) {
|
||||||
|
provinceOptions.value[next['value']] = next['text'] || next['label']
|
||||||
|
}
|
||||||
|
return prev;
|
||||||
|
}, []);
|
||||||
|
});
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
show,
|
||||||
|
submitForm
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.container2 {
|
||||||
|
padding: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.antd-modal-form {
|
||||||
|
padding: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-table-cell) {
|
||||||
|
padding: 8px 12px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 高亮行样式
|
||||||
|
:deep(.highlight-row) {
|
||||||
|
background-color: #fff1f0 !important; // 浅红色背景
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单样式调整
|
||||||
|
:deep(.ant-form-item) {
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-table-cell-row-hover) {
|
||||||
|
// border: 1px solid red;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Loading…
Reference in New Issue