From f8ac14dfe690ce43e8f2c76d07487bc9794cbcc9 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Mon, 18 Jan 2021 23:51:09 +0800
Subject: [PATCH] mdoify

---
 zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html |   55 ++++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 46 insertions(+), 9 deletions(-)

diff --git a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html
index 5d05893..66b5414 100644
--- a/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html
+++ b/zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/cz-form.html
@@ -161,11 +161,14 @@
 <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script>
 <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script>
 <script type="text/javascript"  th:inline="javascript">
+	var vipId = $.query.get("vipId");
+
 	//<![CDATA[
 	var vue = new Vue({
 		el: '#app',
 		data : {
 			cardInfo : "",
+			loginUser : "",
 			rechargeMoney : "",
 			payMethods: [{
 				value: '现金支付',
@@ -208,6 +211,7 @@
 			let _this = this;
 			this.cardInfo = /*[[${obj}]]*/
 
+			this.cardInfo.vipId = vipId;
 			//获取用户列表
 			AjaxProxy.requst({
 				app: _this,
@@ -216,10 +220,37 @@
 					_this.userList = data.rows;
 				}
 			});
+
+			//获取登录用户信息
+			AjaxProxy.requst({
+				app: _this,
+				url: basePath + '/admin/getLoginUser',
+				callback: function (data) {
+					_this.loginUser = data.mapInfo.user;
+
+					_this.achieveList.push({
+						saleId: _this.loginUser.suId,
+						achieveMoney: 0,
+						commission : 0,
+						isShare: false,
+					});
+				}
+			});
 		},
 		methods : {
 			submitRecharge() {
 				let _this = this;
+
+				if (!_this.rechargeMoney) {
+					this.$message.warning("请输入充值金额");
+					return;
+				}
+
+				if (_this.rechargeMoney < 0.1) {
+					this.$message.warning("0.1元起充");
+					return;
+				}
+
 				if (_this.payMoneys.length > 0) {
 					let flows = []
 					var total = 0;
@@ -231,28 +262,25 @@
 							return false;
 						}
 						flow.amount = item.money;
-						if (item.type == '储值卡'){
-							flow.isGift = item.isGift;
-							flow.cardId = item.id;
-						}
 						total += item.money;
-						flows.push(flow)
+						flows.push(flow);
 					})
-					if (total > _this.order.arrears) {
-						this.$message.warning("输入付款总金额大于应还金额");
+					if (total == _this.rechargeMoney) {
+						this.$message.warning("付款金额应等于充值金额");
 						return false;
 					}
-					_this.order.flows = flows;
+					_this.cardInfo.flows = flows;
 				} else {
 					this.$message.warning("请选择支付方式");
 					return false;
 				}
 
+				_this.cardInfo.bjMoney = _this.rechargeMoney;
 				let url = basePath + "/admin/moneyCardUse/cz";
 
 				AjaxProxy.requst({
 					app: _this,
-					data: _this.order,
+					data: _this.cardInfo,
 					url: url,
 					callback: function (data) {
 						if (_this.printPaper) {
@@ -339,6 +367,15 @@
 			closeFrame() {
 				parent.layer.close(parent.layer.getFrameIndex(window.name));
 			},
+			shareAchieve(index, row) {
+				row2 = JSON.parse(JSON.stringify(row));
+				row2.isShare = true;
+				this.achieveList.push(row2);
+			},
+			//删除业绩
+			delAchieve(index, row) {
+				this.achieveList.splice(index, 1);
+			},
 		}
 	});
 	//]]>

--
Gitblit v1.9.1