feat 取消货位级联选择

This commit is contained in:
Amjacks 2025-04-16 13:10:47 +08:00
parent abc0b7be73
commit 5009f73821
5 changed files with 120 additions and 23 deletions

View File

@ -39,11 +39,11 @@
<el-form-item label="货位" prop="params.LOCATION">
<el-select v-model="state.ChangeLocation" multiple clearable collapse-tags placeholder="请选择货位"
popper-class="custom-header" :max-collapse-tags="1" style="width: 240px"
@visible-change="JudgeMentERPLocation" filterable>
remote :remote-method="handleInput" filterable>
<template #header>
</template>
<el-option v-for="item in LocationList" :key="item.STORAGENAME" :label="item.DESCRIPTION"
:value="item.STORAGENAME" />
<el-option v-for="item in LocationList" :key="item.storageName" :label="item.storageName"
:value="item.storageName" />
</el-select>
</el-form-item>
</el-col>
@ -297,6 +297,7 @@
import { getORG } from '@/api/auth';
import { bTableHeight } from "../../../../composables/calcTableHeight";
import dayjs from 'dayjs'
import { search } from '@/api/wareHouse'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(310);
const { proxy }: any = getCurrentInstance();
@ -557,6 +558,24 @@
})
}
function handleInput(val: any) {
let index = [1, 3, 4, 7, 8]
if (index.indexOf(val.length) > -1) {
state.LocationList = []
search({
storageName: val,
orgNo: JSON.parse(localStorage.getItem('orgNo'))
}).then((res:any) => {
if (res.resultObj) {
state.LocationList = res.resultObj
} else {
proxy.$ElMessage.warning(res.message);
}
})
}
}
function exportExcel() {
let paramsObjet = state.queryParams.params;
const parmlist = Object.keys(paramsObjet).filter((key: any) => key !== 'SITENAME')
@ -692,7 +711,7 @@
if (!areAllNotEmpty(state.ChangeERPLocation)) {
return
}
if (!value) {
/*if (!value) {
let ERPLOCATIONList = state.ChangeERPLocation;
getQueryList({
queryId: "GetLocationListForSomeERPLocation",
@ -709,7 +728,7 @@
});
})
.catch(() => { });
}
}*/
}
</script>

View File

@ -75,7 +75,6 @@
v-model="state.queryParams.params.ERPLOCATION"
placeholder="选择仓库"
clearable
@change="getStorageSpec"
style="width: 170px"
>
<el-option
@ -90,18 +89,19 @@
<el-col :span="4">
<el-form-item label="货位" prop="queryParams.params">
<el-select
:filter-method="locatioNFilter"
filterable
v-model="state.queryParams.params.LOCATIONNAME"
remote
:remote-method="handleInput"
clearable
placeholder="选择库位"
style="width: 170px"
>
<el-option
v-for="item in state.LocationList"
:key="item.ENUMVALUE"
:label="item.DESCRIPTION"
:value="item.ENUMVALUE"
:key="item.storageName"
:label="item.storageName"
:value="item.storageName"
/>
</el-select>
</el-form-item>
@ -293,6 +293,7 @@ import { localStorage } from '@/utils/storage'
import { bTableHeight } from '../../../composables/calcTableHeight'
import { getORG } from '@/api/auth'
import { cals } from '@/utils/cal'
import { search } from '@/api/wareHouse'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(280)
const queryFormRef = ref(ElForm)
@ -458,6 +459,23 @@ onMounted(() => {
window.addEventListener('resize', handleResize)
})
function handleInput(val: any) {
let index = [1, 3, 4, 7, 8]
if (index.indexOf(val.length) > -1) {
state.LocationList = []
search({
storageName: val,
orgNo: JSON.parse(localStorage.get('orgNo'))
}).then((res:any) => {
if (res.resultObj) {
state.LocationList = res.resultObj
} else {
proxy.$ElMessage.warning(res.message);
}
})
}
}
const exportLabel = () => {
console.log('state.multipleSelection', state.multipleSelection) //
printLabel(state.multipleSelection)

View File

@ -50,14 +50,16 @@
<el-select
size="small"
filterable
remote
:remote-method="handleInput"
v-model="queryParams.params.LOCATIONNAME"
placeholder="下拉选择货位"
>
<el-option
v-for="item in LocationList"
:key="item.ENUMVALUE"
:label="item.DESCRIPTION"
:value="item.ENUMVALUE"
:key="item.storageName"
:label="item.storageName"
:value="item.storageName"
/>
</el-select>
</el-form-item>
@ -286,6 +288,7 @@ import { IFTRUE } from '@/utils/CommonUtil'
import { bTableHeight } from '../../../composables/calcTableHeight'
import { getORG } from '@/api/auth'
import { cals } from '@/utils/cal'
import { search } from '@/api/wareHouse'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(330)
const queryFormRef = ref(ElForm)
@ -506,6 +509,23 @@ onMounted(() => {
window.addEventListener('resize', handleResize)
})
function handleInput(val: any) {
let index = [1, 3, 4, 7, 8]
if (index.indexOf(val.length) > -1) {
state.LocationList = []
search({
storageName: val,
orgNo: JSON.parse(localStorage.getItem('orgNo'))
}).then((res:any) => {
if (res.resultObj) {
state.LocationList = res.resultObj
} else {
proxy.$ElMessage.warning(res.message);
}
})
}
}
function getRKey(row: any) {
// console.log(row.CHARGE)
return row.CHARGE
@ -590,7 +610,7 @@ function changeERPLocation(e: any) {
// console.log(e)
state.queryParams.params.LOCATIONNAME = ''
state.queryParamsLocation.params.ERPLOCATION = e
LocationQuery()
// LocationQuery()
}
//
function LocationQuery() {

View File

@ -39,11 +39,13 @@
<el-form-item label="货位" prop="params.LOCATION">
<el-select v-model="state.ChangeLocation" multiple clearable collapse-tags placeholder="请选择货位"
popper-class="custom-header" :max-collapse-tags="1" style="width: 240px"
@visible-change="JudgeMentERPLocation" filterable>
remote :remote-method="handleInput" filterable>
<template #header>
</template>
<el-option v-for="item in LocationList" :key="item.STORAGENAME" :label="item.DESCRIPTION"
:value="item.STORAGENAME" />
<el-option v-for="item in LocationList"
:key="item.storageName"
:label="item.storageName"
:value="item.storageName" />
</el-select>
</el-form-item>
</el-col>
@ -208,6 +210,7 @@
import { updateCareerAssistance, updateRemark } from '@/api/label'
import { bTableHeight } from "../../../composables/calcTableHeight";
import { getORG } from '@/api/auth';
import { search } from '@/api/wareHouse'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(310);
@ -446,6 +449,23 @@ const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableH
};
function handleInput(val: any) {
let index = [1, 3, 4, 7, 8]
if (index.indexOf(val.length) > -1) {
state.LocationList = []
search({
storageName: val,
orgNo: JSON.parse(localStorage.get('orgNo'))
}).then((res:any) => {
if (res.resultObj) {
state.LocationList = res.resultObj
} else {
proxy.$ElMessage.warning(res.message);
}
})
}
}
function isChinese(text : any) {
const reg = /^[\u4e00-\u9fa5]+$/;
@ -679,7 +699,7 @@ const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableH
if (!areAllNotEmpty(state.ChangeERPLocation)) {
return
}
if (!value) {
/*if (!value) {
let ERPLOCATIONList = state.ChangeERPLocation;
getQueryList({
queryId: "GetLocationListForSomeERPLocation",
@ -696,7 +716,7 @@ const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableH
});
})
.catch(() => { });
}
}*/
}
</script>

View File

@ -44,14 +44,16 @@
<el-select
size="small"
filterable
remote
:remote-method="handleInput"
v-model="queryParams.params.LOCATIONNAME"
placeholder="下拉选择货位"
>
<el-option
v-for="item in LocationList"
:key="item.ENUMVALUE"
:label="item.DESCRIPTION"
:value="item.ENUMVALUE"
:key="item.storageName"
:label="item.storageName"
:value="item.storageName"
/>
</el-select>
</el-form-item>
@ -252,6 +254,7 @@ import type { CascaderProps } from 'element-plus'
import { IFTRUE } from '@/utils/CommonUtil'
import { bTableHeight } from '../../../composables/calcTableHeight'
import { getORG } from '@/api/auth'
import { search } from '@/api/wareHouse'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(240)
const queryFormRef = ref(ElForm)
@ -391,6 +394,23 @@ const {
checkResultOptions
} = toRefs(state)
function handleInput(val: any) {
let index = [1, 3, 4, 7, 8]
if (index.indexOf(val.length) > -1) {
state.LocationList = []
search({
storageName: val,
orgNo: JSON.parse(localStorage.getItem('orgNo'))
}).then((res:any) => {
if (res.resultObj) {
state.LocationList = res.resultObj
} else {
proxy.$ElMessage.warning(res.message);
}
})
}
}
onMounted(() => {
state.column = [
{ header: '工厂', field: 'SITENAME', hide: true },
@ -473,7 +493,7 @@ function changeERPLocation(e: any) {
// console.log(e)
state.queryParams.params.LOCATIONNAME = ''
state.queryParamsLocation.params.ERPLOCATION = e
LocationQuery()
// LocationQuery()
}
//
function LocationQuery() {