@ -80,17 +80,28 @@
< div class = "order-info" >
< div class = "order-info" >
< div style = "display: flex;" >
< div style = "display: flex;" >
< span style = "width: 210px;" > 订单编号 : { { printData . purchaseNo } } < / span >
< span style = "width: 210px;" > 订单编号 : { { printData . purchaseNo } } < / span >
< span style = "margin-left:20px; width: 1 5 0px;"> 订单日期 : { { formatDate ( printData . ordDate ) } } < / span >
< span style = "margin-left:20px; width: 1 7 0px;"> 订单日期 : { { formatDate ( printData . ordDate ) } } < / span >
< span style = "margin-left:20px;width: 150px" > 供应商 : { { printData . supplierName } } < / span >
< span style = "margin-left:20px;width: 150px" > 供应商 : { { printData . supplierName } } < / span >
< / div >
< / div >
< div style = "display: flex;" >
< div style = "display: flex;" >
< span style = "margin-left:20px;width: 1 0 0px"> 联系人 : { { printData . contactName } } < / span >
< span style = "margin-left:20px;width: 1 1 0px"> 联系人 : { { printData . contactName } } < / span >
< span style = "margin-left:20px;width: 150px" > 电话 : { { printData . contactMobile } } < / span >
< span style = "margin-left:20px;width: 150px" > 电话 : { { printData . contactMobile } } < / span >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< table class = "print-table" >
< table class = "print-table" >
< colgroup >
< col style = "width: 19%;" / >
< col style = "width: 25%;" / >
< col style = "width: 8%;" / >
< col style = "width: 8%;" / >
< col style = "width: 7%;" / >
< col style = "width: 8%;" / >
< col style = "width: 9%;" / >
< col style = "width: 9%;" / >
< col style = "width: 7%;" / >
< / colgroup >
< thead >
< thead >
< tr >
< tr >
< th > 子项目编号 < / th >
< th > 子项目编号 < / th >
@ -105,26 +116,27 @@
< / tr >
< / tr >
< / thead >
< / thead >
< tbody >
< tbody >
< tr v-for ="(item, index) in printData.purchaseOrderNoDetailList" :key ="index" >
< tr v-for ="(item, index) in 17" :key ="index" >
< td > { { item . projectSubCode } } < / td >
< td > { { printData . purchaseOrderNoDetailList [ index ] ? . projectSubCode || '' } } < / td >
< td > { { item . boomName } } < / td >
< td > { { printData . purchaseOrderNoDetailList [ index ] ? . boomName ? limitTo20Chars ( printData . purchaseOrderNoDetailList [ index ] . boomName ) : '' } } < / td >
< td > { { item . matCode } } < / td >
< td > { { printData . purchaseOrderNoDetailList [ index ] ? . matCode || '' } } < / td >
< td > { { item . compositionName } } < / td >
< td > { { printData . purchaseOrderNoDetailList [ index ] ? . compositionName || '' } } < / td >
< td > { { item . purchaseAmount } } < / td >
< td > { { printData . purchaseOrderNoDetailList [ index ] ? . purchaseAmount || '' } } < / td >
< td > { { item . boomSpec } } < / td >
< td > { { printData . purchaseOrderNoDetailList [ index ] ? . boomSpec || '' } } < / td >
< td > { { formatDate ( item . requireTime ) } } < / td >
< td > { { printData . purchaseOrderNoDetailList [ index ] ? . requireTime ? formatDate ( printData . purchaseOrderNoDetailList [ index ] . requireTime ) : '' } } < / td >
< td > { { formatDate ( item . arriveTime ) } } < / td >
< td > { { printData . purchaseOrderNoDetailList [ index ] ? . arriveTime ? formatDate ( printData . purchaseOrderNoDetailList [ index ] . arriveTime ) : '' } } < / td >
< td > { { item . estimatedPrice } } < / td >
< td > { { printData . purchaseOrderNoDetailList [ index ] ? . estimatedPrice || '' } } < / td >
< / tr >
< / tr >
< / tbody >
< / tbody >
< / table >
< / table >
< div class = "order-info" style = "margin-top: 10px;border-bottom: 1px solid #ccc;padding-bottom: 10px;" >
< div class = "order-info" style = "margin-top: 10px;border-bottom: 1px solid #ccc;padding-bottom: 10px;" >
< div style = "display: flex;" >
< div style = "display: flex;" >
< span > 交货地址 : </ span >
< span > 交货地址 : {{ printData . deliveryAddress } } </ span >
< / div >
< / div >
< div style = "display: flex; padding-right: 10%;" >
< div style = "display: flex; padding-right: 10%;" >
< span style = "margin-left:20px;width: 8 0px"> 邮编 : < / span >
< span style = "margin-left:20px;width: 10 0px"> 邮编 : { { printData . postalCode } } < / span >
< span style = "margin-left:20px;width: 150px" > 接收人 : { { printData . username } } < / span >
< span style = "margin-left:20px;width: 150px" > 接收人 : { { printData . username } } < / span >
< span style = "margin-left:20px;width: 150px" > 电话 : { { printData . userMobile } } < / span >
< span style = "margin-left:20px;width: 150px" > 电话 : { { printData . userMobile } } < / span >
< / div >
< / div >
@ -133,7 +145,7 @@
< div class = "stamp-info" style = "display: flex;justify-content: space-between;" >
< div class = "stamp-info" style = "display: flex;justify-content: space-between;" >
< div style = "display: flex;flex-direction: column;" >
< div style = "display: flex;flex-direction: column;" >
< span > 买方 : </ span >
< span > 买方 : {{ printData . buyer } } </ span >
< span style = "margin-top: 20px;" > 签字 / 盖章 < / span >
< span style = "margin-top: 20px;" > 签字 / 盖章 < / span >
< / div >
< / div >
@ -281,7 +293,7 @@ function doPrint() {
body {
body {
font - family : Arial , sans - serif ;
font - family : Arial , sans - serif ;
margin : 10 px ;
margin : 10 px ;
font - size : 1 4 px ;
font - size : 1 2 px ;
}
}
. print - content {
. print - content {
width : 100 % ;
width : 100 % ;
@ -316,6 +328,8 @@ function doPrint() {
border : 1 px solid # ddd ;
border : 1 px solid # ddd ;
padding : 5 px ;
padding : 5 px ;
text - align : center ;
text - align : center ;
height : 20 px ; /* 设置固定高度 */
line - height : 20 px ; /* 垂直居中 */
}
}
. print - table th {
. print - table th {
background - color : # f5f5f5 ;
background - color : # f5f5f5 ;
@ -344,6 +358,11 @@ function doPrint() {
}
}
}
}
function limitTo20Chars ( input ) {
if ( typeof input !== 'string' ) return '' ;
return input . length > 20 ? input . slice ( 0 , 20 ) : input ;
}
const printLoading = ref ( false )
const printLoading = ref ( false )
const isPrint = async ( ) => {
const isPrint = async ( ) => {
@ -434,6 +453,8 @@ const getList = async () => {
padding : 6 px 8 px ;
padding : 6 px 8 px ;
text - align : center ;
text - align : center ;
font - size : 13 px ! important ;
font - size : 13 px ! important ;
height : 30 px ; /* 设置固定高度 */
line - height : 30 px ; /* 垂直居中 */
}
}