优化促销相关代码
parent
246ba9057f
commit
ab2bcb515f
|
@ -164,7 +164,7 @@
|
|||
</div>
|
||||
<div
|
||||
class="add-buy-car"
|
||||
v-if="$route.query.way === 'POINT' && skuDetail.isAuth === 'PASS'"
|
||||
v-if="$route.query.way === 'POINT' && skuDetail.authFlag === 'PASS'"
|
||||
>
|
||||
<Button
|
||||
type="error"
|
||||
|
@ -176,7 +176,7 @@
|
|||
</div>
|
||||
<div
|
||||
class="add-buy-car"
|
||||
v-if="$route.query.way !== 'POINT' && skuDetail.isAuth === 'PASS'"
|
||||
v-if="$route.query.way !== 'POINT' && skuDetail.authFlag === 'PASS'"
|
||||
>
|
||||
<Button
|
||||
type="error"
|
||||
|
@ -393,15 +393,6 @@ export default {
|
|||
|
||||
for (let i = 0; i < keysArr.length; i++) {
|
||||
let key = keysArr[i].split("-")[0];
|
||||
if (
|
||||
(new Date(this.detail.promotionMap[keysArr[i]].startTime).getTime >
|
||||
new Date().getTime() &&
|
||||
new Date(this.detail.promotionMap[keysArr[i]].endTime).getTime <
|
||||
new Date().getTime()) ||
|
||||
this.detail.promotionMap[keysArr[i]].getType !== "FREE"
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
if (key === "COUPON") {
|
||||
this.promotionMap[key].push(this.detail.promotionMap[keysArr[i]]);
|
||||
} else {
|
||||
|
|
|
@ -4,9 +4,7 @@
|
|||
<!-- LOGO 步骤条 -->
|
||||
<div class="width_1200 logo">
|
||||
<div>
|
||||
<router-link to="/"
|
||||
><img :src="$store.state.logoImg"
|
||||
/></router-link>
|
||||
<router-link to="/"><img :src="$store.state.logoImg" /></router-link>
|
||||
<div>结算页</div>
|
||||
</div>
|
||||
<div class="cart-steps">
|
||||
|
@ -23,7 +21,7 @@
|
|||
<span :class="stepIndex == 2 ? 'active' : ''">3.成功提交订单</span>
|
||||
</div>
|
||||
</div>
|
||||
<Divider/>
|
||||
<Divider />
|
||||
<div class="content width_1200">
|
||||
<!-- 收货地址 -->
|
||||
<div class="address">
|
||||
|
@ -45,31 +43,23 @@
|
|||
<div>
|
||||
<span>{{ item.name }}</span>
|
||||
<Tag class="ml_10" v-if="item.isDefault" color="red">默认</Tag>
|
||||
<Tag class="ml_10" v-if="item.alias" color="warning">{{
|
||||
item.alias
|
||||
}}
|
||||
</Tag>
|
||||
<Tag class="ml_10" v-if="item.alias" color="warning">{{ item.alias }} </Tag>
|
||||
</div>
|
||||
<div>{{ item.mobile }}</div>
|
||||
<div>
|
||||
{{ item.consigneeAddressPath | unitAddress }} {{ item.detail }}
|
||||
</div>
|
||||
<div>{{ item.consigneeAddressPath | unitAddress }} {{ item.detail }}</div>
|
||||
<div class="edit-btn" v-show="showEditBtn === index">
|
||||
<span @click.stop="editAddress(item.id)">修改</span>
|
||||
<span
|
||||
class="ml_10"
|
||||
v-if="!item.isDefault"
|
||||
@click.stop="delAddress(item)"
|
||||
>删除</span
|
||||
<span class="ml_10" v-if="!item.isDefault" @click.stop="delAddress(item)"
|
||||
>删除</span
|
||||
>
|
||||
</div>
|
||||
<div class="corner-icon" v-show="selectedAddress.id === item.id">
|
||||
<div></div>
|
||||
<Icon type="md-checkmark"/>
|
||||
<Icon type="md-checkmark" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="add-address" @click="editAddress('')">
|
||||
<Icon type="ios-add-circle-outline"/>
|
||||
<Icon type="ios-add-circle-outline" />
|
||||
<div>添加新地址</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -80,8 +70,8 @@
|
|||
v-if="addressList.length > 3"
|
||||
>
|
||||
{{ moreAddr ? "收起地址" : "更多地址" }}
|
||||
<Icon v-show="!moreAddr" type="md-arrow-dropdown"/>
|
||||
<Icon v-show="moreAddr" type="md-arrow-dropup"/>
|
||||
<Icon v-show="!moreAddr" type="md-arrow-dropdown" />
|
||||
<Icon v-show="moreAddr" type="md-arrow-dropup" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- 商品信息 -->
|
||||
|
@ -90,16 +80,12 @@
|
|||
<span>商品信息</span>
|
||||
<span @click="$router.push('/cart')">返回购物车</span>
|
||||
</div>
|
||||
<div
|
||||
class="goods-msg"
|
||||
v-for="(shop, shopIndex) in goodsList"
|
||||
:key="shopIndex"
|
||||
>
|
||||
<div class="goods-msg" v-for="(shop, shopIndex) in goodsList" :key="shopIndex">
|
||||
<div class="shop-name">
|
||||
<span>
|
||||
<span class="hover-color" @click="goShopPage(shop.storeId)">{{
|
||||
shop.storeName
|
||||
}}</span
|
||||
shop.storeName
|
||||
}}</span
|
||||
>
|
||||
</span>
|
||||
</div>
|
||||
|
@ -111,23 +97,15 @@
|
|||
>
|
||||
<span
|
||||
class="hover-color"
|
||||
@click="
|
||||
goGoodsDetail(goods.goodsSku.id, goods.goodsSku.goodsId)
|
||||
"
|
||||
@click="goGoodsDetail(goods.goodsSku.id, goods.goodsSku.goodsId)"
|
||||
>
|
||||
<img :src="goods.goodsSku.thumbnail" alt=""/>
|
||||
<span style="vertical-align: top">{{
|
||||
goods.goodsSku.goodsName
|
||||
}}</span>
|
||||
<img :src="goods.goodsSku.thumbnail" alt="" />
|
||||
<span style="vertical-align: top">{{ goods.goodsSku.goodsName }}</span>
|
||||
</span>
|
||||
<span class="goods-price">{{
|
||||
goods.purchasePrice | unitPrice("¥")
|
||||
}}</span>
|
||||
<span class="goods-price">{{ goods.purchasePrice | unitPrice("¥") }}</span>
|
||||
<span>x{{ goods.num }}</span>
|
||||
<span>{{ goods.goodsSku.quantity > 0 ? "有货" : "无货" }}</span>
|
||||
<span class="goods-price">{{
|
||||
goods.subTotal | unitPrice("¥")
|
||||
}}</span>
|
||||
<span class="goods-price">{{ goods.subTotal | unitPrice("¥") }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="order-mark">
|
||||
|
@ -139,7 +117,7 @@
|
|||
placeholder="订单备注"
|
||||
/>
|
||||
<span style="font-size: 12px; color: #999"
|
||||
>提示:请勿填写有关支付、收货、发票方面的信息</span
|
||||
>提示:请勿填写有关支付、收货、发票方面的信息</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -148,7 +126,7 @@
|
|||
<div class="invoice">
|
||||
<div class="card-head mt_20 mb_20">
|
||||
<span class="relative"
|
||||
>发票信息<span class="inv-tips">
|
||||
>发票信息<span class="inv-tips">
|
||||
<Icon
|
||||
type="ios-alert-outline"
|
||||
/>开企业抬头发票须填写纳税人识别号,以免影响报销
|
||||
|
@ -168,29 +146,19 @@
|
|||
</div>
|
||||
<div v-if="couponList.length === 0">无可用优惠券</div>
|
||||
<ul v-else class="coupon-list">
|
||||
<li
|
||||
v-for="(item, index) in couponList"
|
||||
class="coupon-item"
|
||||
:key="index"
|
||||
>
|
||||
<li v-for="(item, index) in couponList" class="coupon-item" :key="index">
|
||||
<div class="c-left">
|
||||
<div>
|
||||
<span
|
||||
v-if="item.couponType === 'PRICE'"
|
||||
class="fontsize_12 global_color"
|
||||
>¥<span class="price">{{
|
||||
item.price | unitPrice
|
||||
}}</span></span
|
||||
<span v-if="item.couponType === 'PRICE'" class="fontsize_12 global_color"
|
||||
>¥<span class="price">{{ item.price | unitPrice }}</span></span
|
||||
>
|
||||
<span
|
||||
v-if="item.couponType === 'DISCOUNT'"
|
||||
class="fontsize_12 global_color"
|
||||
><span class="price">{{ item.discount }}</span
|
||||
>折</span
|
||||
>
|
||||
<span class="describe"
|
||||
>满{{ item.consumeThreshold }}元可用</span
|
||||
><span class="price">{{ item.discount }}</span
|
||||
>折</span
|
||||
>
|
||||
<span class="describe">满{{ item.consumeThreshold }}元可用</span>
|
||||
</div>
|
||||
<p>使用范围:{{ useScope(item.scopeType) }}</p>
|
||||
<p>有效期:{{ item.endTime }}</p>
|
||||
|
@ -207,7 +175,7 @@
|
|||
class="c-right"
|
||||
v-if="usedCouponId.includes(item.id)"
|
||||
@click="useCoupon(item.id, false)"
|
||||
>放弃优惠</a
|
||||
>放弃优惠</a
|
||||
>
|
||||
<i class="circle-top"></i>
|
||||
<i class="circle-bottom"></i>
|
||||
|
@ -220,32 +188,22 @@
|
|||
<span>{{ totalNum }}件商品,总商品金额:</span
|
||||
><span>{{ priceDetailDTO.goodsPrice | unitPrice("¥") }}</span>
|
||||
</div>
|
||||
<div v-if="priceDetailDTO.freightPrice>0">
|
||||
<div v-if="priceDetailDTO.freightPrice > 0">
|
||||
<span>运费:</span
|
||||
><span>{{ priceDetailDTO.freightPrice | unitPrice("¥") }}</span>
|
||||
</div>
|
||||
<div v-if="priceDetailDTO.discountPrice>0">
|
||||
<div v-if="priceDetailDTO.discountPrice > 0">
|
||||
<span>优惠金额:</span
|
||||
><span
|
||||
>-{{
|
||||
priceDetailDTO.discountPrice | unitPrice("¥")
|
||||
}}</span
|
||||
>
|
||||
><span>-{{ priceDetailDTO.discountPrice | unitPrice("¥") }}</span>
|
||||
</div>
|
||||
<div v-if="priceDetailDTO.couponPrice>0">
|
||||
<div v-if="priceDetailDTO.couponPrice > 0">
|
||||
<span>优惠券金额:</span
|
||||
><span
|
||||
>-{{
|
||||
priceDetailDTO.couponPrice | unitPrice("¥")
|
||||
}}</span
|
||||
>
|
||||
><span>-{{ priceDetailDTO.couponPrice | unitPrice("¥") }}</span>
|
||||
</div>
|
||||
|
||||
<div v-if="$route.query.way === 'POINTS'">
|
||||
<span>应付积分:</span
|
||||
><span class="actrual-price">{{
|
||||
priceDetailDTO.payPoint
|
||||
}}</span>
|
||||
><span class="actrual-price">{{ priceDetailDTO.payPoint }}</span>
|
||||
</div>
|
||||
<div v-else>
|
||||
<span>应付金额:</span
|
||||
|
@ -267,73 +225,65 @@
|
|||
</div>
|
||||
<BaseFooter></BaseFooter>
|
||||
<!-- 添加发票模态框 -->
|
||||
<invoice-modal
|
||||
ref="invModal"
|
||||
:invoiceData="invoiceData"
|
||||
@change="getInvMsg"
|
||||
/>
|
||||
<invoice-modal ref="invModal" :invoiceData="invoiceData" @change="getInvMsg" />
|
||||
<!-- 选择地址模态框 -->
|
||||
<address-manage
|
||||
ref="address"
|
||||
:id="addrId"
|
||||
@change="addrChange"
|
||||
></address-manage>
|
||||
<address-manage ref="address" :id="addrId" @change="addrChange"></address-manage>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import invoiceModal from '@/components/invoiceModal';
|
||||
import addressManage from '@/components/addressManage';
|
||||
import {memberAddress, delMemberAddress} from '@/api/address';
|
||||
import invoiceModal from "@/components/invoiceModal";
|
||||
import addressManage from "@/components/addressManage";
|
||||
import { memberAddress, delMemberAddress } from "@/api/address";
|
||||
import {
|
||||
cartGoodsPay,
|
||||
createTrade,
|
||||
selectAddr,
|
||||
selectCoupon,
|
||||
couponNum
|
||||
} from '@/api/cart';
|
||||
import {canUseCouponList} from '@/api/member.js';
|
||||
couponNum,
|
||||
} from "@/api/cart";
|
||||
import { canUseCouponList } from "@/api/member.js";
|
||||
|
||||
export default {
|
||||
name: 'Pay',
|
||||
components: {invoiceModal, addressManage},
|
||||
data () {
|
||||
name: "Pay",
|
||||
components: { invoiceModal, addressManage },
|
||||
data() {
|
||||
return {
|
||||
stepIndex: 1, // 顶部步骤条状态
|
||||
invoiceAvailable: false, // 发票编辑按钮
|
||||
showEditBtn: '', // 鼠标移入显示编辑按钮
|
||||
orderMark: '', // 订单备注
|
||||
showEditBtn: "", // 鼠标移入显示编辑按钮
|
||||
orderMark: "", // 订单备注
|
||||
invoiceData: {
|
||||
// 发票数据
|
||||
receiptTitle: '个人',
|
||||
receiptContent: '不开发票'
|
||||
receiptTitle: "个人",
|
||||
receiptContent: "不开发票",
|
||||
},
|
||||
addressList: [], // 地址列表
|
||||
selectedAddress: {}, // 所选地址
|
||||
goodsList: [], // 商品列表
|
||||
priceDetailDTO: {}, // 商品价格
|
||||
totalNum: 0, // 购买数量
|
||||
addrId: '', // 编辑地址传入的id
|
||||
addrId: "", // 编辑地址传入的id
|
||||
moreAddr: false, // 更多地址
|
||||
canUseCouponNum: 0, // 可用优惠券数量
|
||||
couponList: [], // 可用优惠券列表
|
||||
usedCouponId: [], // 已使用优惠券id
|
||||
selectedCoupon: {} // 已选优惠券对象
|
||||
selectedCoupon: {}, // 已选优惠券对象
|
||||
};
|
||||
},
|
||||
mounted () {
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init () {
|
||||
init() {
|
||||
this.getGoodsDetail();
|
||||
},
|
||||
goAddressManage () {
|
||||
goAddressManage() {
|
||||
// 跳转地址管理页面
|
||||
this.$router.push('/home/MyAddress');
|
||||
this.$router.push("/home/MyAddress");
|
||||
},
|
||||
getAddress () {
|
||||
getAddress() {
|
||||
// 获取收货地址列表
|
||||
memberAddress().then((res) => {
|
||||
if (res.success) {
|
||||
|
@ -346,10 +296,10 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
getGoodsDetail () {
|
||||
getGoodsDetail() {
|
||||
// 订单商品详情
|
||||
this.$Spin.show();
|
||||
cartGoodsPay({way: this.$route.query.way})
|
||||
cartGoodsPay({ way: this.$route.query.way })
|
||||
.then((res) => {
|
||||
this.$Spin.hide();
|
||||
if (res.success) {
|
||||
|
@ -358,22 +308,23 @@ export default {
|
|||
this.skuList = res.result.skuList;
|
||||
|
||||
if (res.result.receiptVO) {
|
||||
this.invoiceData = res.result.receiptVO
|
||||
this.invoiceData = res.result.receiptVO;
|
||||
}
|
||||
let notSupArea = res.result.notSupportFreight;
|
||||
this.selectedCoupon = {};
|
||||
if (res.result.platformCoupon) this.selectedCoupon.platformCoupon = res.result.platformCoupon;
|
||||
if (res.result.platformCoupon)
|
||||
this.selectedCoupon.platformCoupon = res.result.platformCoupon;
|
||||
Object.assign(this.selectedCoupon, res.result.storeCoupons);
|
||||
if (notSupArea) {
|
||||
let content = [];
|
||||
let title = '';
|
||||
let title = "";
|
||||
notSupArea.forEach((e) => {
|
||||
title = e.errorMessage;
|
||||
content.push(e.goodsSku.goodsName);
|
||||
});
|
||||
this.$Modal.warning({
|
||||
title: '以下商品超出配送区域' || title,
|
||||
content: content.toString()
|
||||
title: "以下商品超出配送区域" || title,
|
||||
content: content.toString(),
|
||||
});
|
||||
}
|
||||
if (res.result.memberAddress) {
|
||||
|
@ -384,16 +335,28 @@ export default {
|
|||
for (let i = 0; i < this.skuList.length; i++) {
|
||||
this.totalNum += this.skuList[i].num;
|
||||
}
|
||||
this.getCouponNum();
|
||||
this.usedCouponId = [];
|
||||
this.couponList = res.result.canUseCoupons;
|
||||
const couponKeys = Object.keys(this.selectedCoupon);
|
||||
if (couponKeys.length) {
|
||||
this.couponList.forEach((e) => {
|
||||
if (e.id === this.selectedCoupon[couponKeys].memberCoupon.id) {
|
||||
this.usedCouponId.push(e.id);
|
||||
}
|
||||
});
|
||||
this.$nextTick(() => {
|
||||
this.$forceUpdate();
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.$Spin.hide();
|
||||
});
|
||||
},
|
||||
getCouponNum () {
|
||||
getCouponNum() {
|
||||
// 获取可用优惠券数量
|
||||
couponNum({way: this.$route.query.way}).then((res) => {
|
||||
couponNum({ way: this.$route.query.way }).then((res) => {
|
||||
this.canUseCouponNum = res.result;
|
||||
if (res.result) {
|
||||
let storeArr = [];
|
||||
|
@ -407,10 +370,10 @@ export default {
|
|||
let params = {
|
||||
pageNumber: 1,
|
||||
pageSize: 100,
|
||||
memberCouponStatus: 'NEW',
|
||||
memberCouponStatus: "NEW",
|
||||
scopeId: skuArr.toString(),
|
||||
storeId: storeArr.toString(),
|
||||
totalPrice: this.priceDetailDTO.goodsPrice
|
||||
totalPrice: this.priceDetailDTO.goodsPrice,
|
||||
};
|
||||
canUseCouponList(params).then((res) => {
|
||||
// 可用优惠券列表
|
||||
|
@ -431,78 +394,77 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
selectAddress (item) {
|
||||
selectAddress(item) {
|
||||
// 选择地址
|
||||
let params = {
|
||||
way: this.$route.query.way,
|
||||
shippingAddressId: item.id
|
||||
shippingAddressId: item.id,
|
||||
};
|
||||
selectAddr(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success('选择收货地址成功');
|
||||
this.$Message.success("选择收货地址成功");
|
||||
this.selectedAddress = item;
|
||||
this.getGoodsDetail();
|
||||
}
|
||||
});
|
||||
},
|
||||
editAddress (id) {
|
||||
editAddress(id) {
|
||||
// 编辑地址
|
||||
this.addrId = id;
|
||||
this.$refs.address.show();
|
||||
},
|
||||
addrChange () {
|
||||
addrChange() {
|
||||
// 添加,编辑地址回显
|
||||
this.getAddress();
|
||||
},
|
||||
delAddress (item) {
|
||||
delAddress(item) {
|
||||
// 删除地址
|
||||
this.$Modal.confirm({
|
||||
title: '提示',
|
||||
content: '你确定删除这个收货地址',
|
||||
title: "提示",
|
||||
content: "你确定删除这个收货地址",
|
||||
onOk: () => {
|
||||
delMemberAddress(item.id).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success('删除成功');
|
||||
this.$Message.success("删除成功");
|
||||
this.getAddress();
|
||||
}
|
||||
});
|
||||
},
|
||||
onCancel: () => {
|
||||
}
|
||||
onCancel: () => {},
|
||||
});
|
||||
},
|
||||
goGoodsDetail (skuId, goodsId) {
|
||||
goGoodsDetail(skuId, goodsId) {
|
||||
// 跳转商品详情
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/goodsDetail',
|
||||
query: {skuId, goodsId}
|
||||
path: "/goodsDetail",
|
||||
query: { skuId, goodsId },
|
||||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
window.open(routeUrl.href, "_blank");
|
||||
},
|
||||
// 跳转店铺首页
|
||||
goShopPage (id) {
|
||||
goShopPage(id) {
|
||||
let routeUrl = this.$router.resolve({
|
||||
path: '/Merchant',
|
||||
query: {id: id}
|
||||
path: "/Merchant",
|
||||
query: { id: id },
|
||||
});
|
||||
window.open(routeUrl.href, '_blank');
|
||||
window.open(routeUrl.href, "_blank");
|
||||
},
|
||||
useCoupon (id, used) {
|
||||
useCoupon(id, used) {
|
||||
// 使用优惠券
|
||||
let params = {
|
||||
way: this.$route.query.way,
|
||||
memberCouponId: id,
|
||||
used: used // true 为使用, false为弃用
|
||||
used: used, // true 为使用, false为弃用
|
||||
};
|
||||
selectCoupon(params).then((res) => {
|
||||
if (res.success) this.init();
|
||||
});
|
||||
},
|
||||
editInvoice () {
|
||||
editInvoice() {
|
||||
// 编辑发票信息
|
||||
this.$refs.invModal.invoiceAvailable = true;
|
||||
},
|
||||
getInvMsg (item) {
|
||||
getInvMsg(item) {
|
||||
// 获取发票信息
|
||||
if (item) {
|
||||
this.init();
|
||||
|
@ -510,18 +472,18 @@ export default {
|
|||
}
|
||||
},
|
||||
|
||||
pay () {
|
||||
pay() {
|
||||
// 结算
|
||||
const params = {
|
||||
client: 'PC',
|
||||
client: "PC",
|
||||
remark: [],
|
||||
way: this.$route.query.way
|
||||
way: this.$route.query.way,
|
||||
};
|
||||
this.goodsList.forEach((e) => {
|
||||
if (e.remark) {
|
||||
params.remark.push({
|
||||
remark: e.remark,
|
||||
storeId: e.storeId
|
||||
storeId: e.storeId,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -533,12 +495,13 @@ export default {
|
|||
.then((res) => {
|
||||
this.$Spin.hide();
|
||||
if (res.success) {
|
||||
if (params.way === 'POINTS') { // 积分支付不需要跳转支付页面
|
||||
this.$router.push('/payDone')
|
||||
if (params.way === "POINTS") {
|
||||
// 积分支付不需要跳转支付页面
|
||||
this.$router.push("/payDone");
|
||||
} else {
|
||||
this.$router.push({
|
||||
path: '/payment',
|
||||
query: {orderType: 'TRADE', sn: res.result.sn}
|
||||
path: "/payment",
|
||||
query: { orderType: "TRADE", sn: res.result.sn },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -548,28 +511,28 @@ export default {
|
|||
});
|
||||
},
|
||||
// 优惠券可用范围
|
||||
useScope (type) {
|
||||
let goods = '全部商品';
|
||||
useScope(type) {
|
||||
let goods = "全部商品";
|
||||
switch (type) {
|
||||
case 'ALL':
|
||||
goods = '全部商品';
|
||||
case "ALL":
|
||||
goods = "全部商品";
|
||||
break;
|
||||
case 'PORTION_GOODS':
|
||||
goods = '部分商品';
|
||||
case "PORTION_GOODS":
|
||||
goods = "部分商品";
|
||||
break;
|
||||
case 'PORTION_GOODS_CATEGORY':
|
||||
goods = '部分分类商品';
|
||||
case "PORTION_GOODS_CATEGORY":
|
||||
goods = "部分分类商品";
|
||||
break;
|
||||
}
|
||||
return `${goods}可用`;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@import "../../assets/styles/coupon.scss";
|
||||
.goods-msg{
|
||||
.goods-msg {
|
||||
overflow: hidden;
|
||||
}
|
||||
/** logo start */
|
||||
|
@ -781,7 +744,7 @@ export default {
|
|||
|
||||
.goods-item {
|
||||
display: flex;
|
||||
width:100%;
|
||||
width: 100%;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20px 0;
|
||||
|
@ -807,12 +770,11 @@ export default {
|
|||
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
>span{
|
||||
> span {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
> span:last-child {
|
||||
color: $theme_color;
|
||||
font-weight: bold;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
inline
|
||||
:label-width="70"
|
||||
class="search-form"
|
||||
@keydown.enter.native="handleSearch"
|
||||
@keydown.enter.native="handleSearch"
|
||||
>
|
||||
<Form-item label="商品名称" prop="goodsName">
|
||||
<Input
|
||||
|
@ -39,12 +39,19 @@
|
|||
</Select>
|
||||
</Form-item>
|
||||
<Form-item label="商品类型" prop="status">
|
||||
<Select v-model="searchForm.goodsType" placeholder="请选择" clearable style="width: 200px">
|
||||
<Select
|
||||
v-model="searchForm.goodsType"
|
||||
placeholder="请选择"
|
||||
clearable
|
||||
style="width: 200px"
|
||||
>
|
||||
<Option value="PHYSICAL_GOODS">实物商品</Option>
|
||||
<Option value="VIRTUAL_GOODS">虚拟商品</Option>
|
||||
</Select>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search" >搜索</Button>
|
||||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search"
|
||||
>搜索</Button
|
||||
>
|
||||
</Form>
|
||||
<Table
|
||||
:loading="loading"
|
||||
|
@ -55,25 +62,39 @@
|
|||
class="mt_10"
|
||||
>
|
||||
<!-- 商品栏目格式化 -->
|
||||
<template slot="goodsSlot" slot-scope="{row}">
|
||||
<div style="margin: 5px 0px;height: 80px; display: flex;">
|
||||
<template slot="goodsSlot" slot-scope="{ row }">
|
||||
<div style="margin: 5px 0px; height: 80px; display: flex">
|
||||
<div style="">
|
||||
<img :src="row.original" style="height: 60px;margin-top: 1px;width: 60px">
|
||||
<img
|
||||
:src="row.original"
|
||||
style="height: 60px; margin-top: 1px; width: 60px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 13px;">
|
||||
<div style="margin-left: 13px">
|
||||
<div class="div-zoom">
|
||||
<a @click="linkTo(row.id,row.skuId)">{{row.goodsName}}</a>
|
||||
<a @click="linkTo(row.id, row.skuId)">{{ row.goodsName }}</a>
|
||||
</div>
|
||||
<Poptip trigger="hover" title="扫码在手机中查看" transfer>
|
||||
<div slot="content">
|
||||
<vue-qr :text="wapLinkTo(row.id,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff" :size="150"></vue-qr>
|
||||
<vue-qr
|
||||
:text="wapLinkTo(row.id, row.skuId)"
|
||||
:margin="0"
|
||||
colorDark="#000"
|
||||
colorLight="#fff"
|
||||
:size="150"
|
||||
></vue-qr>
|
||||
</div>
|
||||
<img src="../../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
|
||||
<img
|
||||
src="../../../assets/qrcode.svg"
|
||||
class="hover-pointer"
|
||||
width="20"
|
||||
height="20"
|
||||
alt=""
|
||||
/>
|
||||
</Poptip>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
@ -91,26 +112,15 @@
|
|||
></Page>
|
||||
</Row>
|
||||
</Card>
|
||||
<Modal
|
||||
title="下架操作"
|
||||
v-model="modalVisible"
|
||||
:mask-closable="false"
|
||||
:width="500"
|
||||
>
|
||||
<Form
|
||||
ref="underForm"
|
||||
:model="underForm"
|
||||
:label-width="100"
|
||||
>
|
||||
<Modal title="下架操作" v-model="modalVisible" :mask-closable="false" :width="500">
|
||||
<Form ref="underForm" :model="underForm" :label-width="100">
|
||||
<FormItem label="下架原因" prop="reason">
|
||||
<Input v-model="underForm.reason" clearable style="width: 100%" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
<div slot="footer">
|
||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||
<Button type="primary" :loading="submitLoading" @click="lower"
|
||||
>提交</Button
|
||||
>
|
||||
<Button type="primary" :loading="submitLoading" @click="lower">提交</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
|
@ -118,10 +128,10 @@
|
|||
|
||||
<script>
|
||||
import { getGoodsListData, upGoods, lowGoods } from "@/api/goods";
|
||||
import vueQr from 'vue-qr'
|
||||
import vueQr from "vue-qr";
|
||||
export default {
|
||||
components: {
|
||||
"vue-qr":vueQr
|
||||
"vue-qr": vueQr,
|
||||
},
|
||||
name: "goods",
|
||||
data() {
|
||||
|
@ -136,7 +146,8 @@ export default {
|
|||
sort: "create_time", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
underForm: { // 下架原因
|
||||
underForm: {
|
||||
// 下架原因
|
||||
reason: "",
|
||||
},
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
|
@ -151,17 +162,14 @@ export default {
|
|||
title: "商品编号",
|
||||
key: "id",
|
||||
minWidth: 150,
|
||||
tooltip: true
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "价格",
|
||||
key: "price",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||
);
|
||||
return h("div", this.$options.filters.unitPrice(params.row.price, "¥"));
|
||||
},
|
||||
},
|
||||
{
|
||||
|
@ -169,12 +177,12 @@ export default {
|
|||
key: "goodsType",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.goodsType === 'PHYSICAL_GOODS') {
|
||||
return h("Tag", {props: {color: "green",},}, "实物商品");
|
||||
} else if (params.row.goodsType === 'VIRTUAL_GOODS') {
|
||||
return h("Tag", {props: {color: "volcano",},}, "虚拟商品");
|
||||
if (params.row.goodsType === "PHYSICAL_GOODS") {
|
||||
return h("Tag", { props: { color: "green" } }, "实物商品");
|
||||
} else if (params.row.goodsType === "VIRTUAL_GOODS") {
|
||||
return h("Tag", { props: { color: "volcano" } }, "虚拟商品");
|
||||
} else {
|
||||
return h("Tag", {props: {color: "geekblue",},}, "电子卡券");
|
||||
return h("Tag", { props: { color: "geekblue" } }, "电子卡券");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -184,23 +192,23 @@ export default {
|
|||
width: 100,
|
||||
render: (h, params) => {
|
||||
if (params.row.marketEnable == "DOWN") {
|
||||
return h("Tag", {props: {color: "volcano"},},"下架");
|
||||
return h("Tag", { props: { color: "volcano" } }, "下架");
|
||||
} else if (params.row.marketEnable == "UPPER") {
|
||||
return h("Tag", {props: {color: "green",},},"上架");
|
||||
return h("Tag", { props: { color: "green" } }, "上架");
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "审核状态",
|
||||
key: "isAuth",
|
||||
key: "authFlag",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.isAuth == "TOBEAUDITED") {
|
||||
return h("Tag", {props: {color: "volcano",},},"待审核");
|
||||
} else if (params.row.isAuth == "PASS") {
|
||||
return h("Tag", {props: {color: "green"},},"通过");
|
||||
} else if (params.row.isAuth == "REFUSE") {
|
||||
return h("Tag", {props: {color: "red",},},"拒绝");
|
||||
if (params.row.authFlag == "TOBEAUDITED") {
|
||||
return h("Tag", { props: { color: "volcano" } }, "待审核");
|
||||
} else if (params.row.authFlag == "PASS") {
|
||||
return h("Tag", { props: { color: "green" } }, "通过");
|
||||
} else if (params.row.authFlag == "REFUSE") {
|
||||
return h("Tag", { props: { color: "red" } }, "拒绝");
|
||||
}
|
||||
},
|
||||
},
|
||||
|
@ -208,7 +216,7 @@ export default {
|
|||
title: "店铺名称",
|
||||
key: "storeName",
|
||||
minWidth: 100,
|
||||
tooltip: true
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
|
@ -236,7 +244,8 @@ export default {
|
|||
},
|
||||
},
|
||||
"上架"
|
||||
), h(
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
|
@ -249,7 +258,7 @@ export default {
|
|||
},
|
||||
},
|
||||
"查看"
|
||||
)
|
||||
),
|
||||
]);
|
||||
} else {
|
||||
return h("div", [
|
||||
|
@ -270,7 +279,8 @@ export default {
|
|||
},
|
||||
},
|
||||
"下架"
|
||||
), h(
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
|
@ -283,7 +293,7 @@ export default {
|
|||
},
|
||||
},
|
||||
"查看"
|
||||
)
|
||||
),
|
||||
]);
|
||||
}
|
||||
},
|
||||
|
@ -369,7 +379,7 @@ export default {
|
|||
name: "goods-detail",
|
||||
query: { id: id },
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
|
|
|
@ -27,7 +27,9 @@
|
|||
style="width: 200px"
|
||||
/>
|
||||
</Form-item>
|
||||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search">搜索</Button>
|
||||
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search"
|
||||
>搜索</Button
|
||||
>
|
||||
</Form>
|
||||
<Table
|
||||
:loading="loading"
|
||||
|
@ -39,18 +41,20 @@
|
|||
>
|
||||
<!-- 商品栏目格式化 -->
|
||||
<template slot="goodsSlot" slot-scope="scope">
|
||||
<div style="margin-top: 5px;height: 80px; display: flex;">
|
||||
<div style="margin-top: 5px; height: 80px; display: flex">
|
||||
<div style="">
|
||||
<img :src="scope.row.original" style="height: 60px;margin-top: 3px;width: 60px">
|
||||
<img
|
||||
:src="scope.row.original"
|
||||
style="height: 60px; margin-top: 3px; width: 60px"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div style="margin-left: 13px">
|
||||
<div class="div-zoom" >
|
||||
<a>{{scope.row.goodsName}}</a>
|
||||
<div class="div-zoom">
|
||||
<a>{{ scope.row.goodsName }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
</Table>
|
||||
<Row type="flex" justify="end" class="mt_10">
|
||||
|
@ -72,220 +76,224 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {authGoods, getAuthGoodsListData} from "@/api/goods";
|
||||
import { authGoods, getAuthGoodsListData } from "@/api/goods";
|
||||
|
||||
export default {
|
||||
name: "goods",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
id: "", //要操作的id
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "create_time", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
export default {
|
||||
name: "goods",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
id: "", //要操作的id
|
||||
loading: true, // 表单加载状态
|
||||
searchForm: {
|
||||
// 搜索框初始化对象
|
||||
pageNumber: 1, // 当前页数
|
||||
pageSize: 10, // 页面大小
|
||||
sort: "create_time", // 默认排序字段
|
||||
order: "desc", // 默认排序方式
|
||||
},
|
||||
goodsAuditForm: {
|
||||
// 商品编辑表单
|
||||
is_auth: 1,
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 180,
|
||||
slot: "goodsSlot",
|
||||
tooltip: true,
|
||||
},
|
||||
goodsAuditForm: { // 商品编辑表单
|
||||
is_auth: 1,
|
||||
{
|
||||
title: "商品编号",
|
||||
key: "id",
|
||||
minWidth: 100,
|
||||
tooltip: true,
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: "商品名称",
|
||||
key: "goodsName",
|
||||
minWidth: 180,
|
||||
slot: "goodsSlot",
|
||||
tooltip: true
|
||||
{
|
||||
title: "价格",
|
||||
key: "price",
|
||||
minWidth: 130,
|
||||
render: (h, params) => {
|
||||
return h("div", this.$options.filters.unitPrice(params.row.price, "¥"));
|
||||
},
|
||||
{
|
||||
title: "商品编号",
|
||||
key: "id",
|
||||
minWidth: 100,
|
||||
tooltip: true
|
||||
},
|
||||
{
|
||||
title: "价格",
|
||||
key: "price",
|
||||
minWidth: 130,
|
||||
render: (h, params) => {
|
||||
return h(
|
||||
"div",
|
||||
this.$options.filters.unitPrice(params.row.price, "¥")
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
title: "审核状态",
|
||||
key: "isAuth",
|
||||
minWidth: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.isAuth == "TOBEAUDITED") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "待审核",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.isAuth == "PASS") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "审核通过",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.isAuth == "REFUSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "审核拒绝",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
title: "店铺名称",
|
||||
key: "storeName",
|
||||
minWidth: 100,
|
||||
tooltip: true
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
},
|
||||
{
|
||||
title: "审核状态",
|
||||
key: "authFlag",
|
||||
minWidth: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.authFlag == "TOBEAUDITED") {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.examine(params.row, 1);
|
||||
},
|
||||
},
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "待审核",
|
||||
},
|
||||
"通过"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.examine(params.row, 2);
|
||||
},
|
||||
},
|
||||
},
|
||||
"拒绝"
|
||||
), h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.showDetail(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"查看"
|
||||
)
|
||||
}),
|
||||
]);
|
||||
},
|
||||
} else if (params.row.authFlag == "PASS") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "success",
|
||||
text: "审核通过",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
} else if (params.row.authFlag == "REFUSE") {
|
||||
return h("div", [
|
||||
h("Badge", {
|
||||
props: {
|
||||
status: "error",
|
||||
text: "审核拒绝",
|
||||
},
|
||||
}),
|
||||
]);
|
||||
}
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() { // 初始化数据
|
||||
this.getDataList();
|
||||
},
|
||||
changePage(v) { // 改变页码
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
},
|
||||
changePageSize(v) { // 改变每页数量
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() { // 搜索
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
getDataList() { // 获取列表数据
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据
|
||||
this.searchForm.isAuth = 0;
|
||||
getAuthGoodsListData(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.records) {
|
||||
this.data = res.records;
|
||||
this.total = res.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
examine(v, isAuth) { // 审核商品
|
||||
let examine = "通过";
|
||||
this.goodsAuditForm.isAuth = "PASS";
|
||||
if (isAuth != 1) {
|
||||
examine = "拒绝";
|
||||
this.goodsAuditForm.isAuth = "REFUSE";
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认审核",
|
||||
content: "您确认要审核" + examine + " " + v.goodsName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
authGoods(v.id, this.goodsAuditForm).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("审核成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
//查看商品详情
|
||||
showDetail(v) {
|
||||
let id = v.id;
|
||||
this.$router.push({
|
||||
name: "goods-detail",
|
||||
query: { id: id },
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
},
|
||||
|
||||
{
|
||||
title: "店铺名称",
|
||||
key: "storeName",
|
||||
minWidth: 100,
|
||||
tooltip: true,
|
||||
},
|
||||
{
|
||||
title: "操作",
|
||||
key: "action",
|
||||
align: "center",
|
||||
fixed: "right",
|
||||
width: 200,
|
||||
render: (h, params) => {
|
||||
return h("div", [
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "success",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.examine(params.row, 1);
|
||||
},
|
||||
},
|
||||
},
|
||||
"通过"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
type: "error",
|
||||
size: "small",
|
||||
},
|
||||
style: {
|
||||
marginRight: "5px",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.examine(params.row, 2);
|
||||
},
|
||||
},
|
||||
},
|
||||
"拒绝"
|
||||
),
|
||||
h(
|
||||
"Button",
|
||||
{
|
||||
props: {
|
||||
size: "small",
|
||||
},
|
||||
on: {
|
||||
click: () => {
|
||||
this.showDetail(params.row);
|
||||
},
|
||||
},
|
||||
},
|
||||
"查看"
|
||||
),
|
||||
]);
|
||||
},
|
||||
},
|
||||
],
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
// 初始化数据
|
||||
this.getDataList();
|
||||
},
|
||||
changePage(v) {
|
||||
// 改变页码
|
||||
this.searchForm.pageNumber = v;
|
||||
this.getDataList();
|
||||
},
|
||||
changePageSize(v) {
|
||||
// 改变每页数量
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleSearch() {
|
||||
// 搜索
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 10;
|
||||
this.getDataList();
|
||||
},
|
||||
getDataList() {
|
||||
// 获取列表数据
|
||||
this.loading = true;
|
||||
// 带多条件搜索参数获取表单数据
|
||||
this.searchForm.authFlag = 0;
|
||||
getAuthGoodsListData(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.records) {
|
||||
this.data = res.records;
|
||||
this.total = res.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
examine(v, authFlag) {
|
||||
// 审核商品
|
||||
let examine = "通过";
|
||||
this.goodsAuditForm.authFlag = "PASS";
|
||||
if (authFlag != 1) {
|
||||
examine = "拒绝";
|
||||
this.goodsAuditForm.authFlag = "REFUSE";
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认审核",
|
||||
content: "您确认要审核" + examine + " " + v.goodsName + " ?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
authGoods(v.id, this.goodsAuditForm).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("审核成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
//查看商品详情
|
||||
showDetail(v) {
|
||||
let id = v.id;
|
||||
this.$router.push({
|
||||
name: "goods-detail",
|
||||
query: { id: id },
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -53,7 +53,7 @@ export default {
|
|||
sn: "",
|
||||
categoryPath: "",
|
||||
marketEnable: "UPPER",
|
||||
isAuth: "PASS",
|
||||
authFlag: "PASS",
|
||||
},
|
||||
category: [], // 分类
|
||||
goodsData: [], // 商品数据
|
||||
|
|
|
@ -54,12 +54,12 @@
|
|||
</FormItem>
|
||||
<FormItem label="优惠方式">
|
||||
<RadioGroup type="button" button-style="solid" v-model="form.discountType">
|
||||
<Radio label="isFullMinus" disabled>减现金</Radio>
|
||||
<Radio label="isFullRate" disabled>打折</Radio>
|
||||
<Radio label="fullMinusFlag" disabled>减现金</Radio>
|
||||
<Radio label="fullRateFlag" disabled>打折</Radio>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
v-if="form.discountType == 'isFullMinus'"
|
||||
v-if="form.discountType == 'fullMinusFlag'"
|
||||
label="优惠金额"
|
||||
prop="fullMinus"
|
||||
>
|
||||
|
@ -73,7 +73,7 @@
|
|||
/>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
v-if="form.discountType == 'isFullRate'"
|
||||
v-if="form.discountType == 'fullRateFlag'"
|
||||
label="优惠折扣"
|
||||
prop="fullRate"
|
||||
>
|
||||
|
@ -88,12 +88,12 @@
|
|||
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
||||
</FormItem>
|
||||
<FormItem label="额外赠送">
|
||||
<Checkbox v-model="form.isFreeFreight" disabled>免邮费</Checkbox>
|
||||
<Checkbox v-model="form.isCoupon" disabled>送优惠券</Checkbox>
|
||||
<Checkbox v-model="form.isGift" disabled>送赠品</Checkbox>
|
||||
<Checkbox v-model="form.isPoint" disabled>送积分</Checkbox>
|
||||
<Checkbox v-model="form.freeFreightFlag" disabled>免邮费</Checkbox>
|
||||
<Checkbox v-model="form.couponFlag" disabled>送优惠券</Checkbox>
|
||||
<Checkbox v-model="form.giftFlag" disabled>送赠品</Checkbox>
|
||||
<Checkbox v-model="form.pointFlag" disabled>送积分</Checkbox>
|
||||
</FormItem>
|
||||
<FormItem v-if="form.isCoupon" label="赠送优惠券" prop="couponId">
|
||||
<FormItem v-if="form.couponFlag" label="赠送优惠券" prop="couponId">
|
||||
<Select
|
||||
v-model="form.couponId"
|
||||
filterable
|
||||
|
@ -108,7 +108,7 @@
|
|||
}}</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem v-if="form.isGift" label="赠品" prop="giftId">
|
||||
<FormItem v-if="form.giftFlag" label="赠品" prop="giftId">
|
||||
<Select
|
||||
v-model="form.giftId"
|
||||
filterable
|
||||
|
@ -123,7 +123,7 @@
|
|||
}}</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem v-if="form.isPoint" label="赠积分" prop="point">
|
||||
<FormItem v-if="form.pointFlag" label="赠积分" prop="point">
|
||||
<Input v-model="form.point" type="number" disabled style="width: 260px" />
|
||||
</FormItem>
|
||||
<FormItem label="使用范围" prop="scopeType">
|
||||
|
@ -187,7 +187,7 @@ export default {
|
|||
return {
|
||||
form: {
|
||||
// 表单
|
||||
discountType: "isFullMinus",
|
||||
discountType: "fullMinusFlag",
|
||||
scopeType: "ALL",
|
||||
promotionGoodsList: [],
|
||||
},
|
||||
|
@ -242,12 +242,12 @@ export default {
|
|||
if (!data.scopeType === "ALL") {
|
||||
data.promotionGoodsList = [];
|
||||
}
|
||||
if (data.isFullMinus) {
|
||||
data.discountType = "isFullMinus";
|
||||
delete data.isFullMinus;
|
||||
if (data.fullMinusFlag) {
|
||||
data.discountType = "fullMinusFlag";
|
||||
delete data.fullMinusFlag;
|
||||
} else {
|
||||
data.discountType = "isFullMinus";
|
||||
delete data.isFullRate;
|
||||
data.discountType = "fullMinusFlag";
|
||||
delete data.fullRateFlag;
|
||||
}
|
||||
data.rangeTime = [];
|
||||
data.rangeTime.push(new Date(data.startTime), new Date(data.endTime));
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
{{ unixDate(row.applyEndTime) }}
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="promotionType">
|
||||
{{ row.isFullMinus ? "满减" : "满折" }}
|
||||
{{ row.fullMinusFlag ? "满减" : "满折" }}
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="hours">
|
||||
<Tag v-for="item in unixHours(row.hours)" :key="item">{{ item }}</Tag>
|
||||
|
|
|
@ -156,14 +156,14 @@ export default {
|
|||
},
|
||||
{
|
||||
title: "审核状态",
|
||||
key: "isAuth",
|
||||
key: "authFlag",
|
||||
width: 130,
|
||||
render: (h, params) => {
|
||||
if (params.row.isAuth == "TOBEAUDITED") {
|
||||
if (params.row.authFlag == "TOBEAUDITED") {
|
||||
return h("Tag", {props: {color: "blue",},},"待审核");
|
||||
} else if (params.row.isAuth == "PASS") {
|
||||
} else if (params.row.authFlag == "PASS") {
|
||||
return h("Tag", {props: {color: "green",},},"通过");
|
||||
} else if (params.row.isAuth == "REFUSE") {
|
||||
} else if (params.row.authFlag == "REFUSE") {
|
||||
return h("Tag", {props: {color: "red",},},"审核拒绝");
|
||||
}
|
||||
},
|
||||
|
@ -250,14 +250,14 @@ export default {
|
|||
},
|
||||
{
|
||||
title: "审核状态",
|
||||
key: "isAuth",
|
||||
key: "authFlag",
|
||||
width: 120,
|
||||
render: (h, params) => {
|
||||
if (params.row.isAuth == "PASS") {
|
||||
if (params.row.authFlag == "PASS") {
|
||||
return h("Tag", {props: {color: "green"}},"通过");
|
||||
} else if (params.row.isAuth == "TOBEAUDITED") {
|
||||
} else if (params.row.authFlag == "TOBEAUDITED") {
|
||||
return h("Tag", {props: {color: "volcano"}},"待审核");
|
||||
} else if (params.row.isAuth == "REFUSE") {
|
||||
} else if (params.row.authFlag == "REFUSE") {
|
||||
return h("Tag", {props: {color: "red"}},"审核拒绝");
|
||||
}
|
||||
},
|
||||
|
|
|
@ -64,7 +64,7 @@ export default {
|
|||
sn: "",
|
||||
categoryPath: "",
|
||||
marketEnable: "UPPER",
|
||||
isAuth: "PASS",
|
||||
authFlag: "PASS",
|
||||
},
|
||||
category: [], // 选中的商品分类
|
||||
goodsData: [], // 商品列表
|
||||
|
|
|
@ -54,16 +54,16 @@
|
|||
</FormItem>
|
||||
<FormItem label="优惠方式">
|
||||
<RadioGroup type="button" button-style="solid" v-model="form.discountType">
|
||||
<Radio :disabled="form.promotionStatus != 'NEW'" label="isFullMinus"
|
||||
<Radio :disabled="form.promotionStatus != 'NEW'" label="fullMinusFlag"
|
||||
>减现金</Radio
|
||||
>
|
||||
<Radio :disabled="form.promotionStatus != 'NEW'" label="isFullRate"
|
||||
<Radio :disabled="form.promotionStatus != 'NEW'" label="fullRateFlag"
|
||||
>打折</Radio
|
||||
>
|
||||
</RadioGroup>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
v-if="form.discountType == 'isFullMinus'"
|
||||
v-if="form.discountType == 'fullMinusFlag'"
|
||||
label="优惠金额"
|
||||
prop="fullMinus"
|
||||
>
|
||||
|
@ -77,7 +77,7 @@
|
|||
/>
|
||||
</FormItem>
|
||||
<FormItem
|
||||
v-if="form.discountType == 'isFullRate'"
|
||||
v-if="form.discountType == 'fullRateFlag'"
|
||||
label="优惠折扣"
|
||||
prop="fullRate"
|
||||
>
|
||||
|
@ -94,13 +94,15 @@
|
|||
<FormItem label="额外赠送">
|
||||
<Checkbox
|
||||
:disabled="form.promotionStatus != 'NEW'"
|
||||
v-model="form.isFreeFreight"
|
||||
v-model="form.freeFreightFlag"
|
||||
>免邮费</Checkbox
|
||||
>
|
||||
<Checkbox :disabled="form.promotionStatus != 'NEW'" v-model="form.isCoupon"
|
||||
<Checkbox
|
||||
:disabled="form.promotionStatus != 'NEW'"
|
||||
v-model="form.couponFlag"
|
||||
>送优惠券</Checkbox
|
||||
>
|
||||
<Checkbox :disabled="form.promotionStatus != 'NEW'" v-model="form.isGift"
|
||||
<Checkbox :disabled="form.promotionStatus != 'NEW'" v-model="form.giftFlag"
|
||||
>送赠品</Checkbox
|
||||
>
|
||||
<Checkbox
|
||||
|
@ -109,11 +111,11 @@
|
|||
Cookies.get('userInfoSeller') &&
|
||||
JSON.parse(Cookies.get('userInfoSeller')).selfOperated
|
||||
"
|
||||
v-model="form.isPoint"
|
||||
v-model="form.pointFlag"
|
||||
>送积分</Checkbox
|
||||
>
|
||||
</FormItem>
|
||||
<FormItem v-if="form.isCoupon" label="赠送优惠券" prop="couponId">
|
||||
<FormItem v-if="form.couponFlag" label="赠送优惠券" prop="couponId">
|
||||
<Select
|
||||
v-model="form.couponId"
|
||||
:disabled="form.promotionStatus != 'NEW'"
|
||||
|
@ -128,7 +130,7 @@
|
|||
}}</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem v-if="form.isGift" label="赠品" prop="giftId">
|
||||
<FormItem v-if="form.giftFlag" label="赠品" prop="giftId">
|
||||
<Select
|
||||
:disabled="form.promotionStatus != 'NEW'"
|
||||
v-model="form.giftId"
|
||||
|
@ -143,7 +145,7 @@
|
|||
}}</Option>
|
||||
</Select>
|
||||
</FormItem>
|
||||
<FormItem v-if="form.isPoint" label="赠积分" prop="point">
|
||||
<FormItem v-if="form.pointGift" label="赠积分" prop="point">
|
||||
<InputNumber
|
||||
:min="0"
|
||||
:disabled="form.promotionStatus != 'NEW'"
|
||||
|
@ -265,7 +267,7 @@ export default {
|
|||
Cookies,
|
||||
form: {
|
||||
// 活动表单
|
||||
discountType: "isFullMinus",
|
||||
discountType: "fullMinusFlag",
|
||||
scopeType: "ALL",
|
||||
promotionGoodsList: [],
|
||||
promotionStatus: "NEW",
|
||||
|
@ -370,12 +372,12 @@ export default {
|
|||
if (data.scopeType === "ALL") {
|
||||
data.promotionGoodsList = [];
|
||||
}
|
||||
if (data.isFullMinus) {
|
||||
data.discountType = "isFullMinus";
|
||||
delete data.isFullMinus;
|
||||
if (data.fullMinusFlag) {
|
||||
data.discountType = "fullMinusFlag";
|
||||
delete data.fullMinusFlag;
|
||||
} else {
|
||||
data.discountType = "isFullRate";
|
||||
delete data.isFullRate;
|
||||
data.discountType = "fullRateFlag";
|
||||
delete data.fullRateFlag;
|
||||
}
|
||||
data.rangeTime = [];
|
||||
data.rangeTime.push(new Date(data.startTime), new Date(data.endTime));
|
||||
|
@ -410,10 +412,10 @@ export default {
|
|||
e.endTime = params.endTime;
|
||||
});
|
||||
}
|
||||
if (params.discountType == "isFullMinus") {
|
||||
params.isFullMinus = true;
|
||||
if (params.discountType == "fullMinusFlag") {
|
||||
params.fullMinusFlag = true;
|
||||
} else {
|
||||
params.isFullRate = true;
|
||||
params.fullRateFlag = true;
|
||||
}
|
||||
delete params.rangeTime;
|
||||
this.submitLoading = true;
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
{{ unixDate(row.applyEndTime) }}
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="promotionType">
|
||||
{{ row.isFullMinus ? "满减" : "满折" }}
|
||||
{{ row.fullMinusFlag ? "满减" : "满折" }}
|
||||
</template>
|
||||
<template slot-scope="{ row }" slot="hours">
|
||||
<Tag v-for="item in unixHours(row.hours)" :key="item">{{ item }}</Tag>
|
||||
|
|
Loading…
Reference in New Issue