Browse Source

采购收货打印添加字段,修改页面样式 2024/8/9

pull/1/head
test 3 months ago
parent
commit
2c3c3c4079
  1. 67
      src/hybrid/html/purchaseReceiptJob.html
  2. 150
      src/pages/pointPutawayJob/index.vue

67
src/hybrid/html/purchaseReceiptJob.html

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title></title>
<script src="../../api/img-to-base64.js"></script>
<script type="text/javascript">
document.addEventListener('plusready', function() {
//console.log("所有plus api都应该在此事件发生后调用,否则会出现plus is undefined。")
});
</script>
<style>
.box {
font-size: 13px;
/* padding: 10px; */
/* border: 1px solid #dedede; */
}
.left {
flex: 1;
border-bottom: 1px solid #b1b1b1;
}
.left-item {
display: flex;
border-top: 1px solid #b1b1b1;
border-left: 1px solid #b1b1b1;
border-right: 1px solid #b1b1b1;
}
.left-item div{
padding: 10px 10px;
font-size: 16px;
}
.left-item .label{
width: 100px;
padding: 10px 10px;
border-right: 1px solid #b1b1b1;
}
.relative {
margin-bottom: 10px;
position: relative;
}
.q {
position: absolute;
font-size: 15rem;
color: rgba(0, 0, 0, 0.1);
width: calc(100% - 100px);
right: 0px;
top: 0px;
text-align: center;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
</style>
</head>
<body>
mainBody
</body>
</html>

150
src/pages/pointPutawayJob/index.vue

@ -7,23 +7,32 @@
</view> </view>
<view class="" :style="{'paddingTop':isHaveOn && data1 && data1.inspectDTOList && data1.inspectDTOList.length>0?'100rpx': '30rpx'}"> <view class="" :style="{'paddingTop':isHaveOn && data1 && data1.inspectDTOList && data1.inspectDTOList.length>0?'100rpx': '30rpx'}">
<view class="box" style="page-break-before:always;" v-if="tabIndex == 1"> <view class="box" style="page-break-before:always;" v-if="tabIndex == 1">
<view class=""> <view class="relative" v-for="(item,index) in showTableInspectDTOList" :key='index'>
<view class="q">Q</view>
<table border='1'> <table border='1'>
<thead> <thead>
<tr class='top1'> <tr class='top1'>
<th>发货单号:</th> <th>物料代码:</th>
<th colspan='2'>{{data1.asnNumber}}</th> <th colspan='3'>{{item.itemCode}}</th>
</tr>
<tr>
<th>物料代码</th>
<th>供应商批次</th>
<th>检验数量</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="(item,index) in showTableInspectDTOList" :key='index'> <tr>
<td>{{item.itemCode}}</td> <td>物料名称</td>
<td>{{item.itemName}}</td>
<td>发货单号</td>
<td>{{data1.asnNumber}}</td>
</tr>
<tr>
<td>供应商</td>
<td>{{item.supplierCode}}</td>
<td>批次</td>
<td>{{item.supplierBatch}}</td> <td>{{item.supplierBatch}}</td>
</tr>
<tr>
<td>到货数量</td>
<td>{{item.quantityQty}}</td>
<td>抽检数量</td>
<td>{{item.sampleQty}}</td> <td>{{item.sampleQty}}</td>
</tr> </tr>
</tbody> </tbody>
@ -34,7 +43,7 @@
<com-empty-view v-if="data.length==0"></com-empty-view> <com-empty-view v-if="data.length==0"></com-empty-view>
<!-- 只用于展示页面 --> <!-- 只用于展示页面 -->
<view class="" v-if="tabIndex == 2"> <view class="" v-if="tabIndex == 2">
<view class="box" style="margin-bottom: 20rpx;" v-for='(item,index) in showTableSubList' :key='index'> <view class="box1" style="margin-bottom: 20rpx;" v-for='(item,index) in showTableSubList' :key='index'>
<view class="top"> <view class="top">
<view class="mb-kw"> <view class="mb-kw">
目标库位<view>{{item.toLocationCode}}</view> 目标库位<view>{{item.toLocationCode}}</view>
@ -105,11 +114,11 @@ export default {
currentPage: 1, currentPage: 1,
pageSize: 3, pageSize: 3,
showTableSubList: [], showTableSubList: [],
showTableInspectDTOList:[], showTableInspectDTOList: [],
currentPage1: 1, currentPage1: 1,
pageSize1: 20, pageSize1: 20,
number:'', number: '',
isHaveOn: false,// isHaveOn: false,//
// isHaveInspect:false,// // isHaveInspect:false,//
} }
@ -127,17 +136,17 @@ export default {
}, },
// html // html
readFile(path, callback) { readFile(path, callback) {
plus.io.resolveLocalFileSystemURL(path, function(entry) { plus.io.resolveLocalFileSystemURL(path, function (entry) {
entry.file(function(file) { entry.file(function (file) {
var reader = new plus.io.FileReader(); var reader = new plus.io.FileReader();
reader.onloadend = function(e) { reader.onloadend = function (e) {
callback(e.target.result); callback(e.target.result);
}; };
reader.readAsText(file); reader.readAsText(file);
}, function(e) { }, function (e) {
console.log("读取文件失败:" + e.message); console.log("读取文件失败:" + e.message);
}); });
}, function(e) { }, function (e) {
console.log("获取图片资源失败:" + e.message); console.log("获取图片资源失败:" + e.message);
}); });
}, },
@ -160,7 +169,7 @@ export default {
<div class="mb-bo"> <div class="mb-bo">
<div class="mb-left"> <div class="mb-left">
<div class="mb-text"> <div class="mb-text">
物料号<div>${item.itemCode}</div> 物料号<div>${item.itemCode}asjkdhfksjahfkljashfklsdh</div>
</div> </div>
<div class="mb-text"> <div class="mb-text">
托包装号<div>${item.packingNumber}</div> 托包装号<div>${item.packingNumber}</div>
@ -184,44 +193,48 @@ export default {
// html // html
getPurchaseReceiptJobHtml() { getPurchaseReceiptJobHtml() {
this.$nextTick(async () => { this.$nextTick(async () => {
let str2 = '' let str = ''
this.readFile(htmlFileUrl1, (htmlContent) => { this.readFile(htmlFileUrl1, (htmlContent) => {
this.newHtmlContent1 = htmlContent this.newHtmlContent1 = htmlContent
str2 = `<div class="box" style="page-break-before:always;" ><br /> this.data1.inspectDTOList.forEach(item => {
<div class=""> str += `
<div class="box" style="page-break-before:always;"><br />
<div class="relative" >
<div class="q">Q</div>
<table border='1'> <table border='1'>
<thead> <thead>
<tr class='top'> <tr class='top1'>
<th>发货单号:</th> <th>物料代码:</th>
<th colspan='2'>${this.data1.asnNumber}</th> <th colspan='3'>${item.itemCode}</th>
</tr>
<tr>
<th>物料代码</th>
<th>供应商批次</th>
<th>检验数量</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
strBody
</tbody>
</table>
</div>
</div>
`
let str1 = ''
this.data1.inspectDTOList.forEach(item => {
str1 += `
<tr> <tr>
<td>${item.itemCode}</td> <td>物料名称</td>
<td>${item.itemName}</td>
<td>发货单号</td>
<td>${this.data1.asnNumber}</td>
</tr>
<tr>
<td>供应商</td>
<td>${item.supplierCode}</td>
<td>批次</td>
<td>${item.supplierBatch}</td> <td>${item.supplierBatch}</td>
</tr>
<tr>
<td>到货数量</td>
<td>${item.quantityQty}</td>
<td>抽检数量</td>
<td>${item.sampleQty}</td> <td>${item.sampleQty}</td>
</tr> </tr>
</tbody>
</table>
</div>
</div>
` `
}) })
str2 = str2.replace("strBody", str1)
console.log(335, str1)
this.newHtmlContent1 = this.newHtmlContent1.replace( this.newHtmlContent1 = this.newHtmlContent1.replace(
"mainBody", str2); // "mainBody", str); //
}); });
}) })
@ -232,7 +245,7 @@ export default {
(this.currentPage - 1) * this.pageSize, (this.currentPage - 1) * this.pageSize,
this.currentPage * this.pageSize this.currentPage * this.pageSize
) )
if(array.length>0){ if (array.length > 0) {
this.showTableSubList = [...this.showTableSubList, ...array] this.showTableSubList = [...this.showTableSubList, ...array]
this.currentPage += 1 this.currentPage += 1
} }
@ -247,14 +260,14 @@ export default {
(this.currentPage1 - 1) * this.pageSize1, (this.currentPage1 - 1) * this.pageSize1,
this.currentPage1 * this.pageSize1 this.currentPage1 * this.pageSize1
) )
if(array.length>0){ if (array.length > 0) {
this.showTableInspectDTOList = [...this.showTableInspectDTOList, ...array] this.showTableInspectDTOList = [...this.showTableInspectDTOList, ...array]
this.currentPage1 += 1 this.currentPage1 += 1
} }
} else { } else {
this.showTableInspectDTOList = this.data1.inspectDTOList this.showTableInspectDTOList = this.data1.inspectDTOList
} }
console.log(233,this.showTableInspectDTOList) console.log(233, this.showTableInspectDTOList)
} }
}, },
watch: { watch: {
@ -280,7 +293,7 @@ export default {
}, },
async onShow() { async onShow() {
// //
if(this.data.ids){ if (this.data.ids) {
await getJimuPutawayJobDetail({ await getJimuPutawayJobDetail({
masterIds: this.data.ids masterIds: this.data.ids
}).then(res => { }).then(res => {
@ -289,29 +302,30 @@ export default {
}) })
} }
// //
if(this.number){ if (this.number) {
await queryInspectionFreeFlag({ await queryInspectionFreeFlag({
number: this.number number: this.number
}).then(async res1 => { }).then(async res1 => {
this.data1 = res1.data this.data1 = res1.data
this.data1.inspectDTOList = this.data1.inspectDTOList.filter(item=>item.sampleQty>0) this.data1.inspectDTOList = this.data1.inspectDTOList.filter(item => item.sampleQty > 0)
// this.data1.inspectDTOList=[] // this.data1.inspectDTOList=[]
if(this.data1&&this.data1.inspectDTOList&&this.data1.inspectDTOList.length == 0){ if (this.data1 && this.data1.inspectDTOList && this.data1.inspectDTOList.length == 0) {
this.tabIndex =2 this.tabIndex = 2
} }
this.getTableInspectDTOList() this.getTableInspectDTOList()
}) })
} }
this.getPointPutawayJobHtml() this.getPointPutawayJobHtml()
this.getPurchaseReceiptJobHtml() this.getPurchaseReceiptJobHtml()
}, },
onReachBottom() { onReachBottom() {
if(this.tabIndex == 1){ if (this.tabIndex == 1) {
if(this.showTableInspectDTOList.length!=this.data1.inspectDTOList.length){ if (this.showTableInspectDTOList != this.data1.inspectDTOList.length) {
this.getTableInspectDTOList() this.getTableInspectDTOList()
} }
}else{ } else {
if(this.showTableSubList.length!=this.data.sublist.length){ if (this.showTableSubList.length != this.data.sublist.length) {
this.getTableSubList() this.getTableSubList()
} }
} }
@ -322,7 +336,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
.box { .box1 {
font-size: 26rpx; font-size: 26rpx;
/* display: flex; */ /* display: flex; */
/* padding: 20rpx; */ /* padding: 20rpx; */
@ -438,7 +452,7 @@ export default {
.top1 th { .top1 th {
font-weight: bold; font-weight: bold;
font-size: 16px; font-size: 13px;
padding: 10px; padding: 10px;
} }
@ -458,6 +472,14 @@ th {
td { td {
padding: 10px; padding: 10px;
&:nth-child(2n) {
width: 290rpx;
}
&:nth-child(2n+1) {
width: 160rpx;
}
} }
.tabs-box { .tabs-box {
@ -483,4 +505,18 @@ td {
border-bottom: 4rpx solid rgb(60, 156, 255); border-bottom: 4rpx solid rgb(60, 156, 255);
} }
} }
.relative {
margin-bottom: 20rpx;
position: relative;
}
.q {
position: absolute;
left: 50%;
top: 50%;
font-size: 400rpx;
transform: translate(-50%, -50%);
color: rgba(0, 0, 0, 0.1);
}
</style> </style>
Loading…
Cancel
Save