Browse Source

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

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

19
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,7 +571,16 @@ const handleDeleteTable = (row, index) => {
} }
// //
const handleAddTable = () => { 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) => { const inpuFocus = (headerItem, row, index) => {

18
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') {
if(formField == 'locationCode') { val.forEach(item=>{
row['locationCode'] = val[0]['code'] const newRow = {...row}
}else{ if(formField == 'locationCode') {
row[formField] = val[0][searchField] newRow['locationCode'] = item['code']
} }else{
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