shish 3 лет назад
Родитель
Сommit
80326a9f13
2 измененных файлов с 72 добавлено и 20 удалено
  1. 16 16
      hdApp/src/admin/billing/affirmGhs.vue
  2. 56 4
      hdApp/src/admin/billing/affirmGhsBook.vue

+ 16 - 16
hdApp/src/admin/billing/affirmGhs.vue

@@ -445,24 +445,24 @@ export default {
 				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 = ''
-								}
+				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){

+ 56 - 4
hdApp/src/admin/billing/affirmGhsBook.vue

@@ -64,6 +64,15 @@
 						</view>
 					</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" :arrow="true">
 						<view class="tui-title ">配送时间</view>
 						<picker mode="date" :value="sendTimeWant" @change="bindDateChange" style="width:400upx;">
@@ -107,7 +116,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/index";
 import { freight,createOrder } from "@/api/purchase/index";
 import { mapActions, mapGetters } from "vuex";
 import { shopHouponHas } from '@/api/coupon'
@@ -152,13 +161,17 @@ export default {
 				packCost:0,
 				customId: "",
 				product: "",
-        		hbId: '0'
+        		hbId: '0',
+				wlId:0,
+				wlName:''
 			},
 			showCustomer: false,
 			today:'',
 			monthLater:'',
 			hasHb:0,
-			selectedHb:{couponAmount:0,hbId:0,couponSelInx:0}
+			selectedHb:{couponAmount:0,hbId:0,couponSelInx:0},
+			wlList:[],
+			wlSelData: {}
 		};
 	},
 	onLoad(e) {
@@ -187,6 +200,12 @@ export default {
 		init() {
 			this._getDet()
 		},
+		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
 		},
@@ -212,8 +231,30 @@ export default {
 			}).catch(err => {})
 		},
 		getGhsData(id) {
+			let that = this
 			getGhsDataApi({id:id}).then(res => {
-				this.ghsInfo = res.data;
+				that.ghsInfo = res.data;
+
+				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){
@@ -270,10 +311,19 @@ export default {
 				this.$msg('请选择花材')
 				return false				
 			}
+
+			if(this.form.sendType == 3){
+				if(Number(this.form.wlId)<=0){
+					this.$msg('请选择物流')
+					return false
+				}
+			}
+
 			if(this.sendTimeWant==''){
 				this.$msg('请选择配送时间')
 				return false
 			}
+
 			let xj = []
 			this.selectList.forEach((item) => {
 				let hasItem = uni.getStorageSync("ghsColorItem"+this.ghsInfo.id+"_"+item.itemId)
@@ -290,6 +340,8 @@ export default {
 				ghsId:this.ghsInfo.id,
 				hbId: this.form.hbId,
 				xj:JSON.stringify(xj),
+				wlId:this.form.wlId,
+				wlName:this.form.wlName,
 				//预订单
 				book:1
 			}