@ -7,7 +7,7 @@ import {
} from '../../../../api/shipment/box'
import {
getShipmentRollAllData ,
getShipmentRollDataList , printShipmentRoll ,
getShipmentRollDataList , printShipmentRoll , queryShipmentDetailByBox ,
removeShipmentRollData ,
saveShipmentRollData
} from '../../../../api/shipment/roll'
@ -37,6 +37,12 @@ export default {
} ,
data ( ) {
return {
labelLoading : false ,
labelVisible : false ,
shipmentDetailList : [ ] ,
box : {
refOrderNo : '' ,
} ,
open : false ,
endOpen : false ,
form : { } ,
@ -90,7 +96,7 @@ export default {
if ( data && data . code === 0 ) {
this . $message . success ( data . msg )
if ( status === 0 ) {
this . handlePrint ( row )
this . handleClick Print ( row )
}
this . $emit ( 'refresh' )
} else {
@ -273,9 +279,14 @@ export default {
} )
} ,
handlePrint ( row ) {
if ( row . refOrderNo === '' || row . refOrderNo === undefined || row . refOrderNo === null ) {
this . $message . warning ( '未选择信息' )
return
}
this . printBoxLabel ( row ) ;
} ,
printBoxLabel ( row ) {
this . labelLoading = true ;
printShipmentBox ( row ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {
let arr = data . rows . map ( ( item ) => {
@ -285,13 +296,16 @@ export default {
item . boxNo = ` ${ dayjs ( row . createDate ) . format ( "YYMMDDHHmmss" ) } ${ ( row . boxNo + '' ) . padStart ( 3 , '0' ) } `
return item
} )
this . labelVisible = false ;
/ / p r i n t S h i p m e n t B o x L a b e l ( a r r ) ;
this . printRollLabel ( row , arr ) ;
} else {
this . $message . warning ( data . msg )
}
this . labelLoading = false ;
} ) . catch ( ( error ) => {
this . $message . error ( error )
this . labelLoading = false ;
} )
} ,
printRollLabel ( row , packList ) {
@ -314,6 +328,32 @@ export default {
} ) . catch ( ( error ) => {
this . $message . error ( error )
} )
} ,
handleClickPrint ( row ) {
this . box = {
... row ,
refOrderNo : '' ,
}
this . handleQueryShipmenDetail ( row ) ;
this . labelVisible = true ;
} ,
handleQueryShipmenDetail ( row ) {
let params = {
... row
}
this . shipmentDetailList = [ ]
queryShipmentDetailByBox ( params ) . then ( ( { data } ) => {
if ( data && data . code === 0 ) {
this . shipmentDetailList = data . rows
if ( this . shipmentDetailList . length > 0 ) {
this . box . refOrderNo = ` ${ this . shipmentDetailList [ 0 ] . orderNumber } - ${ this . shipmentDetailList [ 0 ] . lineNo } - ${ this . shipmentDetailList [ 0 ] . relNo } `
}
} else {
this . $message . warning ( data . msg )
}
} ) . catch ( ( error ) => {
this . $message . error ( error )
} )
}
} ,
watch : {
@ -347,11 +387,20 @@ export default {
< el -link v-if ="scope.row.status==='已封箱'" @click="handleUpdateBoxStatus(scope.row,1)" > 解封箱 < / el -link >
< el -link v-if ="scope.row.status==='未封箱'" @click="handleRemoveBox(scope.row)" > 删除 < / el -link >
< el -link @click ="handleGetRollDataList(scope.row)" > 查看 < / el -link >
< el -link v-if ="scope.row.status==='已封箱'" @click="handlePrint(scope.row)" > 补打 < / el -link >
< el -link v-if ="scope.row.status==='已封箱'" @click="handleClick Print(scope.row)" > 补打 < / el -link >
< / template >
< / e l - t a b l e - c o l u m n >
< / e l - t a b l e >
< el -dialog title = "标签" :visible.sync ="labelVisible" top = "20vh" v -drag :close-on-click-modal ="false" append -to -body width = "280px" >
< el -select v-model ="box.refOrderNo" style="width: 100%;" >
< el -option :label ="`${item.orderNumber}-${item.lineNo}-${item.relNo}`" :value ="`${item.orderNumber}-${item.lineNo}-${item.relNo}`" v-for ="(item,i) in shipmentDetailList" :key ="i" > < / el -option >
< / e l - s e l e c t >
< el -footer style = "height: 30px;text-align: center;line-height: 30px" >
< el -button type = "primary" :loading ="labelLoading" @click ="handlePrint(box)" > 确定 < / el -button >
< / e l - f o o t e r >
< / e l - d i a l o g >
< el -dialog title = "扫描" :visible.sync ="open" v -drag :close-on-click-modal ="false" append -to -body width = "1000px" >
< el -form :model ="form" label -width = " 100px " label -position = " top " >
< el -row :gutter ="10" >