Browse Source

检验打印单提示变添加没有检验方案和检验阶段不存在

ljc_0803
zhang_li 1 month ago
parent
commit
1a1c9874a2
  1. 200
      src/pages/pointPutawayJob/index.vue

200
src/pages/pointPutawayJob/index.vue

@ -5,10 +5,11 @@
<view @click="tabIndex = 1" :class="tabIndex == 1?'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 @click="tabIndex = 2" :class="tabIndex == 2?'active1' :''" style="padding: 10rpx 0px;">上架指引单</view>
</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="relative" v-for="(item,index) in showTableInspectDTOList" :key='index'> <view class="relative" v-for="(item,index) in showTableInspectDTOList" :key='index'>
<view class="q">Q</view> <view class="q">Q</view>
<table border='1'> <table border='1'>
<thead> <thead>
<tr class='top1'> <tr class='top1'>
@ -35,8 +36,14 @@
<td>抽检数量</td> <td>抽检数量</td>
<td>{{item.sampleQty}}</td> <td>{{item.sampleQty}}</td>
</tr> </tr>
<tr v-if="!item.haveInspectionRequest"> <tr v-if="item.haveInspectionRequest==='0'">
<td colspan='4' style="color:#ff0000;font-weight: bold;font-size: 15px;">未生成检验申请</td> <td colspan='4' style="color:#ff0000;font-weight: bold;font-size: 15px;">未生成检验申请</td>
</tr>
<tr v-else-if="item.haveInspectionRequest==='2'">
<td colspan='4' style="color:#ffab01;font-weight: bold;font-size: 15px;">没有检验方案</td>
</tr>
<tr v-else-if="item.haveInspectionRequest==='3'">
<td colspan='4' style="color:#258eff;font-weight: bold;font-size: 15px;">检验阶段不存在</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -123,7 +130,7 @@
currentPage1: 1, currentPage1: 1,
pageSize1: 20, pageSize1: 20,
number: '', number: '',
isHaveOn: false,// isHaveOn: false, //
// isHaveInspect:false,// // isHaveInspect:false,//
} }
}, },
@ -201,83 +208,52 @@
this.readFile(htmlFileUrl1, (htmlContent) => { this.readFile(htmlFileUrl1, (htmlContent) => {
this.newHtmlContent1 = htmlContent this.newHtmlContent1 = htmlContent
this.data1.inspectDTOList.forEach(item => { this.data1.inspectDTOList.forEach(item => {
if(!item.haveInspectionRequest){ let str1 = `
str += ` <div class="box" style="page-break-before:always;"><br />
<div class="box" style="page-break-before:always;"><br /> <div class="relative" >
<div class="relative" > <div class="q">Q</div>
<div class="q">Q</div> <table border='1'>
<table border='1'> <thead>
<thead> <tr class='top1'>
<tr class='top1'> <th>物料代码:</th>
<th>物料代码:</th> <th colspan='3'>${item.itemCode}</th>
<th colspan='3'>${item.itemCode}</th> </tr>
</tr> </thead>
</thead> <tbody>
<tbody> <tr>
<tr> <td>物料名称</td>
<td>物料名称</td> <td>${item.itemName}</td>
<td>${item.itemName}</td> <td>发货单号</td>
<td>发货单号</td> <td>${this.data1.asnNumber}</td>
<td>${this.data1.asnNumber}</td> </tr>
</tr> <tr>
<tr> <td>供应商</td>
<td>供应商</td> <td>${item.supplierCode}</td>
<td>${item.supplierCode}</td> <td>供应商批次</td>
<td>供应商批次</td> <td>${item.supplierBatch}</td>
<td>${item.supplierBatch}</td> </tr>
</tr> <tr>
<tr> <td>到货数量</td>
<td>到货数量</td> <td>${item.quantityQty}</td>
<td>${item.quantityQty}</td> <td>抽检数量</td>
<td>抽检数量</td> <td>${item.sampleQty}</td>
<td>${item.sampleQty}</td> </tr>
</tr> `
<tr> let str2 = ``
<td colspan='4' style="color:#ff0000;font-weight: bold;font-size: 15px;">未生成检验申请</td> if(item.haveInspectionRequest==='0'){
</tr> str2 =`<tr><td colspan='4' style="color:#ff0000;font-weight: bold;font-size: 15px;">未生成检验申请</td></tr>`
</tbody> }else if(item.haveInspectionRequest==='2'){
</table> str2 =`<tr><td colspan='4' style="color:#ffab01;font-weight: bold;font-size: 15px;">没有检验方案</td></tr>`
</div> }else if(item.haveInspectionRequest==='3'){
</div> str2 =`<tr><td colspan='4' style="color:#258eff;font-weight: bold;font-size: 15px;">检验阶段不存在</td></tr>`
`
}else{
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>
`
} }
let str3 = `
</tbody>
</table>
</div>
</div>
`
str += str1 + str2+ str3
}) })
this.newHtmlContent1 = this.newHtmlContent1.replace( this.newHtmlContent1 = this.newHtmlContent1.replace(
"mainBody", str); // "mainBody", str); //
@ -318,7 +294,7 @@
showMessage(message) { showMessage(message) {
this.$refs.comMessage.showMessage(message, res => { this.$refs.comMessage.showMessage(message, res => {
if (res) { if (res) {
} }
}); });
}, },
@ -346,7 +322,7 @@
}, },
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 => {
@ -355,27 +331,26 @@
}) })
} }
// //
if(this.number){ if (this.number) {
await queryInspectionFreeFlag({ await queryInspectionFreeFlag({
number: this.number number: this.number
}).then(async res1 => { }).then(async res1 => {
console.log(444,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) 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()
})
.catch(error=>{
this.$refs.comMessage.showMessage(error, res => {
if (res) {
} }
}); this.getTableInspectDTOList()
}) })
.catch(error => {
this.$refs.comMessage.showMessage(error, res => {
if (res) {
}
});
})
} }
this.getPointPutawayJobHtml() this.getPointPutawayJobHtml()
this.getPurchaseReceiptJobHtml() this.getPurchaseReceiptJobHtml()
}, },
@ -531,11 +506,13 @@
td { td {
padding: 10px; padding: 10px;
&:nth-child(2n){
width:290rpx; &:nth-child(2n) {
width: 290rpx;
} }
&:nth-child(2n+1){
width:160rpx; &:nth-child(2n+1) {
width: 160rpx;
} }
} }
@ -563,17 +540,18 @@
border-bottom: 4rpx solid rgb(60, 156, 255); border-bottom: 4rpx solid rgb(60, 156, 255);
} }
} }
.relative{
.relative {
margin-bottom: 20rpx; margin-bottom: 20rpx;
position: relative; position: relative;
} }
.q{ .q {
position: absolute; position: absolute;
left: 50%; left: 50%;
top:50%; top: 50%;
font-size: 400rpx; font-size: 400rpx;
transform: translate(-50% ,-50%); transform: translate(-50%, -50%);
color: rgba(0, 0, 0, 0.1); color: rgba(0, 0, 0, 0.1);
} }
</style> </style>
Loading…
Cancel
Save