Kaynağa Gözat

Merge branch 'master' of http://git.huaml.com/zhh/front-end

wangn 5 yıl önce
ebeveyn
işleme
80a9326d97

+ 35 - 12
hdApp/src/admin/billing/affirmGhs.vue

@@ -229,13 +229,13 @@
 						<button @click="form.sendType=1" class="admin-button-com mini-btn" :class="form.sendType==1?'blue':'default'">配送</button>
 						<button @tap="form.sendType=2" class="admin-button-com mini-btn" :class="form.sendType==2?'blue':'default'">自取</button>
 					</tui-list-cell>
-						<appSendTime :sendDate.sync="form.sendDate" :sendTime.sync="form.sendTime" ></appSendTime>
+						<appSendTime @alterTime="purchaseFreight(ghsMsg)" :sendDate.sync="form.sendDate" :sendTime.sync="sendTime" ></appSendTime>
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false" v-show="form.sendType == 1">
 						<view class="tui-title ">运费</view>
 						<input type="number" placeholder="留空表示免运费" @input="countAllPrices" v-model="form.sendCost" placeholder-class="tui-placeholder">
 					</tui-list-cell>
 					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
-						<textarea style="height: 100rpx" placeholder="备注..."/>
+						<textarea style="height: 100rpx" v-model="remark" placeholder="备注..."/>
 					</tui-list-cell>
 <!--					<tui-list-cell class="line-cell" :hover="false" :arrow="false">-->
 <!--						<view class="tui-title ">结算方式</view>-->
@@ -250,7 +250,7 @@
 		</view>
 		<view class="under-bar">
 			<view class="price-view">
-				<text class="price-title">{{ form.debt==1?'欠款':'已收款' }}</text>
+				<text class="price-title">总金额</text>
 				<text class="price-number">
 					¥ <text class="large">{{ allPrice+Number(form.sendCost)  }}</text>
 				</text>
@@ -258,7 +258,7 @@
 			<button class="admin-button-com blue middle" @click="affirmFormSubmit">开单</button>
 		</view>
 		<!-- 选择客户 -->
-		<AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn" />
+<!--		<AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn" />-->
 	</view>
 </template>
 
@@ -274,9 +274,9 @@ import appAddressGroup from "@/components/app-address-group";
 import appSendTime from "@/components/app-send-time";
 import appFormSend from "@/components/app-form-send";
 const formUtil = require("@/utils/formValidation.js");
-import { createOrder,freight } from "@/api/order/index";
+// import { createOrder } from "@/api/order/index";
 import { getGhsDataApi } from "@/api/ghs/index";
-// import { freight } from "@/api/order";
+import { freight,createOrder } from "@/api/purchase/index";
 import { mapActions, mapGetters } from "vuex";
 
 export default {
@@ -297,6 +297,8 @@ export default {
 		return {
 			autoLoad: false,
 			ghsMsg:'',
+			sendTime:'',
+			remark:'',
 			form: {
 				debt:1,//结算方式 1欠款订单 0正常订单
 				shopId: "",
@@ -350,7 +352,9 @@ export default {
 		},
 		getGhsData(id) {
 			getGhsDataApi({id:id}).then(res => {
-				this.ghsMsg = res.data
+				this.ghsMsg = res.data;
+				console.log('res.data',this.ghsMsg)
+				this.purchaseFreight(this.ghsMsg);
 			});
 		},
 		countAllPrices(e){
@@ -372,8 +376,7 @@ export default {
 			});
 		},
 
-		changeCustomerFn(info) {
-			console.log("changeCustomerFn", info);
+		purchaseFreight(info) {
 			let params = {
 				province: info.province,
 				city:info.city,
@@ -381,12 +384,11 @@ export default {
 				floor:info.floor,
 				long: info.long,
 				lat: info.lat,
+				sendTime: this.sendTime,
 			};
 			freight(params).then(res => {
 				this.form.sendCost = res.data.sedCost;
 			});
-			this.form.customId = info.id;
-			this.form.customName = info.name;
 		},
 		confirmFn(options) {
 			createOrder(options).then(res => {
@@ -409,13 +411,34 @@ export default {
 			});
 		},
 		affirmFormSubmit(){
+			if(this.sendTime==''){uni.showToast({title:'请先选择时间',icon:'none'});return}
+			const product = this.selectList.map(ele => {
+				return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
+			});
+			let parameter = {
+				getType:this.form.sendType,
+				sendTime:this.sendTime,
+				sendCost:this.form.sendCost,
+				remark:this.remark,
+				product:product,
+				supplierId:this.ghsMsg.id,
+			}
 			let self = this;
 			uni.showModal({
 				title: '提示',
 				content: '确认开单?',
 				success: function (res) {
 					if (res.confirm) {
-						self.formSubmit();
+						createOrder(parameter).then(res => {
+							self.resetSelectInfoByType(self.pageType);
+							const {data: { id, orderSn }} = res;
+							// 如果是客户跳转到客户成功页pagesClient/official/clientApply   供货员工下单到 /admin/billing/result
+							let url =
+								self.getLoginInfo.identity == "1"
+									? "pagesClient/official/clientApply"
+									: `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
+							uni.redirectTo({url: url,});
+						});
 					}
 				}
 			});

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

@@ -108,9 +108,9 @@
 				<!--内容部分 end -->
 			</scroll-view>
 
-			<view v-if="tabIndex == 2" class="PxClass-box">
+			<scroll-view scroll-y scroll-with-animation v-if="tabIndex == 2" class="PxClass-box">
 				<PxClassCommondity  :info="pxClassInfo"></PxClassCommondity>
-			</view>
+			</scroll-view>
 		</view>
 		<!-- :maskClosable="false" -->
 		<modal-module :show="isModel" @cancel="modalCancel" @click="affirm" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >

+ 16 - 4
hdApp/src/api/purchase/index.js

@@ -43,7 +43,7 @@ export const createPurchaseOrderApi = async data => {
 };
 
 /** *
- * 待结款 - 结款 
+ * 待结款 - 结款
  */
  export const purchaseClearCreateOrder = async data => {
 	return https.post("/purchase-clear/create-order", data);
@@ -64,7 +64,7 @@ export const createPurchaseOrderApi = async data => {
 };
 
 /** *
- * 延期支付  
+ * 延期支付
  */
  export const purchaseDebtPay = async data => {
 	return https.get("/purchase/debt-pay", data);
@@ -78,8 +78,20 @@ export const createPurchaseOrderApi = async data => {
 };
 
 /** *
- * 采购详情   
+ * 采购详情
  */
  export const purchaseWxPay = async data => {
 	return https.post("/purchase/wx-pay", data);
-};
+};
+/** *
+	* 发快递配送费计算  姜枫 2021.04.12
+	*/
+export const freight = async data => {
+	return https.post("/purchase/freight", data);
+};
+/** *
+	* 采购-下单  姜枫 2021.04.12
+	*/
+export const createOrder = async data => {
+	return https.post("/purchase/create-order", data);
+};

+ 2 - 1
hdApp/src/components/app-send-time.vue

@@ -102,11 +102,12 @@ export default {
 			let oneIndex = e.detail.value[0] || 0;
 			let twoIndex = e.detail.value[1] || 0;
 			this.timeValue = e.detail.value;
-			this.$emit("alterTime")
 			this.$emit(
 				"update:sendTime",
 				this.timeList[0][oneIndex] + ":" + this.timeList[1][twoIndex]
 			);
+			this.$emit("alterTime")
+
 		}
 	},
 	watch: {

+ 37 - 25
hdApp/src/components/module/app-pxClass-commodity.vue

@@ -1,35 +1,41 @@
 <style lang="scss" scoped>
 .PxClass-center {
-	padding: 0 20rpx;
+	border-bottom: 20px solid #f0f2f6;
 	.PxClass-list{
-		padding: 30rpx 0;
-		border-bottom: 1px solid #eeeeec;
+		border-top: 20px solid #f0f2f6;
 		.PxClass-title{
-			font-size: 30rpx;
+			padding: 30rpx;
+			font-size: 32rpx;
+			font-weight: 600;
 			text{
 				color: #aeaeae;
 				font-size: 20rpx;
 			}
 		}
 		.PxClass-msg-box{
-			margin-top: 20rpx;
+			padding: 0 30rpx 30rpx;
+			border-bottom: 1px solid #EEEEEE;
 			.PxClass-msg{
-				text{
-					color: #b2b2b2;
-					font-size: 24rpx;
-				}
-				view{
-					margin-top: 15rpx;
-					color: #ff1f1f;
+				line-height: 38rpx;
+				font-size: 30rpx;
+				font-weight: 600;
+				.PxClass-label{
 					font-size: 26rpx;
+					font-weight: 400;
+					text{
+						color: #999999;
+					}
 				}
 			}
-			.PxClass-btn{
-				width: 150rpx;
-				height: 60rpx;
-				color: #FFFFFF;
-				background: #0A98D5;
-			}
+
+		}
+		.PxClass-btn{
+			height: 70rpx;
+			margin: 10rpx 30rpx;
+			color: #FFFFFF;
+			font-size: 28rpx;
+			background: #3385FF;
+			border-radius: 8rpx;
 		}
 	}
 }
@@ -37,16 +43,22 @@
 <template>
 	<view class="PxClass-center">
 			<view class="PxClass-list" v-for="(res,i) in info">
-				<view class="flex-space PxClass-title">
-					{{res.name}} <text class="">学员数:{{res.num}}</text>
-				</view>
-				<view class="flex-space PxClass-msg-box">
+				<view class="flex-space PxClass-title">{{res.name}} </view>
+				<view class="PxClass-msg-box">
 					<view class="PxClass-msg">
-						<text>{{ res.lesson }}个节时</text>
-						<view>¥{{ res.tuition }}</view>
+
+						<view class="PxClass-label"><text>课时:</text>{{ res.lesson }}个节时</view>
+
+						<view class="flex-space">
+							<view class="PxClass-label"><text>人数:</text> {{res.num}}</view>
+							¥{{ res.tuition }}
+						</view>
+
 					</view>
-					<view class="flex-center PxClass-btn" @tap="toAffirmPxClass(res)">开单</view>
 				</view>
+
+				<view class="flex-center PxClass-btn" @tap="toAffirmPxClass(res)">开单</view>
+
 			</view>
 	</view>
 </template>