|
|
@ -1,7 +1,22 @@ |
|
|
|
<template> |
|
|
|
|
|
|
|
<view style="margin-left: 20px; margin-right: 20px;padding-bottom: 50px"> |
|
|
|
<view style="display: flex; width: 100%;justify-content: center; size: 25px;font-family: sans-serif;font-weight: 600;margin: 10px;">{{date}}</view> |
|
|
|
|
|
|
|
<view style="display: flex;width: 100%;"> |
|
|
|
<view style="flex: 1;"></view> |
|
|
|
<text style="size: 25px;font-family: sans-serif;font-weight: 600;color: white; |
|
|
|
margin-top: 10px;margin-right: 5px;border: none; padding: 5px 15px; |
|
|
|
border-radius: 5px 5px; |
|
|
|
background: #0498FD;" @click="download"> |
|
|
|
下载 |
|
|
|
</text> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view |
|
|
|
style="display: flex; width: 100%;justify-content: center; size: 25px;font-family: sans-serif;font-weight: 600;margin: 10px;"> |
|
|
|
{{date}} |
|
|
|
</view> |
|
|
|
|
|
|
|
<view style="margin-top: 20px; display: flex; flex-direction: column;"> |
|
|
|
<text style="size: 25px;font-family: sans-serif;font-weight: 600;padding-bottom: 10px;">库存日报汇总表</text> |
|
|
@ -13,9 +28,9 @@ |
|
|
|
<uni-tr> |
|
|
|
<!-- <uni-th align="center">序号</uni-th> --> |
|
|
|
<uni-th align="center" width="180">仓库类型</uni-th> |
|
|
|
<uni-th align="center"width="80">仓库数量</uni-th> |
|
|
|
<uni-th align="center"width="80">品种数量</uni-th> |
|
|
|
<uni-th align="center"width="100">品种货值</uni-th> |
|
|
|
<uni-th align="center" width="80">仓库数量</uni-th> |
|
|
|
<uni-th align="center" width="80">品种数量</uni-th> |
|
|
|
<uni-th align="center" width="100">品种货值</uni-th> |
|
|
|
</uni-tr> |
|
|
|
<uni-tr v-for="(item, index) in tableData1" :key="index"> |
|
|
|
<!-- <uni-td align="center">{{ index+1}}</uni-td> --> |
|
|
@ -80,7 +95,7 @@ |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
date: "2023-06-25", |
|
|
|
date: "", |
|
|
|
logInfo: { |
|
|
|
serialNumber: "", |
|
|
|
reportTime: "", |
|
|
@ -97,22 +112,75 @@ |
|
|
|
tableData1: [], |
|
|
|
tableData2: [], |
|
|
|
tableData3: [], |
|
|
|
tempFilePath: "", |
|
|
|
// fileUrl:"https://desk-fd.zol-img.com.cn/t_s960x600c5/g5/M00/01/0F/ChMkJlbKwtmINC3iAAx4ozyK5jAAALGuAMGw3cADHi7853.jpg" |
|
|
|
fileUrl: "" |
|
|
|
}; |
|
|
|
}, |
|
|
|
onLoad(option) { |
|
|
|
|
|
|
|
// this.date = option.orderDate |
|
|
|
this.date = option.orderDate |
|
|
|
|
|
|
|
// console.log('1111', this.queryParams) |
|
|
|
this.getData() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
wx.hideHomeButton() |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
download() { |
|
|
|
if (this.fileUrl == '') { |
|
|
|
uni.showToast({ |
|
|
|
title: "下载地址错误,请重新进入页面。", |
|
|
|
duration: 5000 |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
uni.downloadFile({ |
|
|
|
url: this.fileUrl, // 网络文档地址 |
|
|
|
success: (data) => { |
|
|
|
if (data.statusCode === 200) { |
|
|
|
uni.saveFile({ |
|
|
|
tempFilePath: data.tempFilePath, //临时路径 |
|
|
|
success: function(res) { |
|
|
|
// 保存路径 |
|
|
|
uni.showToast({ |
|
|
|
title: "文件已保存:" + res.savedFilePath, |
|
|
|
duration: 5000 |
|
|
|
}) |
|
|
|
setTimeout(() => { |
|
|
|
//打开文档查看 |
|
|
|
uni.openDocument({ |
|
|
|
filePath: res.savedFilePath, |
|
|
|
showMenu: true, //右上角是否有可以转发分享的功能 |
|
|
|
success: function(res) { |
|
|
|
console.log('打开文档成功') |
|
|
|
} |
|
|
|
}) |
|
|
|
}, 3000); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: (err) => { |
|
|
|
uni.showToast({ |
|
|
|
title: '失败请重新下载' |
|
|
|
}); |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
getData() { |
|
|
|
console.log('getData', this.date) |
|
|
|
this.$api.getReportInventoryDayGather(this.date).then((resp) => { |
|
|
|
console.log('1111>>>>>>', resp) |
|
|
|
|
|
|
|
this.fileUrl = resp.downloadUrl |
|
|
|
this.tableData1 = resp.list |
|
|
|
this.logInfo = { |
|
|
|
serialNumber: resp.serialNumber, |
|
|
|