From 8afaf86828ff45698e081402b92253beabb4160e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=90=8C=E6=B5=B7?= <14166000+zhangtonghai@user.noreply.gitee.com> Date: Fri, 24 May 2024 17:48:44 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/operation/seaexport/columns.tsx | 47 +- .../operation/seaexport/detail/index.vue | 36 +- .../seaexport/detail/modules/cargoInfo.vue | 87 ++- .../seaexport/detail/modules/goodsTable.vue | 683 ++---------------- 4 files changed, 163 insertions(+), 690 deletions(-) diff --git a/src/views/operation/seaexport/columns.tsx b/src/views/operation/seaexport/columns.tsx index eab35c67..482bbbb2 100644 --- a/src/views/operation/seaexport/columns.tsx +++ b/src/views/operation/seaexport/columns.tsx @@ -3111,41 +3111,66 @@ export const cargoInfoFormSchema2: FormSchema[] = [ }, }, { - field: 'kindPkgs', + label: '', + field: 'kindPkgsName', + component: 'Input', + // defaultValue: '', + show: false, + }, + { label: '包装', + field: 'kindPkgs', component: 'Select', required: false, dynamicDisabled: false, // defaultValue: '', colProps: { span: 6 }, - componentProps: { - options: ListData.goodsName, - allowClear: true, - showSearch: true, - filterOption: (input: string, option: any) => { - return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 - }, + componentProps: ({ schema, tableAction, formActionType, formModel }) => { + return { + options: ListData.goodsName, + allowClear: true, + showSearch: true, + filterOption: (input: string, option: any) => { + return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 + }, + onChange: (e) => { + ListData.goodsName.forEach((item) => { + if (item.value == e) { + formModel.kindPkgsName = item.label + } + }) + + setTimeout(() => { + formActionType.submit() + }, 10) + }, + } }, }, { - field: 'description', label: '货物描述', + field: 'description', component: 'InputTextArea', required: false, dynamicDisabled: false, - // defaultValue: '', colProps: { span: 12 }, componentProps: { rows: 3, }, }, - { label: '毛重', field: 'kgs', component: 'InputNumber', required: false, colProps: { span: 6 }, + componentProps: ({ schema, tableAction, formActionType, formModel }) => { + return { + onChange: () => { + formActionType.submit() + }, + } + }, }, { label: '尺寸', diff --git a/src/views/operation/seaexport/detail/index.vue b/src/views/operation/seaexport/detail/index.vue index 721e8fb8..94c7e17f 100644 --- a/src/views/operation/seaexport/detail/index.vue +++ b/src/views/operation/seaexport/detail/index.vue @@ -665,8 +665,6 @@ } // list RefgoodsTable.value.list.forEach((e, index) => { - console.log(e, 'ZZZZZZZZZZZZZZZZZZZZZZ') - let ctnCode = '' ctnList.forEach((item: any) => { if (item.label == e.ctn) { @@ -1018,6 +1016,27 @@ RefrightContent.value.init() }, 100) } + // 集装箱 件重尺 更改 整票数据 + function changeTotalFun(data) { + const { type, val } = data + if (type === 'totalKgs') { + RefcargoInfo.value.setFieldsValue2({ + ...RefcargoInfo.value.getFieldsValue2(), + kgs: val, + }) + // bookingDetails.value.kgs = val || bookingDetails.value.kgs + } else if (type === 'totalPkgs') { + RefcargoInfo.value.setFieldsValue2({ + ...RefcargoInfo.value.getFieldsValue2(), + pkgs: val, + }) + } else if (type === 'totalCbm') { + RefcargoInfo.value.setFieldsValue2({ + ...RefcargoInfo.value.getFieldsValue2(), + cbm: val, + }) + } + } // ============================================ // function getRouterHis() { // inChildLoading.value = true @@ -1348,18 +1367,7 @@ RefgoodsTable.value.loadingTable = false }) } - function changeTotalFun(data) { - const { type, val } = data - if (type === 'totalKgs') { - bookingDetails.value.kgs = val || bookingDetails.value.kgs - } else if (type === 'totalPkgs') { - bookingDetails.value.pkgs = val || bookingDetails.value.pkgs - const enCapitalRes = RefcargoInfo.value.SetTOTALNO(bookingDetails.value.pkgs) - bookingDetails.value.totalno = enCapitalRes - } else if (type === 'totalCbm') { - bookingDetails.value.cbm = val || bookingDetails.value.cbm - } - } + function changeCtnInfoFun({ type, val }) { if (type === 'kindpkgs') { bookingDetails.value.kindpkgs = val diff --git a/src/views/operation/seaexport/detail/modules/cargoInfo.vue b/src/views/operation/seaexport/detail/modules/cargoInfo.vue index e29f887a..c36c8251 100644 --- a/src/views/operation/seaexport/detail/modules/cargoInfo.vue +++ b/src/views/operation/seaexport/detail/modules/cargoInfo.vue @@ -685,7 +685,8 @@ // submitFunc: asd, // }) async function asd() { - let data = await validate2() + let data = getFieldsValue2() + let SS = data.pkgs if (SS) { let GetStringNum = (str) => { @@ -823,10 +824,11 @@ } num = parseFloat(num).add(parseFloat(strNum)) } + if (strKind !== '') { enCapital = strKind } else { - strKind = data.kindpkgs ? data.kindpkgs : '' + strKind = data.kindPkgsName ? data.kindPkgsName : '' enCapital = ToEn(num).toUpperCase() + ' ' + strKind + ' ONLY.' } } else { @@ -835,7 +837,7 @@ if (strKind !== '') { enCapital = strKind } else { - strKind = data.kindpkgs ? data.kindpkgs : '' + strKind = data.kindPkgsName ? data.kindPkgsName : '' enCapital = 'SAY:' + ToEn(strNum).toUpperCase() + ' ' + strKind + ' ONLY.' } } @@ -861,33 +863,47 @@ let { ctx: that, proxy }: any = getCurrentInstance() watch( () => props.details, - (nval) => { - setFieldsValue1(nval) - setFieldsValue2({ - goodsName: nval.goodsName, - cargoId: nval.cargoId, - hsCode: nval.hsCode, - pkgs: nval.pkgs, - kindPkgs: nval.kindPkgs, - description: nval.description, - kgs: nval.kgs, - cbm: nval.cbm, - }) - setTimeout(() => { - setFieldsValue2({ - dangerClass: nval.dangerClass, - dangerNo: nval.dangerNo, - dangerPage: nval.dangerPage, - dangerLabel: nval.dangerLabel, - temperatureSet: nval.temperatureSet, - reeferQuantity: nval.reeferQuantity, - temperatureUnit: nval.temperatureUnit, - temperatureMin: nval.temperatureMin, - temperatureMax: nval.temperatureMax, - humidity: nval.humidity, + async (nval) => { + if (Object.keys(nval).length) { + await setFieldsValue1({ marks: nval.marks }) + await setFieldsValue2({ + pkgs: nval.pkgs, + kgs: nval.kgs, + cbm: nval.cbm, + goodsName: nval.goodsName, + cargoId: nval.cargoId, + hsCode: nval.hsCode, + kindPkgs: nval.kindPkgs, + description: nval.description, + }) + console.log({ + pkgs: nval.pkgs, + kgs: nval.kgs, + cbm: nval.cbm, + goodsName: nval.goodsName, + cargoId: nval.cargoId, + hsCode: nval.hsCode, + kindPkgs: nval.kindPkgs, + description: nval.description, }) - }, 10) - setFieldsValue4(nval) + + setTimeout(async () => { + await setFieldsValue2({ + ...getFieldsValue2(), + dangerClass: nval.dangerClass, + dangerNo: nval.dangerNo, + dangerPage: nval.dangerPage, + dangerLabel: nval.dangerLabel, + temperatureSet: nval.temperatureSet, + reeferQuantity: nval.reeferQuantity, + temperatureUnit: nval.temperatureUnit, + temperatureMin: nval.temperatureMin, + temperatureMax: nval.temperatureMax, + humidity: nval.humidity, + }) + }, 10) + await setFieldsValue4({ totalNo: nval.totalNo }) + } // setFieldsValue3(nval) // if (!props.inSave) { @@ -1009,11 +1025,11 @@ props.details.goodsname = res.goodsNameEN || '' } else if (type === 'cargoid') { props.details.cargoid = res.code || '' - if (res.code == 'R') { - props.props.rules['goodsname'][0].required = true - } else { - props.props.rules['goodsname'][0].required = false - } + // if (res.code == 'R') { + // props.props.rules['goodsname'][0].required = true + // } else { + // props.props.rules['goodsname'][0].required = false + // } } else if (['kindpkgs'].includes(type)) { props.details.kindpkgs = res['name'] || '' const enCapitalRes = SetTOTALNO(props.details.pkgs) @@ -1046,7 +1062,6 @@ const strNum: any = GetStringNum(DSS) strKind = DSS.substring(strNum.length) if (strKind !== '') { - console.log(strKind) enCapital = strKind } else { strKind = props.details.kindpkgs @@ -1273,7 +1288,6 @@ } } async function validateFields() { - console.log('validateFields') await validateFields1() await validateFields2() // await validateFields3() @@ -1290,6 +1304,7 @@ getFieldsValue, updateSchema, validateFields, + setFieldsValue2, })