lijingjia 7 months ago
commit 4ff09beb86

@ -2154,7 +2154,7 @@ export const mailingInfoFormSchemaR: FormSchema[] = [
// }, // },
] ]
// cargoInfo表单 // cargoInfo表单
export const cargoInfoFormSchema: FormSchema[] = [ export const cargoInfoFormSchema1: FormSchema[] = [
{ {
field: 'marks', field: 'marks',
label: `唛头`, label: `唛头`,
@ -2163,15 +2163,14 @@ export const cargoInfoFormSchema: FormSchema[] = [
dynamicDisabled: false, dynamicDisabled: false,
defaultValue: '', defaultValue: '',
colProps: { colProps: {
span: 4, span: 24,
style: {
color: 'red',
},
}, },
componentProps: { componentProps: {
rows: 4, rows: 4,
}, },
}, },
]
export const cargoInfoFormSchema2: FormSchema[] = [
{ {
field: 'goodsName', field: 'goodsName',
label: '品名', label: '品名',
@ -2179,7 +2178,7 @@ export const cargoInfoFormSchema: FormSchema[] = [
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
defaultValue: '', defaultValue: '',
colProps: { span: 6 }, colProps: { span: 8 },
componentProps: { componentProps: {
options: ListData.goodsName, options: ListData.goodsName,
allowClear: true, allowClear: true,
@ -2196,7 +2195,7 @@ export const cargoInfoFormSchema: FormSchema[] = [
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
defaultValue: '', defaultValue: '',
colProps: { span: 6 }, colProps: { span: 8 },
componentProps: { componentProps: {
options: ListData.cargoId, options: ListData.cargoId,
allowClear: true, allowClear: true,
@ -2211,15 +2210,29 @@ export const cargoInfoFormSchema: FormSchema[] = [
field: 'hsCode', field: 'hsCode',
component: 'Input', component: 'Input',
required: false, required: false,
colProps: { span: 3 }, colProps: { span: 8 },
}, },
{
field: 'description',
label: '货物描述',
component: 'InputTextArea',
required: false,
dynamicDisabled: false,
defaultValue: '',
colProps: { span: 24 },
componentProps: {
rows: 4,
},
},
]
export const cargoInfoFormSchema3: FormSchema[] = [
{ {
label: '件数', label: '件数',
field: 'pkgs', field: 'pkgs',
component: 'InputNumber', component: 'InputNumber',
required: false, required: false,
colProps: { span: 3 }, colProps: { span: 12 },
componentProps: ({ schema, tableAction, formActionType, formModel }) => { componentProps: ({ schema, tableAction, formActionType, formModel }) => {
return { return {
onChange: (SS) => { onChange: (SS) => {
@ -2375,9 +2388,11 @@ export const cargoInfoFormSchema: FormSchema[] = [
enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.' enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.'
} }
} }
formModel.totalNo = enCapital formActionType.submit()
// formModel.totalNo = enCapital
} else { } else {
formModel.totalNo = '' formActionType.submit()
// formModel.totalNo = ''
} }
}, },
} }
@ -2390,7 +2405,7 @@ export const cargoInfoFormSchema: FormSchema[] = [
required: false, required: false,
dynamicDisabled: false, dynamicDisabled: false,
defaultValue: '', defaultValue: '',
colProps: { span: 3 }, colProps: { span: 12 },
componentProps: { componentProps: {
options: ListData.FngoodsName, options: ListData.FngoodsName,
allowClear: true, allowClear: true,
@ -2400,33 +2415,23 @@ export const cargoInfoFormSchema: FormSchema[] = [
}, },
}, },
}, },
{
field: 'description',
label: '货物描述',
component: 'InputTextArea',
required: false,
dynamicDisabled: false,
defaultValue: '',
colProps: { span: 8 },
componentProps: {
rows: 4,
},
},
{ {
label: '毛重', label: '毛重',
field: 'kgs', field: 'kgs',
component: 'InputNumber', component: 'InputNumber',
required: false, required: false,
colProps: { span: 3 }, colProps: { span: 12 },
}, },
{ {
label: '尺寸', label: '尺寸',
field: 'cbm', field: 'cbm',
component: 'InputNumber', component: 'InputNumber',
required: false, required: false,
colProps: { span: 3 }, colProps: { span: 12 },
}, },
]
export const cargoInfoFormSchema4: FormSchema[] = [
{ {
field: 'totalNo', field: 'totalNo',
label: '件数大写', label: '件数大写',

@ -13,7 +13,20 @@
></div> ></div>
</template> </template>
<div class="container cargo-info"> <div class="container cargo-info">
<BasicForm @register="registerForm" /> <a-row :gutter="16">
<a-col :span="5">
<BasicForm @register="registerForm1" />
</a-col>
<a-col :span="10">
<BasicForm @register="registerForm2" />
</a-col>
<a-col :span="9">
<BasicForm @register="registerForm3" @asd="asd" />
</a-col>
<a-col :span="24">
<BasicForm @register="registerForm4" />
</a-col>
</a-row>
<!-- <a-form :selfUpdate="true" ref="RefcargoFrom" :model="props.details" :rules="rules"> <!-- <a-form :selfUpdate="true" ref="RefcargoFrom" :model="props.details" :rules="rules">
<a-row :gutter="10"> <a-row :gutter="10">
<a-col :span="5"> <a-col :span="5">
@ -577,7 +590,12 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { BasicForm, useForm } from '/@/components/Form/index' import { BasicForm, useForm } from '/@/components/Form/index'
import { cargoInfoFormSchema } from '/@/views/operation/seaexport/columns' import {
cargoInfoFormSchema1,
cargoInfoFormSchema2,
cargoInfoFormSchema3,
cargoInfoFormSchema4,
} from '/@/views/operation/seaexport/columns'
import { ref, getCurrentInstance, watch, onMounted } from 'vue' import { ref, getCurrentInstance, watch, onMounted } from 'vue'
import inputView from '../components/inputView.vue' import inputView from '../components/inputView.vue'
import textareaView from '../components/textareaView.vue' import textareaView from '../components/textareaView.vue'
@ -614,12 +632,62 @@
inSave: { type: Boolean, default: false }, inSave: { type: Boolean, default: false },
moreStr: { type: String, default: '' }, moreStr: { type: String, default: '' },
}) })
const [registerForm, { getFieldsValue, validateFields, resetFields, setFieldsValue, validate }] = const [
useForm({ registerForm1,
labelWidth: 80, {
schemas: cargoInfoFormSchema, getFieldsValue: getFieldsValue1,
showActionButtonGroup: false, validateFields: validateFields1,
}) setFieldsValue: setFieldsValue1,
},
] = useForm({
labelWidth: 80,
schemas: cargoInfoFormSchema1,
showActionButtonGroup: false,
})
const [
registerForm2,
{
getFieldsValue: getFieldsValue2,
validateFields: validateFields2,
setFieldsValue: setFieldsValue2,
},
] = useForm({
labelWidth: 80,
schemas: cargoInfoFormSchema2,
showActionButtonGroup: false,
})
const [
registerForm3,
{
getFieldsValue: getFieldsValue3,
validateFields: validateFields3,
setFieldsValue: setFieldsValue3,
validate: validate3,
},
] = useForm({
labelWidth: 80,
schemas: cargoInfoFormSchema3,
showActionButtonGroup: false,
submitFunc: asd,
})
async function asd() {
// let data = await validate3()
// console.log('------', data)
let data = ''
console.log('奇奇怪怪-奇奇怪怪-奇奇怪怪-奇奇怪怪-奇奇怪怪-奇奇怪怪-奇奇怪怪', data)
}
const [
registerForm4,
{
getFieldsValue: getFieldsValue4,
validateFields: validateFields4,
setFieldsValue: setFieldsValue4,
},
] = useForm({
labelWidth: 80,
schemas: cargoInfoFormSchema4,
showActionButtonGroup: false,
})
const emit = defineEmits(['pkgsEnCapital', 'changeDetail']) const emit = defineEmits(['pkgsEnCapital', 'changeDetail'])
let { ctx: that, proxy }: any = getCurrentInstance() let { ctx: that, proxy }: any = getCurrentInstance()
const showKey = ref(['1']) const showKey = ref(['1'])
@ -658,7 +726,10 @@
watch( watch(
() => props.details, () => props.details,
(nval) => { (nval) => {
setFieldsValue(nval) setFieldsValue1(nval)
setFieldsValue2(nval)
setFieldsValue3(nval)
setFieldsValue4(nval)
// if (!props.inSave) { // if (!props.inSave) {
// emit('changeDetail', { // emit('changeDetail', {
// detail: nval, // detail: nval,
@ -986,10 +1057,24 @@
textEntryModalTitle.value = '' textEntryModalTitle.value = ''
textEntryType.value = false textEntryType.value = false
} }
function getFieldsValue() {
return {
...getFieldsValue1(),
...getFieldsValue2(),
...getFieldsValue3(),
...getFieldsValue4(),
}
}
function validateFields() {
validateFields1()
validateFields2()
validateFields3()
validateFields4()
}
defineExpose({ defineExpose({
// RefcargoFrom, // RefcargoFrom,
getFieldsValue,
validateFields, validateFields,
getFieldsValue,
}) })
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

Loading…
Cancel
Save