shish пре 4 година
родитељ
комит
cc2f381bdd
3 измењених фајлова са 102 додато и 70 уклоњено
  1. 40 26
      ghsApp/src/admin/changePrice/list.vue
  2. 42 27
      ghsApp/src/admin/item/list.vue
  3. 20 17
      hdApp/src/pagesPurchase/ghsProduct.vue

+ 40 - 26
ghsApp/src/admin/changePrice/list.vue

@@ -91,35 +91,49 @@ export default {
 	},
 	methods: {
 		downloadTable(){
-			uni.showLoading({title:'下载中',mask:true});
-			generatePriceTable().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)
+
+			let level = 0
+			let levelList = ['普通价', '青铜价', '白银价','黄金价','钻石价']
+			uni.showActionSheet({
+				itemList: levelList,
+				success: function (respond) {
+					level = respond.tapIndex
+
+						uni.showLoading({title:'下载中',mask:true})
+						generatePriceTable({level:level}).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:function(res) {
-										console.log(res)
+									fail:()=>{
+										uni.showToast({title:'请用电脑打开小程序下载',mask:true,icon:'none'})
 									}
-								})
-							}
-						},
-						fail:()=>{
-							uni.showToast({title:'请用电脑打开小程序下载',mask:true,icon:'none'})
-						}
-					});
-				}					
+								});
+							}					
+						})
+
+
+				}
 			})
+
+
 		},
 		initProduct(){
 			this.shopId = this.getMyShopInfo.id;

+ 42 - 27
ghsApp/src/admin/item/list.vue

@@ -99,35 +99,50 @@ export default {
 
 	methods: {
 		downloadTable(){
-			uni.showLoading({title:'下载中',mask:true});
-			generatePriceTable().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)
+			
+
+			let level = 0
+			let levelList = ['普通价', '青铜价', '白银价','黄金价','钻石价']
+			uni.showActionSheet({
+				itemList: levelList,
+				success: function (respond) {
+					level = respond.tapIndex
+
+					uni.showLoading({title:'下载中',mask:true})
+					generatePriceTable({level:level}).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'})
-						}
-					});
-				}					
+								},
+								fail:()=>{
+									uni.showToast({title:'请用电脑打开小程序下载',mask:true,icon:'none'})
+								}
+							});
+						}					
+					})
+
+
+
+				}
 			})
+
 		},
 		goToProduct (id) {
 			let that = this

+ 20 - 17
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -3,23 +3,23 @@
 	<view class="billing_box_bg">
     <view class="c_header" :class="myClass">
       <view class="header_inside">
-        <image :src="pageInfo.avatar"></image>
+        <image :src="ghsInfo.avatar"></image>
         <view class="shop_info">
-          <view class="shop_title">{{pageInfo.name||''}}<text :class="[pageInfo.giveLevel==0?'level-common':'level']" >{{pageInfo.giveLevelName||''}}会员</text></view>
+          <view class="shop_title">{{ghsInfo.name||''}}<text :class="[ghsInfo.giveLevel==0?'level-common':'level']" >{{ghsInfo.giveLevelName||''}}会员</text></view>
 
-			<view v-if="pageInfo.hasRechargeHb && pageInfo.hasRechargeHb ==1" class="shop_intro" @tap="recharge(pageInfo)">
-				<text>充值送红包<text style="color:red;font-weight:700;">{{parseFloat(pageInfo.hasRechargeHbAmount)}}</text>元
+			<view v-if="ghsInfo.hasRechargeHb && ghsInfo.hasRechargeHb ==1" class="shop_intro" @tap="recharge(ghsInfo)">
+				<text>充值送红包<text style="color:red;font-weight:700;">{{parseFloat(ghsInfo.hasRechargeHbAmount)}}</text>元
 					<text style="z-index:999999;margin-left:15rpx;color:red;border:1px solid red;padding:3rpx 12rpx 3rpx 12rpx;border-radius:10rpx;">去充值</text>
 				</text>
 			</view>
 
           	<view v-else class="shop_intro">
-			  <text style="margin-right: 20upx;">已采购:{{pageInfo.expendAmount || '0.00'}}</text>
-			  <text>欠款:{{pageInfo.debtAmount || '0.00'}}</text>
+			  <text style="margin-right: 20upx;">已采购:{{ghsInfo.expendAmount || '0.00'}}</text>
+			  <text>欠款:{{ghsInfo.debtAmount || '0.00'}}</text>
 			</view>
 
         </view>
-        <i class="iconfont icondianhua1" v-if="pageInfo.mobile !=''" @tap="toPhone(pageInfo.mobile)"></i>
+        <i class="iconfont icondianhua1" v-if="ghsInfo.mobile !=''" @tap="toPhone(ghsInfo.mobile)"></i>
       </view>
     </view>
 		<view class="input-wrap" >
@@ -61,7 +61,7 @@
 									:offVerifyRepertory="true"
 									:bigCount="getSelectItemById(productItem.id, classItem.classId).bigCount"
 									:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
-									:discount.sync="pageInfo.giveDiscount"
+									:discount.sync="ghsInfo.giveDiscount"
 									@customNum="customNum"
 									@add="addEvent"
 									@addOneEvent="addCustomNumEvent"
@@ -158,7 +158,7 @@ export default {
 			showSubmitModel: false,
 			notOpenShop:false,
 			hdShopAdminId:0,
-			pageInfo: {
+			ghsInfo: {
 				avatar:'',
 				name:' ',
 				mobile:'',
@@ -263,7 +263,7 @@ export default {
 		console.log('share',`pagesPurchase/ghsProduct?hdShopAdminId=${this.loginInfo.shopAdminId}&ghsShopAdminId=${ghsShopAdminId}&shopId=${this.shopId}&id=0`)
 
 		return {
-			title: this.pageInfo.name,
+			title: this.ghsInfo.name,
 			desc: "",
 			path: `pagesPurchase/ghsProduct?hdShopAdminId=${this.loginInfo.shopAdminId}&ghsShopAdminId=${ghsShopAdminId}&shopId=${this.shopId}&id=0`
 		}
@@ -320,31 +320,34 @@ export default {
 				}
 			}
 
-			//只要拿到供应商的门店ID即可先取花材,不需要生成供应商id
 			const { shopId,id} = this.option;
-			this.initGhsData(id,shopId);
 
 			if(this.option.id == 0) {
 				ghsInfo({shopId: this.option.shopId}).then(res => {
-					this.pageInfo = res.data
+					this.ghsInfo = res.data
+					let id = res.data.id
+					//获取供货商花材
+					this.initGhsData(id,shopId);					
 					this.createShareDiscount()
-					uni.setNavigationBarTitle({title: this.pageInfo.name})
+					uni.setNavigationBarTitle({title: this.ghsInfo.name})
 					this.option.id = res.data.id;
 				}).catch(err => {})
 			} else {
+				//获取供货商花材
+				this.initGhsData(id,shopId);
 				getGhsDataApi({id: this.option.id}).then(res => {
-					this.pageInfo = res.data
+					this.ghsInfo = res.data
 					this.shopId = res.data.shopId
 					this.createShareDiscount()
 					uni.setNavigationBarTitle({
-						title: this.pageInfo.name
+						title: this.ghsInfo.name
 					})
 				}).catch(err => {})
 			}
 
 		},
 		createShareDiscount(){
-			let shareDiscount = this.pageInfo.giveDiscount*100
+			let shareDiscount = this.ghsInfo.giveDiscount*100
 			this.shareDiscount = shareDiscount
 		},
 		scroll_detail(options){