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