mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-18 17:05:54 +08:00
提交促销以己部分页面商家端功能迁移,接口对接
This commit is contained in:
@@ -57,5 +57,15 @@ export const auditDistributionCash = (id,params) => {
|
|||||||
return postRequest(`/distribution/cash/audit/${id}`, params)
|
return postRequest(`/distribution/cash/audit/${id}`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 取消分销商品
|
||||||
|
export const distributionGoodsCancel = (id) => {
|
||||||
|
return deleteRequest(`/distribution/goods/cancel/${id}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 选择分销商品
|
||||||
|
export const distributionGoodsCheck = (id,param) => {
|
||||||
|
return putRequest(`/distribution/goods/checked/${id}`,param)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// 统一请求路径前缀在libs/axios.js中修改
|
// 统一请求路径前缀在libs/axios.js中修改
|
||||||
import { getRequest, postRequest, putRequest, deleteRequest} from '@/libs/axios';
|
import { getRequest, postRequest, putRequest, deleteRequest } from '@/libs/axios';
|
||||||
|
|
||||||
// 获取商品品牌分页列表
|
// 获取商品品牌分页列表
|
||||||
export const getManagerBrandPage = (params) => {
|
export const getManagerBrandPage = (params) => {
|
||||||
@@ -7,7 +7,7 @@ export const getManagerBrandPage = (params) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 批量删除
|
// 批量删除
|
||||||
export const delBrand = (ids) =>{
|
export const delBrand = (ids) => {
|
||||||
return deleteRequest(`/goods/brand/delByIds/${ids}`)
|
return deleteRequest(`/goods/brand/delByIds/${ids}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,7 +83,7 @@ export const insertSpec = (params) => {
|
|||||||
return postRequest('/goods/spec', params)
|
return postRequest('/goods/spec', params)
|
||||||
}
|
}
|
||||||
// 添加或修改规格设置
|
// 添加或修改规格设置
|
||||||
export const updateSpec = (id,params) => {
|
export const updateSpec = (id, params) => {
|
||||||
return putRequest(`/goods/spec/${id}`, params)
|
return putRequest(`/goods/spec/${id}`, params)
|
||||||
}
|
}
|
||||||
//根据分类id获取关联规格
|
//根据分类id获取关联规格
|
||||||
@@ -103,11 +103,11 @@ export const getGoodsCategory = (parent_id) => {
|
|||||||
// 上架商品
|
// 上架商品
|
||||||
export const upGoods = (id, params) => {
|
export const upGoods = (id, params) => {
|
||||||
return putRequest(`/goods/goods/${id}/up`, params)
|
return putRequest(`/goods/goods/${id}/up`, params)
|
||||||
}
|
}
|
||||||
// 下架商品
|
// 下架商品
|
||||||
export const lowGoods = (id, params) => {
|
export const lowGoods = (id, params) => {
|
||||||
return putRequest(`/goods/goods/${id}/under`, params)
|
return putRequest(`/goods/goods/${id}/under`, params)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取商品sku分页列表
|
// 获取商品sku分页列表
|
||||||
export const getGoodsSkuData = (params) => {
|
export const getGoodsSkuData = (params) => {
|
||||||
@@ -225,3 +225,35 @@ export const refundStatistics = (params) => {
|
|||||||
export const refundPriceStatistics = (params) => {
|
export const refundPriceStatistics = (params) => {
|
||||||
return getRequest(`/statistics/refund/order/getPrice`, params)
|
return getRequest(`/statistics/refund/order/getPrice`, params)
|
||||||
}
|
}
|
||||||
|
// 获取草稿商品分页列表
|
||||||
|
export const getDraftGoodsListData = params => {
|
||||||
|
return getRequest("/goods/draftGoods/page", params);
|
||||||
|
};
|
||||||
|
// 获取草稿商品详情
|
||||||
|
export const getDraftGoodsDetail = id => {
|
||||||
|
return getRequest(`/goods/draftGoods/${id}`);
|
||||||
|
};
|
||||||
|
// 保存草稿商品
|
||||||
|
export function saveDraftGoods(params) {
|
||||||
|
return postRequest("/goods/draftGoods/save", params, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除草稿商品
|
||||||
|
export const deleteDraftGoods = id => {
|
||||||
|
return deleteRequest(`/goods/draftGoods/${id}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export function createGoods(params) {
|
||||||
|
return postRequest("/goods/goods/create", params, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function editGoods(goodsId, params) {
|
||||||
|
return putRequest(`/goods/goods/update/${goodsId}`, params, {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -126,10 +126,7 @@ export const getAfterSaleOrderDetail = (sn) => {
|
|||||||
export const getAfterSaleTraces = (sn) => {
|
export const getAfterSaleTraces = (sn) => {
|
||||||
return getRequest(`/order/afterSale/getDeliveryTraces/${sn}`)
|
return getRequest(`/order/afterSale/getDeliveryTraces/${sn}`)
|
||||||
}
|
}
|
||||||
// 获取商家选中的物流公司
|
|
||||||
export const getLogisticsChecked = () => {
|
|
||||||
return getRequest(`/other/logistics/getChecked`)
|
|
||||||
}
|
|
||||||
|
|
||||||
//查询物流
|
//查询物流
|
||||||
export const getTraces = (sn, params) => {
|
export const getTraces = (sn, params) => {
|
||||||
@@ -165,3 +162,14 @@ export const storeAddress = (sn) => {
|
|||||||
export const orderTake = (sn, verificationCode) => {
|
export const orderTake = (sn, verificationCode) => {
|
||||||
return putRequest(`/order/order/take/${sn}/${verificationCode}`);
|
return putRequest(`/order/order/take/${sn}/${verificationCode}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//分包裹发货
|
||||||
|
export const partDelivery = (orderSn,params) => {
|
||||||
|
return postRequest(`/order/order/${orderSn}/partDelivery`,params,{
|
||||||
|
"Content-type": "application/json"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 修改订单备注
|
||||||
|
export const modifyOrderRemark = (sn, params) => {
|
||||||
|
return putRequest(`/order/order/${sn}/sellerRemark`, params);
|
||||||
|
};
|
||||||
|
|||||||
@@ -281,3 +281,32 @@ export const deletePointsGoodsCategoryById = id => {
|
|||||||
export const getCouponReceiveList = (params) => {
|
export const getCouponReceiveList = (params) => {
|
||||||
return getRequest("/promotion/coupon/received", params);
|
return getRequest("/promotion/coupon/received", params);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 新增满减活动
|
||||||
|
export const newFullDiscount = (params) => {
|
||||||
|
return postRequest(`/promotion/fullDiscount`, params, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 编辑满减活动
|
||||||
|
export const editFullDiscount = (params) => {
|
||||||
|
return putRequest(`/promotion/fullDiscount`, params, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
// 新建 拼团
|
||||||
|
export const savePintuan = (params) => {
|
||||||
|
return postRequest('/promotion/pintuan', params, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
// 编辑 拼团
|
||||||
|
export const editPintuan = (params) => {
|
||||||
|
return putRequest('/promotion/pintuan', params, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加限时抢购 商品
|
||||||
|
export const setSeckillGoods = (params) => {
|
||||||
|
return postRequest(`/promotion/seckill/apply/${params.seckillId}`, params.applyVos, { 'Content-type': 'application/json' })
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加限时抢购 商品
|
||||||
|
export const removeSeckillGoods = (seckillId, ids) => {
|
||||||
|
return deleteRequest(`/promotion/seckill/apply/${seckillId}/${ids}`)
|
||||||
|
}
|
||||||
|
|||||||
@@ -89,9 +89,21 @@ export const downloadBill = (id) => {
|
|||||||
|
|
||||||
// 获取物流模版
|
// 获取物流模版
|
||||||
export const getShipTemplate = (id) => {
|
export const getShipTemplate = (id) => {
|
||||||
// return getRequest(`/order/bill/shipTemplate`)
|
return getRequest(`/order/bill/shipTemplate`)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const replyMemberComment = (id, params) => {
|
export const replyMemberComment = (id, params) => {
|
||||||
return putRequest(`/member/evaluation/reply/${id}`, params)
|
return putRequest(`/member/evaluation/reply/${id}`, params)
|
||||||
}
|
}
|
||||||
|
//删除运费模板
|
||||||
|
export const deleteShipTemplate = (id) => {
|
||||||
|
return deleteRequest(`/setting/freightTemplate/${id}`)
|
||||||
|
}
|
||||||
|
//新增运费模板
|
||||||
|
export const addShipTemplate = (params, headers) => {
|
||||||
|
return postRequest(`/setting/freightTemplate`, params, headers)
|
||||||
|
}
|
||||||
|
//编辑运费模板
|
||||||
|
export const editShipTemplate = (id, params, headers) => {
|
||||||
|
return putRequest(`/setting/freightTemplate/${id}`, params, headers)
|
||||||
|
}
|
||||||
|
|||||||
@@ -242,6 +242,12 @@ export const otherRouter = {
|
|||||||
name: "pintuan-goods",
|
name: "pintuan-goods",
|
||||||
component: () => import("@/views/promotions/pintuan/pintuan-goods.vue")
|
component: () => import("@/views/promotions/pintuan/pintuan-goods.vue")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "promotions/pintuan/pintuan-create",
|
||||||
|
title: "添加拼团活动",
|
||||||
|
name: "pintuan-create",
|
||||||
|
component: () => import("@/views/promotions/pintuan/pintuan-create.vue")
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "promotions/full-discount-detail",
|
path: "promotions/full-discount-detail",
|
||||||
title: "满减满折详情",
|
title: "满减满折详情",
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
<Row class="operation" style="margin:10px 0;">
|
<Row class="operation" style="margin:10px 0;">
|
||||||
|
<Button @click="add" type="primary">添加</Button>
|
||||||
|
|
||||||
<Button @click="delAll" type="primary">批量下架</Button>
|
<Button @click="delAll" type="primary">批量下架</Button>
|
||||||
</Row>
|
</Row>
|
||||||
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
|
||||||
@@ -34,11 +36,34 @@
|
|||||||
show-sizer></Page>
|
show-sizer></Page>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
<liliDialog
|
||||||
|
ref="liliDialog"
|
||||||
|
@selectedGoodsData="selectedGoodsData"
|
||||||
|
></liliDialog>
|
||||||
|
<Modal
|
||||||
|
:title="modalTitle"
|
||||||
|
v-model="modalVisible"
|
||||||
|
:mask-closable="false"
|
||||||
|
:width="500"
|
||||||
|
>
|
||||||
|
<Form ref="form" :model="form" :label-width="100" :rules="formValidate">
|
||||||
|
<FormItem label="分销佣金" prop="commission">
|
||||||
|
<Input v-model="form.commission" clearable style="width: 100%"/>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
<div slot="footer">
|
||||||
|
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||||
|
<Button type="primary" :loading="submitLoading" @click="handleSubmit"
|
||||||
|
>提交
|
||||||
|
</Button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { delDistributionGoods, getDistributionGoods } from "@/api/distribution";
|
import { delDistributionGoods, getDistributionGoods,distributionGoodsCheck } from "@/api/distribution";
|
||||||
import vueQr from "vue-qr";
|
import vueQr from "vue-qr";
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
@@ -47,6 +72,11 @@ export default {
|
|||||||
name: "distributionGoods",
|
name: "distributionGoods",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
modalVisible: false, // 添加或编辑显示
|
||||||
|
modalTitle: "", // 添加或编辑标题
|
||||||
|
form:{
|
||||||
|
commission : 1 // 分销金额
|
||||||
|
},
|
||||||
loading: true, // 表单加载状态
|
loading: true, // 表单加载状态
|
||||||
searchForm: {
|
searchForm: {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
@@ -155,11 +185,48 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
data: [], // 表单数据
|
data: [], // 表单数据
|
||||||
total: 0, // 表单数据总数
|
total: 0, // 表单数据总数
|
||||||
|
skuId:0,
|
||||||
|
formValidate: {
|
||||||
|
commission: [
|
||||||
|
{ required: true, message: '请输入大于1小于9999的合法分销金额'},
|
||||||
|
{
|
||||||
|
pattern: /^[1-9]\d{0,3}(\.\d{1,2})?$/,
|
||||||
|
message: "请输入大于1小于9999的合法分销金额",
|
||||||
|
trigger: "change"
|
||||||
|
}],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 选择商品回调
|
||||||
|
selectedGoodsData(v){
|
||||||
|
this.modalVisible = true
|
||||||
|
this.form.commission = 1
|
||||||
|
this.modalTitle = "保存分销商品"
|
||||||
|
this.skuId = v[0].id
|
||||||
|
},
|
||||||
|
// 添加商品
|
||||||
|
handleSubmit(){
|
||||||
|
this.$refs['form'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
distributionGoodsCheck(this.skuId,this.form).then(res => {
|
||||||
|
if(res.message === 'success') {
|
||||||
|
this.$Message.success("添加成功");
|
||||||
|
}
|
||||||
|
this.modalVisible = false
|
||||||
|
this.getDataList()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
add(){
|
||||||
|
this.$refs.liliDialog.flag = true;
|
||||||
|
this.$refs.liliDialog.goodsFlag = true;
|
||||||
|
this.$refs.liliDialog.singleGoods();
|
||||||
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
|
|||||||
@@ -54,13 +54,13 @@
|
|||||||
</i-switch>
|
</i-switch>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
<FormItem label="禁用状态" prop="disabled">
|
<!-- <FormItem label="禁用状态" prop="disabled">
|
||||||
|
|
||||||
<i-switch true-value="OPEN" false-value="CLOSE" v-model="form.disabled" size="large">
|
<i-switch true-value="OPEN" false-value="CLOSE" v-model="form.disabled" size="large">
|
||||||
<span slot="open">开启</span>
|
<span slot="open">开启</span>
|
||||||
<span slot="close">禁用</span>
|
<span slot="close">禁用</span>
|
||||||
</i-switch>
|
</i-switch>
|
||||||
</FormItem>
|
</FormItem> -->
|
||||||
</Form>
|
</Form>
|
||||||
<div slot="footer">
|
<div slot="footer">
|
||||||
<Button type="text" @click="modalVisible = false">取消</Button>
|
<Button type="text" @click="modalVisible = false">取消</Button>
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
form: {
|
form: {
|
||||||
// 添加或编辑表单对象初始化数据
|
// 添加或编辑表单对象初始化数据
|
||||||
name: "",
|
name: "",
|
||||||
disabled:"CLOSE"
|
disabled:"OPEN"
|
||||||
},
|
},
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
formValidate: {
|
formValidate: {
|
||||||
@@ -125,12 +125,7 @@
|
|||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
sortable: false,
|
sortable: false,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "状态",
|
|
||||||
key: "disabled",
|
|
||||||
width: 150,
|
|
||||||
slot: "disableSlot",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "创建时间",
|
title: "创建时间",
|
||||||
key: "createTime",
|
key: "createTime",
|
||||||
@@ -246,7 +241,7 @@
|
|||||||
if (this.modalTitle == "添加") {
|
if (this.modalTitle == "添加") {
|
||||||
// 添加 避免编辑后传入id等数据 记得删除
|
// 添加 避免编辑后传入id等数据 记得删除
|
||||||
delete this.form.id;
|
delete this.form.id;
|
||||||
|
this.form.disabled = 'OPEN'
|
||||||
|
|
||||||
addLogistics(this.form).then((res) => {
|
addLogistics(this.form).then((res) => {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
@@ -257,6 +252,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
this.form.disabled = 'OPEN'
|
||||||
// 编辑
|
// 编辑
|
||||||
updateLogistics(this.id, this.form).then((res) => {
|
updateLogistics(this.id, this.form).then((res) => {
|
||||||
this.submitLoading = false;
|
this.submitLoading = false;
|
||||||
@@ -292,7 +288,8 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.form.disabled = v.disabled
|
// this.form.disabled = v.disabled
|
||||||
|
this.form.disabled = 'OPEN'
|
||||||
},
|
},
|
||||||
// 删除物流公司
|
// 删除物流公司
|
||||||
remove(v) {
|
remove(v) {
|
||||||
|
|||||||
@@ -1,32 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<Card>
|
<div>
|
||||||
<Tabs :value="type">
|
<Card class="mb_10">
|
||||||
<TabPane label="物流公司" name="company">
|
<h2 class="mb_10">运费模版</h2>
|
||||||
<company/>
|
<shipTemplate />
|
||||||
</TabPane>
|
|
||||||
<TabPane label="物流模版" name="template">
|
|
||||||
<!-- <shipTemplate/> -->
|
|
||||||
</TabPane>
|
|
||||||
</Tabs>
|
|
||||||
</Card>
|
</Card>
|
||||||
|
<Card>
|
||||||
|
<h2 class="mb_10">物流公司</h2>
|
||||||
|
<company />
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import company from './company.vue'
|
import company from './company.vue'
|
||||||
import shipTemplate from './shipTemplate.vue';
|
import shipTemplate from './shipTemplate.vue';
|
||||||
export default {
|
export default {
|
||||||
components:{
|
components: {
|
||||||
company,
|
company,
|
||||||
shipTemplate
|
shipTemplate
|
||||||
},
|
},
|
||||||
data(){
|
data() {
|
||||||
return{
|
return {
|
||||||
type:'company'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped></style>
|
||||||
|
|
||||||
</style>
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<Button v-if="allowOperation.ship" @click="groupShip" type="primary">分包裹发货</Button>
|
<Button v-if="allowOperation.ship" @click="groupShip" type="primary">分包裹发货</Button>
|
||||||
|
|
||||||
<Button v-if="allowOperation.take" @click="orderTake" type="primary">订单核销</Button>
|
<Button v-if="allowOperation.take" @click="orderTake" type="primary">订单核销</Button>
|
||||||
|
<Button @click="modifyRemark" type="primary">添加备注</Button>
|
||||||
<Button @click="orderLog" type="info" ghost>订单日志</Button>
|
<Button @click="orderLog" type="info" ghost>订单日志</Button>
|
||||||
<Button @click="printOrder" type="primary" ghost style="float:right;"
|
<Button @click="printOrder" type="primary" ghost style="float:right;"
|
||||||
v-if="$route.query.orderType != 'VIRTUAL'">打印发货单</Button>
|
v-if="$route.query.orderType != 'VIRTUAL'">打印发货单</Button>
|
||||||
@@ -28,7 +28,10 @@
|
|||||||
{{ orderInfo.order.clientType | clientTypeWay }}
|
{{ orderInfo.order.clientType | clientTypeWay }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="div-item">
|
||||||
|
<div class="div-item-left">订单备注:</div>
|
||||||
|
<div class="div-item-right">{{ orderInfo.order.sellerRemark }}</div>
|
||||||
|
</div>
|
||||||
<div class="div-item">
|
<div class="div-item">
|
||||||
<div class="div-item-left">订单状态:</div>
|
<div class="div-item-left">订单状态:</div>
|
||||||
<div class="div-item-right">
|
<div class="div-item-right">
|
||||||
@@ -441,7 +444,7 @@
|
|||||||
<Form ref="groupOrderDeliveryForm" :model="groupOrderDeliveryForm" :label-width="90" :rules="groupOrderDeliverFormValidate" style="position: relative">
|
<Form ref="groupOrderDeliveryForm" :model="groupOrderDeliveryForm" :label-width="90" :rules="groupOrderDeliverFormValidate" style="position: relative">
|
||||||
<FormItem label="物流公司" prop="logisticsId">
|
<FormItem label="物流公司" prop="logisticsId">
|
||||||
<Select v-model="groupOrderDeliveryForm.logisticsId" placeholder="请选择" style="width: 250px">
|
<Select v-model="groupOrderDeliveryForm.logisticsId" placeholder="请选择" style="width: 250px">
|
||||||
<Option v-for="(item, i) in checkedLogistics" :key="i" :value="item.logisticsId">{{ item.name }}
|
<Option v-for="(item, i) in checkedLogistics" :key="i" :value="item.id">{{ item.name }}
|
||||||
</Option>
|
</Option>
|
||||||
</Select>
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@@ -509,6 +512,23 @@
|
|||||||
<Button type="primary" @click="orderTakeSubmit">核销</Button>
|
<Button type="primary" @click="orderTakeSubmit">核销</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
<Modal v-model="sellerRemarkModal" width="530">
|
||||||
|
<p slot="header">
|
||||||
|
<Icon type="edit"></Icon>
|
||||||
|
<span>编辑备注</span>
|
||||||
|
</p>
|
||||||
|
<div>
|
||||||
|
<Form ref="modifyRemarkForm" :model="modifyRemarkForm" label-position="left" :label-width="100">
|
||||||
|
<FormItem label="订单备注" prop="sellerRemark">
|
||||||
|
<Input v-model="modifyRemarkForm.sellerRemark" size="large" maxlength="20"></Input>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
<div slot="footer" style="text-align: right">
|
||||||
|
<Button @click="sellerRemarkModal = false">关闭</Button>
|
||||||
|
<Button type="primary" @click="modifyRemarkSubmit">确认</Button>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
<multipleMap ref="map" @callback="selectedRegion" />
|
<multipleMap ref="map" @callback="selectedRegion" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -516,7 +536,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as API_Order from "@/api/order";
|
import * as API_Order from "@/api/order";
|
||||||
import * as RegExp from "@/libs/RegExp.js";
|
import * as RegExp from "@/libs/RegExp.js";
|
||||||
|
import * as API_Logistics from "@/api/logistics";
|
||||||
import multipleMap from "@/components/map/multiple-map";
|
import multipleMap from "@/components/map/multiple-map";
|
||||||
import vueQr from "vue-qr";
|
import vueQr from "vue-qr";
|
||||||
export default {
|
export default {
|
||||||
@@ -528,6 +548,11 @@ export default {
|
|||||||
},
|
},
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
sellerRemarkModal: false,//弹出编辑订单备注
|
||||||
|
//修改订单备注表单
|
||||||
|
modifyRemarkForm: {
|
||||||
|
sellerRemark: 0,
|
||||||
|
},
|
||||||
// 分包裹发货
|
// 分包裹发货
|
||||||
groupShipModal: false,
|
groupShipModal: false,
|
||||||
shipLoading: true,
|
shipLoading: true,
|
||||||
@@ -781,6 +806,26 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
modifyRemark () {
|
||||||
|
this.modifyRemarkForm.sellerRemark = this.orderInfo.order.sellerRemark;
|
||||||
|
this.sellerRemarkModal = true;
|
||||||
|
},
|
||||||
|
//修改订单备注提交
|
||||||
|
modifyRemarkSubmit () {
|
||||||
|
this.$refs.modifyRemarkForm.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
API_Order.modifyOrderRemark(this.sn, this.modifyRemarkForm).then(
|
||||||
|
(res) => {
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("编辑订单备注成功");
|
||||||
|
this.sellerRemarkModal = false;
|
||||||
|
this.getDataList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
// 选中
|
// 选中
|
||||||
selectGroupShipGoodsMethods (selected) {
|
selectGroupShipGoodsMethods (selected) {
|
||||||
this.selectGroupShipGoods = selected;
|
this.selectGroupShipGoods = selected;
|
||||||
@@ -794,7 +839,7 @@ export default {
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("订单核销成功");
|
this.$Message.success("订单核销成功");
|
||||||
this.orderTakeModal = false;
|
this.orderTakeModal = false;
|
||||||
this.getDataDetail();
|
this.getDataList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -813,9 +858,9 @@ export default {
|
|||||||
},
|
},
|
||||||
// 分页获取物流公司
|
// 分页获取物流公司
|
||||||
getLogisticsList () {
|
getLogisticsList () {
|
||||||
API_Order.getLogisticsChecked().then((res) => {
|
API_Logistics.getLogisticsPage({pageSize:100}).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.checkedLogistics = res.result;
|
this.checkedLogistics = res.result.records;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -838,7 +883,7 @@ export default {
|
|||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success("发货成功!");
|
this.$Message.success("发货成功!");
|
||||||
this.shipLoading = false;
|
this.shipLoading = false;
|
||||||
this.getDataDetail();
|
this.getDataList();
|
||||||
this.getOrderPackage();
|
this.getOrderPackage();
|
||||||
this.groupShipModal = false;
|
this.groupShipModal = false;
|
||||||
this.groupOrderDeliveryForm = []
|
this.groupOrderDeliveryForm = []
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
v-model="form.promotionName"
|
v-model="form.promotionName"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
placeholder="活动名称"
|
placeholder="活动名称"
|
||||||
clearable
|
clearable
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
<DatePicker
|
<DatePicker
|
||||||
type="datetimerange"
|
type="datetimerange"
|
||||||
v-model="form.rangeTime"
|
v-model="form.rangeTime"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
format="yyyy-MM-dd HH:mm:ss"
|
format="yyyy-MM-dd HH:mm:ss"
|
||||||
placeholder="请选择"
|
placeholder="请选择"
|
||||||
:options="options"
|
:options="options"
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
<FormItem label="活动描述" prop="description">
|
<FormItem label="活动描述" prop="description">
|
||||||
<Input
|
<Input
|
||||||
v-model="form.description"
|
v-model="form.description"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:rows="4"
|
:rows="4"
|
||||||
clearable
|
clearable
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
v-model="form.fullMoney"
|
v-model="form.fullMoney"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
placeholder="优惠门槛"
|
placeholder="优惠门槛"
|
||||||
clearable
|
clearable
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
@@ -58,8 +58,8 @@
|
|||||||
button-style="solid"
|
button-style="solid"
|
||||||
v-model="form.discountType"
|
v-model="form.discountType"
|
||||||
>
|
>
|
||||||
<Radio label="fullMinusFlag" disabled>减现金</Radio>
|
<Radio label="fullMinusFlag" :disabled="form.promotionStatus != 'NEW'">减现金</Radio>
|
||||||
<Radio label="fullRateFlag" disabled>打折</Radio>
|
<Radio label="fullRateFlag" :disabled="form.promotionStatus != 'NEW'">打折</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem
|
<FormItem
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
>
|
>
|
||||||
<Input
|
<Input
|
||||||
type="text"
|
type="text"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
v-model="form.fullMinus"
|
v-model="form.fullMinus"
|
||||||
placeholder="优惠金额"
|
placeholder="优惠金额"
|
||||||
clearable
|
clearable
|
||||||
@@ -85,24 +85,24 @@
|
|||||||
type="text"
|
type="text"
|
||||||
v-model="form.fullRate"
|
v-model="form.fullRate"
|
||||||
placeholder="优惠折扣"
|
placeholder="优惠折扣"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
clearable
|
clearable
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
/>
|
/>
|
||||||
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem label="额外赠送">
|
<FormItem label="额外赠送">
|
||||||
<Checkbox v-model="form.freeFreightFlag" disabled>免邮费</Checkbox
|
<Checkbox v-model="form.freeFreightFlag" :disabled="form.promotionStatus != 'NEW'">免邮费</Checkbox
|
||||||
>
|
>
|
||||||
<Checkbox v-model="form.couponFlag" disabled>送优惠券</Checkbox
|
<Checkbox v-model="form.couponFlag" :disabled="form.promotionStatus != 'NEW'">送优惠券</Checkbox
|
||||||
>
|
>
|
||||||
<Checkbox v-model="form.giftFlag" disabled>送赠品</Checkbox>
|
<Checkbox v-model="form.giftFlag" :disabled="form.promotionStatus != 'NEW'">送赠品</Checkbox>
|
||||||
<Checkbox v-model="form.pointFlag" disabled>送积分</Checkbox>
|
<Checkbox v-model="form.pointFlag" :disabled="form.promotionStatus != 'NEW'">送积分</Checkbox>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem v-if="form.couponFlag" 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'"
|
||||||
filterable
|
filterable
|
||||||
:remote-method="getCouponList"
|
:remote-method="getCouponList"
|
||||||
placeholder="输入优惠券名称搜索"
|
placeholder="输入优惠券名称搜索"
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
filterable
|
filterable
|
||||||
:remote-method="getGiftList"
|
:remote-method="getGiftList"
|
||||||
placeholder="输入赠品名称搜索"
|
placeholder="输入赠品名称搜索"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
:loading="giftLoading"
|
:loading="giftLoading"
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
>
|
>
|
||||||
@@ -136,10 +136,10 @@
|
|||||||
</Select>
|
</Select>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
<FormItem v-if="form.pointFlag" label="赠积分" prop="point">
|
<FormItem v-if="form.pointFlag" label="赠积分" prop="point">
|
||||||
<Input
|
<InputNumber
|
||||||
v-model="form.point"
|
v-model="form.point"
|
||||||
type="number"
|
:min="0"
|
||||||
disabled
|
:disabled="form.promotionStatus != 'NEW'"
|
||||||
style="width: 260px"
|
style="width: 260px"
|
||||||
/>
|
/>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
@@ -149,8 +149,8 @@
|
|||||||
button-style="solid"
|
button-style="solid"
|
||||||
v-model="form.scopeType"
|
v-model="form.scopeType"
|
||||||
>
|
>
|
||||||
<Radio label="ALL" disabled>全品类</Radio>
|
<Radio label="ALL" :disabled="form.promotionStatus != 'NEW'">全品类</Radio>
|
||||||
<Radio label="PORTION_GOODS" disabled>指定商品</Radio>
|
<Radio label="PORTION_GOODS" :disabled="form.promotionStatus != 'NEW'">指定商品</Radio>
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
@@ -185,25 +185,32 @@
|
|||||||
</Poptip>
|
</Poptip>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
</Table>
|
</Table>
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<FormItem label="操作" >
|
||||||
<div>
|
<div>
|
||||||
<Button
|
<Button
|
||||||
@click="$router.push({ name: 'promotions/full-discount' })"
|
@click="$router.push({ name: 'promotions/full-discount' })"
|
||||||
>返回</Button
|
>返回</Button
|
||||||
>
|
>
|
||||||
|
<Button type="primary" class="ml_10" :disabled="form.promotionStatus != 'NEW' && !!id" :loading="submitLoading"
|
||||||
|
@click="handleSubmit">提交</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</FormItem>
|
||||||
</div>
|
|
||||||
</Form>
|
</Form>
|
||||||
</Card>
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getPlatformCouponList, getFullDiscountById } from "@/api/promotion";
|
import { getPlatformCouponList, getFullDiscountById, newFullDiscount, editFullDiscount,} from "@/api/promotion";
|
||||||
import { getGoodsSkuData } from "@/api/goods";
|
import { getGoodsSkuData } from "@/api/goods";
|
||||||
|
import { regular } from "@/utils";
|
||||||
import vueQr from "vue-qr";
|
import vueQr from "vue-qr";
|
||||||
export default {
|
export default {
|
||||||
name: "add-full-discount",
|
name: "add-full-discount",
|
||||||
@@ -211,14 +218,65 @@ export default {
|
|||||||
"vue-qr": vueQr,
|
"vue-qr": vueQr,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
const checkPrice = (rule, value, callback) => {
|
||||||
|
if (!value && value !== 0) {
|
||||||
|
return callback(new Error("面额不能为空"));
|
||||||
|
} else if (!regular.money.test(value)) {
|
||||||
|
callback(new Error("请输入正整数或者两位小数"));
|
||||||
|
} else if (parseFloat(value) > 99999999) {
|
||||||
|
callback(new Error("面额设置超过上限值"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const checkWeight = (rule, value, callback) => {
|
||||||
|
if (!value && typeof value !== "number") {
|
||||||
|
callback(new Error("优惠门槛不能为空"));
|
||||||
|
} else if (!regular.money.test(value)) {
|
||||||
|
callback(new Error("请输入正整数或者两位小数"));
|
||||||
|
} else if (parseFloat(value) > 99999999) {
|
||||||
|
callback(new Error("优惠门槛设置超过上限值"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
form: {
|
form: {
|
||||||
// 表单
|
// 表单
|
||||||
discountType: "fullMinusFlag",
|
discountType: "fullMinusFlag",
|
||||||
scopeType: "ALL",
|
scopeType: "ALL",
|
||||||
promotionGoodsList: [],
|
promotionGoodsList: [],
|
||||||
|
promotionStatus: "NEW",
|
||||||
},
|
},
|
||||||
id: this.$route.query.id, // 活动id
|
id: this.$route.query.id, // 活动id
|
||||||
|
selectedGoods: [], // 已选商品列表,便于删除
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
|
formRule: {
|
||||||
|
// 验证规则
|
||||||
|
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
||||||
|
rangeTime: [{ required: true, message: "请选择活动时间" }],
|
||||||
|
description: [{ required: true, message: "请填写活动描述" }],
|
||||||
|
price: [
|
||||||
|
{ required: true, message: "请输入面额" },
|
||||||
|
{ validator: checkPrice },
|
||||||
|
],
|
||||||
|
consumptionLimit: [{ required: true, validator: checkWeight }],
|
||||||
|
fullMoney: [{ required: true, validator: checkWeight }],
|
||||||
|
fullMinus: [
|
||||||
|
{ required: true, message: "请填写优惠金额" },
|
||||||
|
{ pattern: regular.money, message: "请输入正确金额" },
|
||||||
|
],
|
||||||
|
fullRate: [
|
||||||
|
{ required: true, message: "请填写优惠折扣" },
|
||||||
|
{
|
||||||
|
pattern: regular.discount,
|
||||||
|
message: "请输入0-10的数字,可有一位小数",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
couponId: [{ required: true, message: "请选择优惠券" }],
|
||||||
|
giftId: [{ required: true, message: "请选择赠品" }],
|
||||||
|
point: [{ required: true, message: "请填写积分" }],
|
||||||
|
},
|
||||||
couponList: [], // 优惠券列表
|
couponList: [], // 优惠券列表
|
||||||
giftList: [], // 赠品列表
|
giftList: [], // 赠品列表
|
||||||
giftLoading: false, // 赠品加载状态
|
giftLoading: false, // 赠品加载状态
|
||||||
@@ -257,6 +315,8 @@ export default {
|
|||||||
async mounted() {
|
async mounted() {
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
this.getDetail();
|
this.getDetail();
|
||||||
|
this.columns.shift()
|
||||||
|
this.columns.pop()
|
||||||
}
|
}
|
||||||
this.getCouponList();
|
this.getCouponList();
|
||||||
this.getGiftList();
|
this.getGiftList();
|
||||||
@@ -318,6 +378,122 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
/** 保存 */
|
||||||
|
handleSubmit () {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const params = JSON.parse(JSON.stringify(this.form));
|
||||||
|
const strat = this.$options.filters.unixToDate(
|
||||||
|
this.form.rangeTime[0] / 1000
|
||||||
|
);
|
||||||
|
const end = this.$options.filters.unixToDate(
|
||||||
|
this.form.rangeTime[1] / 1000
|
||||||
|
);
|
||||||
|
params.startTime = strat;
|
||||||
|
params.endTime = end;
|
||||||
|
|
||||||
|
if (
|
||||||
|
params.scopeType == "PORTION_GOODS" &&
|
||||||
|
(!params.promotionGoodsList ||
|
||||||
|
params.promotionGoodsList.length == 0)
|
||||||
|
) {
|
||||||
|
this.$Modal.warning({ title: "提示", content: "请选择指定商品" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (params.scopeType == "ALL") {
|
||||||
|
delete params.promotionGoodsList;
|
||||||
|
params.number = -1;
|
||||||
|
} else {
|
||||||
|
let scopeId = [];
|
||||||
|
params.number = 1;
|
||||||
|
params.promotionGoodsList.forEach((e) => {
|
||||||
|
e.startTime = params.startTime;
|
||||||
|
e.endTime = params.endTime;
|
||||||
|
scopeId.push(e.skuId);
|
||||||
|
});
|
||||||
|
params.scopeId = scopeId.toString();
|
||||||
|
}
|
||||||
|
if (params.discountType == "fullMinusFlag") {
|
||||||
|
params.fullMinusFlag = true;
|
||||||
|
} else {
|
||||||
|
params.fullRateFlag = true;
|
||||||
|
}
|
||||||
|
delete params.rangeTime;
|
||||||
|
// this.submitLoading = true;
|
||||||
|
if (!this.id) {
|
||||||
|
// 添加 避免编辑后传入id等数据 记得删除
|
||||||
|
delete params.id;
|
||||||
|
newFullDiscount(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("添加活动成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 编辑
|
||||||
|
delete params.updateTime;
|
||||||
|
|
||||||
|
editFullDiscount(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("编辑活动成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
changeSelect (e) {
|
||||||
|
// 已选商品批量选择
|
||||||
|
this.selectedGoods = e;
|
||||||
|
},
|
||||||
|
|
||||||
|
delSelectGoods () {
|
||||||
|
// 多选删除商品
|
||||||
|
if (this.selectedGoods.length <= 0) {
|
||||||
|
this.$Message.warning("您还未选择要删除的数据");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.$Modal.confirm({
|
||||||
|
title: "确认删除",
|
||||||
|
content: "您确认要删除所选商品吗?",
|
||||||
|
onOk: () => {
|
||||||
|
let ids = [];
|
||||||
|
this.selectedGoods.forEach(function (e) {
|
||||||
|
ids.push(e.id);
|
||||||
|
});
|
||||||
|
this.form.promotionGoodsList = this.form.promotionGoodsList.filter(
|
||||||
|
(item) => {
|
||||||
|
return !ids.includes(item.id);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
delGoods (index) {
|
||||||
|
// 删除商品
|
||||||
|
this.form.promotionGoodsList.splice(index, 1);
|
||||||
|
},
|
||||||
|
selectedGoodsData (item) {
|
||||||
|
// 回显已选商品
|
||||||
|
let list = [];
|
||||||
|
item.forEach((e) => {
|
||||||
|
list.push({
|
||||||
|
goodsName: e.goodsName,
|
||||||
|
price: e.price,
|
||||||
|
quantity: e.quantity,
|
||||||
|
storeId: e.storeId,
|
||||||
|
storeName: e.storeName,
|
||||||
|
thumbnail: e.thumbnail,
|
||||||
|
skuId: e.id,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.form.promotionGoodsList = list;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -50,6 +50,9 @@
|
|||||||
>
|
>
|
||||||
</Form>
|
</Form>
|
||||||
</Row>
|
</Row>
|
||||||
|
<div class="mt_10">
|
||||||
|
<Button type="primary" @click="view">添加活动</Button>
|
||||||
|
</div>
|
||||||
<Table
|
<Table
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
border
|
border
|
||||||
@@ -162,6 +165,7 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
@@ -227,7 +231,14 @@ export default {
|
|||||||
},
|
},
|
||||||
view(row) {
|
view(row) {
|
||||||
// 查看
|
// 查看
|
||||||
this.$router.push({ name: "full-discount-detail", query: { id: row.id } });
|
let data = { name: "full-discount-detail" }
|
||||||
|
if(row){
|
||||||
|
data = {
|
||||||
|
name: "full-discount-detail",
|
||||||
|
query: { id: row.id }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.$router.push(data);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
190
manager/src/views/promotions/pintuan/pintuan-create.vue
Normal file
190
manager/src/views/promotions/pintuan/pintuan-create.vue
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
<template>
|
||||||
|
<div class="new-pintuan">
|
||||||
|
<Card>
|
||||||
|
<Form ref="form" :model="form" :label-width="130" :rules="formValidate">
|
||||||
|
<FormItem label="活动名称" prop="promotionName" :label-width="130">
|
||||||
|
<Input v-model="form.promotionName" clearable style="width: 260px" maxlength="25" />
|
||||||
|
<div style="color: #cccccc">
|
||||||
|
活动名称将显示在对人拼团活动列表中,方便商家管理使用,最多输入25个字符
|
||||||
|
</div>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="活动时间" prop="rangeTime">
|
||||||
|
<DatePicker type="datetimerange" v-model="form.rangeTime" format="yyyy-MM-dd HH:mm:ss" placeholder="请选择" :options="options" style="width: 260px">
|
||||||
|
</DatePicker>
|
||||||
|
</FormItem>
|
||||||
|
|
||||||
|
<FormItem label="参团人数" prop="requiredNum" :label-width="130">
|
||||||
|
<Input v-model="form.requiredNum" style="width: 260px" max="8">
|
||||||
|
<span slot="append">人</span>
|
||||||
|
</Input>
|
||||||
|
<span style="color: #cccccc">参团人数不少于2人,不得超过10人。</span>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="限购数量" prop="limitNum" :label-width="130">
|
||||||
|
<Input v-model="form.limitNum" type="number" style="width: 260px">
|
||||||
|
<span slot="append">件/人</span>
|
||||||
|
</Input>
|
||||||
|
<span style="color: #cccccc">如果设置为0则视为不限制购买数量</span>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="虚拟成团" prop="fictitious">
|
||||||
|
<RadioGroup type="button" button-style="solid" v-model="form.fictitious">
|
||||||
|
<Radio title="开启" :label="1">
|
||||||
|
<span>开启</span>
|
||||||
|
</Radio>
|
||||||
|
<Radio title="关闭" :label="0">
|
||||||
|
<span>关闭</span>
|
||||||
|
</Radio>
|
||||||
|
</RadioGroup>
|
||||||
|
<br />
|
||||||
|
<span style="color: #cccccc">开启虚拟成团后,24小时人数未满的团,系统将会模拟匿名买家凑满人数,使该团成团;您只需要对已付款参团的真实买家发货;建议合理开启以提高成团率</span>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="拼团规则" prop="pintuanRule">
|
||||||
|
<Input v-model="form.pintuanRule" type="textarea" :rows="4" clearable maxlength="255" style="width: 260px" />
|
||||||
|
<br />
|
||||||
|
<span style="color: #cccccc">拼团规则描述不能为空且不能大于255个字,会在WAP拼团详情页面显示</span>
|
||||||
|
</FormItem>
|
||||||
|
<FormItem label="操作" >
|
||||||
|
<div>
|
||||||
|
<Button type="text" @click="closeCurrentPage">返回</Button>
|
||||||
|
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
|
||||||
|
</div>
|
||||||
|
</FormItem>
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
</Card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import { savePintuan, editPintuan, getPintuanDetail } from "@/api/promotion";
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
id: this.$route.query.id, // 拼团id
|
||||||
|
form: {
|
||||||
|
// 添加或编辑表单对象初始化数据
|
||||||
|
promotionName: "",
|
||||||
|
promotionTitle: "",
|
||||||
|
pintuanRule: "",
|
||||||
|
requiredNum: "",
|
||||||
|
fictitious: 0,
|
||||||
|
limitNum: "",
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
},
|
||||||
|
// 表单验证规则
|
||||||
|
formValidate: {
|
||||||
|
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
||||||
|
requiredNum: [
|
||||||
|
{ required: true, message: "参团人数不能为空" },
|
||||||
|
{
|
||||||
|
pattern: /^([2-9]|10)?$/,
|
||||||
|
message: "参团人数不合法",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
limitNum: [
|
||||||
|
{ required: true, message: "限购数不能为空" },
|
||||||
|
{
|
||||||
|
pattern: /^(0|[1-9]\d?|100)$/,
|
||||||
|
message: "限购数不合法",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
rangeTime: [{ required: true, message: "请选择活动时间" }],
|
||||||
|
},
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
|
options: {
|
||||||
|
// 不可选取时间
|
||||||
|
disabledDate(date) {
|
||||||
|
return date && date.valueOf() < Date.now() - 86400000;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
if (this.id) {
|
||||||
|
this.getDetail();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
// 关闭当前页面
|
||||||
|
closeCurrentPage() {
|
||||||
|
this.$store.commit("removeTag", "new-pintuan");
|
||||||
|
localStorage.storeOpenedList = JSON.stringify(
|
||||||
|
this.$store.state.app.storeOpenedList
|
||||||
|
);
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
// 提交活动
|
||||||
|
handleSubmit() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
this.submitLoading = true;
|
||||||
|
let params = JSON.parse(JSON.stringify(this.form));
|
||||||
|
params.fictitious
|
||||||
|
? (params.fictitious = true)
|
||||||
|
: (params.fictitious = false);
|
||||||
|
params.startTime = this.$options.filters.unixToDate(
|
||||||
|
this.form.rangeTime[0] / 1000
|
||||||
|
);
|
||||||
|
|
||||||
|
params.endTime = this.$options.filters.unixToDate(
|
||||||
|
this.form.rangeTime[1] / 1000
|
||||||
|
);
|
||||||
|
if (params.startTime === "" || params.endTime === "") {
|
||||||
|
this.$Message.error("活动时间不能为空");
|
||||||
|
this.submitLoading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (params.startTime < new Date()) {
|
||||||
|
this.$Message.error("拼团活动开始时间不能小于当前时间");
|
||||||
|
this.submitLoading = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
delete params.rangeTime;
|
||||||
|
if (!this.id) {
|
||||||
|
// 添加 避免编辑后传入id等数据 记得删除
|
||||||
|
delete params.id;
|
||||||
|
savePintuan(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("拼团活动发布成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// 编辑
|
||||||
|
if (params.promotionGoodsList == "")
|
||||||
|
delete params.promotionGoodsList;
|
||||||
|
editPintuan(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res.success) {
|
||||||
|
this.$Message.success("操作成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取详情
|
||||||
|
getDetail() {
|
||||||
|
getPintuanDetail(this.id).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
const data = res.result;
|
||||||
|
data.rangeTime = [];
|
||||||
|
data.rangeTime.push(new Date(data.startTime), new Date(data.endTime));
|
||||||
|
this.form = data;
|
||||||
|
// 此处将值转换为 1 true ,0 false 不然ivew radio组件会报错
|
||||||
|
this.form.fictitious ? this.$set(this.form, "fictitious", 1) : this.$set(this.form, "fictitious", 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
/deep/ .ivu-form-item {
|
||||||
|
padding: 18px 10px !important;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -41,6 +41,9 @@
|
|||||||
</Form-item>
|
</Form-item>
|
||||||
<Button @click="handleSearch" type="primary" class="search-btn">搜索</Button>
|
<Button @click="handleSearch" type="primary" class="search-btn">搜索</Button>
|
||||||
</Form>
|
</Form>
|
||||||
|
<div class="mt_10">
|
||||||
|
<Button type="primary" @click="add()">添加活动</Button>
|
||||||
|
</div>
|
||||||
<Table
|
<Table
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
border
|
border
|
||||||
@@ -184,6 +187,9 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
add(){
|
||||||
|
this.$router.push({ name: 'pintuan-create'})
|
||||||
|
},
|
||||||
// 查看拼团商品
|
// 查看拼团商品
|
||||||
view(v) {
|
view(v) {
|
||||||
this.$router.push({ name: "pintuan-goods", query: { id: v.id } });
|
this.$router.push({ name: "pintuan-goods", query: { id: v.id } });
|
||||||
|
|||||||
@@ -9,33 +9,82 @@
|
|||||||
<Tag v-for="item in unixHours(row.hours)" :key="item">{{ item }}</Tag>
|
<Tag v-for="item in unixHours(row.hours)" :key="item">{{ item }}</Tag>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
|
|
||||||
|
<Row class="operation">
|
||||||
|
<template v-if="promotionStatus == 'NEW'">
|
||||||
|
<Button type="primary" @click="openSkuList">选择商品</Button>
|
||||||
|
<!-- <Button @click="delAll">批量删除</Button> -->
|
||||||
|
</template>
|
||||||
|
</Row>
|
||||||
|
<Row class="operation">
|
||||||
|
<Tabs type="card" v-model="tabCurrent">
|
||||||
|
<TabPane
|
||||||
|
v-for="(tab, tabIndex) in goodsList"
|
||||||
|
:key="tabIndex"
|
||||||
|
:label="tab.hour"
|
||||||
|
:name="tabIndex + ''"
|
||||||
|
>
|
||||||
<Table
|
<Table
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
border
|
border
|
||||||
class="operation"
|
|
||||||
:columns="goodsColumns"
|
:columns="goodsColumns"
|
||||||
:data="goodsList"
|
v-if="tabIndex == tabCurrent"
|
||||||
ref="table"
|
:data="tab.list"
|
||||||
|
:ref="'table' + tabIndex"
|
||||||
|
@on-selection-change="changeSelect"
|
||||||
>
|
>
|
||||||
<template slot-scope="{ row }" slot="originalPrice">
|
<template slot-scope="{ row }" slot="originalPrice">
|
||||||
<div>
|
<div>{{ row.originalPrice | unitPrice("¥") }}</div>
|
||||||
<priceColorScheme :value="row.originalPrice" :color="$mainColor"></priceColorScheme>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ row }" slot="quantity">
|
<template slot-scope="{ row, index }" slot="quantity">
|
||||||
<div>{{ row.quantity }}</div>
|
<InputNumber
|
||||||
|
:min="0"
|
||||||
|
v-model="row.quantity"
|
||||||
|
:disabled="row.promotionApplyStatus == 'PASS'"
|
||||||
|
@input="goodsList[tabIndex].list[index].quantity = row.quantity"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ row }" slot="price">
|
<template slot-scope="{ row, index }" slot="price">
|
||||||
<div>
|
<InputNumber
|
||||||
<priceColorScheme :value="row.price" :color="$mainColor"></priceColorScheme>
|
:min="0"
|
||||||
</div>
|
style="width: 100%"
|
||||||
|
v-model="row.price"
|
||||||
|
:disabled="row.promotionApplyStatus == 'PASS'"
|
||||||
|
@input="goodsList[tabIndex].list[index].price = row.price"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ row }" slot="time">
|
<template slot-scope="{ row }" slot="promotionApplyStatus">
|
||||||
<Tag>{{ row.timeLine + ":00" }}</Tag>
|
<Badge
|
||||||
|
status="success"
|
||||||
|
v-if="row.promotionApplyStatus == 'PASS'"
|
||||||
|
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||||
|
/>
|
||||||
|
<Badge
|
||||||
|
status="blue"
|
||||||
|
v-if="row.promotionApplyStatus == 'APPLY'"
|
||||||
|
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||||
|
/>
|
||||||
|
<Badge
|
||||||
|
status="error"
|
||||||
|
v-if="row.promotionApplyStatus == 'REFUSE'"
|
||||||
|
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||||
|
/>
|
||||||
|
<span
|
||||||
|
v-if="row.promotionApplyStatus == 'REFUSE'"
|
||||||
|
@click="showReason(row.failReason)"
|
||||||
|
class="reason"
|
||||||
|
>(拒绝原因)</span
|
||||||
|
>
|
||||||
|
<Badge
|
||||||
|
status="error"
|
||||||
|
v-if="row.promotionApplyStatus == ''"
|
||||||
|
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template slot-scope="{ row }" slot="QRCode">
|
<template slot-scope="{ row }" slot="QRCode">
|
||||||
<img
|
<img
|
||||||
v-if="row.QRCode"
|
v-if="row.QRCode"
|
||||||
@@ -46,53 +95,69 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<template slot-scope="{ row, index }" slot="action">
|
<template slot-scope="{ row, index }" slot="action">
|
||||||
<Button type="error" size="small" @click="delGoods(index, row)">删除 </Button>
|
<Button
|
||||||
|
type="error"
|
||||||
|
v-if="promotionStatus === 'NEW'"
|
||||||
|
size="small"
|
||||||
|
ghost
|
||||||
|
@click="delGoods(index, row)"
|
||||||
|
>删除
|
||||||
|
</Button>
|
||||||
</template>
|
</template>
|
||||||
</Table>
|
</Table>
|
||||||
<Row type="flex" justify="end" class="mt_10">
|
</TabPane>
|
||||||
<Page
|
</Tabs>
|
||||||
:current="searchForm.pageNumber"
|
</Row>
|
||||||
:total="total"
|
|
||||||
:page-size="searchForm.pageSize"
|
<Row class="operation">
|
||||||
@on-change="changePage"
|
<Button @click="closeCurrentPage">返回</Button>
|
||||||
@on-page-size-change="changePageSize"
|
<Button
|
||||||
:page-size-opts="[10, 20, 50]"
|
type="primary"
|
||||||
size="small"
|
:loading="submitLoading"
|
||||||
show-total
|
v-if="promotionStatus === 'NEW'"
|
||||||
show-elevator
|
@click="save"
|
||||||
show-sizer
|
>提交
|
||||||
></Page>
|
</Button>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
|
|
||||||
|
<sku-select ref="skuSelect" @selectedGoodsData="selectedGoodsData"></sku-select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
seckillGoodsList,
|
seckillGoodsList,
|
||||||
seckillDetail,
|
seckillDetail,
|
||||||
auditApplySeckill,
|
setSeckillGoods,
|
||||||
delSeckillGoods,
|
delSeckillGoods,
|
||||||
} from "@/api/promotion.js";
|
} from "@/api/promotion.js";
|
||||||
|
import skuSelect from "@/components/lili-dialog";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
skuSelect,
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
tabCurrent(val) {
|
||||||
|
this.tabIndex = val;
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
tabCurrent: 0,
|
||||||
promotionStatus: "", // 活动状态
|
promotionStatus: "", // 活动状态
|
||||||
showModal: false, // modal显隐
|
|
||||||
openTip: true, // 显示提示
|
|
||||||
loading: false, // 表单加载状态
|
loading: false, // 表单加载状态
|
||||||
submitLoading: false, // 加载状态
|
|
||||||
searchForm: {
|
searchForm: {
|
||||||
// 搜索框初始化对象
|
// 搜索框初始化对象
|
||||||
pageNumber: 1, // 当前页数
|
pageNumber: 0, // 当前页数
|
||||||
pageSize: 10, // 页面大小
|
pageSize: 1000, // 页面大小
|
||||||
},
|
},
|
||||||
total: 0, // 总数
|
tabIndex: 0, // 选择商品的下标
|
||||||
|
submitLoading: false, // 添加或编辑提交状态
|
||||||
selectList: [], // 多选数据
|
selectList: [], // 多选数据
|
||||||
selectCount: 0, // 多选计数
|
selectCount: 0, // 多选计数
|
||||||
data: [], // 表单数据
|
data: [{}], // 表单数据
|
||||||
columns: [
|
columns: [
|
||||||
// 表头
|
|
||||||
{
|
{
|
||||||
title: "活动名称",
|
title: "活动名称",
|
||||||
key: "promotionName",
|
key: "promotionName",
|
||||||
@@ -110,144 +175,121 @@ export default {
|
|||||||
title: "时间场次",
|
title: "时间场次",
|
||||||
slot: "hours",
|
slot: "hours",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "活动状态",
|
|
||||||
key: "promotionStatus",
|
|
||||||
minWidth: 80,
|
|
||||||
sortable: false,
|
|
||||||
render: (h, params) => {
|
|
||||||
if (params.row.promotionStatus == "NEW") {
|
|
||||||
return h("div", [
|
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "新建",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.promotionStatus == "START") {
|
|
||||||
return h("div", [
|
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "success",
|
|
||||||
text: "开始",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.promotionStatus == "END") {
|
|
||||||
return h("div", [
|
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "结束",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
} else if (params.row.promotionStatus == "CLOSE") {
|
|
||||||
return h("div", [
|
|
||||||
h("Badge", {
|
|
||||||
props: {
|
|
||||||
status: "error",
|
|
||||||
text: "废弃",
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
goodsColumns: [
|
goodsColumns: [
|
||||||
// 商品表单
|
|
||||||
{
|
{
|
||||||
title: "商品名称",
|
title: "商品名称",
|
||||||
key: "goodsName",
|
key: "goodsName",
|
||||||
minWidth: 120,
|
minWidth: 120,
|
||||||
tooltip: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "商品价格",
|
title: "商品价格",
|
||||||
slot: "originalPrice",
|
slot: "originalPrice",
|
||||||
width: 110,
|
minWidth: 50,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "库存",
|
title: "库存",
|
||||||
slot: "quantity",
|
slot: "quantity",
|
||||||
minWidth: 30,
|
minWidth: 40,
|
||||||
width: 90,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "活动价格",
|
title: "活动价格",
|
||||||
slot: "price",
|
slot: "price",
|
||||||
width: 100,
|
minWidth: 50,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "商家名称",
|
title: "状态",
|
||||||
key: "storeName",
|
slot: "promotionApplyStatus",
|
||||||
minWidth: 100,
|
minWidth: 30,
|
||||||
tooltip: true,
|
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "活动场次",
|
|
||||||
width: 100,
|
|
||||||
slot: "time",
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: "状态",
|
|
||||||
// slot: "promotionApplyStatus",
|
|
||||||
// width: 90,
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
title: "操作",
|
title: "操作",
|
||||||
slot: "action",
|
slot: "action",
|
||||||
width: 150,
|
minWidth: 50,
|
||||||
align: "center",
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
goodsList: [], // 商品列表
|
goodsList: [], // 商品列表
|
||||||
params: {
|
defaultGoodsList: [], //默认查询秒杀的商品
|
||||||
// 请求参数
|
|
||||||
seckillId: this.$route.query.id,
|
|
||||||
applyStatus: "PASS",
|
|
||||||
failReason: "",
|
|
||||||
ids: "",
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
// 验证规则
|
|
||||||
failReason: [{ required: true, message: "请输入拒绝原因" }],
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 关闭当前页面
|
||||||
|
closeCurrentPage() {
|
||||||
|
this.$store.commit("removeTag", "seckill-goods");
|
||||||
|
localStorage.storeOpenedList = JSON.stringify(
|
||||||
|
this.$store.state.app.storeOpenedList
|
||||||
|
);
|
||||||
|
this.$router.go(-1);
|
||||||
|
},
|
||||||
|
// 提交秒杀商品
|
||||||
|
save() {
|
||||||
|
let list = JSON.parse(JSON.stringify(this.goodsList));
|
||||||
|
let params = {
|
||||||
|
seckillId: this.$route.query.id,
|
||||||
|
applyVos: [],
|
||||||
|
};
|
||||||
|
|
||||||
|
list.forEach((e, index) => {
|
||||||
|
e.list.forEach((i) => {
|
||||||
|
// if(e.id) delete e.id
|
||||||
|
params.applyVos.push(i);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
this.submitLoading = true;
|
||||||
|
|
||||||
|
console.log(list);
|
||||||
|
|
||||||
|
setSeckillGoods(params).then((res) => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
if (res && res.success) {
|
||||||
|
this.$Message.success("提交活动商品成功");
|
||||||
|
this.closeCurrentPage();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
// 初始化数据
|
// 初始化数据
|
||||||
init() {
|
init() {
|
||||||
this.getSeckillMsg();
|
this.getSeckillMsg();
|
||||||
},
|
},
|
||||||
// 分页 改变页码
|
|
||||||
changePage(v) {
|
|
||||||
this.searchForm.pageNumber = v;
|
|
||||||
this.getDataList();
|
|
||||||
this.clearSelectAll();
|
|
||||||
},
|
|
||||||
// 分页 改变页数
|
|
||||||
changePageSize(v) {
|
|
||||||
this.searchForm.pageNumber = 1;
|
|
||||||
this.searchForm.pageSize = v;
|
|
||||||
this.getDataList();
|
|
||||||
},
|
|
||||||
// 清除选中状态
|
// 清除选中状态
|
||||||
clearSelectAll() {
|
clearSelectAll() {
|
||||||
this.$refs.table.selectAll(false);
|
this.$refs.table.selectAll(false);
|
||||||
},
|
},
|
||||||
|
// 获取选择数据
|
||||||
|
changeSelect(e) {
|
||||||
|
this.selectList = e;
|
||||||
|
this.selectCount = e.length;
|
||||||
|
},
|
||||||
|
|
||||||
getDataList() {
|
getDataList() {
|
||||||
// 获取商品详情
|
// 获取商品详情
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.searchForm.seckillId = this.$route.query.id;
|
this.searchForm.seckillId = this.$route.query.id;
|
||||||
|
// 处理过的时间 为‘1:00’
|
||||||
|
let hours = this.unixHours(this.data[0].hours);
|
||||||
|
hours.forEach((e) => {
|
||||||
|
this.goodsList.push({
|
||||||
|
hour: e,
|
||||||
|
list: [],
|
||||||
|
});
|
||||||
|
});
|
||||||
seckillGoodsList(this.searchForm).then((res) => {
|
seckillGoodsList(this.searchForm).then((res) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
if (res.success && res.result) {
|
if (res.success && res.result) {
|
||||||
this.goodsList = res.result.records;
|
let data = res.result.records;
|
||||||
this.total = res.result.total;
|
// 未处理时间 为'1'
|
||||||
|
let noFilterhours = this.data[0].hours.split(",");
|
||||||
|
if (data.length) {
|
||||||
|
noFilterhours.forEach((e, index) => {
|
||||||
|
data.forEach((i) => {
|
||||||
|
if (i.timeLine == e) {
|
||||||
|
this.goodsList[index].list.push(i);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.defaultGoodsList = this.goodsList[this.tabIndex].list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -265,39 +307,105 @@ export default {
|
|||||||
},
|
},
|
||||||
delGoods(index, row) {
|
delGoods(index, row) {
|
||||||
// 删除商品
|
// 删除商品
|
||||||
this.$Modal.confirm({
|
if (row.promotionApplyStatus === "PASS") {
|
||||||
title: "确认删除",
|
|
||||||
content: "您确认要删除该商品吗?删除后不可恢复",
|
|
||||||
onOk: () => {
|
|
||||||
const params = {
|
const params = {
|
||||||
seckillId: row.seckillId,
|
seckillId: row.seckillId,
|
||||||
id: row.id,
|
id: row.id,
|
||||||
};
|
};
|
||||||
delSeckillGoods(params).then((res) => {
|
delSeckillGoods(params).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.goodsList.splice(index, 1);
|
this.goodsList[this.tabIndex].list.splice(index, 1);
|
||||||
this.$Message.success("删除成功!");
|
this.$Message.success("删除成功!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.goodsList[this.tabIndex].list.splice(index, 1);
|
||||||
|
this.$Message.success("删除成功!");
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
selectedGoodsData(callback) {
|
||||||
|
let way = [];
|
||||||
|
let data = JSON.parse(JSON.stringify(callback));
|
||||||
|
|
||||||
|
data.forEach((e) => {
|
||||||
|
way.push({
|
||||||
|
goodsName: e.goodsName,
|
||||||
|
price: e.price,
|
||||||
|
originalPrice: e.price,
|
||||||
|
promotionApplyStatus: e.promotionApplyStatus || "",
|
||||||
|
quantity: e.quantity,
|
||||||
|
seckillId: this.$route.query.id,
|
||||||
|
storeId: e.storeId,
|
||||||
|
storeName: e.storeName,
|
||||||
|
skuId: e.id,
|
||||||
|
timeLine: this.data[0].hours.split(",")[this.tabIndex],
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.$set(this.goodsList[this.tabIndex], "list", [
|
||||||
|
...way,
|
||||||
|
// ...this.defaultGoodsList,
|
||||||
|
]);
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$forceUpdate();
|
||||||
|
// });
|
||||||
|
},
|
||||||
|
openSkuList() {
|
||||||
|
// 显示商品选择器
|
||||||
|
|
||||||
|
this.$refs.skuSelect.open("goods");
|
||||||
|
let data = this.goodsList[this.tabIndex].list;
|
||||||
|
data.forEach((e) => {
|
||||||
|
e.id = e.skuId;
|
||||||
|
});
|
||||||
|
this.$refs.skuSelect.goodsData = data;
|
||||||
},
|
},
|
||||||
unixDate(time) {
|
unixDate(time) {
|
||||||
// 处理报名截止时间
|
// 处理报名截止时间
|
||||||
return this.$options.filters.unixToDate(new Date(time) / 1000);
|
return this.$options.filters.unixToDate(new Date(time) / 1000);
|
||||||
},
|
},
|
||||||
unixHours(item) {
|
unixHours(item) {
|
||||||
|
if (item) {
|
||||||
// 处理小时场次
|
// 处理小时场次
|
||||||
let hourArr = item.split(",");
|
let hourArr = item.split(",");
|
||||||
for (let i = 0; i < hourArr.length; i++) {
|
for (let i = 0; i < hourArr.length; i++) {
|
||||||
hourArr[i] += ":00";
|
hourArr[i] += ":00";
|
||||||
}
|
}
|
||||||
return hourArr;
|
return hourArr;
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
},
|
||||||
|
// 格式化申请状态
|
||||||
|
promotionApplyStatus(key) {
|
||||||
|
switch (key) {
|
||||||
|
case "APPLY":
|
||||||
|
return "申请";
|
||||||
|
case "PASS":
|
||||||
|
return "通过";
|
||||||
|
case "REFUSE":
|
||||||
|
return "拒绝";
|
||||||
|
default:
|
||||||
|
return "未申请";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 展示审核拒绝原因
|
||||||
|
showReason(reason) {
|
||||||
|
this.$Modal.info({
|
||||||
|
title: "拒绝原因",
|
||||||
|
content: reason,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
},
|
},
|
||||||
|
// 如果是从详情页返回列表页,修改列表页keepAlive为true,确保不刷新页面
|
||||||
|
beforeRouteLeave(to, from, next) {
|
||||||
|
if (to.name === "seckill") {
|
||||||
|
to.meta.keepAlive = true;
|
||||||
|
}
|
||||||
|
next();
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ export const addShipTemplate = (params, headers) => {
|
|||||||
return postRequest(`/setting/freightTemplate`, params, headers)
|
return postRequest(`/setting/freightTemplate`, params, headers)
|
||||||
}
|
}
|
||||||
|
|
||||||
//新增运费模板
|
//编辑运费模板
|
||||||
export const editShipTemplate = (id, params, headers) => {
|
export const editShipTemplate = (id, params, headers) => {
|
||||||
return putRequest(`/setting/freightTemplate/${id}`, params, headers)
|
return putRequest(`/setting/freightTemplate/${id}`, params, headers)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user