@ -643,6 +643,7 @@
v - for = "dict in dict.type.mes_sale_type"
: key = "dict.value"
: label = "dict.value"
: disabled = "dict.value === '3'"
> { { dict . label } }
< / e l - r a d i o >
< / e l - r a d i o - g r o u p >
@ -656,7 +657,7 @@
< el -table -column prop = "materialName" label = "成品名称" width = "130" align = "center" v -if = " batchSaleForm.batchSaleType ! = = MES_SALE_TYPE.MES_SALE_TYPE_PACKING " / >
< el -table -column label = "成品BOM" width = "200" align = "center" v-if ="batchSaleForm.batchSaleType === MES_SALE_TYPE.MES_SALE_TYPE_EXTERNAL" >
< template slot -scope = " scope " >
< el -select v-model ="scope.row.materialBomId" placeholder="请选择 物料 BOM">
< el -select v-model ="scope.row.materialBomId" placeholder="请选择 成品 BOM">
< el -option v -for = " item in ( scope.row.materialBomList | | [ ] ) " :key ="item.materialBomId" :label ="item.materialNameDesc" :value ="item.materialBomId" :disabled ="item.activeFlag!=='1'" / >
< / e l - s e l e c t >
< / template >
@ -672,7 +673,7 @@
< el -table -column label = "物料BOM" width = "200" align = "center" v-if ="batchSaleForm.batchSaleType === MES_SALE_TYPE.MES_SALE_TYPE_INTERNAL" >
< template slot -scope = " scope " >
< el -select v-model ="scope.row.materialBomId" placeholder="请选择物料BOM" >
< el -option v -for = " item in ( scope.row. m aterialBomList | | [ ] ) " :key ="item.materialBomId" :label ="item.materialNameDesc" :value ="item.materialBomId" :disabled ="item.activeFlag!=='1'" / >
< el -option v -for = " item in ( scope.row. produceM aterialBomList | | [ ] ) " :key ="item.materialBomId" :label ="item.materialNameDesc" :value ="item.materialBomId" :disabled ="item.activeFlag!=='1'" / >
< / e l - s e l e c t >
< / template >
< / e l - t a b l e - c o l u m n >
@ -740,7 +741,13 @@
< / e l - d i a l o g >
<!-- 新增 : 批量选择生产物料弹窗 -- >
< el -dialog title = "选择生产物料" :visible.sync ="batchSaleProduceMaterialOpen" append -to -body >
< select -material @selection ="()=>{}" ref = "batchSaleProduceMaterialRef" :select-type ="MATERIAL_TYPE.RAW" v-if ="batchSaleProduceMaterialOpen" > < / select -material >
< select -material
@ selection = "()=>{}"
ref = "batchSaleProduceMaterialRef"
: select - type = "MATERIAL_TYPE.RAW"
: filter - material - id = "currentBatchSaleMaterialId"
v - if = "batchSaleProduceMaterialOpen" >
< / s e l e c t - m a t e r i a l >
< div slot = "footer" class = "dialog-footer" >
< el -button type = "primary" @click ="submitBatchSaleProduceMaterialForm" > 确 定 < / el -button >
< el -button @ click = "batchSaleProduceMaterialOpen = false" > 取 消 < / e l - b u t t o n >
@ -1043,6 +1050,7 @@ export default {
/ / 新 增 : 批 量 选 择 生 产 物 料 弹 窗 控 制 和 当 前 行 索 引
batchSaleProduceMaterialOpen : false ,
currentBatchSaleRowIndex : null ,
currentBatchSaleMaterialId : null , / / 新 增 : 当 前 批 量 选 择 的 物 料 I D
} ;
} ,
activated ( ) {
@ -1607,20 +1615,28 @@ export default {
materialBomList : [ ]
} ) ) ;
rows . forEach ( ( row , index ) => {
getMaterialVisionList ( row . materialId ) . then ( response => {
if ( response . data && response . data . length !== 0 ) {
this . $set ( this . batchSaleOrders [ index ] , 'materialBomList' , response . data ) ;
this . batchSaleOrders [ index ] . materialBomId = response . data [ 0 ] . materialBomId ;
} else {
this . $modal . msgError ( row . materialName + "物料未维护BOM信息! " ) ;
if ( this . batchSaleForm . batchSaleType === this . MES _SALE _TYPE . MES _SALE _TYPE _EXTERNAL ) {
rows . forEach ( ( row , index ) => {
getMaterialVisionList ( row . materialId ) . then ( response => {
if ( response . data && response . data . length !== 0 ) {
this . $set ( this . batchSaleOrders [ index ] , 'materialBomList' , response . data ) ;
this . batchSaleOrders [ index ] . materialBomId = response . data [ 0 ] . materialBomId ;
} else {
this . $modal . msgError ( row . materialName + "物料未维护BOM信息! " ) ;
this . $set ( this . batchSaleOrders [ index ] , 'materialBomList' , [ ] ) ;
}
} ) . catch ( error => {
console . error ( '获取BOM信息失败:' , error ) ;
this . $set ( this . batchSaleOrders [ index ] , 'materialBomList' , [ ] ) ;
}
} ) . catch ( error => {
console . error ( '获取BOM信息失败:' , error ) ;
this . $set ( this . batchSaleOrders [ index ] , 'materialBomList' , [ ] ) ;
} ) ;
} ) ;
} ) ;
}
if ( this . batchSaleForm . batchSaleType === this . MES _SALE _TYPE . MES _SALE _TYPE _INTERNAL ) {
rows . forEach ( ( row , index ) => {
this . batchSaleOrders [ index ] . dispatchId = 3 ;
this . batchSaleOrders [ index ] . materialBomId = null ;
} ) ;
}
console . log ( "batchSaleOrders" , this . batchSaleOrders )
this . $refs . batchSaleOrderRef . clearSelection ( ) ;
@ -1674,16 +1690,39 @@ export default {
/ / 新 增 : 打 开 批 量 选 择 生 产 物 料 弹 窗
openBatchSaleProduceMaterialDialog ( rowIndex ) {
this . currentBatchSaleRowIndex = rowIndex ;
this . batchSaleProduceMaterialOpen = true ;
this . currentBatchSaleMaterialId = this . batchSaleOrders [ rowIndex ] . materialId ; / / 新 增
this . batchSaleProduceMaterialOpen = false ;
this . $nextTick ( ( ) => {
this . batchSaleProduceMaterialOpen = true ;
} ) ;
} ,
/ / 新 增 : 批 量 选 择 生 产 物 料 弹 窗 确 认
submitBatchSaleProduceMaterialForm ( ) {
const selectedRow = this . $refs . batchSaleProduceMaterialRef . selectedRow ;
if ( selectedRow ) {
const idx = this . currentBatchSaleRowIndex ;
this . $set ( this . batchSaleOrders [ idx ] , 'produceMaterialId' , selectedRow . materialId ) ;
this . $set ( this . batchSaleOrders [ idx ] , 'produceMaterialName' , selectedRow . materialName ) ;
const idx = this . currentBatchSaleRowIndex ;
if ( this . batchSaleForm . batchSaleType === this . MES _SALE _TYPE . MES _SALE _TYPE _EXTERNAL ) {
if ( selectedRow ) {
this . $set ( this . batchSaleOrders [ idx ] , 'produceMaterialId' , selectedRow . materialId ) ;
this . $set ( this . batchSaleOrders [ idx ] , 'produceMaterialName' , selectedRow . materialName ) ;
}
}
if ( this . batchSaleForm . batchSaleType === this . MES _SALE _TYPE . MES _SALE _TYPE _INTERNAL ) {
if ( selectedRow ) {
this . $set ( this . batchSaleOrders [ idx ] , 'produceMaterialId' , selectedRow . materialId ) ;
this . $set ( this . batchSaleOrders [ idx ] , 'produceMaterialName' , selectedRow . materialName ) ;
}
getMaterialVisionList ( selectedRow . materialId ) . then ( response => {
if ( response . data && response . data . length !== 0 ) {
this . $set ( this . batchSaleOrders [ idx ] , 'produceMaterialBomList' , response . data ) ;
this . batchSaleOrders [ idx ] . materialBomId = response . data [ 0 ] . materialBomId ;
console . log ( this . batchSaleOrders )
} else {
this . $modal . msgError ( selectedRow . materialName + "物料未维护BOM信息! " ) ;
this . $set ( this . batchSaleOrders [ idx ] , 'produceMaterialBomList' , [ ] ) ;
}
} )
}
this . batchSaleProduceMaterialOpen = false ;
} ,
}