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

+ 9 - 9
hdApp/src/App.vue

@@ -54,15 +54,15 @@ import store from '@/store'
 					})
 					if (needRedirect === true) {
 						//非员工
-						if (res.data.admin.identity == '1') {
-							this.$util.pageTo({
-								url: "/pagesClient/official/index",
-								type: 2,
-								query: {
-									...this.option
-								}
-							});
-						}
+						// if (res.data.admin.identity == '1') {
+						// 	this.$util.pageTo({
+						// 		url: "/pagesClient/official/index",
+						// 		type: 2,
+						// 		query: {
+						// 			...this.option
+						// 		}
+						// 	});
+						// }
 					}
 					getUser(true)
 					//获取门店信息

+ 429 - 0
hdApp/src/admin/billing/affirmPxClass.vue

@@ -0,0 +1,429 @@
+<template>
+	<view class="affirm-page">
+		<view class="affirm-view overscroll">
+			<!-- 门店信息 -->
+			<form>
+				<view class="module-com">
+					<view class="commodity-view">
+						<view class="commodity-list">
+							<view
+								class="commodity-item"
+								v-for="(item, index) in selectList"
+								:key="index"
+							>
+								<image class="item-icon" :src="item.cover" alt="商品图" />
+
+								<view class="item-info">
+									<view class="info-line">
+										<text class="item-name">{{ item.itemName }}</text>
+										<text class="item-price">
+											<text class="unit">¥</text>
+
+											<text class="price">
+												{{ getSelectItemPrice(item) }}
+											</text>
+										</text>
+									</view>
+									<view class="info-line">
+										<text class="item-type">{{ item.rank }}级</text>
+										<text class="item-count">
+											<text v-if="item.bigCount > 0 || item.smallCount > 0">{{
+												`${item.bigCount}`
+											}}</text>
+											<text v-if="item.smallCount > 0">/</text>
+											<text v-if="smallCount > 0">{{ `${smallCount}` }}</text>
+										</text>
+									</view>
+								</view>
+							</view>
+						</view>
+						<view class="summary-bar">
+							<view class="operate-view" @click="gobackEvent">
+								<text class="iconfont icongouwuche"></text>
+								重选花材
+							</view>
+							<view class="describe-view">
+								共{{ allCount }}种,
+								<!-- 共16扎9支, -->
+								合计 ¥<text class="price">{{ allPrice }}</text>
+							</view>
+						</view>
+					</view>
+				</view>
+				<!-- 登录信息 -->
+				<view class="module-com input-line-wrap">
+					<tui-list-cell class="line-cell" :hover="false" :arrow="true">
+						<view class="tui-title ">客户</view>
+						<view class="tui-input" v-if="form.customId" @click="showCustomer = true">{{ form.customName }}</view>
+						<view class="tui-placeholder" style="width: 100%" v-else @click="showCustomer = true">请选择客户</view>
+					</tui-list-cell>
+					<tui-list-cell class="line-cell" :hover="false" :arrow="false">
+						<view class="tui-title ">送货</view>
+						<button @tap="form.sendType=2" class="admin-button-com mini-btn" :class="form.sendType==2?'blue':'default'">自取</button>
+						<button @click="form.sendType=1" class="admin-button-com mini-btn" :class="form.sendType==1?'blue':'default'">配送</button>
+					</tui-list-cell>
+					<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">
+						<view class="tui-title ">结算方式</view>
+						<button @tap="form.debt=1" class="admin-button-com mini-btn" :class="form.debt==1?'blue':'default'">欠款</button>
+						<button @click="form.debt=0" class="admin-button-com mini-btn" :class="form.debt==0?'blue':'default'">已收款</button>
+					</tui-list-cell>
+
+
+<!--					<appFormSend :form.sync="form"> </appFormSend>-->
+				</view>
+			</form>
+		</view>
+		<view class="under-bar">
+			<view class="price-view">
+				<text class="price-title">{{ form.debt==1?'欠款':'已收款' }}</text>
+				<text class="price-number">
+					¥ <text class="large">{{ allPrice+Number(form.sendCost)  }}</text>
+				</text>
+			</view>
+			<button class="admin-button-com blue middle" @click="affirmFormSubmit">开单</button>
+		</view>
+		<!-- 选择客户 -->
+		<AppCustomerSel :show.sync="showCustomer" @change="changeCustomerFn" />
+	</view>
+</template>
+
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import AppAvatarModule from "@/components/module/app-avatar";
+import SimpleAddress from "@/components/plugin/simple-address";
+import AppAreaSel from "@/components/app-area-sel";
+import AppCustomerSel from "@/components/app-customer-sel";
+import productMins from "@/mixins/product";
+import appFormRadioBtn from "@/components/app-formRadio-btn";
+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 { freight } from "@/api/order";
+import { mapActions, mapGetters } from "vuex";
+
+export default {
+	name: "BillingAffirm", // 开单确认
+	components: {
+		TuiListCell,
+		AppAvatarModule,
+		SimpleAddress,
+		AppAreaSel,
+		AppCustomerSel,
+		appFormRadioBtn,
+		appAddressGroup,
+		appSendTime,
+		appFormSend
+	},
+	mixins: [productMins],
+	data() {
+		return {
+			autoLoad: false,
+			form: {
+				debt:1,//结算方式 1欠款订单 0正常订单
+				shopId: "",
+				shopName: "",
+				receiveProvince: "",
+				receiveCity: "",
+				receiveFloor: "",
+				receiveAddress: "",
+				receiveLong: "",
+				receiveLat: "",
+				sendType: 2,
+				sendSide: "2",
+				sendDate: "",
+				sendTime: "",
+				sendCost: "",
+				customId: "",
+				product: ""
+			},
+
+			// 详细地址
+			// showRegion: false,
+			showCustomer: false
+		};
+	},
+	onLoad() {
+		if (!this.getMerchantInfo) {
+			this.initMerchantInfo().then(data => {
+				uni.setNavigationBarTitle({
+					title: data.name
+				});
+			});
+		} else {
+			uni.setNavigationBarTitle({
+				title: this.getMerchantInfo.name
+			});
+		}
+	},
+	computed: {
+		...mapGetters(["getMerchantInfo", "getLoginInfo"])
+	},
+	methods: {
+		...mapActions(["initMerchantInfo"]),
+		init() {
+			this._getDet();
+		},
+		countAllPrices(e){
+			this.allPrices = this.allPrices+Number(this.form.sendCost)
+			console.log('e',e)
+			console.log('this.form.sendCost',Number(this.form.sendCost))
+			console.log('this.form.sendCost',this.form.sendCost)
+			console.log('this.allPrices',this.allPrices)
+		},
+
+		// api
+		_getDet() {
+			let data = uni.getStorageSync("modifyShopB");
+			if (this.$util.isEmpty(data)) return;
+			Object.keys(this.form).forEach((i, index) => {
+				// if (i != 'password') {
+				this.form[i] = data[i];
+				// }
+			});
+		},
+
+		changeCustomerFn(info) {
+			console.log("changeCustomerFn", info);
+			let params = {
+				province: info.province,
+				city:info.city,
+				address:info.address,
+				floor:info.floor,
+				long: info.long,
+				lat: info.lat,
+			};
+			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 => {
+				// this.$msg("下单成功");
+				this.resetSelectInfoByType(this.pageType);
+				const {
+					data: { id, orderSn }
+				} = res;
+				// 如果是客户跳转到客户成功页pagesClient/official/clientApply   供货员工下单到 /admin/billing/result
+				let url =
+					this.getLoginInfo.identity == "1"
+						? "pagesClient/official/clientApply"
+						: `/admin/billing/result?orderId=${id}&orderSn=${orderSn}`;
+				uni.redirectTo({
+					url: url,
+					success: result => {},
+					fail: () => {},
+					complete: () => {}
+				});
+			});
+		},
+		affirmFormSubmit(){
+			let self = this;
+			uni.showModal({
+				title: '提示',
+				content: '确认开单?',
+				success: function (res) {
+					if (res.confirm) {
+						self.formSubmit();
+					}
+				}
+			});
+		},
+		// 表单验证
+		async formSubmit(e) {
+			try {
+				// 进行表单检查
+				let formData = this.form;
+
+				const product = this.selectList.map(ele => {
+					return { productId: ele.id, bigNum: ele.bigCount, smallNum: ele.smallCount };
+				});
+				formData.product = JSON.stringify(product);
+				if (!this.getMerchantInfo) {
+					await this.initMerchantInfo();
+				}
+				formData.shopId = this.getMerchantInfo.id;
+
+				console.log(9999, formData);
+				// this.confirmFn(formData);
+				// let rules = rules.concat(temp);
+				let checkRes = formUtil.validation(formData, []);
+				// 验证通过!
+				if (!checkRes) {
+					this.confirmFn(formData);
+				} else {
+					this.$msg(checkRes);
+				}
+			} catch (error) {
+				console.log(999999, error);
+			}
+		},
+		gobackEvent() {
+			uni.navigateBack({
+				delta: 1
+			});
+		}
+	}
+};
+</script>
+
+<style lang="scss" scoped>
+.admin-button-com {
+	margin-right: 20upx;
+}
+.affirm-page {
+	position: relative;
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+
+	.affirm-view {
+		flex: 1;
+		padding: 20px;
+		background-color: #f0f2f6;
+
+		.commodity-view {
+			display: flex;
+			flex-direction: column;
+			.commodity-list {
+				padding: 20px;
+				.commodity-item {
+					display: flex;
+					margin-bottom: 20px;
+					.item-icon {
+						flex-shrink: 0;
+						width: 140px;
+						height: 140px;
+					}
+					.item-info {
+						display: flex;
+						flex-direction: column;
+						justify-content: center;
+						flex: 1;
+						margin-left: 20px;
+						.info-line {
+							margin-bottom: 20px;
+							display: flex;
+							justify-content: space-between;
+							align-items: flex-end;
+							.item-name {
+								color: #666;
+								font-size: 28px;
+							}
+							.item-price {
+								color: #333;
+								font-size: 22px;
+								.price {
+									font-size: 32px;
+									font-weight: bold;
+								}
+							}
+							.item-type {
+								color: #999;
+								font-size: 24px;
+							}
+							.item-count {
+								color: #666;
+								font-size: 24px;
+							}
+						}
+					}
+				}
+			}
+			.summary-bar {
+				padding: 0 20px;
+				height: 90px;
+				display: flex;
+
+				align-items: center;
+				justify-content: space-between;
+				border-top: 1px solid #eeeeee;
+				.operate-view {
+					display: flex;
+
+					align-items: center;
+					color: #3385ff;
+					font-size: 26px;
+					.iconfont {
+						margin-right: 20px;
+						font-size: 40px;
+					}
+				}
+				.describe-view {
+					display: flex;
+
+					align-items: center;
+					color: #333;
+					font-size: 24px;
+					.price {
+						font-weight: bold;
+						font-size: 36px;
+					}
+				}
+			}
+		}
+
+		.module-com {
+			background-color: #fff;
+			margin-bottom: 20px;
+
+			border-radius: 10px;
+			overflow: hidden;
+			.member-wrap {
+				.member-det {
+					font-size: 24px;
+					margin-left: 20px;
+				}
+			}
+			.remark-wrap {
+				align-items: flex-start;
+				.remark {
+					height: 240px;
+				}
+			}
+			// .tui-placeholder,
+			// .tui-input {
+			// 	padding-right: 30px;
+			// 	width: 100%;
+			// 	text-align: right;
+			// }
+		}
+	}
+	.under-bar {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 20px;
+		width: 100%;
+		height: 100px;
+		background-color: #fff;
+
+		box-shadow: 0px -1px 6px 0px rgba(4, 0, 0, 0.06);
+		.price-view {
+			display: flex;
+			align-items: center;
+			font-size: 24px;
+			.price-title {
+				color: #333;
+			}
+			.price-number {
+				margin: 0 20px;
+				color: #ff2842;
+				.large {
+					font-size: 40px;
+				}
+			}
+		}
+		.admin-button-com {
+			width: 200px;
+		}
+	}
+}
+</style>

+ 19 - 11
hdApp/src/admin/billing/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="billing_box_bg">
-		<app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="50%" />
+		<app-tabs :tabs="tabs" :currentTab="tabIndex" @change="change" itemWidth="33.3%" />
 		<view class="input-wrap" v-if="tabIndex == 0">
 			<app-search-module v-model="py" placeholder="请输入关键词,支持拼音首字母搜索" @search="searchFn" />
 		</view>
@@ -64,11 +64,14 @@
 				</block>
 				<!--内容部分 end -->
 			</scroll-view>
-			<block v-else>
+			<block v-if="tabIndex == 1">
 				<view style="width:100%">
 					<AppWrapperEmpty :type="'billing'" :is-empty="true" />
 				</view>
 			</block>
+			<view v-if="tabIndex == 2" class="PxClass-box">
+				<PxClassCommondity  :info="pxClassInfo"></PxClassCommondity>
+			</view>
 		</view>
 		<!-- :maskClosable="false" -->
 		<modal-module :show="isModel" @cancel="modalCancel" @click="affirm" :title="customData.itemName" color="#333" :size="32" padding="30rpx 30rpx" >
@@ -110,6 +113,7 @@ import AppSearchModule from "@/components/module/app-search";
 import AppTabs from "@/components/plugin/tabs";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
 import Commondity from "@/components/module/app-commodity";
+import PxClassCommondity from "@/components/module/app-pxClass-commodity";
 import FooterCart from "@/components/module/app-footer-cart";
 import ModalModule from "@/components/plugin/modal";
 
@@ -118,6 +122,7 @@ import allMoreSelectInputMins from "@/mixins/allMoreSelectInput";
 
 import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product";
+import pxClassMins from "@/mixins/product";
 export default {
 	name: "Billing", // 开单
 	components: {
@@ -126,23 +131,23 @@ export default {
 		AppWrapperEmpty,
 		Commondity,
 		ModalModule,
-		FooterCart,allMoreSelectInput
+		FooterCart,allMoreSelectInput,PxClassCommondity
 	},
-	mixins: [productMins,allMoreSelectInputMins],
+	mixins: [productMins,allMoreSelectInputMins,pxClassMins],
 	data() {
 		return {
 			COMMODITY_TYPE,
-			tabIndex: 0,
+			tabIndex: 2,
 			tabs: [
 				{
-					name: "批发"
+					name: "成品"
 				},
 				{
-					name: "零售"
-				}
-				// {
-				//     name: '课程'
-				// },
+					name: "组合"
+				},
+				{
+				    name: '课程'
+				},
 			],
 			isModel: false,
 			customData: {
@@ -348,5 +353,8 @@ export default {
 			}
 		}
 	}
+	.PxClass-box{
+		width: 100%;
+	}
 }
 </style>

+ 6 - 0
hdApp/src/api/product/index.js

@@ -33,3 +33,9 @@ export const autoPriceByIdApi = data => {
 export const changePriceByIdApi = data => {
 	return https.post("/product/change-price", data);
 };
+/** *
+	* 培训班开单列表(课程开单)
+	*/
+export const getPxClassDataApi = data => {
+	return https.get("/px-class/list", data);
+};

+ 87 - 0
hdApp/src/components/module/app-pxClass-commodity.vue

@@ -0,0 +1,87 @@
+<style lang="scss" scoped>
+.PxClass-center {
+	padding: 0 20rpx;
+	.PxClass-list{
+		padding: 30rpx 0;
+		border-bottom: 1px solid #eeeeec;
+		.PxClass-title{
+			font-size: 30rpx;
+			text{
+				color: #aeaeae;
+				font-size: 20rpx;
+			}
+		}
+		.PxClass-msg-box{
+			margin-top: 20rpx;
+			.PxClass-msg{
+				text{
+					color: #b2b2b2;
+					font-size: 24rpx;
+				}
+				view{
+					margin-top: 15rpx;
+					color: #ff1f1f;
+					font-size: 26rpx;
+				}
+			}
+			.PxClass-btn{
+				width: 150rpx;
+				height: 60rpx;
+				color: #FFFFFF;
+				background: #0A98D5;
+			}
+		}
+	}
+}
+</style>
+<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="PxClass-msg">
+						<text>{{ res.lesson }}个节时</text>
+						<view>¥{{ res.tuition }}</view>
+					</view>
+					<view class="flex-center PxClass-btn" @tap="toAffirmPxClass(res)">开单</view>
+				</view>
+			</view>
+	</view>
+</template>
+
+<script>
+import { COMMODITY_TYPE } from "@/utils/declare";
+import AppImg from "@/components/app-img";
+import productMins from "@/mixins/productContrapose";
+import animationMins from "@/mixins/animation";
+export default {
+	name: "PxClassCommodity",
+	components: {		AppImg	},
+	mixins: [productMins,animationMins],
+	props: {
+		info: {
+			required: true,
+			type: Object,
+			default() {
+				return {};
+			}
+		},
+	},
+	data() {
+		return {
+			COMMODITY_TYPE,
+		};
+	},
+	created() {},
+	mounted() {},
+	methods: {
+		toAffirmPxClass(){
+			uni.navigateTo({url:''})
+		},
+	}
+};
+</script>
+
+

+ 18 - 34
hdApp/src/mixins/product.js

@@ -1,4 +1,4 @@
-import { getProductDataApi } from "@/api/product/index";
+import { getProductDataApi,getPxClassDataApi } from "@/api/product/index";
 import { mapGetters, mapActions } from "vuex";
 import { copyObject } from "@/utils/util";
 export default {
@@ -7,6 +7,7 @@ export default {
 			pageType: "bill", //选择商品页面类别  用于区分不同功能的数据
 
 			productInfo: [], //商品信息
+			pxClassInfo: [], //培训班开单列表
 			classIndex: 0, //当前商品类别下标
 			py: "", //拼音搜索条件
 			type: "", //库存预警时,固定为waring,其他情况不传或者传空
@@ -19,7 +20,7 @@ export default {
 		if (pageType) {
 			this.pageType = pageType;
 		}
-
+		this.initPxClassData();
 		if (this.autoLoad) {
 			this.initData();
 		}
@@ -150,22 +151,6 @@ export default {
 				uni.hideLoading();
 			}
 		},
-		/**
-		 * 通过id获取当前选中的该商品信息
-		 */
-		// getSelectItemInfoById(id, classId) {
-		// 	let info = null;
-		// 	const item =
-		// 		this.productInfo &&
-		// 		this.productInfo.forEach(element => {
-		// 			if (element.classId == classId && element.child) {
-		// 				info = element.child.find(ele => {
-		// 					return ele.id == id;
-		// 				});
-		// 			}
-		// 		});
-		// 	return info;
-		// },
 		/**
 		 * 获取当前选中商品总价
 		 */
@@ -408,21 +393,6 @@ export default {
 			}
 			this.setSelectInfoByType({ type: this.pageType, info: list });
 		},
-		// /**
-		//  * 删除商品
-		//  */
-		// removeEvent(item) {
-		// 	const list = this.selectList;
-		// 	for (let index = list.length - 1; index >= 0; index--) {
-		// 		const element = list[index];
-		// 		if (element.id == item.id && element.classId == item.classId) {
-		// 			list.splice(index, 1);
-		// 			break;
-		// 		}
-		// 	}
-		// 	this.setSelectInfoByType({ type: this.pageType, info: list });
-		// 	// this.$forceUpdate();
-		// },
 		/**
 		 * 更新商品
 		 */
@@ -473,6 +443,20 @@ export default {
 		/**
 		 * 搜索对应花材
 		 */
-		searchFn() {}
+		searchFn() {},
+
+
+		/**
+			* 请求课程数据
+			*/
+		async initPxClassData() {
+			try {
+				const { data } = await getPxClassDataApi();
+				this.pxClassInfo = data.list;
+			} catch (error) {
+			} finally {
+				uni.hideLoading();
+			}
+		},
 	}
 };

+ 6 - 0
hdApp/src/pages.json

@@ -444,6 +444,12 @@
 						"navigationBarTitleText": "确认下单"
 					}
 				},
+				{
+					"path": "affirmPxClass",
+					"style": {
+						"navigationBarTitleText": "确认下单"
+					}
+				},
 				{
 					"path": "customerAffirm",
 					"style": {

+ 4 - 0
hdApp/src/static/css/reset.scss

@@ -140,3 +140,7 @@ image {
 uni-button::after {
     border: none;
 }
+.flex{display: flex;align-items: center};
+.flex-center{display: flex;align-items: center;justify-content: center};
+.flex-space{display: flex;align-items: center;justify-content: space-between};
+.flex-end{display: flex;align-items: center;justify-content: end};