【采购订单、物料需求计划、入库、出库】将物料编码与物料名称字段合并

pull/4/head
qiuhongwu 8 months ago
parent 6b301ac06f
commit 1cd843e272

@ -95,16 +95,17 @@
<el-table :data="formData.matItemDOList" class="hl-table">
<el-table-column prop="cid" label="序号" min-width="80" align="center" fixed />
<el-table-column prop="matId" min-width="140" align="center">
<template #header> <span class="hl-table_header">*</span> 物料编码 </template>
<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" remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading" @change="(val) => handleMatCode(scope, val)" class="!w-180px">
<!-- <el-select v-model="scope.row.matId" placeholder="物料编码/名称" :remote-method="remoteMatCodeSearch" 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 matList" :key="item.id" :label="item.code" :value="item.id" />
</el-select>
</el-select> -->
<MaterialSelect v-model="scope.row.matId" @update:newValue="handleSelectedMaterial(scope.$index,$event)" />
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="matName" label="物料名称" min-width="120" align="center" />
<!-- <el-table-column prop="matName" label="物料名称" min-width="120" align="center" /> -->
<el-table-column prop="matType" label="物料类型" align="center" min-width="120">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="scope.row.matType ? true : false" />
@ -281,7 +282,7 @@ import * as StorageApi from '@/api/heli/storage'
import * as StorageMatApi from '@/api/heli/storagemat'
import { getAccessToken, getTenantId } from '@/utils/auth'
import { useUserStore } from '@/store/modules/user'
import MaterialSelect from '@/views/heli/hlvuestyle/materialSelect.vue'
import * as MaterialApi from '@/api/heli/material'
import * as WarehouseApi from '@/api/heli/warehouse'
import * as RgApi from '@/api/heli/rg'
@ -768,6 +769,17 @@ onMounted(async () => {
//
userList.value = await UserApi.getSimpleUserList()
})
//
const handleSelectedMaterial = (currentIndex: number, newValue: any) => {
// console.log(currentIndex,':', newValue)
formData.value.matItemDOList[currentIndex].matId = newValue?.id
formData.value.matItemDOList[currentIndex].matName = newValue?.name
formData.value.matItemDOList[currentIndex].matCode = newValue?.code
formData.value.matItemDOList[currentIndex].matSpec = newValue?.spec
formData.value.matItemDOList[currentIndex].matType = newValue?.materialType
formData.value.matItemDOList[currentIndex].matUnit = newValue?.unit
}
</script>
<style>
a {

@ -94,16 +94,17 @@
<el-table :data="formData.matItemDOList" class="hl-table">
<el-table-column prop="cid" label="序号" :width="80" />
<el-table-column prop="matId" min-width="140" align="center">
<template #header> <span class="hl-table_header">*</span>物料名称 </template>
<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="remoteMatNameSearch" v-bind:disabled="ctrView || ctrSave" remote-show-suffix remote clearable reserve-keyword filterable :loading="matSelectLoading" @change="(val) => handleMatName(scope, val)" class="!w-180px">
<!-- <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) => 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-select> -->
<MaterialSelect v-model="scope.row.matId" @update:newValue="handleSelectedMaterial(scope.$index,$event)" />
</el-form-item>
</template>
</el-table-column>
<el-table-column prop="matCode" label="物料编码" min-width="120" align="center" />
<!-- <el-table-column prop="matCode" label="物料编码" min-width="120" align="center" /> -->
<el-table-column prop="matType" label="物料类型" min-width="120" align="center">
<template #default="scope">
<dict-tag :type="DICT_TYPE.HELI_MATERIAL_TYPE" :value="scope.row.matType" v-if="scope.row.matType ? true : false" />
@ -280,6 +281,7 @@ import * as StorageApi from '@/api/heli/storage'
import * as StorageMatApi from '@/api/heli/storagemat'
import { getAccessToken, getTenantId } from '@/utils/auth'
import { useUserStore } from '@/store/modules/user'
import MaterialSelect from '@/views/heli/hlvuestyle/materialSelect.vue'
import * as MaterialApi from '@/api/heli/material'
import * as WarehouseApi from '@/api/heli/warehouse'
@ -439,7 +441,7 @@ const openerror = () => {
`文件名为:${failedAttachmentsName.value.join(' / ')}上传失败`,
`文件格式不正确或网络问题 请您稍后再试`,
{
dangerouslyUseHTMLString: false,
dangerouslyUseHTMLString: false,
confirmButtonText: '知道了',
center: true
}
@ -866,6 +868,17 @@ onMounted(async () => {
//
userList.value = await UserApi.getSimpleUserList()
})
//
const handleSelectedMaterial = (currentIndex: number, newValue: any) => {
// console.log(currentIndex,':', newValue)
formData.value.matItemDOList[currentIndex].matId = newValue?.id
formData.value.matItemDOList[currentIndex].matName = newValue?.name
formData.value.matItemDOList[currentIndex].matCode = newValue?.code
formData.value.matItemDOList[currentIndex].matSpec = newValue?.spec
formData.value.matItemDOList[currentIndex].matType = newValue?.materialType
formData.value.matItemDOList[currentIndex].matUnit = newValue?.unit
}
</script>
<style>
a {

Loading…
Cancel
Save