From 5ac9ccc3534d66f3c134c3f15d165834c6c51d39 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:04:05 +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=B8=8B=E6=8B=89=20=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E5=8F=AF=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 6 ++++ src/components/TableForm/src/TableForm.vue | 10 +++++-- .../transferissueRequestMain/index.vue | 8 ++--- .../transferissueRequestMain.data.ts | 29 +++++++++---------- 4 files changed, 32 insertions(+), 21 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 3e3ce1bed..4e58d3544 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -86,6 +86,7 @@ @buttonOperationClick="buttonOperationClick" @inputStringBlur="inputStringBlur" @inputNumberChange="inputNumberChange" + @tableFormSelectOnBlur="tableFormSelectOnBlur" />
@@ -463,6 +464,7 @@ const resetForm = () => { const emit = defineEmits([ 'success', 'tableSelectionChange', + 'tableFormSelectOnBlur', 'extendedButtonsClick', 'formSelectChange', 'formSelectvVisibleChange', @@ -495,6 +497,10 @@ const formSelectvVisibleChange = (field, val, row) => { const tableSelectionChange = (val) => { emit('tableSelectionChange', val) } +// tableform select bulr +const tableFormSelectOnBlur = (field, val, row, index) => { + emit('tableFormSelectOnBlur', field, val, row, index) +} // 列表排序 const tableSortChange = (column, prop, order) => { emit('tableSortChange', column, prop, order) diff --git a/src/components/TableForm/src/TableForm.vue b/src/components/TableForm/src/TableForm.vue index 4a38c18ca..c360d9f86 100644 --- a/src/components/TableForm/src/TableForm.vue +++ b/src/components/TableForm/src/TableForm.vue @@ -114,7 +114,8 @@ :allow-create="headerItem?.tableForm.allowCreate" style="width: 100%" :placeholder="headerItem?.tableForm?.placeholder || '请选择' + headerItem.label" - @change="formSelectChange(headerItem.field, $event,row)"> + @change="formSelectChange(headerItem.field, $event,row)" + @blur="tableFormSelectOnBlur(headerItem.field, $event,row, $index)"> { @@ -356,6 +358,10 @@ const initSelectOptions = (item) => { const formSelectChange = (field, val,row) => { emit('formSelectChange', field, val,row) } +// 普通下拉失焦事件 +const tableFormSelectOnBlur = (field, val,row,index) => { + emit('tableFormSelectOnBlur', field, val,row,index) +} // 数字输入-改变事件 const inputNumberChange = (field, index, row, e) => { emit('inputNumberChange', field, index, row, e) diff --git a/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue b/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/index.vue index 678b3916a..84fc44c73 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" - @on-blur="onBlur" + @tableFormSelectOnBlur="onBlur" /> @@ -318,10 +318,10 @@ const handleHandle = async (id: number) => { } catch {} } -const onBlur = (field, e) => { +const onBlur = (field, val, row, index) => { // console.log('字段', field) - // console.log('失焦后值', e.target.value) - formRef.value.formRef.formModel[field] = e.target.value + // console.log('失焦后值', val.target.value) + 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 836badd73..f7769002b 100644 --- a/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts +++ b/src/views/wms/inventoryjobManage/transferissue/transferissueRequestMain/transferissueRequestMain.data.ts @@ -113,21 +113,6 @@ export const TransferissueRequestMain = useCrudSchemas(reactive([ width: 150 }, }, - { - label: '原因', - field: 'reason', - sort: 'custom', - dictType: DICT_TYPE.TRANSFER_REASON, - dictClass: 'string', - table: { - width: 150 - }, - form: { - componentProps: { - filterable: true, - } - } - }, { label: '申请时间', field: 'requestTime', @@ -609,6 +594,20 @@ export const TransferissueRequestDetail = useCrudSchemas(reactive( disabled: true } }, + { + label: '原因', + field: 'reason', + sort: 'custom', + dictType: DICT_TYPE.TRANSFER_REASON, + dictClass: 'string', + table: { + width: 150 + }, + tableForm: { + type: 'Select', + filterable: true + } + }, { label: '包装号', field: 'packingNumber',