lijingjia 7 months ago
commit 4ff09beb86

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

@ -13,7 +13,20 @@
></div>
</template>
<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-row :gutter="10">
<a-col :span="5">
@ -577,7 +590,12 @@
</template>
<script lang="ts" setup>
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 inputView from '../components/inputView.vue'
import textareaView from '../components/textareaView.vue'
@ -614,12 +632,62 @@
inSave: { type: Boolean, default: false },
moreStr: { type: String, default: '' },
})
const [registerForm, { getFieldsValue, validateFields, resetFields, setFieldsValue, validate }] =
useForm({
labelWidth: 80,
schemas: cargoInfoFormSchema,
showActionButtonGroup: false,
})
const [
registerForm1,
{
getFieldsValue: getFieldsValue1,
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'])
let { ctx: that, proxy }: any = getCurrentInstance()
const showKey = ref(['1'])
@ -658,7 +726,10 @@
watch(
() => props.details,
(nval) => {
setFieldsValue(nval)
setFieldsValue1(nval)
setFieldsValue2(nval)
setFieldsValue3(nval)
setFieldsValue4(nval)
// if (!props.inSave) {
// emit('changeDetail', {
// detail: nval,
@ -986,10 +1057,24 @@
textEntryModalTitle.value = ''
textEntryType.value = false
}
function getFieldsValue() {
return {
...getFieldsValue1(),
...getFieldsValue2(),
...getFieldsValue3(),
...getFieldsValue4(),
}
}
function validateFields() {
validateFields1()
validateFields2()
validateFields3()
validateFields4()
}
defineExpose({
// RefcargoFrom,
getFieldsValue,
validateFields,
getFieldsValue,
})
</script>
<style lang="less" scoped>

Loading…
Cancel
Save