Merge branch 'dev' of http://47.94.165.164:13000/geg-gas/geg-gas-web into dev
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
<SimpleForm ref="systemFormRef" :formProps="data.formDataProps" :formModel="{}" :isWorkFlow="props.fromPage != FromPageType.MENU" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, onBeforeMount, onMounted, watch } from 'vue';
|
||||
import { reactive, ref, onMounted, watch } from 'vue';
|
||||
import { formProps, formEventConfigs, formConfig } from './config';
|
||||
import SimpleForm from '/@/components/SimpleForm/src/SimpleForm.vue';
|
||||
import { addLngBDocCp, getLngBDocCp, updateLngBDocCp, deleteLngBDocCp } from '/@/api/mdm/DocCp';
|
||||
@ -182,16 +182,26 @@
|
||||
async function handleDelete(id) {
|
||||
return await deleteLngBDocCp([id]);
|
||||
}
|
||||
// watch(
|
||||
// () => systemFormRef.value.suSign,
|
||||
// (val) => {
|
||||
// console.log(val);
|
||||
// },
|
||||
// {
|
||||
// immediate: true,
|
||||
// deep: true
|
||||
// }
|
||||
// );
|
||||
watch(
|
||||
() => systemFormRef.value?.formModel,
|
||||
(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.suSign === 'Y') {
|
||||
suNecSignProps.componentProps.required = true;
|
||||
} else {
|
||||
suNecSignProps.componentProps.required = false;
|
||||
}
|
||||
if (val.cuSign === 'Y') {
|
||||
cuNecSignProps.componentProps.required = true;
|
||||
} else {
|
||||
cuNecSignProps.componentProps.required = false;
|
||||
}
|
||||
},
|
||||
{
|
||||
deep: true
|
||||
}
|
||||
);
|
||||
defineExpose({
|
||||
setFieldsValue,
|
||||
resetFields,
|
||||
|
||||
@ -181,7 +181,7 @@ export const formProps: FormProps = {
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
labelFixWidth: 150,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请输入编码',
|
||||
@ -215,7 +215,7 @@ export const formProps: FormProps = {
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
labelFixWidth: 150,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请输入名称',
|
||||
@ -247,7 +247,7 @@ export const formProps: FormProps = {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
labelFixWidth: 150,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择供应商适用',
|
||||
@ -292,7 +292,7 @@ export const formProps: FormProps = {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
labelFixWidth: 150,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择供应商必须提供',
|
||||
@ -318,7 +318,7 @@ export const formProps: FormProps = {
|
||||
apiId: '93d735dcb7364a0f8102188ec4d77ac7'
|
||||
},
|
||||
dicOptions: [],
|
||||
required: false,
|
||||
required: true,
|
||||
rules: [],
|
||||
events: {},
|
||||
isShow: true,
|
||||
@ -337,7 +337,7 @@ export const formProps: FormProps = {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
labelFixWidth: 150,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择客户适用',
|
||||
@ -374,7 +374,7 @@ export const formProps: FormProps = {
|
||||
{
|
||||
key: 'e2a327ac6aa249a5b5eb66199e263131',
|
||||
field: 'cuNecSign',
|
||||
label: '供应商必须提供',
|
||||
label: '客户必须提供',
|
||||
type: 'select',
|
||||
component: 'XjrSelect',
|
||||
colProps: { span: 24 },
|
||||
@ -382,7 +382,7 @@ export const formProps: FormProps = {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
labelFixWidth: 150,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择供应商必须提供',
|
||||
@ -427,7 +427,7 @@ export const formProps: FormProps = {
|
||||
width: '100%',
|
||||
span: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
labelFixWidth: 150,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择有效标志',
|
||||
@ -474,7 +474,7 @@ export const formProps: FormProps = {
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
labelFixWidth: 150,
|
||||
responsive: false,
|
||||
respNewRow: true,
|
||||
placeholder: '请输入备注',
|
||||
|
||||
@ -41,13 +41,6 @@
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const treeData = await getTreeData({});
|
||||
formProps.schemas?.forEach((v) => {
|
||||
if (v.field == 'regionCode') {
|
||||
v.componentProps.options = treeData;
|
||||
}
|
||||
});
|
||||
|
||||
// 合并渲染覆盖配置中的字段配置、表单事件配置
|
||||
await mergeCustomFormRenderConfig();
|
||||
|
||||
@ -110,14 +103,13 @@
|
||||
async function setFormDataFromId(rowId, skipUpdate) {
|
||||
try {
|
||||
const record = await getLngBPort(rowId);
|
||||
const res = { ...record, regionCode: (record.regionCode || '').split(',') };
|
||||
if (skipUpdate) {
|
||||
return res;
|
||||
return record;
|
||||
}
|
||||
setFieldsValue(res);
|
||||
state.formModel = res;
|
||||
setFieldsValue(record);
|
||||
state.formModel = record;
|
||||
await getFormDataEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:获取表单数据
|
||||
return res;
|
||||
return record;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
@ -143,7 +135,7 @@
|
||||
try {
|
||||
values[RowKey] = rowId;
|
||||
state.formModel = values;
|
||||
let saveVal = await updateLngBPort({ ...values, regionCode: (values.regionCode || []).join(',') });
|
||||
let saveVal = await updateLngBPort(values);
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
} catch (error) {}
|
||||
@ -152,7 +144,7 @@
|
||||
async function add(values) {
|
||||
try {
|
||||
state.formModel = values;
|
||||
let saveVal = await addLngBPort({ ...values, regionCode: (values.regionCode || []).join(',') });
|
||||
let saveVal = await addLngBPort(values);
|
||||
|
||||
await submitFormEvent(customFormEventConfigs, state.formModel, systemFormRef.value, formProps.schemas); //表单事件:提交表单
|
||||
return saveVal;
|
||||
|
||||
@ -254,36 +254,29 @@ export const formProps: FormProps = {
|
||||
},
|
||||
{
|
||||
field: 'regionCode',
|
||||
label: '所属国家和地区',
|
||||
type: 'cascader',
|
||||
component: 'Cascader',
|
||||
label: '所属国家/地区',
|
||||
type: 'areacascader',
|
||||
component: 'AreaCascader',
|
||||
colProps: { span: 16 },
|
||||
componentProps: {
|
||||
options: [],
|
||||
fieldNames: { label: 'fullName', value: 'code', children: 'children' },
|
||||
width: '100%',
|
||||
span: '',
|
||||
defaultValue: '',
|
||||
labelWidthMode: 'fix',
|
||||
labelFixWidth: 120,
|
||||
responsive: false,
|
||||
respNewRow: false,
|
||||
placeholder: '请选择',
|
||||
maxlength: null,
|
||||
prefix: '',
|
||||
suffix: '',
|
||||
addonBefore: '',
|
||||
addonAfter: '',
|
||||
disabled: false,
|
||||
allowClear: false,
|
||||
placeholder: '请选择区域',
|
||||
showLabel: true,
|
||||
disabled: false,
|
||||
allowClear: true,
|
||||
clearable: false,
|
||||
required: false,
|
||||
rules: [],
|
||||
events: {},
|
||||
isSave: false,
|
||||
isShow: true,
|
||||
scan: false,
|
||||
style: { width: '100%' }
|
||||
style: { width: '100%' },
|
||||
fieldNames: { label: 'fullName', value: 'code', children: 'children' },
|
||||
excludeType: 'CONTINENT'
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user