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