部门管理增加省市区等

This commit is contained in:
1378012178@qq.com 2025-05-30 16:50:40 +08:00
parent 5399127ea9
commit b8efa56a30
10 changed files with 477 additions and 332 deletions

View File

@ -122,7 +122,7 @@
//
const columns = [
{
title: '护理单元ID',
title: '护理单元编码',
dataIndex: 'nuId',
width: 180,
align: 'left',

View File

@ -10,6 +10,11 @@ export const columns: BasicColumn[] = [
align: "center",
dataIndex: 'nuName'
},
{
title: '护理单元编码',
align: "center",
dataIndex: 'code'
},
{
title: '区域标签',
align: "center",

View File

@ -2,16 +2,24 @@
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="NuBaseInfoForm">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="NuBaseInfoForm">
<a-row>
<a-col :span="24">
<a-form-item label="护理单元名称" v-bind="validateInfos.nuName" id="NuBaseInfoForm-nuName" name="nuName">
<a-input v-model:value="formData.nuName" placeholder="请输入护理单元名称" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="护理单元编码" v-bind="validateInfos.code" id="NuBaseInfoForm-code" name="code">
<a-input v-model:value="formData.code" placeholder="编码自动生成" allow-clear :disabled="!formData.code"
:readonly="formData.code"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="区域标签" v-bind="validateInfos.areaFlag" id="NuBaseInfoForm-areaFlag" name="areaFlag">
<j-dict-select-tag v-model:value="formData.areaFlag" dictCode="nu_type" placeholder="请选择区域标签ID" allow-clear />
<j-dict-select-tag v-model:value="formData.areaFlag" dictCode="nu_type" placeholder="请选择区域标签ID"
allow-clear />
</a-form-item>
</a-col>
<!-- <a-col :span="24">
@ -46,6 +54,7 @@
const formData = reactive<Record<string, any>>({
id: '',
nuName: '',
code: '',
areaFlag: '',
status: '',
});

View File

@ -65,7 +65,7 @@ export const saveOrUpdateDict = (params, isUpdate) => {
*
* @param params
*/
export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData, params });
export const loadTreeData = (params) => defHttp.get({ url: Api.loadTreeData,timeout:100*1000, params });
/**
*
* @param params

View File

@ -64,4 +64,10 @@ export const formSchema: FormSchema[] = [
required: true,
component: 'Input',
},
{
label: '编码(非必要无需填写)',
field: 'code',
required: false,
component: 'Input',
},
];

View File

@ -1,5 +1,5 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose width="550px" :title="getTitle" @ok="handleSubmit">
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose width="50vw" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
@ -21,11 +21,11 @@
showActionButtonGroup: false,
labelCol: {
xs: { span: 24 },
sm: { span: 4 },
sm: { span: 5 },
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 18 },
sm: { span: 15 },
},
});
//

View File

@ -147,6 +147,9 @@
* 成功回调
*/
async function handleSuccess({ isUpdate,isSubAdd, values, expandedArr }) {
reload();
return
// 🤡
if (isUpdate) {
//
updateTableDataRecord(values.id, values);

View File

@ -1,6 +1,22 @@
<template>
<BasicModal :title="title" :width="800" v-bind="$attrs" @ok="handleOk" @register="registerModal">
<BasicForm @register="registerForm" />
<BasicForm @register="registerForm">
<!-- 省份 -->
<template #province="{ model, field }">
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"
:dictCode="getProvinceDictCode()" placeholder="请选择所在省份" />
</template>
<!-- 城市 -->
<template #city="{ model, field }">
<j-dict-select-tag @change="cityChanged(model)" v-model:value="model[field]" :dictCode="getCityDictCode(model)"
placeholder="请选择所在城市" :disabled="!model.province" />
</template>
<!-- 区县 -->
<template #district="{ model, field }">
<j-dict-select-tag v-model:value="model[field]" :dictCode="getDistrictDictCode(model)" placeholder="请选择所在区县"
:disabled="!model.province || !model.city" />
</template>
</BasicForm>
</BasicModal>
</template>
@ -12,6 +28,7 @@
import { saveOrUpdateDepart } from '../depart.api';
import { useBasicFormSchema, orgCategoryOptions } from '../depart.data';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const emit = defineEmits(['success', 'register']);
const props = defineProps({
@ -60,6 +77,18 @@
field: 'url',
show: !isChild,
},
{
field: 'province',
show: !isChild,
},
{
field: 'city',
show: !isChild,
},
{
field: 'district',
show: !isChild,
},
]);
let record = unref(data?.record);
@ -93,4 +122,32 @@
setModalProps({ confirmLoading: false });
}
}
/**
* 省份字典
*/
function getProvinceDictCode() {
return 'sys_category,name,id,pid = \'xzqhdm\' order by code asc'
}
function provinceChanged(model) {
model.city = null
model.district = null
}
/**
* 城市字典
* @param v_
*/
function getCityDictCode(v_) {
return 'sys_category,name,id,pid = \'' + v_.province + '\' order by code asc'
}
function cityChanged(model) {
model.district = null
}
/**
* 区县字典
* @param v_
*/
function getDistrictDictCode(v_) {
return 'sys_category,name,id,pid = \'' + v_.city + '\' order by code asc'
}
</script>

View File

@ -1,6 +1,22 @@
<template>
<a-spin :spinning="loading">
<BasicForm @register="registerForm" />
<BasicForm @register="registerForm">
<!-- 省份 -->
<template #province="{ model, field }">
<j-dict-select-tag @change="provinceChanged(model)" v-model:value="model[field]"
:dictCode="getProvinceDictCode()" placeholder="请选择所在省份" :disabled="model.orgCategory != '1'" />
</template>
<!-- 城市 -->
<template #city="{ model, field }">
<j-dict-select-tag @change="cityChanged(model)" v-model:value="model[field]" :dictCode="getCityDictCode(model)"
placeholder="请选择所在城市" :disabled="model.orgCategory != '1' && !model.province" />
</template>
<!-- 区县 -->
<template #district="{ model, field }">
<j-dict-select-tag v-model:value="model[field]" :dictCode="getDistrictDictCode(model)" placeholder="请选择所在区县"
:disabled="model.orgCategory != '1' && (!model.province || !model.city)" />
</template>
</BasicForm>
<div class="j-box-bottom-button offset-20" style="margin-top: 30px">
<div class="j-box-bottom-button-float" :class="[`${prefixCls}`]">
<a-button preIcon="ant-design:sync-outlined" @click="onReset">重置</a-button>
@ -16,6 +32,7 @@
import { saveOrUpdateDepart } from '../depart.api';
import { useBasicFormSchema, orgCategoryOptions } from '../depart.data';
import { useDesign } from '/@/hooks/web/useDesign';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const { prefixCls } = useDesign('j-depart-form-content');
@ -113,16 +130,46 @@
loading.value = false;
}
}
/**
* 省份字典
*/
function getProvinceDictCode() {
return 'sys_category,name,id,pid = \'xzqhdm\' order by code asc'
}
function provinceChanged(model) {
model.city = null
model.district = null
}
/**
* 城市字典
* @param v_
*/
function getCityDictCode(v_) {
return 'sys_category,name,id,pid = \'' + v_.province + '\' order by code asc'
}
function cityChanged(model) {
model.district = null
}
/**
* 区县字典
* @param v_
*/
function getDistrictDictCode(v_) {
return 'sys_category,name,id,pid = \'' + v_.city + '\' order by code asc'
}
</script>
<style lang="less">
// update-begin-author:liusq date:20230625 for: [issues/563]
@prefix-cls: ~'@{namespace}-j-depart-form-content';
/*begin 兼容暗夜模式*/
.@{prefix-cls} {
background: @component-background;
border-top: 1px solid @border-color-base;
}
/*end 兼容暗夜模式*/
// update-end-author:liusq date:20230625 for: [issues/563]
</style>
// update-end-author:liusq date:20230625 for: [issues/563]</style>

View File

@ -36,23 +36,35 @@ export function useBasicFormSchema() {
component: 'RadioButtonGroup',
componentProps: { options: [] },
},
{
field: 'departOrder',
label: '排序',
component: 'InputNumber',
componentProps: {},
},
{
field: 'url',
label: '协议域名',
component: 'Input',
dynamicDisabled: ({ values }) => {
return values.orgCategory != '1'
return values.orgCategory != '1';
},
componentProps: {
placeholder: '请输入协议域名',
},
},
{
field: 'province',
label: '省份',
component: 'Input',
slot: 'province',
},
{
field: 'city',
label: '城市',
component: 'Input',
slot: 'city',
},
{
field: 'district',
label: '区县',
component: 'Input',
slot: 'district',
},
{
field: 'mobile',
label: '电话',
@ -85,6 +97,12 @@ export function useBasicFormSchema() {
placeholder: '请输入备注',
},
},
{
field: 'departOrder',
label: '排序',
component: 'InputNumber',
componentProps: {},
},
];
return { basicFormSchema };
}