|
|
@@ -5,8 +5,9 @@
|
|
|
<app-search-module v-model="py" placeholder="找小菊请输xj" @input="searchFn"/>
|
|
|
</view>
|
|
|
<view style="padding:0 0upx 0 20upx;" >
|
|
|
- <button class="admin-button-com middle blue" style="margin-right:10upx;" @click="downloadTable()">价格表</button>
|
|
|
- <button class="admin-button-com middle blue" @click="pageTo({ url: '/admin/ptItem/itemList' })">导入花材</button>
|
|
|
+ <button class="admin-button-com middle blue" style="margin-right:8upx;" @click="downPriceTable()">价格表</button>
|
|
|
+ <button class="admin-button-com middle blue" style="margin-right:8upx;" @click="pageTo({ url: '/admin/ptItem/itemList' })">导花材</button>
|
|
|
+ <button class="admin-button-com middle blue" @click="downBarcodeTable()">条码</button>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="scroll-middle_bx">
|
|
|
@@ -52,7 +53,7 @@ import { selectShop } from "@/mixins";
|
|
|
import { mapGetters } from "vuex";
|
|
|
import DorpdownSelect from "@/components/module/shopSelect";
|
|
|
import { getWeixinId } from "@/api/invite/index";
|
|
|
-import { generatePriceTable } from '@/api/product/index'
|
|
|
+import { generatePriceTable,generateBarcodeTable } from '@/api/product/index'
|
|
|
export default {
|
|
|
name: "item_list",
|
|
|
components: {
|
|
|
@@ -89,8 +90,7 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
- downloadTable(){
|
|
|
-
|
|
|
+ downPriceTable(){
|
|
|
let level = 0
|
|
|
let levelList = ['散客价', '普店价', '银店价','金店价']
|
|
|
uni.showActionSheet({
|
|
|
@@ -130,6 +130,37 @@ export default {
|
|
|
})
|
|
|
|
|
|
},
|
|
|
+ downBarcodeTable(){
|
|
|
+ uni.showLoading({title:'下载中',mask:true})
|
|
|
+ generateBarcodeTable().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'})
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
goToProduct (id) {
|
|
|
let that = this
|
|
|
console.log('admin/ghsProduct/detail?shopId='+ that.loginInfo.shopId+'&id=0&ghsShopAdminId='+that.loginInfo.shopAdminId+'&id='+id)
|