|
|
@ -1,23 +1,23 @@ |
|
|
|
<template> |
|
|
|
<view class="content" style="padding:30rpx 20rpx 100rpx;min-height: calc(100vh - 120rpx);"> |
|
|
|
<com-empty-view v-if="data.length==0"></com-empty-view> |
|
|
|
<view class="content" style="padding: 30rpx 20rpx 100rpx; min-height: calc(100vh - 120rpx)"> |
|
|
|
<com-empty-view v-if="data.length == 0"></com-empty-view> |
|
|
|
<!-- 只用于展示页面 --> |
|
|
|
<view class="box" style="margin-bottom: 20rpx;"> |
|
|
|
<view class="box" style="margin-bottom: 20rpx"> |
|
|
|
<view class="top"> |
|
|
|
<view class="mb-kw"> |
|
|
|
目标库位:<text>{{data.toLocationCode}}</text> |
|
|
|
目标库位:<text>{{ data.toLocationCode }}</text> |
|
|
|
</view> |
|
|
|
<view class="mb-text"> |
|
|
|
任务编号:<text>{{data.number}}</text> |
|
|
|
任务编号:<text>{{ data.number }}</text> |
|
|
|
</view> |
|
|
|
<view class="mb-text"> |
|
|
|
创建人:<text>{{data.creator||''}}</text> |
|
|
|
创建人:<text>{{ data.creator || '' }}</text> |
|
|
|
</view> |
|
|
|
<view class="mb-text"> |
|
|
|
创建时间:<text>{{data.createTime}}</text> |
|
|
|
创建时间:<text>{{ formatDate(data.createTime) }}</text> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<u-table style="margin-top: 20rpx;"> |
|
|
|
<u-table style="margin-top: 20rpx"> |
|
|
|
<u-tr> |
|
|
|
<u-th>物品代码</u-th> |
|
|
|
<u-th>物品描述</u-th> |
|
|
@ -27,45 +27,42 @@ |
|
|
|
<u-th>数量</u-th> |
|
|
|
<u-th>计量单位</u-th> |
|
|
|
</u-tr> |
|
|
|
<u-tr v-for="(cur,key) in data.sublist" :key='key'> |
|
|
|
<u-td>{{cur.itemCode}}</u-td> |
|
|
|
<u-td>{{cur.itemDesc1}}</u-td> |
|
|
|
<u-td>{{cur.batch}}</u-td> |
|
|
|
<u-td>{{cur.packingNumber}}</u-td> |
|
|
|
<u-td>{{cur.packUnit}}</u-td> |
|
|
|
<u-td>{{cur.packQty}}</u-td> |
|
|
|
<u-td>{{cur.uom}}</u-td> |
|
|
|
<u-tr v-for="(cur, key) in data.sublist" :key="key"> |
|
|
|
<u-td>{{ cur.itemCode }}</u-td> |
|
|
|
<u-td>{{ cur.itemDesc1 }}</u-td> |
|
|
|
<u-td>{{ cur.batch }}</u-td> |
|
|
|
<u-td>{{ cur.packingNumber }}</u-td> |
|
|
|
<u-td>{{ cur.packUnit }}</u-td> |
|
|
|
<u-td>{{ cur.packQty }}</u-td> |
|
|
|
<u-td>{{ cur.uom }}</u-td> |
|
|
|
</u-tr> |
|
|
|
</u-table> |
|
|
|
</view> |
|
|
|
<view class="" style="position: fixed;width: 100%;bottom: 0rpx;left: 0px;"> |
|
|
|
<button @click="printImage" |
|
|
|
style='background:rgb(60, 156, 255) !important ;color: white;margin-top: 80rpx;'> 打印</button> |
|
|
|
<view class="" style="position: fixed; width: 100%; bottom: 0rpx; left: 0px"> |
|
|
|
<button @click="printImage" style="background: rgb(60, 156, 255) !important ; color: white; margin-top: 80rpx">打印</button> |
|
|
|
</view> |
|
|
|
|
|
|
|
</view> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
getJimuPutawayJobDetail |
|
|
|
} from '@/api/request2.js'; |
|
|
|
// 打印页面的模板 |
|
|
|
const htmlFileUrl = '/hybrid/html/pointPutawayJob.html'; |
|
|
|
// #ifdef APP |
|
|
|
var testModule = uni.requireNativePlugin("TestModule") |
|
|
|
// #endif |
|
|
|
import { getJimuPutawayJobDetail } from '@/api/request2.js' |
|
|
|
import { dateFormat } from '@/common/basic.js' |
|
|
|
// 打印页面的模板 |
|
|
|
const htmlFileUrl = '/hybrid/html/pointPutawayJob.html' |
|
|
|
// #ifdef APP |
|
|
|
const testModule = uni.requireNativePlugin('TestModule') |
|
|
|
// #endif |
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: 'pointPutawayJob', |
|
|
|
data() { |
|
|
|
return { |
|
|
|
data: { |
|
|
|
sublist:[] |
|
|
|
sublist: [] |
|
|
|
}, |
|
|
|
newHtmlContent: '', //打印传入的html |
|
|
|
newHtmlContent: '', // 打印传入的html |
|
|
|
isLoadFinish: false, |
|
|
|
ids:'' |
|
|
|
ids: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -77,42 +74,52 @@ |
|
|
|
}, |
|
|
|
// 读取html文件 |
|
|
|
readFile(path, callback) { |
|
|
|
plus.io.resolveLocalFileSystemURL(path, function(entry) { |
|
|
|
entry.file(function(file) { |
|
|
|
var reader = new plus.io.FileReader(); |
|
|
|
reader.onloadend = function(e) { |
|
|
|
callback(e.target.result); |
|
|
|
}; |
|
|
|
reader.readAsText(file); |
|
|
|
}, function(e) { |
|
|
|
console.log("读取文件失败:" + e.message); |
|
|
|
}); |
|
|
|
}, function(e) { |
|
|
|
console.log("获取图片资源失败:" + e.message); |
|
|
|
}); |
|
|
|
plus.io.resolveLocalFileSystemURL( |
|
|
|
path, |
|
|
|
function (entry) { |
|
|
|
entry.file( |
|
|
|
function (file) { |
|
|
|
const reader = new plus.io.FileReader() |
|
|
|
reader.onloadend = function (e) { |
|
|
|
callback(e.target.result) |
|
|
|
} |
|
|
|
reader.readAsText(file) |
|
|
|
}, |
|
|
|
function (e) { |
|
|
|
console.log(`读取文件失败:${e.message}`) |
|
|
|
} |
|
|
|
) |
|
|
|
}, |
|
|
|
function (e) { |
|
|
|
console.log(`获取图片资源失败:${e.message}`) |
|
|
|
} |
|
|
|
) |
|
|
|
}, |
|
|
|
// #endif |
|
|
|
formatDate(val) { |
|
|
|
return dateFormat(val) |
|
|
|
} |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
isLoadFinish: { |
|
|
|
handler(newVal, oldVal) { |
|
|
|
if (newVal == true) { |
|
|
|
// 读取html文件将文件中的内容图换成当前页面的数据 |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
immediate: true |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
onLoad(option) { |
|
|
|
if (option.data) { |
|
|
|
this.data = JSON.parse(decodeURIComponent(option.data)); |
|
|
|
this.data = JSON.parse(decodeURIComponent(option.data)) |
|
|
|
} |
|
|
|
}, |
|
|
|
async onShow() { |
|
|
|
await getJimuPutawayJobDetail(this.data.ids).then(res=>{ |
|
|
|
await getJimuPutawayJobDetail({ |
|
|
|
masterIds: this.data.ids |
|
|
|
}).then((res) => { |
|
|
|
this.data.sublist = res.data |
|
|
|
}) |
|
|
|
// 获取数据 |
|
|
@ -184,7 +191,7 @@ |
|
|
|
创建人:<span>${this.data.creator}</span> |
|
|
|
</div> |
|
|
|
<div class="mb-text"> |
|
|
|
创建时间:<span>${this.data.createTime}</span> |
|
|
|
创建时间:<span>${this.formatDate(this.data.createTime)}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<table style="margin-top: 20rpx;" style='border-collapse: collapse;'> |
|
|
@ -215,48 +222,43 @@ |
|
|
|
</tr> |
|
|
|
` |
|
|
|
}) |
|
|
|
str = str.replace( |
|
|
|
"tableTrTd", str1) |
|
|
|
str = str.replace('tableTrTd', str1) |
|
|
|
// }) |
|
|
|
this.newHtmlContent = this.newHtmlContent.replace( |
|
|
|
"mainBody", str); //替换物品代码 |
|
|
|
}); |
|
|
|
|
|
|
|
this.newHtmlContent = this.newHtmlContent.replace('mainBody', str) // 替换物品代码 |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style> |
|
|
|
.box { |
|
|
|
.box { |
|
|
|
font-size: 26rpx; |
|
|
|
/* display: flex; */ |
|
|
|
padding: 20rpx; |
|
|
|
border: 1px solid #dedede; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.left { |
|
|
|
.left { |
|
|
|
border-top: 1px solid #b1b1b1; |
|
|
|
border-left: 1px solid #b1b1b1; |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.left-item { |
|
|
|
.left-item { |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.label { |
|
|
|
.label { |
|
|
|
border-bottom: 1px solid #b1b1b1; |
|
|
|
border-right: 1px solid #b1b1b1; |
|
|
|
width: 140rpx; |
|
|
|
padding: 0px 10rpx; |
|
|
|
height: 60rpx; |
|
|
|
line-height: 60rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.value { |
|
|
|
.value { |
|
|
|
border-bottom: 1px solid #b1b1b1; |
|
|
|
border-right: 1px solid #b1b1b1; |
|
|
|
padding: 0px 5px; |
|
|
@ -266,51 +268,49 @@ |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
word-wrap: break-word; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.right { |
|
|
|
.right { |
|
|
|
width: 50%; |
|
|
|
|
|
|
|
border-top: 1px solid #b1b1b1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.image { |
|
|
|
.image { |
|
|
|
width: 100%; |
|
|
|
height: 301rpx; |
|
|
|
border-bottom: 1px solid #b1b1b1; |
|
|
|
border-top: 1px solid #b1b1b1; |
|
|
|
border-right: 1px solid #b1b1b1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.image img { |
|
|
|
.image img { |
|
|
|
width: calc(100% - 4px); |
|
|
|
height: calc(100% - 4px); |
|
|
|
margin: 4rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.mb-kw { |
|
|
|
.mb-kw { |
|
|
|
border-bottom: 1px solid #dedede; |
|
|
|
padding-bottom: 20rpx; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.mb-kw text { |
|
|
|
.mb-kw text { |
|
|
|
font-weight: bold; |
|
|
|
font-size: 32rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.mb-text { |
|
|
|
.mb-text { |
|
|
|
margin-top: 10rpx; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .u-th { |
|
|
|
::v-deep .u-th { |
|
|
|
font-size: 24rpx !important; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .u-td { |
|
|
|
::v-deep .u-td { |
|
|
|
height: auto !important; |
|
|
|
font-size: 24rpx !important; |
|
|
|
word-break: break-all; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
</style> |