|
@ -19,39 +19,43 @@ |
|
|
<view class="label">包装号</view> |
|
|
<view class="label">包装号</view> |
|
|
<view class="value">{{ item.packageCode }}</view> |
|
|
<view class="value">{{ item.packageCode }}</view> |
|
|
</view> |
|
|
</view> |
|
|
|
|
|
<view class="left-item" v-if="item.productionLineCode&&item.productionLineCode.length>0"> |
|
|
|
|
|
<view class="label">生产线</view> |
|
|
|
|
|
<view class="value">{{item.productionLineCode}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="left-item" v-if="!(item.productionLineCode&&item.productionLineCode.length>0)"> |
|
|
|
|
|
<view class="label">父包装号</view> |
|
|
|
|
|
<view class="value">{{item.parentNumber}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="left-item" v-if="!(item.productionLineCode&&item.productionLineCode.length>0)"> |
|
|
|
|
|
<view class="label">ASN</view> |
|
|
|
|
|
<view class="value">{{item.asnNumber}}</view> |
|
|
|
|
|
</view> |
|
|
<view class="left-item"> |
|
|
<view class="left-item"> |
|
|
<view class="label">父包装号</view> |
|
|
<view class="label">数量</view> |
|
|
<view class="value">{{item.parentNumber}}</view> |
|
|
<view class="value bold-font">{{item.qty}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="left-item"> |
|
|
|
|
|
<view class="label">ASN</view> |
|
|
|
|
|
<view class="value">{{item.asnNumber}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
<view class="left-item"> |
|
|
|
|
|
<view class="label">数量</view> |
|
|
|
|
|
<view class="value bold-font">{{item.qty}}</view> |
|
|
|
|
|
</view> |
|
|
|
|
|
</view> |
|
|
</view> |
|
|
<view class="right"> |
|
|
<view class="right"> |
|
|
<view class="image"> |
|
|
<view class="image"> |
|
|
<l-qrcode ref="qrcodeRef" :value="item.barcodeString" size="300rpx"></l-qrcode> |
|
|
<l-qrcode ref="qrcodeRef" :value="item.barcodeString" size="300rpx"></l-qrcode> |
|
|
</view> |
|
|
</view> |
|
|
<view class="left-item"> |
|
|
<view class="left-item"> |
|
|
<view class="label">批次</view> |
|
|
<view class="label">批次</view> |
|
|
<view class="value">{{item.batch}}</view> |
|
|
<view class="value">{{item.batch}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="left-item"> |
|
|
<view class="left-item"> |
|
|
<view class="label">物料类型</view> |
|
|
<view class="label">物料类型</view> |
|
|
<view class="value">{{item.itemType}}</view> |
|
|
<view class="value">{{item.itemType}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="left-item"> |
|
|
<view class="left-item" v-if="!(item.productionLineCode&&item.productionLineCode.length>0)"> |
|
|
<view class="label">供应商</view> |
|
|
<view class="label">供应商</view> |
|
|
<view class="value">{{item.supplierCode}}</view> |
|
|
<view class="value">{{item.supplierCode}}</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="left-item"> |
|
|
<view class="left-item"> |
|
|
<view class="label">打印时间</view> |
|
|
<view class="label">打印时间</view> |
|
|
<view class="value">{{item.printTimes}}</view> |
|
|
<view class="value">{{item.printTimes}}</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
</view> |
|
|
<view class="" style="position: fixed; width: 100%; bottom: 0rpx; left: 0px"> |
|
|
<view class="" style="position: fixed; width: 100%; bottom: 0rpx; left: 0px"> |
|
@ -74,7 +78,7 @@ |
|
|
const data = ref([]) |
|
|
const data = ref([]) |
|
|
const newHtmlContent = ref('') // 打印传入的html |
|
|
const newHtmlContent = ref('') // 打印传入的html |
|
|
const isLoadFinish = ref(false) |
|
|
const isLoadFinish = ref(false) |
|
|
const qrcodeRef =ref() |
|
|
const qrcodeRef = ref() |
|
|
// #ifdef APP |
|
|
// #ifdef APP |
|
|
// 打印 |
|
|
// 打印 |
|
|
const printImage = () => { |
|
|
const printImage = () => { |
|
@ -114,59 +118,80 @@ |
|
|
readFile(htmlFileUrl, (htmlContent) => { |
|
|
readFile(htmlFileUrl, (htmlContent) => { |
|
|
newHtmlContent.value = htmlContent |
|
|
newHtmlContent.value = htmlContent |
|
|
data.value.forEach((item) => { |
|
|
data.value.forEach((item) => { |
|
|
str += `<div class="box" style="page-break-before:always;"><br /> |
|
|
str += ` |
|
|
<div class="left"> |
|
|
<div class="box" style="page-break-before:always;"><br /> |
|
|
<div class="left-item"> |
|
|
<div class="left"> |
|
|
<div class="label">物品代码</div> |
|
|
<div class="left-item"> |
|
|
<div class="value bold-font" id="name1">${item.itemCode}</div> |
|
|
<div class="label">物品代码</div> |
|
|
</div> |
|
|
<div class="value bold-font" id="name1">${item.itemCode}</div> |
|
|
<div class="left-item"> |
|
|
</div> |
|
|
<div class="label">物品名称</div> |
|
|
<div class="left-item"> |
|
|
<div class="value" id="name2">${item.itemName}</div> |
|
|
<div class="label">物品名称</div> |
|
|
</div> |
|
|
<div class="value" id="name2">${item.itemName}</div> |
|
|
<div class="left-item"> |
|
|
</div> |
|
|
<div class="label">包装名称</div> |
|
|
<div class="left-item"> |
|
|
<div class="value">${item.packName}</div> |
|
|
<div class="label">包装名称</div> |
|
|
</div> |
|
|
<div class="value">${item.packName}</div> |
|
|
<div class="left-item"> |
|
|
</div> |
|
|
<div class="label">包装号</div> |
|
|
<div class="left-item"> |
|
|
<div class="value">${item.packageCode}</div> |
|
|
<div class="label">包装号</div> |
|
|
</div> |
|
|
<div class="value">${item.packageCode}</div> |
|
|
<div class="left-item"> |
|
|
</div> |
|
|
<div class="label">父包装号</div> |
|
|
` |
|
|
<div class="value">${item.parentNumber}</div> |
|
|
if (item.productionLineCode && item.productionLineCode.length > 0) { |
|
|
</div> |
|
|
str += ` |
|
|
<div class="left-item"> |
|
|
<div class="left-item"> |
|
|
<div class="label">ASN</div> |
|
|
<div class="label">生产线</div> |
|
|
<div class="value">${item.asnNumber}</div> |
|
|
<div class="value">${item.productionLineCode}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="left-item"> |
|
|
` |
|
|
<div class="label">数量</div> |
|
|
} else { |
|
|
<div class="value bold-font">${item.qty}</div> |
|
|
str += ` |
|
|
</div> |
|
|
<div class="left-item"> |
|
|
</div> |
|
|
<div class="label">父包装号</div> |
|
|
<div class="right"> |
|
|
<div class="value">${item.parentNumber}</div> |
|
|
<div class="image"> |
|
|
</div> |
|
|
<img id='image1' src="${item.barcodeBase64}" alt="" /> |
|
|
<div class="left-item"> |
|
|
</div> |
|
|
<div class="label">ASN</div> |
|
|
<div class="left-item"> |
|
|
<div class="value">${item.asnNumber}</div> |
|
|
<div class="label">批次</div> |
|
|
</div> |
|
|
<div class="value">${item.batch}</div> |
|
|
` |
|
|
</div> |
|
|
} |
|
|
<div class="left-item"> |
|
|
str += ` |
|
|
<div class="label">物料类型</div> |
|
|
<div class="left-item"> |
|
|
<div class="value">${item.itemType}</div> |
|
|
<div class="label">数量</div> |
|
|
</div> |
|
|
<div class="value bold-font">${item.qty}</div> |
|
|
<div class="left-item"> |
|
|
</div> |
|
|
<div class="label">供应商</div> |
|
|
</div> |
|
|
<div class="value">${item.supplierCode}</div> |
|
|
<div class="right"> |
|
|
</div> |
|
|
<div class="image"> |
|
|
<div class="left-item"> |
|
|
<img id='image1' src="${item.barcodeBase64}" alt="" /> |
|
|
<div class="label">打印时间</div> |
|
|
</div> |
|
|
<div class="value">${item.printTimes}</div> |
|
|
<div class="left-item"> |
|
|
</div> |
|
|
<div class="label">批次</div> |
|
|
</div> |
|
|
<div class="value">${item.batch}</div> |
|
|
</div>` |
|
|
</div> |
|
|
|
|
|
<div class="left-item"> |
|
|
|
|
|
<div class="label">物料类型</div> |
|
|
|
|
|
<div class="value">${item.itemType}</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
` |
|
|
|
|
|
if (!(item.productionLineCode && item.productionLineCode.length > 0)) { |
|
|
|
|
|
str += ` |
|
|
|
|
|
<div class="left-item"> |
|
|
|
|
|
<div class="label">供应商</div> |
|
|
|
|
|
<div class="value">${item.supplierCode}</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
` |
|
|
|
|
|
} |
|
|
|
|
|
str += ` |
|
|
|
|
|
<div class="left-item"> |
|
|
|
|
|
<div class="label">打印时间</div> |
|
|
|
|
|
<div class="value">${item.printTimes}</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
` |
|
|
}) |
|
|
}) |
|
|
newHtmlContent.value = newHtmlContent.value.replace('mainBody', str) // 替换物品代码 |
|
|
newHtmlContent.value = newHtmlContent.value.replace('mainBody', str) // 替换物品代码 |
|
|
}) |
|
|
}) |
|
@ -258,10 +283,12 @@ |
|
|
.left-item { |
|
|
.left-item { |
|
|
display: flex; |
|
|
display: flex; |
|
|
} |
|
|
} |
|
|
.bold-font{ |
|
|
|
|
|
|
|
|
.bold-font { |
|
|
font-weight: bold; |
|
|
font-weight: bold; |
|
|
font-size: 28rpx; |
|
|
font-size: 28rpx; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
.label { |
|
|
.label { |
|
|
border-bottom: 1px solid #b1b1b1; |
|
|
border-bottom: 1px solid #b1b1b1; |
|
|
border-right: 1px solid #b1b1b1; |
|
|
border-right: 1px solid #b1b1b1; |
|
|