update 产成品入库、调拨入库修改库位下拉框方法

This commit is contained in:
18110972313 2025-04-27 11:13:36 +08:00
parent c1dc838916
commit 24132593cf
2 changed files with 93 additions and 15 deletions

View File

@ -20,7 +20,6 @@
<el-select
size="default"
filterable
@change="changeWare(formData.ERPRECEIVELOCATION,formData.ERPFACTORY)"
v-model="formData.ERPRECEIVELOCATION"
placeholder="下拉选择库位"
>
@ -33,7 +32,24 @@
</el-select>
<!-- <el-input v-model="formData.ERPRECEIVELOCATION" placeholder="接收仓库" /> -->
</el-form-item>
<el-form-item v-show="USE_LOCATION != 'N'" label="目的货位" prop="portFormRefData.SEARCHTYPE">
<!-- <el-form-item label="仓库">
<el-select
size="default"
filterable
@change="changeWare(formData.ERPRECEIVELOCATION,formData.ERPFACTORY)"
v-model="formData.ERPRECEIVELOCATION"
placeholder="下拉选择库位"
>
<el-option
v-for="item in locDecList"
:key="item.ENUMVALUE"
:label="item.DESCRIPTION"
:value="item.ENUMVALUE"
/>
</el-select>
&lt;!&ndash; <el-input v-model="formData.ERPRECEIVELOCATION" placeholder="接收仓库" /> &ndash;&gt;
</el-form-item>-->
<!-- <el-form-item v-show="USE_LOCATION != 'N'" label="目的货位" prop="portFormRefData.SEARCHTYPE">
<el-cascader
@visible-change="handleOuterClick"
v-model="state.StorageSelect"
@ -41,10 +57,27 @@
:props="{
checkStrictly: true,
label: 'DESCRIPTION',
value: 'ERPLOCATION',
value: 'STORAGENAME',
children: 'children'
}"
/>
</el-form-item>-->
<el-form-item label="目的货位" prop="portFormRefData.SEARCHTYPE">
<el-select
size="default"
filterable
v-model="state.StorageSelect"
default-first-option
placeholder="下拉选择货位"
:filter-method="handleOuterClick"
>
<el-option
v-for="item in state.StorageSelectList"
:key="item.STORAGENAME"
:label="item.DESCRIPTION"
:value="item.STORAGENAME"
/>
</el-select>
</el-form-item>
</el-form>
@ -141,6 +174,7 @@ export default {
import { reactive, ref, onMounted, toRefs, getCurrentInstance } from 'vue'
import { ElForm, ElMessageBox } from 'element-plus'
import { allocateStockInCommit, BpelEvent, getQueryList } from '@/api/common'
import request from '@/utils/request'
// import { getPageList } from "@/api/menu";
// import { Header } from "element-plus/es/components/table-v2/src/components";
@ -156,6 +190,7 @@ const state = reactive({
locDecList: [] as any,
StorageSelect: [] as any,
StorageSelectList: [] as any,
locDecListAll: [] as any,
formData: {
SHIPREQUESTNAME: '',
SHIPREQUESTSTATE: '',
@ -339,6 +374,8 @@ onMounted(() => {
hide: false
}
]
WareList()
getStorageSpecLocationList()
})
/*****************************************************下面方法******************************************/
@ -454,9 +491,9 @@ function getBoxList() {
// state.formData.ERPRECEIVELOCATION = res.data[0]?.ERPRECEIVELOCATION
state.formData.SHIPREQUESTSTATE = res.data[0]?.SHIPREQUESTSTATE
if(state.formData.ERPRECEIVEFACTORY) {
/*if(state.formData.ERPRECEIVEFACTORY) {
WareList(state.formData.ERPRECEIVEFACTORY)
}
}*/
})
.catch((error: any) => {
@ -467,13 +504,14 @@ function getBoxList() {
// getDetailList() //
getAllPackingList()
}
async function WareList(firstLocation: any) {
async function WareList() {
try {
let erpLocation = JSON.parse(localStorage.getItem('orgNo'))
const res = await getQueryList({
queryId: 'GetErpLocationList',
version: 'WEB00001',
params: {
ERPFACTORYNAME: firstLocation,
ERPFACTORYNAME: erpLocation,
SITENAME: 'SDK'
},
pageNum: 1,
@ -529,8 +567,17 @@ function getAllPackingList() {
})
}
function handleOuterClick() {
StorageList(state.formData.ERPRECEIVELOCATION)
function handleOuterClick(query: any) {
//StorageList(state.formData.ERPRECEIVELOCATION)
let arr = state.locDecListAll.filter((item: any) => {
return item.DESCRIPTION.includes(query) || item.STORAGENAME.includes(query)
})
// console.log(arr)
if (arr.length > 50) {
state.StorageSelectList = arr.slice(0, 50)
} else {
state.StorageSelectList = arr
}
}
async function StorageList(firstLocation: any) {
@ -792,6 +839,21 @@ function stockIn() {
console.log(res, 'res')
})
}
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;
console.log(state.locDecListAll)
});
}
</script>
<style scoped>

View File

@ -140,7 +140,6 @@
<el-select
size="small"
filterable
@change="changeLocW"
v-model="desParams.params.ERPLOCATION"
placeholder="下拉选择仓库"
>
@ -165,9 +164,9 @@
>
<el-option
v-for="item in locDecList2"
:key="item.VALUE"
:label="item.LABEL"
:value="item.VALUE"
:key="item.STORAGENAME"
:label="item.DESCRIPTION"
:value="item.STORAGENAME"
/>
</el-select>
</el-form-item>
@ -221,6 +220,7 @@ import { bTableHeight } from '../../../composables/calcTableHeight'
import { getORG } from '@/api/auth'
import { cals } from '@/utils/cal'
import { getOpCode } from '@/api/opcode'
import request from '@/utils/request'
const { tableContainer, tableHeight, updateTableHeight, handleResize } = bTableHeight(330)
const queryFormRef = ref(ElForm)
@ -426,7 +426,7 @@ onMounted(() => {
let pwd: any = localStorage.getItem('remeberPwd')
ERPFactoryQuery()
queryInfo()
getStorageSpecLocationList()
updateTableHeight()
window.addEventListener('resize', handleResize)
})
@ -574,8 +574,9 @@ async function changeLocW() {
}
function getlocDec(query: any) {
// console.log(query)
//let arr = state.locDecListAll;
let arr = state.locDecListAll.filter((item: any) => {
return item.LABEL.includes(query) || item.VALUE.includes(query)
return item.STORAGENAME.includes(query) || item.STORAGENAME.includes(query)
})
// console.log(arr)
if (arr.length > 50) {
@ -681,6 +682,21 @@ async function submit() {
// state.loading2 = false
state.Button_state = false
}
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;
console.log(state.locDecList2)
});
}
</script>
<style scoped lang="scss">