From d50b5563909ed5b61c9333e01c9052622d7bd602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=96=AA=E5=90=8D?= <942005050@qq.com> Date: Fri, 23 Feb 2024 15:46:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=8B=A8=E5=87=BA=E5=BA=93=20?= =?UTF-8?q?=E5=8E=9F=E5=9B=A0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Detail/src/Detail.vue | 11 +++++++++++ .../transferissueRequestMain/index.vue | 17 ++++++++++++++--- .../transferissueRequestMain.data.ts | 8 ++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/components/Detail/src/Detail.vue b/src/components/Detail/src/Detail.vue index 88d886787..1d8125c7a 100644 --- a/src/components/Detail/src/Detail.vue +++ b/src/components/Detail/src/Detail.vue @@ -135,6 +135,7 @@ :formTypeDetail="formTypeDetail" :countPlanAllList="countPlanAllList" @onChange="detailBasicFormOnChange" + @onBlur="onBlur" /> @@ -583,6 +584,7 @@ const emit = defineEmits([ 'detailOpenForm', 'tableFormButton', 'openImage', + 'onBlur', 'detailBasicFormOnChange' ]) /** 删除按钮操作 */ @@ -642,6 +644,15 @@ const openImage=(item)=>{ const detailBasicFormOnChange = (field, cur) => { emit('detailBasicFormOnChange', field, cur) } + +/** + * 监听失焦事件 + * @param field 当前操作字段 + * @param e + */ + const onBlur = (field, e) => { + emit('onBlur', field, e) +} //监视属性 watch( () => props.apiPage, diff --git a/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue b/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue index 1513622ed..aba5da784 100644 --- a/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue +++ b/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue @@ -54,7 +54,7 @@ @handleDeleteTable="handleDeleteTable" @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" - @tableFormSelectOnBlur="onBlur" + @tableFormSelectOnBlur="tableFormSelectOnBlur" /> @@ -71,6 +71,7 @@ :Echo="Echo" @searchTableSuccessDetail="searchTableSuccessDetail" :detailValidate="detailValidate" + @onBlur="onBlur" /> @@ -315,10 +316,20 @@ const handleHandle = async (id: number) => { } catch {} } -const onBlur = (field, val, row, index) => { +const onBlur = (field, e) => { + console.log('字段', field) + console.log('失焦后值', e.target.value) + if (field == 'reason') { + detailRef.value.formRef.formRef.formModel[field] = e.target.value + } +} + +const tableFormSelectOnBlur = (field, val, row, index) => { // console.log('字段', field) // console.log('失焦后值', val.target.value) - tableData.value[index][field] = val.target.value + if (field == 'reason') { + tableData.value[index][field] = val.target.value + } } /** 添加/修改操作 */ diff --git a/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts b/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts index d865b15e9..d078cc6ab 100644 --- a/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts @@ -788,9 +788,17 @@ export const TransferissueRequestDetail = useCrudSchemas(reactive( sort: 'custom', dictType: DICT_TYPE.TRANSFER_REASON, dictClass: 'string', + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return cellValue + }, table: { width: 150 }, + form: { + componentProps: { + filterable: true + } + }, tableForm: { type: 'Select', filterable: true