|
@@ -7,6 +7,58 @@
|
|
|
<div class="acea-row row-between row-bottom cart-left">
|
|
|
<div class="left-top">
|
|
|
<div v-if="checkOut == 0" class="cart">
|
|
|
+ <div v-if="staffInfo" class="title acea-row row-middle">
|
|
|
+ <div class="picture">
|
|
|
+ <img :src="staffInfo.avatar" v-if="staffInfo.avatar" />
|
|
|
+ <img src="../../assets/images/yonghu.png" alt="" v-else />
|
|
|
+ </div>`
|
|
|
+ <div class="text">
|
|
|
+ <div class="textCon line1">
|
|
|
+ <div class="text-wrap">
|
|
|
+ <div class="name-wrap">
|
|
|
+ <span class="name">{{ staffInfo.name || '请选择员工'}}</span>
|
|
|
+ <!-- <span v-if="userInfo.phone" class="phone mr10">手机号:{{ userInfo.phone }}</span> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="switchs" trigger="click" @click="changeStaff(1)">
|
|
|
+ <a href="javascript:void(0)">
|
|
|
+ 选择员工
|
|
|
+ <Icon type="ios-arrow-down"></Icon>
|
|
|
+ </a>
|
|
|
+ <!-- <DropdownMenu slot="list">
|
|
|
+ <DropdownItem name="1">选择员工</DropdownItem>
|
|
|
+ <DropdownItem name="2">游客</DropdownItem>
|
|
|
+ </DropdownMenu> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div v-if="userInfo.uid" class="user-msg">
|
|
|
+ <span class="balance">积分<span class="num">{{userInfo.integral}}</span></span>
|
|
|
+ <span class="balance">余额<span class="num">{{userInfo.now_money}}</span></span>
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="saleInfo" class="title acea-row row-middle">
|
|
|
+ <div class="picture">
|
|
|
+ <img :src="saleInfo.avatar" v-if="saleInfo.avatar" />
|
|
|
+ <img src="../../assets/images/yonghu.png" alt="" v-else />
|
|
|
+ </div>`
|
|
|
+ <div class="text">
|
|
|
+ <div class="textCon line1">
|
|
|
+ <div class="text-wrap">
|
|
|
+ <div class="name-wrap">
|
|
|
+ <span class="name">{{ saleInfo.name || '请选择销售员工'}}</span>
|
|
|
+ <!-- <span v-if="userInfo.phone" class="phone mr10">手机号:{{ userInfo.phone }}</span> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="switchs" trigger="click" @click="changeStaff(2)">
|
|
|
+ <a href="javascript:void(0)">
|
|
|
+ 选择销售员工
|
|
|
+ <Icon type="ios-arrow-down"></Icon>
|
|
|
+ </a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div v-if="userInfo" class="title acea-row row-middle">
|
|
|
<div class="picture" @click="getUserDetail">
|
|
|
<img :src="userInfo.avatar" />
|
|
@@ -16,7 +68,8 @@
|
|
|
<div class="text-wrap">
|
|
|
<div class="name-wrap">
|
|
|
<span class="name">{{ userInfo.nickname }}</span>
|
|
|
- <span v-if="userInfo.phone" class="phone mr10">手机号:{{ userInfo.phone }}</span>
|
|
|
+ <span v-if="userInfo.phone"
|
|
|
+ class="phone mr10">手机号:{{ userInfo.phone }}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<Dropdown class="switchs" trigger="click"
|
|
@@ -32,8 +85,10 @@
|
|
|
</Dropdown>
|
|
|
</div>
|
|
|
<div v-if="userInfo.uid" class="user-msg">
|
|
|
- <span class="balance">积分<span class="num">{{userInfo.integral}}</span></span>
|
|
|
- <span class="balance">余额<span class="num">{{userInfo.now_money}}</span></span>
|
|
|
+ <span class="balance">积分<span
|
|
|
+ class="num">{{userInfo.integral}}</span></span>
|
|
|
+ <span class="balance">余额<span
|
|
|
+ class="num">{{userInfo.now_money}}</span></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -48,93 +103,25 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="listCon">
|
|
|
- <div v-if="cartList.length" class="list">
|
|
|
- <div v-for="(data, proindex) in cartList" :key="proindex + 'data'"
|
|
|
- class="promotions">
|
|
|
- <div v-for="(pro, index) in data.promotions" :key="index + 'pro'"
|
|
|
- class="promotions-msg">
|
|
|
- <div class="flex-1">
|
|
|
- <span class="card">{{ pro.title }}</span>
|
|
|
- <span class="desc">{{ pro.desc }}</span>
|
|
|
- </div>
|
|
|
- <div class="collect" @click="collectOrder(pro)">
|
|
|
- {{ pro.promotions_type == 1 ? "去逛逛" : "去凑单" }}
|
|
|
- <span class="iconfont iconjinru"></span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-for="(item, indexs) in data.cart" :key="indexs + 'car'"
|
|
|
- :class="{ is_give: item.is_gift }" class="item acea-row row-middle">
|
|
|
- <div class="picture">
|
|
|
- <img v-if="item.productInfo.attrInfo"
|
|
|
- :src="item.productInfo.attrInfo.image" />
|
|
|
- <img v-else :src="item.productInfo.image" />
|
|
|
- </div>
|
|
|
- <div v-if="!item.is_gift" class="text">
|
|
|
- <div class="name line1">
|
|
|
- {{ item.productInfo.store_name }}
|
|
|
- </div>
|
|
|
- <div v-if="
|
|
|
- item.productInfo.attrInfo &&
|
|
|
- item.productInfo.spec_type
|
|
|
- " class="info" @click="cartAttr(item)">
|
|
|
- <div class="suk line1">
|
|
|
- {{ item.productInfo.attrInfo.suk }}
|
|
|
- </div>
|
|
|
- <span class="iconfont iconxiayi"></span>
|
|
|
- </div>
|
|
|
- <div v-else class="info">默认</div>
|
|
|
- <div class="sum_price">¥ {{ item.sum_price }}</div>
|
|
|
- </div>
|
|
|
- <div v-else class="text">
|
|
|
- <div class="give-name line1">
|
|
|
- {{ item.productInfo.store_name }}
|
|
|
- </div>
|
|
|
- <div class="give-info">赠品</div>
|
|
|
- </div>
|
|
|
- <div v-if="!item.is_gift" class="del"
|
|
|
- @click="delCart(item, proindex, indexs, 'cart')">
|
|
|
- 删除
|
|
|
- </div>
|
|
|
- <div v-if="!item.is_gift"
|
|
|
- class="cartBnt acea-row row-center-wrapper">
|
|
|
- <div class="iconfont iconjian"
|
|
|
- @click="calculate(item, 'reduce')"></div>
|
|
|
- <!-- <input type="text" v-model="item.cart_num">-->
|
|
|
- <InputNumber v-model="item.cart_num"
|
|
|
- :max="item.productInfo.attrInfo.stock" :min="1" @on-blur="
|
|
|
- (e) => {
|
|
|
- changeCart(e, item);
|
|
|
- }
|
|
|
- "></InputNumber>
|
|
|
- <div class="iconfont iconjia" @click="calculate(item, 'add')">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-else class="cartBnt">
|
|
|
- <span>x{{ item.cart_num }}</span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
<div v-if="invalidList.length" class="list promotions">
|
|
|
<div v-for="(item, index) in invalidList" :key="index"
|
|
|
class="item acea-row row-middle">
|
|
|
<div class="picture">
|
|
|
- <img v-if="item.productInfo.attrInfo"
|
|
|
- :src="item.productInfo.attrInfo.image" />
|
|
|
- <img v-else :src="item.productInfo.image" />
|
|
|
+ <img v-if="item.product.image" :src="item.product.image" />
|
|
|
+ <!-- <img v-else :src="item.productInfo.image" /> -->
|
|
|
</div>
|
|
|
<div class="text invalid">
|
|
|
<div class="name line1">
|
|
|
- {{ item.productInfo.store_name }}
|
|
|
+ {{ item.store_name }}
|
|
|
</div>
|
|
|
- <div v-if="item.productInfo.attrInfo" class="info">
|
|
|
+ <!-- <div v-if="item.productInfo.attrInfo" class="info">
|
|
|
<div class="suk line1">
|
|
|
{{ item.productInfo.attrInfo.suk }}
|
|
|
</div>
|
|
|
<span class="iconfont iconxiayi"></span>
|
|
|
</div>
|
|
|
<div v-else class="info">默认</div>
|
|
|
- <div class="end">该商品已失效</div>
|
|
|
+ <div class="end">该商品已失效</div> -->
|
|
|
</div>
|
|
|
<div class="del" @click="delCart(item, index, 1, 'inv')">
|
|
|
删除
|
|
@@ -165,12 +152,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="discount">
|
|
|
- 优惠: ¥{{
|
|
|
- this.$computes.Sub(
|
|
|
- priceInfo.sumPrice || 0,
|
|
|
- priceInfo.payPrice || 0
|
|
|
- ) || 0
|
|
|
- }}
|
|
|
+ 优惠: ¥{{ payInfo.deduction_price || 0}}
|
|
|
</div>
|
|
|
<div v-if="cartList.length" class="detailed" @click="discountCon">
|
|
|
明细
|
|
@@ -178,13 +160,13 @@
|
|
|
<span class="discount">实付: </span>
|
|
|
<span class="rmb">¥</span>
|
|
|
<span class="num">{{
|
|
|
- cartSum && priceInfo.payPrice ? priceInfo.payPrice : 0
|
|
|
+ cartSum && payInfo.pay_price ? payInfo.pay_price : 0
|
|
|
}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="footer-bottom">
|
|
|
- <Button :disabled="!cartList.length" @click="openSettle">立即结账</Button>
|
|
|
+ <Button :disabled="!invalidList.length" @click="openSettle">立即结账</Button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -236,7 +218,7 @@
|
|
|
<div class="acea-row" style="height: 100%">
|
|
|
<div class="goodsCon">
|
|
|
<div class="goods-top">
|
|
|
- <Input v-model="goodFrom.store_name" :maxlength="20" class="input" element-id="name"
|
|
|
+ <!-- <Input v-model="goodFrom.store_name" :maxlength="20" class="input" element-id="name"
|
|
|
enter-button placeholder="搜索商品名称/ID/唯一码或点击聚焦扫码" search size="large"
|
|
|
@on-search="orderSearch">
|
|
|
<Select slot="prepend" v-model="goodFrom.field_key" style="width: 90px">
|
|
@@ -245,7 +227,7 @@
|
|
|
<Option value="id">ID</Option>
|
|
|
<Option value="bar_code">唯一码</Option>
|
|
|
</Select>
|
|
|
- </Input>
|
|
|
+ </Input> -->
|
|
|
<swiper v-if="activityTypeArr.length" :options="swiperOption" @ready="readySwiper"
|
|
|
@click="clickSwiper">
|
|
|
<swiper-slide v-for="(item, index) in activityTypeArr" :key="index"
|
|
@@ -253,7 +235,8 @@
|
|
|
</swiper>
|
|
|
<Alert v-if="swiperClickedIndex">
|
|
|
<div>活动时间:{{activityTypeArr[swiperClickedIndex].section_time[0]}} ~
|
|
|
- {{activityTypeArr[swiperClickedIndex].section_time[1]}}</div>
|
|
|
+ {{activityTypeArr[swiperClickedIndex].section_time[1]}}
|
|
|
+ </div>
|
|
|
<div style="margin-top: 14px;">活动内容:{{activityTypeArr[swiperClickedIndex].desc}}</div>
|
|
|
</Alert>
|
|
|
<div ref="listWrap" class="list-wrap" @scroll="pageChange">
|
|
@@ -261,9 +244,9 @@
|
|
|
:gutter="15" class="list">
|
|
|
<Col v-for="(item, index) in goodData" :key="index" :sm="12" :md="12" :lg="12"
|
|
|
:xl="8" :xxl="4">
|
|
|
- <div :class="{ on: item.stock }" class="item" @click="attrTap(item)">
|
|
|
+ <div :class="{ on: item.product.stock }" class="item" @click="attrTap(item)">
|
|
|
<div :style="{ height: goodsHeight + 'px' }" class="picture">
|
|
|
- <img :src="item.image" alt="商品图" style="width: 100%;" />
|
|
|
+ <img :src="item.slider_image" alt="商品图" style="width: 100%;" />
|
|
|
</div>
|
|
|
<div class="name line1">
|
|
|
{{ item.store_name || item.title }}
|
|
@@ -271,18 +254,18 @@
|
|
|
<div class="text">
|
|
|
<div class="text-left">
|
|
|
<div class="money">
|
|
|
- <span class="rmb">¥</span>{{ item.price }}
|
|
|
+ <span class="rmb">¥</span>{{ item.product.price }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div v-if="item.cart_num && cartList.length" class="icon-cart-num">
|
|
|
{{ item.cart_num > 99 ? "99+" : item.cart_num }}
|
|
|
</div>
|
|
|
- <div v-if="!item.stock && !item.cart_num" class="no-stock">
|
|
|
+ <!-- <div v-if="!item.stock && !item.cart_num" class="no-stock">
|
|
|
<div class="trip">
|
|
|
<div>暂无</div>
|
|
|
<div>库存</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</Col>
|
|
@@ -316,7 +299,7 @@
|
|
|
<!-- </Scroll> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="goodClass acea-row row-center">
|
|
|
+ <!-- <div class="goodClass acea-row row-center">
|
|
|
<div>
|
|
|
<div v-for="(item, index) in cateData" :key="index"
|
|
|
:class="currentCate == index ? 'on' : ''" class="item line1"
|
|
@@ -324,7 +307,7 @@
|
|
|
{{ item.cate_name }}
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -332,6 +315,10 @@
|
|
|
width="950" class-name="user-modal">
|
|
|
<userList v-if="modalUser" ref="users" :uid="userInfo.uid || 0" @getUserId="getUserId"></userList>
|
|
|
</Modal>
|
|
|
+ <Modal v-model="modalStaff" :mask-closable="false" :scrollable="true" closable footer-hide title="用户列表"
|
|
|
+ width="950" class-name="user-modal">
|
|
|
+ <staffList v-if="modalStaff" ref="users" :uid="staffInfo.uid || 0" @getUserId="getStaffId"></staffList>
|
|
|
+ </Modal>
|
|
|
<settleDrawer v-model="settleVisible" :list="payList" :type="payType" :money="settleMoney"
|
|
|
:collection="collection" :verify="yueVerify" :z-index="zIndex" @payPrice="payPrice" @numTap="numTap"
|
|
|
@delNum="delNum" @cashBnt="cashBnt"></settleDrawer>
|
|
@@ -559,6 +546,7 @@
|
|
|
|
|
|
<script>
|
|
|
import userList from "@/components/userList";
|
|
|
+ import staffList from "@/components/staffList";
|
|
|
import storeList from "@/components/storeList";
|
|
|
import couponList from "@/components/couponList";
|
|
|
import productAttr from "./components/productAttr";
|
|
@@ -587,7 +575,9 @@
|
|
|
getHang,
|
|
|
cashierHang,
|
|
|
cashierGetAttr,
|
|
|
- swithUser
|
|
|
+ swithUser,
|
|
|
+ computedServe,
|
|
|
+ createServeItem
|
|
|
} from "@/api/order";
|
|
|
import {
|
|
|
checkOrderApi,
|
|
@@ -596,14 +586,19 @@
|
|
|
} from "@/api/user";
|
|
|
import {
|
|
|
activityList,
|
|
|
- activityTypeList
|
|
|
+ activityTypeList,
|
|
|
+ getServeItem
|
|
|
} from "@/api/product";
|
|
|
import Setting from '@/setting';
|
|
|
+ import {
|
|
|
+ array
|
|
|
+ } from "js-md5";
|
|
|
|
|
|
export default {
|
|
|
name: "index",
|
|
|
components: {
|
|
|
userList,
|
|
|
+ staffList,
|
|
|
storeList,
|
|
|
productAttr,
|
|
|
couponList,
|
|
@@ -614,6 +609,9 @@
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ pptype: 1,
|
|
|
+ payInfo: {}, //订单计算结果
|
|
|
+ checkType: 1,
|
|
|
formItem: {
|
|
|
price: 0,
|
|
|
},
|
|
@@ -692,13 +690,14 @@
|
|
|
],
|
|
|
checkOut: 0,
|
|
|
modalUser: false,
|
|
|
+ modalStaff: false,
|
|
|
flag: true,
|
|
|
goodFrom: {
|
|
|
store_name: "",
|
|
|
field_key: "all",
|
|
|
cate_id: "",
|
|
|
page: 1,
|
|
|
- limit: 20,
|
|
|
+ limit: 1000,
|
|
|
uid: 0,
|
|
|
staff_id: 0,
|
|
|
},
|
|
@@ -717,6 +716,12 @@
|
|
|
codeNum: "",
|
|
|
payNum: "",
|
|
|
userInfo: {},
|
|
|
+ staffInfo: {
|
|
|
+ avatar: ''
|
|
|
+ },
|
|
|
+ saleInfo: {
|
|
|
+ avatar: ''
|
|
|
+ },
|
|
|
storeInfos: {}, //门店店员信息
|
|
|
storeList: [], //门店列表
|
|
|
attr: {
|
|
@@ -1129,6 +1134,7 @@
|
|
|
},
|
|
|
// 充值
|
|
|
rechargeBnt() {
|
|
|
+ this.pptype = 1
|
|
|
this.rechargeVisible = true;
|
|
|
},
|
|
|
//点击出现优惠明细
|
|
@@ -1137,21 +1143,120 @@
|
|
|
},
|
|
|
//现金收款创建订单并支付
|
|
|
cashBnt(payNum) {
|
|
|
- console.log(payNum,'2333');
|
|
|
- if (this.cashBntLoading) return;
|
|
|
- this.cashBntLoading = true;
|
|
|
- if (this.isOrderCreate) {
|
|
|
- this.getCashierPay("cash");
|
|
|
- } else {
|
|
|
- if (this.rechargeVisible) {
|
|
|
- this.rechargeBalance(payNum);
|
|
|
+ if(this.pptype == 1) {
|
|
|
+ console.log(payNum, '2333');
|
|
|
+ if (this.cashBntLoading) return;
|
|
|
+ this.cashBntLoading = true;
|
|
|
+ if (this.isOrderCreate) {
|
|
|
+ this.getCashierPay("cash");
|
|
|
} else {
|
|
|
- this.orderCreate();
|
|
|
+ if (this.rechargeVisible) {
|
|
|
+ this.rechargeBalance(payNum);
|
|
|
+ } else {
|
|
|
+ this.orderCreate();
|
|
|
+ }
|
|
|
}
|
|
|
+ }else {
|
|
|
+ let that = this
|
|
|
+ let arr = that.invalidList.map(item => {
|
|
|
+ return item.product.id
|
|
|
+ })
|
|
|
+ let qdata = {
|
|
|
+ uid: that.userInfo.uid,
|
|
|
+ work_member_id: that.staffInfo.id,
|
|
|
+ sale_uid: that.payInfo.pay_price == 0? '': that.saleInfo.id,
|
|
|
+ products: arr.join(','),
|
|
|
+ pay_type: that.payType,
|
|
|
+ userCode: payNum,
|
|
|
+ }
|
|
|
+ this.cashBntLoading = true;
|
|
|
+ createServeItem(qdata).then(res => {
|
|
|
+ that.pptype = 1
|
|
|
+ if (that.payType == "yue") {
|
|
|
+ that.settleVisible = false;
|
|
|
+ that.payNum = "";
|
|
|
+ that.createOrder.userCode = "";
|
|
|
+ if (res.data.status == "ORDER_CREATE") {
|
|
|
+ this.isOrderCreate = 1;
|
|
|
+ this.orderId = res.data.order_id;
|
|
|
+ this.$Message.success(res.data.message);
|
|
|
+ } else if (res.data.status == "SUCCESS") {
|
|
|
+ this.isOrderCreate = 0;
|
|
|
+ this.$Message.success("支付成功");
|
|
|
+ let money = that.$computes.Sub(
|
|
|
+ that.userInfo.now_money,
|
|
|
+ that.priceInfo.payPrice
|
|
|
+ );
|
|
|
+ that.userInfo.now_money = money;
|
|
|
+ that.changePoints();
|
|
|
+ that.payTypeModal = false;
|
|
|
+ // this.modalPay = false;
|
|
|
+ storage.setItem("cashierUser", JSON.stringify(this.userInfo));
|
|
|
+ // this.goodList();
|
|
|
+ this.clear();
|
|
|
+ } else {
|
|
|
+ that.isOrderCreate = 1;
|
|
|
+ that.orderId = res.data.order_id;
|
|
|
+ that.$Message.error(res.data.message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (that.payType == "cash") {
|
|
|
+ if (res.data.status == "SUCCESS") {
|
|
|
+ that.$Message.success("支付成功");
|
|
|
+ // storage.removeItem("cashierUser");
|
|
|
+ // this.userInfo = null;
|
|
|
+ if (that.userInfo.uid) {
|
|
|
+ that.changePoints();
|
|
|
+ }
|
|
|
+ storage.setItem("cashierUser", JSON.stringify(this.userInfo));
|
|
|
+ // this.goodList();
|
|
|
+ // this.modalCash = false;
|
|
|
+ that.payTypeModal = false;
|
|
|
+ that.settleVisible = false;
|
|
|
+ that.clear();
|
|
|
+ that.jsToJava();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (that.payType == "") {
|
|
|
+ that.payNum = "";
|
|
|
+ that.createOrder.auth_code = "";
|
|
|
+ if (res.data.status == "ORDER_CREATE") {
|
|
|
+ that.isOrderCreate = 1;
|
|
|
+ that.orderId = res.data.order_id;
|
|
|
+ that.$Message.success(res.data.message);
|
|
|
+ } else if (res.data.status == "PAY_ING") {
|
|
|
+ let msg = this.$Message.loading({
|
|
|
+ content: "等待支付中...",
|
|
|
+ duration: 0,
|
|
|
+ });
|
|
|
+ that.orderId = res.data.order_id;
|
|
|
+ that.checkOrderTime(msg);
|
|
|
+ } else if (res.data.status == "SUCCESS") {
|
|
|
+ that.$Message.success("支付成功");
|
|
|
+ // storage.removeItem("cashierUser");
|
|
|
+ // this.userInfo = null;
|
|
|
+ // this.setUp();
|
|
|
+ that.changePoints();
|
|
|
+ storage.setItem("cashierUser", JSON.stringify(this.userInfo));
|
|
|
+ // this.goodList();
|
|
|
+ // this.modalPay = false;
|
|
|
+ that.settleVisible = false;
|
|
|
+ that.clear();
|
|
|
+ } else {
|
|
|
+ that.isOrderCreate = 1;
|
|
|
+ that.orderId = res.data.order_id;
|
|
|
+ that.$Message.error(res.data.message);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ that.$Message.success(err.msg);
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ that.cashBntLoading = false;
|
|
|
+ }, 1000);
|
|
|
}
|
|
|
- setTimeout(() => {
|
|
|
- this.cashBntLoading = false;
|
|
|
- }, 1000);
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
//清除计算机输入的数字
|
|
|
delNum(type) {
|
|
@@ -1270,6 +1375,7 @@
|
|
|
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("请扫描个人中心二维码");
|
|
|
}
|
|
@@ -1576,68 +1682,30 @@
|
|
|
},
|
|
|
// 删除
|
|
|
del(ids, type, index, num, name) {
|
|
|
+ let that = this
|
|
|
this.$Modal.confirm({
|
|
|
- title: "删除该购物车",
|
|
|
- content: "<p>确定要删除该购物车吗?</p><p>删除该购物车后将无法恢复,请谨慎操作!</p>",
|
|
|
+ title: "删除该服务项目",
|
|
|
+ content: "<p>确定要删除该服务项目吗?",
|
|
|
onOk: () => {
|
|
|
- cashierCartDel(this.userInfo.uid, ids)
|
|
|
- .then((res) => {
|
|
|
- this.$Message.success("删除成功");
|
|
|
- this.reloadList();
|
|
|
- this.goodList(this.activityFrom.type);
|
|
|
- if (type) {
|
|
|
- this.clear();
|
|
|
- this.invalidList = [];
|
|
|
- this.hangDataList();
|
|
|
- } else {
|
|
|
- if (name == "inv" && num) {
|
|
|
- this.invalidList.splice(index, 1);
|
|
|
- } else {
|
|
|
- this.cartList[index].cart.splice(num, 1);
|
|
|
- if (this.cartList.length) {
|
|
|
- this.getCartList();
|
|
|
- // if (this.activityFrom.type) {
|
|
|
- // this.goodList(this.activityFrom.type);
|
|
|
- // } else {
|
|
|
- // // this.goodList();
|
|
|
- // }
|
|
|
- } else {
|
|
|
- this.hangDataList();
|
|
|
- this.clear();
|
|
|
- }
|
|
|
- }
|
|
|
- // this.cartSum = this.cartSum - 1;
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$Message.error(err.msg);
|
|
|
- });
|
|
|
+ that.invalidList.splice(index, 1)
|
|
|
+ that.computedServe()
|
|
|
+
|
|
|
},
|
|
|
onCancel: () => {},
|
|
|
});
|
|
|
},
|
|
|
delAll() {
|
|
|
- let ids = [];
|
|
|
- if (!this.cartList.length && !this.invalidList.length)
|
|
|
- return this.$Message.warning("购物车暂无商品");
|
|
|
- this.cartList.forEach((item) => {
|
|
|
- item.cart.forEach((good) => {
|
|
|
- ids.push(good.id);
|
|
|
- });
|
|
|
- });
|
|
|
-
|
|
|
- this.getSwithUser({
|
|
|
- chang_cart_remove: 1
|
|
|
- });
|
|
|
+ let that = this
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: "删除该服务项目",
|
|
|
+ content: "<p>确定要删除该服务项目吗?",
|
|
|
+ onOk: () => {
|
|
|
+ that.invalidList = []
|
|
|
+ that.computedServe()
|
|
|
|
|
|
- this.invalidList.forEach((item) => {
|
|
|
- ids.push(item.id);
|
|
|
- });
|
|
|
- this.del({
|
|
|
- ids: ids,
|
|
|
},
|
|
|
- 1
|
|
|
- );
|
|
|
+ onCancel: () => {},
|
|
|
+ });
|
|
|
},
|
|
|
delCart(item, index, num, type) {
|
|
|
let ids = [];
|
|
@@ -1680,8 +1748,7 @@
|
|
|
uniqueId: num ?
|
|
|
this.attr.productSelect !== undefined ?
|
|
|
this.attr.productSelect.unique :
|
|
|
- "" :
|
|
|
- "",
|
|
|
+ "" : "",
|
|
|
staff_id: this.storeInfos.id,
|
|
|
tourist_uid: this.userInfo.touristId,
|
|
|
new: Number(this.storeInfo.product_type === 4),
|
|
@@ -1893,53 +1960,59 @@
|
|
|
},
|
|
|
// 选择属性
|
|
|
attrTap(item) {
|
|
|
+ let that = this
|
|
|
this.disabled = false;
|
|
|
if (this.userInfo && this.userInfo.uid >= 0) {
|
|
|
- this.productId = item.product_id;
|
|
|
- if (!item.stock) return this.$Message.error("暂无库存");
|
|
|
-
|
|
|
+ // this.productId = item.product_id;
|
|
|
+ // // if (!item.stock) return this.$Message.error("暂无库存");
|
|
|
// if (this.activityFrom.type === "5") {
|
|
|
- // this.seckillId = item.id;
|
|
|
- // this.isCart = 0; //判断切换属性或是加入购物车:0加入购物车;1切换属性
|
|
|
- // this.$refs.skillAttrs.modals = true;
|
|
|
- // this.cashierGetAttr(item.id);
|
|
|
- // } else if (item.spec_type) {
|
|
|
- // this.isCart = 0; //判断切换属性或是加入购物车:0加入购物车;1切换属性
|
|
|
- // this.$refs.attrs.modals = true;
|
|
|
- // this.goodsInfo(item.product_id || item.id);
|
|
|
- // } else if (item.product_type === 4) {
|
|
|
- // // this.isCart = 0; //判断切换属性或是加入购物车:0加入购物车;1切换属性
|
|
|
- // // this.$refs.attrs.modals = true;
|
|
|
- // // this.goodsInfo(item.product_id || item.id);
|
|
|
+ // this.seckillId = item.id;
|
|
|
+ // this.isCart = 0; //判断切换属性或是加入购物车:0加入购物车;1切换属性
|
|
|
+ // this.$refs.skillAttrs.modals = true;
|
|
|
+ // this.cashierGetAttr(item.id);
|
|
|
+ // } else if (item.spec_type) {
|
|
|
+ // this.isCart = 0; //判断切换属性或是加入购物车:0加入购物车;1切换属性
|
|
|
+ // this.$refs.attrs.modals = true;
|
|
|
+ // this.goodsInfo(item.product_id || item.id);
|
|
|
// } else {
|
|
|
- // console.log(666)
|
|
|
- // // 0为单规格属性
|
|
|
- // this.joinCart(0);
|
|
|
+ // // 0为单规格属性
|
|
|
+ // if (item.product_type === 4) {
|
|
|
+ // this.isCart = 0;
|
|
|
+ // this.$refs.skillAttrs.modals = true;
|
|
|
+ // this.goodsInfo(item.product_id || item.id);
|
|
|
+ // } else {
|
|
|
+ // this.joinCart(0);
|
|
|
+ // }
|
|
|
// }
|
|
|
-
|
|
|
- if (this.activityFrom.type === "5") {
|
|
|
- this.seckillId = item.id;
|
|
|
- this.isCart = 0; //判断切换属性或是加入购物车:0加入购物车;1切换属性
|
|
|
- this.$refs.skillAttrs.modals = true;
|
|
|
- this.cashierGetAttr(item.id);
|
|
|
- } else if (item.spec_type) {
|
|
|
- this.isCart = 0; //判断切换属性或是加入购物车:0加入购物车;1切换属性
|
|
|
- this.$refs.attrs.modals = true;
|
|
|
- this.goodsInfo(item.product_id || item.id);
|
|
|
- } else {
|
|
|
- // 0为单规格属性
|
|
|
- if (item.product_type === 4) {
|
|
|
- this.isCart = 0;
|
|
|
- this.$refs.skillAttrs.modals = true;
|
|
|
- this.goodsInfo(item.product_id || item.id);
|
|
|
- } else {
|
|
|
- this.joinCart(0);
|
|
|
- }
|
|
|
+ let slot = this.invalidList.find(itemx => {
|
|
|
+ return itemx.id == item.id
|
|
|
+ })
|
|
|
+ if (!slot) {
|
|
|
+ this.invalidList.push(item)
|
|
|
+ // 计算价格
|
|
|
+ that.computedServe()
|
|
|
}
|
|
|
+
|
|
|
} else {
|
|
|
this.$Message.error("请添加或选择用户");
|
|
|
}
|
|
|
},
|
|
|
+ computedServe() {
|
|
|
+ let that = this
|
|
|
+ that.cartSum = that.invalidList.length;
|
|
|
+ if (that.cartSum > 0) {
|
|
|
+ let arr = that.invalidList.map(item => {
|
|
|
+ return item.product.id
|
|
|
+ })
|
|
|
+ computedServe({
|
|
|
+ uid: that.userInfo.uid,
|
|
|
+ products: arr.join(',')
|
|
|
+ }).then(res => {
|
|
|
+ that.payInfo = res.data
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
// 商品详情
|
|
|
goodsInfo(id) {
|
|
|
cashierDetail(id, this.userInfo.uid)
|
|
@@ -2116,6 +2189,17 @@
|
|
|
this.setUp();
|
|
|
}
|
|
|
},
|
|
|
+ changeStaff(type) {
|
|
|
+ this.checkType = type
|
|
|
+ this.modalStaff = true;
|
|
|
+ // if (name == 1) {
|
|
|
+ // this.modalStaff = true;
|
|
|
+ // } else {
|
|
|
+ // this.activeHangon = -1;
|
|
|
+ // this.clear();
|
|
|
+ // this.setUp();
|
|
|
+ // }
|
|
|
+ },
|
|
|
// 修改用户
|
|
|
setUser() {
|
|
|
this.modalUser = true;
|
|
@@ -2183,6 +2267,15 @@
|
|
|
uid: e.uid
|
|
|
});
|
|
|
},
|
|
|
+ getStaffId(e) {
|
|
|
+ // this.clear();
|
|
|
+ this.modalStaff = false;
|
|
|
+ if (this.checkType == 1) {
|
|
|
+ this.staffInfo = e
|
|
|
+ } else {
|
|
|
+ this.saleInfo = e
|
|
|
+ }
|
|
|
+ },
|
|
|
checkUser() {
|
|
|
this.userInfoShow = false;
|
|
|
this.goodFrom.store_name = "";
|
|
@@ -2324,53 +2417,54 @@
|
|
|
},
|
|
|
//商品列表
|
|
|
goodList(type) {
|
|
|
- if (this.activityFrom.type) {
|
|
|
- this.activityFrom.uid = this.userInfo ? this.userInfo.uid : 0;
|
|
|
- this.activityFrom.type = type;
|
|
|
- this.activityFrom.staff_id = this.storeInfos.id;
|
|
|
- if (!this.userInfo.uid)
|
|
|
- this.activityFrom.tourist_uid = this.userInfo.touristId;
|
|
|
- activityList(this.activityFrom).then((res) => {
|
|
|
- let data = res.data;
|
|
|
- this.total = data.count;
|
|
|
- if (this.reloading) {
|
|
|
- this.reloading = false;
|
|
|
- this.activityFrom.limit = this.limitTemp;
|
|
|
- this.goodData = data.list;
|
|
|
- } else {
|
|
|
- this.goodData = this.goodData.concat(data.list);
|
|
|
- }
|
|
|
- });
|
|
|
- } else {
|
|
|
- this.goodFrom.uid = this.userInfo ? this.userInfo.uid : 0;
|
|
|
- if (!this.userInfo.uid)
|
|
|
- this.goodFrom.tourist_uid = this.userInfo.touristId;
|
|
|
- cashierProduct(this.goodFrom)
|
|
|
- .then((res) => {
|
|
|
- let data = res.data;
|
|
|
- this.total = data.count;
|
|
|
- if (this.reloading) {
|
|
|
- this.reloading = false;
|
|
|
- this.goodFrom.limit = this.limitTemp;
|
|
|
- this.goodData = data.list;
|
|
|
- } else {
|
|
|
- this.goodData = this.goodData.concat(data.list);
|
|
|
- }
|
|
|
- if (data.attrValue) {
|
|
|
- // 加入购物车
|
|
|
- this.attr.productSelect.unique = data.attrValue.unique;
|
|
|
- this.productId = data.attrValue.product_id;
|
|
|
- this.joinCart(1);
|
|
|
- }
|
|
|
- if (data.userInfo) {
|
|
|
- this.modalUserInfo = data.userInfo;
|
|
|
- this.userInfoShow = true;
|
|
|
- }
|
|
|
- })
|
|
|
- .catch((err) => {
|
|
|
- this.$Message.error(err.msg);
|
|
|
- });
|
|
|
- }
|
|
|
+ // if (this.activityFrom.type) {
|
|
|
+ this.activityFrom.uid = this.userInfo ? this.userInfo.uid : 0;
|
|
|
+ this.activityFrom.type = type;
|
|
|
+ this.activityFrom.staff_id = this.storeInfos.id;
|
|
|
+ if (!this.userInfo.uid)
|
|
|
+ this.activityFrom.tourist_uid = this.userInfo.touristId;
|
|
|
+ // activityList(this.activityFrom).then((res) => {
|
|
|
+ getServeItem(this.activityFrom).then((res) => {
|
|
|
+ let data = res.data;
|
|
|
+ this.total = data.count;
|
|
|
+ if (this.reloading) {
|
|
|
+ this.reloading = false;
|
|
|
+ this.activityFrom.limit = this.limitTemp;
|
|
|
+ this.goodData = data.list;
|
|
|
+ } else {
|
|
|
+ this.goodData = this.goodData.concat(data.list);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // } else {
|
|
|
+ // this.goodFrom.uid = this.userInfo ? this.userInfo.uid : 0;
|
|
|
+ // if (!this.userInfo.uid)
|
|
|
+ // this.goodFrom.tourist_uid = this.userInfo.touristId;
|
|
|
+ // cashierProduct(this.goodFrom)
|
|
|
+ // .then((res) => {
|
|
|
+ // let data = res.data;
|
|
|
+ // this.total = data.count;
|
|
|
+ // if (this.reloading) {
|
|
|
+ // this.reloading = false;
|
|
|
+ // this.goodFrom.limit = this.limitTemp;
|
|
|
+ // this.goodData = data.list;
|
|
|
+ // } else {
|
|
|
+ // this.goodData = this.goodData.concat(data.list);
|
|
|
+ // }
|
|
|
+ // if (data.attrValue) {
|
|
|
+ // // 加入购物车
|
|
|
+ // this.attr.productSelect.unique = data.attrValue.unique;
|
|
|
+ // this.productId = data.attrValue.product_id;
|
|
|
+ // this.joinCart(1);
|
|
|
+ // }
|
|
|
+ // if (data.userInfo) {
|
|
|
+ // this.modalUserInfo = data.userInfo;
|
|
|
+ // this.userInfoShow = true;
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch((err) => {
|
|
|
+ // this.$Message.error(err.msg);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
},
|
|
|
// 活动商品列表
|
|
|
selectaActivity(type) {
|
|
@@ -2526,6 +2620,13 @@
|
|
|
},
|
|
|
// 打开结算抽屉
|
|
|
openSettle() {
|
|
|
+ this.pptype = 2
|
|
|
+ if(!this.staffInfo.id) {
|
|
|
+ return this.$Message.error('请选择服务员工');
|
|
|
+ }
|
|
|
+ if(!this.saleInfo.id) {
|
|
|
+ return this.$Message.error('请选择销售员工');
|
|
|
+ }
|
|
|
this.payList.forEach((value, index, arr) => {
|
|
|
value.status = true;
|
|
|
if (value.value === 'yue' && !this.userInfo.uid) {
|
|
@@ -2535,9 +2636,12 @@
|
|
|
this.payType = value.value;
|
|
|
}
|
|
|
});
|
|
|
- this.yueVerify = !!this.priceInfo.is_cashier_yue_pay_verify;
|
|
|
- this.settleMoney = this.priceInfo.payPrice;
|
|
|
- this.collection = this.priceInfo.payPrice;
|
|
|
+ // this.yueVerify = !!this.priceInfo.is_cashier_yue_pay_verify;
|
|
|
+ this.yueVerify = true
|
|
|
+ // this.settleMoney = this.priceInfo.payPrice;
|
|
|
+ // this.collection = this.priceInfo.payPrice;
|
|
|
+ this.settleMoney = this.payInfo.pay_price;
|
|
|
+ this.collection = this.payInfo.pay_price;
|
|
|
this.settleVisible = true;
|
|
|
},
|
|
|
onRecharge(e) {
|