jf 5 лет назад
Родитель
Сommit
1bc8a47039

+ 2 - 4
ghsApp/src/admin/home/order.vue

@@ -74,10 +74,8 @@
 							</view>
 						</view>
 					</view>
-					<div
-						v-if="!$util.isEmpty(item.buttonList.filter(r => r.disable == 1))"
-						class="list-bottom"
-					>
+<!--					<div 						v-if="!$util.isEmpty(item.buttonList.filter(r => r.disable == 1))"  class="list-bottom" >-->
+					<div class="list-bottom" >
 						<div class="list-button">
 							<view v-for="s in item.buttonList" :key="s.type">
 								<button

+ 6 - 0
ghsApp/src/api/order/index.js

@@ -76,6 +76,12 @@ export const debtPay = data => {
 export const hasPay = data => {
 	return https.get("/order/has-pay", data);
 };
+/** *
+	* 发快递 --姜枫 2021.03.20
+	*/
+export const sendExpressage = data => {
+	return https.get("/order/third-send", data);
+};
 
 /** *
  * 未支付订单重选花材

+ 4 - 1
ghsApp/src/components/app-address-group.vue

@@ -105,6 +105,9 @@ export default {
 			return getUserDet({ id: this.customId }).then(res => {
 				this.form.province = res.data.province;
 				this.form.city = res.data.city;
+				this.form.address = res.data.address;
+				this.form.latitude = res.data.lat;
+				this.form.longitude = res.data.long;
 				this.$emit("selectAdress", this.form);
 			})
 		},
@@ -130,7 +133,7 @@ export default {
 			this.$refs.simpleAddress.open();
 		},
 		changeAreaFn(e) {
-			this.form.address = e.address;
+			this.form.address = e.title;
 			this.form.latitude = e.location.lat;
 			this.form.longitude = e.location.lng;
 			this.$emit("selectAdress", this.form);

+ 28 - 18
ghsApp/src/components/app-form-send1.vue

@@ -43,6 +43,7 @@ export default {
 	},
 	props: {
 		customId:'',
+		orderid:'',
 		form: {
 			type: Object
 		}
@@ -57,11 +58,13 @@ export default {
 				receiveAddress: "",
 				receiveLong: "",
 				receiveLat: "",
-				sendSide: "2",
+				sendSide: "",
 				sendType: "3", //1自取 2本店送 3快递送
 				sendDate: "",
 				sendTime: ""
 			},
+			userLong:'',
+			userLat:'',
 			sendSideIndex:0,
 			deliveryList: []
 		};
@@ -87,17 +90,19 @@ export default {
 	},
 	methods: {
 		initData() {
-			// this.deliveryList
-			let list = this.getDictionariesInfo.expressList
-			for (let i=0;i<list.length;i++){
-				this.deliveryList.push({name:list[i].deliveryName,value:list[i].deliveryId,id:list[i].id})
-			}
 			for (const key in this.formData) {
 				if (Object.hasOwnProperty.call(this.formData, key)) {
 					const element = this.form[key];
 					this.formData[key] = element;
 				}
 			}
+			//配送方-列表
+			let list = this.getDictionariesInfo.expressList;
+			for (let i=0;i<list.length;i++){
+				this.deliveryList.push({name:list[i].deliveryName,value:list[i].deliveryId,id:list[i].id})
+			}
+			console.log(list);
+			this.formData.sendSide = list[0].id;
 		},
 		selectAdress(info) {
 			this.formData.receiveProvince = info.province;
@@ -106,12 +111,17 @@ export default {
 			this.formData.receiveAddress = info.address;
 			this.formData.receiveLong = info.longitude;
 			this.formData.receiveLat = info.latitude;
-
+			console.log('this.formData',this.formData)
 			this.$nextTick(() => {
 				let params = {
-					sendSide: this.formData.sendSide,
-					receiveLong: info.longitude,
-					receiveLat: info.latitude
+					customId: this.customId,
+					expressId: this.formData.sendSide,
+					city:this.formData.receiveCity,
+					address:this.formData.receiveAddress,
+					floor:this.formData.receiveFloor,
+					orderId: this.orderid,
+					long: this.formData.receiveLong,
+					lat: this.formData.receiveLat,
 				};
 				this.freightCount(params);
 			});
@@ -123,13 +133,13 @@ export default {
 			});
 		},
 		selectSideEvent(event) {
-			console.log(event);
-			console.log(event.detail.value);
-			const {
-				detail: { value }
-			} = event;
+			// console.log(event);
+			// console.log(event.detail.value);
+
+			const {detail: { value }} = event;
 			this.sendSideIndex = value;
-			this.formData.sendSide = this.deliveryList[value].value;
+			this.formData.sendSide = this.deliveryList[value].id;
+			console.log(this.formData.sendSide);
 		}
 	},
 	watch: {
@@ -138,9 +148,9 @@ export default {
 				if (val) {
 					let info = { ...this.form, ...val };
 					if (this.formData.sendTime) {
-						info.sendTime = `${this.formData.sendDate} ${this.formData.sendTime}`;
+						// info.sendTime = `${this.formData.sendDate} ${this.formData.sendTime}`;
+						info.sendTime = this.formData.sendTime;
 					}
-					console.log(2222, info);
 					this.$emit("update:form", info);
 				}
 			},

+ 2 - 2
ghsApp/src/pagesOrder/ship.vue

@@ -201,7 +201,7 @@ export default {
 		// this.init()
 	},
 	onShow(){
-		// this.init()
+		this.init()
 	},
 	methods: {
 		init() {
@@ -223,7 +223,7 @@ export default {
 		},
 		// 快递送
 		sendParcel(){
-			this.pageTo({url: "/pagesOrder/shipInfo",query: {id: this.orderInfo.customId}});
+			this.pageTo({url: "/pagesOrder/shipInfo",query: {orderId:this.option.id,id: this.orderInfo.customId}});
 			console.error('快递送')
 			// this.shipModal = true;
 		},

+ 13 - 25
ghsApp/src/pagesOrder/shipInfo.vue

@@ -5,7 +5,7 @@
 			<form>
 				<!-- 登录信息 -->
 				<view class="module-com input-line-wrap">
-					<appFormSend :form.sync="form" :customId="customId"> </appFormSend>
+					<appFormSend :form.sync="form" :customId="customId" :orderid="orderid"> </appFormSend>
 				</view>
 			</form>
 		</view>
@@ -16,9 +16,7 @@
 <!--					¥ <text class="large">{{ allPrice }}</text>-->
 <!--				</text>-->
 			</view>
-			<button class="admin-button-com blue middle" @click="formSubmit">
-				下单
-			</button>
+			<button class="admin-button-com blue middle" @click="formSubmit">发货</button>
 		</view>
 		<!-- 选择客户 -->
 		<AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn" />
@@ -37,7 +35,7 @@ import appAddressGroup from "@/components/app-address-group";
 import appSendTime from "@/components/app-send-time";
 import appFormSend from "@/components/app-form-send1";
 const formUtil = require("@/utils/formValidation.js");
-import { createOrder } from "@/api/order/index";
+import { sendExpressage } from "@/api/order/index";
 import { getUserDet } from "@/api/member/index";
 import { mapActions, mapGetters } from "vuex";
 
@@ -58,6 +56,7 @@ export default {
 	data() {
 		return {
 			customId:'',
+			orderId:'',
 			autoLoad: false,
 			form: {
 				shopId: "",
@@ -84,6 +83,7 @@ export default {
 	},
 	onLoad(e) {
 		this.customId = e.id
+		this.orderId = e.orderId
 		if (!this.getMerchantInfo) {
 			this.initMerchantInfo().then(data => {
 				uni.setNavigationBarTitle({
@@ -121,24 +121,14 @@ export default {
 			this.form.customName = info.name;
 		},
 		confirmFn(options) {
-			createOrder(options).then(res => {
-				// this.$msg("下单成功");
-				this.resetSelectInfoByType(this.pageType);
-				const {
-					data: { orderId, orderSn }
-				} = res;
-				// 如果是客户跳转到客户成功页pagesClient/official/clientApply   供货员工下单到 /admin/billing/result
-				let url =
-					this.getLoginInfo.identity == "1"
-						? "pagesClient/official/clientApply"
-						: `/admin/billing/result?orderId=${orderId}&orderSn=${orderSn}`;
-				uni.redirectTo({
-					url: url,
-					success: result => {},
-					fail: () => {},
-					complete: () => {}
-				});
-			});
+			console.log(options)
+			sendExpressage({ id: this.orderId,sendCost:options.sendCost,expressId:options.sendSide,sendTime:options.sendTime }).then(res => {
+				// this.form.province = res.data.province;
+				// this.form.city = res.data.city;
+				// this.$emit("selectAdress", this.form);
+				// uni.navigateTo({url:'/pagesOrder/ship'});
+				uni.navigateBack({delta: 1});
+			})
 		},
 		// 表单验证
 		async formSubmit(e) {
@@ -153,8 +143,6 @@ export default {
 				];
 				// 进行表单检查
 				let formData = this.form;
-				console.log(formData);
-				return;
 				if (formData.sendType == "1") {
 				} else {
 					let temp = [