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

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

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

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

Loading…
Cancel
Save