主数据bug修复

This commit is contained in:
‘huanghaiixia’
2025-12-03 16:35:03 +08:00
parent 2506d02e95
commit a60bf862cf
19 changed files with 155 additions and 82 deletions

View File

@ -491,4 +491,14 @@
display: none;
}
}
.ant-input-number-disabled {
border: none !important;
background-color: transparent !important;
padding-left: 0 !important;
color: rgb(0 0 0 / 85%) !important;
}
.ant-input-disabled {
color: rgb(0 0 0 / 85%) !important;
}
</style>

View File

@ -24,7 +24,7 @@
const { filterFormSchemaAuth } = usePermission();
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
const { currentRoute } = useRouter();
const isView = currentRoute.value.query.isView
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
const props = defineProps({
@ -44,6 +44,11 @@
let customFormEventConfigs=[];
onMounted(async () => {
formProps.schemas?.forEach(v => {
if (v.field === 'code') {
v.component = 'Input'
}
})
try {
// 合并渲染覆盖配置中的字段配置、表单事件配置
await mergeCustomFormRenderConfig();

View File

@ -15,11 +15,6 @@ export const searchFormSchema: FormSchema[] = [
label: '银行名称/简称',
component: 'Input',
},
{
field: 'code',
label: '编码',
component: 'Input',
},
{
field: 'bankCode',
label: '联行号',
@ -38,6 +33,11 @@ export const searchFormSchema: FormSchema[] = [
getPopupContainer: () => document.body,
},
},
{
field: 'code',
label: '编码',
component: 'Input',
},
// {
// field: 'fullName',
// label: '银行名称',

View File

@ -1,5 +1,5 @@
<template>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="cusFormStyle">
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex" class="cusFormStyle bankStyle">
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
<template #toolbar>
@ -215,7 +215,8 @@ const logPath = ref('/mdm/bank/datalog');
query: {
formPath: 'mdm/Bank',
formName: formName,
formId:currentRoute.value.meta.formId
formId:currentRoute.value.meta.formId,
isView: true
}
});
}
@ -374,6 +375,9 @@ const logPath = ref('/mdm/bank/datalog');
.cusFormStyle .cusSearchForm .advanceRow> div:nth-of-type(3){
display: none;
}
.bankStyle .w-full .advanceRow> div:nth-of-type(4){
display: none;
}
</style>

View File

@ -24,7 +24,7 @@
const { filterFormSchemaAuth } = usePermission();
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
const { currentRoute } = useRouter();
const isView = currentRoute.value.query.isView
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
const props = defineProps({
@ -44,6 +44,11 @@
let customFormEventConfigs=[];
onMounted(async () => {
formProps.schemas?.forEach(v => {
if (v.field === 'code') {
v.componentProps.disabled = (isView ? true : false)
}
})
try {
// 合并渲染覆盖配置中的字段配置、表单事件配置
await mergeCustomFormRenderConfig();

View File

@ -202,7 +202,8 @@
query: {
formPath: 'mdm/Category',
formName: formName,
formId: currentRoute.value.meta.formId
formId: currentRoute.value.meta.formId,
isView: true
}
});
}

View File

@ -24,7 +24,7 @@
const { filterFormSchemaAuth } = usePermission();
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
const { currentRoute } = useRouter();
const isView = currentRoute.value.query.isView
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
const props = defineProps({
@ -44,6 +44,11 @@
let customFormEventConfigs=[];
onMounted(async () => {
formProps.schemas?.forEach(v => {
if (v.field === 'code') {
v.componentProps.disabled = (isView ? true : false)
}
})
try {
let curParentId=currentRoute.value.query.id;

View File

@ -7,6 +7,7 @@
search
show-line
:show-icon="false"
:selectedKeys="selectedKeysTree"
:clickRowToExpand="true"
:treeData="treeData"
:fieldNames="{ key: 'id', title: 'fullName' }"
@ -84,6 +85,7 @@
const customConfigColums =ref(filterColumns);
const customSearchFormSchema =ref(searchFormSchema);
const selectedKeys = ref<string[]>([]);
const selectedKeysTree = ref<string[]>(['0']);
const tableRef = ref();
//所有按钮
const buttons = ref([{"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"isUse":true},{"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true,"isUse":true},{"isUse":true,"name":"启用","code":"enable","icon":"ant-design:form-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"作废","code":"disable","icon":"ant-design:stop-outlined","isDefault":true,"type":"dashed"},{"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true,"isUse":true},{"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true,"isUse":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true},{"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true,"isUse":true}]);
@ -128,7 +130,7 @@
showResetButton: true,
},
beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
return { ...params, pid:selectId.value||'0', FormId: formIdComputedRef.value, PK: 'id' };
},
afterFetch: (res) => {
tableRef.value.setToolBarWidth();
@ -226,7 +228,8 @@
query: {
formPath: 'mdm/CountryRegion',
formName: formName,
formId:currentRoute.value.meta.formId
formId:currentRoute.value.meta.formId,
isView: true
}
});
}
@ -311,7 +314,7 @@
}
function handleRefresh() {
// reload();
reload({ searchInfo: { pid: selectId.value=='0'?'': selectId.value } });
reload({ searchInfo: { pid: selectId.value } });
fetchTree()
}
function handleSuccess() {

View File

@ -24,7 +24,7 @@
const { filterFormSchemaAuth } = usePermission();
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
const { currentRoute } = useRouter();
const isView = currentRoute.value.query.isView
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
const props = defineProps({
@ -44,6 +44,11 @@
let customFormEventConfigs=[];
onMounted(async () => {
formProps.schemas?.forEach(v => {
if (v.field === 'code') {
v.componentProps.disabled = (isView ? true : false)
}
})
try {
// 合并渲染覆盖配置中的字段配置、表单事件配置
await mergeCustomFormRenderConfig();

View File

@ -204,7 +204,8 @@
query: {
formPath: 'mdm/Currency',
formName: formName,
formId: currentRoute.value.meta.formId
formId: currentRoute.value.meta.formId,
isView: true
}
});
}

View File

@ -19,7 +19,7 @@
const { filterFormSchemaAuth } = usePermission();
const { mergeFormSchemas, mergeFormEventConfigs } = useFormConfig();
const { currentRoute } = useRouter();
const isView = currentRoute.value.path.includes('viewForm')
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds', 'loadingCompleted', 'form-mounted']);
const props = defineProps({
@ -38,7 +38,9 @@
console.log(data.formDataProps, 'datadata');
let customFormEventConfigs = [];
const formObj = ref()
let num = 0
let num1 = 0
onMounted(async () => {
try {
// 合并渲染覆盖配置中的字段配置、表单事件配置
@ -108,6 +110,7 @@
}
setFieldsValue(record);
state.formModel = record;
formObj.value = record
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
return record;
} catch (error) {}
@ -183,28 +186,42 @@
return await deleteLngBDocCp([id]);
}
watch(
() => systemFormRef.value?.formModel,
() => systemFormRef.value?.formModel.cuSign,
(val) => {
let suNecSignProps = data.formDataProps.schemas?.filter((item) => item.field === 'suNecSign')[0];
let cuNecSignProps = data.formDataProps.schemas?.filter((item) => item.field === 'cuNecSign')[0];
if (val.suNecSign == 'N' && !suNecSignProps.componentProps.disabled && val.suSign != 'N' && val.cuNecSign != 'N') return
if (val.suSign === 'N') {
val.suNecSign = 'N';
suNecSignProps.componentProps.disabled = true;
}
if (val.suSign === 'Y') {
suNecSignProps.componentProps.disabled = false;
val.suNecSign = 'Y';
}
if (val.cuNecSign == 'N' && !cuNecSignProps.componentProps.disabled && val.cuSign != 'N') return
if (val.cuSign === 'N') {
val.cuNecSign = 'N';
let obj = systemFormRef.value?.formModel
if (val=='Y' && val == formObj.value?.cuSign && !num)return
val&&num++
if (val === 'N') {
obj.cuNecSign = 'N';
cuNecSignProps.componentProps.disabled = true;
}
if (val.cuSign === 'Y') {
val.cuNecSign = 'Y';
cuNecSignProps.componentProps.disabled = false;
if (val === 'Y') {
obj.cuNecSign = 'Y';
cuNecSignProps.componentProps.disabled = isView ? true: false;
}
setFieldsValue(obj)
},
{
deep: true
}
)
watch(
() => systemFormRef.value?.formModel.suSign,
(val) => {
let suNecSignProps = data.formDataProps.schemas?.filter((item) => item.field === 'suNecSign')[0];
let obj = systemFormRef.value?.formModel
if (val=='Y' && val == formObj.value?.suSign && !num1)return
val&&num1++
if (val== 'N') {
obj.suNecSign = 'N';
suNecSignProps.componentProps.disabled = true;
}
if (val === 'Y') {
suNecSignProps.componentProps.disabled = isView ? true: false;
obj.suNecSign = 'Y';
}
setFieldsValue(obj)
},
{
deep: true

View File

@ -367,8 +367,8 @@ export const formProps: FormProps = {
key: '1485b829c80a493bb55f37d1c839ccc9',
field: 'regionCode',
label: '行政区域',
type: 'area',
component: 'Area',
type: 'areacascader',
component: 'AreaCascader',
colProps: { span: 8 },
componentProps: {
width: '100%',
@ -377,15 +377,18 @@ export const formProps: FormProps = {
labelFixWidth: 120,
responsive: false,
respNewRow: false,
placeholder: '请选择行政区域',
placeholder: '请选择区域',
showLabel: true,
disabled: false,
allowClear: false,
allowClear: true,
clearable: false,
required: false,
rules: [],
events: {},
isShow: true,
style: { width: '100%' }
style: { width: '100%' },
fieldNames: {label: 'fullName', value: 'code', children: 'children'},
excludeType: 'CONTINENT'
}
},
{

View File

@ -59,6 +59,7 @@ watch(
} else {
data.formDataProps.schemas?.forEach(v => {
if (v.field === 'staCodeLng') {
newVal.staCodeLng = ''
v.componentProps.disabled = true
v.componentProps.required = false
}

View File

@ -293,31 +293,31 @@ export const formProps: FormProps = {
responsive: false,
width: '100%',
span: '',
defaultValue: 0.0,
formatter(value: number) {
if (!value) return '';
console.log(value);
defaultValue: null,
// formatter(value: number) {
// if (!value) return '';
// console.log(value);
// 3. 保留4位小数toFixed会自动四舍五入
const fixedNum = parseFloat(value).toFixed(4); // 结果为字符串,如 "12345.6700"、"-1234.5679"
// // 3. 保留4位小数toFixed会自动四舍五入
// const fixedNum = parseFloat(value).toFixed(4); // 结果为字符串,如 "12345.6700"、"-1234.5679"
// 4. 分割整数部分和小数部分
const [integerPart, decimalPart] = fixedNum.split('.');
// // 4. 分割整数部分和小数部分
// const [integerPart, decimalPart] = fixedNum.split('.');
// 5. 处理整数部分:添加千分位分隔符
// 正则解释:\B 匹配非单词边界,(?=(\d{3})+(?!\d)) 正向预查每3位数字
const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
// // 5. 处理整数部分:添加千分位分隔符
// // 正则解释:\B 匹配非单词边界,(?=(\d{3})+(?!\d)) 正向预查每3位数字
// const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
// 6. 拼接整数、小数部分,返回结果
return `${formattedInteger}.${decimalPart}`;
// return value.toLocaleString('zh-CN', {
// minimumFractionDigits: 4,
// maximumFractionDigits: 4
// });
},
// // 6. 拼接整数、小数部分,返回结果
// return `${formattedInteger}.${decimalPart}`;
// // return value.toLocaleString('zh-CN', {
// // minimumFractionDigits: 4,
// // maximumFractionDigits: 4
// // });
// },
min: null,
max: null,
step: 0.0001,
// step: 0.0001,
maxlength: '',
disabled: false,
showLabel: true,
@ -343,12 +343,12 @@ export const formProps: FormProps = {
labelFixWidth: 120,
responsive: false,
width: '100%',
precision: '6',
// precision: '6',
span: '',
defaultValue: null,
min: null,
max: null,
step: 0.000001,
// step: 0.000001,
disabled: false,
showLabel: true,
controls: true,
@ -372,14 +372,14 @@ export const formProps: FormProps = {
labelWidthMode: 'fix',
labelFixWidth: 120,
responsive: false,
precision: '6',
// precision: '6',
width: '100%',
span: '',
defaultValue: null,
min: null,
max: null,
step: 0.00001,
// step: 0.00001,
disabled: false,
showLabel: true,
controls: true,
@ -565,7 +565,7 @@ export const formProps: FormProps = {
showSearch: false,
clearable: false,
disabled: true,
mode: 'multiple',
// mode: 'multiple',
staticOptions: [
{ key: 1, label: 'Option 1', value: 'Option 1' },
{ key: 2, label: 'Option 2', value: 'Option 2' },

View File

@ -26,6 +26,7 @@
const { currentRoute } = useRouter();
const RowKey = 'id';
const isView = currentRoute.value.query.isView
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
const props = defineProps({
fromPage: {
@ -44,6 +45,11 @@
let customFormEventConfigs=[];
onMounted(async () => {
formProps.schemas?.forEach(v => {
if (v.field === 'code') {
v.componentProps.disabled = (isView ? true : false)
}
})
try {
// 合并渲染覆盖配置中的字段配置、表单事件配置
await mergeCustomFormRenderConfig();

View File

@ -201,7 +201,8 @@
query: {
formPath: 'mdm/PriceTerms',
formName: formName,
formId: currentRoute.value.meta.formId
formId: currentRoute.value.meta.formId,
isView:true
}
});
}

View File

@ -24,7 +24,7 @@
const { filterFormSchemaAuth } = usePermission();
const { mergeFormSchemas,mergeFormEventConfigs } = useFormConfig();
const { currentRoute } = useRouter();
const isView = currentRoute.value.query.isView
const RowKey = 'id';
const emits = defineEmits(['changeUploadComponentIds','loadingCompleted', 'form-mounted']);
const props = defineProps({
@ -44,6 +44,11 @@
let customFormEventConfigs=[];
onMounted(async () => {
formProps.schemas?.forEach(v => {
if (v.field === 'code') {
v.componentProps.disabled = (isView ? true : false)
}
})
try {
// 合并渲染覆盖配置中的字段配置、表单事件配置
await mergeCustomFormRenderConfig();

View File

@ -203,7 +203,8 @@
query: {
formPath: 'mdm/TaxRate',
formName: formName,
formId:currentRoute.value.meta.formId
formId:currentRoute.value.meta.formId,
isView: true
}
});
}

View File

@ -28,7 +28,7 @@
</a-col>
<a-col :span="24">
<a-form-item label="上传附件" name="fileList" :label-col="{ span: 4 }" :wrapper-col="{ span: 24 }">
<UploadNew :file-list="formState.fileList" @change="changeUplod" :multiple="true" :maxSize="200" :accept="accept" />
<UploadNew :file-list="formState.fileList" :disabled="isDisable" @change="changeUplod" :multiple="true" :maxSize="200" :accept="accept" />
<div style="color: #ccc; font-size: 12px">{{ fileTip }}</div>
</a-form-item>