فهرست منبع

支持昆明端

shish 3 سال پیش
والد
کامیت
d5b4aa9493

+ 110 - 27
hdApp/src/admin/billing/affirmGhs.vue

@@ -48,13 +48,24 @@
 							<view class="operate-view" @click="gobackEvent">
 								<text class="iconfont icongouwuche"></text>返回列表
 							</view>
-							<view class="describe-view">共{{ allCountFun.bigLength }}扎,合计 ¥<text class="price">{{ allPriceFun }}</text></view>
+							<view class="describe-view">
+								<text class="price">共{{ allCountFun.bigLength }}扎,{{ allCountFun.weight }}公斤,合计 ¥{{ allPriceFun }}</text>
+							</view>
 						</view>
 					</view>
 				</view>
 
 				<view class="module-com input-line-wrap">
 
+<block v-if="ghsInfo.pfLevel && ghsInfo.pfLevel == 1">
+	<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
+		<button class="admin-button-com middle" :class="[form.transType == 0 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;"  @click="changeTransType(0)">德邦空运</button>
+		<button class="admin-button-com middle" :class="[form.transType == 1 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;"  @click="changeTransType(1)">顺丰空运</button>
+		<button class="admin-button-com middle" :class="[form.transType == 2 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeTransType(2)">冷链物流</button>
+		<button class="admin-button-com middle" :class="[form.transType == 3 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;" @click="changeTransType(3)">航空物流</button>
+	</tui-list-cell>
+</block>
+<block v-else>
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
 						<button v-if="ghsInfo.shopId != 4608" class="admin-button-com middle" :class="[form.sendType == 0 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:30upx;"  @click="changeSendType(0)">送货上门</button>
 						<button class="admin-button-com middle" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:160upx;height:100upx;line-height:52upx;"  @click="changeSendType(1)">自取</button>
@@ -102,22 +113,6 @@
 						</view>
 					</tui-list-cell>
 
-					<tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.sendType == 2" @click="modifyAddress">
-						<view class="tui-title">收花地址</view>
-						<view v-if="!$util.isEmpty(shopInfo.lat) && !$util.isEmpty(shopInfo.long)">
-							<view><text>{{shopInfo.fullAddress}}</text></view>
-							<view><text>{{shopInfo.showAddress}}</text></view>
-						</view>
-						<view v-else>
-							<view><text style="color:#CCCCCC;">请完善门店地址</text></view>
-						</view>
-					</tui-list-cell>
-
-					<tui-list-cell class="line-cell" :hover="false" v-if="form.sendType == 2 && Number(form.sendCost)>0">
-					<view class="tui-title">运费</view>
-					<text style="color: #3385FF">¥{{ form.sendCost }}</text>
-					</tui-list-cell>
-
 					<block v-if="$util.isEmpty(wlList)">
 						<tui-list-cell class="line-cell" :hover="false" v-if="form.sendType == 3">
 							<view class="tui-title">配送物流</view>
@@ -133,6 +128,23 @@
 							</picker>
 						</tui-list-cell>
 					</block>
+</block>
+
+					<tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="displayAddress == true" @click="modifyAddress">
+						<view class="tui-title">收花地址</view>
+						<view v-if="!$util.isEmpty(shopInfo.lat) && !$util.isEmpty(shopInfo.long)">
+							<view><text>{{shopInfo.fullAddress}}</text></view>
+							<view><text>{{shopInfo.showAddress}}</text></view>
+						</view>
+						<view v-else>
+							<view><text style="color:#CCCCCC;">请完善门店地址</text></view>
+						</view>
+					</tui-list-cell>
+
+					<tui-list-cell class="line-cell" :hover="false" v-if="displaySendCost == true">
+					<view class="tui-title">运费</view>
+					<text style="color: #3385FF">¥{{ form.sendCost }}</text>
+					</tui-list-cell>
 
 					<tui-list-cell class="line-cell" :hover="false" v-if="needAddPackCost == true">
 					<view class="tui-title">包装费</view>
@@ -228,6 +240,7 @@ export default {
 				receiveLong: "",
 				receiveLat: "",
 				sendType: 0,
+				transType:0,
 				sendSide: "2",
 				sendDate: "",
 				sendTimeWant: "",
@@ -263,6 +276,7 @@ export default {
 	},
 	onLoad() {
 		this.getGhsData(this.option.id)
+		this.changeTransType(0)
 	},
 	onShow() {
 		if(this.selectedHb.hbId && this.selectedHb.hbId > 0) {
@@ -277,21 +291,46 @@ export default {
 		}
 	},
 	computed: {
-		...mapGetters(["getMerchantInfo", "getLoginInfo"]),
+		...mapGetters(["getMerchantInfo", "getLoginInfo","getDictionariesInfo"]),
+		displayAddress(){
+			if(this.form.sendType == 2){
+				return true
+			}
+			if(this.ghsInfo.pfLevel && this.ghsInfo.pfLevel == 1){
+				return true
+			}
+			return false
+		},
+		displaySendCost(){
+			if(this.form.sendType == 2){
+				return true
+			}
+			if(this.ghsInfo.pfLevel && this.ghsInfo.pfLevel == 1){
+				return true
+			}
+			return false
+		},
 		modifyPrice(){
 			let allPrice = this.allPrice.toFixed(2)
 			allPrice = Number(allPrice)
 			let price = allPrice
 
-			if(this.form.sendType == 2){
+			if(this.displaySendCost == true){
 				price = price + this.form.sendCost
 			}
 			this.needAddPackCost = false
-			if(this.form.sendType == 4){
-				//设置了订单金额低200需要付包装费,当前只付一次
-				if(Number(this.lackExpend) > 0 && allPrice < Number(this.lackExpend)){
-					price = price + this.form.packCost
-					this.needAddPackCost = true
+			if(this.ghsInfo.pfLevel && this.ghsInfo.pfLevel == 1){
+				//昆明发全国
+				this.needAddPackCost = true
+				price = price + this.form.packCost
+			}else{
+				//同城配送
+				if(this.form.sendType == 4){
+					//设置了订单金额低200需要付包装费,当前只付一次
+					if(Number(this.lackExpend) > 0 && allPrice < Number(this.lackExpend)){
+						price = price + this.form.packCost
+						this.needAddPackCost = true
+					}
 				}
 			}
 			price = Number(price)
@@ -307,6 +346,34 @@ export default {
 			this.form.wlId = this.wlSelData.id
 			this.form.wlName = this.wlSelData.name
 		},
+		changeTransType(num){
+			let that = this
+			this.form.transType = num
+			if(this.getDictionariesInfo.transCost && !this.$util.isEmpty(this.getDictionariesInfo.transCost)){
+				let weight = this.allCountFun.weight ? Number(this.allCountFun.weight) : 0
+				for (const ele of this.getDictionariesInfo.transCost) {
+					if(ele.sign == num){
+						if(num == 2){
+							let llOption = ele.option ? ele.option : ''
+							if(!this.$util.isEmpty(llOption)){
+								for (const llEle of llOption) {
+									if(Number(llEle.num)>=weight){
+										this.form.sendCost = llEle.amount?llEle.amount:0
+										break
+									}
+								}
+							}
+						}else{
+							let perKiloCost = ele.perKiloCost?Number(ele.perKiloCost):0
+							let sendCost = weight*perKiloCost
+							sendCost = parseFloat(sendCost.toFixed(2))
+							this.form.sendCost = sendCost
+						}
+						break
+					}
+				}
+			}
+		},
 		changeSendType(num){
 			this.form.sendType = num
 			if(num == 2){
@@ -489,7 +556,23 @@ export default {
 			let that = this
 			getGhsDataApi({id:id}).then(res => {
 				that.ghsInfo = res.data
-				that.form.packCost = res.data.packCost?parseFloat(res.data.packCost):0
+				if(that.ghsInfo.pfLevel && that.ghsInfo.pfLevel == 1){
+					//昆明发货到全国
+					let packCost = 0
+					let weight = this.allCountFun.weight ? this.allCountFun.weight : 0
+					if (that.getDictionariesInfo.kmPackCost && !this.$util.isEmpty(that.getDictionariesInfo.kmPackCost)){
+						for (const ele of that.getDictionariesInfo.kmPackCost) {
+							let flagWeight = ele.num?ele.num:0
+							if(Number(flagWeight)>=Number(weight)){
+								that.form.packCost = ele.amount?parseFloat(Number(ele.amount)):0
+								break
+							}
+						}
+					}
+				}else{
+					//同城配送
+					that.form.packCost = res.data.packCost?parseFloat(res.data.packCost):0
+				}
 				that.lackExpend = res.data.lackExpend?parseFloat(res.data.lackExpend):0
 				that.form.wlName = res.data.customWlName ? res.data.customWlName : ''
 
@@ -543,6 +626,7 @@ export default {
 				sendTimeWant:this.sendTimeWant,
 				sendCost:this.form.sendCost,
 				sendType:this.form.sendType,
+				transType:this.form.transType,
 				remark:this.remark,
 				product:JSON.stringify(product),
 				ghsId:this.ghsInfo.id,
@@ -769,13 +853,12 @@ export default {
 				}
 				.describe-view {
 					display: flex;
-
 					align-items: center;
 					color: #333;
 					font-size: 24upx;
 					.price {
 						font-weight: bold;
-						font-size: 36upx;
+						font-size: 30upx;
 					}
 				}
 			}

+ 2 - 2
hdApp/src/admin/billing/affirmGhsBook.vue

@@ -47,8 +47,8 @@
 				<view class="module-com input-line-wrap">
 
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false" >
-						<button class="admin-button-com big" :class="[form.sendType == 0 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(0)">免费送货</button>
-						<button class="admin-button-com big" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(1)">上门自取</button>
+						<button class="admin-button-com big" :class="[form.sendType == 0 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(0)">送货上门</button>
+						<button class="admin-button-com big" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(1)">到店自取</button>
 						<button class="admin-button-com big" :class="[form.sendType == 3 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(3)">物流</button>
 					</tui-list-cell>
 

+ 6 - 1
hdApp/src/mixins/cgProduct.js

@@ -108,13 +108,18 @@ export default {
 		allCountFun() {
 			let bigLength = 0;
 			let smallLength = 0;
+			let weight = 0
 			if (this.selectList) {
 				for (const item of this.selectList) {
 					bigLength += item.bigCount
 					smallLength += item.smallCount
+					let currentWeight = item.weight ? item.weight : 0
+					weight = Number(weight) + Number(currentWeight)
 				}
+				weight = weight.toFixed(2)
+				weight = parseFloat(weight)
 			}
-			return {bigLength:bigLength,smallLength:smallLength,};
+			return {bigLength:bigLength,smallLength:smallLength,weight:weight};
 		},
 		/**
 			* 描点-定位分类

+ 10 - 0
hdApp/src/pagesPurchase/purDetails.vue

@@ -62,6 +62,7 @@
             <text style="color:white;border:1px solid #657cac;border-radius:20upx;font-size:20upx;padding:5upx 12upx;background:#657cac;">预订单</text>
           </view>
         </view>
+<block v-if="detailInfo.localOrder == 0">
         <view class="order-info_box">
           <view>配送方式:</view>
           <view>
@@ -76,6 +77,15 @@
           <view>配送时间:</view>
           <view>{{ detailInfo.sendTimeWant }}</view>
         </view>
+</block>
+<block v-else>
+        <view class="order-info_box">
+          <view>运输方式:</view>
+          <view>
+{{ detailInfo.transType==0?'德邦空运':detailInfo.transType==1?'顺丰空运':detailInfo.transType==2?'冷链物流':detailInfo.transType==3?'航空物流':'' }} <text v-if="detailInfo.transPayType == 1" style="font-weight:bold;margin-left:10upx;">到付</text>
+          </view>
+        </view>
+</block>
 				<view class="order-info_box" v-if="detailInfo.status != 1 && detailInfo.status!=5">
 					<view>在线支付:</view>
 					<view v-if="detailInfo.onlinePay == 1">否</view>