Browse Source

page/pointPutawayJob 文件迁移 8/8-10/25

pull/1/head
test 4 months ago
parent
commit
212472f628
  1. 345
      src/pages/pointPutawayJob/index.vue

345
src/pages/pointPutawayJob/index.vue

@ -5,38 +5,50 @@
<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'> <view class="left">
<thead> <view class="left-item">
<tr class='top1'> <view class="label">发货单号</view>
<th>物料代码:</th> <view>{{ data1.asnNumber }}</view>
<th colspan='3'>{{item.itemCode}}</th> </view>
</tr> <view class="left-item">
</thead> <view class="label">物料代码</view>
<tbody> <view>{{ item.itemCode }}</view>
<tr> </view>
<td>物料名称</td> <view class="left-item">
<td>{{item.itemName}}</td> <view class="label">物料名称</view>
<td>发货单号</td> <view>{{ item.itemName }}</view>
<td>{{data1.asnNumber}}</td> </view>
</tr> <view class="left-item">
<tr> <view class="label">供应商</view>
<td>供应商</td> <view>{{ item.supplierCode }}</view>
<td>{{item.supplierCode}}</td> </view>
<td>批次</td> <view class="left-item">
<td>{{item.supplierBatch}}</td> <view class="label">供应商批次</view>
</tr> <view>{{ item.supplierBatch }}</view>
<tr> </view>
<td>到货数量</td> <view class="left-item">
<td>{{item.quantityQty}}</td> <view class="label">到货数量</view>
<td>抽检数量</td> <view>{{ item.quantityQty }}</view>
<td>{{item.sampleQty}}</td> </view>
</tr> <view class="left-item">
</tbody> <view class="label">抽检数量</view>
</table> <view>{{ item.sampleQty }}</view>
</view>
<view class="left-item" v-if="item.haveInspectionRequest==='0'">
<view style="color:#ff0000;font-weight: bold;font-size: 15px;">未生成检验申请</view>
</view>
<view class="left-item" v-else-if="item.haveInspectionRequest==='2'">
<view style="color:#ffab01;font-weight: bold;font-size: 15px;">没有检验方案</view>
</view>
<view class="left-item" v-else-if="item.haveInspectionRequest==='3'">
<view style="color:#258eff;font-weight: bold;font-size: 15px;">检验阶段不存在</view>
</view>
</view>
</view> </view>
</view> </view>
</view> </view>
@ -46,20 +58,24 @@
<view class="box1" 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>
</view> </view>
<view class="mb-bo"> <view class="mb-bo">
<view class="mb-left"> <view class="mb-left">
<view class="mb-text"> <view class="mb-text">
物料号<view>{{item.itemCode}}</view> 物料号
<view>{{ item.itemCode }}</view>
</view> </view>
<view class="mb-text"> <view class="mb-text">
托包装号<view>{{item.packingNumber}}</view> 托包装号
<view>{{ item.packingNumber }}</view>
</view> </view>
</view> </view>
<view class="mb-right"> <view class="mb-right">
<view class="mb-text"> <view class="mb-text">
数量<view>{{item.qty}}{{item.uom}}</view> 数量
<view>{{ item.qty }}{{ item.uom }}</view>
</view> </view>
</view> </view>
</view> </view>
@ -75,7 +91,9 @@
style='background:rgb(60, 156, 255) !important ;color: white;margin-top: 80rpx;'> 打印上架指引单 style='background:rgb(60, 156, 255) !important ;color: white;margin-top: 80rpx;'> 打印上架指引单
</button> </button>
</view> </view>
<u-empty text="无打印数据" mode="list"
v-if="(tabIndex == 1 &&(!data1.inspectDTOList || data1.inspectDTOList && data1.inspectDTOList.length==0))||(tabIndex == 2&&isHaveOn && (!data.sublist || data.sublist.length==0))"></u-empty>
<comMessage ref="comMessage"></comMessage>
</view> </view>
</template> </template>
@ -119,23 +137,25 @@ export default {
currentPage1: 1, currentPage1: 1,
pageSize1: 20, pageSize1: 20,
number: '', number: '',
isHaveOn: false,// isHaveOn: false, //
// isHaveInspect:false,// // isHaveInspect:false,//
} }
}, },
methods: { methods: {
// #ifdef APP
// //
printImage() { printImage() {
// #ifdef APP
if (this.tabIndex == 1) { if (this.tabIndex == 1) {
testModule.doHTMLPrint(this.newHtmlContent1) testModule.doHTMLPrint(this.newHtmlContent1)
} else { } else {
testModule.doHTMLPrint(this.newHtmlContent) testModule.doHTMLPrint(this.newHtmlContent)
} }
// #endif
}, },
// html // html
readFile(path, callback) { readFile(path, callback) {
// #ifdef APP
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();
@ -149,8 +169,8 @@ export default {
}, function (e) { }, function (e) {
console.log("获取图片资源失败:" + e.message); console.log("获取图片资源失败:" + e.message);
}); });
},
// #endif // #endif
},
formatDate(val) { formatDate(val) {
return dateFormat(val) return dateFormat(val)
}, },
@ -158,6 +178,7 @@ export default {
getPointPutawayJobHtml() { getPointPutawayJobHtml() {
this.$nextTick(async () => { this.$nextTick(async () => {
let str = '' let str = ''
// #ifdef APP-PLUS
this.readFile(htmlFileUrl, (htmlContent) => { this.readFile(htmlFileUrl, (htmlContent) => {
this.newHtmlContent = htmlContent this.newHtmlContent = htmlContent
this.data.sublist.forEach(item => { this.data.sublist.forEach(item => {
@ -187,56 +208,79 @@ export default {
this.newHtmlContent = this.newHtmlContent.replace( this.newHtmlContent = this.newHtmlContent.replace(
"mainBody", str); // "mainBody", str); //
}); });
// #endif
}) })
}, },
// html // html
getPurchaseReceiptJobHtml() { getPurchaseReceiptJobHtml() {
this.$nextTick(async () => { this.$nextTick(async () => {
let str = '' let str = ''
// #ifdef APP-PLUS
this.readFile(htmlFileUrl1, (htmlContent) => { this.readFile(htmlFileUrl1, (htmlContent) => {
this.newHtmlContent1 = htmlContent this.newHtmlContent1 = htmlContent
this.data1.inspectDTOList.forEach(item => { this.data1.inspectDTOList.forEach(item => {
str += ` let str1 = `
<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'> <div class="left">
<thead> <div class="left-item">
<tr class='top1'> <div class="label">发货单号</div>
<th>物料代码:</th> <div>${this.data1.asnNumber}</div>
<th colspan='3'>${item.itemCode}</th> </div>
</tr> <div class="left-item">
</thead> <div class="label">物料代码</div>
<tbody> <div>${item.itemCode}</div>
<tr> </div>
<td>物料名称</td> <div class="left-item">
<td>${item.itemName}</td> <div class="label">物料名称</div>
<td>发货单号</td> <div>${item.itemName}</div>
<td>${this.data1.asnNumber}</td> </div>
</tr> <div class="left-item">
<tr> <div class="label">供应商</div>
<td>供应商</td> <div>${item.supplierCode}</div>
<td>${item.supplierCode}</td> </div>
<td>批次</td> <div class="left-item">
<td>${item.supplierBatch}</td> <div class="label">供应商批次</div>
</tr> <div>${item.supplierBatch}</div>
<tr> </div>
<td>到货数量</td> <div class="left-item">
<td>${item.quantityQty}</td> <div class="label">到货数量</div>
<td>抽检数量</td> <div>${item.quantityQty}</div>
<td>${item.sampleQty}</td> </div>
</tr> <div class="left-item">
</tbody> <div class="label">抽检数量</div>
</table> <div>${item.sampleQty}</div>
</div>
`
let str2 = ``
if (item.haveInspectionRequest === '0') {
str2 = `
<div class="left-item">
<div style="color:#ff0000;font-weight: bold;font-size: 15px;">未生成检验申请</div>
</div>`
} else if (item.haveInspectionRequest === '2') {
str2 = `
<div class="left-item">
<div style="color:#ffab01;font-weight: bold;font-size: 15px;">没有检验方案</div>
</div>`
} else if (item.haveInspectionRequest === '3') {
str2 = `
<div class="left-item">
<div style="color:#258eff;font-weight: bold;font-size: 15px;">检验阶段不存在</div>
</div>`
}
let str3 = `
</div>
</div> </div>
</div> </div>
` `
str += str1 + str2 + str3
}) })
this.newHtmlContent1 = this.newHtmlContent1.replace( this.newHtmlContent1 = this.newHtmlContent1.replace(
"mainBody", str); // "mainBody", str); //
}); });
// #endif
}) })
}, },
getTableSubList() { getTableSubList() {
@ -252,7 +296,6 @@ export default {
} else { } else {
this.showTableSubList = this.data.sublist this.showTableSubList = this.data.sublist
} }
// console.log(233,this.showTableSubList)
}, },
getTableInspectDTOList() { getTableInspectDTOList() {
if (this.data1.inspectDTOList.length > this.pageSize1) { if (this.data1.inspectDTOList.length > this.pageSize1) {
@ -267,8 +310,14 @@ export default {
} else { } else {
this.showTableInspectDTOList = this.data1.inspectDTOList this.showTableInspectDTOList = this.data1.inspectDTOList
} }
console.log(233, this.showTableInspectDTOList) },
showMessage(message) {
this.$refs.comMessage.showMessage(message, res => {
if (res) {
} }
});
},
}, },
watch: { watch: {
isLoadFinish: { isLoadFinish: {
@ -301,19 +350,30 @@ export default {
this.getTableSubList() this.getTableSubList()
}) })
} }
//
if (this.data.ids && !this.number) {
this.tabIndex = 2
}
//
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 >
// this.data1.inspectDTOList=[] 0)
if (this.data1 && this.data1.inspectDTOList && this.data1.inspectDTOList.length == 0) { if (this.data1 && this.data1.inspectDTOList && this.data1.inspectDTOList.length == 0 && this.data.ids) {
this.tabIndex = 2 this.tabIndex = 2
} }
this.getTableInspectDTOList() this.getTableInspectDTOList()
}) })
.catch(error => {
this.$refs.comMessage.showMessage(error, res => {
if (res) {
}
});
})
} }
this.getPointPutawayJobHtml() this.getPointPutawayJobHtml()
@ -338,61 +398,51 @@ export default {
<style lang="scss"> <style lang="scss">
.box1 { .box1 {
font-size: 26rpx; font-size: 26rpx;
/* display: flex; */
/* padding: 20rpx; */
border: 1px solid #dedede; border: 1px solid #dedede;
} }
.left { .left {
border-top: 1px solid #b1b1b1;
border-left: 1px solid #b1b1b1;
flex: 1; flex: 1;
border-bottom: 1px solid #b1b1b1;
} }
.left-item { .left-item {
display: flex; display: flex;
} border-top: 1px solid #b1b1b1;
border-left: 1px solid #b1b1b1;
.label {
border-bottom: 1px solid #b1b1b1;
border-right: 1px solid #b1b1b1; border-right: 1px solid #b1b1b1;
width: 140rpx; min-height: 30px;
padding: 0px 10rpx; line-height: 30px;
height: 60rpx;
line-height: 60rpx;
}
.value { view {
border-bottom: 1px solid #b1b1b1; padding: 4px 10px;
}
.label {
width: 100px;
padding: 4px 10px;
border-right: 1px solid #b1b1b1; border-right: 1px solid #b1b1b1;
padding: 0px 5px; }
height: 60rpx;
flex: 1;
width: 0px;
display: flex;
align-items: center;
word-wrap: break-word;
} }
.right {
width: 50%;
border-top: 1px solid #b1b1b1;
}
.image { .relative {
width: 100%; margin-bottom: 20rpx;
height: 301rpx; position: relative;
border-bottom: 1px solid #b1b1b1;
border-top: 1px solid #b1b1b1;
border-right: 1px solid #b1b1b1;
} }
.image img { .q {
width: calc(100% - 4px); position: absolute;
height: calc(100% - 4px); font-size: 12.5rem;
margin: 4rpx; 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;
} }
.mb-kw { .mb-kw {
@ -439,7 +489,6 @@ export default {
} }
.mb-bo .mb-right .mb-text { .mb-bo .mb-right .mb-text {
width: 100%; width: 100%;
} }
@ -449,74 +498,4 @@ export default {
text-align: center; text-align: center;
width: 100%; width: 100%;
} }
.top1 th {
font-weight: bold;
font-size: 13px;
padding: 10px;
}
table {
border-collapse: collapse;
border: 1px solid #dedede;
/* 设置表格的边框 */
width: 100%
}
th {
text-align: left;
padding: 10px;
}
td {
padding: 10px;
&:nth-child(2n) {
width: 290rpx;
}
&:nth-child(2n+1) {
width: 160rpx;
}
}
.tabs-box {
display: flex;
align-items: center;
margin-bottom: 20rpx;
border-bottom: 2rpx solid rgb(188, 188, 188);
position: fixed;
background: white;
width: 100%;
left: 0px;
view {
flex: 1;
text-align: center;
line-height: 60rpx;
font-size: 30rpx;
}
.active1 {
color: rgb(60, 156, 255) !important;
font-weight: bold;
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