This commit is contained in:
Leo_Ding 2025-10-15 13:55:44 +08:00
parent 7b65c5e27f
commit 73a1340b54
15 changed files with 1074 additions and 383 deletions

View File

@ -14,5 +14,5 @@ export const updateItem = (id, params) => request.basic.put(`/api/v1/customers/$
export const delItem = (id) => request.basic.delete(`/api/v1/customers/${id}`)
//获取用户数量
export const getCount=()=>request.basic.get('/api/v1/customers/count')
export const getCount=(params)=>request.basic.get('/api/v1/customers/count',params)

View File

@ -0,0 +1,16 @@
/**
* 区域模块接口
*/
import request from '@/utils/request'
// 获取项目列表
export const getProjectList = (params) => request.basic.get('/api/v1/service-people', params)
// 获取单挑数据
export const getItem = (id) => request.basic.get(`/api/v1/service-people/${id}`)
// 添加条目
export const createItem = (params) => request.basic.post('/api/v1/service-people', params)
// 更新role
export const updateItem = (id, params) => request.basic.put(`/api/v1/service-people/${id}`, params)
// 删除数据
export const delItem = (id) => request.basic.delete(`/api/v1/service-people/${id}`)

View File

@ -0,0 +1,100 @@
<!-- @/components/TreeSelect.vue -->
<template>
<a-tree-select v-model:value="modelValue" show-search :style="{ width: width }"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :placeholder="placeholder" :allow-clear="allowClear"
:tree-default-expand-all="defaultExpandAll" :tree-data="localTreeData" :tree-node-filter-prop="filterProp"
:disabled="disabled" :loading="loading" @change="handleChange" @search="handleSearch" @focus="handleFocus"
@blur="handleBlur">
</a-tree-select>
</template>
<script setup>
import { ref, watch, onMounted,defineModel } from 'vue'
import { useDicsStore } from '@/store'
const dicsStore = useDicsStore()
const modelValue = defineModel();
const props = defineProps({
allowClear:{
type:Boolean,
default:false
},
width: {
type: String,
default: '100%'
},
placeholder: {
type: String,
default: '请选择节点'
},
filterProp: {
type: String,
default: 'label'
},
defaultExpandAll: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
},
// store
useStore: {
type: Boolean,
default: true
}
})
const emit = defineEmits(['update:modelValue', 'change', 'search', 'focus', 'blur'])
const localTreeData = ref([])
const loading = ref(false)
// store
watch(
() => dicsStore.orgTree,
(newVal) => {
if (newVal?.length > 0) {
localTreeData.value = newVal
console.log('localTreeData',localTreeData.value)
// modelValue.value=localTreeData.value[0].value
loading.value = false
}
},
{ immediate: true }
)
// store
onMounted(async () => {
if (props.useStore) {
if (dicsStore.orgTree.length === 0 && !loading.value) {
loading.value = true
try {
await dicsStore.loadOrgTree()
// watch
} catch (error) {
loading.value = false
}
}
}
})
const handleChange = (value, label, extra) => {
emit('change', value, label, extra)
}
const handleSearch = (value) => {
console.log(value)
emit('search', value)
}
const handleFocus = () => {
emit('focus')
}
const handleBlur = () => {
emit('blur')
}
</script>

View File

@ -22,6 +22,7 @@ import Cascader from './Cascader/Cascader.vue'
import { setupLoadingDirective } from './Loading/directive'
import GxUpload from './GxUpload/index.vue'
import GxMap from './GxMap/index.vue'
import NodeTree from './NodeTree/index.vue'
const componentList = [
ActionBar,
@ -44,7 +45,8 @@ const componentList = [
Scrollbar,
Cascader,
GxUpload,
GxMap
GxMap,
NodeTree
]
export const loading = Loading

View File

@ -5,23 +5,17 @@
<template v-if="config.layout === 'topBottom'">
<!-- 侧边菜单 -->
<template v-if="config.menuMode === 'side'">
<basic-header
:theme="config.headerTheme"
@config="$refs.configDialogRef.handleOpen()">
<basic-header :theme="config.headerTheme" @config="$refs.configDialogRef.handleOpen()">
<template #left>
<brand :theme="config.headerTheme"></brand>
</template>
</basic-header>
<a-layout>
<basic-side
:theme="config.sideTheme"
:style="{
height: `calc(100vh - ${config.headerHeight}px)`,
top: `${config.headerHeight}px`,
}">
<basic-menu
:theme="config.sideTheme"
:data-list="sideMenuList"></basic-menu>
<basic-side :theme="config.sideTheme" :style="{
height: `calc(100vh - ${config.headerHeight}px)`,
top: `${config.headerHeight}px`,
}">
<basic-menu :theme="config.sideTheme" :data-list="sideMenuList"></basic-menu>
</basic-side>
<a-layout>
<multi-tab v-if="config.multiTab"></multi-tab>
@ -32,28 +26,19 @@
<!-- 混合菜单 -->
<template v-if="config.menuMode === 'mix'">
<basic-header
:theme="config.headerTheme"
@config="$refs.configDialogRef.handleOpen()">
<basic-header :theme="config.headerTheme" @config="$refs.configDialogRef.handleOpen()">
<template #left>
<brand :theme="config.headerTheme"></brand>
</template>
<basic-menu
mode="horizontal"
:theme="config.headerTheme"
:data-list="topMenuList"></basic-menu>
<basic-menu mode="horizontal" :theme="config.headerTheme" :data-list="topMenuList"></basic-menu>
</basic-header>
<a-layout>
<template v-if="sideMenuList.length">
<basic-side
:theme="config.sideTheme"
:style="{
height: `calc(100vh - ${config.headerHeight}px)`,
top: `${config.headerHeight}px`,
}">
<basic-menu
:theme="config.sideTheme"
:data-list="sideMenuList"></basic-menu>
<basic-side :theme="config.sideTheme" :style="{
height: `calc(100vh - ${config.headerHeight}px)`,
top: `${config.headerHeight}px`,
}">
<basic-menu :theme="config.sideTheme" :data-list="sideMenuList"></basic-menu>
</basic-side>
</template>
<a-layout>
@ -68,23 +53,17 @@
<template v-if="config.layout === 'leftRight'">
<!-- 侧边菜单 -->
<template v-if="config.menuMode === 'side'">
<basic-side
:theme="config.sideTheme"
:style="{
height: `100vh`,
top: 0,
}">
<basic-side :theme="config.sideTheme" :style="{
height: `100vh`,
top: 0,
}">
<template #header>
<brand :theme="config.sideTheme"></brand>
</template>
<basic-menu
:theme="config.sideTheme"
:data-list="sideMenuList"></basic-menu>
<basic-menu :theme="config.sideTheme" :data-list="sideMenuList"></basic-menu>
</basic-side>
<a-layout>
<basic-header
:theme="config.headerTheme"
@config="$refs.configDialogRef.handleOpen()">
<basic-header :theme="config.headerTheme" @config="$refs.configDialogRef.handleOpen()">
</basic-header>
<multi-tab v-if="config.multiTab"></multi-tab>
<basic-content></basic-content>
@ -92,26 +71,18 @@
</template>
<!-- 混合菜单 -->
<template v-if="config.menuMode === 'mix'">
<basic-side
:theme="config.sideTheme"
:style="{
height: `100vh`,
top: 0,
}">
<basic-side :theme="config.sideTheme" :style="{
height: `100vh`,
top: 0,
}">
<template #header>
<brand :theme="config.sideTheme"></brand>
</template>
<basic-menu
:theme="config.sideTheme"
:data-list="sideMenuList"></basic-menu>
<basic-menu :theme="config.sideTheme" :data-list="sideMenuList"></basic-menu>
</basic-side>
<a-layout>
<basic-header
:theme="config.headerTheme"
@config="$refs.configDialogRef.handleOpen()">
<basic-menu
mode="horizontal"
:theme="config.headerTheme"
<basic-header :theme="config.headerTheme" @config="$refs.configDialogRef.handleOpen()">
<basic-menu mode="horizontal" :theme="config.headerTheme"
:data-list="topMenuList"></basic-menu>
</basic-header>
<multi-tab v-if="config.multiTab"></multi-tab>
@ -122,16 +93,11 @@
<!-- 顶部菜单不区分布局方式 -->
<template v-if="config.menuMode === 'top'">
<basic-header
:theme="config.headerTheme"
@config="$refs.configDialogRef.handleOpen()">
<basic-header :theme="config.headerTheme" @config="$refs.configDialogRef.handleOpen()">
<template #left>
<brand :theme="config.headerTheme"></brand>
</template>
<basic-menu
mode="horizontal"
:theme="config.headerTheme"
:data-list="topMenuList"></basic-menu>
<basic-menu mode="horizontal" :theme="config.headerTheme" :data-list="topMenuList"></basic-menu>
</basic-header>
<multi-tab v-if="config.multiTab"></multi-tab>
<basic-content></basic-content>
@ -145,7 +111,7 @@
<script setup>
import { storeToRefs } from 'pinia'
import { ref } from 'vue'
import { useAppStore,useDicsStore } from '@/store'
import { useAppStore, useDicsStore } from '@/store'
import useMultiTab from './hooks/useMultiTab'
import useMenu from './hooks/useMenu'
import BasicContent from './components/BasicContent.vue'
@ -161,10 +127,16 @@ defineOptions({
})
useMultiTab()
const appStore = useAppStore()
const dicsStore = useDicsStore()
dicsStore.loadProvinces() //
dicsStore.loadAllDictData() //
initData()
async function initData() {
await dicsStore.loadProvinces() //
await dicsStore.loadAllDictData() //
await dicsStore.loadOrgTree()
}
const { sideMenuList, topMenuList } = useMenu()
const { config } = storeToRefs(appStore)

View File

@ -55,5 +55,7 @@ export default {
serviceStaff:'服务人员',
constructorList:'施工员列表',
serviceStaffList:'服务人员',
assessor:'评估员列表'
assessor:'评估员列表',
baseSet:'基础配置',
serverProjectManage:'服务项目管理',
}

View File

@ -0,0 +1,29 @@
import { DollarOutlined } from '@ant-design/icons-vue'
export default [
{
path: 'baseSet',
name: 'baseSet',
component: 'RouteViewLayout',
meta: {
icon: DollarOutlined,
title: '基础配置',
isMenu: true,
keepAlive: true,
permission: '*',
},
children: [
{
path: 'serverProjectManage',
name: 'serverProjectManage',
component: 'baseSet/serverProjectManage/index.vue',
meta: {
title: '服务项目管理',
isMenu: true,
keepAlive: true,
permission: '*',
},
},
],
},
]

View File

@ -10,6 +10,7 @@ const useDicsStore = defineStore('dics', {
state: () => ({
dictOptions: {},
provinceOptions: [],
orgTree: [],
}),
getters: {
/**
@ -108,6 +109,39 @@ const useDicsStore = defineStore('dics', {
console.error('加载字典数据失败:', error)
}
},
/**
* 将后端返回的树结构数据转换为 a-tree-select 所需格式
* @param {Array} data - 原始数据
* @returns {Array} 转换后的 [{ value, label, children }]
*/
formatTreeData(data) {
return data.map((item) => {
const node = {
value: item.id,
label: item.name,
// disabled: item.disabled, // 可选:如果需要禁用某些节点
}
// 如果有 children递归处理
if (item.children && item.children.length > 0) {
node.children = this.formatTreeData(item.children)
}
return node
})
},
async loadOrgTree() {
try {
const response = await apis.serviceMenu.getNodeList({ current: 1, pageSize: 100 })
if (Array.isArray(response.data)) {
this.orgTree = this.formatTreeData(response.data)
} else {
console.warn('获取省份失败:', response.data.message)
}
} catch (error) {
console.error('请求省份数据失败:', error)
}
},
/**
* 可选清空字典数据登出时调用

View File

@ -20,6 +20,7 @@ const options = {
},
interceptorRequestCatch: () => {},
interceptorResponse: (response) => {
console.log('返回',response.data)
// 错误处理
const { success, msg = 'Network Error' } = response.data || {}
if (![true].includes(success)) {

View File

@ -0,0 +1,180 @@
<template>
<a-modal :open="modal.open" :title="modal.title" :width="600" :confirm-loading="modal.confirmLoading"
:after-close="onAfterClose" :cancel-text="cancelText" @ok="handleOk" @cancel="handleCancel">
<a-card>
<a-form ref="formRef" :model="formData" :rules="formRules">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="姓名" name="name">
<a-input v-model:value="formData.name" placeholder="请输入姓名" />
</a-form-item>
</a-col>
<!-- 性别 -->
<a-col :span="12">
<a-form-item label="性别" name="gender">
<a-radio-group v-model:value="formData.gender">
<a-radio value="1"></a-radio>
<a-radio value="2"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<!-- 证件号码 -->
<a-col :span="12">
<a-form-item label="身份证号" name="idCard">
<a-input v-model:value="formData.idCard" placeholder="请输入证件号码" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="电话" name="phone">
<a-input v-model:value="formData.phone" placeholder="请输入电话" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="电话" name="phone">
<a-input v-model:value="formData.phone" placeholder="请输入电话" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="护理人员类型" name="serviceType">
<a-select v-model:value="formData.serviceType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.STAFF_TYPE" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="护理人员状态" name="status">
<a-select v-model:value="formData.status" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.STAFF_STATUS" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="用工形式" name="workType">
<a-select v-model:value="formData.workType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.USE_TYPE" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="所属服务组织" name="stationLables">
<node-tree v-model:value="formData.stationLables" />
</a-form-item>
</a-col>
<!-- <a-col :span="8">
<a-form-item label="组织所在区域" name="areaLabels">
<node-tree v-model:value="formData.areaLabels" />
</a-form-item>
</a-col> -->
</a-row>
</a-form>
</a-card>
</a-modal>
</template>
<script setup>
import { cloneDeep } from 'lodash-es'
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'
import NodeTree from '@/components/NodeTree/index.vue'
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 dicsStore = useDicsStore()
/**
* 新建
*/
function handleCreate() {
showModal({
type: 'create',
title: '新增服务人员',
})
}
/**
* 编辑
*/
function handleEdit(record = {}) {
showModal({
type: 'edit',
title: '编辑项',
})
formRecord.value = record
formData.value = cloneDeep(record)
}
/**
* 确定
*/
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({
handleEdit,
handleCreate,
})
</script>
<style lang="less" scoped></style>

View File

@ -0,0 +1,377 @@
<template>
<x-search-bar class="mb-8-2">
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" layout="inline" labelAlign="left">
<a-row :gutter="[24, 24]">
<!-- 所在区域 -->
<a-col :span="8">
<a-form-item label="所属服务组织" name="station">
<node-tree v-model:value="searchFormData.station" />
</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="phone">
<a-input v-model:value="searchFormData.phone" placeholder="请输入联系电话" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="护理人员类型" name="serviceType">
<a-select v-model:value="searchFormData.serviceType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.STAFF_TYPE" :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="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.STAFF_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="workType">
<a-select v-model:value="searchFormData.workType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.USE_TYPE" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</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-form>
</template>
</x-search-bar>
<a-row :gutter="8" :wrap="false">
<a-col flex="auto">
<a-card title="服务人员列表">
<template #extra>
<a-space>
<a-button type="primary" @click="$refs.editDialogRef.handleCreate(record)">新建</a-button>
<a-button type="primary">导出</a-button>
<a-button type="dashed">导出记录</a-button>
</a-space>
</template>
<a-table :columns="columns" :data-source="listData" bordered="true" :loading="loading"
:pagination="paginationState" :scroll="{ x: 'max-content' }" @change="onTableChange">
<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="$refs.editDialogRef.handleEdit(record)">
<span>编辑</span>
</x-action-button>
<x-action-button @click="handleDelete(record)">
<span style="color: #ff4d4f;">删除</span>
</x-action-button>
</template>
</template>
</a-table>
</a-card>
</a-col>
</a-row>
<edit-dialog ref="editDialogRef" @ok="onOk"></edit-dialog>
<detail ref="detailRef"></detail>
</template>
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
import { useI18n } from 'vue-i18n'
import EditDialog from './components/EditDialog.vue'
import { useDicsStore } from '@/store'
import AreaCascader from '@/components/AreaCascader/index.vue'
import detail from './components/detail.vue'
import dayjs from 'dayjs'
import NodeTree from '@/components/NodeTree/index.vue'
defineOptions({
name: 'serverProjectManage',
})
const dicsStore = useDicsStore()
const columns = [
{
title: '序号',
dataIndex: 'serialNumber',
key: 'serialNumber',
align: 'center',
width: 80,
},
{
title: '姓名',
dataIndex: 'name',
key: 'name',
align: 'center',
width: 100,
},
{
title: '性别',
dataIndex: 'gender',
key: 'gender',
align: 'center',
width: 80,
},
{
title: '电话',
dataIndex: 'phone',
key: 'phone',
align: 'center',
width: 80,
},
{
title: '身份证号',
dataIndex: 'idCard',
key: 'idCard',
align: 'center',
width: 180,
},
{
title: '护理人员类型',
dataIndex: 'serviceType',
key: 'serviceType',
align: 'center',
width: 120,
},
{
title: '用工形式',
dataIndex: 'workType',
key: 'workType',
align: 'center',
width: 120,
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
width: 120,
},
// --- ---
{
title: '护理人员类型',
dataIndex: 'serviceType',
key: 'serviceType',
align: 'center',
width: 130,
},
{
title: '所属服务组织',
dataIndex: 'stationName',
key: 'stationName',
align: 'center',
width: 120,
},
// {
// title: '',
// dataIndex: 'areaLabels',
// key: 'areaLabels',
// align: 'center',
// width: 120,
// },
{
title: '操作',
dataIndex: 'action',
key: 'action',
align: 'center',
width: 180,
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',
value: '0-0',
key: '0-0',
children: [
{
value: '0-0-1',
key: '0-0-1',
slots: {
title: 'title',
},
},
{
title: 'Child Node2',
value: '0-0-2',
key: '0-0-2',
},
],
},
{
title: 'Node2',
value: '0-1',
key: '0-1',
},
]);
const options = ref([
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: [
{
value: 'xihu',
label: 'West Lake',
},
],
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
children: [
{
value: 'zhonghuamen',
label: 'Zhong Hua Men',
},
],
},
],
},])
getPageList()
async function getPageList() {
try {
const { pageSize, current } = paginationState
const { success, data, total } = await apis.serviceStaffList
.getProjectList({
pageSize,
current: current,
...searchFormData.value,
})
.catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
listData.value = data
paginationState.total = total
}
} catch (error) {
}
}
/**核销 */
const checkHandler = (record) => {
Modal.confirm({
title: '即将核销是否继续',
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: async () => {
const params = {
...record,
status: 'success'
}
const { success } = await apis.productOrder.updateItem(params.id, params).catch(() => {
// throw new Error()
})
if (config('http.code.success') === success) {
// resolve()
message.success('核销成功')
await getPageList()
}
},
})
}
/**
* 删除
*/
function handleDelete({ id }) {
Modal.confirm({
title: t('pages.system.user.delTip'),
content: t('button.confirm'),
okText: t('button.confirm'),
onOk: () => {
return new Promise((resolve, reject) => {
; (async () => {
try {
const { success } = await apis.productOrder.delItem(id).catch(() => {
throw new Error()
})
if (config('http.code.success') === success) {
resolve()
message.success(t('component.message.success.delete'))
await getPageList()
}
} catch (error) {
reject()
}
})()
})
},
})
}
/**
* 分页
*/
function onTableChange({ current, pageSize }) {
paginationState.current = current
paginationState.pageSize = pageSize
getPageList()
}
/**
* 搜索
*/
function handleSearch() {
resetPagination()
getPageList()
}
/**
* 重置
*/
function handleResetSearch() {
searchFormData.value = {}
resetPagination()
getPageList()
}
/**
* 编辑完成
*/
async function onOk() {
await getPageList()
}
</script>
<style lang="less" scoped></style>

View File

@ -25,7 +25,7 @@
<!-- 证件号码 -->
<a-col :span="12">
<a-form-item label="证件号码" name="idNumber">
<a-form-item label="证件号码" name="identityNo">
<span style="display: inline-flex; width: 100%;">
<a-select v-model:value="formData.identityType"
style="width: 100px; margin-right: 8px;">
@ -34,7 +34,7 @@
{{ item.introduction }}
</a-select-option>
</a-select>
<a-input v-model:value="formData.idNumber" placeholder="请输入证件号码" style="flex: 1;"
<a-input v-model:value="formData.identityNo" placeholder="请输入证件号码" style="flex: 1;"
@change="extractBirthDateFromIdCard" />
</span>
</a-form-item>
@ -75,19 +75,6 @@
<a-input v-model:value="formData.otherPhone1" placeholder="请输入其他电话1" />
</a-form-item>
</a-col>
<!-- 联系状态 -->
<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 dicsStore.dictOptions.CONTACT_STATUS"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<!-- 其他电话2 -->
<a-col :span="12">
<a-form-item label="其他电话2" name="otherPhone2">
@ -97,16 +84,17 @@
<!-- 政府购买服务开始时间 -->
<a-col :span="12">
<a-form-item label="政府购买服务开始时间" name="governmentPurchasedServiceStartDate">
<a-date-picker v-model:value="formData.governmentPurchasedServiceStartDate"
placeholder="请选择政府购买服务开始时间" style="width: 100%;" />
<a-form-item label="政府购买服务时间" name="governmentPurchasedServiceStartDate">
<a-range-picker v-model:value="formData.governmentPurchasedServiceStartDate"
placeholder="请选择政府购买服务时间" style="width: 100%;" />
</a-form-item>
</a-col>
<!-- 健康状况 -->
<a-col :span="12">
<a-form-item label="健康状况" name="healthStatus">
<a-select v-model:value="formData.healthStatus" placeholder="请选择健康状况" allow-clear>
<a-form-item label="健康状况" :name="['archive', 'healthStatus']">
<a-select v-model:value="formData.archive.healthStatus" placeholder="请选择健康状况"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Health_Condition"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -117,8 +105,8 @@
<!-- 服务状态 -->
<a-col :span="12">
<a-form-item label="服务状态" name="serviceStatus">
<a-select v-model:value="formData.serviceStatus" placeholder="请选择服务状态">
<a-form-item label="服务状态" :name="['archive', 'serviceStatus']">
<a-select v-model:value="formData.archive.serviceStatus" placeholder="请选择服务状态">
<a-select-option v-for="item in dicsStore.dictOptions.SERVICE_STATUS"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -129,8 +117,8 @@
<!-- 生存状态 -->
<a-col :span="12">
<a-form-item label="生存状态" name="survivalStatus">
<a-select v-model:value="formData.survivalStatus" placeholder="请选择生存状态">
<a-form-item label="生存状态" :name="['archive', 'survivalStatus']">
<a-select v-model:value="formData.archive.survivalStatus" placeholder="请选择生存状态">
<a-select-option v-for="item in dicsStore.dictOptions.LIVING_STATUS"
:key="item.dval" :value="item.dval">{{
item.introduction }}</a-select-option>
@ -140,8 +128,9 @@
<!-- 服务形式 -->
<a-col :span="12">
<a-form-item label="服务形式" name="serviceForm">
<a-select v-model:value="formData.serviceForm" placeholder="请选择服务形式" allow-clear>
<a-form-item label="服务形式" name="archive.serviceForm">
<a-select v-model:value="formData.archive.serviceForm" placeholder="请选择服务形式"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Service_Format"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -152,8 +141,9 @@
<!-- 护理等级 -->
<a-col :span="12">
<a-form-item label="护理等级" name="nursingLevel">
<a-select v-model:value="formData.nursingLevel" placeholder="请选择护理等级" allow-clear>
<a-form-item label="护理等级" name="archive.nursingLevel">
<a-select v-model:value="formData.archive.nursingLevel" placeholder="请选择护理等级"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Care_Level" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
@ -163,13 +153,13 @@
</a-col>
<!-- 家庭地址 -->
<a-col :span="12">
<a-form-item label="家庭地址" name="homeAreaCodes">
<AreaCascader v-model:value="formData.homeAreaCodes" @change="onAreaChange" />
<a-form-item label="家庭地址" :name="['archive', 'homeAreaCodes']">
<AreaCascader v-model:value="formData.archive.homeAreaCodes" @change="onAreaChange" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="详细地址" name="homeDetailAddress">
<a-input v-model:value="formData.homeDetailAddress" placeholder="请输入详细地址" />
<a-form-item label="详细地址" :name="['archive', 'homeDetailAddress']">
<a-input v-model:value="formData.archive.homeDetailAddress" placeholder="请输入详细地址" />
</a-form-item>
</a-col>
</a-row>
@ -181,15 +171,15 @@
<a-row :gutter="24">
<!-- 经度 -->
<a-col :span="12">
<a-form-item label="经度" name="log">
<a-input v-model:value="formData.lng" placeholder="请输入经度" />
<a-form-item label="经度" name="lat">
<a-input v-model:value="formData.archive.lat" placeholder="请输入经度" />
</a-form-item>
</a-col>
<!-- 纬度 -->
<a-col :span="12">
<a-form-item label="纬度" name="lat">
<a-input v-model:value="formData.lat" placeholder="请输入纬度" />
<a-form-item label="纬度" name="lag">
<a-input v-model:value="formData.archive.lag" placeholder="请输入纬度" />
</a-form-item>
</a-col>
<gx-map @handleGetLng="handleGetLng" />
@ -203,7 +193,8 @@
<!-- 居住情况 -->
<a-col :span="8">
<a-form-item label="居住情况" name="livingSituation">
<a-select v-model:value="formData.livingSituation" placeholder="请选择居住情况" allow-clear>
<a-select v-model:value="formData.archive.livingSituation" placeholder="请选择居住情况"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Living_Situation"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -215,7 +206,8 @@
<!-- 子女情况 -->
<a-col :span="8">
<a-form-item label="子女情况" name="childrenSituation">
<a-select v-model:value="formData.childrenSituation" placeholder="请选择子女情况" allow-clear>
<a-select v-model:value="formData.archive.childrenSituation" placeholder="请选择子女情况"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.CHILDREN_STATE"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -227,7 +219,8 @@
<!-- 统计分类 -->
<a-col :span="8">
<a-form-item label="统计分类" name="statisticsCategory">
<a-select v-model:value="formData.statisticsCategory" placeholder="请选择统计分类" allow-clear>
<a-select v-model:value="formData.archive.statisticsCategory" placeholder="请选择统计分类"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Statistical_Classification"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -239,7 +232,7 @@
<!-- 智力情况 -->
<a-col :span="8">
<a-form-item label="智力情况" name="intellectualSituation">
<a-select v-model:value="formData.intellectualSituation" placeholder="请选择智力情况"
<a-select v-model:value="formData.archive.intellectualSituation" placeholder="请选择智力情况"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Intellectual_Condition"
:key="item.dval" :value="item.dval">
@ -252,7 +245,7 @@
<!-- 是否长期照料失能子女 -->
<a-col :span="8">
<a-form-item label="是否长期照料失能子女" name="longTermCareForDisabledChildren">
<a-select v-model:value="formData.longTermCareForDisabledChildren"
<a-select v-model:value="formData.archive.longTermCareForDisabledChildren"
placeholder="请选择是否长期照料失能子女" allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Disabled_Child"
:key="item.dval" :value="item.dval">
@ -265,7 +258,7 @@
<!-- 老人子女探望情况 -->
<a-col :span="8">
<a-form-item label="老人子女探望情况" name="childrenVisitStatus">
<a-select v-model:value="formData.childrenVisitStatus" placeholder="请选择老人子女探望情况"
<a-select v-model:value="formData.archive.childrenVisitStatus" placeholder="请选择老人子女探望情况"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Frequency_Visits"
:key="item.dval" :value="item.dval">
@ -278,8 +271,8 @@
<!-- 是否人户分离 -->
<a-col :span="8">
<a-form-item label="是否人户分离" name="householdResidenceSeparation">
<a-select v-model:value="formData.householdResidenceSeparation" placeholder="请选择是否人户分离"
allow-clear>
<a-select v-model:value="formData.archive.householdResidenceSeparation"
placeholder="请选择是否人户分离" allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Separation" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
@ -291,7 +284,7 @@
<!-- 民族 -->
<a-col :span="8">
<a-form-item label="民族" name="ethnicity">
<a-select v-model:value="formData.ethnicity" placeholder="请选择民族" allow-clear>
<a-select v-model:value="formData.archive.ethnicity" placeholder="请选择民族" allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Ethnicity" :key="item.dval"
:value="item.dval">
{{ item.introduction }}
@ -303,8 +296,8 @@
<!-- 是否完成能力评估 -->
<a-col :span="8">
<a-form-item label="是否完成能力评估" name="completedCapacityAssessment">
<a-select v-model:value="formData.completedCapacityAssessment" placeholder="请选择是否完成能力评估"
allow-clear>
<a-select v-model:value="formData.archive.completedCapacityAssessment"
placeholder="请选择是否完成能力评估" allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Capability_Assessment"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -316,7 +309,7 @@
<!-- 是否住出租屋/地下室 -->
<a-col :span="8">
<a-form-item label="是否住出租屋/地下室" name="livesInRentedRoomOrBasement">
<a-select v-model:value="formData.livesInRentedRoomOrBasement"
<a-select v-model:value="formData.archive.livesInRentedRoomOrBasement"
placeholder="请选择是否住出租屋/地下室" allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Property_Basement"
:key="item.dval" :value="item.dval">
@ -329,7 +322,8 @@
<!-- 经济来源 -->
<a-col :span="8">
<a-form-item label="经济来源" name="economicSource">
<a-select v-model:value="formData.economicSource" placeholder="请选择经济来源" allow-clear>
<a-select v-model:value="formData.archive.economicSource" placeholder="请选择经济来源"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Source_Income"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -341,7 +335,8 @@
<!-- 文化程度 -->
<a-col :span="8">
<a-form-item label="文化程度" name="educationLevel">
<a-select v-model:value="formData.educationLevel" placeholder="请选择文化程度" allow-clear>
<a-select v-model:value="formData.archive.educationLevel" placeholder="请选择文化程度"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Level_Education"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -353,7 +348,7 @@
<!-- 宗教信仰 -->
<a-col :span="8">
<a-form-item label="宗教信仰" name="religion">
<a-select v-model:value="formData.religion" placeholder="请选择宗教信仰" allow-clear>
<a-select v-model:value="formData.archive.religion" placeholder="请选择宗教信仰" allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Religious_belief"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -365,7 +360,7 @@
<!-- 职业情况 -->
<a-col :span="8">
<a-form-item label="职业情况" name="occupation">
<a-select v-model:value="formData.occupation" placeholder="请选择职业情况" allow-clear>
<a-select v-model:value="formData.archive.occupation" placeholder="请选择职业情况" allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Employment_Status"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -377,7 +372,7 @@
<!-- 政治面貌 -->
<a-col :span="8">
<a-form-item label="政治面貌" name="politicalAffiliation">
<a-select v-model:value="formData.politicalAffiliation" placeholder="请选择政治面貌"
<a-select v-model:value="formData.archive.politicalAffiliation" placeholder="请选择政治面貌"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Political_affiliation"
:key="item.dval" :value="item.dval">
@ -390,7 +385,8 @@
<!-- 婚姻情况 -->
<a-col :span="8">
<a-form-item label="婚姻情况" name="maritalStatus">
<a-select v-model:value="formData.maritalStatus" placeholder="请选择婚姻情况" allow-clear>
<a-select v-model:value="formData.archive.maritalStatus" placeholder="请选择婚姻情况"
allow-clear>
<a-select-option v-for="item in dicsStore.dictOptions.Marital_Status"
:key="item.dval" :value="item.dval">
{{ item.introduction }}
@ -398,23 +394,33 @@
</a-select>
</a-form-item>
</a-col>
<a-col :span='8'>
<a-form-item label="分类标签" name="labelsCode">
<a-select v-model:value="formData.labelsCode" allowClear mode="multiple">
<a-select-option v-for="item in dicsStore.dictOptions.Service_Recipient_Category2"
: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="householdArea">
<AreaCascader v-model:value="formData.householdArea" @change="onAreaHoldChange" />
<AreaCascader v-model:value="formData.archive.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-input v-model:value="formData.archive.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="1"
<a-textarea v-model:value="formData.archive.otherNotes" placeholder="请输入" :rows="1"
:auto-size="{ minRows: 1, maxRows: 2 }" />
</a-form-item>
</a-col>
@ -422,26 +428,16 @@
<!-- 身份证照片 -->
<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">
<div>
<plus-outlined />
<div class="ant-upload-text">选择图片</div>
</div>
</a-upload>
<gx-upload v-model="formData.archive.idCardPhotos" accept-types=".jpg,.png,.webp"
:fileNumber="1" />
</a-form-item>
</a-col>
<!-- 上传资料 -->
<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">
<div>
<plus-outlined />
<div class="ant-upload-text">选择图片</div>
</div>
</a-upload>
<gx-upload v-model="formData.archive.idCardPhotos" accept-types=".jpg,.png,.webp,.xlsx,.docx,.doc"
:fileNumber="10" />
</a-form-item>
</a-col>
</a-row>
@ -460,8 +456,9 @@ import { useForm, useModal } from '@/hooks'
import { useDicsStore } from '@/store'
import AreaCascader from '@/components/AreaCascader/index.vue'
import { validatePhone, validateEmail, validateIdCard } from '@/utils/validate'
import { getBirthDate } from '@/utils/util'
import { getBirthDate, spliceUrl } from '@/utils/util'
import dayjs from 'dayjs'
import { message } from 'ant-design-vue'
const emit = defineEmits(['ok'])
const activeKey = ref('1')
@ -471,16 +468,23 @@ const cancelText = ref('取消')
formRules.value = {
name: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
identityType: [{ required: true, message: '请选择证件类型', trigger: 'change' }],
idNumber: [{ required: true, message: '请输入证件号码', trigger: 'blur' }],
identityNo: [{ required: true, message: '请输入证件号码', trigger: 'blur' }],
contact1: [{ validator: validatePhone, trigger: ['blur', 'input'] }, { required: true, message: '请输入联系方式', trigger: 'blur' }],
healthStatus: [{ required: true, message: '请选择健康状况', trigger: 'change' }],
survivalStatus: [{ required: true, message: '请选择生存状态', trigger: 'change' }],
homeAreaCodes: [{ required: true, message: '请选择并输入家庭地址', trigger: 'change' }],
serviceStatus: [{ required: true, message: '请选择服务状态', trigger: 'change' }],
homeDetailAddress: [{ required: true, message: '请输入详细地址', trigger: 'change' }],
archive: {
healthStatus: [{ required: true, message: '请选择健康状况', trigger: 'change' }],
serviceStatus: [{ required: true, message: '请选择服务状态', trigger: 'change' }],
homeAreaCodes: [{ required: true, message: '请选择并输入家庭地址', trigger: 'change' }],
homeDetailAddress: [{ required: true, message: '请输入详细地址', trigger: 'change' }],
},
}
const dicsStore = useDicsStore()
formData.value = {
archive: {
}
}
/**
* 新建
*/
@ -506,6 +510,10 @@ async function handleEdit(record = {}) {
return
}
formData.value = { ...data }
formData.value.birthDate=dayjs(data.birthDate)
formData.value.archive.idCardPhotos = data.archive.idCardPhotos ? data.archive.idCardPhotos.map(item => config('http.apiBasic') + item) : []
formData.value.archive.uploadedDocuments = data.archive.uploadedDocuments ? data.archive.uploadedDocuments.map(item => config('http.apiBasic') + item) : []
formData.value.governmentPurchasedServiceStartDate=[dayjs(formData.value.starGovernmentService),dayjs(formData.value.endGovernmentService)]
}
// utils/idCard.js
function isValidIdCard(value) {
@ -567,11 +575,19 @@ function handleOk() {
.then(async (values) => {
try {
showLoading()
const params = {
let params = {
...formData.value,
labels: formData.value.labelsCode ? formData.value.labelsCode.map(item => dicsStore.getDictLabel('Service_Recipient_Category2', item)) : [],
birthDate:dayjs(formData.value.birthDate).format('YYYY-MM-DD')
}
params.archive.idCardPhotos = formData.value.archive.idCardPhotos ? formData.value.archive.idCardPhotos.map(item => spliceUrl(item)) : ['']
params.archive.uploadedDocuments = formData.value.archive.uploadedDocuments ? formData.value.archive.uploadedDocuments.map(item => spliceUrl(item)) : ['']
if(formData.value.governmentPurchasedServiceStartDate.length>0){
params.archive.starGovernmentService=dayjs(formData.value.governmentPurchasedServiceStartDate[0]).format('YYYY-MM-DD')
params.archive.endGovernmentService=dayjs(formData.value.governmentPurchasedServiceStartDate[1]).format('YYYY-MM-DD')
}
//
if (params.identityType === '1' && !isValidIdCard(params.idNumber)) {
if (params.identityType === '1' && !isValidIdCard(params.identityNo)) {
throw new Error('请输入正确的身份证号码');
}
@ -584,7 +600,8 @@ function handleOk() {
console.log('result', result.code)
break
case 'edit':
result = await apis.serverObj.updateItem(params).catch(() => {
console.log(params)
result = await apis.serverObj.updateItem(params.id,params).catch(() => {
throw new Error()
})
break
@ -596,7 +613,7 @@ function handleOk() {
}
} catch (error) {
hideLoading()
message.error(error.message)
// message.error(error.message)
}
})
.catch(() => {
@ -606,26 +623,40 @@ function handleOk() {
//
const extractBirthDateFromIdCard = () => {
console.log(111)
const { idNumber } = formData.value;
if (!idNumber) {
const { identityNo } = formData.value;
if (!identityNo) {
formData.value.birthDate = '';
return;
}
console.log(getBirthDate(idNumber))
formData.value.birthDate = dayjs(getBirthDate(idNumber));
console.log(getBirthDate(identityNo))
formData.value.birthDate = dayjs(getBirthDate(identityNo));
};
function onAreaChange(value, labels) {
console.log(formData.value.homeAreaCodes);
formData.value.homeAreaLabels = [...labels]
formData.value.archive.homeAreaLabels = [...labels]
}
function onAreaHoldChange(value, labels) {
console.log(formData.value.houseAreaCodes);
formData.value.houseAreaLabels = [...labels]
formData.value.archive.houseAreaLabels = [...labels]
}
function handleGetLng(obj) {
formData.value.lat = obj.lat
formData.value.lng = obj.lng
formData.value.lag = obj.lng
}
//
const handleCustomRequest = async (options) => {
const { file, onProgress, onSuccess, onError } = options;
try {
const formData = new FormData();
formData.append('file', file);
const { data } = await apis.common.uploadFile(formData);
const fullUrl = config('http.apiBasic') + data;
console.log(fullUrl)
} catch (err) {
message.error('上传失败');
}
};
/**
* 取消
*/
@ -638,6 +669,7 @@ function handleCancel() {
*/
function onAfterClose() {
resetForm()
formData.value.archive = {}
hideLoading()
}

View File

@ -3,22 +3,15 @@
<template #default="{ gutter, colSpan }">
<a-form :model="searchFormData" labelAlign="left">
<a-row :gutter="24">
<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-col :span="8">
<a-form-item label="所在节点" name="serviceNodeIds">
<node-tree v-model:value="searchFormData.serviceNodeIds" />
</a-form-item>
</a-col>
<!-- 所在区域 -->
<a-col :span="12">
<a-form-item label="所在区域" name="region">
<AreaCascader v-model:value="searchFormData.currentNode" @change="onAreaChange" />
<a-col :span="8">
<a-form-item label="所在区域" name="areaCodes">
<AreaCascader v-model:value="searchFormData.areaCodes" @change="onAreaChange" />
</a-form-item>
</a-col>
<!-- 姓名 -->
@ -47,8 +40,8 @@
<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">{{
<a-select-option v-for="item in dicsStore.dictOptions.Service_Recipient_Category2"
:key="item.dval" :value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
@ -219,15 +212,8 @@
<!-- 户籍地址建议若为区域则用 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 label="户籍地址" name="hAreaCodes">
<AreaCascader v-model:value="searchFormData.hAreaCodes" @change="detailedAddressChange" />
</a-form-item>
</a-col>
@ -294,6 +280,24 @@
<template v-if="column.key === 'serialNumber'">
<span>{{ index + 1 }}</span>
</template>
<template v-if="column.key === 'gender'">
<span>{{ record.gender === '1' ? '男' : '女' }}</span>
</template>
<template v-if="column.key === 'survivalStatus'">
<span>{{ dicsStore.getDictLabel('LIVING_STATUS', record.survivalStatus) }}</span>
</template>
<template v-if="column.key === 'healthStatus'">
<span>{{ dicsStore.getDictLabel('Health_Condition', record.healthStatus) }}</span>
</template>
<template v-if="column.key === 'governmentPurchasedService'">
<span>{{ record.governmentPurchasedService ? '是' : '' }}</span>
</template>
<template v-if="column.key === 'serviceRecipientCategory'">
<span>{{
dicsStore.getDictLabel('Service_Recipient_Category2', record.serviceRecipientCategory)
}}</span>
</template>
<template v-if="'action' === column.key">
<x-action-button @click="$refs.detailRef.handleCreate(record)">
<span>详情</span>
@ -322,7 +326,7 @@
<script setup>
import { message, Modal } from 'ant-design-vue'
import { ref } from 'vue'
import { onMounted, ref } from 'vue'
import apis from '@/apis'
import { config } from '@/config'
import { usePagination } from '@/hooks'
@ -332,6 +336,7 @@ import EditDialog from './components/EditDialog.vue'
import detail from './components/detail.vue'
import { useDicsStore } from '@/store'
import AreaCascader from '@/components/AreaCascader/index.vue'
import NodeTree from '@/components/NodeTree/index.vue'
import dayjs from 'dayjs'
defineOptions({
name: 'serverList',
@ -370,8 +375,8 @@ const columns = [
},
{
title: '身份证号',
dataIndex: 'idNumber',
key: 'idNumber',
dataIndex: 'identityNo',
key: 'identityNo',
align: 'center',
width: 180,
},
@ -403,48 +408,7 @@ const columns = [
align: 'center',
width: 120,
},
{
title: '联系状态',
dataIndex: 'contactStatus',
key: 'contactStatus',
align: 'center',
width: 120,
},
{
title: '是否完成能力评估',
dataIndex: 'completedCapacityAssessment',
key: 'completedCapacityAssessment',
align: 'center',
width: 150,
},
{
title: '是否住出租屋/地下室',
dataIndex: 'livesInRentedRoomOrBasement',
key: 'livesInRentedRoomOrBasement',
align: 'center',
width: 180,
},
{
title: '是否人户分离',
dataIndex: 'householdResidenceSeparation',
key: 'householdResidenceSeparation',
align: 'center',
width: 120,
},
{
title: '婚姻情况',
dataIndex: 'maritalStatus',
key: 'maritalStatus',
align: 'center',
width: 120,
},
{
title: '居住情况',
dataIndex: 'livingSituation',
key: 'livingSituation',
align: 'center',
width: 120,
},
{
title: '生存状态',
dataIndex: 'survivalStatus',
@ -455,8 +419,8 @@ const columns = [
// --- ---
{
title: '去世时间',
dataIndex: 'dateOfDeath',
key: 'dateOfDeath',
dataIndex: 'passWayAt',
key: 'passWayAt',
align: 'center',
width: 140,
customRender: ({ text, record }) => {
@ -466,8 +430,8 @@ const columns = [
// --- ---
{
title: '去世原因',
dataIndex: 'causeOfDeath',
key: 'causeOfDeath',
dataIndex: 'passWayReason',
key: 'passWayReason',
align: 'center',
width: 140,
},
@ -599,73 +563,19 @@ const { t } = useI18n() // 解构出t方法
const { listData, loading, showLoading, hideLoading, paginationState, resetPagination, searchFormData } = usePagination()
const editDialogRef = ref()
const detailRef = ref()
const treeData = ref([
{
title: 'Node1',
value: '0-0',
key: '0-0',
children: [
{
value: '0-0-1',
key: '0-0-1',
slots: {
title: 'title',
},
},
{
title: 'Child Node2',
value: '0-0-2',
key: '0-0-2',
},
],
},
{
title: 'Node2',
value: '0-1',
key: '0-1',
},
]);
const options = ref([
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: [
{
value: 'xihu',
label: 'West Lake',
},
],
},
],
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
children: [
{
value: 'zhonghuamen',
label: 'Zhong Hua Men',
},
],
},
],
},])
onMounted(() => {
searchFormData.value.serviceNodeIds = dicsStore.orgTree[0].value
getCount(searchFormData.value.serviceNodeIds)
})
getPageList()
getCount()
async function getCount(params) {
try {
const { success, data } = await apis.serverObj.getCount({serviceNodeCodes:searchFormData.value.serviceNodeCodes})
const { success, data } = await apis.serverObj.getCount({ serviceNodeCodes: params })
if (config('http.code.success') === success) {
totalCount.value = data
totalCount.value = data.count
}
} catch (error) {
@ -747,7 +657,12 @@ function handleDelete({ id }) {
},
})
}
function onAreaChange(value) {
searchFormData.value.areaCodes = value
}
function detailedAddressChange(value) {
searchFormData.value.hAreaCodes = value
}
/**
* 分页
*/

View File

@ -1,18 +1,80 @@
<template>
<a-modal :open="modal.open" :title="modal.title" :width="600" :confirm-loading="modal.confirmLoading"
:after-close="onAfterClose" :cancel-text="cancelText" @ok="handleOk" @cancel="handleCancel">
<a-form ref="formRef" :model="formData" :rules="formRules">
<a-row :gutter="24">
<!-- 姓名 -->
<a-col :span="24">
<a-form-item label="分配到" name="name" :rules="[{ required: true, message: '请选择节点' }]">
<a-tree-select v-model:value="formData.name" style="width: 100%" :tree-data="treeData" tree-checkable
allow-clear :show-checked-strategy="SHOW_PARENT" placeholder="请选择站点"
tree-node-filter-prop="label" />
</a-form-item>
</a-col>
</a-row>
</a-form>
<a-card>
<a-form ref="formRef" :model="formData" :rules="formRules">
<a-row :gutter="24">
<a-col :span="12">
<a-form-item label="姓名" name="name">
<a-input v-model:value="formData.name" placeholder="请输入姓名" />
</a-form-item>
</a-col>
<!-- 性别 -->
<a-col :span="12">
<a-form-item label="性别" name="gender">
<a-radio-group v-model:value="formData.gender">
<a-radio value="1"></a-radio>
<a-radio value="2"></a-radio>
</a-radio-group>
</a-form-item>
</a-col>
<!-- 证件号码 -->
<a-col :span="12">
<a-form-item label="身份证号" name="idCard">
<a-input v-model:value="formData.idCard" placeholder="请输入证件号码" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="电话" name="phone">
<a-input v-model:value="formData.phone" placeholder="请输入电话" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="电话" name="phone">
<a-input v-model:value="formData.phone" placeholder="请输入电话" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="护理人员类型" name="serviceType">
<a-select v-model:value="formData.serviceType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.STAFF_TYPE" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="护理人员状态" name="status">
<a-select v-model:value="formData.status" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.STAFF_STATUS" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="用工形式" name="workType">
<a-select v-model:value="formData.workType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.USE_TYPE" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="所属服务组织" name="stationLables">
<node-tree v-model:value="formData.stationLables" />
</a-form-item>
</a-col>
<!-- <a-col :span="8">
<a-form-item label="组织所在区域" name="areaLabels">
<node-tree v-model:value="formData.areaLabels" />
</a-form-item>
</a-col> -->
</a-row>
</a-form>
</a-card>
</a-modal>
</template>
@ -24,43 +86,14 @@ import apis from '@/apis'
import { useForm, useModal } from '@/hooks'
import { useDicsStore } from '@/store'
import AreaCascader from '@/components/AreaCascader/index.vue'
import NodeTree from '@/components/NodeTree/index.vue'
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 treeData = [
{
label: 'Node1',
value: '0-0',
children: [
{
label: 'Child Node1',
value: '0-0-0',
},
],
},
{
label: 'Node2',
value: '0-1',
const dicsStore = useDicsStore()
children: [
{
label: 'Child Node3',
value: '0-1-0',
disabled: true,
},
{
label: 'Child Node4',
value: '0-1-1',
},
{
label: 'Child Node5',
value: '0-1-2',
},
],
},
];
/**
* 新建
@ -68,7 +101,7 @@ const treeData = [
function handleCreate() {
showModal({
type: 'create',
title: '分配节点',
title: '新增服务人员',
})
}
/**
@ -139,6 +172,7 @@ function onAfterClose() {
}
defineExpose({
handleEdit,
handleCreate,
})
</script>

View File

@ -5,15 +5,8 @@
<a-row :gutter="[24, 24]">
<!-- 所在区域 -->
<a-col :span="8">
<a-form-item label="所属服务组织" name="orgCode">
<a-tree-select v-model:value="searchFormData.orgCode" 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 label="所属服务组织" name="station">
<node-tree v-model:value="searchFormData.station" />
</a-form-item>
</a-col>
<!-- 姓名 -->
@ -25,13 +18,13 @@
<!-- 身份证号 -->
<a-col :span="8">
<a-form-item label="联系电话" name="contact">
<a-input v-model:value="searchFormData.contact" placeholder="请输入联系电话" />
<a-form-item label="联系电话" name="phone">
<a-input v-model:value="searchFormData.phone" placeholder="请输入联系电话" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="护理人员类型" name="staffType">
<a-select v-model:value="searchFormData.staffType" allowClear>
<a-form-item label="护理人员类型" name="serviceType">
<a-select v-model:value="searchFormData.serviceType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.STAFF_TYPE" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
@ -39,8 +32,8 @@
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="护理人员状态" name="staffStatus">
<a-select v-model:value="searchFormData.staffType" allowClear>
<a-form-item label="护理人员状态" name="status">
<a-select v-model:value="searchFormData.status" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.STAFF_STATUS" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
@ -48,8 +41,8 @@
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="用工形式" name="useType">
<a-select v-model:value="searchFormData.useType" allowClear>
<a-form-item label="用工形式" name="workType">
<a-select v-model:value="searchFormData.workType" allowClear>
<a-select-option v-for="item in dicsStore.dictOptions.USE_TYPE" :key="item.dval"
:value="item.dval">{{
item.introduction }}</a-select-option>
@ -74,7 +67,7 @@
<a-card title="服务人员列表">
<template #extra>
<a-space>
<a-button type="primary">新建</a-button>
<a-button type="primary" @click="$refs.editDialogRef.handleCreate(record)">新建</a-button>
<a-button type="primary">导出</a-button>
<a-button type="dashed">导出记录</a-button>
</a-space>
@ -89,9 +82,6 @@
<x-action-button @click="$refs.editDialogRef.handleEdit(record)">
<span>编辑</span>
</x-action-button>
<x-action-button @click="$refs.detailRef.handleEdit(record)">
<span>详情</span>
</x-action-button>
<x-action-button @click="handleDelete(record)">
<span style="color: #ff4d4f;">删除</span>
</x-action-button>
@ -117,6 +107,7 @@ import { useDicsStore } from '@/store'
import AreaCascader from '@/components/AreaCascader/index.vue'
import detail from './components/detail.vue'
import dayjs from 'dayjs'
import NodeTree from '@/components/NodeTree/index.vue'
defineOptions({
name: 'allocation',
})
@ -146,55 +137,61 @@ const columns = [
},
{
title: '电话',
dataIndex: 'contact',
key: 'contact',
dataIndex: 'phone',
key: 'phone',
align: 'center',
width: 80,
},
{
title: '身份证号',
dataIndex: 'idNumber',
key: 'idNumber',
dataIndex: 'idCard',
key: 'idCard',
align: 'center',
width: 180,
},
{
title: '护理人员类型',
dataIndex: 'staffType',
key: 'staffType',
dataIndex: 'serviceType',
key: 'serviceType',
align: 'center',
width: 120,
},
{
title: '用工形式',
dataIndex: 'useType',
key: 'useType',
dataIndex: 'workType',
key: 'workType',
align: 'center',
width: 120,
},
{
title: '状态',
dataIndex: 'status',
key: 'status',
align: 'center',
width: 120,
},
// --- ---
{
title: '护理人员状态',
dataIndex: 'staffStatus',
key: 'staffStatus',
title: '护理人员类型',
dataIndex: 'serviceType',
key: 'serviceType',
align: 'center',
width: 130,
},
{
title: '所属服务组织',
dataIndex: 'orgName',
key: 'orgName',
align: 'center',
width: 120,
},
{
title: '组织所在区域',
dataIndex: 'region',
key: 'region',
dataIndex: 'stationName',
key: 'stationName',
align: 'center',
width: 120,
},
// {
// title: '',
// dataIndex: 'areaLabels',
// key: 'areaLabels',
// align: 'center',
// width: 120,
// },
{
title: '操作',
@ -275,7 +272,7 @@ getPageList()
async function getPageList() {
try {
const { pageSize, current } = paginationState
const { success, data, total } = await apis.serverObj
const { success, data, total } = await apis.serviceStaffList
.getProjectList({
pageSize,
current: current,