2023-3-18
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import store from '../store/index';
|
||||
export default {
|
||||
// qq 237524947 wx15d4269d3210863d
|
||||
// BASEURI: 'http://192.168.3.9:8083/api/',
|
||||
BASEURI: 'http://192.168.3.9:8083/api/',
|
||||
// BASEURI: 'http://mall.yyundong.com/portalapi/api/',
|
||||
BASEURI: 'http://192.168.3.116:8083/api/',
|
||||
// BASEURI: 'http://192.168.3.116:8083/api/',
|
||||
ADMINURI: 'http://mall.yyundong.com/adminapi/',
|
||||
ESURI: 'http://www.yyundong.com:8081/',
|
||||
h5Appid: 'wxb4660f37187c0b8e', // h5微信登录的appId 暂时测试用
|
||||
|
||||
@@ -2,16 +2,32 @@
|
||||
<view class="coupon-item">
|
||||
<view class="coupon-money">
|
||||
<view class="nick">{{item.name}}</view>
|
||||
<view class="layof" :style="{color:theme}">¥{{item.amount}}</view>
|
||||
<view class="end_time">{{item.endTime | formatCreateTime}}前使用</view>
|
||||
<view>
|
||||
<view class="demand">满{{ item.minPoint }} 减 {{ item.amount }}</view>
|
||||
|
||||
<view style="display: flex;flex-direction: row;
|
||||
align-items: center; margin-top: 10px;">
|
||||
<view class="layof" :style="{color:theme}">¥{{item.amount}}</view>
|
||||
<view style="display: flex;flex-direction: column;flex: 1;" >
|
||||
|
||||
<view style="display: flex;flex-direction: row;">
|
||||
<view class="demand">满{{ item.minPoint }}减{{ item.amount }}</view>
|
||||
<view class="demand" style="margin-left: 5px;" >(限领{{item.perLimit}}张)</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<view class="end_time">有效期至{{item.endTime | formatCreateTime}}</view>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
<view class="get-btn" :style="{color:color, borderColor:color, background:solid}" @click="acceptCoupon(item)">
|
||||
立即领取</view>
|
||||
<!-- <navigator class="get-btn" v-if="types" :style="{color:color, borderColor:color, background:solid}"
|
||||
:url='item.url' @click="useCoupon(item)">立即使用</navigator> -->
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -54,16 +70,16 @@
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
return formatDate(date, 'yyyy-MM-dd')
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(['hasLogin','hasVip', 'userInfo']),
|
||||
...mapState(['hasLogin', 'hasVip', 'userInfo']),
|
||||
},
|
||||
methods: {
|
||||
async acceptCoupon(item) {
|
||||
if (this.hasLogin) {
|
||||
if(this.hasVip){
|
||||
if (this.hasVip) {
|
||||
this.types = !this.types
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
@@ -81,11 +97,11 @@
|
||||
|
||||
}
|
||||
uni.hideLoading();
|
||||
}else{
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您不属于惠农会员,暂不能领取此优惠券',
|
||||
showCancel:false,
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
return;
|
||||
@@ -115,63 +131,62 @@
|
||||
|
||||
<style lang='scss'>
|
||||
.coupon-item {
|
||||
width: 100%;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
height: auto;
|
||||
display: table;
|
||||
display: flex;
|
||||
border-radius: 10upx;
|
||||
padding: 0 20upx;
|
||||
margin-top: 22upx;
|
||||
border: 1px solid #eeeeee;
|
||||
position: relative;
|
||||
background: -webkit-linear-gradient(left, hsla(134, 66%, 66%, 0.5), hsla(53, 98%, 50%, 0.5), tomato) no-repeat;
|
||||
|
||||
.coupon-money {
|
||||
width: 465upx;
|
||||
padding: 15px;
|
||||
width: 520upx;
|
||||
height: auto;
|
||||
display: table;
|
||||
float: left;
|
||||
padding: 26upx 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-style: none dotted none none;
|
||||
border-color: #eeeeee;
|
||||
|
||||
.nick {
|
||||
width: 100%;
|
||||
height: 50upx;
|
||||
overflow: hidden;
|
||||
/*溢出的部分隐藏*/
|
||||
white-space: nowrap;
|
||||
/*文本不换行*/
|
||||
text-overflow: ellipsis;
|
||||
/*ellipsis:文本溢出显示省略号(...);clip:不显示省略标记(...),而是简单的裁切*/
|
||||
line-height: 30upx;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-999;
|
||||
color: #ffaa00;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.tit {
|
||||
/* .tit {
|
||||
width: 100%;
|
||||
height: 50upx;
|
||||
line-height: 50upx;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-999;
|
||||
}
|
||||
|
||||
*/
|
||||
.demand {
|
||||
width: 100%;
|
||||
height: 30upx;
|
||||
line-height: 30upx;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-999;
|
||||
color: #DF5423;
|
||||
}
|
||||
|
||||
.layof {
|
||||
width: 100%;
|
||||
height: 48upx;
|
||||
line-height: 30upx;
|
||||
font-size: 44upx;
|
||||
color: #ff9000;
|
||||
font-weight: bold;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.end_time {
|
||||
width: 100%;
|
||||
height: 30upx;
|
||||
line-height: 30upx;
|
||||
font-size: $font-sm;
|
||||
color: $font-color-999;
|
||||
color: #E24451;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,7 +211,7 @@
|
||||
width: 40upx;
|
||||
height: 20upx;
|
||||
position: absolute;
|
||||
left: 460upx;
|
||||
left: 500upx;
|
||||
top: -1px;
|
||||
border-radius: 0 0 40upx 40upx;
|
||||
content: "";
|
||||
@@ -210,7 +225,7 @@
|
||||
width: 40upx;
|
||||
height: 20upx;
|
||||
position: absolute;
|
||||
left: 460upx;
|
||||
left: 500upx;
|
||||
bottom: -1px;
|
||||
border-radius: 40upx 40upx 0 0;
|
||||
content: "";
|
||||
|
||||
@@ -20,11 +20,13 @@
|
||||
</view>
|
||||
<!-- 分类 -->
|
||||
<view class="cate-section">
|
||||
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?productAttributeCategoryId=1005001')">
|
||||
<view class="cate-item"
|
||||
@click="navToTabPage('../../pagesA/product/list?productAttributeCategoryId=1005001')">
|
||||
<image src="/static/nywz_icon.png"></image>
|
||||
<text>农业物资</text>
|
||||
</view>
|
||||
<view class="cate-item" @click="navToTabPage('../../pagesA/product/list?productAttributeCategoryId=1005000')">
|
||||
<view class="cate-item"
|
||||
@click="navToTabPage('../../pagesA/product/list?productAttributeCategoryId=1005000')">
|
||||
<image src="/static/shwz_icon.png"></image>
|
||||
<text>生活物资</text>
|
||||
</view>
|
||||
@@ -112,7 +114,15 @@
|
||||
</view> -->
|
||||
|
||||
<!-- 优惠券 https://s.click.taobao.com/OPh3c1w -->
|
||||
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#ff0000" ref="SubComponent"
|
||||
<view v-if='couponList && couponList.length>0' class="f-header m-t" @click="allAcceptCoupon">
|
||||
<image src="/static/youhuiquan.png"></image>
|
||||
<view class="tit-box">
|
||||
<text class="tit">有可领取优惠券</text>
|
||||
</view>
|
||||
<text class="get-btn">全部领取</text>
|
||||
</view>
|
||||
|
||||
<coupon v-for="(item, index) in couponList" :key="index" v-bind:item="item" theme="#EB331E" ref="SubComponent"
|
||||
@callParentMethod="callParentMethod"></coupon>
|
||||
|
||||
<!-- 团购楼层
|
||||
@@ -269,6 +279,7 @@
|
||||
} from 'vuex';
|
||||
import navBar from '@/components/zhouWei-navBar';
|
||||
import uniLoadMore from '@/uni_modules/uni-load-more/components/uni-load-more/uni-load-more.vue';
|
||||
import index from '@/store/index.js';
|
||||
export default {
|
||||
components: {
|
||||
coupon,
|
||||
@@ -315,6 +326,7 @@
|
||||
setTimeout(function() {
|
||||
uni.stopPullDownRefresh();
|
||||
}, 2000);
|
||||
|
||||
},
|
||||
onShareAppMessage() {},
|
||||
onLoad(ops) {
|
||||
@@ -361,7 +373,7 @@
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(['hasLogin', 'userInfo']),
|
||||
...mapState(['hasLogin', 'hasVip', 'userInfo']),
|
||||
},
|
||||
methods: {
|
||||
clickParentMethod() {
|
||||
@@ -390,7 +402,47 @@
|
||||
});
|
||||
this.getCouponList();
|
||||
},
|
||||
async allAcceptCoupon() {
|
||||
if (this.hasLogin) {
|
||||
if (this.hasVip) {
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
|
||||
let params = {
|
||||
// couponId: item.id
|
||||
};
|
||||
// this.clickSubMethod(item)
|
||||
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
console.log("data?????", data);
|
||||
if (data) {
|
||||
// this.$api.msg(data);
|
||||
this.couponList = [];
|
||||
uni.showLoading({
|
||||
title: '领取成功'
|
||||
});
|
||||
this.getCouponList();
|
||||
}
|
||||
uni.hideLoading();
|
||||
} else {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您不属于惠农会员,暂不能领取此优惠券',
|
||||
showCancel: false,
|
||||
success: function(res) {
|
||||
if (res.confirm) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
uni.navigateTo({
|
||||
url: '/pages/public/login'
|
||||
});
|
||||
}
|
||||
},
|
||||
async sysInfoMethod() {
|
||||
let params = {};
|
||||
// let list = this.$db.get('sysInfo')
|
||||
@@ -503,14 +555,14 @@
|
||||
pageSize: 4,
|
||||
productCategoryId: "",
|
||||
type: 1,
|
||||
newStatus:1,
|
||||
newStatus: 1,
|
||||
productAttributeCategoryId: ""
|
||||
};
|
||||
let groupHotGoodsList = await Api.apiCall('get', Api.goods.goodsList, params);
|
||||
if (groupHotGoodsList) {
|
||||
this.homeNewProductList = groupHotGoodsList.records;
|
||||
}
|
||||
console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
|
||||
},
|
||||
/**
|
||||
@@ -522,7 +574,7 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
pageSize: 4,
|
||||
productCategoryId: "",
|
||||
type: 1,
|
||||
recommandStatus:1,
|
||||
recommandStatus: 1,
|
||||
productAttributeCategoryId: ""
|
||||
};;
|
||||
let groupHotGoodsList = await Api.apiCall('get', Api.goods.goodsList, params);
|
||||
@@ -562,7 +614,7 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
*/
|
||||
async getCouponList() {
|
||||
let params = {
|
||||
pageSize: 3
|
||||
// pageSize: 3
|
||||
};
|
||||
let data = await Api.apiCall('get', Api.index.selectNotRecive, params);
|
||||
if (data) {
|
||||
@@ -769,21 +821,21 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
url: `../../pagesA/product/product?id=${id}`
|
||||
});
|
||||
},
|
||||
async acceptCoupon(item) {
|
||||
uni.showLoading({
|
||||
title: '请稍后'
|
||||
});
|
||||
// async acceptCoupon(item) {
|
||||
// uni.showLoading({
|
||||
// title: '请稍后'
|
||||
// });
|
||||
|
||||
let params = {
|
||||
couponId: item.id
|
||||
};
|
||||
let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
console.log(data);
|
||||
if (data) {
|
||||
this.$api.msg(data);
|
||||
}
|
||||
uni.hideLoading();
|
||||
},
|
||||
// let params = {
|
||||
// couponId: item.id
|
||||
// };
|
||||
// let data = await Api.apiCall('post', Api.index.acceptCoupon, params);
|
||||
// console.log(data);
|
||||
// if (data) {
|
||||
// this.$api.msg(data);
|
||||
// }
|
||||
// uni.hideLoading();
|
||||
// },
|
||||
navToSkillDetailPage(item) {
|
||||
//测试数据没有写id,用title代替
|
||||
let id = item.id;
|
||||
@@ -1111,7 +1163,7 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
.f-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 140upx;
|
||||
height: 110upx;
|
||||
padding: 0upx 20upx;
|
||||
background: #fff;
|
||||
|
||||
@@ -1139,6 +1191,22 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
color: $font-color-light;
|
||||
}
|
||||
|
||||
.get-btn {
|
||||
width: 146upx;
|
||||
height: 52upx;
|
||||
line-height: 50upx;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 36upx;
|
||||
margin-top: -53upx;
|
||||
text-align: center;
|
||||
border-radius: 60upx;
|
||||
color: #ff9000;
|
||||
border: 1px solid #ff9000;
|
||||
font-size: $font-sm;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.icon-you {
|
||||
font-size: $font-lg + 2upx;
|
||||
color: $font-color-light;
|
||||
@@ -1208,6 +1276,7 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
color: $font-color-light;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
.pro-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -1279,6 +1348,7 @@ console.log("新品推荐》》》》》", this.homeNewProductList)
|
||||
color: $font-color-light;
|
||||
margin-left: 10upx;
|
||||
}
|
||||
|
||||
.coupon_box {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
|
||||
@@ -28,9 +28,11 @@
|
||||
</navigator>
|
||||
|
||||
<view class="goods-section">
|
||||
<view class="g-header b-b">
|
||||
<text class="name" v-if="groupActivity">团购-{{groupActivity.name}}</text>
|
||||
</view>
|
||||
<!-- <image class="logo"
|
||||
src="http://yjlive160322.oss-cn-beijing.aliyuncs.com/mall/images/20190807/QQ%E5%9B%BE%E7%89%8720190807191952.jpg">
|
||||
</image>
|
||||
<text class="name"> 共{{ cartPromotionItemList.length }}件商品</text>
|
||||
<text class="name" v-if="groupActivity">团购-{{groupActivity.name}}</text> -->
|
||||
<!-- 商品列表 -->
|
||||
<view class="g-item" v-for="(item, index) in cartPromotionItemList" :key="index">
|
||||
<image :src="item.productPic"></image>
|
||||
@@ -66,8 +68,8 @@
|
||||
<text class="cell-tip active">选择优惠券</text>
|
||||
<text class="cell-more wanjia wanjia-gengduo-d"></text>
|
||||
</view>
|
||||
<view class="yt-list-cell b-b" v-if="coupon">
|
||||
<text class="cell-tit clamp">商家促销</text>
|
||||
<view class="yt-list-cell b-b" v-if="couponList.length > 0">
|
||||
<text class="cell-tit clamp">{{coupon.name}}</text>
|
||||
<view class="cell-tip hb" v-if="coupon.minPoint">满{{coupon.minPoint}}减{{coupon.amount}}</view>
|
||||
<text class="cell-tip disabled" v-if="!coupon">暂无可用优惠</text>
|
||||
</view>
|
||||
@@ -78,14 +80,14 @@
|
||||
<text class="cell-tit clamp">商品金额</text>
|
||||
<text class="cell-tip">¥{{ calcAmount.totalAmount }}</text>
|
||||
</view>
|
||||
<view class="yt-list-cell b-b" v-if="groupActivity">
|
||||
<!-- <view class="yt-list-cell b-b" v-if="groupActivity">
|
||||
<text class="cell-tit clamp">活动金额</text>
|
||||
<text class="cell-tip">¥{{ groupActivity.price }}</text>
|
||||
</view>
|
||||
<view class="yt-list-cell b-b" v-if="calcAmount.promotionAmount>0">
|
||||
<text class="cell-tit clamp">优惠金额</text>
|
||||
<text class="cell-tip red">-¥{{ calcAmount.promotionAmount }}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="yt-list-cell b-b" v-if="coupon.amount>0">
|
||||
<text class="cell-tit clamp">优惠券抵扣</text>
|
||||
<text class="cell-tip red">-¥{{ coupon.amount }}</text>
|
||||
@@ -270,11 +272,13 @@
|
||||
}
|
||||
|
||||
}
|
||||
/* if (!data || !data.cartPromotionItemList){
|
||||
uni.switchTab({
|
||||
url: '/pages/index/index'
|
||||
});
|
||||
} */
|
||||
// if (!data || !data.cartPromotionItemList){
|
||||
// uni.switchTab({
|
||||
// url: '/pages/index/index'
|
||||
// });
|
||||
// }
|
||||
this.cartPromotionItemList = data.cartPromotionItemList
|
||||
console.log('cartPromotionItemList' + this.cartPromotionItemList);
|
||||
/* this.memberIntegration=data.memberIntegration; */
|
||||
this.basicGiftsList = data.basicGiftsList;
|
||||
|
||||
@@ -303,6 +307,11 @@
|
||||
}
|
||||
console.log("优惠券", data.couponHistoryDetailList);
|
||||
this.couponList = data.couponHistoryDetailList;
|
||||
|
||||
if (this.couponList.length > 0) {
|
||||
this.coupon = this.couponList[0].coupon
|
||||
}
|
||||
|
||||
this.memberReceiveAddressList = data.memberReceiveAddressListaddress;
|
||||
|
||||
},
|
||||
@@ -542,6 +551,7 @@
|
||||
|
||||
.g-item {
|
||||
display: flex;
|
||||
padding-top: 15px;
|
||||
margin: 20upx 30upx;
|
||||
|
||||
image {
|
||||
@@ -573,7 +583,7 @@
|
||||
align-items: center;
|
||||
font-size: 32upx;
|
||||
color: $font-color-dark;
|
||||
padding-top: 10upx;
|
||||
padding-top: 25upx;
|
||||
|
||||
.price {
|
||||
margin-bottom: 4upx;
|
||||
@@ -582,7 +592,7 @@
|
||||
.number {
|
||||
font-size: 26upx;
|
||||
color: $font-color-base;
|
||||
margin-left: 20upx;
|
||||
margin-left: 30upx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
<text class="name">{{ addressData.name }}</text>
|
||||
<text class="mobile">{{ addressData.phoneNumber }}</text>
|
||||
</view>
|
||||
<text
|
||||
class="address">{{ addressData.region }}-{{ addressData.detailAddress }}</text>
|
||||
<text class="address">{{ addressData.region }}-{{ addressData.detailAddress }}</text>
|
||||
</view>
|
||||
<view class="cen" v-else>
|
||||
<text>请设置收货地址</text>
|
||||
@@ -29,13 +28,13 @@
|
||||
</navigator>
|
||||
|
||||
<view class="goods-section" v-for="(item1, index1) in confirmOrderResultList" :key="index1">
|
||||
<view class="g-header b-b">
|
||||
<!-- <view class="g-header b-b">
|
||||
<image class="logo"
|
||||
src="http://yjlive160322.oss-cn-beijing.aliyuncs.com/mall/images/20190807/QQ%E5%9B%BE%E7%89%8720190807191952.jpg">
|
||||
</image>
|
||||
<text class="name"> 共{{ item1.cartPromotionItemList.length }}件商品,店铺 【{{item1.storeName }}】</text>
|
||||
<text class="name"> 共{{ item1.cartPromotionItemList.length }}件商品</text>
|
||||
<text class="name" v-if="groupActivity">团购-{{groupActivity.name}}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 商品列表 -->
|
||||
<view class="g-item" v-for="(item, index) in item1.cartPromotionItemList" :key="index">
|
||||
<image :src="item.productPic"></image>
|
||||
@@ -48,6 +47,21 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优惠明细 -->
|
||||
<view class="yt-list">
|
||||
<view class="yt-list-cell b-b" v-if="couponList.length > 0" @click="toggleMask('show')">
|
||||
<view class="cell-icon">券</view>
|
||||
<text class="cell-tit clamp">优惠券</text>
|
||||
<text class="cell-tip active">选择优惠券</text>
|
||||
<text class="cell-more wanjia wanjia-gengduo-d"></text>
|
||||
</view>
|
||||
<view class="yt-list-cell b-b">
|
||||
<text class="cell-tit clamp">{{coupon.name}}</text>
|
||||
<view class="cell-tip hb" v-if="coupon.minPoint">满{{coupon.minPoint}}减{{coupon.amount}}</view>
|
||||
<text class="cell-tip disabled" v-if="!coupon">暂无可用优惠</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 金额明细 -->
|
||||
<view class="yt-list">
|
||||
<view class="yt-list-cell b-b">
|
||||
@@ -60,6 +74,10 @@
|
||||
<text class="cell-tip red">-¥{{ item1.calcAmount.promotionAmount }}</text>
|
||||
</view>
|
||||
|
||||
<view class="yt-list-cell b-b" v-if="coupon.amount>0">
|
||||
<text class="cell-tit clamp">优惠券抵扣</text>
|
||||
<text class="cell-tip red">-¥{{ coupon.amount }}</text>
|
||||
</view>
|
||||
<!-- <view class="yt-list-cell b-b" v-if="memberIntegration>0">
|
||||
<text class="cell-tit clamp">积分抵扣</text>
|
||||
<text class="cell-tip red">-¥{{ memberIntegration }}</text>
|
||||
@@ -84,18 +102,45 @@
|
||||
<view class="price-content">
|
||||
<text>实付款</text>
|
||||
<text class="price-tip">¥</text>
|
||||
<text class="price">{{ totalPayAmount }}</text>
|
||||
<text class="price">{{ (totalPayAmount-coupon.amount) | numFilter}}</text>
|
||||
</view>
|
||||
<text class="submit" @click="submit">提交订单</text>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 优惠券面板 -->
|
||||
<view class="mask" :class="maskState === 0 ? 'none' : maskState === 1 ? 'show' : ''" @click="toggleMask">
|
||||
<view class="mask-content" @click.stop.prevent="stopPrevent">
|
||||
<!-- 优惠券页面,仿mt -->
|
||||
<view class="coupon-item" v-if="couponList.length > 0" v-for="(item, index) in couponList" :key="index">
|
||||
<view class="con" @click="selectCoupon(item)">
|
||||
<view class="left">
|
||||
<text class="title">{{ item.coupon.name }}</text>
|
||||
<text class="time">有效期至{{item.coupon.endTime | formatCreateTime}}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<text class="price">{{ item.coupon.amount }}</text>
|
||||
<text>满{{item.coupon.minPoint}}可用</text>
|
||||
</view>
|
||||
|
||||
<view class="circle l"></view>
|
||||
<view class="circle r"></view>
|
||||
</view>
|
||||
<text class="tips">限新用户使用</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mallplusCopyright from '@/components/mall-copyright/mallplusCopyright.vue';
|
||||
import Api from '@/common/api';
|
||||
import {
|
||||
formatDate
|
||||
} from '@/common/date';
|
||||
import {
|
||||
mapState
|
||||
} from 'vuex';
|
||||
@@ -207,6 +252,9 @@
|
||||
}
|
||||
|
||||
}
|
||||
console.log("data>>>>>", data);
|
||||
|
||||
|
||||
this.totalPayAmount = data.totalPayAmount;
|
||||
/* this.memberIntegration=data.memberIntegration; */
|
||||
this.basicGiftsList = data.basicGiftsList;
|
||||
@@ -234,13 +282,30 @@
|
||||
this.addressId = this.addressData.id;
|
||||
}
|
||||
|
||||
this.couponList = data.couponHistoryDetailList;
|
||||
console.log("优惠券", data.confirmOrderResultList[0].couponHistoryDetailList);
|
||||
this.couponList = data.confirmOrderResultList[0].couponHistoryDetailList;
|
||||
|
||||
if (this.couponList.length > 0) {
|
||||
this.coupon = this.couponList[0].coupon
|
||||
}
|
||||
|
||||
this.memberReceiveAddressList = data.memberReceiveAddressListaddress;
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapState(['hasLogin', 'userInfo'])
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss')
|
||||
},
|
||||
numFilter(value) {
|
||||
// 截取当前数据到小数点后两位
|
||||
let realVal = parseFloat(value).toFixed(2)
|
||||
return realVal
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getSource() {
|
||||
let source = Api.source;
|
||||
@@ -439,7 +504,7 @@
|
||||
.goods-section {
|
||||
margin-top: 16upx;
|
||||
background: #fff;
|
||||
padding-bottom: 1px;
|
||||
padding-bottom: 150px;
|
||||
|
||||
.g-header {
|
||||
display: flex;
|
||||
@@ -726,6 +791,7 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin: 20upx 24upx;
|
||||
padding-top: 15px;
|
||||
background: #fff;
|
||||
|
||||
.con {
|
||||
|
||||
@@ -355,6 +355,15 @@ export const constantRouterMap = [{
|
||||
icon: 'product-list'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'orderStatistic',
|
||||
name: 'orderStatistic',
|
||||
component: () => import('@/views/oms/order/orderStatistic'),
|
||||
meta: {
|
||||
title: '订单归集统计',
|
||||
icon: 'product-list'
|
||||
}
|
||||
},
|
||||
{
|
||||
path: 'orderDetail',
|
||||
name: 'orderDetail',
|
||||
|
||||
857
mallplusui-web-admin/src/views/oms/order/orderStatistic.vue
Normal file
857
mallplusui-web-admin/src/views/oms/order/orderStatistic.vue
Normal file
@@ -0,0 +1,857 @@
|
||||
<template>
|
||||
<div class="app-container" style="position: relative; height: calc(100vh - 117px);">
|
||||
<div class="container">
|
||||
<el-tabs v-model="status" type="card" @tab-click="handleOrder">
|
||||
<el-tab-pane name="0">
|
||||
<span slot="label">
|
||||
<i class="el-icon-s-order"></i>
|
||||
全部订单
|
||||
</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="12">
|
||||
<span slot="label">
|
||||
<i class="el-icon-bank-card"></i>
|
||||
待付款
|
||||
</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="2">
|
||||
<span slot="label">
|
||||
<i class="el-icon-refrigerator"></i>
|
||||
待发货
|
||||
</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="3">
|
||||
<span slot="label">
|
||||
<i class="el-icon-truck"></i>
|
||||
待收货
|
||||
</span>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane name="4">
|
||||
<span slot="label">
|
||||
<i class="el-icon-document"></i>
|
||||
待评价
|
||||
</span>
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane name="5">
|
||||
<span slot="label">
|
||||
<i class="el-icon-circle-check"></i>
|
||||
交易完成
|
||||
</span>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane name="13">
|
||||
<span slot="label">
|
||||
<i class="el-icon-back"></i>
|
||||
申请退款
|
||||
</span>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane name="14">
|
||||
<span slot="label">
|
||||
<i class="el-icon-finished"></i>
|
||||
已退款
|
||||
</span>
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane name="15">
|
||||
<span slot="label">
|
||||
<i class="el-icon-circle-close"></i>
|
||||
已关闭
|
||||
</span>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<!--工具栏-->
|
||||
<el-card class="filter-container" shadow="never">
|
||||
<div>
|
||||
<i class="el-icon-search"></i>
|
||||
<span>筛选搜索</span>
|
||||
<el-button style="float:right" type="primary" @click="handleSearchList()" size="small">查询搜索
|
||||
</el-button>
|
||||
<el-button style="float:right;margin-right: 15px" @click="handleResetSearch()" size="small">重置
|
||||
</el-button>
|
||||
</div>
|
||||
<div style="margin-top: 15px">
|
||||
<el-form :inline="true" :model="listQuery" size="small" label-width="140px">
|
||||
<el-form-item label="所在地:">
|
||||
<el-input v-model="listQuery.orderSn" class="input-width" placeholder="请选择所在地"></el-input>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="订单分类:">
|
||||
<el-select v-model="listQuery.orderType" class="input-width" placeholder="全部" clearable>
|
||||
<el-option v-for="item in orderTypeOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="取货点">
|
||||
<el-input v-model="listQuery.orderSn" class="input-width" placeholder="请选择取货点"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="收货信息 :">
|
||||
<el-input v-model="listQuery.receiverPhone" class="input-width" placeholder="收货人电话">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="订单来源:">
|
||||
<el-select v-model="listQuery.sourceType" class="input-width" placeholder="全部" clearable>
|
||||
<el-option v-for="item in sourceTypeOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<!--订单数据统计-->
|
||||
<div class="order-caculate">
|
||||
<a class="caculate-title">
|
||||
订单数 :
|
||||
<span class="caculate-num">{{ caculateInfo.orderCount }}</span>
|
||||
</a>
|
||||
|
||||
<a class="caculate-title">
|
||||
订单金额 :
|
||||
<span class="caculate-num">{{ caculateInfo.orderPay }}</span>
|
||||
</a>
|
||||
<a class="caculate-title">
|
||||
客户数 :
|
||||
<span class="caculate-num">{{ caculateInfo.memberCount }}</span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<el-card class="operate-container" shadow="never">
|
||||
<i class="el-icon-tickets"></i>
|
||||
<span>数据列表</span>
|
||||
</el-card>
|
||||
<!-- <div class="batch-operate-container">
|
||||
<el-checkbox v-model="printChecked" @change="batchSelection"
|
||||
style="margin-left:23px; margin-right: 20px;"></el-checkbox>
|
||||
<el-select v-model="batchHandle" @change="handlePrintOption" clearable placeholder="批量操作"
|
||||
class="filter-item" style="width: 130px; margin-right: 8px;">
|
||||
<el-option v-for="item in handleOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
<el-select v-model="batchExport" @change="handleExportOption" clearable placeholder="批量导出"
|
||||
class="filter-item" style="width: 130px">
|
||||
<el-option v-for="item in exportOptions" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</div> -->
|
||||
<div class="table-container">
|
||||
<el-table ref="orderTable" :data="list" style="width: 100%;" @selection-change="handleSelectionChange"
|
||||
v-loading="listLoading" border>
|
||||
<el-table-column type="selection" width="60" align="center"></el-table-column>
|
||||
<el-table-column label="编号" width="80" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.id }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单编号" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.orderSn }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.goodsName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="提交时间" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.createTime | formatCreateTime }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="用户账号" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.memberUsername }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单金额" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
¥{{ scope.row.totalAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付金额" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
¥{{ scope.row.payAmount }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="支付方式" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.payType | formatPayType }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="订单来源" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.sourceType | formatSourceType }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单类型" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.orderType | formatOrderType }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
|
||||
<el-table-column label="订单状态" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status | formatStatus }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" @click="handleViewOrder(scope.$index, scope.row)">查看订单</el-button>
|
||||
<!-- <el-button size="mini" @click="handleCloseOrder(scope.$index, scope.row)"
|
||||
v-show="scope.row.status === 14">关闭订单</el-button> -->
|
||||
<!-- <el-button size="mini" @click="handleDeliveryOrder(scope.$index, scope.row)"
|
||||
v-show="scope.row.status === 2">订单发货</el-button> -->
|
||||
<!-- <el-button size="mini" @click="handleViewLogistics(scope.$index, scope.row)"
|
||||
v-show="scope.row.status > 2 || scope.row.status < 9">订单跟踪</el-button> -->
|
||||
<!-- <el-button size="mini" type="danger" @click="handleDeleteOrder(scope.$index, scope.row)"
|
||||
v-show="scope.row.status === 15">删除订单</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
|
||||
<div class="pagination-container">
|
||||
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
||||
layout="total, sizes,prev, pager, next,jumper" :current-page.sync="listQuery.pageNum"
|
||||
:page-size="listQuery.pageSize" :page-sizes="[5, 10, 15]" :total="total"></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import checkPermission from '@/utils/permission';
|
||||
import {
|
||||
formatTime
|
||||
} from '@/utils/index';
|
||||
import {
|
||||
fetchList,
|
||||
closeOrder,
|
||||
deleteOrder,
|
||||
orderData
|
||||
} from '@/api/order';
|
||||
import {
|
||||
formatDate
|
||||
} from '@/utils/date';
|
||||
import LogisticsDialog from '@/views/oms/order/components/logisticsDialog';
|
||||
const defaultListQuery = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
status: 0,
|
||||
orderSn: null,
|
||||
receiverPhone: null,
|
||||
createTimeStart: null,
|
||||
createTimeEnd: null
|
||||
};
|
||||
|
||||
export default {
|
||||
name: 'orderList',
|
||||
components: {
|
||||
LogisticsDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
status: '0',
|
||||
orderType: '0',
|
||||
createTime: '',
|
||||
checkList: [],
|
||||
printChecked: false,
|
||||
batchHandle: '',
|
||||
batchExport: '',
|
||||
listContent: [],
|
||||
listQuery: Object.assign({}, defaultListQuery),
|
||||
listLoading: true,
|
||||
list: null,
|
||||
total: null,
|
||||
operateType: null,
|
||||
multipleSelection: [],
|
||||
closeOrder: {
|
||||
dialogVisible: false,
|
||||
content: null,
|
||||
orderIds: []
|
||||
},
|
||||
statusOptions: [{
|
||||
label: '待付款',
|
||||
value: 12
|
||||
},
|
||||
{
|
||||
label: '待发货',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '已发货',
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
label: '已完成',
|
||||
value: 5
|
||||
},
|
||||
{
|
||||
label: '申请退款',
|
||||
value: 13
|
||||
},
|
||||
{
|
||||
label: '已退款',
|
||||
value: 14
|
||||
},
|
||||
{
|
||||
label: '已关闭',
|
||||
value: 15
|
||||
}
|
||||
],
|
||||
orderTypeOptions: [{
|
||||
label: '正常订单',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '秒杀订单',
|
||||
value: 6
|
||||
},
|
||||
{
|
||||
value: 7,
|
||||
label: '门店自取订单'
|
||||
},
|
||||
{
|
||||
label: ' 拼团订单',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '团购订单',
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
label: '砍价订单',
|
||||
value: 4
|
||||
},
|
||||
{
|
||||
label: '积分订单',
|
||||
value: 5
|
||||
}
|
||||
],
|
||||
sourceTypeOptions: [{
|
||||
label: '小程序订单',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: 'APP订单',
|
||||
value: 4
|
||||
},
|
||||
{
|
||||
label: 'h5订单',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: 'pc订单',
|
||||
value: 3
|
||||
}
|
||||
],
|
||||
operateOptions: [{
|
||||
label: '批量发货',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '关闭订单',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '删除订单',
|
||||
value: 3
|
||||
}
|
||||
],
|
||||
logisticsDialogVisible: false,
|
||||
|
||||
handleOptions: [{
|
||||
value: '',
|
||||
label: '批量操作'
|
||||
}, {
|
||||
value: '0',
|
||||
label: '批量打印'
|
||||
}],
|
||||
exportOptions: [{
|
||||
value: '',
|
||||
label: '批量导出'
|
||||
}, {
|
||||
value: '0',
|
||||
label: '导出全部'
|
||||
}, {
|
||||
value: '1',
|
||||
label: '导出选中'
|
||||
}],
|
||||
caculateInfo: {
|
||||
orderCount: 0,
|
||||
orderPay: 0,
|
||||
memberCount: 0
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.getList();
|
||||
this.orderDatas(0);
|
||||
});
|
||||
},
|
||||
filters: {
|
||||
formatCreateTime(time) {
|
||||
let date = new Date(time);
|
||||
return formatDate(date, 'yyyy-MM-dd hh:mm:ss');
|
||||
},
|
||||
formatPayType(value) { //支付方式:0->未支付;1->支付宝;2->微信
|
||||
if (value === 1) {
|
||||
return '支付宝';
|
||||
} else if (value === 2) {
|
||||
return '微信';
|
||||
} else if (value === 3) {
|
||||
return '余额支付';
|
||||
} else if (value === 5) {
|
||||
return '积分兑换';
|
||||
}
|
||||
},
|
||||
formatSourceType(value) { //订单来源:0->PC订单;1->app订单
|
||||
if (value === 4) {
|
||||
return '小程序';
|
||||
} else if (value === 2) {
|
||||
return 'h5订单';
|
||||
} else if (value === 3) {
|
||||
return 'PC订单';
|
||||
} else if (value === 1) {
|
||||
return 'android订单';
|
||||
} else if (value === 5) {
|
||||
return 'ios订单';
|
||||
}
|
||||
},
|
||||
formatOrderType(value) {
|
||||
if (value === 2) {
|
||||
return '拼团订单';
|
||||
} else if (value === 3) {
|
||||
return '团购订单';
|
||||
} else if (value === 6) {
|
||||
return '秒杀订单';
|
||||
} else if (value === 1) {
|
||||
return '普通订单';
|
||||
} else if (value === 4) {
|
||||
return '砍价订单';
|
||||
} else if (value === 5) {
|
||||
return '积分订单';
|
||||
}
|
||||
},
|
||||
formatStatus(value) { //订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单
|
||||
if (value === 12) {
|
||||
return '待付款';
|
||||
}
|
||||
if (value === 1) {
|
||||
return '支付成功,没有回掉';
|
||||
} else if (value === 2) {
|
||||
return '待发货';
|
||||
} else if (value === 3) {
|
||||
return '待收货';
|
||||
} else if (value === 4) {
|
||||
return '待评价';
|
||||
} else if (value === 5) {
|
||||
return '已完成';
|
||||
} else if (value === 6) {
|
||||
return '维权中';
|
||||
} else if (value === 7) {
|
||||
return '维权已完成';
|
||||
} else if (value === 8) {
|
||||
return '待分享';
|
||||
} else if (value === 13) {
|
||||
return '申请退款';
|
||||
} else if (value === 14) {
|
||||
return '已退款';
|
||||
} else if (value === 15) {
|
||||
return '已关闭';
|
||||
} else if (value === 16) {
|
||||
return '无效订单';
|
||||
} else if (value === 17) {
|
||||
return '已删除';
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatTime,
|
||||
checkPermission,
|
||||
handleOrder(tab, event) {
|
||||
this.listQuery.status = tab.name;
|
||||
this.getList();
|
||||
this.orderDatas(tab.name);
|
||||
console.log("tab", tab)
|
||||
},
|
||||
handleResetSearch() {
|
||||
this.listQuery = Object.assign({}, defaultListQuery);
|
||||
},
|
||||
handleSearchList() {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
handleViewOrder(index, row) {
|
||||
this.$router.push({
|
||||
path: '/oms/orderDetail',
|
||||
query: {
|
||||
id: row.id
|
||||
}
|
||||
});
|
||||
},
|
||||
handleCloseOrder(index, row) {
|
||||
this.closeOrder.dialogVisible = true;
|
||||
this.closeOrder.orderIds = [row.id];
|
||||
},
|
||||
handleDeliveryOrder(index, row) {
|
||||
let listItem = this.covertOrder(row);
|
||||
console.log("listItem", listItem)
|
||||
this.$router.push({
|
||||
path: '/oms/deliverOrderList',
|
||||
query: {
|
||||
list: [listItem]
|
||||
}
|
||||
});
|
||||
},
|
||||
handleViewLogistics(index, row) {
|
||||
this.logisticsDialogVisible = true;
|
||||
},
|
||||
handleDeleteOrder(index, row) { //删除订单
|
||||
let id = [];
|
||||
id.push(row.id);
|
||||
this.deleteOrder(id);
|
||||
},
|
||||
handleBatchOperate() {
|
||||
if (this.multipleSelection == null || this.multipleSelection.length < 1) {
|
||||
this.$message({
|
||||
message: '请选择要操作的订单',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.operateType === 1) {
|
||||
//批量发货
|
||||
let list = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
if (this.multipleSelection[i].status === 1) {
|
||||
list.push(this.covertOrder(this.multipleSelection[i]));
|
||||
}
|
||||
}
|
||||
if (list.length === 0) {
|
||||
this.$message({
|
||||
message: '选中订单中没有可以发货的订单',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.$router.push({
|
||||
path: '/oms/deliverOrderList',
|
||||
query: {
|
||||
list: list
|
||||
}
|
||||
});
|
||||
} else if (this.operateType === 2) {
|
||||
//关闭订单
|
||||
this.closeOrder.orderIds = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
this.closeOrder.orderIds.push(this.multipleSelection[i].id);
|
||||
}
|
||||
this.closeOrder.dialogVisible = true;
|
||||
} else if (this.operateType === 3) {
|
||||
//删除订单
|
||||
let ids = [];
|
||||
for (let i = 0; i < this.multipleSelection.length; i++) {
|
||||
ids.push(this.multipleSelection[i].id);
|
||||
}
|
||||
this.deleteOrder(ids);
|
||||
}
|
||||
},
|
||||
// 设置每页几条
|
||||
handleSizeChange(val) {
|
||||
this.listQuery.pageNum = 1;
|
||||
this.listQuery.pageSize = val;
|
||||
this.getList();
|
||||
},
|
||||
// 查看第几页数据
|
||||
handleCurrentChange(val) {
|
||||
this.listQuery.pageNum = val;
|
||||
this.getList();
|
||||
},
|
||||
handleCloseOrderConfirm() {
|
||||
if (this.closeOrder.content == null || this.closeOrder.content === '') {
|
||||
this.$message({
|
||||
message: '操作备注不能为空',
|
||||
type: 'warning',
|
||||
duration: 1000
|
||||
});
|
||||
return;
|
||||
}
|
||||
let params = new URLSearchParams();
|
||||
params.append('ids', this.closeOrder.orderIds);
|
||||
params.append('note', this.closeOrder.content);
|
||||
closeOrder(params).then(response => {
|
||||
this.closeOrder.orderIds = [];
|
||||
this.closeOrder.dialogVisible = false;
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: '修改成功',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
this.listLoading = true;
|
||||
if (this.listQuery.status == 0)
|
||||
this.listQuery.status = null
|
||||
|
||||
if (this.listQuery.orderSn == "")
|
||||
this.listQuery.orderSn = null
|
||||
|
||||
if (this.listQuery.receiverPhone == "")
|
||||
this.listQuery.receiverPhone = null
|
||||
|
||||
|
||||
console.log("listQuery", this.listQuery)
|
||||
fetchList(this.listQuery).then(response => {
|
||||
this.listLoading = false;
|
||||
console.log("list", response.data.records)
|
||||
this.list = response.data.records;
|
||||
this.total = response.data.total;
|
||||
});
|
||||
},
|
||||
orderDatas(status) {
|
||||
orderData({
|
||||
status: status
|
||||
}).then(response => {
|
||||
this.caculateInfo = response.data;
|
||||
});
|
||||
},
|
||||
|
||||
deleteOrder(id) {
|
||||
this.$confirm('是否要进行该删除操作?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
let params = new URLSearchParams();
|
||||
params.append('id', id);
|
||||
deleteOrder(params).then(response => {
|
||||
this.$message({
|
||||
message: '删除成功!',
|
||||
type: 'success',
|
||||
duration: 1000
|
||||
});
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
covertOrder(order) {
|
||||
let address = order.receiverRegion + order
|
||||
.receiverDetailAddress;
|
||||
|
||||
let listItem = {
|
||||
orderId: order.id,
|
||||
orderSn: order.orderSn,
|
||||
receiverName: order.receiverName,
|
||||
receiverPhone: order.receiverPhone,
|
||||
receiverPostCode: order.receiverPostCode,
|
||||
address: address,
|
||||
deliveryCompany: null,
|
||||
deliverySn: null
|
||||
};
|
||||
return listItem;
|
||||
},
|
||||
beforeInit() {
|
||||
this.url = 'api/yxStoreOrder';
|
||||
const sort = 'id,desc';
|
||||
this.params = {
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
sort: sort,
|
||||
orderStatus: this.status,
|
||||
orderType: this.orderType,
|
||||
addTime: this.createTime,
|
||||
listContent: this.listContent
|
||||
};
|
||||
const query = this.query;
|
||||
const type = query.type;
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
getCaculateInfo() {},
|
||||
clearCaculateInfo() {
|
||||
this.caculateInfo = {
|
||||
orderCount: 0,
|
||||
orderPay: 0,
|
||||
memberCount: 0
|
||||
};
|
||||
},
|
||||
|
||||
batchSelection(val) {
|
||||
let rows = this.data;
|
||||
if (val) {
|
||||
rows.forEach(row => {
|
||||
this.$refs.multipleTable.toggleRowSelection(row);
|
||||
});
|
||||
} else {
|
||||
this.$refs.multipleTable.clearSelection();
|
||||
}
|
||||
},
|
||||
handlePrintOption(val) {
|
||||
switch (val) {
|
||||
case '0':
|
||||
this.getPrintList();
|
||||
this.batchHandle = '';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
handleExportOption(val) {
|
||||
let list = this.checkList;
|
||||
this.page = 0;
|
||||
this.size = 10000;
|
||||
switch (val) {
|
||||
case '0':
|
||||
this.listContent = '';
|
||||
this.beforeInit();
|
||||
this.downloadMethod();
|
||||
break;
|
||||
case '1':
|
||||
if (list.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择订单',
|
||||
type: 'warning'
|
||||
});
|
||||
} else {
|
||||
this.listContent = [];
|
||||
list.forEach(item => {
|
||||
this.listContent.push(item.orderId);
|
||||
});
|
||||
this.listContent = JSON.stringify(this.listContent);
|
||||
this.beforeInit();
|
||||
this.downloadMethod();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.batchExport = '';
|
||||
},
|
||||
downloadMethod() {
|
||||
this.beforeInit();
|
||||
this.downloadLoading = true;
|
||||
download(process.env.BASE_API + '/download', this.params)
|
||||
.then(result => {
|
||||
this.downloadFile(result, this.title + '数据', 'xlsx');
|
||||
this.downloadLoading = false;
|
||||
})
|
||||
.catch(() => {
|
||||
this.downloadLoading = false;
|
||||
});
|
||||
},
|
||||
// 下载文件
|
||||
downloadFile(obj, name, suffix) {
|
||||
const url = window.URL.createObjectURL(new Blob([obj]));
|
||||
const link = document.createElement('a');
|
||||
link.style.display = 'none';
|
||||
link.href = url;
|
||||
const fileName = parseTime(new Date()) + '-' + name + '.' + suffix;
|
||||
link.setAttribute('download', fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
},
|
||||
getPrintList() {
|
||||
let list = this.checkList;
|
||||
if (list.length == 0) {
|
||||
this.$message({
|
||||
message: '请选择订单',
|
||||
type: 'warning'
|
||||
});
|
||||
} else {
|
||||
const _this = this.$refs.form5;
|
||||
_this.dialog = true;
|
||||
}
|
||||
},
|
||||
checkboxT(row, rowIndex) {
|
||||
return row.id !== 1;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
height: calc(100% - 80px);
|
||||
position: absolute;
|
||||
overflow: auto;
|
||||
width: calc(100% - 20px);
|
||||
|
||||
.order-caculate {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
border-top: 1px solid #f0f0f0;
|
||||
padding: 20px 10px;
|
||||
|
||||
.caculate-title {
|
||||
display: inline-block;
|
||||
margin-right: 50px;
|
||||
}
|
||||
|
||||
.caculate-num {
|
||||
font-size: 20px;
|
||||
color: #ff4949;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table th {
|
||||
background-color: #fafafa;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-contains {
|
||||
position: absolute;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
background-color: #f6f6f6;
|
||||
bottom: 0;
|
||||
flex-align: center;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
z-index: 999;
|
||||
padding: 0 20px 0 13px;
|
||||
}
|
||||
|
||||
/*打印单样式编辑*/
|
||||
.order-list {
|
||||
/* height: 297mm;*/
|
||||
margin: 0 auto;
|
||||
width: 210mm;
|
||||
|
||||
.order-title {
|
||||
height: 16mm;
|
||||
line-height: 16mm;
|
||||
font-size: 8mm;
|
||||
font-weight: bolder;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.order-info {
|
||||
span {
|
||||
display: inline-block;
|
||||
padding: 0 0 10px 0;
|
||||
font-size: 3mm;
|
||||
}
|
||||
|
||||
span.info {
|
||||
width: 60mm;
|
||||
}
|
||||
}
|
||||
|
||||
.el-table--small th,
|
||||
.el-table--small td {
|
||||
padding: 4px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -2,7 +2,7 @@
|
||||
<el-card class="form-container" shadow="never">
|
||||
<el-form :model="coupon" :rules="rules" ref="couponFrom" label-width="150px" size="small">
|
||||
<el-form-item label="优惠券类型:">
|
||||
<span>全场赠券</span>
|
||||
<span>全场赠券</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="优惠券名称:" prop="name">
|
||||
<el-input v-model="coupon.name" class="input-width"></el-input>
|
||||
@@ -31,13 +31,16 @@
|
||||
<template slot="append">元可用</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="有效期:" >
|
||||
<el-date-picker type="date" placeholder="选择日期" v-model="coupon.startTime" style="width: 150px">
|
||||
<el-form-item label="有效期:">
|
||||
<el-date-picker type="datetime" placeholder="选择日期" v-model="coupon.startTime" default-time="00:00:00"
|
||||
style="width:200px">
|
||||
</el-date-picker>
|
||||
<span style="margin-left: 20px;margin-right: 20px">至</span>
|
||||
<el-date-picker type="date" placeholder="选择日期" v-model="coupon.endTime" style="width: 150px">
|
||||
<span style="margin-left:5px;margin-right: 5px">至</span>
|
||||
<el-date-picker type="datetime" placeholder="选择日期" v-model="coupon.endTime" default-time="23:59:59"
|
||||
style="width: 200px">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="可使用商品:">
|
||||
<el-radio-group v-model="coupon.useType">
|
||||
<el-radio-button :label="0">全场通用</el-radio-button>
|
||||
@@ -237,6 +240,10 @@
|
||||
this.getProductCateList();
|
||||
},
|
||||
methods: {
|
||||
dateChange(val) {
|
||||
|
||||
console.log("val", val)
|
||||
},
|
||||
UpNumber(val, limit = 2) {
|
||||
val = val.replace(/[^\d.]/g, '') // 保留数字
|
||||
val = val.replace(/^00/, '0.') // 开头不能有两个0
|
||||
|
||||
Reference in New Issue
Block a user