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

View File

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