This commit is contained in:
1378012178@qq.com 2025-04-28 16:09:01 +08:00
commit 556cab7781
15 changed files with 2004 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -24,6 +24,40 @@
<j-dict-select-tag type='radio' v-model:value="formData.advisoryType" dictCode="advisory_type" placeholder="请选择咨询类型" allow-clear disabled/> <j-dict-select-tag type='radio' v-model:value="formData.advisoryType" dictCode="advisory_type" placeholder="请选择咨询类型" allow-clear disabled/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="24" v-if="formData.advisoryType == '1'">
<a-row>
<a-col :span="24">
<a-form-item label="老人姓名" v-bind="validateInfos.oldManName" id="NuBizAdvisoryInfoForm-oldManName" name="oldManName">
<a-input v-model:value="formData.oldManName" placeholder="请输入老人姓名" allow-clear disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="老人年龄" v-bind="validateInfos.oldManAge" id="NuBizAdvisoryInfoForm-oldManAge" name="oldManAge">
<a-input v-model:value="formData.oldManAge" placeholder="请输入老人年龄" allow-clear disabled ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="入住单元" v-bind="validateInfos.nuId" id="NuBizAdvisoryInfoForm-nuId" name="nuId">
<j-dict-select-tag type='list' v-model:value="formData.nuId" :dictCode="`nu_base_info,nu_name,id`" placeholder="请选报销类型" disabled allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="医保类型" v-bind="validateInfos.medicalInsuranceType" id="NuBizAdvisoryInfoForm-medicalInsuranceType" name="medicalInsuranceType">
<j-dict-select-tag type='radio' v-model:value="formData.medicalInsuranceType" dictCode="medical_insurance_type" placeholder="请选择医保类型" disabled allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="老人性别" v-bind="validateInfos.oldManSex" id="NuBizAdvisoryInfoForm-oldManSex" name="oldManSex">
<j-dict-select-tag type='radio' v-model:value="formData.oldManSex" dictCode="sex" placeholder="请选择性别" disabled allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="报销类型" v-bind="validateInfos.reimbType" id="NuBizAdvisoryInfoForm-reimbType" name="reimbType">
<j-dict-select-tag type='radio' v-model:value="formData.reimbType" dictCode="reimb_type" placeholder="请选报销类型" disabled allow-clear />
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :span="24"> <a-col :span="24">
<a-form-item label="审核状态" v-bind="validateInfos.status" id="NuBizAdvisoryInfoForm-status" name="status"> <a-form-item label="审核状态" v-bind="validateInfos.status" id="NuBizAdvisoryInfoForm-status" name="status">
<j-dict-select-tag type='radio' v-model:value="formData.status" dictCode="advisory_approval" placeholder="请选择状态" allow-clear /> <j-dict-select-tag type='radio' v-model:value="formData.status" dictCode="advisory_approval" placeholder="请选择状态" allow-clear />
@ -66,6 +100,12 @@
advisoryType: '', advisoryType: '',
status: '', status: '',
content: '', content: '',
oldManName: '',
oldManAge: '',
medicalInsuranceType: '',
oldManSex: '',
reimbType: '',
nuId: '',
}); });
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } }); const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/nuBaseInfo/nuBaseInfo/list',
save='/nuBaseInfo/nuBaseInfo/add',
edit='/nuBaseInfo/nuBaseInfo/edit',
deleteOne = '/nuBaseInfo/nuBaseInfo/delete',
deleteBatch = '/nuBaseInfo/nuBaseInfo/deleteBatch',
importExcel = '/nuBaseInfo/nuBaseInfo/importExcel',
exportXls = '/nuBaseInfo/nuBaseInfo/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,30 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '护理单元名称',
align: "center",
dataIndex: 'nuName'
},
{
title: '区域标签',
align: "center",
dataIndex: 'areaFlag_dictText'
},
{
title: '使用状态',
align: "center",
dataIndex: 'status_dictText'
},
];
// 高级查询数据
export const superQuerySchema = {
nuName: {title: '护理单元名称',order: 0,view: 'text', type: 'string',},
areaFlag: {title: '区域标签',order: 1,view: 'list', type: 'string',dictCode: 'nu_type',},
status: {title: '使用状态',order: 2,view: 'list', type: 'string',dictCode: 'nu_status',},
};

View File

@ -0,0 +1,262 @@
<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="nuName">
<template #label><span title="护理单元名称">护理单元名称</span></template>
<j-input placeholder="请输入护理单元名称" v-model:value="queryParam.nuName" allow-clear ></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="areaFlag">
<template #label><span title="区域标签">区域标签</span></template>
<j-select-multiple placeholder="请选择区域标签" v-model:value="queryParam.areaFlag" dictCode="nu_type" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="status">
<template #label><span title="使用状态">使用状态</span></template>
<j-select-multiple placeholder="请选择使用状态" v-model:value="queryParam.status" dictCode="nu_status" allow-clear />
</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" v-auth="'nuBaseInfo:nu_base_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'nuBaseInfo:nu_base_info:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'nuBaseInfo:nu_base_info:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button v-auth="'nuBaseInfo:nu_base_info:deleteBatch'">批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<NuBaseInfoModal ref="registerModal" @success="handleSuccess"></NuBaseInfoModal>
</div>
</template>
<script lang="ts" name="nuBaseInfo-nuBaseInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuBaseInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBaseInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuBaseInfoModal from './components/NuBaseInfoModal.vue'
import { useUserStore } from '/@/store/modules/user';
import { JInput } from '/@/components/Form';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.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,
showIndexColumn: true,
actionColumn: {
width: 160,
fixed: 'right',
},
beforeFetch: async (params) => {
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:6,
xl:6,
xxl:6
});
const wrapperCol = reactive({
xs: 24,
sm: 18,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
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);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'nuBaseInfo:nu_base_info:edit'
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'nuBaseInfo:nu_base_info:delete'
}
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</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>

View File

@ -0,0 +1,161 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuBaseInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="护理单元名称" v-bind="validateInfos.nuName" id="NuBaseInfoForm-nuName" name="nuName">
<a-input v-model:value="formData.nuName" placeholder="请输入护理单元名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="区域标签" v-bind="validateInfos.areaFlag" id="NuBaseInfoForm-areaFlag" name="areaFlag">
<j-dict-select-tag v-model:value="formData.areaFlag" dictCode="nu_type" placeholder="请选择区域标签ID" allow-clear />
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="使用状态 0未使用 1占用 2入住 3退住 4留床" v-bind="validateInfos.status" id="NuBaseInfoForm-status" name="status">
<j-dict-select-tag v-model:value="formData.status" dictCode="nu_status" placeholder="请选择使用状态 0未使用 1占用 2入住 3退住 4留床" allow-clear />
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuBaseInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.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: '',
nuName: '',
areaFlag: '',
status: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
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(',');
}
}
}
if (!model.id) {
model.status = "0";
}
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>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :maxHeight="`200px`" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<NuBaseInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuBaseInfoForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuBaseInfoForm from './NuBaseInfoForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/nuBizCustomerInfo/nuBizCustomerInfo/list',
save='/nuBizCustomerInfo/nuBizCustomerInfo/add',
edit='/nuBizCustomerInfo/nuBizCustomerInfo/edit',
deleteOne = '/nuBizCustomerInfo/nuBizCustomerInfo/delete',
deleteBatch = '/nuBizCustomerInfo/nuBizCustomerInfo/deleteBatch',
importExcel = '/nuBizCustomerInfo/nuBizCustomerInfo/importExcel',
exportXls = '/nuBizCustomerInfo/nuBizCustomerInfo/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,168 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '护理单元',
align: "center",
dataIndex: 'nuId_dictText'
},
{
title: '姓名',
align: "center",
dataIndex: 'customerName'
},
{
title: '性别',
align: "center",
dataIndex: 'customerSex'
},
{
title: '年龄',
align: "center",
dataIndex: 'customerAge_dictText'
},
{
title: '身份证号码',
align: "center",
dataIndex: 'idCard'
},
{
title: '出生日期',
align: "center",
dataIndex: 'dateOfBirth'
},
{
title: '民族',
align: "center",
dataIndex: 'national'
},
{
title: '自理程度',
align: "center",
dataIndex: 'selfCareType'
},
{
title: '头像',
align: "center",
dataIndex: 'avatarPath',
customRender: render.renderImage,
},
{
title: '医保类型',
align: "center",
dataIndex: 'medicalType_dictText'
},
{
title: '医保卡号',
align: "center",
dataIndex: 'medicalCard'
},
{
title: '文化程度',
align: "center",
dataIndex: 'educationLevel_dictText'
},
{
title: '婚姻状况',
align: "center",
dataIndex: 'maritalStatus'
},
{
title: '宗教信仰',
align: "center",
dataIndex: 'religiousBeliefs'
},
{
title: '身份证正面',
align: "center",
dataIndex: 'frontIdCard',
customRender: render.renderImage,
},
{
title: '身份证反面',
align: "center",
dataIndex: 'negativeIdCard',
customRender: render.renderImage,
},
{
title: '户口本本人页',
align: "center",
dataIndex: 'accountBookHimself',
customRender: render.renderImage,
},
{
title: '医保卡正面',
align: "center",
dataIndex: 'frontMedical',
customRender: render.renderImage,
},
{
title: '医保卡反面',
align: "center",
dataIndex: 'negaticeMedical',
customRender: render.renderImage,
},
{
title: '备注',
align: "center",
dataIndex: 'content'
},
{
title: '当前状态',
align: "center",
dataIndex: 'currentState_dictText'
},
{
title: '监护人',
align: "center",
dataIndex: 'guardian'
},
{
title: '关系',
align: "center",
dataIndex: 'relationship'
},
{
title: '联系电话',
align: "center",
dataIndex: 'contactNumber'
},
{
title: '家庭住址',
align: "center",
dataIndex: 'homeAddress'
},
];
// 高级查询数据
export const superQuerySchema = {
nuId: {title: '护理单元',order: 0,view: 'list', type: 'string',dictCode: '',},
customerName: {title: '姓名',order: 1,view: 'text', type: 'string',},
customerSex: {title: '性别',order: 2,view: 'text', type: 'string',},
customerAge: {title: '年龄',order: 3,view: 'list', type: 'string',dictCode: '',},
idCard: {title: '身份证号码',order: 4,view: 'text', type: 'string',},
dateOfBirth: {title: '出生日期',order: 5,view: 'text', type: 'string',},
national: {title: '民族',order: 6,view: 'text', type: 'string',},
selfCareType: {title: '自理程度',order: 7,view: 'text', type: 'string',},
avatarPath: {title: '头像',order: 8,view: 'image', type: 'string',},
medicalType: {title: '医保类型',order: 9,view: 'list', type: 'string',dictCode: 'medical_insurance_type',},
medicalCard: {title: '医保卡号',order: 10,view: 'text', type: 'string',},
educationLevel: {title: '文化程度',order: 11,view: 'list', type: 'string',dictCode: '',},
maritalStatus: {title: '婚姻状况',order: 12,view: 'text', type: 'string',},
religiousBeliefs: {title: '宗教信仰',order: 13,view: 'text', type: 'string',},
frontIdCard: {title: '身份证正面',order: 14,view: 'image', type: 'string',},
negativeIdCard: {title: '身份证反面',order: 15,view: 'image', type: 'string',},
accountBookHimself: {title: '户口本本人页',order: 16,view: 'image', type: 'string',},
frontMedical: {title: '医保卡正面',order: 17,view: 'image', type: 'string',},
negaticeMedical: {title: '医保卡反面',order: 18,view: 'image', type: 'string',},
content: {title: '备注',order: 19,view: 'textarea', type: 'string',},
currentState: {title: '当前状态',order: 20,view: 'list', type: 'string',dictCode: '',},
guardian: {title: '监护人',order: 21,view: 'text', type: 'string',},
relationship: {title: '关系',order: 22,view: 'text', type: 'string',},
contactNumber: {title: '联系电话',order: 23,view: 'text', type: 'string',},
homeAddress: {title: '家庭住址',order: 24,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,240 @@
<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="customerName">
<template #label><span title="姓名">姓名</span></template>
<a-input placeholder="请输入姓名" v-model:value="queryParam.customerName" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="contactNumber">
<template #label><span title="联系电话">联系电话</span></template>
<a-input placeholder="请输入联系电话" v-model:value="queryParam.contactNumber" 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" v-auth="'nuBizCustomerInfo:nu_biz_customer_info:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'nuBizCustomerInfo:nu_biz_customer_info:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'nuBizCustomerInfo:nu_biz_customer_info:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<NuBizCustomerInfoModal ref="registerModal" @success="handleSuccess"></NuBizCustomerInfoModal>
</div>
</template>
<script lang="ts" name="nuBizCustomerInfo-nuBizCustomerInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuBizCustomerInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizCustomerInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuBizCustomerInfoModal from './components/NuBizCustomerInfoModal.vue'
import { useUserStore } from '/@/store/modules/user';
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',
},
beforeFetch: async (params) => {
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 handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
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);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'nuBizCustomerInfo:nu_biz_customer_info:edit'
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [ {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'nuBizCustomerInfo:nu_biz_customer_info:delete'
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</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>

View File

@ -0,0 +1,323 @@
<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="customerName">
<template #label><span title="姓名">姓名</span></template>
<a-input placeholder="请输入姓名" v-model:value="queryParam.customerName" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="contactNumber">
<template #label><span title="联系电话">联系电话</span></template>
<a-input placeholder="请输入联系电话" v-model:value="queryParam.contactNumber" 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>
<a-row>
<a-col :span="6" v-for="(item,index) in dataList" :key="index">
<a-card class="cardClass">
<template #title>
{{item.customerName}} /
{{item.customerSex_dictText?item.customerSex_dictText:'无'}} /
<span v-if="item.currentState=='0'" style="color: #1890ff">{{item.currentState_dictText}}</span>
<span v-if="item.currentState=='1'" style="color: green">{{item.currentState_dictText}}</span>
<span v-if="item.currentState=='2'" style="color: #ff6c00">{{item.currentState_dictText}}</span>
<span v-if="item.currentState=='3'" style="color: red">{{item.currentState_dictText}}</span>
</template>
<template #extra><a title="操作">
<a-popover title="功能" style="width: 300px;" placement="topRight">
<template #content>
<div>
<span class="buttonMargin">
<a-button type="primary" @click="handleEdit(item)">编辑</a-button>
</span>
<span class="buttonMargin" v-if="item.currentState!='3'">
<a-button type="primary" @click="handleCheckNu(item)">更换护理单元</a-button>
</span>
<span class="buttonMargin" v-if="item.currentState=='1'">
<a-button type="primary" @click="handleWaichu(item)">外出</a-button>
</span>
<span class="buttonMargin" v-if="item.currentState=='2'">
<a-button type="primary" @click="handleFanhui(item)">返回</a-button>
</span>
<span class="buttonMargin" v-if="item.currentState=='1' || item.currentState=='2'">
<a-button type="primary" @click="handleTuizhu(item)">退住</a-button>
</span>
</div>
</template>
<icon icon="ant-design:setting-outlined" />
</a-popover>
</a></template>
<!-- 人员信息 -->
<a-row>
<a-col :span="8" style="padding: 0 8px;">
<img
width="100%"
:src="handleHeadPath(item.headPath)"
@error="setDefaultImage"
/>
</a-col>
<a-col :span="16">
<p>护理单元{{item.nuId_dictText }}</p>
<p>报销类型{{item.reimbType_dictText }}</p>
<p>医保类型{{item.medicalType_dictText }}</p>
<p>联系电话{{item.contactNumber }}</p>
</a-col>
</a-row>
</a-card>
</a-col>
<a-col :span="24" style="text-align: right;">
<a-pagination v-model:current="current" v-model:page-size="pageSize" :total="total" show-less-items @change="onPageChange" />
</a-col>
</a-row>
<!-- 表单区域 -->
<NuBizCustomerInfoModal ref="registerModal" @success="handleSuccess"></NuBizCustomerInfoModal>
<CheckNuListModal ref="checkNuListModal" @success="handleSuccess"></CheckNuListModal>
</div>
</template>
<script lang="ts" name="nuBizCustomerInfo-nuBizCustomerInfo" setup>
import { ref, reactive , onMounted} from 'vue';
import { useListPage } from '/@/hooks/system/useListPage';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './NuBizCustomerInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuBizCustomerInfoModal from './components/NuBizCustomerInfoModal.vue'
import CheckNuListModal from './components/CheckNuListModal.vue'
import { useUserStore } from '/@/store/modules/user';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import { defHttp } from '/@/utils/http/axios';
import { Pagination } from 'ant-design-vue';
const APagination = Pagination;
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const checkNuListModal = ref();
const userStore = useUserStore();
const dataList = ref<any[]>([]);
const current = ref(1);
const pageSize = ref(8);
const total = ref(0);
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
function handleCheckNu(record){
checkNuListModal.value.disableSubmit = false;
checkNuListModal.value.edit(record);
}
//退
function handleTuizhu(record){
defHttp.post({ url: "/nuBizCustomerInfo/nuBizCustomerInfo/editTuizhu", params: { id: record.id } }).then((data) => {
reload();
});
}
//
function handleWaichu(record){
defHttp.post({ url: "/nuBizCustomerInfo/nuBizCustomerInfo/edit", params: { id: record.id,currentStatus:'2' } }).then((data) => {
reload();
});
}
//
function handleFanhui(record){
defHttp.post({ url: "/nuBizCustomerInfo/nuBizCustomerInfo/edit", params: { id: record.id,currentStatus:'1' } }).then((data) => {
reload();
});
}
//logo
function handleHeadPath(headPath){
console.log('headPath--->',headPath);
if(headPath){
return getFileAccessHttpUrl(headPath);
}else{
return '../../../../../public/resource/img/logo.png';
}
}
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
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);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'nuBizCustomerInfo:nu_biz_customer_info:edit'
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [ {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'nuBizCustomerInfo:nu_biz_customer_info:delete'
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
//
reload();
}
function onPageChange(page,pageSize){
console.log('onPageChange', page,pageSize);
current.value = page;
reload();
}
function reload(){
queryParam.pageSize = pageSize;
queryParam.pageNo = current;
queryParam.column = "createTime";
queryParam.order = "desc";
console.log('queryParam',queryParam);
defHttp.get({url:'/nuBizCustomerInfo/nuBizCustomerInfo/list',params:queryParam}).then(res=>{
console.log(res);
dataList.value = res.records;
total.value = res.total;
})
}
//
onMounted(() => {
reload();
});
</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%;
}
}
.cardClass{
margin: 5px;
//
border-radius: 5px;
transition: box-shadow 0.3s ease-in-out;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
}
.buttonMargin{
margin: 3px;
}
</style>

View File

@ -0,0 +1,67 @@
<template>
<div>
<div v-for="(item, index) in nulistSource" :key="index" style="padding: 4px">
<a-card :title="index+1 +'、'+ item.nuName" style="width: 100%">
<template #extra><a @click="handleCheckNu(item)" >{{nuId == item.id?'已选择':'选择'}}</a></template>
</a-card>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import axios from 'axios';
const emit = defineEmits(['register', 'ok']);
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const nulistSource = ref([]);
const customerInfo = ref<any>({});
const nuId = ref<string>('');
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
customerInfo.value = record;
const getNulistUrl = "/h5Api/nuBaseInfo/list";
defHttp.get({ url: getNulistUrl }).then((data) => {
nulistSource.value = data;
});
}
/**
* 提交数据
*/
async function submitForm() {
defHttp.post({ url: '/nuBizCustomerInfo/nuBizCustomerInfo/editNu', params: customerInfo.value }).then((data) => {
emit('ok');
});
}
function handleCheckNu(record) {
customerInfo.value.nuId = record.id;
nuId.value = record.id;
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<CheckNuListForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></CheckNuListForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import CheckNuListForm from './CheckNuListForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '选择护理单元';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback(record) {
handleCancel();
emit('success',record);
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,338 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuBizCustomerInfoForm">
<a-card title="基础信息">
<a-row>
<a-col :span="18">
<a-row>
<a-col :span="8">
<a-form-item label="姓名" v-bind="validateInfos.customerName" id="NuBizCustomerInfoForm-customerName" name="customerName">
<a-input v-model:value="formData.customerName" placeholder="请输入姓名" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="性别" v-bind="validateInfos.customerSex" id="NuBizCustomerInfoForm-customerSex" name="customerSex">
<j-dict-select-tag v-model:value="formData.customerSex" dictCode="sex" placeholder="请选择性别" allow-clear />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="身份证号码" v-bind="validateInfos.idCard" id="NuBizCustomerInfoForm-idCard" name="idCard">
<a-input v-model:value="formData.idCard" placeholder="请输入身份证号码" allow-clear @change="handleChangeIdcard"></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="年龄" v-bind="validateInfos.customerAge" id="NuBizCustomerInfoForm-customerAge" name="customerAge">
<a-input v-model:value="formData.customerAge" placeholder="请输入年龄" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="出生日期" v-bind="validateInfos.dateOfBirth" id="NuBizCustomerInfoForm-dateOfBirth" name="dateOfBirth">
<a-input v-model:value="formData.dateOfBirth" placeholder="请输入出生日期" disabled allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="民族" v-bind="validateInfos.national" id="NuBizCustomerInfoForm-national" name="national">
<a-input v-model:value="formData.national" placeholder="请输入民族" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="自理程度" v-bind="validateInfos.reimbType" id="NuBizCustomerInfoForm-reimreimbTypeb_type" name="reimbType">
<j-dict-select-tag v-model:value="formData.reimbType" dictCode="reimb_type" placeholder="请选择自理程度" allow-clear />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="医保类型" v-bind="validateInfos.medicalType" id="NuBizCustomerInfoForm-medicalType" name="medicalType">
<j-dict-select-tag v-model:value="formData.medicalType" dictCode="medical_insurance_type" placeholder="请选择医保类型" allow-clear />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="医保卡号" v-bind="validateInfos.medicalCard" id="NuBizCustomerInfoForm-medicalCard" name="medicalCard">
<a-input v-model:value="formData.medicalCard" placeholder="请输入医保卡号" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-col>
<a-col :span="6">
<a-col :span="24">
<a-form-item label="头像" v-bind="validateInfos.avatarPath" id="NuBizCustomerInfoForm-avatarPath" name="avatarPath">
<j-image-upload :fileMax="1" :bizPath="`customerHead`" v-model:value="formData.avatarPath" text="上传头像" ></j-image-upload>
</a-form-item>
</a-col>
</a-col>
<a-col :span="24" hidden>
<a-form-item label="护理单元" v-bind="validateInfos.nuId" id="NuBizCustomerInfoForm-nuId" name="nuId">
<j-dict-select-tag v-model:value="formData.nuId" dictCode="" placeholder="请选择护理单元" allow-clear />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="监护人" v-bind="validateInfos.guardian" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-guardian" name="guardian">
<a-input v-model:value="formData.guardian" placeholder="请输入监护人" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="联系电话" v-bind="validateInfos.contactNumber" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-contactNumber" name="contactNumber">
<a-input v-model:value="formData.contactNumber" placeholder="请输入联系电话" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="关系" v-bind="validateInfos.relationship" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-relationship" name="relationship">
<a-input v-model:value="formData.relationship" placeholder="请输入关系" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="宗教信仰" v-bind="validateInfos.religiousBeliefs" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-religiousBeliefs" name="religiousBeliefs">
<a-input v-model:value="formData.religiousBeliefs" placeholder="请输入宗教信仰" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="文化程度" v-bind="validateInfos.educationLevel" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-educationLevel" name="educationLevel">
<j-dict-select-tag v-model:value="formData.educationLevel" dictCode="" placeholder="请选择文化程度" allow-clear />
</a-form-item>
</a-col>
<a-col :span="6">
<a-form-item label="婚姻状况" v-bind="validateInfos.maritalStatus" :labelCol="labelCol2" :wrapperCol="wrapperCol2" id="NuBizCustomerInfoForm-maritalStatus" name="maritalStatus">
<a-input v-model:value="formData.maritalStatus" placeholder="请输入婚姻状况" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="家庭住址" v-bind="validateInfos.homeAddress" :labelCol="labelCol3" :wrapperCol="wrapperCol3" id="NuBizCustomerInfoForm-homeAddress" name="homeAddress">
<a-input v-model:value="formData.homeAddress" placeholder="请输入家庭住址" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="备注" v-bind="validateInfos.content" :labelCol="labelCol3" :wrapperCol="wrapperCol3" id="NuBizCustomerInfoForm-content" name="content">
<a-textarea v-model:value="formData.content" :rows="4" placeholder="请输入备注" />
</a-form-item>
</a-col>
</a-row>
</a-card>
<a-card title="证件信息信息" style="margin-top: 20px;">
<a-tabs v-model:activeKey="activeKey" type="card">
<a-tab-pane key="1" tab="身份证">
<a-row>
<a-col :span="12">
<a-form-item label="身份证正面" v-bind="validateInfos.frontIdCard" id="NuBizCustomerInfoForm-frontIdCard" name="frontIdCard">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.frontIdCard" ></j-image-upload>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="身份证反面" v-bind="validateInfos.negativeIdCard" id="NuBizCustomerInfoForm-negativeIdCard" name="negativeIdCard">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.negativeIdCard" ></j-image-upload>
</a-form-item>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane key="2" tab="户口本">
<a-row>
<a-col :span="12">
<a-form-item label="户口本本人页" v-bind="validateInfos.accountBookHimself" id="NuBizCustomerInfoForm-accountBookHimself" name="accountBookHimself">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.accountBookHimself" ></j-image-upload>
</a-form-item>
</a-col>
</a-row>
</a-tab-pane>
<a-tab-pane key="3" tab="医保卡">
<a-row>
<a-col :span="12">
<a-form-item label="医保卡正面" v-bind="validateInfos.frontMedical" id="NuBizCustomerInfoForm-frontMedical" name="frontMedical">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.frontMedical" ></j-image-upload>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="医保卡反面" v-bind="validateInfos.negaticeMedical" id="NuBizCustomerInfoForm-negaticeMedical" name="negaticeMedical">
<j-image-upload :fileMax="1" :bizPath="`customerZzxx`" v-model:value="formData.negaticeMedical" ></j-image-upload>
</a-form-item>
</a-col>
</a-row>
</a-tab-pane>
</a-tabs>
</a-card>
<a-row>
<!-- <a-col :span="24">
<a-form-item label="当前状态" v-bind="validateInfos.currentState" id="NuBizCustomerInfoForm-currentState" name="currentState">
<j-dict-select-tag v-model:value="formData.currentState" dictCode="" placeholder="请选择当前状态" allow-clear />
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../NuBizCustomerInfo.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import dayjs from "dayjs";
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 activeKey = ref('1');
const formData = reactive<Record<string, any>>({
id: '',
nuId: '',
customerName: '',
customerSex: '',
customerAge: '',
idCard: '',
dateOfBirth: '',
national: '',
reimbType: '',
avatarPath: '',
medicalType: '',
medicalCard: '',
educationLevel: '',
maritalStatus: '',
religiousBeliefs: '',
frontIdCard: '',
negativeIdCard: '',
accountBookHimself: '',
frontMedical: '',
negaticeMedical: '',
content: '',
currentState: '',
guardian: '',
relationship: '',
contactNumber: '',
homeAddress: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 7 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol3 = ref<any>({ xs: { span: 24 }, sm: { span: 2 } });
const wrapperCol3 = ref<any>({ xs: { span: 24 }, sm: { span: 21 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
customerName: [{ required: true, message: '请输入姓名!'},],
idCard: [{ required: true, message: '请输入身份证号码!'}, { pattern: '^\\d{6}(18|19|20)?\\d{2}(0[1-9]|1[012])(0[1-9]|[12]\\d|3[01])\\d{3}(\\d|[xX])$', message: '身份证号错误!' }],
contactNumber: [{ required: true, message: '请输入联系电话!'},],
});
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 handleChangeIdcard(){
const item = formData.idCard;
if(item.length === 18){
formData.dateOfBirth = item.substring(6, 10) + '-' + item.substring(10, 12) + '-' + item.substring(12, 14);
var year = dayjs().format('YYYY')
formData.customerAge = parseInt(year) - item.substring(6, 10);
// formData.national = item.substring(14, 16);
}
}
/**
* 新增
*/
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>

View File

@ -0,0 +1,77 @@
<template>
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<NuBizCustomerInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></NuBizCustomerInfoForm>
</j-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuBizCustomerInfoForm from './NuBizCustomerInfoForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<string>('80%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>