Browse Source

物料库区配置管理---主表新增---多选功能

master_hella_20240701
yufei0306 8 months ago
parent
commit
659cc6d021
  1. 17
      src/components/BasicForm/src/BasicForm.vue
  2. 12
      src/views/wms/basicDataManage/itemManage/itemarea/index.vue
  3. 1
      src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts

17
src/components/BasicForm/src/BasicForm.vue

@ -259,7 +259,13 @@ const props = defineProps({
type: Array, type: Array,
required: false, required: false,
default: null default: null
} },
//
isOpenSearchTable:{
type: Boolean,
required: false,
default: false
},
}) })
const { t } = useI18n() // const { t } = useI18n() //
@ -565,8 +571,17 @@ const handleDeleteTable = (row, index) => {
} }
// //
const handleAddTable = () => { const 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') emit('handleAddTable')
} }
}
// //
const inpuFocus = (headerItem, row, index) => { const inpuFocus = (headerItem, row, index) => {
opensearchTable( opensearchTable(

12
src/views/wms/basicDataManage/itemManage/itemarea/index.vue

@ -44,6 +44,7 @@
ref="formRef" ref="formRef"
@success="getList" @success="getList"
:rules="ItemareaRules" :rules="ItemareaRules"
:isOpenSearchTable="true"
:formAllSchemas="Itemarea.allSchemas" :formAllSchemas="Itemarea.allSchemas"
:tableAllSchemas="ItemareaDetail.allSchemas" :tableAllSchemas="ItemareaDetail.allSchemas"
:tableFormRules="ItemareaDetailRules" :tableFormRules="ItemareaDetailRules"
@ -118,11 +119,16 @@ const updataTableColumns = (val) => {
const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
nextTick(() => { nextTick(() => {
if (type == 'tableForm') { if (type == 'tableForm') {
val.forEach(item=>{
const newRow = {...row}
if(formField == 'locationCode') { if(formField == 'locationCode') {
row['locationCode'] = val[0]['code'] newRow['locationCode'] = item['code']
}else{ }else{
row[formField] = val[0][searchField] newRow[formField] = item[searchField]
} }
tableData.value.push(newRow)
})
}else{ }else{
const setV = {} const setV = {}
if(formField == 'areaCode') { if(formField == 'areaCode') {
@ -135,8 +141,6 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
setV['outPackUnit'] = val[0]['packUnit'] setV['outPackUnit'] = val[0]['packUnit']
}else if(formField == 'itemCode') { }else if(formField == 'itemCode') {
setV['itemCode'] = val[0]['code'] setV['itemCode'] = val[0]['code']
}else if(formField == 'repleinshFromArea') {
setV['repleinshFromArea'] = val[0]['code']
}else{ }else{
setV[formField] = setV[0][searchField] setV[formField] = setV[0][searchField]
} }

1
src/views/wms/basicDataManage/itemManage/itemarea/itemarea.data.ts

@ -662,6 +662,7 @@ export const ItemareaDetail = useCrudSchemas(reactive<CrudSchema[]>([
field: 'locationCode', field: 'locationCode',
sort: 'custom', sort: 'custom',
tableForm:{ tableForm:{
multiple:true,//多选
isInpuFocusShow: true, // 开启查询弹窗 isInpuFocusShow: true, // 开启查询弹窗
searchListPlaceholder: '请选择库位代码', // 输入框占位文本 searchListPlaceholder: '请选择库位代码', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'code', // 查询弹窗赋值字段

Loading…
Cancel
Save