出库管理 物料名称远程搜索修正

出库管理 物料名称远程搜索修正
pull/3/head
siontion 9 months ago
parent 8c2db2f559
commit ba7301b2a3

@ -103,10 +103,10 @@
<template #header> <span class="hl-table_header">*</span>物料名称 </template>
<template #default="scope">
<el-form-item :prop="`${scope.$index}.matId`" :rules="subFormRules.matId" class="mb-0px!">
<el-select v-model="scope.row.matId" placeholder="物料名称" :remote-method="remoteMatCodeSearch" v-bind:disabled="ctrView || ctrSave"
<el-select v-model="scope.row.matId" placeholder="物料名称" :remote-method="remoteMatNameSearch" v-bind:disabled="ctrView || ctrSave"
remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading"
@change="(val) => handleMatCode(scope, val)" class="!w-180px">
<el-option v-for="item in scope.row.matList" :key="item.id" :label="item.name" :value="item.id" />
@change="(val) => handleMatName(scope, val)" class="!w-180px">
<el-option v-for="item in matList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</template>
@ -625,7 +625,7 @@ const getMatList = async (name) =>{
pageSize: 10,
status: '1'
}
if(name){
if(name.length>0){
matParams.name = name
}
@ -672,14 +672,14 @@ const handlePn = async (scope) =>{
const matSelectLoading = ref(false)
const remoteMatCodeSearch = async (name) => {
const remoteMatNameSearch = async (name) => {
matSelectLoading.value = true
//
await getMatList(name)
matSelectLoading.value = false
}
const handleMatCode = async (scope, matid) => {
const handleMatName = async (scope, matid) => {
scope.row.matId = scope.row.matList.find((item) => item.id === matid)?.id
scope.row.matName = scope.row.matList.find((item) => item.id === matid)?.name
scope.row.matCode = scope.row.matList.find((item) => item.id === matid)?.code
@ -687,9 +687,10 @@ const handleMatCode = async (scope, matid) => {
scope.row.matType = scope.row.matList.find((item) => item.id === matid)?.materialType
scope.row.matUnit = scope.row.matList.find((item) => item.id === matid)?.unit
if(matid.length==0){
scope.row.rgId = ''
scope.row.rgId = ''
scope.row.pnId = ''
if(matid.length==0){
}
scope.row.pnlist = pnList.value.filter(pn => pn.wh_id == formData.value.whId && matLastData.value.filter( mat => mat.matId == matid && mat.pnId == pn.id).length>0)

Loading…
Cancel
Save