|
|
@@ -27,6 +27,9 @@
|
|
|
</scroll-view>
|
|
|
|
|
|
<view class="app-footer open_btn">
|
|
|
+ <view @click="getItem()" class="admin-button-com big default" style="margin-right:80upx;">
|
|
|
+ 出库花材
|
|
|
+ </view>
|
|
|
<view @click="addEvent" class="admin-button-com big blue">新增出库</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -35,7 +38,7 @@
|
|
|
<script>
|
|
|
import Tabs from "@/components/plugin/tabs";
|
|
|
import AppWrapperEmpty from "@/components/app-wrapper-empty";
|
|
|
-
|
|
|
+import { generateItemTable } from '@/api/product'
|
|
|
import { list } from "@/mixins";
|
|
|
import { getStockOutListApi } from "@/api/storehouse/stock";
|
|
|
import { OUT_STATUS } from "@/utils/declare";
|
|
|
@@ -86,6 +89,37 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getItem(){
|
|
|
+ uni.showLoading({title:'下载中',mask:true})
|
|
|
+ generateItemTable().then(res => {
|
|
|
+ if(res.code == 1){
|
|
|
+ uni.hideLoading()
|
|
|
+ let file = res.data.file
|
|
|
+ let shortFile = res.data.shortFile
|
|
|
+ uni.downloadFile({
|
|
|
+ url: file,
|
|
|
+ header: {"Content-Type": 'application/vnd.ms-excel'},
|
|
|
+ filePath: `${wx.env.USER_DATA_PATH}/${shortFile}`,
|
|
|
+ success: (res) => {
|
|
|
+ if (res.statusCode === 200) {
|
|
|
+ wx.saveFileToDisk({
|
|
|
+ filePath: res.filePath,
|
|
|
+ success: function(res) {
|
|
|
+ console.log(res)
|
|
|
+ },
|
|
|
+ fail:function(res) {
|
|
|
+ console.log(res)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ fail:()=>{
|
|
|
+ uni.showToast({title:'请用电脑打开小程序下载',mask:true,icon:'none'})
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
async initData() {
|
|
|
this._list();
|
|
|
},
|