Răsfoiți Sursa

app 花材优化

shish 4 ani în urmă
părinte
comite
4608eee2d9

+ 2 - 7
ghsApp/src/admin/billing/affirm.vue

@@ -22,9 +22,9 @@
                     <view class="open-bx" >
                       <i class="iconfont iconjian" @click.stop="reduceItemFn(item)" v-if="item.bigCount > 0 || item.smallCount > 0"></i>
                       <text class="num" >
-                        <text v-if="item.bigCount > 0 || item.smallCount > 0">{{ `${item.bigCount}` }}</text>
+                        <text v-if="item.bigCount > 0 || item.smallCount > 0">{{ item.bigCount }}</text>
                         <text v-if="item.smallCount > 0">/</text>
-                        <text v-if="item.smallCount > 0">{{ `${item.smallCount}` }}</text>
+                        <text v-if="item.smallCount > 0">{{ item.smallCount }}</text>
                       </text>
                       <i class="iconfont iconzeng" @click.stop="addItemFn(item)"></i>
                     </view>
@@ -150,7 +150,6 @@ import { createOrder, updateOrder } from "@/api/order/index";
 import { mapActions, mapGetters } from "vuex";
 import { getUserDet} from "@/api/member";
 import ModalModule from "@/components/plugin/modal";
-import { allProduct } from '@/api/product'
 export default {
   name: "BillingAffirm", // 开单确认
   components: {
@@ -203,10 +202,6 @@ export default {
     };
   },
   onLoad (option) {
-    
-    allProduct().then(res=>{
-      this.allProduct = res.data.list
-    })
 
     this.kdType = option.kdType
 

+ 1 - 1
ghsApp/src/admin/billing/result.vue

@@ -46,7 +46,7 @@ export default {
     },
     //订单详情
     gotoOrderDetail() {
-      this.$util.pageTo({url: "/pagesOrder/detail",query: { id: this.option.orderId }})
+      this.$util.pageTo({url: "/pagesOrder/detail",type:2,query: { id: this.option.orderId }})
     },
     gotoPlace() {
       uni.navigateBack({ delta: 1 });

+ 36 - 5
ghsApp/src/admin/item/list.vue

@@ -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)

+ 5 - 0
ghsApp/src/api/product/index.js

@@ -79,4 +79,9 @@ export const generatePriceTable = data => {
 //所有花材
 export const allProduct = data => {
 	return https.get("/product/all", data);
+};
+
+//下载条形码
+export const generateBarcodeTable = data => {
+	return https.get("/product/generate-barcode-table", data);
 };

+ 2 - 4
ghsApp/src/mixins/product.js

@@ -381,7 +381,6 @@ export default {
 					return
 				}
 			}
-
 			let index = list.findIndex(element => element.id == item.id)
 			if(index == -1){
 				list.push(item)			
@@ -399,13 +398,12 @@ export default {
 				this.$util.hitRemind()
 			}
 
-			this.setSelectInfoByType({ type: this.pageType, info: list });
+			this.setSelectInfoByType({ type: this.pageType, info: list })
 
 			this.itemListRefresh()
 
 			//记忆已经选择的花材
 			this.rememberProduct()
-
 		},
 		//显示可以修改花材的弹框
 		showAddModelFn(info) {
@@ -415,7 +413,7 @@ export default {
 				return false
 			}
 			this.isAddModel = true;
-			this.customData = info;
+			this.customData = copyObject(info)
 			this.isAddInputFocus = false;
 			this.$nextTick(()=>{
 				this.customData.smallCount = this.customData.smallCount==0?null:this.customData.smallCount;