服务对象列表,所在区域组件,服务对象详情

This commit is contained in:
Leo_Ding 2025-10-10 20:47:14 +08:00
parent 91837700df
commit 23b0f6efc5
23 changed files with 982 additions and 375 deletions

View File

@ -6,6 +6,8 @@ export const getRegion = (params) => request.basic.get('/region', params)
// 获取 验证码ID
export const getCaptcha = (params) => request.basic.get('/api/v1/captcha/id', params)
export const getDictByType = (type) => request.basic.get(`/api/v1/dictionaries?categoryCode=${type}`)
export const getAreaList = (params) => request.basic.get('/api/v1/areas', params)
export const getChildAreaList = (id) => request.basic.get(`/api/v1/areas/${id}`)
//上传图片
export const uploadFile=(params)=>request.basic.post('/api/v1/upload',params,{
headers: {

View File

@ -0,0 +1,120 @@
<!-- AreaCascader.vue -->
<template>
<a-cascader v-model:value="modelValue" :options="options" :load-data="loadData" :placeholder="placeholder"
:style="style" :disabled="disabled" :show-search="showSearch" :allow-clear="allowClear"
:change-on-select="changeOnSelect" :field-names="fieldNames" @change="handleChange" />
</template>
<script setup>
import { ref, watch, onMounted,defineModel } from 'vue';
import apis from '@/apis'
// 使 defineModel v-model
const modelValue = defineModel();
// props
const props = defineProps({
placeholder: {
type: String,
default: '请选择省市区'
},
style: {
type: Object,
default: () => ({ width: '100%' })
},
disabled: {
type: Boolean,
default: false
},
showSearch: {
type: Boolean,
default: true
},
allowClear: {
type: Boolean,
default: true
},
changeOnSelect: {
type: Boolean,
default: false //
},
fieldNames: {
type: Object,
default: () => ({
label: 'label',
value: 'code',
// children: 'children'
})
}
});
// emit
const emit = defineEmits(['change']);
//
const options = ref([]);
//
const loadProvinces = async () => {
try {
const response = await apis.common.getAreaList({current:1,pageSize:100});
console.log('获取省份响应:', response);
if (Array.isArray(response.data)) {
options.value = response.data.map(province => ({
...province,
isLeaf: !province.hasChild //
}));
console.log('省份数据加载成功:', options.value);
} else {
console.warn('获取省份失败:', response.data.message);
}
} catch (error) {
console.error('请求省份数据失败:', error);
}
};
//
const loadData = async (selectedOptions) => {
console.log('加载子节点, 选中选项:', selectedOptions);
const targetOption = selectedOptions[selectedOptions.length - 1];
targetOption.loading = true;
try {
const response = await apis.common.getAreaList({ current:1,pageSize:100,parentId: targetOption.id });
targetOption.loading = false;
if (Array.isArray(response.data)) {
const children = response.data.map(item => ({
...item,
isLeaf: !item.hasChild // /
}));
// children
targetOption.children = children;
} else {
targetOption.children = [];
}
//
options.value = [...options.value];
} catch (error) {
console.error('加载子节点失败:', error);
targetOption.children = [];
targetOption.loading = false;
}
};
//
const handleChange = (value, selectedOptions) => {
emit('change', value, selectedOptions.map(option => option.label));
};
//
onMounted(() => {
loadProvinces();
});
</script>
<style scoped>
/* 可根据需要添加样式 */
</style>

View File

@ -20,6 +20,7 @@ import UploadInput from './Upload/UploadInput.vue'
import Scrollbar from './Scrollbar/Scrollbar.vue'
import Cascader from './Cascader/Cascader.vue'
import { setupLoadingDirective } from './Loading/directive'
import GxUpload from './GxUpload/index.vue'
const componentList = [
ActionBar,
@ -41,6 +42,7 @@ const componentList = [
UploadInput,
Scrollbar,
Cascader,
GxUpload,
]
export const loading = Loading

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,229 @@
<template>
<div>
<a-row :gutter="20">
<!-- 基本信息 -->
<a-col :span="8">
<div ><span class="label">服务对象姓名姓名:</span> {{ formData.name || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">性别:</span> {{ formData.gender || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">出生日期:</span> {{ formData.birthDate || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">关爱巡访电话:</span> {{ formData.careVisitPhone || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">联系方式:</span> {{ formData.contact1 || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">其他电话1:</span> {{ formData.otherPhone1 || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">其他电话2:</span> {{ formData.otherPhone2 || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">联系状态:</span> {{ formData.contactStatus || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">社保卡号:</span> {{ formData.socialSecurityCardNumber || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">证件类型:</span> {{ formData.identityType || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">证件号码:</span> {{ formData.idNumber || '-' }}</div>
</a-col>
<a-col :span="24">
<div >
<span class="label">家庭地址:</span>
{{ formatArea(formData.homeAreaLabels) }} {{ formData.homeDetailAddress || '' }}
<span v-if="formData.lag && formData.lat" style="color: #999;">
(经度: {{ formData.lag }}, 纬度: {{ formData.lat }})
</span>
</div>
</a-col>
<a-col :span="8">
<div ><span class="label">护理等级:</span> {{ formData.nursingLevel || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">健康状况:</span> {{ formData.healthStatus || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">生存状态:</span> {{ formData.survivalStatus || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">服务状态:</span> {{ formData.serviceStatus || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">服务形式:</span> {{ formData.serviceForm || '-' }}</div>
</a-col>
<a-col :span="24">
<div >
<span class="label">户籍地址:</span>
{{ formatArea(formData.houseAreaLabels) }} {{ formData.householdDetailAddress || '' }}
</div>
</a-col>
<!-- 政府购买服务时间 -->
<a-col :span="8">
<div >
<span class="label">政府购买服务开始时间():</span>
{{ formatDate(formData.governmentPurchasedServiceStartDateStart) }}
</div>
</a-col>
<a-col :span="8">
<div >
<span class="label">政府购买服务开始时间():</span>
{{ formatDate(formData.governmentPurchasedServiceStartDateEnd) }}
</div>
</a-col>
<!-- 其他字段 -->
<a-col :span="8">
<div ><span class="label">居住情况:</span> {{ formData.livingSituation || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">子女情况:</span> {{ formData.childrenSituation || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">统计分类:</span> {{ formData.statisticsCategory || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">智力情况:</span> {{ formData.intellectualSituation || '-' }}</div>
</a-col>
<a-col :span="8">
<div >
<span class="label">长期照料失能子女:</span>
{{ formData.longTermCareForDisabledChildren === 'true' ? '是' : formData.longTermCareForDisabledChildren === 'false' ? '否' : '-' }}
</div>
</a-col>
<a-col :span="8">
<div ><span class="label">子女探望情况:</span> {{ formData.childrenVisitStatus || '-' }}</div>
</a-col>
<a-col :span="8">
<div >
<span class="label">人户分离:</span>
{{ formData.householdResidenceSeparation === 'true' ? '是' : formData.householdResidenceSeparation === 'false' ? '否' : '-' }}
</div>
</a-col>
<a-col :span="8">
<div ><span class="label">民族:</span> {{ formData.ethnicity || '-' }}</div>
</a-col>
<a-col :span="8">
<div >
<span class="label">完成能力评估:</span>
{{ formData.completedCapacityAssessment === 'true' ? '是' : formData.completedCapacityAssessment === 'false' ? '否' : '-' }}
</div>
</a-col>
<a-col :span="8">
<div >
<span class="label">住出租屋/地下室:</span>
{{ formData.livesInRentedRoomOrBasement === 'true' ? '是' : formData.livesInRentedRoomOrBasement === 'false' ? '否' : '-' }}
</div>
</a-col>
<a-col :span="8">
<div ><span class="label">经济来源:</span> {{ formData.economicSource || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">文化程度:</span> {{ formData.educationLevel || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">宗教信仰:</span> {{ formData.religion || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">职业情况:</span> {{ formData.occupation || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">政治面貌:</span> {{ formData.politicalAffiliation || '-' }}</div>
</a-col>
<a-col :span="8">
<div ><span class="label">婚姻情况:</span> {{ formData.maritalStatus || '-' }}</div>
</a-col>
<!-- 数组类字段 -->
<a-col :span="24" v-if="formData.idCardPhotos && formData.idCardPhotos.length > 0">
<div >
<span class="label">身份证照片:</span>
<div style="margin-top: 8px;">
<a-image
v-for="(url, index) in formData.idCardPhotos"
:key="index"
:src="url"
fit="cover"
style="width: 100px; height: 60px; margin-right: 8px;"
:preview-src-list="formData.idCardPhotos"
/>
</div>
</div>
</a-col>
</a-row>
</div>
</template>
<script setup>
import { ref, defineProps } from 'vue';
const formData=ref({});
//
const formatArea = (areaArray) => {
if (!areaArray || !Array.isArray(areaArray)) return '-';
return areaArray.filter(item => item).join(' / ');
};
//
const formatDate = (date) => {
if (!date) return '-';
return new Date(date).toLocaleDateString();
};
//
const openFile = (url) => {
window.open(url, '_blank');
};
</script>
<style scoped>
.customer-detail {
padding: 20px;
font-size: 14px;
color: #333;
}
.field-item {
margin-bottom: 12px;
line-height: 1.6;
}
.label {
display: inline-block;
line-height: 45px;
}
.cursor-pointer {
cursor: pointer;
}
:deep(.el-tag) {
cursor: pointer;
}
</style>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -17,8 +17,8 @@
<a-col :span="12">
<a-form-item label="性别" name="gender">
<a-radio-group v-model:value="formData.gender">
<a-radio value="MAN"></a-radio>
<a-radio value="WOMAN"></a-radio>
<a-radio value="1"></a-radio>
<a-radio value="2"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
@ -27,8 +27,11 @@
<a-col :span="12">
<a-form-item label="证件号码" name="idNumber" :rules="[{ required: true, message: '请输入证件号码' }]">
<span style="display: inline-flex; width: 100%;">
<a-select v-model:value="formData.idType" style="width: 100px; margin-right: 8px;">
<a-select-option value="身份证">身份证</a-select-option>
<a-select v-model:value="formData.identityType" style="width: 100px; margin-right: 8px;">
<a-select-option v-for="item in dicsStore.dictOptions.CARD_TYPE" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
</a-select>
<a-input v-model:value="formData.idNumber" placeholder="请输入证件号码" style="flex: 1;" />
</span>
@ -38,7 +41,7 @@
<!-- 出生日期 -->
<a-col :span="12">
<a-form-item label="出生日期" name="birthDate">
<a-date-picker v-model:value="formData.birthDate" placeholder="请选择出生日期" disabled
<a-date-picker v-model:value="formData.birthDate" placeholder="请选择出生日期"
style="width: 100%;" />
</a-form-item>
</a-col>
@ -75,7 +78,7 @@
<a-col :span="12">
<a-form-item label="联系状态" name="contactStatus">
<a-select v-model:value="formData.contactStatus" placeholder="请选择联系状态" allow-clear>
<a-select-option v-for="item in dictOptions.CONTACT_STATUS" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.CONTACT_STATUS" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -103,7 +106,7 @@
<a-form-item label="健康状况" name="healthStatus"
:rules="[{ required: true, message: '请选择健康状况' }]">
<a-select v-model:value="formData.healthStatus" placeholder="请选择健康状况" allow-clear>
<a-select-option v-for="item in dictOptions.Health_Condition" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Health_Condition" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -114,7 +117,7 @@
<!-- 服务状态 -->
<a-col :span="12">
<a-form-item label="服务状态" name="serviceStatus">
<a-select v-model:value="formData.serviceStatus" placeholder="请选择服务状态" disabled>
<a-select v-model:value="formData.serviceStatus" placeholder="请选择服务状态" >
<a-select-option value="服务中">服务中</a-select-option>
</a-select>
</a-form-item>
@ -124,7 +127,7 @@
<a-col :span="12">
<a-form-item label="生存状态" name="survivalStatus"
:rules="[{ required: true, message: '请选择生存状态' }]">
<a-select v-model:value="formData.survivalStatus" placeholder="请选择生存状态" disabled>
<a-select v-model:value="formData.survivalStatus" placeholder="请选择生存状态" >
<a-select-option value="在世">在世</a-select-option>
</a-select>
</a-form-item>
@ -134,7 +137,7 @@
<a-col :span="12">
<a-form-item label="服务形式" name="serviceForm">
<a-select v-model:value="formData.serviceForm" placeholder="请选择服务形式" allow-clear>
<a-select-option v-for="item in dictOptions.Service_Format" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Service_Format" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -146,7 +149,7 @@
<a-col :span="12">
<a-form-item label="护理等级" name="nursingLevel">
<a-select v-model:value="formData.nursingLevel" placeholder="请选择护理等级" allow-clear>
<a-select-option v-for="item in dictOptions.Care_Level" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Care_Level" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -161,21 +164,12 @@
<a-row :gutter="24">
<!-- 家庭地址 -->
<a-col :span="24">
<a-form-item label="家庭地址" name="homeAddress"
<a-form-item label="家庭地址" name="homeAreaCodes"
:rules="[{ required: true, message: '请选择并输入家庭地址' }]">
<a-cascader v-model:value="formData.homeArea" placeholder="请选择" :options="areaOptions"
change-on-select />
<a-input v-model:value="formData.homeDetailAddress" placeholder="请输入详细地址" />
<AreaCascader v-model:value="formData.homeAreaCodes" @change="onAreaChange" />
</a-form-item>
</a-col>
<!-- 地图定位地址 -->
<a-col :span="24">
<a-form-item label="地图定位地址" name="mapLocationAddress">
<a-button type="link" style="padding: 0;">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACshmLzAAADRklEQVRYCb1WTUhUURQ+Z2ZUMglEKEdFC9tFRquINgbtCqSFW4PoZ6GOA0WlFQT9WgY61qJNUBQELsSoXVC7cBUZUYukLHVMECPS0px3Oucx93XfnffevHGsB49z7vm+c74z992fQSjgqeunpgzCfiLYx2n1gFBtpxPMsP2MCM+iBE8nkzgWtiyGIdYNUvNKBq4wd3cYPnNexqLQM9mJL/LxAxvYdpsq5n7DXS7Smq+QDz5UVQKH37bjDx+cJ9HnaRikLUsWjADBdh9KuDDCm7IItEx04kevBM8Gam9RVSYDoyze6JVUcAxhPBqFXVMdOGfmRsxA83OKsfjQmomLAP8QqSm1Tb2cBt6/hmOcsNckFj3mmnZto5DrEzTdp/Wz8zDODWwyeGszRPi6sRIax9pwQRV0zcDsN2j7Z+KiyD/M1lDqbF0NoAUtGhbo8qEzzG8y+w4HkjXQ1HA+Qc0dKqefME8ApRrfy12JAhycSuITHaztpwMZAGkkZ6HpPBZcxnVQOX0cFyX+dwaWoT6EuBwc10xxKSQxwcQPemwN1lIcpwGemrgKBtmSGDzyw4MwPUfXchoghAqd5OeXWvBlNZieo2s5DViWfaPpPE+f988OT4CDQZieo2s5DcTKYFon+foWnPXFCM75Yhqgazm7QPD4AH3iu75B43q6EYR75QiJDwn8LoStKdqwSJCyCA55JmhB3rYT6S7crEKuLcMr9DEDnQr0syLE090a76dXwlkg2MmNl/vx9XhWwwk5n0Ai/CfioYPkcUSQi+2x35DiXhquBiY7cJSnaCSP9qphqS0aegFXAzYQg24m/tJJa+FzzSU+I7vNWjkNpNvxHV8aR01i0WOCI3Zto1BOA4Knk/gAI/afUIO+uqHUkppe2a5taBJqUtTHh8YJM17IOBKBm9MJPOmX4zkDipxNvKHGhVo+L/qCxKVe4AwoweoB6uV1cUqNQ1mE6zNdeDofN3AGVLIU4lWc96pVfLa9YcSFH6oBIfLxKdvzqvhBj3BmkngmiKNjoT6BnhBP0WWyoEePKd9e7Qn0v6wUUbOhZ0DlpFmAu76kxspKTDA1DmsLbkAK854+zyv8ohIRX2Jq/N9szQBdkLcYwT9BJvELTXHGpwAAAABJRU5ErkJggg=="
style="width: 18px; cursor: pointer;" alt="定位" />
</a-button>
<a-form-item label="详细地址" name="homeDetailAddress">
<a-input v-model:value="formData.homeDetailAddress" placeholder="请输入详细地址" />
</a-form-item>
</a-col>
</a-row>
@ -185,10 +179,10 @@
<a-tab-pane key="3" tab="更多">
<a-row :gutter="24">
<!-- 居住情况 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="居住情况" name="livingSituation">
<a-select v-model:value="formData.livingSituation" placeholder="请选择居住情况" allow-clear>
<a-select-option v-for="item in dictOptions.Living_Situation" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Living_Situation" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -197,10 +191,10 @@
</a-col>
<!-- 子女情况 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="子女情况" name="childrenSituation">
<a-select v-model:value="formData.childrenSituation" placeholder="请选择子女情况" allow-clear>
<a-select-option v-for="item in dictOptions.CHILDREN_SITUATION" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.CHILDREN_STATE" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -209,10 +203,10 @@
</a-col>
<!-- 统计分类 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="统计分类" name="statisticsCategory">
<a-select v-model:value="formData.statisticsCategory" placeholder="请选择统计分类" allow-clear>
<a-select-option v-for="item in dictOptions.Statistical_Classification" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Statistical_Classification" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -221,11 +215,11 @@
</a-col>
<!-- 智力情况 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="智力情况" name="intellectualSituation">
<a-select v-model:value="formData.intellectualSituation" placeholder="请选择智力情况"
allow-clear>
<a-select-option v-for="item in dictOptions.Intellectual_Condition" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Intellectual_Condition" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -234,11 +228,11 @@
</a-col>
<!-- 是否长期照料失能子女 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="是否长期照料失能子女" name="longTermCareForDisabledChildren">
<a-select v-model:value="formData.longTermCareForDisabledChildren"
placeholder="请选择是否长期照料失能子女" allow-clear>
<a-select-option v-for="item in dictOptions.Disabled_Child" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Disabled_Child" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -247,11 +241,11 @@
</a-col>
<!-- 老人子女探望情况 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="老人子女探望情况" name="childrenVisitStatus">
<a-select v-model:value="formData.childrenVisitStatus" placeholder="请选择老人子女探望情况"
allow-clear>
<a-select-option v-for="item in dictOptions.Frequency_Visits" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Frequency_Visits" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -260,11 +254,11 @@
</a-col>
<!-- 是否人户分离 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="是否人户分离" name="householdResidenceSeparation">
<a-select v-model:value="formData.householdResidenceSeparation" placeholder="请选择是否人户分离"
allow-clear>
<a-select-option v-for="item in dictOptions.Separation" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Separation" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -273,10 +267,10 @@
</a-col>
<!-- 民族 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="民族" name="ethnicity">
<a-select v-model:value="formData.ethnicity" placeholder="请选择民族" allow-clear>
<a-select-option v-for="item in dictOptions.Ethnicity" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Ethnicity" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -285,11 +279,11 @@
</a-col>
<!-- 是否完成能力评估 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="是否完成能力评估" name="completedCapacityAssessment">
<a-select v-model:value="formData.completedCapacityAssessment" placeholder="请选择是否完成能力评估"
allow-clear>
<a-select-option v-for="item in dictOptions.Capability_Assessment" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Capability_Assessment" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -298,11 +292,11 @@
</a-col>
<!-- 是否住出租屋/地下室 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="是否住出租屋/地下室" name="livesInRentedRoomOrBasement">
<a-select v-model:value="formData.livesInRentedRoomOrBasement"
placeholder="请选择是否住出租屋/地下室" allow-clear>
<a-select-option v-for="item in dictOptions.Property_Basement" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Property_Basement" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -311,10 +305,10 @@
</a-col>
<!-- 经济来源 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="经济来源" name="economicSource">
<a-select v-model:value="formData.economicSource" placeholder="请选择经济来源" allow-clear>
<a-select-option v-for="item in dictOptions.Source_Income" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Source_Income" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -323,10 +317,10 @@
</a-col>
<!-- 文化程度 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="文化程度" name="educationLevel">
<a-select v-model:value="formData.educationLevel" placeholder="请选择文化程度" allow-clear>
<a-select-option v-for="item in dictOptions.Level_Education" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Level_Education" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -335,10 +329,10 @@
</a-col>
<!-- 宗教信仰 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="宗教信仰" name="religion">
<a-select v-model:value="formData.religion" placeholder="请选择宗教信仰" allow-clear>
<a-select-option v-for="item in dictOptions.Religious_belief" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Religious_belief" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -347,10 +341,10 @@
</a-col>
<!-- 职业情况 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="职业情况" name="occupation">
<a-select v-model:value="formData.occupation" placeholder="请选择职业情况" allow-clear>
<a-select-option v-for="item in dictOptions.Employment_Status" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Employment_Status" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -359,11 +353,11 @@
</a-col>
<!-- 政治面貌 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="政治面貌" name="politicalAffiliation">
<a-select v-model:value="formData.politicalAffiliation" placeholder="请选择政治面貌"
allow-clear>
<a-select-option v-for="item in dictOptions.Political_affiliation" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Political_affiliation" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -372,10 +366,10 @@
</a-col>
<!-- 婚姻情况 -->
<a-col :span="12">
<a-col :span="8">
<a-form-item label="婚姻情况" name="maritalStatus">
<a-select v-model:value="formData.maritalStatus" placeholder="请选择婚姻情况" allow-clear>
<a-select-option v-for="item in dictOptions.Marital_Status" :key="item.dval"
<a-select-option v-for="item in dicsStore.dictOptions.Marital_Status" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
</a-select-option>
@ -384,24 +378,28 @@
</a-col>
<!-- 户口所在地 -->
<a-col :span="24">
<a-form-item label="户口所在地" name="householdLocation">
<a-cascader v-model:value="formData.householdArea" placeholder="请选择"
:options="areaOptions" change-on-select />
<a-input v-model:value="formData.householdDetailAddress" placeholder="详细地址" />
<a-col :span="8">
<a-form-item label="户口所在地" name="householdLocation"
:rules="[{ required: true, message: '请选择' }]">
<AreaCascader v-model:value="formData.householdArea" @change="onAreaHoldChange" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="详细地址" name="householdDetailAddress">
<a-input v-model:value="formData.householdDetailAddress" placeholder="请输入详细地址" />
</a-form-item>
</a-col>
<!-- 其他 -->
<a-col :span="24">
<a-form-item label="其他" name="otherNotes">
<a-textarea v-model:value="formData.otherNotes" placeholder="请输入" :rows="4"
:auto-size="{ minRows: 4, maxRows: 4 }" />
<a-textarea v-model:value="formData.otherNotes" placeholder="请输入" :rows="1"
:auto-size="{ minRows:1, maxRows: 2 }" />
</a-form-item>
</a-col>
<!-- 身份证照片 -->
<a-col :span="24">
<a-col :span="12">
<a-form-item label="身份证照片" name="idCardPhotos">
<a-upload v-model:file-list="formData.idCardPhotos" list-type="picture-card"
:multiple="true" :before-upload="() => false">
@ -414,7 +412,7 @@
</a-col>
<!-- 上传资料 -->
<a-col :span="24">
<a-col :span="12">
<a-form-item label="上传资料" name="uploadedDocuments">
<a-upload v-model:file-list="formData.uploadedDocuments" list-type="picture-card"
:multiple="true" :before-upload="() => false">
@ -438,7 +436,8 @@ import { ref, defineProps } from 'vue'
import { config } from '@/config'
import apis from '@/apis'
import { useForm, useModal } from '@/hooks'
import { useDicsStore } from '@/store'
import AreaCascader from '@/components/AreaCascader/index.vue'
const emit = defineEmits(['ok'])
const activeKey = ref('1')
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
@ -446,18 +445,15 @@ const { formRecord, formData, formRef, formRules, resetForm } = useForm()
const cancelText = ref('取消')
formRules.value = {
name: [{ required: true, message: '请输入姓名' }],
identityType: [{ required: true, message: '请选择证件类型',trigger: 'change' }],
idNumber: [{ required: true, message: '请输入证件号码' }],
contact1: [{ required: true, message: '请输入联系方式' }],
healthStatus: [{ required: true, message: '请选择健康状况' }],
survivalStatus: [{ required: true, message: '请选择生存状态' }],
homeAddress: [{ required: true, message: '请选择并输入家庭地址' }],
homeAreaCodes: [{ required: true, message: '请选择并输入家庭地址' }],
}
const props = defineProps({
dictOptions: {
type: Object,
default: () => ({}),
}
})
formData.value.gender='1'
const dicsStore = useDicsStore()
/**
* 新建
*/
@ -490,17 +486,17 @@ function handleOk() {
try {
showLoading()
const params = {
...values,
...formData.value,
}
let result = null
switch (modal.value.type) {
case 'create':
result = await apis.common.create(params).catch(() => {
result = await apis.serverObj.createItem(params).catch(() => {
throw new Error()
})
break
case 'edit':
result = await apis.common.update(params).catch(() => {
result = await apis.serverObj.updateItem(params).catch(() => {
throw new Error()
})
break
@ -518,7 +514,14 @@ function handleOk() {
hideLoading()
})
}
function onAreaChange(value,labels) {
console.log(formData.value.homeAreaCodes);
formData.value.homeAreaLabels = [...labels]
}
function onAreaHoldChange(value,labels) {
console.log(formData.value.houseAreaCodes);
formData.value.houseAreaLabels = [...labels]
}
/**
* 取消
*/

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,6 @@
<template>
<div>新建文件</div>
</template>
<script setup>
</script>

View File

@ -0,0 +1,172 @@
<template>
<a-modal :open="modal.open" :title="modal.title" :width="1000" :confirm-loading="modal.confirmLoading"
:after-close="onAfterClose" :cancel-text="cancelText" @ok="handleOk" @cancel="handleCancel">
<div style="display: flex;justify-content: space-around;">
<div style="width:200px;margin-top: 20px;">
<gx-upload v-model="formData.imgList" accept-types=".jpg,.png,.webp" :fileNumber="1" />
<p>{{ formData.name }}{{ formData.gender }}{{ formData.age }}</p>
<p>身份证号{{ formData.idNumber }}</p>
<p>手机号{{ formData.contact1 }}</p>
<p>联系人{{ formData.contactman }}</p>
<p>联系方式{{ formData.contact1 }}</p>
<p><a-tag color="#2db7f5">#2db7f5</a-tag></p>
</div>
<div style="width: calc(100% - 200px);">
<!-- Tab 页签 -->
<a-tabs v-model:activeKey="activeKey" @change="handleTabChange" >
<a-tab-pane v-for="(tab, index) in tabsList" :key="index" :tab="tab" />
</a-tabs>
<!-- 动态组件区域 -->
<div style="flex: 1; padding: 16px; overflow-y: auto;">
<keep-alive>
<component v-if="currentComponent" :is="currentComponent" :ref="activeKey" :key="activeKey" />
</keep-alive>
</div>
</div>
</div>
</a-modal>
</template>
<script setup>
import GxUpload from '@/components/GxUpload/index.vue'
import { cloneDeep } from 'lodash-es'
import { ref, computed, defineAsyncComponent,defineExpose,getCurrentInstance,nextTick } from 'vue'
import { config } from '@/config'
import apis from '@/apis'
import { useForm, useModal } from '@/hooks'
import { useDicsStore } from '@/store'
const emit = defineEmits(['ok'])
const activeKey = ref('1')
const { modal, showModal, hideModal, showLoading, hideLoading } = useModal()
const { formRecord, formData, formRef, formRules, resetForm } = useForm()
const cancelText = ref('取消')
const imgList = ref([])
const tabsList = ['基本信息', '残疾人信息', '联系人信息', '附件', '病史信息', '服务记录', '工单图片和视频', '联络历史', '操作记录', '转入转出记录']
// tab ->
const componentMap = {
'基本信息': defineAsyncComponent(() => import('./BasicInfo.vue')),
'残疾人信息': defineAsyncComponent(() => import('./DisabledPersonInfo.vue')),
'联系人信息': defineAsyncComponent(() => import('./ContactInfo.vue')),
'附件': defineAsyncComponent(() => import('./Attachments.vue')),
'病史信息': defineAsyncComponent(() => import('./MedicalHistory.vue')),
'服务记录': defineAsyncComponent(() => import('./ServiceRecords.vue')),
'工单图片和视频': defineAsyncComponent(() => import('./WorkOrderMedia.vue')),
'联络历史': defineAsyncComponent(() => import('./ContactHistory.vue')),
'操作记录': defineAsyncComponent(() => import('./OperationLog.vue')),
'转入转出记录': defineAsyncComponent(() => import('./TransferRecords.vue')),
};
//
const currentComponent = computed(() => {
const tabName = tabsList[activeKey.value];
return componentMap[tabName];
});
// tab
const handleTabChange = (key) => {
//
nextTick(() => {
const tabName = tabsList[key];
const componentName = componentMap[tabName];
if (componentName) {
//
const instance = proxy.$refs[key];
if (instance && typeof instance.onTabClick === 'function') {
instance.onTabClick(); // onTabClick
} else if (instance && typeof instance.loadData === 'function') {
instance.loadData(); // loadData
}
}
});
};
// setup 使 $refs
const { proxy } = getCurrentInstance();
/**
* 新建
*/
function handleCreate() {
showModal({
type: 'create',
title: '新建项',
})
}
/**
* 编辑
*/
function handleEdit(record = {}) {
console.log('record', record)
showModal({
type: 'edit',
title: '编辑项',
})
formRecord.value = record
formData.value = cloneDeep(record)
}
const callback = (val) => {
console.log(val);
};
/**
* 确定
*/
function handleOk() {
formRef.value
.validateFields()
.then(async (values) => {
try {
showLoading()
const params = {
...formData.value,
}
let result = null
switch (modal.value.type) {
case 'create':
result = await apis.serverObj.createItem(params).catch(() => {
throw new Error()
})
break
case 'edit':
result = await apis.serverObj.updateItem(params).catch(() => {
throw new Error()
})
break
}
hideLoading()
if (config('http.code.success') === result?.code) {
hideModal()
emit('ok')
}
} catch (error) {
hideLoading()
}
})
.catch(() => {
hideLoading()
})
}
/**
* 取消
*/
function handleCancel() {
hideModal()
}
/**
* 关闭后
*/
function onAfterClose() {
resetForm()
hideLoading()
}
defineExpose({
handleCreate,
handleEdit,
})
</script>
<style lang="less" scoped></style>

View File

@ -1,272 +1,287 @@
<template>
<x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline">
<a-form :model="searchFormData" layout="inline" labelAlign="left">
<a-row :gutter="[24, 24]">
<!-- 所在节点 -->
<a-col :span="6">
<a-row :gutter="[24, 24]">
<a-col :span="24">
<a-form-item label="所在节点" name="currentNode">
<a-tree-select v-model:value="searchFormData.currentNode" style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="treeData"
placeholder="请选择" tree-default-expand-all>
<template #title="{ key, value }">
<span style="color: #08c" v-if="key === '0-0-1'">Child Node1 {{ value
}}</span>
</template>
</a-tree-select>
</a-form-item>
</a-col>
<a-col :span="24" class="align-center">
<div style="display: flex; align-items: center;justify-content: center;">
<a-image :width="50" :src="totalImg" />
<span style="font-size: 28px;margin-left: 10px;">{{ totalCount }}</span>
</div>
</a-col>
</a-row>
<a-col :span="12">
<a-form-item label="所在节点" name="currentNode">
<a-tree-select v-model:value="value" show-search style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" placeholder="Please select"
allow-clear tree-default-expand-all :tree-data="treeData" tree-node-filter-prop="label">
<template #title="{ value: val, label }">
<b v-if="val === 'parent 1-1'" style="color: #08c">sss</b>
<template v-else>{{ label }}</template>
</template>
</a-tree-select>
</a-form-item>
</a-col>
<!-- 所在区域 -->
<a-col :span="12">
<a-form-item label="所在区域" name="region">
<AreaCascader v-model:value="searchFormData.currentNode" @change="onAreaChange" />
</a-form-item>
</a-col>
<!-- 姓名 -->
<a-col :span="8">
<a-form-item label="姓名" name="name">
<a-input v-model:value="searchFormData.name" placeholder="请输入姓名" />
</a-form-item>
</a-col>
<!-- 其他搜索项 -->
<a-col :span="18">
<a-row :gutter="[24, 24]">
<!-- 所在区域 -->
<a-col :span="8">
<a-form-item label="所在区域" name="region">
<a-cascader v-model:value="searchFormData.region" :options="areaOptions"
placeholder="请选择" />
</a-form-item>
</a-col>
<!-- 身份证号 -->
<a-col :span="8">
<a-form-item label="身份证号" name="idNumber">
<a-input v-model:value="searchFormData.idNumber" placeholder="请输入身份证号" />
</a-form-item>
</a-col>
<!-- 联系方式 -->
<a-col :span="8">
<a-form-item label="联系方式" name="contact1">
<a-input v-model:value="searchFormData.contact1" placeholder="请输入联系方式" />
<!-- 分类标签 -->
<a-col :span="8">
<a-form-item label="分类标签" name="serviceRecipientCategory">
<a-select v-model:value="searchFormData.serviceRecipientCategory" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.SERVICE_STATUS" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-form-item>
</a-col>
<!-- 服务状态未在映射表中 -->
<a-col :span="8">
<a-form-item label="服务状态" name="serviceStatus">
<a-select v-model:value="searchFormData.serviceStatus" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.SERVICE_STATUS" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 生存状态 -->
<a-col :span="8">
<a-form-item label="生存状态" name="survivalStatus">
<a-select v-model:value="searchFormData.survivalStatus" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.LIVING_STATUS" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 分类标签 -->
<a-col :span="8">
<a-form-item label="分类标签" name="serviceRecipientCategory">
<a-select v-model:value="searchFormData.serviceRecipientCategory" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.SERVICE_STATUS" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 姓名 -->
<a-col :span="8">
<a-form-item label="姓名" name="name">
<a-input v-model:value="searchFormData.name" placeholder="请输入姓名" />
</a-form-item>
</a-col>
<!-- 服务状态未在映射表中 -->
<a-col :span="8">
<a-form-item label="服务状态" name="serviceStatus">
<a-select v-model:value="searchFormData.serviceStatus" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.SERVICE_STATUS" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 身份证号 -->
<a-col :span="8">
<a-form-item label="身份证号" name="idNumber">
<a-input v-model:value="searchFormData.idNumber" placeholder="请输入身份证号" />
</a-form-item>
</a-col>
<!-- 生存状态 -->
<a-col :span="8">
<a-form-item label="生存状态" name="survivalStatus">
<a-select v-model:value="searchFormData.survivalStatus" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.LIVING_STATUS" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 档案号 -->
<a-col :span="8">
<!-- 档案号 -->
<!-- <a-col :span="8">
<a-form-item label="档案号" name="fileNumber">
<a-input v-model:value="searchFormData.fileNumber" placeholder="请输入档案号" />
</a-form-item>
</a-col>
</a-col> -->
<!-- 残疾类型 -->
<a-col :span="8">
<a-form-item label="残疾类型" name="disabilityType">
<a-select v-model:value="searchFormData.disabilityType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.DISABILITY_TYPES" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 残疾类型 -->
<a-col :span="8">
<a-form-item label="残疾类型" name="disabilityType">
<a-select v-model:value="searchFormData.disabilityType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.DISABILITY_TYPES" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 残疾等级 -->
<a-col :span="8">
<a-form-item label="残疾等级" name="disabilityLevel">
<a-select v-model:value="searchFormData.disabilityLevel" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Disability_Level" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 残疾等级 -->
<a-col :span="8">
<a-form-item label="残疾等级" name="disabilityLevel">
<a-select v-model:value="searchFormData.disabilityLevel" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Disability_Level" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 是否出租屋/地下室 -->
<a-col :span="8">
<a-form-item label="是否出租屋/地下室" name="livesInRentedRoomOrBasement">
<a-select v-model:value="searchFormData.livesInRentedRoomOrBasement" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Property_Basement" :key="item.dval"
:value="item.dval">{{ item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 是否出租屋/地下室 -->
<a-col :span="8">
<a-form-item label="是否出租屋/地下室" name="livesInRentedRoomOrBasement">
<a-select v-model:value="searchFormData.livesInRentedRoomOrBasement" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Property_Basement"
:key="item.dval" :value="item.dval">{{ item.introduction
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 是否完成能力评估 -->
<a-col :span="8">
<a-form-item label="是否完成能力评估" name="completedCapacityAssessment">
<a-select v-model:value="searchFormData.completedCapacityAssessment" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Capability_Assessment"
:key="item.dval" :value="item.dval">{{ item.introduction
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 是否完成能力评估 -->
<a-col :span="8">
<a-form-item label="是否完成能力评估" name="completedCapacityAssessment">
<a-select v-model:value="searchFormData.completedCapacityAssessment" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Capability_Assessment"
:key="item.dval" :value="item.dval">{{ item.introduction
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 是否人户分离 -->
<a-col :span="8">
<a-form-item label="是否人户分离" name="householdResidenceSeparation">
<a-select v-model:value="searchFormData.householdResidenceSeparation" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Separation" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 是否人户分离 -->
<a-col :span="8">
<a-form-item label="是否人户分离" name="householdResidenceSeparation">
<a-select v-model:value="searchFormData.householdResidenceSeparation" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Separation" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 婚姻状况 -->
<a-col :span="8">
<a-form-item label="婚姻状况" name="maritalStatus">
<a-select v-model:value="searchFormData.maritalStatus" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Marital_Status" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 婚姻状况 -->
<a-col :span="8">
<a-form-item label="婚姻状况" name="maritalStatus">
<a-select v-model:value="searchFormData.maritalStatus" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Marital_Status" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 健康状况 -->
<a-col :span="8">
<a-form-item label="健康状况" name="healthStatus">
<a-select v-model:value="searchFormData.healthStatus" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Health_Condition" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 健康状况 -->
<a-col :span="8">
<a-form-item label="健康状况" name="healthStatus">
<a-select v-model:value="searchFormData.healthStatus" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Health_Condition" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 居住情况 -->
<a-col :span="8">
<a-form-item label="居住情况" name="livingSituation">
<a-select v-model:value="searchFormData.livingSituation" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Living_Situation" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 居住情况 -->
<a-col :span="8">
<a-form-item label="居住情况" name="livingSituation">
<a-select v-model:value="searchFormData.livingSituation" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Living_Situation" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 统计分类未在映射表中 -->
<a-col :span="8">
<a-form-item label="统计分类" name="statisticalClassification">
<a-select v-model:value="searchFormData.statisticalClassification" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Statistical_Classification"
:key="item.dval" :value="item.dval">{{ item.introduction
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 统计分类未在映射表中 -->
<a-col :span="8">
<a-form-item label="统计分类" name="statisticalClassification">
<a-select v-model:value="searchFormData.statisticalClassification" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Statistical_Classification"
:key="item.dval" :value="item.dval">{{ item.introduction
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 智力情况未在映射表中 -->
<a-col :span="8">
<a-form-item label="智力情况" name="intellectualCondition">
<a-select v-model:value="searchFormData.intellectualCondition" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Intellectual_Condition"
:key="item.dval" :value="item.dval">{{ item.introduction
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 智力情况未在映射表中 -->
<a-col :span="8">
<a-form-item label="智力情况" name="intellectualCondition">
<a-select v-model:value="searchFormData.intellectualCondition" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Intellectual_Condition"
:key="item.dval" :value="item.dval">{{ item.introduction
}}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 是否长期照料失能子女未在映射表中 -->
<a-col :span="8">
<a-form-item label="是否长期照料失能子女" name="longTermCareForDisabledChild">
<a-select v-model:value="searchFormData.longTermCareForDisabledChild" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Disabled_Child" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 是否长期照料失能子女未在映射表中 -->
<a-col :span="8">
<a-form-item label="是否长期照料失能子女" name="longTermCareForDisabledChild">
<a-select v-model:value="searchFormData.longTermCareForDisabledChild" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Disabled_Child" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 老人子女探望情况未在映射表中 -->
<a-col :span="8">
<a-form-item label="老人子女探望情况" name="frequencyOfVisits">
<a-select v-model:value="searchFormData.frequencyOfVisits" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Frequency_Visits" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 老人子女探望情况未在映射表中 -->
<a-col :span="8">
<a-form-item label="老人子女探望情况" name="frequencyOfVisits">
<a-select v-model:value="searchFormData.frequencyOfVisits" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.Frequency_Visits" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 户籍地址建议若为区域则用 region若为详细地址则用 detailedAddress -->
<a-col :span="8">
<a-form-item label="户籍地址" name="detailedAddress">
<a-tree-select v-model:value="searchFormData.detailedAddress" style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="treeData"
placeholder="请选择" tree-default-expand-all>
<template #title="{ key, value }">
<span style="color: #08c" v-if="key === '0-0-1'">Child Node1 {{ value
}}</span>
</template>
</a-tree-select>
</a-form-item>
</a-col>
<!-- 户籍地址建议若为区域则用 region若为详细地址则用 detailedAddress -->
<a-col :span="8">
<a-form-item label="户籍地址" name="detailedAddress">
<a-tree-select v-model:value="searchFormData.detailedAddress" style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="treeData"
placeholder="请选择" tree-default-expand-all>
<template #title="{ key, value }">
<span style="color: #08c" v-if="key === '0-0-1'">Child Node1 {{ value
}}</span>
</template>
</a-tree-select>
</a-form-item>
</a-col>
<!-- 联系方式 -->
<a-col :span="8">
<a-form-item label="联系方式" name="contact1">
<a-input v-model:value="searchFormData.contact1" placeholder="请输入联系方式" />
</a-form-item>
</a-col>
<!-- 操作按钮 -->
<a-col class="align-right" :span="24">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
<!-- 操作按钮 -->
<a-col class="align-left" :span="8">
<a-space>
<a-button @click="handleResetSearch">{{ $t('button.reset') }}</a-button>
<a-button ghost type="primary" @click="handleSearch">
{{ $t('button.search') }}
</a-button>
</a-space>
</a-col>
</a-row>
</a-form>
</template>
</x-search-bar>
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card title="服务对象列表">
<a-card>
<template #title>
<a-space>
<span style="font-size: 18px;">服务对象列表</span>
<span style="margin-left: 10px;color: #666;">({{ totalCount }})</span>
</a-space>
</template>
<template #extra>
<a-space>
<a-button type="primary" @click="$refs.editDialogRef.handleCreate()">新建</a-button>
<a-button>导入</a-button>
<a-dropdown>
<template #overlay>
<a-menu @click="handleMenuClick">
<a-menu-item key="1">
<UserOutlined />
服务对象导入
</a-menu-item>
<a-menu-item key="2">
<UserOutlined />
更新导入
</a-menu-item>
<a-menu-item key="3">
<UserOutlined />
联系人导入
</a-menu-item>
</a-menu>
</template>
<a-button>
导入
<DownOutlined />
</a-button>
</a-dropdown>
<a-button danger>批量打标</a-button>
<a-button>导入记录</a-button>
<a-button>导出</a-button>
@ -275,15 +290,18 @@
</template>
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 'max-content' }" @change="onTableChange">
<template #bodyCell="{ column, record }">
<template #bodyCell="{ index,column, record }">
<template v-if="column.key === 'serialNumber'">
<span>{{ index + 1 }}</span>
</template>
<template v-if="'action' === column.key">
<x-action-button @click="checkHandler(record)">
<x-action-button @click="$refs.detailRef.handleCreate(record)">
<span>详情</span>
</x-action-button>
<x-action-button @click="checkHandler(record)">
<span>线下工单</span>
</x-action-button>
<x-action-button @click="checkHandler(record)">
<x-action-button @click="$refs.detailRef.handleCreate(record)">
<span>编辑</span>
</x-action-button>
<x-action-button @click="checkHandler(record)">
@ -298,7 +316,8 @@
</a-card>
</a-col>
</a-row>
<edit-dialog ref="editDialogRef" @ok="onOk" :dict-options="dictOptions"></edit-dialog>
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
<detail ref="detailRef"></detail>
</template>
<script setup>
@ -307,19 +326,19 @@ import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { PlusOutlined, EditOutlined, DeleteOutlined } from '@ant-design/icons-vue'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
import { status } from 'nprogress'
import { getDictByType } from '@/apis/modules/common'
import totalImg from '@/assets/imgs/total.png'
import EditDialog from './components/EditDialog.vue'
import detail from './components/detail.vue'
import { useDicsStore } from '@/store'
import AreaCascader from '@/components/AreaCascader/index.vue'
import dayjs from 'dayjs'
defineOptions({
name: 'serverList',
})
const totalCount = ref(0) //
const dicsStore = useDicsStore()
const columns = [
{
title: '序号',
@ -433,13 +452,18 @@ const columns = [
align: 'center',
width: 120,
},
// --- ---
{
title: '去世时间',
dataIndex: 'dateOfDeath',
key: 'dateOfDeath',
align: 'center',
width: 140,
customRender: ({ text, record }) => {
return text ? dayjs(text).format('YYYY-MM-DD') : '-';
},
},
// --- ---
{
title: '去世原因',
dataIndex: 'causeOfDeath',
@ -447,27 +471,40 @@ const columns = [
align: 'center',
width: 140,
},
// --- ---
{
title: '更新时间',
dataIndex: 'updateTime',
key: 'updateTime',
align: 'center',
width: 140,
customRender: ({ text, record }) => {
return text ? dayjs(text).format('YYYY-MM-DD') : '-';
},
},
// --- ---
{
title: '失能险签约日期',
dataIndex: 'ltcInsuranceSignUpDate',
key: 'ltcInsuranceSignUpDate',
align: 'center',
width: 150,
customRender: ({ text, record }) => {
return text ? dayjs(text).format('YYYY-MM-DD') : '-';
},
},
// --- ---
{
title: '失能险解约日期',
dataIndex: 'ltcInsuranceTerminationDate',
key: 'ltcInsuranceTerminationDate',
align: 'center',
width: 150,
customRender: ({ text, record }) => {
return text ? dayjs(text).format('YYYY-MM-DD') : '-';
},
},
// --- ---
{
title: '联系方式1',
dataIndex: 'contact1',
@ -538,24 +575,30 @@ const columns = [
align: 'center',
width: 140,
},
// --- ---
{
title: '建档日期',
dataIndex: 'dateOfFileCreation',
key: 'dateOfFileCreation',
align: 'center',
width: 140,
customRender: ({ text, record }) => {
return text ? dayjs(text).format('YYYY-MM-DD') : '-';
},
},
{
title: '操作',
dataIndex: 'action',
key: 'action',
align: 'center',
width: 180,
width: 350,
fixed: 'right',
}
];
const { t } = useI18n() // t
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
const detailRef = ref()
const treeData = ref([
{
title: 'Node1',
@ -615,68 +658,8 @@ const options = ref([
},
],
},])
// type
const dictOptions = ref({})
initData()
// getDicList()
async function initData() {
try {
showLoading()
await getPageList()
hideLoading()
} catch (error) {
hideLoading()
}
}
async function getDicList() {
try {
const dictTypes = [
"SERVICE_STATUS", //
"LIVING_STATUS", //
"CATEGORY_LABELS", //
"DISABILITY_TYPES", //
"Disability_Level", //
"Capability_Assessment", //
"Property_Basement", // /
"Separation", //
"Marital_Status", //
"Health_Condition", //
"Living_Situation", //
"Statistical_Classification", //
"Intellectual_Condition", //
"Disabled_Child", //
"Frequency_Visits", //
"Service_Format", //
"Care_Level", //
"Ethnicity", //
"Source_Income", //
"Level_Education", //
"Religious_belief", //
"Employment_Status", //
"Political_affiliation" //
]
// Promise
const requests = dictTypes.map(type => getDictByType(type))
console.log(requests, 'requests')
//
const results = await Promise.all(requests)
// type dictOptions
dictTypes.forEach((type, index) => {
dictOptions.value[type] = results[index].data || []
})
console.log(dictOptions.value, 'dictOptions')
} catch (err) {
console.error('字典数据加载失败:', err)
//
dictTypes.forEach(type => {
dictOptions.value[type] = []
})
} finally {
hideLoading()
}
}
getPageList()
/**
* 获取表格数据
* @returns {Promise<void>}