From 659cc6d021b262e9f51ff28e819d89612e06709e Mon Sep 17 00:00:00 2001 From: yufei0306 <13417315+yufei0306@user.noreply.gitee.com> Date: Fri, 29 Mar 2024 16:53:26 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E5=BA=93=E5=8C=BA=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E7=AE=A1=E7=90=86---=E4=B8=BB=E8=A1=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E---=E5=A4=9A=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/BasicForm/src/BasicForm.vue | 19 +++++++++++++++++-- .../itemManage/itemarea/index.vue | 18 +++++++++++------- .../itemManage/itemarea/itemarea.data.ts | 1 + 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/components/BasicForm/src/BasicForm.vue b/src/components/BasicForm/src/BasicForm.vue index 2566aaf6c..bdeb41002 100644 --- a/src/components/BasicForm/src/BasicForm.vue +++ b/src/components/BasicForm/src/BasicForm.vue @@ -259,7 +259,13 @@ const props = defineProps({ type: Array, required: false, default: null - } + }, + //是否直接展示搜索表单 + isOpenSearchTable:{ + type: Boolean, + required: false, + default: false + }, }) const { t } = useI18n() // 国际化 @@ -565,7 +571,16 @@ const handleDeleteTable = (row, index) => { } // 添加数据 const handleAddTable = () => { - emit('handleAddTable') + if(props.isOpenSearchTable){ + const tableFormKeys = {} + tableAllSchemas.value.tableFormColumns.forEach(item => { + tableFormKeys[item.field] = item.default ? item.default : '' + }) + inpuFocus(tableAllSchemas.value.tableFormColumns[0],tableFormKeys,0) + }else{ + emit('handleAddTable') + } + } // 输入框聚焦 const inpuFocus = (headerItem, row, index) => { diff --git a/src/views/wms/basicDataManage/itemManage/itemarea/index.vue b/src/views/wms/basicDataManage/itemManage/itemarea/index.vue index ff3501627..0bbece782 100644 --- a/src/views/wms/basicDataManage/itemManage/itemarea/index.vue +++ b/src/views/wms/basicDataManage/itemManage/itemarea/index.vue @@ -44,6 +44,7 @@ ref="formRef" @success="getList" :rules="ItemareaRules" + :isOpenSearchTable="true" :formAllSchemas="Itemarea.allSchemas" :tableAllSchemas="ItemareaDetail.allSchemas" :tableFormRules="ItemareaDetailRules" @@ -118,11 +119,16 @@ const updataTableColumns = (val) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { nextTick(() => { if (type == 'tableForm') { - if(formField == 'locationCode') { - row['locationCode'] = val[0]['code'] - }else{ - row[formField] = val[0][searchField] - } + val.forEach(item=>{ + const newRow = {...row} + if(formField == 'locationCode') { + newRow['locationCode'] = item['code'] + }else{ + newRow[formField] = item[searchField] + } + tableData.value.push(newRow) + }) + }else{ const setV = {} if(formField == 'areaCode') { @@ -135,8 +141,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => setV['outPackUnit'] = val[0]['packUnit'] }else if(formField == 'itemCode') { setV['itemCode'] = val[0]['code'] - }else if(formField == 'repleinshFromArea') { - setV['repleinshFromArea'] = val[0]['code'] }else{ setV[formField] = setV[0][searchField] } diff --git a/src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts b/src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts index a8ad7c0b3..7c4b61e89 100644 --- a/src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts +++ b/src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts @@ -662,6 +662,7 @@ export const ItemareaDetail = useCrudSchemas(reactive([ field: 'locationCode', sort: 'custom', tableForm:{ + multiple:true,//多选 isInpuFocusShow: true, // 开启查询弹窗 searchListPlaceholder: '请选择库位代码', // 输入框占位文本 searchField: 'code', // 查询弹窗赋值字段