Browse Source

2023-12-15

cmy 1 year ago
parent
commit
ecc3c93f58
3 changed files with 9 additions and 294 deletions
  1. 1 31
      src/pages/cashier/index.vue
  2. 0 96
      src/pages/cashier/reservation.vue
  3. 8 167
      src/pages/cashier/servecard.vue

+ 1 - 31
src/pages/cashier/index.vue

@@ -464,11 +464,6 @@
 						</div>
 					</div>
 				</div>
-				<!-- <Button type="primary" class="bnt" @click="confirm">确认</Button> -->
-				<!-- 	<div v-else>
-					<Button type="primary" class="bnt" @click="confirmOrder" v-if="isOrderCreate">确认</Button>
-					<Button type="primary" class="bnt" @click="confirm" v-else>创建订单</Button>
-				</div> -->
 			</div>
 		</Modal>
 		<Modal v-model="modalCash" class="cash" footer-hide width="770px" @on-cancel="cancel">
@@ -1145,6 +1140,7 @@
 			cashBnt(payNum) {
 				if (this.cashBntLoading) return;
 				this.cashBntLoading = true;
+				this.payNum = payNum;
 				if (this.isOrderCreate) {
 					this.getCashierPay("cash");
 				} else {
@@ -1246,32 +1242,6 @@
 				this.createOrder.staff_id = this.storeInfos.id;
 				// this.fapi.resetFields();
 			},
-			// 线上支付和余额支付
-			confirm(payNum) {
-				this.createOrder.userCode = payNum;
-				this.createOrder.auth_code = payNum;
-				if (this.payType == "yue") {
-					// this.createOrder.userCode = this.payNum;
-					if (!this.createOrder.userCode && this.priceInfo.is_cashier_yue_pay_verify) {
-						return this.$Message.error("请扫描个人中心二维码");
-					}
-					if (this.isOrderCreate) {
-						this.getCashierPay("yue");
-					} else {
-						this.orderCreate();
-					}
-				} else if (this.payType == "") {
-					// this.createOrder.auth_code = this.payNum;
-					if (!this.createOrder.auth_code) {
-						return this.$Message.error("请扫描您的付款码");
-					}
-					if (this.isOrderCreate) {
-						this.getCashierPay("");
-					} else {
-						this.orderCreate();
-					}
-				}
-			},
 			modalPayCancel() {
 				this.$Message.destroy();
 				if (this.orderSystem.timer) {

+ 0 - 96
src/pages/cashier/reservation.vue

@@ -287,66 +287,6 @@
 				discountPrice: 100,
 				loading: false,
 				cashBntLoading: false,
-				currentid: "",
-				columns: [{
-						title: "选择",
-						key: "chose",
-						width: 60,
-						align: "center",
-						render: (h, params) => {
-							let id = params.row.id;
-							let flag = false;
-							if (this.currentid === id) {
-								flag = true;
-							} else {
-								flag = false;
-							}
-							let self = this;
-							return h("div", [
-								h("Radio", {
-									props: {
-										value: flag,
-									},
-									on: {
-										"on-change": () => {
-											self.currentid = id;
-											let data = {
-												uid: params.row.uid,
-											};
-											let touristId = params.row.tourist_uid;
-											if (params.row.uid) {
-												this.userInfoData(data);
-											} else {
-												this.setUp(touristId);
-											}
-										},
-									},
-								}),
-							]);
-						},
-					},
-					{
-						title: "用户",
-						slot: "nickname",
-						minWidth: 70,
-					},
-					{
-						title: "订单金额",
-						key: "price",
-						minWidth: 70,
-					},
-					{
-						title: "时间",
-						key: "_add_time",
-						minWidth: 70,
-					},
-					{
-						title: "操作",
-						slot: "action",
-						minWidth: 100,
-						align: "center",
-					},
-				],
 				checkOut: 0,
 				modalUser: false,
 				modalStaff: false,
@@ -369,10 +309,6 @@
 				},
 				total: 0,
 				goodData: [],
-				cateData: [],
-				currentCate: 0, //分类的当前index;
-				currentTab: "2",
-				codeNum: "",
 				payNum: "",
 				userInfo: {},
 				staffInfo: {
@@ -964,9 +900,6 @@
 			// 修改用户
 			setUser() {
 				this.modalUser = true;
-				// this.$refs.users.currentid = 0;
-				// this.$refs.users.modals = true
-				// this.$refs.users.cancel();
 			},
 			// 当前选中门店店员信息
 			getStoreId(e) {
@@ -1063,26 +996,6 @@
 					this.setUser();
 				}
 			},
-			//员工列表
-			cateList() {
-				cashierCate()
-					.then((res) => {
-						let all = [{
-								cate_name: "全部商品",
-								id: "",
-							},
-							{
-								cate_name: "活动商品",
-								id: "99999",
-							},
-						];
-						let data = [...all, ...res.data];
-						this.cateData = data;
-					})
-					.catch((err) => {
-						this.$Message.error(err.msg);
-					});
-			},
 			//商品列表
 			goodList(type) {
 				this.activityFrom.uid = this.userInfo ? this.userInfo.uid : 0;
@@ -1101,15 +1014,6 @@
 
 				});
 			},
-			// 去凑单
-			collectOrder(item) {
-				this.currentCate = 1;
-				this.activityFrom.promotions_id = item.id;
-				this.activityFrom.page = 1;
-				this.activityFrom.type = item.promotions_type;
-				this.reloadList();
-				this.goodList(item.promotions_type);
-			},
 			//搜索
 			orderSearch() {
 				this.goodFrom.page = 1;

+ 8 - 167
src/pages/cashier/servecard.vue

@@ -234,7 +234,7 @@
 			<userList v-if="modalUser" ref="users" :uid="userInfo.uid || 0" @getUserId="getUserId"></userList>
 		</Modal>
 		<settleDrawer v-model="settleVisible" :list="payList" :type="payType" :money="settleMoney"
-			@close='defaultcalc=false' :collection="collection" :verify="yueVerify" :z-index="zIndex"
+			@close='cancel' :collection="collection" :verify="yueVerify" :z-index="zIndex"
 			@payPrice="payPrice" @numTap="numTap" @delNum="delNum" @cashBnt="cashBnt"></settleDrawer>
 		<recharge ref="recharge" v-model="rechargeVisible" :userInfo="userInfo" @getSuccess="getSuccess"
 			@recharge="onRecharge"></recharge>
@@ -359,8 +359,6 @@
 				},
 				total: 0,
 				goodData: [],
-				currentCate: 0, //分类的当前index;
-				currentTab: "2",
 				codeNum: "",
 				payNum: "",
 				userInfo: {},
@@ -374,7 +372,6 @@
 				productValue: [],
 				attrValue: "", //已选属性
 				productId: 0, //产品id
-				seckillId: 0, //秒杀商品id
 				cartList: [],
 				isCart: 0,
 				cartInfo: {
@@ -385,30 +382,6 @@
 				},
 				modal: false,
 				fapi: {},
-				rule: [{
-					type: "input",
-					field: "remarks",
-					title: "备注",
-					props: {
-						type: "textarea",
-						maxlength: 100,
-						"show-word-limit": true,
-					},
-				}, ],
-				modal2: false,
-				rule2: [{
-					type: "InputNumber",
-					field: "change_price",
-					title: "实付款",
-					value: 0,
-					props: {
-						min: 0,
-					},
-				}, ],
-				integral: false, //是否使用积分
-				coupon: false, //是否使用优惠券
-				couponId: 0, //优惠券id
-				payTypeModal: false,
 				cartSum: 0,
 				priceInfo: {},
 				createOrder: {
@@ -432,7 +405,6 @@
 				cartHeight: 0,
 				goodsHeight: 0,
 				invalidList: [],
-				promotionsList: [],
 				defaultcalc: false,
 				orderSystem: {
 					loadingMsg: null,
@@ -598,7 +570,6 @@
 				this.priceInfo.vipPrice = 0;
 				this.priceInfo.sumPrice = 0;
 				this.cartList = [];
-				this.promotionsList = [];
 				this.cartSum = 0;
 				this.collection = 0;
 				this.collectionArray = [];
@@ -608,9 +579,11 @@
 				this.activityFrom.type = 0;
 				this.goodFrom.cate_id = "";
 			},
+			// 关闭支付弹窗
 			cancel() {
 				this.collection = 0;
 				this.collectionArray = [];
+				this.defaultcalc = false
 			},
 			defaultSel(type) {
 				let uid = this.userInfo.uid;
@@ -655,6 +628,7 @@
 			cashBnt(payNum) {
 				if (this.cashBntLoading) return;
 				this.cashBntLoading = true;
+				this.payNum = payNum
 				if (this.isOrderCreate) {
 					this.getCashierPay("cash");
 				} else {
@@ -726,7 +700,6 @@
 							this.isOrderCreate = 0;
 							this.$Message.success("支付成功");
 							this.goodList();
-							this.changePoints();
 							let storage = window.localStorage;
 							storage.setItem("cashierUser", JSON.stringify(this.userInfo));
 							this.clear();
@@ -755,32 +728,6 @@
 				this.createOrder.staff_id = this.storeInfos.id;
 				// this.fapi.resetFields();
 			},
-			// 线上支付和余额支付
-			confirm(payNum) {
-				this.createOrder.userCode = payNum;
-				this.createOrder.auth_code = payNum;
-				if (this.payType == "yue") {
-					// this.createOrder.userCode = this.payNum;
-					if (!this.createOrder.userCode && this.priceInfo.is_cashier_yue_pay_verify) {
-						return this.$Message.error("请扫描个人中心二维码");
-					}
-					if (this.isOrderCreate) {
-						this.getCashierPay("yue");
-					} else {
-						this.orderCreate();
-					}
-				} else if (this.payType == "") {
-					// this.createOrder.auth_code = this.payNum;
-					if (!this.createOrder.auth_code) {
-						return this.$Message.error("请扫描您的付款码");
-					}
-					if (this.isOrderCreate) {
-						this.getCashierPay("");
-					} else {
-						this.orderCreate();
-					}
-				}
-			},
 			getCashierPay(payType) {
 				let data = {
 					payType: payType,
@@ -799,8 +746,6 @@
 							this.isOrderCreate = 0;
 							this.$Message.success("支付成功");
 							this.modalCash = false;
-							this.modalPay = false;
-							this.changePoints();
 							let storage = window.localStorage;
 							storage.setItem("cashierUser", JSON.stringify(this.userInfo));
 							this.clear();
@@ -854,7 +799,6 @@
 						let storage = window.localStorage;
 						this.payNum = "";
 						if (this.payType == "yue") {
-							// this.modalPay = false;
 							this.settleVisible = false;
 							this.payNum = "";
 							this.createOrder.userCode = "";
@@ -870,9 +814,6 @@
 									this.priceInfo.payPrice
 								);
 								this.userInfo.now_money = money;
-								this.changePoints();
-								this.payTypeModal = false;
-								// this.modalPay = false;
 								storage.setItem("cashierUser", JSON.stringify(this.userInfo));
 								// this.goodList();
 								this.clear();
@@ -888,12 +829,8 @@
 								// storage.removeItem("cashierUser");
 								// this.userInfo = null;
 								if (this.userInfo.uid) {
-									this.changePoints();
 								}
 								storage.setItem("cashierUser", JSON.stringify(this.userInfo));
-								// this.goodList();
-								// this.modalCash = false;
-								this.payTypeModal = false;
 								this.settleVisible = false;
 								this.clear();
 								this.jsToJava();
@@ -920,13 +857,7 @@
 								this.checkOrderTime(msg);
 							} else if (res.data.status == "SUCCESS") {
 								this.$Message.success("支付成功");
-								// storage.removeItem("cashierUser");
-								// this.userInfo = null;
-								// this.setUp();
-								this.changePoints();
 								storage.setItem("cashierUser", JSON.stringify(this.userInfo));
-								// this.goodList();
-								// this.modalPay = false;
 								this.settleVisible = false;
 								this.clear();
 							} else {
@@ -942,19 +873,6 @@
 						this.$Message.error(err.msg);
 					});
 			},
-			//更新积分、更新左侧挂单、更新挂单(此函数支付成功调用)
-			changePoints() {
-				let usedIntegral = this.$computes.Sub(
-					this.userInfo.integral,
-					this.priceInfo.usedIntegral
-				);
-				this.userInfo.integral = usedIntegral;
-			},
-			changeModal(n) {
-				if (!n) {
-					this.cartCompute();
-				}
-			},
 			// 计算金额
 			cartCompute(cartId) {
 				let ids = [];
@@ -999,29 +917,6 @@
 			changePrice() {
 				this.modal2 = true;
 			},
-			remarks() {
-				// this.fapi.resetFields();
-				this.modal = true;
-			},
-			// 提交备注
-			onSubmit() {
-				this.modal = false;
-			},
-			onSubmit2() {
-				if (this.formItem.price >= 0 && this.formItem.price != null) {
-					this.priceInfo.payPrice = this.formItem.price;
-					this.$Message.success("改价成功");
-					this.createOrder.is_price = 1;
-					this.createOrder.change_price = this.formItem.price;
-					this.getSwithUser({
-						change_price: this.formItem.price
-					});
-					this.cancelPrice();
-					this.modal2 = false;
-				} else {
-					return this.$Message.error("价格不能为空");
-				}
-			},
 			// 删除
 			del(ids, type, index, num, name) {
 				this.$Modal.confirm({
@@ -1120,23 +1015,13 @@
 				};
 				cashierCart(uid, data)
 					.then((res) => {
-						if (this.storeInfo.product_type === 4) {
-							this.$refs.skillAttrs.modals = false;
-							this.cartCompute(res.data.cartId);
-							return false;
-						}
 						this.$refs.attrs.modals = false;
 						this.$Message.success("添加购物车成功");
 						this.getCartList();
-						if (this.activityFrom.type) {
-							this.reloadList();
-							this.goodList(this.activityFrom.type);
-						} else {
-							//如果是扫码查询商品摒弃直接加入购物车的情况下,在加入购物车成功以后,清空输入框的内容,重新请求列表
-							this.goodFrom.store_name = "";
-							this.reloadList();
-							this.goodList();
-						}
+						//如果是扫码查询商品摒弃直接加入购物车的情况下,在加入购物车成功以后,清空输入框的内容,重新请求列表
+						this.goodFrom.store_name = "";
+						this.reloadList();
+						this.goodList();
 						this.disabled = true;
 					})
 					.catch((err) => {
@@ -1164,8 +1049,6 @@
 							this.cartList = res.data.valid;
 							this.invalidList = res.data.invalid;
 							this.cartSum = res.data.count;
-							// this.promotionsList = res.data.promotions;
-							// this.cartSum = res.data.valid.length;
 							if (res.data.valid.length) {
 								this.cartCompute();
 							} else {
@@ -1506,24 +1389,6 @@
 						this.$Message.error(err.msg);
 					});
 			},
-			//点击分类
-			cateTap(item, index) {
-				this.currentCate = index;
-				this.goodFrom.cate_id = item.id;
-				this.goodFrom.promotions_id = 0;
-				this.activityFrom.type = 0;
-				this.activityFrom.page = 1;
-				this.goodFrom.page = 1;
-				this.goodFrom.store_name = "";
-				this.goodData = [];
-				this.activityTypeArr = [];
-				this.swiperClickedIndex = 0;
-				this.activityFrom.promotions_id = 0;
-				if (index !== 1) {
-					this.seckillId = 0;
-					this.goodList();
-				}
-			},
 			//商品列表
 			goodList(type) {
 				if (this.activityFrom.type) {
@@ -1670,7 +1535,6 @@
 				this.yueVerify = !!this.priceInfo.is_cashier_yue_pay_verify;
 				this.settleMoney = this.priceInfo.payPrice;
 				this.collection = this.priceInfo.payPrice;
-				this.collectionArray = [];
 				this.settleVisible = true;
 			},
 			onRecharge(e) {
@@ -1691,29 +1555,6 @@
 				this.zIndex = 1 + Number(this.$refs.recharge.$el.querySelector('.ivu-modal-mask').style.zIndex);
 				this.settleVisible = true;
 			},
-			activityTypeList(type) {
-				activityTypeList(type).then(res => {
-					this.activityTypeArr = [{
-							desc: '全部',
-							id: 0
-						},
-						...res.data
-					];
-				});
-			},
-			readySwiper(swiper) {
-				this.swiper = swiper;
-			},
-			clickSwiper() {
-				if (this.swiper.clickedIndex === undefined || this.swiper.clickedIndex === this.swiperClickedIndex) {
-					return false;
-				}
-				this.swiperClickedIndex = this.swiper.clickedIndex;
-				this.activityFrom.page = 1;
-				this.activityFrom.promotions_id = this.activityTypeArr[this.swiperClickedIndex].id;
-				this.goodData = [];
-				this.goodList(this.activityFrom.type);
-			},
 			// 充值余额
 			rechargeBalance(auth_code) {
 				this.rechargeData.uid = this.userInfo.uid;