|
|
|
@ -17,6 +17,7 @@
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
filterable
|
|
|
|
filterable
|
|
|
|
:placeholder="t('FactoryModeling.ProductBOM.detailMaterialPlaceholder')"
|
|
|
|
:placeholder="t('FactoryModeling.ProductBOM.detailMaterialPlaceholder')"
|
|
|
|
|
|
|
|
@change="(val) => handleProductChange(val, row)"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<el-option
|
|
|
|
<el-option
|
|
|
|
v-for="item in productList"
|
|
|
|
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 handleAdd = () => {
|
|
|
|
const row = {
|
|
|
|
const row = {
|
|
|
|
|