shish пре 3 година
родитељ
комит
0f78329a18

+ 60 - 8
hdApp/src/admin/billing/affirmGhs.vue

@@ -55,21 +55,25 @@
 				<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 == 2 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(2)">跑腿</button>
+						<button class="admin-button-com middle" :class="[form.sendType == 0 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(0)">免费送货</button>
+						<button class="admin-button-com middle" :class="[form.sendType == 1 ? 'blue' : 'default']" style="width:180upx;"  @click="changeSendType(1)">到店自取</button>
+						<button class="admin-button-com middle" :class="[form.sendType == 2 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(2)">跑腿</button>
+						<button class="admin-button-com middle" :class="[form.sendType == 3 ? 'blue' : 'default']" style="width:180upx;" @click="changeSendType(3)">物流</button>
 					</tui-list-cell>
 
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
 						<view v-if="form.sendType == 0">
-							<text style="color: #3385FF;width:100%;">本店有出车到您店,请选此项,免配送费</text>
+							<text style="color: #3385FF;width:100%;">在本店配送范围的,免费送货上门</text>
 						</view>				
 						<view v-if="form.sendType == 1">
-							<text style="color: #3385FF;width:100%;">您自己来店里取,没有配送费</text>
+							<text style="color: #3385FF;width:100%;">您自己来店里取,没有配送费</text>
 						</view>
 						<view v-if="form.sendType == 2">
 							<text style="color: #3385FF;width:100%;">请跑腿送货,有配送费</text>
 						</view>
+						<view v-if="form.sendType == 3">
+							<text style="color: #3385FF;width:100%;">发物流,默认到付</text>
+						</view>
 					</tui-list-cell>
 
 					<tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.sendType == 2" @click="modifyAddress">
@@ -88,6 +92,15 @@
 					<text style="color: #3385FF">¥{{ form.sendCost }}</text>
 					</tui-list-cell>
 
+					<tui-list-cell class="line-cell" :hover="false" :arrow="true" v-if="form.sendType == 3">
+						<view class="tui-title ">配送物流</view>
+						<picker mode="selector" :value="form.wlId" :range="wlList" range-key="name" @change="changeWlFn" class="tui-input" >
+						<input v-model="form.wlId" name="wlId" type="text" hidden />
+						<view v-if="Number(form.wlId)>0">{{ wlSelData.name }}</view>
+						<view class="tui-placeholder" v-else>请选择</view>
+						</picker>
+					</tui-list-cell>
+
 					<tui-list-cell class="line-cell" :hover="false" v-if="(form.sendType == 2 || form.sendType == 0)&& Number(form.packCost)>0">
 					<view class="tui-title">打包费</view>
 					<text style="color: #3385FF">¥{{ form.packCost }}</text>
@@ -139,7 +152,7 @@ import appFormSend from "@/components/app-form-send";
 import appSendTime from "@/components/app-send-time";
 const formUtil = require("@/utils/formValidation.js");
 import AppDatePicker from "@/components/app-date-picker";
-import { getGhsDataApi } from "@/api/ghs/index";
+import { getGhsDataApi,getGhsWl } from "@/api/ghs";
 import { freight,createOrder } from "@/api/purchase";
 import { mapActions, mapGetters } from "vuex";
 import { shopHouponHas } from '@/api/coupon'
@@ -189,7 +202,9 @@ export default {
 				customId: "",
 				product: "",
         		hbId: '0',
-				packCost:0
+				packCost:0,
+				wlId:0,
+				wlName:''
 			},
 			showCustomer: false,
 			today:'',
@@ -206,7 +221,9 @@ export default {
 				long:'',
 				fullAddress:'',
 				showAddress:''
-			}
+			},
+			wlList:[],
+			wlSelData: {}
 		};
 	},
 	onLoad(e) {
@@ -244,6 +261,12 @@ export default {
 	},
 	methods: {
 		...mapActions(["initMerchantInfo"]),
+		changeWlFn(e) {
+			let that = this
+			this.wlSelData = this.wlList[e.detail.value]
+			that.form.wlId = that.wlSelData.id
+			that.form.wlName = that.wlSelData.name
+		},
 		changeSendType(num){
 			this.form.sendType = num
 			if(num == 2){
@@ -417,9 +440,29 @@ export default {
 			}).catch(err => {})
 		},
 		getGhsData(id) {
+			let that = this
 			getGhsDataApi({id:id}).then(res => {
 				this.ghsInfo = res.data
 				this.form.packCost = res.data.packCost?parseFloat(res.data.packCost):0
+				that.form.wlId = this.ghsInfo.customWlId ? this.ghsInfo.customWlId : 0
+					getGhsWl({id:id}).then(res=>{
+						if(res.code == 1){
+							that.wlList = res.data.list
+							if(Number(that.form.wlId)>0){
+								let newData = that.wlList.filter(
+									e => that.form.wlId == e.id
+								)
+								if(!this.$util.isEmpty(newData)){
+									that.wlSelData = newData[0]
+									that.form.wlId = that.wlSelData.id
+									that.form.wlName = that.wlSelData.name
+								}else{
+									that.form.wlId = 0
+									that.form.wlName = ''
+								}
+							}
+						}
+					})
 			});
 		},
 		countAllPrices(e){
@@ -454,6 +497,13 @@ export default {
 				return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount,classId:ele.classId,itemId:ele.itemId,weight:ele.weight };
 			})
 
+			if(this.form.sendType == 3){
+				if(Number(this.form.wlId)<=0){
+					this.$msg('请选择物流')
+					return false
+				}
+			}
+
 			let xj = []
 			this.selectList.forEach((item) => {
 				let hasItem = uni.getStorageSync("ghsColorItem"+this.ghsInfo.id+"_"+item.itemId)
@@ -472,6 +522,8 @@ export default {
 				product:JSON.stringify(product),
 				ghsId:this.ghsInfo.id,
 				hbId: this.form.hbId,
+				wlId:this.form.wlId,
+				wlName:this.form.wlName,
 				xj:JSON.stringify(xj)
 			}
 			let self = this;

+ 7 - 3
hdApp/src/admin/billing/affirmGhsBook.vue

@@ -47,16 +47,20 @@
 				<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 == 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>
 
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
 						<view v-if="form.sendType == 0">
-							<text style="color: #3385FF;width:100%;">本店有出车到您店,请选此项,免配送费</text>
+							<text style="color: #3385FF;width:100%;">在本店配送范围的,免费送货上门</text>
 						</view>				
 						<view v-if="form.sendType == 1">
-							<text style="color: #3385FF;width:100%;">您自己来店里取花,没有配送费</text>
+							<text style="color: #3385FF;width:100%;">您自己来店里取,没有配送费</text>
+						</view>
+						<view v-if="form.sendType == 3">
+							<text style="color: #3385FF;width:100%;">发物流,默认到付</text>
 						</view>
 					</tui-list-cell>
 

+ 4 - 0
hdApp/src/api/ghs/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 
+export const getGhsWl = data => {
+	return https.get('/ghs/get-all-wl', data)
+}
+
 export const hasClassRemind = data => {
 	return https.get('/ghs/has-class-remind', data)
 }

+ 5 - 1
hdApp/src/pagesPurchase/purDetails.vue

@@ -47,9 +47,13 @@
         <view class="order-info_box">
           <view>配送方式:</view>
           <view>
-{{ detailInfo.sendType==0?'出车':detailInfo.sendType==1?'自取':detailInfo.sendType==2?'发快递':'' }}
+{{ detailInfo.sendType==0?'出车':detailInfo.sendType==1?'自取':detailInfo.sendType==2?'发快递':detailInfo.sendType==3?'物流':'' }}
           </view>
         </view>
+        <view class="order-info_box" v-if="detailInfo.sendType==3">
+          <view>配送物流:</view>
+          <view>{{ detailInfo.wlName }}</view>
+        </view>
         <view class="order-info_box">
           <view>配送时间:</view>
           <view>{{ detailInfo.sendTimeWant }}</view>