From ad2ee42a31e7cd160d072c99b494227b1326355d Mon Sep 17 00:00:00 2001 From: lijingjia Date: Mon, 19 Aug 2024 16:04:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=A8=A1=E7=89=88=E8=BF=AD?= =?UTF-8?q?=E4=BB=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ActionBar/index.vue | 9 ------- src/components/ConfigForm/index.vue | 6 ++--- .../Form/src/components/FormItem.vue | 7 +++--- .../Modal/src/components/ModalClose.vue | 6 ++--- src/views/baseinfo/infoclient/columns.tsx | 1 - .../baseinfo/lanes/TenantAuditStepModal.vue | 9 ++++--- src/views/baseinfo/lanes/columns.tsx | 11 ++++++-- .../seaexport/detail/components/journal.vue | 24 ++++++++++++++++-- .../seaexport/detail/modules/baseInfo.tsx | 5 ++-- .../seaexport/detail/modules/basicInfo.vue | 11 +++++--- .../seaexport/detail/modules/mailingInfo.vue | 12 ++++++--- src/views/system/print/api.ts | 17 ++++++++++--- src/views/system/print/columns.tsx | 10 ++++++++ .../system/print/components/temModal.vue | 25 ++++++++++++++++++- 14 files changed, 113 insertions(+), 40 deletions(-) diff --git a/src/components/ActionBar/index.vue b/src/components/ActionBar/index.vue index 4f4a50b4..b15fbaf6 100644 --- a/src/components/ActionBar/index.vue +++ b/src/components/ActionBar/index.vue @@ -185,10 +185,7 @@ } // 复制 const copyHandle = async () => { - if (copyFlag.value) return - copyFlag.value = true await props.copy() - copyFlag.value = false } // 跳转上下票 const toPage = (v) => { @@ -223,18 +220,12 @@ } // 保存 const saveHandle = async () => { - if (saveFlag.value) return - saveFlag.value = true await props.save() - saveFlag.value = false } const submitFlag = ref(false) // 提交 const submitHandle = async () => { - if (submitFlag.value) return - submitFlag.value = true await props.submit() - submitFlag.value = false } return { t, diff --git a/src/components/ConfigForm/index.vue b/src/components/ConfigForm/index.vue index e86dbbd1..49d11afd 100644 --- a/src/components/ConfigForm/index.vue +++ b/src/components/ConfigForm/index.vue @@ -68,9 +68,9 @@ const data = props.formSchema const columns = data.map((item: FormSchema) => { const res = { - defaultValue: item.defaultValue || '', - field: item.field || '', - label: item.label || '', + defaultValue: item.defaultValue || null, + field: item.field || null, + label: item.label || null, required: item.required || false, colProps: item.colProps || { span: 24 }, component: item.component, diff --git a/src/components/Form/src/components/FormItem.vue b/src/components/Form/src/components/FormItem.vue index 359d9dfe..6404729e 100644 --- a/src/components/Form/src/components/FormItem.vue +++ b/src/components/Form/src/components/FormItem.vue @@ -151,8 +151,7 @@ ? rulesMessageJoinLabel : globalRulesMessageJoinLabel const defaultMsg = createPlaceholderMessage(component) + `${joinLabel ? label : ''}` - - function validator(rule: any, value: any) { + async function validator(rule: any, value: any) { const msg = rule.message || defaultMsg if (value === undefined || isNull(value)) { // 空值 @@ -187,12 +186,12 @@ */ if (getRequired) { if (!rules || rules.length === 0) { - rules = [{ required: getRequired, validator }] + // rules = [{ required: getRequired, validator }] } else { const requiredIndex: number = rules.findIndex((rule) => Reflect.has(rule, 'required')) if (requiredIndex === -1) { - rules.push({ required: getRequired, validator }) + // rules.push({ required: getRequired, validator }) } } } diff --git a/src/components/Modal/src/components/ModalClose.vue b/src/components/Modal/src/components/ModalClose.vue index 8de266c5..37d7094c 100644 --- a/src/components/Modal/src/components/ModalClose.vue +++ b/src/components/Modal/src/components/ModalClose.vue @@ -123,9 +123,9 @@ const addFormToSet = () => { const columns = props.formSchema.map((item: FormSchema) => { const res = { - defaultValue: item.defaultValue || '', - field: item.field || '', - label: item.label || '', + defaultValue: item.defaultValue || null, + field: item.field || null, + label: item.label || null, required: item.required || false, colProps: item.colProps || { span: 24 }, component: item.component diff --git a/src/views/baseinfo/infoclient/columns.tsx b/src/views/baseinfo/infoclient/columns.tsx index dff4da19..7e2e1d40 100644 --- a/src/views/baseinfo/infoclient/columns.tsx +++ b/src/views/baseinfo/infoclient/columns.tsx @@ -985,7 +985,6 @@ export const formSchema: FormSchema[] = [ return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 }, onChange: (e, obj) => { - console.log(obj) if (e && obj) { formModel.customerService = obj.value formModel.customerServiceName = obj.label diff --git a/src/views/baseinfo/lanes/TenantAuditStepModal.vue b/src/views/baseinfo/lanes/TenantAuditStepModal.vue index d0b31335..cd39d532 100644 --- a/src/views/baseinfo/lanes/TenantAuditStepModal.vue +++ b/src/views/baseinfo/lanes/TenantAuditStepModal.vue @@ -51,14 +51,15 @@ const loading = ref(false) const rowId = ref('') const { createMessage } = useMessage() - const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({ + const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] = useForm({ labelWidth: 100, schemas: formSchema, showActionButtonGroup: false, }) - const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => { + const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => { resetFields() setModalProps({ confirmLoading: false, loading: true }) + updateFormField(updateSchema) isUpdate.value = !!data?.isUpdate if (unref(isUpdate)) { // setModalProps({ confirmLoading: true }); @@ -67,7 +68,7 @@ // getFieldList() if (res.succeeded) { setFieldsValue({ - ...res.data, + ...res.data }) // console.log('返回数据Form', getFieldsValue()); // setFieldsValue({ trainId: unref(res.data.trainId) }); @@ -82,6 +83,8 @@ const getTitle = computed(() => (!unref(isUpdate) ? '新增航线信息' : '编辑航线信息')) async function handleSave(exit) { + console.log(getFieldsValue()) + return try { const values = await validate() setModalProps({ confirmLoading: true, loading: true }) diff --git a/src/views/baseinfo/lanes/columns.tsx b/src/views/baseinfo/lanes/columns.tsx index e0c5cddf..4ddb2fcb 100644 --- a/src/views/baseinfo/lanes/columns.tsx +++ b/src/views/baseinfo/lanes/columns.tsx @@ -88,7 +88,7 @@ export const formSchema: FormSchema[] = [ label: '', field: 'id', component: 'Input', - defaultValue: '', + defaultValue: null, show: false, }, { @@ -97,6 +97,7 @@ export const formSchema: FormSchema[] = [ component: 'Input', required: true, colProps: { span: 12 }, + defaultValue: null, dynamicDisabled: ({ values }) => { return !!values.id }, @@ -106,13 +107,14 @@ export const formSchema: FormSchema[] = [ label: '航线中文名称', component: 'Input', required: true, + defaultValue: null, colProps: { span: 12 }, }, { field: 'laneEnName', label: '航线英文名称', component: 'Input', - + defaultValue: null, colProps: { span: 12 }, }, { @@ -120,6 +122,7 @@ export const formSchema: FormSchema[] = [ label: '默认操作员', component: 'ApiSelect', colProps: { span: 12 }, + defaultValue: null, componentProps: ({ formModel }) => { return { api: GetCustomerServiceList, @@ -150,6 +153,7 @@ export const formSchema: FormSchema[] = [ label: '默认单证', component: 'ApiSelect', colProps: { span: 12 }, + defaultValue: null, componentProps: ({ formModel }) => { return { api: GetVouchingClerkList, @@ -180,6 +184,7 @@ export const formSchema: FormSchema[] = [ label: '默认客服', component: 'ApiSelect', colProps: { span: 12 }, + defaultValue: null, componentProps: ({ formModel }) => { return { api: GetCustomerServiceList, @@ -209,6 +214,7 @@ export const formSchema: FormSchema[] = [ field: 'ediCode', label: 'EDI代码', component: 'Input', + defaultValue: null, colProps: { span: 12 }, }, { @@ -216,6 +222,7 @@ export const formSchema: FormSchema[] = [ label: '备注', component: 'InputTextArea', colProps: { span: 12 }, + defaultValue: null, componentProps: { rows: 2, }, diff --git a/src/views/operation/seaexport/detail/components/journal.vue b/src/views/operation/seaexport/detail/components/journal.vue index 044312e3..2ab7a157 100644 --- a/src/views/operation/seaexport/detail/components/journal.vue +++ b/src/views/operation/seaexport/detail/components/journal.vue @@ -5,7 +5,16 @@ --> @@ -53,6 +62,17 @@