style:产品BOM-产品BOM明细-单位自动带入

pull/1/head
黄伟杰 4 weeks ago
parent 5a5080877f
commit 1d312fd646

@ -17,6 +17,7 @@
clearable
filterable
:placeholder="t('FactoryModeling.ProductBOM.detailMaterialPlaceholder')"
@change="(val) => handleProductChange(val, row)"
>
<el-option
v-for="item in productList"
@ -138,6 +139,16 @@ watch(
)
/** 原料选择变更时,自动带入单位 */
const handleProductChange = (productId: number | undefined, row: any) => {
if (productId) {
const product = productList.value.find((item) => item.id === productId)
row.unitId = product?.unitId ?? undefined
} else {
row.unitId = undefined
}
}
/** 新增按钮操作 */
const handleAdd = () => {
const row = {

Loading…
Cancel
Save