|
@@ -161,6 +161,49 @@ export default {
|
|
|
// LODOP.PRINT_DESIGN();
|
|
|
// LODOP.PREVIEW();
|
|
|
},
|
|
|
+ createHTML(){
|
|
|
+ let html = `<div id="form1">
|
|
|
+ <div style="font-size: 20px;font-weight: bold;text-align: center;">#${printInfo.daySeq}${printInfo.orderSource}${num === 1 ? '(顾客联)' : num === 2 ? '(商家联)' : ''}</div>
|
|
|
+ <div style="font-size: 12px;text-align: center;margin:5px 0;">${printInfo.shopName}</div>
|
|
|
+ <div style="font-size: 16px;font-weight: bold;text-align: center;">${printInfo.deliveryTime === '0' ? '立即送达' : '期望' + printInfo.deliveryTime}</div>
|
|
|
+ <div v-if="pageWidth === 1" style="text-align: center;">${pageWidth ===1 ? '------------------------------------' : '----------------------------------------'}</div>
|
|
|
+ <div style="font-size: 13px;margin-bottom:5px;">下单时间:{{printInfo.createTime}}</div>
|
|
|
+ <div style="font-size: 13px;">订单编号:{{printInfo.outOrderId}}</div>
|
|
|
+ <div v-if="pageWidth === 1" style="text-align: center;">---------------商品-------------</div>
|
|
|
+ <div v-if="pageWidth === 2" style="text-align: center;">------------------商品----------------</div>
|
|
|
+ <div style="font-size: 18px; display: flex;flex-wrap:wrap;justify-content:space-between;" v-for="(v,i) in printInfo.orderGoodsDtoList" :key="i">
|
|
|
+ <div>{{v.foodName}}</div>
|
|
|
+ <div style="width:100%;text-align:right"><span style="margin-right:20px;">x{{v.quantity}}</span><span>{{v.price}}</span></div>
|
|
|
+ </div>
|
|
|
+ <div v-if="(printInfo.taxpayerId || printInfo.invoiceTitle) && num !== 3 && pageWidth === 1" style="margin-top: 5px; text-align: center;">---------------发票-------------</div>
|
|
|
+ <div v-if="(printInfo.taxpayerId || printInfo.invoiceTitle) && num !== 3 && pageWidth === 2" style="margin-top: 5px; text-align: center;">------------------发票----------------</div>
|
|
|
+ <div v-if="printInfo.invoiceTitle && num !== 3" style="font-size: 13px;">抬头: {{printInfo.invoiceTitle}}</div>
|
|
|
+ <div v-if="printInfo.taxpayerId && num !== 3" style="font-size: 13px;">税号: {{printInfo.taxpayerId}}</div>
|
|
|
+ <div v-if="printInfo.caution && num !== 3 && pageWidth === 1" style="margin-top: 5px;text-align: center;">---------------备注-------------</div>
|
|
|
+ <div v-if="printInfo.caution && num !== 3 && pageWidth === 2" style="margin-top: 5px;text-align: center;">------------------备注----------------</div>
|
|
|
+ <div v-if="printInfo.caution && num !== 3" style="font-size: 20px;font-weight: bold;">{{printInfo.caution}}</div>
|
|
|
+ <div v-if="printInfo.caution && num === 3 && pageWidth === 1" style="text-align: center;">------------------------------------</div>
|
|
|
+ <div v-if="printInfo.caution && num === 3 && pageWidth === 2" style="text-align: center;">----------------------------------------</div>
|
|
|
+ <div v-if="printInfo.caution && num === 3" style="font-size: 20px;font-weight: bold;">备注: {{printInfo.caution}}</div>
|
|
|
+ <div v-if="num !== 3 && pageWidth === 1" style="text-align: center;">------------------------------------</div>
|
|
|
+ <div v-if="num !== 3 && pageWidth === 2" style="text-align: center;">----------------------------------------</div>
|
|
|
+ <div v-if="num !== 3" style="font-size: 12px;display:flex;justify-content: space-between;"><span>配送费:</span><span>{{Number(printInfo.deliverFee)}}元</span></div>
|
|
|
+ <div v-if="num !== 3" style="font-size: 12px;display:flex;justify-content: space-between;"><span>餐盒费:</span><span>{{Number(printInfo.boxFee)}}元</span></div>
|
|
|
+ <div v-if="num !== 3 && pageWidth === 1" style="text-align: center;">------------------------------------</div>
|
|
|
+ <div v-if="num !== 3 && pageWidth === 2" style="text-align: center;">----------------------------------------</div>
|
|
|
+ <div v-if="num !== 3" style="font-size: 12px;display:flex;justify-content: space-between;"><span>原价:</span><span>{{printInfo.originalPrice}}元</span></div>
|
|
|
+ <div v-if="num !== 3 && pageWidth === 1" style="text-align: center;">------------------------------------</div>
|
|
|
+ <div v-if="num !== 3 && pageWidth === 2" style="text-align: center;">----------------------------------------</div>
|
|
|
+ <div v-if="num !== 3" style="font-size: 20px;font-weight:bold;display:flex;justify-content: space-between;"><span>实付:</span><span>{{printInfo.totalPrice}}元</span></div>
|
|
|
+ <div v-if="pageWidth === 1" style="text-align: center;">------------------------------------</div>
|
|
|
+ <div v-if="pageWidth === 2" style="text-align: center;">----------------------------------------</div>
|
|
|
+ <div style="font-size: 20px;font-weight: bold;">地址: {{printInfo.recipientAddress}}</div>
|
|
|
+ <div v-if="num !== 3" style="font-size: 13px;">{{printInfo.recipientName}}</div>
|
|
|
+ <div v-if="num !== 3" style="font-size: 14px;">{{printInfo.recipientPhone}}</div>
|
|
|
+ <div v-if="pageWidth === 1" style="text-align: center;">---------------#{{printInfo.daySeq}}完-------------</div>
|
|
|
+ <div v-if="pageWidth === 2" style="text-align: center;">------------------#{{printInfo.daySeq}}完----------------</div>
|
|
|
+ </div>`
|
|
|
+ }
|
|
|
},
|
|
|
};
|
|
|
</script>
|