Browse Source

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

pull/1/head
test 3 months ago
parent
commit
2c3c3c4079
  1. 67
      src/hybrid/html/purchaseReceiptJob.html
  2. 172
      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>

172
src/pages/pointPutawayJob/index.vue

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