update 优化移库页面货位下拉框方法

This commit is contained in:
18110972313 2025-04-27 14:27:44 +08:00
parent 866fd5b6f8
commit dfbc800b69

View File

@ -144,7 +144,7 @@
<el-row class="page-search" justify="end" align="middle"> <el-row class="page-search" justify="end" align="middle">
<el-col :span="6"> <el-col :span="6">
<el-form-item label="目的货位" prop="portFormRefData.SEARCHTYPE"> <!-- <el-form-item label="目的货位" prop="portFormRefData.SEARCHTYPE">
<el-cascader <el-cascader
@visible-change="handleOuterClick" @visible-change="handleOuterClick"
v-model="state.StorageSelect" v-model="state.StorageSelect"
@ -156,6 +156,23 @@
children: 'children' children: 'children'
}" }"
/> />
</el-form-item>-->
<el-form-item label="目的货位" prop="portFormRefData.SEARCHTYPE">
<el-select
size="small"
filterable
v-model="state.StorageSelect"
default-first-option
placeholder="下拉选择货位"
:filter-method="getlocDec"
>
<el-option
v-for="item in state.StorageSelectList"
:key="item.STORAGENAME"
:label="item.DESCRIPTION"
:value="item.STORAGENAME"
/>
</el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -195,6 +212,7 @@ import { waitForDebugger } from 'inspector'
import { FirstInFirstOut, IFTRUE } from '@/utils/CommonUtil' import { FirstInFirstOut, IFTRUE } from '@/utils/CommonUtil'
import { bTableHeight } from '../../../composables/calcTableHeight' import { bTableHeight } from '../../../composables/calcTableHeight'
import { AssignShipRequest, DeAssignShipRequest, AllCommitMoveInInvoice } from '@/api/StockOut' import { AssignShipRequest, DeAssignShipRequest, AllCommitMoveInInvoice } from '@/api/StockOut'
import request from '@/utils/request'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(480) const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(480)
@ -218,6 +236,7 @@ const state = reactive({
MaterialPackingList: [] as any, MaterialPackingList: [] as any,
MaterialPackingUsername: [] as any, MaterialPackingUsername: [] as any,
StorageSelect: [] as any, StorageSelect: [] as any,
locDecListAll: [] as any,
StorageSelectList: [] as any, StorageSelectList: [] as any,
lineRow: [] as any, lineRow: [] as any,
queryParams: { queryParams: {
@ -368,6 +387,7 @@ onMounted(() => {
updateTableHeight() updateTableHeight()
window.addEventListener('resize', handleResize) window.addEventListener('resize', handleResize)
getStorageSpecLocationList()
}) })
// //
function updateList(col: any) { function updateList(col: any) {
@ -700,7 +720,7 @@ async function handle(row: any, event: any, column: any) {
state.firstLocation = row.ERPLOCATION state.firstLocation = row.ERPLOCATION
} }
function handleOuterClick() { function handleOuterClick() {
StorageList(state.firstLocation) //StorageList(state.firstLocation)
} }
async function StorageList(firstLocation: any) { async function StorageList(firstLocation: any) {
@ -733,6 +753,34 @@ async function StorageList(firstLocation: any) {
// state // state
} }
} }
async function getStorageSpecLocationList() {
let erpLocation = JSON.parse(localStorage.getItem('orgNo'));
request({
url: '/api/api/storage/getLocationNameForERPLocation',
method: 'post',
data: {
erpLocation: erpLocation,
SITENAME: 'SDK',
},
}).then((res: any) => {
state.locDecListAll = res.resultObj;
});
}
function getlocDec(query: any) {
// console.log(query)
//let arr = state.locDecListAll;
let arr = state.locDecListAll.filter((item: any) => {
return item.STORAGENAME.includes(query) || item.STORAGENAME.includes(query)
})
// console.log(arr)
if (arr.length > 50) {
state.StorageSelectList = arr.slice(0, 50)
} else {
state.StorageSelectList = arr
}
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">