|
|
@ -103,10 +103,10 @@
|
|
|
|
<template #header> <span class="hl-table_header">*</span>物料名称 </template>
|
|
|
|
<template #header> <span class="hl-table_header">*</span>物料名称 </template>
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<el-form-item :prop="`${scope.$index}.matId`" :rules="subFormRules.matId" class="mb-0px!">
|
|
|
|
<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"
|
|
|
|
remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading"
|
|
|
|
@change="(val) => handleMatCode(scope, val)" class="!w-180px">
|
|
|
|
@change="(val) => handleMatName(scope, val)" class="!w-180px">
|
|
|
|
<el-option v-for="item in scope.row.matList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
<el-option v-for="item in matList" :key="item.id" :label="item.name" :value="item.id" />
|
|
|
|
</el-select>
|
|
|
|
</el-select>
|
|
|
|
</el-form-item>
|
|
|
|
</el-form-item>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
@ -625,7 +625,7 @@ const getMatList = async (name) =>{
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
status: '1'
|
|
|
|
status: '1'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(name){
|
|
|
|
if(name.length>0){
|
|
|
|
matParams.name = name
|
|
|
|
matParams.name = name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -672,14 +672,14 @@ const handlePn = async (scope) =>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const matSelectLoading = ref(false)
|
|
|
|
const matSelectLoading = ref(false)
|
|
|
|
const remoteMatCodeSearch = async (name) => {
|
|
|
|
const remoteMatNameSearch = async (name) => {
|
|
|
|
matSelectLoading.value = true
|
|
|
|
matSelectLoading.value = true
|
|
|
|
// 获得物料列表
|
|
|
|
// 获得物料列表
|
|
|
|
await getMatList(name)
|
|
|
|
await getMatList(name)
|
|
|
|
matSelectLoading.value = false
|
|
|
|
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.matId = scope.row.matList.find((item) => item.id === matid)?.id
|
|
|
|
scope.row.matName = scope.row.matList.find((item) => item.id === matid)?.name
|
|
|
|
scope.row.matName = scope.row.matList.find((item) => item.id === matid)?.name
|
|
|
|
scope.row.matCode = scope.row.matList.find((item) => item.id === matid)?.code
|
|
|
|
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.matType = scope.row.matList.find((item) => item.id === matid)?.materialType
|
|
|
|
scope.row.matUnit = scope.row.matList.find((item) => item.id === matid)?.unit
|
|
|
|
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 = ''
|
|
|
|
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)
|
|
|
|
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)
|
|
|
|