mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-06-23 18:40:25 +08:00
feat: 新增全局布局样式并提升组件响应式表现
- 在 global-layout.scss 中引入全局布局样式,统一页面宽度与对齐方式 - 更新多个组件与页面以优化响应式,包括宽度、间距及 flex 布局等调整 - 在 API 请求中增加 loading 状态管理,改善用户体验 - 优化领券中心与商品详情页,提升功能与 UI 一致性
This commit is contained in:
@@ -147,6 +147,16 @@ export const getGoodsSkuData = params => {
|
||||
export const getGoodsListData = params => {
|
||||
return getRequest("/goods/goods/list", params);
|
||||
};
|
||||
// 商品分组分页
|
||||
export const getGoodsGroupByPage = params => {
|
||||
return getRequest("/goods/goodsGroup/getByPage", params);
|
||||
};
|
||||
// 设定商品分组(批量)
|
||||
export const addGoodsGroupItems = (groupId, goodsIds) => {
|
||||
return postRequest(`/goods/goodsGroup/${groupId}/goods`, {
|
||||
goodsIds: Array.isArray(goodsIds) ? goodsIds.join(",") : goodsIds,
|
||||
});
|
||||
};
|
||||
// 获取商品数量
|
||||
export const getGoodsNumerData = (params) => {
|
||||
return getRequest('/goods/goods/goodsNumber', params)
|
||||
@@ -176,6 +186,9 @@ export const getGoodsCategoryAll = () => {
|
||||
return getRequest(`/goods/category/all`);
|
||||
};
|
||||
|
||||
// 兼容旧页面的分类树命名
|
||||
export const getCategoryTree = getGoodsCategoryAll;
|
||||
|
||||
// 获取当前店铺分类
|
||||
export const getShopGoodsLabelListSeller = () => {
|
||||
return getRequest(`/goods/label`);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// 统一请求路径前缀在libs/axios.js中修改
|
||||
import { getRequest, postRequest, putRequest ,postRequestWithNoForm } from "@/libs/axios";
|
||||
import { getRequest, postRequest, putRequest, deleteRequest, postRequestWithNoForm } from "@/libs/axios";
|
||||
|
||||
import { baseUrl } from "@/libs/axios.js";
|
||||
|
||||
@@ -42,6 +42,11 @@ export const getOrderDetail = sn => {
|
||||
return getRequest(`/order/order/${sn}`);
|
||||
};
|
||||
|
||||
// 订单付款
|
||||
export const orderPay = sn => {
|
||||
return postRequest(`/order/order/${sn}/pay`);
|
||||
};
|
||||
|
||||
// 调整订单金额
|
||||
export const modifyOrderPrice = (sn, params) => {
|
||||
return putRequest(`/order/order/update/${sn}/price`, params);
|
||||
@@ -65,18 +70,31 @@ export const editOrderConsignee = (sn, params) => {
|
||||
export const getComplainPage = params => {
|
||||
return getRequest(`/order/complain`, params);
|
||||
};
|
||||
export const getOrderComplain = getComplainPage;
|
||||
|
||||
//获取投诉详情
|
||||
export const getComplainDetail = id => {
|
||||
return getRequest(`/order/complain/${id}`);
|
||||
};
|
||||
export const getOrderComplainDetail = getComplainDetail;
|
||||
|
||||
//添加交易投诉对话
|
||||
export const addOrderComplaint = params => {
|
||||
return postRequest(`/order/complain/communication/`, params);
|
||||
return postRequest(`/order/complain/communication`, params);
|
||||
};
|
||||
export const addOrderCommunication = addOrderComplaint;
|
||||
|
||||
// 更新投诉状态
|
||||
export const storeComplain = params => {
|
||||
return putRequest(`/order/complain/status`, params);
|
||||
};
|
||||
|
||||
//添加交易投诉对话
|
||||
// 仲裁完成投诉
|
||||
export const orderComplete = (id, params) => {
|
||||
return putRequest(`/order/complain/complete/${id}`, params);
|
||||
};
|
||||
|
||||
//商家申诉
|
||||
export const appeal = params => {
|
||||
return putRequest(`/order/complain/appeal`, params);
|
||||
};
|
||||
@@ -110,11 +128,43 @@ export const orderTake = (sn, verificationCode) => {
|
||||
export const afterSaleOrderPage = params => {
|
||||
return getRequest(`/order/afterSale/page`, params);
|
||||
};
|
||||
export const getAfterSaleOrderPage = afterSaleOrderPage;
|
||||
|
||||
// 售后服务单详情
|
||||
export const afterSaleOrderDetail = sn => {
|
||||
return getRequest(`/order/afterSale/${sn}`);
|
||||
};
|
||||
export const getAfterSaleOrderDetail = afterSaleOrderDetail;
|
||||
|
||||
// 获取售后原因分页列表
|
||||
export const getAfterSaleReasonPage = params => {
|
||||
return getRequest(`/order/afterSaleReason/getByPage`, params);
|
||||
};
|
||||
|
||||
// 删除售后原因
|
||||
export const delAfterSaleReason = id => {
|
||||
return deleteRequest(`/order/afterSaleReason/delByIds/${id}`);
|
||||
};
|
||||
|
||||
// 添加售后原因
|
||||
export const addAfterSaleReason = params => {
|
||||
return postRequest(`/order/afterSaleReason`, params);
|
||||
};
|
||||
|
||||
// 修改售后原因
|
||||
export const editAfterSaleReason = (id, params) => {
|
||||
return putRequest(`/order/afterSaleReason/update/${id}`, params);
|
||||
};
|
||||
|
||||
// 售后单商家收货信息
|
||||
export const storeAddress = sn => {
|
||||
return getRequest(`/order/afterSale/getStoreAfterSaleAddress/${sn}`);
|
||||
};
|
||||
|
||||
// 售后退款
|
||||
export const refundPrice = (afterSaleSn, params) => {
|
||||
return putRequest(`/order/afterSale/refund/${afterSaleSn}`, params);
|
||||
};
|
||||
|
||||
// 商家审核
|
||||
export const afterSaleSellerReview = (sn, params) => {
|
||||
|
||||
@@ -145,6 +145,17 @@ export const removeSeckillGoods = (seckillId, ids) => {
|
||||
export const seckillDetail = (seckillId) => {
|
||||
return getRequest(`/promotion/seckill/${seckillId}`)
|
||||
}
|
||||
|
||||
// 删除秒杀活动
|
||||
export const delSeckill = (id) => {
|
||||
return deleteRequest(`/promotion/seckill/${id}`)
|
||||
}
|
||||
|
||||
// 关闭秒杀活动
|
||||
export const updateSeckillStatus = (id, params) => {
|
||||
return putRequest(`/promotion/seckill/status/${id}`, params)
|
||||
}
|
||||
|
||||
// 删除秒杀商品
|
||||
export const delSeckillGoods = params => {
|
||||
return deleteRequest(`/promotion/seckill/apply/${params.seckillId}/${params.id}`);
|
||||
@@ -197,3 +208,11 @@ export const getNthItemDiscountDetail = (id) => getRequest(`/promotion/nthItemDi
|
||||
export const saveNthItemDiscount = (params) => postRequest('/promotion/nthItemDiscount', params, { 'Content-type': 'application/json' })
|
||||
export const editNthItemDiscount = (params) => putRequest('/promotion/nthItemDiscount', params, { 'Content-type': 'application/json' })
|
||||
export const updateNthItemDiscountStatus = (id, params) => putRequest(`/promotion/nthItemDiscount/status/${id}`, params)
|
||||
|
||||
// 兼容平台优惠券命名(商家端实际调用店铺优惠券接口)
|
||||
export const getPlatformCouponList = getShopCouponList
|
||||
export const savePlatformCoupon = saveShopCoupon
|
||||
export const editPlatformCoupon = editShopCoupon
|
||||
export const getPlatformCoupon = getShopCoupon
|
||||
export const deletePlatformCoupon = deleteShopCoupon
|
||||
export const updatePlatformCouponStatus = updateCouponStatus
|
||||
|
||||
@@ -133,6 +133,150 @@ util.oneOf = function (ele, targetArr) {
|
||||
return targetArr.indexOf(ele) >= 0;
|
||||
};
|
||||
|
||||
util.getRouterObjByName = function (routers, name) {
|
||||
if (!name || !routers || !routers.length) {
|
||||
return null;
|
||||
}
|
||||
let routerObj = null;
|
||||
for (let item of routers) {
|
||||
if (item.name == name) {
|
||||
return item;
|
||||
}
|
||||
routerObj = util.getRouterObjByName(item.children, name);
|
||||
if (routerObj) {
|
||||
return routerObj;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
util.handleTitle = function (vm, item) {
|
||||
if (!item) {
|
||||
return "";
|
||||
}
|
||||
if (typeof item.title == "object") {
|
||||
return item.title;
|
||||
}
|
||||
return item.title;
|
||||
};
|
||||
|
||||
util.setCurrentPath = function (vm, name) {
|
||||
let title = "";
|
||||
let isOtherRouter = false;
|
||||
vm.$store.state.app.routers.forEach((item) => {
|
||||
if (item.children.length == 1) {
|
||||
if (item.children[0].name == name) {
|
||||
title = util.handleTitle(vm, item);
|
||||
if (item.name == "otherRouter") {
|
||||
isOtherRouter = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
item.children.forEach((child) => {
|
||||
if (child.name == name) {
|
||||
title = util.handleTitle(vm, child);
|
||||
if (item.name == "otherRouter") {
|
||||
isOtherRouter = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
let currentPathArr = [];
|
||||
if (name == "home_index") {
|
||||
currentPathArr = [
|
||||
{
|
||||
title: util.handleTitle(
|
||||
vm,
|
||||
util.getRouterObjByName(vm.$store.state.app.routers, "home_index")
|
||||
),
|
||||
path: "",
|
||||
name: "home_index",
|
||||
},
|
||||
];
|
||||
} else if ((name.indexOf("_index") >= 0 || isOtherRouter) && name !== "home_index") {
|
||||
currentPathArr = [
|
||||
{
|
||||
title: util.handleTitle(
|
||||
vm,
|
||||
util.getRouterObjByName(vm.$store.state.app.routers, "home_index")
|
||||
),
|
||||
path: "/home",
|
||||
name: "home_index",
|
||||
},
|
||||
{
|
||||
title: title,
|
||||
path: "",
|
||||
name: name,
|
||||
},
|
||||
];
|
||||
} else {
|
||||
let currentPathObj = vm.$store.state.app.routers.filter((item) => {
|
||||
if (item.children.length <= 1) {
|
||||
return item.children[0].name == name;
|
||||
}
|
||||
let i = 0;
|
||||
let childArr = item.children;
|
||||
let len = childArr.length;
|
||||
while (i < len) {
|
||||
if (childArr[i].name == name) {
|
||||
return true;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
return false;
|
||||
})[0];
|
||||
if (!currentPathObj) {
|
||||
currentPathArr = [];
|
||||
} else if (currentPathObj.children.length <= 1 && currentPathObj.name == "home") {
|
||||
currentPathArr = [
|
||||
{
|
||||
title: "首页",
|
||||
path: "",
|
||||
name: "home_index",
|
||||
},
|
||||
];
|
||||
} else if (currentPathObj.children.length <= 1 && currentPathObj.name !== "home") {
|
||||
currentPathArr = [
|
||||
{
|
||||
title: "首页",
|
||||
path: "/home",
|
||||
name: "home_index",
|
||||
},
|
||||
{
|
||||
title: currentPathObj.title,
|
||||
path: "",
|
||||
name: name,
|
||||
},
|
||||
];
|
||||
} else {
|
||||
let childObj = currentPathObj.children.filter((child) => {
|
||||
return child.name == name;
|
||||
})[0];
|
||||
currentPathArr = [
|
||||
{
|
||||
title: "首页",
|
||||
path: "/home",
|
||||
name: "home_index",
|
||||
},
|
||||
{
|
||||
title: currentPathObj.title,
|
||||
path: "",
|
||||
name: currentPathObj.name,
|
||||
},
|
||||
{
|
||||
title: childObj.title,
|
||||
path: currentPathObj.path + "/" + childObj.path,
|
||||
name: name,
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
vm.$store.commit("setCurrentPath", currentPathArr);
|
||||
|
||||
return currentPathArr;
|
||||
};
|
||||
|
||||
util.openNewPage = function (vm, name, argu, query) {
|
||||
if (!vm.$store) {
|
||||
return;
|
||||
@@ -229,11 +373,6 @@ util.initRouter = function (vm) {
|
||||
util.initMenuData(vm, menuData);
|
||||
window.localStorage.setItem("menuData", JSON.stringify(menuData));
|
||||
vm.$store.commit("setAdded", true);
|
||||
if (vm.$store.state.app.refMenu) {
|
||||
vm.$nextTick(() => {
|
||||
vm.$store.state.app.refMenu.updateActiveName();
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
let data = window.localStorage.getItem("menuData");
|
||||
@@ -244,11 +383,6 @@ util.initRouter = function (vm) {
|
||||
let menuData = JSON.parse(data);
|
||||
util.registerDynamicRoutes(menuData);
|
||||
util.initMenuData(vm, menuData);
|
||||
if (vm.$store.state.app.refMenu) {
|
||||
vm.$nextTick(() => {
|
||||
vm.$store.state.app.refMenu.updateActiveName();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -85,3 +85,26 @@ export function memberPromotionsStatusRender(h, status) {
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 优惠券「活动时间 / 有效期」文案(活动获取券:effectiveDays 为领取后有效天数)
|
||||
*/
|
||||
export function formatPromotionCouponValidityHtml(row) {
|
||||
if (!row) return "-";
|
||||
if (row.getType === "ACTIVITY") {
|
||||
const days = row.effectiveDays;
|
||||
if (days !== undefined && days !== null && days !== "") {
|
||||
const n = Number(days);
|
||||
if (!Number.isNaN(n) && n > 0) {
|
||||
return `领取后${n}天有效`;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (row.startTime && row.endTime) {
|
||||
return `${row.startTime}<br/>${row.endTime}`;
|
||||
}
|
||||
if (row.getType === "ACTIVITY" && row.rangeDayType === "DYNAMICTIME") {
|
||||
return "长期有效";
|
||||
}
|
||||
return "-";
|
||||
}
|
||||
|
||||
@@ -25,24 +25,6 @@
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="店铺名称">
|
||||
<el-select
|
||||
v-model="searchForm.storeId"
|
||||
placeholder="请选择"
|
||||
filterable
|
||||
remote
|
||||
:remote-method="searchChange"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in shopList"
|
||||
:key="item.id"
|
||||
:label="item.storeName"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单时间">
|
||||
<el-date-picker
|
||||
v-model="timeRange"
|
||||
@@ -108,7 +90,6 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="distributionName" label="分销商" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column prop="storeName" label="店铺名称" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="状态" min-width="90">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row" :type="filterStatusTagType(row.distributionOrderStatus)">
|
||||
@@ -144,7 +125,6 @@
|
||||
<script>
|
||||
import { getDistributionOrder } from "@/api/distribution";
|
||||
import { orderStatusList } from "./dataJson";
|
||||
import { getShopListData } from "@/api/shops";
|
||||
import vueQr from "vue-qr";
|
||||
|
||||
export default {
|
||||
@@ -154,7 +134,6 @@ export default {
|
||||
return {
|
||||
timeRange: [],
|
||||
orderStatusList,
|
||||
shopList: [],
|
||||
distributionId: this.$route.query.id,
|
||||
loading: true,
|
||||
searchForm: {
|
||||
@@ -176,7 +155,6 @@ export default {
|
||||
methods: {
|
||||
init() {
|
||||
this.getDataList();
|
||||
this.getShopList();
|
||||
},
|
||||
changePage() {
|
||||
this.getDataList();
|
||||
@@ -202,26 +180,20 @@ export default {
|
||||
this.searchForm.startTime = null;
|
||||
this.searchForm.endTime = null;
|
||||
}
|
||||
getDistributionOrder(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
getShopList(val) {
|
||||
const params = {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
storeName: val || "",
|
||||
};
|
||||
getShopListData(params).then((res) => {
|
||||
this.shopList = res.result.records;
|
||||
});
|
||||
},
|
||||
searchChange(val) {
|
||||
this.getShopList(val);
|
||||
getDistributionOrder(this.searchForm)
|
||||
.then((res) => {
|
||||
if (res?.success) {
|
||||
const page = res.result || {};
|
||||
this.data = page.records || [];
|
||||
this.total = page.total || 0;
|
||||
} else {
|
||||
this.data = [];
|
||||
this.total = 0;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
filterStatus(status) {
|
||||
const arr = [
|
||||
|
||||
@@ -78,15 +78,35 @@
|
||||
}
|
||||
|
||||
.sku-val {
|
||||
width: 100%;
|
||||
justify-content: flex-start;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.sku-val-label {
|
||||
margin-bottom: 10px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sku-val-form {
|
||||
flex-wrap: wrap !important;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
>.ivu-form {
|
||||
flex-wrap: wrap !important;
|
||||
}
|
||||
|
||||
:deep(.sku-item-content-val) {
|
||||
margin-right: 20px;
|
||||
margin-left: 0 !important;
|
||||
width: auto !important;
|
||||
min-width: auto !important;
|
||||
|
||||
.el-form-item__content {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -151,9 +171,23 @@ div.base-info-item {
|
||||
|
||||
.sku-item-content-name {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.sku-item-label {
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.sku-item-input-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,14 +114,6 @@
|
||||
>
|
||||
批量下架
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="currentStatus === 'TOBEAUDITED'"
|
||||
type="primary"
|
||||
:disabled="selectedRows.length === 0"
|
||||
@click="batchAudit"
|
||||
>
|
||||
批量审核
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
@@ -178,20 +170,15 @@
|
||||
<el-table-column prop="storeName" label="店铺名称" width="200" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="200" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row.authFlag === 'TOBEAUDITED'">
|
||||
<a class="link-text" @click="openAuditModal(row)">审核</a>
|
||||
<span class="op-split">|</span>
|
||||
<a class="link-text" @click="showDetail(row)">查看</a>
|
||||
</template>
|
||||
<template v-else-if="row.marketEnable === 'DOWN'">
|
||||
<template v-if="row.marketEnable === 'DOWN'">
|
||||
<a class="link-text" @click="upper(row)">上架</a>
|
||||
<span class="op-split">|</span>
|
||||
<a class="link-text" @click="showDetail(row)">查看</a>
|
||||
<a class="link-text" @click="editGoods(row)">编辑</a>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a class="link-text" @click="edit(row)">下架</a>
|
||||
<span class="op-split">|</span>
|
||||
<a class="link-text" @click="showDetail(row)">查看</a>
|
||||
<a class="link-text" @click="editGoods(row)">编辑</a>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -223,49 +210,6 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="auditModalVisible" title="商品审核" width="500px" :close-on-click-modal="false">
|
||||
<el-form ref="auditForm" :model="goodsAuditForm" label-width="100px">
|
||||
<el-form-item label="审核结果" prop="auth_flag">
|
||||
<el-radio-group v-model="goodsAuditForm.auth_flag">
|
||||
<el-radio :value="1">审核通过</el-radio>
|
||||
<el-radio :value="2">审核拒绝</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="auditModalVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmAudit">提交审核</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog
|
||||
v-model="batchAuditModalVisible"
|
||||
title="批量商品审核"
|
||||
width="500px"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="batchAuditForm" :model="batchAuditForm" label-width="100px">
|
||||
<el-form-item label="审核结果" prop="auth_flag">
|
||||
<el-radio-group v-model="batchAuditForm.auth_flag">
|
||||
<el-radio :value="1">审核通过</el-radio>
|
||||
<el-radio :value="2">审核拒绝</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="batchAuditForm.auth_flag === 2" label="审核备注" prop="reason">
|
||||
<el-input v-model="batchAuditForm.reason" type="textarea" :rows="3" placeholder="请输入拒绝原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="选中商品">
|
||||
<div style="max-height: 200px; overflow-y: auto">
|
||||
<el-tag v-for="item in selectedRows" :key="item.id" style="margin: 2px">{{ item.goodsName }}</el-tag>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="batchAuditModalVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submitBatchAudit">提交审核</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="goodsGroupFlag" title="批量设置商品分组" width="420px">
|
||||
<el-form ref="goodsGroupForm" :model="goodsGroupForm" :rules="goodsGroupRule" label-width="90px">
|
||||
<el-form-item label="商品分组" prop="groupId">
|
||||
@@ -295,7 +239,6 @@ import {
|
||||
getGoodsNumerData,
|
||||
upGoods,
|
||||
lowGoods,
|
||||
authGoods,
|
||||
getGoodsGroupByPage,
|
||||
addGoodsGroupItems
|
||||
} from "@/api/goods";
|
||||
@@ -318,12 +261,6 @@ export default {
|
||||
// 下架原因
|
||||
reason: "",
|
||||
},
|
||||
goodsAuditForm: {
|
||||
// 商品审核表单
|
||||
auth_flag: 1,
|
||||
},
|
||||
auditModalVisible: false, // 审核弹框显示状态
|
||||
currentAuditGoods: null, // 当前审核的商品
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
data: [], // 表单数据
|
||||
total: 0, // 表单数据总数
|
||||
@@ -331,11 +268,6 @@ export default {
|
||||
goodsNumerData: {},
|
||||
selectedRows: [], // 选中的行数据
|
||||
selectAll: false, // 全选状态
|
||||
batchAuditModalVisible: false, // 批量审核弹框显示状态
|
||||
batchAuditForm: {
|
||||
auth_flag: 1,
|
||||
reason: ''
|
||||
},
|
||||
goodsGroupFlag: false,
|
||||
goodsGroupLoading: false,
|
||||
goodsGroupList: [],
|
||||
@@ -477,10 +409,10 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
//查看商品详情
|
||||
showDetail(v) {
|
||||
// 编辑商品
|
||||
editGoods(v) {
|
||||
this.$filters.customRouterPush({
|
||||
name: "goods-detail",
|
||||
name: "goods-operation-edit",
|
||||
query: { id: v.id },
|
||||
});
|
||||
},
|
||||
@@ -498,73 +430,6 @@ export default {
|
||||
this.clearTableSelection();
|
||||
this.getDataList();
|
||||
},
|
||||
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: () => {
|
||||
this.goodsAuditForm.goodsIds=v.id;
|
||||
let formData = new FormData();
|
||||
formData.append('goodsIds', v.id);
|
||||
formData.append('authFlag', this.goodsAuditForm.authFlag);
|
||||
|
||||
authGoods(formData).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("审核成功");
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 打开审核弹框
|
||||
openAuditModal(goods) {
|
||||
this.currentAuditGoods = goods;
|
||||
this.goodsAuditForm.auth_flag = 1;
|
||||
this.goodsAuditForm.reason = '';
|
||||
this.auditModalVisible = true;
|
||||
},
|
||||
|
||||
// 确认审核(二次确认)
|
||||
confirmAudit() {
|
||||
const auditText = this.goodsAuditForm.auth_flag === 1 ? '通过' : '拒绝';
|
||||
this.$Modal.confirm({
|
||||
title: '确认审核',
|
||||
content: `您确认要审核${auditText} "${this.currentAuditGoods.goodsName}" 吗?`,
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
this.submitAudit();
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 提交审核
|
||||
submitAudit() {
|
||||
let formData = new FormData();
|
||||
formData.append('goodsIds', this.currentAuditGoods.id);
|
||||
formData.append('authFlag', this.goodsAuditForm.auth_flag === 1 ? 'PASS' : 'REFUSE');
|
||||
authGoods(formData).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success('审核成功');
|
||||
this.auditModalVisible = false;
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onSelectionChange(selection) {
|
||||
this.selectedRows = selection;
|
||||
@@ -640,68 +505,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 批量审核
|
||||
batchAudit() {
|
||||
if (this.selectedRows.length === 0) {
|
||||
this.$Message.warning('请先选择要审核的商品');
|
||||
return;
|
||||
}
|
||||
|
||||
// 重置批量审核表单
|
||||
this.batchAuditForm = {
|
||||
auth_flag: 1,
|
||||
reason: ''
|
||||
};
|
||||
this.batchAuditModalVisible = true;
|
||||
},
|
||||
|
||||
// 提交批量审核
|
||||
submitBatchAudit() {
|
||||
if (this.selectedRows.length === 0) {
|
||||
this.$Message.warning('请先选择要审核的商品');
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果是拒绝审核,必须填写原因
|
||||
if (this.batchAuditForm.auth_flag === 2 && !this.batchAuditForm.reason.trim()) {
|
||||
this.$Message.warning('审核拒绝时必须填写拒绝原因');
|
||||
return;
|
||||
}
|
||||
|
||||
const actionText = this.batchAuditForm.auth_flag === 1 ? '通过' : '拒绝';
|
||||
const goodsNames = this.selectedRows.map(item => item.goodsName).join('、');
|
||||
|
||||
this.$Modal.confirm({
|
||||
title: `确认批量审核${actionText}`,
|
||||
content: `您确认要${actionText}以下商品的审核吗?\n${goodsNames}`,
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
// 提取所有选中商品的ID
|
||||
const goodsIds = this.selectedRows.map(item => item.id);
|
||||
|
||||
let formData = new FormData();
|
||||
formData.append('goodsId', goodsIds);
|
||||
formData.append('authFlag', this.batchAuditForm.auth_flag === 1 ? 'PASS' : 'REFUSE');
|
||||
formData.append('reason', this.batchAuditForm.reason || '');
|
||||
|
||||
// 修正:直接调用authGoods,不传递'batch'参数
|
||||
authGoods(formData).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success(`批量审核${actionText}成功`);
|
||||
this.selectedRows = [];
|
||||
this.selectAll = false;
|
||||
this.batchAuditModalVisible = false;
|
||||
this.getDataList();
|
||||
this.getNumberData();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$Modal.remove();
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
loadGoodsGroupList() {
|
||||
getGoodsGroupByPage({ pageNumber: 1, pageSize: 1000 }).then((res) => {
|
||||
if (res && res.success && res.result) {
|
||||
|
||||
@@ -17,6 +17,12 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="goods-type-actions">
|
||||
<el-button @click="cancelGoodsType">取消</el-button>
|
||||
<el-button type="primary" @click="confirmGoodsType">确认</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<!-- 商品分类 -->
|
||||
<div class="content-goods-publish">
|
||||
@@ -64,7 +70,7 @@
|
||||
<!-- 底部按钮 -->
|
||||
<div class="footer">
|
||||
<div class="footer-btns">
|
||||
<el-button type="primary" @click="selectGoodsType = true">商品类型</el-button>
|
||||
<el-button type="primary" @click="openGoodsTypeDialog">商品类型</el-button>
|
||||
<el-button type="primary" @click="next">下一步</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -100,6 +106,7 @@ export default {
|
||||
],
|
||||
// 商品类型
|
||||
goodsType: "",
|
||||
pendingGoodsType: "",
|
||||
/** 1级分类列表*/
|
||||
categoryListLevel1: [],
|
||||
/** 2级分类列表*/
|
||||
@@ -108,15 +115,41 @@ export default {
|
||||
categoryListLevel3: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
selectGoodsType(val) {
|
||||
if (val) {
|
||||
this.syncGoodsTypeSelection();
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 点击商品类型
|
||||
handleClickGoodsType(val) {
|
||||
this.goodsTypeWay.map((item) => {
|
||||
return (item.check = false);
|
||||
syncGoodsTypeSelection() {
|
||||
this.pendingGoodsType = this.goodsType;
|
||||
this.goodsTypeWay.forEach((item) => {
|
||||
item.check = item.type === this.goodsType;
|
||||
});
|
||||
|
||||
val.check = !val.check;
|
||||
this.goodsType = val.type;
|
||||
},
|
||||
openGoodsTypeDialog() {
|
||||
this.selectGoodsType = true;
|
||||
},
|
||||
// 点击商品类型(仅临时选中,确认后才生效)
|
||||
handleClickGoodsType(val) {
|
||||
this.goodsTypeWay.forEach((item) => {
|
||||
item.check = item.type === val.type;
|
||||
});
|
||||
this.pendingGoodsType = val.type;
|
||||
},
|
||||
cancelGoodsType() {
|
||||
this.syncGoodsTypeSelection();
|
||||
this.selectGoodsType = false;
|
||||
},
|
||||
confirmGoodsType() {
|
||||
if (!this.pendingGoodsType) {
|
||||
this.$Message.error("请选择商品类型");
|
||||
return;
|
||||
}
|
||||
this.goodsType = this.pendingGoodsType;
|
||||
this.selectGoodsType = false;
|
||||
},
|
||||
/** 选择商城商品分类 */
|
||||
handleSelectCategory(row, index, level) {
|
||||
@@ -177,4 +210,22 @@ export default {
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import "./addGoods.scss";
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.footer-btns {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.goods-type-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -120,19 +120,23 @@
|
||||
<div class="form-item-view">
|
||||
<el-form-item class="form-item-view-el required" label="主图" prop="goodsGalleryFiles">
|
||||
<div style="display: flex; flex-wrap: wrap;">
|
||||
<vuedraggable :animation="200" :list="baseInfoForm.goodsGalleryFiles">
|
||||
<div v-for="(item, __index) in baseInfoForm.goodsGalleryFiles" :key="__index"
|
||||
class="demo-upload-list">
|
||||
<template>
|
||||
<img :src="item" />
|
||||
<vuedraggable
|
||||
v-model="baseInfoForm.goodsGalleryFiles"
|
||||
:animation="200"
|
||||
:item-key="draggableItemKey"
|
||||
style="display: flex; flex-wrap: wrap"
|
||||
>
|
||||
<template #item="{ element }">
|
||||
<div class="demo-upload-list">
|
||||
<img :src="element" />
|
||||
<div class="demo-upload-list-cover">
|
||||
<div>
|
||||
<el-button link type="primary" @click="handleViewGoodsPicture(item)">预览</el-button>
|
||||
<el-button link type="danger" @click="handleRemoveGoodsPicture(item)">删除</el-button>
|
||||
<el-button link type="primary" @click="handleViewGoodsPicture(element)">预览</el-button>
|
||||
<el-button link type="danger" @click="handleRemoveGoodsPicture(element)">删除</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</vuedraggable>
|
||||
<!--<Upload ref="upload"-->
|
||||
<!--:action="uploadFileUrl" :before-upload="handleBeforeUploadGoodsPicture"-->
|
||||
@@ -190,39 +194,34 @@
|
||||
<template #header>
|
||||
<el-button link type="danger" @click="handleCloseSkuItem($index, item)">删除规格项</el-button>
|
||||
</template>
|
||||
<div>
|
||||
<div style="display: flex;margin-bottom: 10px;font-weight: bold">规格项</div>
|
||||
<el-form-item class="sku-item-content-val flex" label="">
|
||||
|
||||
<div>
|
||||
<el-autocomplete
|
||||
v-model="item.name"
|
||||
:fetch-suggestions="(q, cb) => cb([])"
|
||||
maxlength="30"
|
||||
placeholder="请输入规格项名称"
|
||||
style="width: 150px"
|
||||
@focus="changeSkuItem(item.name)"
|
||||
@change="editSkuItem(item.name, $index, item)"
|
||||
/>
|
||||
|
||||
<el-switch
|
||||
v-if="$index === 0"
|
||||
v-model="openImage"
|
||||
style="margin-left: 10px"
|
||||
@change="changeSkuOpenImage"
|
||||
/>
|
||||
<span v-if="$index === 0" style="margin-left: 5px">添加规格图片</span>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<div class="sku-item-content-name">
|
||||
<div class="sku-item-label">规格项</div>
|
||||
<div class="sku-item-input-row">
|
||||
<el-autocomplete
|
||||
v-model="item.name"
|
||||
:fetch-suggestions="(q, cb) => cb([])"
|
||||
maxlength="30"
|
||||
placeholder="请输入规格项名称"
|
||||
style="width: 150px"
|
||||
@focus="changeSkuItem(item.name)"
|
||||
@change="editSkuItem(item.name, $index, item)"
|
||||
/>
|
||||
<el-switch
|
||||
v-if="$index === 0"
|
||||
v-model="openImage"
|
||||
style="margin-left: 10px"
|
||||
@change="changeSkuOpenImage"
|
||||
/>
|
||||
<span v-if="$index === 0" style="margin-left: 5px">添加规格图片</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sku-val">
|
||||
<div style="margin-bottom: 10px;font-weight: bold;display: flex">规格值 (输入完成后,鼠标点击其他地方后生效)</div>
|
||||
<el-form :model="item" class="flex">
|
||||
<div class="sku-val-label">规格值 (输入完成后,鼠标点击其他地方后生效)</div>
|
||||
<el-form :model="item" class="sku-val-form flex">
|
||||
<!--规格值文本列表-->
|
||||
<el-form-item v-for="(val, index) in item.spec_values" :key="index"
|
||||
class="sku-item-content-val flex" label="" style="line-height: 32px;">
|
||||
<div style="display: flex; justify-content: center; align-items: center;">
|
||||
<div style="display: flex; justify-content: flex-start; align-items: center;">
|
||||
|
||||
|
||||
<el-autocomplete
|
||||
@@ -244,19 +243,26 @@
|
||||
<!-- 内联错误提示 -->
|
||||
<div v-if="val._error" class="sku-inline-error">{{ val._error }}</div>
|
||||
<div v-if="$index === 0 && openImage" style="margin-top: 10px">
|
||||
<vuedraggable :animation="200" :list="val.images">
|
||||
<div v-for="(img, __index) in val.images" :key="__index" class="sku-upload-list"
|
||||
style="width: 180px;height: 140px">
|
||||
<template>
|
||||
<img :src="img" style="width: 180px;height: 140px" />
|
||||
<vuedraggable
|
||||
v-model="val.images"
|
||||
:animation="200"
|
||||
:item-key="draggableItemKey"
|
||||
style="display: flex; flex-wrap: wrap"
|
||||
>
|
||||
<template #item="{ element, index: imgIndex }">
|
||||
<div
|
||||
class="sku-upload-list"
|
||||
style="width: 180px;height: 140px"
|
||||
>
|
||||
<img :src="element" style="width: 180px;height: 140px" />
|
||||
<div class="sku-upload-list-cover">
|
||||
<div style="margin-top: 50px">
|
||||
<el-icon :size="25" style="cursor:pointer;margin-right:8px" @click="handleView(img)"><ZoomIn /></el-icon>
|
||||
<el-icon :size="25" style="cursor:pointer" @click="handleRemove(val.images, __index)"><Delete /></el-icon>
|
||||
<el-icon :size="25" style="cursor:pointer;margin-right:8px" @click="handleView(element)"><ZoomIn /></el-icon>
|
||||
<el-icon :size="25" style="cursor:pointer" @click="handleRemove(val.images, imgIndex)"><Delete /></el-icon>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</vuedraggable>
|
||||
<el-upload
|
||||
v-if="val.images.length < 1"
|
||||
@@ -311,21 +317,21 @@
|
||||
:prop="col.key"
|
||||
min-width="120"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<template #default="{ row, $index }">
|
||||
<span v-if="col.key && !col.slot">{{ row[col.key] }}</span>
|
||||
<el-input
|
||||
v-else-if="col.slot === 'sn'"
|
||||
v-model="row.sn"
|
||||
clearable
|
||||
placeholder="请输入货号"
|
||||
@change="updateSkuTable(row, 'sn')"
|
||||
@change="updateSkuTable(row, 'sn', $index)"
|
||||
/>
|
||||
<el-input
|
||||
v-else-if="col.slot === 'weight' && baseInfoForm.goodsType !== 'VIRTUAL_GOODS'"
|
||||
v-model="row.weight"
|
||||
clearable
|
||||
placeholder="请输入重量"
|
||||
@change="updateSkuTable(row, 'weight')"
|
||||
@change="updateSkuTable(row, 'weight', $index)"
|
||||
>
|
||||
<template #append>kg</template>
|
||||
</el-input>
|
||||
@@ -334,7 +340,7 @@
|
||||
v-model="row.quantity"
|
||||
clearable
|
||||
placeholder="请输入库存"
|
||||
@change="updateSkuTable(row, 'quantity')"
|
||||
@change="updateSkuTable(row, 'quantity', $index)"
|
||||
>
|
||||
<template #append>{{ baseInfoForm.goodsUnit || "" }}</template>
|
||||
</el-input>
|
||||
@@ -343,7 +349,7 @@
|
||||
v-model="row.cost"
|
||||
clearable
|
||||
placeholder="请输入成本价"
|
||||
@change="updateSkuTable(row, 'cost')"
|
||||
@change="updateSkuTable(row, 'cost', $index)"
|
||||
>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
@@ -352,7 +358,7 @@
|
||||
v-model="row.price"
|
||||
clearable
|
||||
placeholder="请输入价格"
|
||||
@change="updateSkuTable(row, 'price')"
|
||||
@change="updateSkuTable(row, 'price', $index)"
|
||||
>
|
||||
<template #append>元</template>
|
||||
</el-input>
|
||||
@@ -414,15 +420,19 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item class="form-item-view-el" label="PC商品描述" prop="intro" style="width: 100%">
|
||||
<editor ref="editor" v-model="baseInfoForm.intro" height="800px" openXss></editor>
|
||||
<div class="promise-intro-btn">
|
||||
<el-button type="primary" @click="promiseIntroEditor">将PC商品描述同步到移动端描述
|
||||
</el-button>
|
||||
<div class="intro-editor-field">
|
||||
<editor ref="editor" v-model="baseInfoForm.intro" height="800px" openXss></editor>
|
||||
<div class="promise-intro-btn">
|
||||
<el-button type="primary" @click="promiseIntroEditor">将PC商品描述同步到移动端描述
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item class="form-item-view-el" label="移动端描述" prop="skuList" style="width: 100%">
|
||||
<editor ref="introEditor" v-model="baseInfoForm.mobileIntro" height="800px" openXss></editor>
|
||||
<div class="intro-editor-field">
|
||||
<editor ref="introEditor" v-model="baseInfoForm.mobileIntro" height="800px" openXss></editor>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="baseInfoForm.goodsType != 'VIRTUAL_GOODS'">
|
||||
@@ -669,7 +679,7 @@ export default {
|
||||
// 某一规格名下的规格值
|
||||
skuVal: [],
|
||||
// 规格展开的项
|
||||
open_panel: [1, 2],
|
||||
open_panel: ["1", "2"],
|
||||
/** 要提交的规格数据*/
|
||||
skuInfo: [],
|
||||
/** 物流模板 **/
|
||||
@@ -736,12 +746,18 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
draggableItemKey(item) {
|
||||
return item;
|
||||
},
|
||||
// 选择图片modal
|
||||
handleCLickImg(val, index) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.selectedFormBtnName = val;
|
||||
// this.picIndex = index;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
handleLoadingSkuData() {
|
||||
this.needToloadSku = false
|
||||
@@ -908,11 +924,21 @@ export default {
|
||||
this.baseInfoForm.goodsGalleryFiles =
|
||||
this.baseInfoForm.goodsGalleryFiles.filter((i) => i !== file);
|
||||
},
|
||||
assignSkuTableIndex() {
|
||||
this.skuTableData.forEach((row, index) => {
|
||||
row._index = index;
|
||||
});
|
||||
},
|
||||
// 更新sku图片
|
||||
updateSkuPicture() {
|
||||
this.baseInfoForm.regeneratorSkuFlag = true;
|
||||
let _index = this.selectedSku._index;
|
||||
this.skuTableData[_index] = this.selectedSku;
|
||||
if (_index === undefined || _index === null) {
|
||||
_index = this.skuTableData.indexOf(this.selectedSku);
|
||||
}
|
||||
if (_index >= 0) {
|
||||
this.skuTableData[_index] = this.selectedSku;
|
||||
}
|
||||
},
|
||||
// sku图片上传成功
|
||||
handleSuccess(res, file, images) {
|
||||
@@ -1251,13 +1277,12 @@ export default {
|
||||
},
|
||||
// 将pc商品描述同步给移动端
|
||||
promiseIntroEditor() {
|
||||
const pcContent = this.$refs.editor?.getContent?.() ?? this.baseInfoForm.intro ?? "";
|
||||
this.baseInfoForm.intro = pcContent;
|
||||
this.baseInfoForm.mobileIntro = pcContent;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.introEditor.setContent(this.baseInfoForm.intro);
|
||||
})
|
||||
|
||||
this.baseInfoForm.mobileIntro = this.baseInfoForm.intro;
|
||||
|
||||
this.$forceUpdate();
|
||||
this.$refs.introEditor?.setContent?.(pcContent);
|
||||
});
|
||||
},
|
||||
|
||||
/** 根据当前分类id查询商品应包含的参数 */
|
||||
@@ -1830,6 +1855,7 @@ export default {
|
||||
};
|
||||
}
|
||||
});
|
||||
this.assignSkuTableIndex();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1967,8 +1993,18 @@ export default {
|
||||
return option.toUpperCase().indexOf(value.toUpperCase()) !== -1;
|
||||
},
|
||||
/** 数据改变之后 抛出数据 */
|
||||
updateSkuTable(row, item, type = "default") {
|
||||
let index = row._index;
|
||||
updateSkuTable(row, item, rowIndex) {
|
||||
let index = rowIndex;
|
||||
if (index === undefined || index === null) {
|
||||
index = row._index;
|
||||
}
|
||||
if (index === undefined || index === null) {
|
||||
index = this.skuTableData.indexOf(row);
|
||||
}
|
||||
if (index < 0 || !this.skuTableData[index]) {
|
||||
return;
|
||||
}
|
||||
row._index = index;
|
||||
this.baseInfoForm.regeneratorSkuFlag = true;
|
||||
/** 进行自定义校验 判断是否是数字(小数也能通过)重量 */
|
||||
if (item === "weight") {
|
||||
@@ -1994,35 +2030,11 @@ export default {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// else if (item === "alertQuantity") {
|
||||
// if (
|
||||
// !/^[0-9]\d*$/.test(row[item]) ||
|
||||
// parseInt(row[item]) < 0 ||
|
||||
// parseInt(row[item]) > 99999999
|
||||
// ) {
|
||||
// // 库存预警
|
||||
// this.validateError.push([index, item]);
|
||||
// this.validatatxt = "请输入0~99999999之间的整数";
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
// else if (item === "cost" || item === "price") {
|
||||
// if (
|
||||
// !regular.money.test(row[item]) ||
|
||||
// parseInt(row[item]) < 0 ||
|
||||
// parseInt(row[item]) > 99999999
|
||||
// ) {
|
||||
// // 成本价 价格
|
||||
// this.validateError.push([index, item]);
|
||||
// this.validatatxt = "请输入0~99999999之间的价格";
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
this.$nextTick(() => {
|
||||
this.skuTableData[index][item] = row[item];
|
||||
if (this.skuTableData[index]) {
|
||||
this.skuTableData[index][item] = row[item];
|
||||
}
|
||||
});
|
||||
// // migrated
|
||||
(this.skuTableData,[index][item],row[item])
|
||||
},
|
||||
// 店内分类选择
|
||||
selectTree(v) {
|
||||
@@ -2285,6 +2297,26 @@ export default {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.intro-editor-field {
|
||||
width: calc(100% - 400px);
|
||||
}
|
||||
|
||||
.promise-intro-btn {
|
||||
margin-top: 12px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.footer-btns {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* .tox-notifications-container{
|
||||
|
||||
@@ -16,6 +16,10 @@ export default {
|
||||
components:{uploadImage},
|
||||
name: "Tinymce",
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: "",
|
||||
@@ -25,6 +29,7 @@ export default {
|
||||
default:'500px'
|
||||
}
|
||||
},
|
||||
emits: ["update:modelValue", "input"],
|
||||
data() {
|
||||
return {
|
||||
// 引入编辑器的配置
|
||||
@@ -41,14 +46,19 @@ export default {
|
||||
created() {
|
||||
this.init();
|
||||
},
|
||||
computed: {
|
||||
bindValue() {
|
||||
return this.modelValue ?? this.value ?? "";
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
bindValue: {
|
||||
handler(val) {
|
||||
if (!this.hasChange && this.hasInit) {
|
||||
// 当内容有更改且编辑器已初始化时,更新编辑器的内容
|
||||
this.$nextTick(() =>
|
||||
window.tinymce.get(this.tinymceId).setContent(val || "")
|
||||
);
|
||||
const editor = window.tinymce.get(this.tinymceId);
|
||||
if (editor) {
|
||||
this.$nextTick(() => editor.setContent(val || ""));
|
||||
}
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
@@ -69,19 +79,15 @@ export default {
|
||||
selector: `#${this.tinymceId}`,
|
||||
convert_urls: false,
|
||||
init_instance_callback: (editor) => {
|
||||
if (_this.value) {
|
||||
// 如果有初始值,则设置编辑器的内容为初始值
|
||||
this.$nextTick(() => editor.setContent(_this.value));
|
||||
if (_this.bindValue) {
|
||||
_this.$nextTick(() => editor.setContent(_this.bindValue));
|
||||
}
|
||||
_this.hasInit = true;
|
||||
// 监听编辑器内容的变化
|
||||
editor.on("NodeChange Change KeyUp SetContent", (event) => {
|
||||
if (_this.value) {
|
||||
// 内容发生更改
|
||||
this.hasChange = true;
|
||||
}
|
||||
// 通过 input 事件将编辑器的内容传递给父组件
|
||||
this.$emit("input", editor.getContent());
|
||||
editor.on("NodeChange Change KeyUp SetContent", () => {
|
||||
_this.hasChange = true;
|
||||
const content = editor.getContent();
|
||||
_this.$emit("update:modelValue", content);
|
||||
_this.$emit("input", content);
|
||||
});
|
||||
},
|
||||
setup(editor) {
|
||||
@@ -96,8 +102,15 @@ export default {
|
||||
});
|
||||
},
|
||||
setContent(value) {
|
||||
// 设置编辑器的内容
|
||||
window.tinymce.get(this.tinymceId).setContent(value);
|
||||
const editor = window.tinymce.get(this.tinymceId);
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
const content = value || "";
|
||||
this.hasChange = false;
|
||||
editor.setContent(content);
|
||||
this.$emit("update:modelValue", content);
|
||||
this.$emit("input", content);
|
||||
},
|
||||
getContent() {
|
||||
// 获取编辑器的内容
|
||||
|
||||
@@ -4,28 +4,31 @@
|
||||
<el-dialog v-model="show" width="850px" title="上传图片" append-to-body :z-index="3500">
|
||||
<div class="import-oss" @click="importOSS">从资源库中导入</div>
|
||||
<div style="display: flex; flex-wrap: wrap">
|
||||
<vuedraggable :animation="200" :list="images">
|
||||
<div
|
||||
v-for="(item, __index) in images"
|
||||
:key="__index"
|
||||
class="upload-list"
|
||||
>
|
||||
<img alt="image" :src="item.url" />
|
||||
<div class="upload-list-cover">
|
||||
<div>
|
||||
<el-icon class="action-icon" :size="30" @click="handleView(item.url)">
|
||||
<ZoomIn />
|
||||
</el-icon>
|
||||
<el-icon
|
||||
class="action-icon"
|
||||
:size="30"
|
||||
@click="handleRemoveGoodsPicture(__index)"
|
||||
>
|
||||
<Delete />
|
||||
</el-icon>
|
||||
<vuedraggable
|
||||
v-model="images"
|
||||
:animation="200"
|
||||
:item-key="draggableItemKey"
|
||||
style="display: flex; flex-wrap: wrap"
|
||||
>
|
||||
<template #item="{ element, index }">
|
||||
<div class="upload-list">
|
||||
<img alt="image" :src="element.url" />
|
||||
<div class="upload-list-cover">
|
||||
<div>
|
||||
<el-icon class="action-icon" :size="30" @click="handleView(element.url)">
|
||||
<ZoomIn />
|
||||
</el-icon>
|
||||
<el-icon
|
||||
class="action-icon"
|
||||
:size="30"
|
||||
@click="handleRemoveGoodsPicture(index)"
|
||||
>
|
||||
<Delete />
|
||||
</el-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</vuedraggable>
|
||||
<div class="upload-box">
|
||||
<el-upload
|
||||
@@ -58,17 +61,16 @@
|
||||
append-to-body
|
||||
:z-index="3600"
|
||||
destroy-on-close
|
||||
@closed="confirmUrls"
|
||||
@closed="resetOssSelection"
|
||||
>
|
||||
<OssManage
|
||||
ref="ossManage"
|
||||
:is-component="true"
|
||||
:initialize="showOssManager"
|
||||
@selected="(list) => { selectedImage = list }"
|
||||
@callback="handleCallback"
|
||||
@selected="handleOssSelected"
|
||||
/>
|
||||
<template #footer>
|
||||
<el-button @click="showOssManager = false">取消</el-button>
|
||||
<el-button @click="cancelOssImport">取消</el-button>
|
||||
<el-button type="primary" @click="confirmUrls">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
@@ -114,6 +116,9 @@ export default {
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
draggableItemKey(item) {
|
||||
return item?.url || item;
|
||||
},
|
||||
handleClickUploadImage() {
|
||||
this.show = true;
|
||||
},
|
||||
@@ -153,18 +158,39 @@ export default {
|
||||
this.$Message.error(err?.message || String(err));
|
||||
},
|
||||
confirmUrls() {
|
||||
if (this.selectedImage.length) {
|
||||
this.selectedImage.forEach((element) => {
|
||||
this.images.push({ url: element.url });
|
||||
});
|
||||
}
|
||||
this.applySelectedImages();
|
||||
this.showOssManager = false;
|
||||
},
|
||||
handleCallback(val) {
|
||||
this.$Message.success("导入成功");
|
||||
this.images.push({ url: val.url });
|
||||
cancelOssImport() {
|
||||
this.selectedImage = [];
|
||||
this.showOssManager = false;
|
||||
},
|
||||
resetOssSelection() {
|
||||
this.selectedImage = [];
|
||||
},
|
||||
handleOssSelected(list) {
|
||||
this.selectedImage = Array.isArray(list) ? list : [];
|
||||
},
|
||||
parseOssSelectionUrl(item) {
|
||||
if (!item) {
|
||||
return "";
|
||||
}
|
||||
if (typeof item === "string") {
|
||||
const index = item.indexOf(",");
|
||||
return index >= 0 ? item.slice(index + 1) : item;
|
||||
}
|
||||
return item.url || "";
|
||||
},
|
||||
applySelectedImages() {
|
||||
(this.selectedImage || []).forEach((item) => {
|
||||
const url = this.parseOssSelectionUrl(item);
|
||||
if (url) {
|
||||
this.images.push({ url });
|
||||
}
|
||||
});
|
||||
},
|
||||
importOSS() {
|
||||
this.selectedImage = [];
|
||||
this.showOssManager = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
|
||||
@@ -103,7 +103,7 @@ export default {
|
||||
},
|
||||
watch: {
|
||||
category(val) {
|
||||
this.goodsParams.categoryPath = val[2];
|
||||
this.goodsParams.categoryPath = val && val.length ? val.join(",") : "";
|
||||
},
|
||||
selectedWay: {
|
||||
handler() {
|
||||
|
||||
@@ -57,8 +57,9 @@ export default {
|
||||
this.goodsData = [];
|
||||
},
|
||||
clickClose() {
|
||||
this.$emit("closeFlag", false);
|
||||
this.flag = false;
|
||||
this.goodsFlag = false;
|
||||
this.$emit("closeFlag", false);
|
||||
},
|
||||
singleGoods() {
|
||||
var timer = setInterval(() => {
|
||||
|
||||
@@ -73,26 +73,21 @@ export default {
|
||||
this.thirdIndex = index;
|
||||
},
|
||||
init() {
|
||||
|
||||
|
||||
let category = JSON.parse(localStorage.getItem('category'))
|
||||
if (category) {
|
||||
const loadCategory = () => {
|
||||
const category = JSON.parse(localStorage.getItem("category"));
|
||||
if (!Array.isArray(category)) {
|
||||
return;
|
||||
}
|
||||
category.forEach((item) => {
|
||||
item.___type = "category";
|
||||
});
|
||||
this.categoryList = category;
|
||||
// this.handleClickChild(category[0], 0);
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
category = JSON.parse(localStorage.getItem('category'))
|
||||
category.forEach((item) => {
|
||||
item.___type = "category";
|
||||
});
|
||||
this.categoryList = category;
|
||||
// this.handleClickChild(category[0], 0);
|
||||
},3000)
|
||||
}
|
||||
};
|
||||
|
||||
loadCategory();
|
||||
if (!this.categoryList.length) {
|
||||
setTimeout(loadCategory, 3000);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -95,12 +95,25 @@ export default {
|
||||
height: auto;
|
||||
min-height: 56px;
|
||||
white-space: normal;
|
||||
transition: background-color 0.2s ease, color 0.2s ease;
|
||||
}
|
||||
|
||||
:deep(.el-menu-item:not(.is-active):hover),
|
||||
:deep(.el-menu-item:not(.is-active):focus) {
|
||||
background-color: #43444d !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
:deep(.el-menu-item.is-active) {
|
||||
background-color: #fff !important;
|
||||
color: $theme_color !important;
|
||||
}
|
||||
|
||||
:deep(.el-menu-item.is-active:hover),
|
||||
:deep(.el-menu-item.is-active:focus) {
|
||||
background-color: #fff !important;
|
||||
color: $theme_color !important;
|
||||
}
|
||||
}
|
||||
|
||||
.sub-menu {
|
||||
|
||||
@@ -112,10 +112,14 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleCLickImg(val, index) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModalFlag = true;
|
||||
this.selectedFormBtnName = val;
|
||||
this.picIndex = index;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
callbackSelected(val) {
|
||||
this.picModalFlag = false;
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="upload-pic-thumb">
|
||||
<vuedraggable
|
||||
:list="uploadList"
|
||||
:disabled="!draggable || !multiple"
|
||||
:animation="200"
|
||||
class="list-group"
|
||||
ghost-class="thumb-ghost"
|
||||
@end="onEnd"
|
||||
>
|
||||
<div v-for="(item, index) in uploadList" :key="index" class="upload-list">
|
||||
<div v-if="disable || isView" class="list-group">
|
||||
<div v-for="item in uploadList" :key="item.url" class="upload-list">
|
||||
<div v-if="item.status == 'finished'" style="height: 60px">
|
||||
<img :src="item.url" alt="" />
|
||||
<div class="upload-list-cover">
|
||||
@@ -25,6 +18,35 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<vuedraggable
|
||||
v-else
|
||||
v-model="uploadList"
|
||||
:disabled="disable || !draggable || !multiple"
|
||||
:animation="200"
|
||||
class="list-group"
|
||||
ghost-class="thumb-ghost"
|
||||
item-key="url"
|
||||
@end="onEnd"
|
||||
>
|
||||
<template #item="{ element: item }">
|
||||
<div class="upload-list">
|
||||
<div v-if="item.status == 'finished'" style="height: 60px">
|
||||
<img :src="item.url" alt="" />
|
||||
<div class="upload-list-cover">
|
||||
<el-icon class="action-icon" @click="handleView(item.url)"><View /></el-icon>
|
||||
<el-icon v-if="remove" class="action-icon" @click="handleRemove(item)"><Delete /></el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<el-progress
|
||||
v-if="item.showProgress"
|
||||
:percentage="item.percentage"
|
||||
:show-text="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</vuedraggable>
|
||||
<div
|
||||
v-if="!isView"
|
||||
@@ -121,9 +143,13 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
handleCLickImg(val) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.selectedFormBtnName = val;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
callbackSelected(val) {
|
||||
this.picModelFlag = false;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
class="search-form"
|
||||
@keyup.enter="handleSearch"
|
||||
>
|
||||
<el-form-item label="关键字" prop="keywords" style="display: block; width: 100%">
|
||||
<el-form-item label="关键字" prop="keywords">
|
||||
<el-input
|
||||
v-model="searchForm.keywords"
|
||||
placeholder="请输入商品名称、订单编号搜索"
|
||||
@@ -61,17 +61,6 @@
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="售后类型">
|
||||
<el-select
|
||||
v-model="searchForm.serviceType"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option label="退款" value="RETURN_MONEY" />
|
||||
<el-option label="退货" value="RETURN_GOODS" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
||||
</el-form-item>
|
||||
@@ -129,13 +118,6 @@
|
||||
{{ $filters.unitPrice(row.applyRefundPrice, "¥") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售后类型" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row" :type="serviceTypeTagType(row.serviceType)">
|
||||
{{ serviceTypeText(row.serviceType) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售后状态" width="180">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row" :type="serviceStatusTagType(row.serviceStatus)">
|
||||
@@ -182,6 +164,7 @@ export default {
|
||||
order: "desc",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
serviceType: "RETURN_GOODS",
|
||||
orderSn: "",
|
||||
memberName: "",
|
||||
serviceStatus: "",
|
||||
@@ -240,22 +223,6 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
serviceTypeText(type) {
|
||||
const map = {
|
||||
RETURN_MONEY: "退款",
|
||||
RETURN_GOODS: "退货",
|
||||
EXCHANGE_GOODS: "换货",
|
||||
};
|
||||
return map[type] || type || "-";
|
||||
},
|
||||
serviceTypeTagType(type) {
|
||||
const map = {
|
||||
RETURN_MONEY: "primary",
|
||||
RETURN_GOODS: "warning",
|
||||
EXCHANGE_GOODS: "success",
|
||||
};
|
||||
return map[type] || "info";
|
||||
},
|
||||
serviceStatusText(status) {
|
||||
const map = {
|
||||
APPLY: "申请中",
|
||||
@@ -331,7 +298,7 @@ export default {
|
||||
detail(v) {
|
||||
const sn = v.sn;
|
||||
this.$filters.customRouterPush({
|
||||
name: "after-order-detail",
|
||||
name: "return-goods-order-detail",
|
||||
query: { sn: sn },
|
||||
});
|
||||
},
|
||||
|
||||
@@ -1,41 +1,126 @@
|
||||
<template>
|
||||
<div class="search">
|
||||
<el-card>
|
||||
<el-tabs v-model="activeTab" @tab-click="onTabClick">
|
||||
<el-tab-pane label="退款" name="RETURN_MONEY">
|
||||
<div class="operation" style="margin-bottom: 10px">
|
||||
<el-button type="primary" @click="add">添加</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="取消" name="CANCEL">
|
||||
<div class="operation" style="margin-bottom: 10px">
|
||||
<el-button type="primary" @click="add">添加</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="退货" name="RETURN_GOODS">
|
||||
<div class="operation" style="margin-bottom: 10px">
|
||||
<el-button type="primary" @click="add">添加</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="投诉" name="COMPLAIN">
|
||||
<div class="operation" style="margin-bottom: 10px">
|
||||
<el-button type="primary" @click="add">添加</el-button>
|
||||
<el-button @click="getDataList">刷新</el-button>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<el-form
|
||||
ref="searchForm"
|
||||
:model="searchForm"
|
||||
inline
|
||||
label-width="70px"
|
||||
class="search-form"
|
||||
@keyup.enter="handleSearch"
|
||||
>
|
||||
<el-form-item label="关键字" prop="keywords" style="display: block; width: 100%">
|
||||
<el-input
|
||||
v-model="searchForm.keywords"
|
||||
placeholder="请输入商品名称、订单编号搜索"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单编号" prop="orderSn">
|
||||
<el-input
|
||||
v-model="searchForm.orderSn"
|
||||
placeholder="请输入订单编号"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="售后单号" prop="sn">
|
||||
<el-input
|
||||
v-model="searchForm.sn"
|
||||
placeholder="请输入售后单号"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请时间">
|
||||
<el-date-picker
|
||||
v-model="selectDate"
|
||||
type="datetimerange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
clearable
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
style="width: 360px"
|
||||
@change="selectDateRange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会员名称" prop="memberName">
|
||||
<el-input
|
||||
v-model="searchForm.memberName"
|
||||
placeholder="请输入会员名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
||||
<el-button class="search-btn" @click="handleReset">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-table v-loading="loading" border :data="data" ref="table" style="width: 100%">
|
||||
<el-table-column prop="createBy" label="创建人" min-width="120" />
|
||||
<el-table-column prop="reason" label="原因" min-width="400" />
|
||||
<el-table-column prop="createTime" label="时间" min-width="100" />
|
||||
<el-table-column label="操作" width="200" align="center">
|
||||
<el-card>
|
||||
<div class="order-tab">
|
||||
<el-tabs v-model="currentStatus" @tab-click="onStatusTabClick">
|
||||
<el-tab-pane
|
||||
v-for="item in serviceStatusWithCount"
|
||||
:key="item.value"
|
||||
:label="item.title"
|
||||
:name="item.value"
|
||||
/>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
:data="data"
|
||||
class="mt_10"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="sn" label="售后服务单号" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="orderSn" label="订单编号" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="商品" min-width="300">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<a class="link-text" @click="edit(row)">编辑</a>
|
||||
<span class="op-split">|</span>
|
||||
<a class="link-text" @click="remove(row)">删除</a>
|
||||
</template>
|
||||
<div v-if="row" style="margin-top: 5px; height: 80px; display: flex">
|
||||
<div>
|
||||
<img
|
||||
:src="row.goodsImage"
|
||||
style="width: 60px; height: 60px; margin-top: 3px; object-fit: cover; border-radius: 4px"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<div style="margin-left: 13px">
|
||||
<div class="div-zoom">
|
||||
<a class="link-text" @click="linkTo(row.goodsId, row.skuId)">{{ row.goodsName }}</a>
|
||||
</div>
|
||||
<div style="color: #999; font-size: 12px; margin-top: 5px">
|
||||
商品ID: {{ row.goodsId }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="memberId" label="会员ID" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="memberName" label="会员名称" width="140" />
|
||||
<el-table-column label="售后金额" width="110">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.applyRefundPrice, "¥") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="售后状态" width="180">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row" :type="serviceStatusTagType(row.serviceStatus)">
|
||||
{{ serviceStatusText(row.serviceStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="createTime" label="申请时间" width="180" />
|
||||
<el-table-column label="操作" fixed="right" align="center" width="100">
|
||||
<template #default="{ row }">
|
||||
<a v-if="row" class="link-text" @click="detail(row)">查看</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -53,145 +138,198 @@
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-dialog v-model="modalVisible" :title="modalTitle" width="500px" :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" label-width="100px" :rules="formValidate">
|
||||
<el-form-item label="售后原因" prop="reason">
|
||||
<el-input v-model="form.reason" maxlength="20" clearable style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="modalVisible = false">取消</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="handleSubmit">提交</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as API_Order from "@/api/order";
|
||||
|
||||
const createDefaultSearchForm = () => ({
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
sort: "createTime",
|
||||
order: "desc",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
serviceType: "RETURN_MONEY",
|
||||
orderSn: "",
|
||||
memberName: "",
|
||||
serviceStatus: "",
|
||||
sn: "",
|
||||
keywords: "",
|
||||
});
|
||||
|
||||
export default {
|
||||
name: "returnMoneyOrder",
|
||||
data() {
|
||||
return {
|
||||
activeTab: "RETURN_MONEY",
|
||||
modalVisible: false,
|
||||
modalTitle: "",
|
||||
loading: true,
|
||||
submitLoading: false,
|
||||
form: { reason: "" },
|
||||
formValidate: {
|
||||
reason: [{ required: true, message: "请输入售后原因", trigger: "blur" }],
|
||||
},
|
||||
searchForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
sort: "createTime",
|
||||
order: "desc",
|
||||
serviceType: "RETURN_MONEY",
|
||||
},
|
||||
searchForm: createDefaultSearchForm(),
|
||||
selectDate: null,
|
||||
data: [],
|
||||
total: 0,
|
||||
currentStatus: "",
|
||||
afterSaleNumData: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
serviceStatusWithCount() {
|
||||
return [
|
||||
{ title: "全部", value: "" },
|
||||
{
|
||||
title: `申请售后${this.afterSaleNumData.applyNum ? "(" + this.afterSaleNumData.applyNum + ")" : ""}`,
|
||||
value: "APPLY",
|
||||
},
|
||||
{
|
||||
title: `通过售后${this.afterSaleNumData.passNum ? "(" + this.afterSaleNumData.passNum + ")" : ""}`,
|
||||
value: "PASS",
|
||||
},
|
||||
{
|
||||
title: `拒绝售后${this.afterSaleNumData.refuseNum ? "(" + this.afterSaleNumData.refuseNum + ")" : ""}`,
|
||||
value: "REFUSE",
|
||||
},
|
||||
{
|
||||
title: `完成售后${this.afterSaleNumData.completeNum ? "(" + this.afterSaleNumData.completeNum + ")" : ""}`,
|
||||
value: "COMPLETE",
|
||||
},
|
||||
{
|
||||
title: `卖家终止售后${this.afterSaleNumData.sellerTerminationNum ? "(" + this.afterSaleNumData.sellerTerminationNum + ")" : ""}`,
|
||||
value: "SELLER_TERMINATION",
|
||||
},
|
||||
{
|
||||
title: `买家取消售后${this.afterSaleNumData.buyerCancelNum ? "(" + this.afterSaleNumData.buyerCancelNum + ")" : ""}`,
|
||||
value: "BUYER_CANCEL",
|
||||
},
|
||||
{
|
||||
title: `等待平台退款${this.afterSaleNumData.waitRefundNum ? "(" + this.afterSaleNumData.waitRefundNum + ")" : ""}`,
|
||||
value: "WAIT_REFUND",
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
onTabClick(tab) {
|
||||
this.handleClickType(tab.paneName);
|
||||
serviceStatusText(status) {
|
||||
const map = {
|
||||
APPLY: "申请中",
|
||||
PASS: "通过售后",
|
||||
REFUSE: "拒绝售后",
|
||||
BUYER_RETURN: "买家退货,待卖家收货",
|
||||
SELLER_CONFIRM: "卖家确认收货",
|
||||
SELLER_TERMINATION: "卖家终止售后",
|
||||
BUYER_CANCEL: "买家取消售后",
|
||||
COMPLETE: "完成售后",
|
||||
WAIT_REFUND: "待平台退款",
|
||||
};
|
||||
return map[status] || status || "-";
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
serviceStatusTagType(status) {
|
||||
const map = {
|
||||
APPLY: "primary",
|
||||
PASS: "info",
|
||||
REFUSE: "warning",
|
||||
BUYER_RETURN: "warning",
|
||||
SELLER_CONFIRM: "",
|
||||
SELLER_TERMINATION: "success",
|
||||
BUYER_CANCEL: "danger",
|
||||
COMPLETE: "success",
|
||||
WAIT_REFUND: "primary",
|
||||
};
|
||||
return map[status] || "info";
|
||||
},
|
||||
init() {
|
||||
this.getDataList();
|
||||
this.getAfterSaleNumData();
|
||||
},
|
||||
changePage() {
|
||||
this.getDataList();
|
||||
},
|
||||
changePageSize(v) {
|
||||
changePageSize() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = v;
|
||||
this.getDataList();
|
||||
},
|
||||
handleClickType(v) {
|
||||
handleSearch() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.searchForm.pageSize = 20;
|
||||
this.searchForm.serviceType = v;
|
||||
this.getDataList();
|
||||
this.getAfterSaleNumData();
|
||||
},
|
||||
handleReset() {
|
||||
this.searchForm = createDefaultSearchForm();
|
||||
this.selectDate = null;
|
||||
this.currentStatus = "";
|
||||
this.getDataList();
|
||||
this.getAfterSaleNumData();
|
||||
},
|
||||
selectDateRange(v) {
|
||||
if (v) {
|
||||
this.searchForm.startDate = v[0];
|
||||
this.searchForm.endDate = v[1];
|
||||
} else {
|
||||
this.searchForm.startDate = "";
|
||||
this.searchForm.endDate = "";
|
||||
}
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
API_Order.getAfterSaleReasonPage(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
});
|
||||
},
|
||||
add() {
|
||||
this.form.reason = "";
|
||||
this.modalVisible = true;
|
||||
this.modalTitle = "添加售后原因";
|
||||
},
|
||||
edit(v) {
|
||||
this.form.reason = v.reason;
|
||||
this.form.id = v.id;
|
||||
this.modalVisible = true;
|
||||
this.modalTitle = "修改售后原因";
|
||||
},
|
||||
handleSubmit() {
|
||||
this.form.serviceType = this.searchForm.serviceType;
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.submitLoading = true;
|
||||
if (this.modalTitle == "添加售后原因") {
|
||||
delete this.form.id;
|
||||
API_Order.addAfterSaleReason(this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("添加成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
API_Order.editAfterSaleReason(this.form.id, this.form).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("修改成功");
|
||||
this.getDataList();
|
||||
this.modalVisible = false;
|
||||
}
|
||||
});
|
||||
API_Order.getAfterSaleOrderPage(this.searchForm)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
this.total = res.result.total;
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getAfterSaleNumData() {
|
||||
const { serviceStatus, ...searchParams } = this.searchForm;
|
||||
API_Order.getAfterSaleNumVO(searchParams).then((res) => {
|
||||
if (res.success) {
|
||||
this.afterSaleNumData = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
remove(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: "确认要删除此售后原因?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
API_Order.delAfterSaleReason(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("售后原因已删除");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
detail(v) {
|
||||
this.$filters.customRouterPush({
|
||||
name: "return-goods-order-detail",
|
||||
query: { sn: v.sn },
|
||||
});
|
||||
},
|
||||
onStatusTabClick(tab) {
|
||||
this.serviceStatusClick(tab.paneName);
|
||||
},
|
||||
serviceStatusClick(item) {
|
||||
this.currentStatus = item;
|
||||
if (item === "" || item === undefined) {
|
||||
delete this.searchForm.serviceStatus;
|
||||
} else {
|
||||
this.searchForm.serviceStatus = item;
|
||||
}
|
||||
this.getDataList();
|
||||
this.getAfterSaleNumData();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getDataList();
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.order-tab {
|
||||
:deep(.el-tabs__item) {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.link-text {
|
||||
color: #2d8cf0;
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
.op-split {
|
||||
display: inline-block;
|
||||
margin: 0 8px;
|
||||
color: #dcdee2;
|
||||
|
||||
.mt_10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<div class="main-content">
|
||||
<div class="div-flow-left">
|
||||
<div class="div-form-default">
|
||||
<h3>退货申请</h3>
|
||||
<h3>{{ sectionTitle }}</h3>
|
||||
<dl>
|
||||
<dt>退货商品</dt>
|
||||
<dt>{{ isRefundOnly ? '退款商品' : '退货商品' }}</dt>
|
||||
<dd>
|
||||
<div>
|
||||
<img :src="afterSaleInfo.goodsImage" style="height: 60px">
|
||||
@@ -23,11 +23,11 @@
|
||||
<dd>{{ afterSaleInfo.serviceName }}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>退货退款编号</dt>
|
||||
<dt>{{ isRefundOnly ? '退款编号' : '退货退款编号' }}</dt>
|
||||
<dd>{{ afterSaleInfo.sn }}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>退货退款原因</dt>
|
||||
<dt>{{ isRefundOnly ? '退款原因' : '退货退款原因' }}</dt>
|
||||
<dd>{{ afterSaleInfo.reason }}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
@@ -47,7 +47,7 @@
|
||||
<dd>{{ afterSaleInfo.refundPoint }}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>退货数量</dt>
|
||||
<dt>{{ isRefundOnly ? '退款数量' : '退货数量' }}</dt>
|
||||
<dd>{{ afterSaleInfo.num }}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
@@ -92,7 +92,7 @@
|
||||
<priceColorScheme :value="afterSaleInfo.applyRefundPrice" :color="$mainColor"></priceColorScheme>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dl v-if="params.serviceStatus === 'PASS'">
|
||||
<dt>实际退款金额</dt>
|
||||
<dd>
|
||||
<el-input-number :min="0" v-model="params.actualRefundPrice" style="width: 260px" />
|
||||
@@ -264,20 +264,36 @@
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>物流公司</dt>
|
||||
<dd>{{ afterSaleInfo.mlogisticsName }}</dd>
|
||||
<dd>{{ buyerLogisticsName }}</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>物流单号</dt>
|
||||
<dd>
|
||||
{{ afterSaleInfo.mlogisticsNo }}
|
||||
{{ buyerLogisticsNo }}
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>操作</dt>
|
||||
<dd>
|
||||
<el-button
|
||||
v-if="canConfirmReceipt"
|
||||
type="danger"
|
||||
:loading="confirmLoading"
|
||||
@click="sellerConfirmSubmit('PASS')"
|
||||
style="margin-left: 5px"
|
||||
>
|
||||
确认收货
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="canConfirmReceipt"
|
||||
type="primary"
|
||||
plain
|
||||
:loading="confirmLoading"
|
||||
@click="sellerConfirmSubmit('REFUSE')"
|
||||
style="margin-left: 5px"
|
||||
>
|
||||
拒收
|
||||
</el-button>
|
||||
<el-button
|
||||
:loading="submitLoading"
|
||||
@click="logisticsSeller()"
|
||||
style="margin-left: 5px"
|
||||
@@ -302,13 +318,13 @@
|
||||
<dl>
|
||||
<dt>物流公司:</dt>
|
||||
<dd>
|
||||
<div class="text-box">{{ afterSaleInfo.mlogisticsName }}</div>
|
||||
<div class="text-box">{{ buyerLogisticsName }}</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>物流单号:</dt>
|
||||
<dd>
|
||||
<div class="text-box">{{ afterSaleInfo.mlogisticsNo }}</div>
|
||||
<div class="text-box">{{ buyerLogisticsNo }}</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="div-express-log">
|
||||
@@ -349,6 +365,7 @@ export default {
|
||||
afterSaleInfo: {}, // 售后信息
|
||||
afterSaleImage: [], //会员申诉图片
|
||||
submitLoading: false, // 添加或编辑提交状态
|
||||
confirmLoading: false, // 确认收货提交状态
|
||||
storeMsg: {}, // 商家地址信息
|
||||
//商家处理意见
|
||||
params: {
|
||||
@@ -359,6 +376,36 @@ export default {
|
||||
refundPriceForm: {
|
||||
remark: "",
|
||||
},
|
||||
afterSaleRefundStatusList: [
|
||||
{
|
||||
name: "退款申请",
|
||||
status: "APPLY",
|
||||
},
|
||||
{
|
||||
name: "通过售后",
|
||||
status: "PASS",
|
||||
},
|
||||
{
|
||||
name: "拒绝售后",
|
||||
status: "REFUSE",
|
||||
},
|
||||
{
|
||||
name: "卖家终止售后",
|
||||
status: "SELLER_TERMINATION",
|
||||
},
|
||||
{
|
||||
name: "买家取消售后",
|
||||
status: "BUYER_CANCEL",
|
||||
},
|
||||
{
|
||||
name: "完成售后",
|
||||
status: "COMPLETE",
|
||||
},
|
||||
{
|
||||
name: "待平台退款",
|
||||
status: "WAIT_REFUND",
|
||||
},
|
||||
],
|
||||
afterSaleStatusList: [
|
||||
// 售后状态列表
|
||||
{
|
||||
@@ -400,6 +447,37 @@ export default {
|
||||
],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
isRefundOnly() {
|
||||
return this.afterSaleInfo.serviceType === "RETURN_MONEY";
|
||||
},
|
||||
sectionTitle() {
|
||||
return this.isRefundOnly ? "退款申请" : "退货申请";
|
||||
},
|
||||
buyerLogisticsName() {
|
||||
const info = this.afterSaleInfo;
|
||||
return (
|
||||
info.mLogisticsName ||
|
||||
info.mlogisticsName ||
|
||||
this.logisticsInfo.shipper ||
|
||||
"-"
|
||||
);
|
||||
},
|
||||
buyerLogisticsNo() {
|
||||
const info = this.afterSaleInfo;
|
||||
return (
|
||||
info.mLogisticsNo ||
|
||||
info.mlogisticsNo ||
|
||||
this.logisticsInfo.logisticCode ||
|
||||
"-"
|
||||
);
|
||||
},
|
||||
canConfirmReceipt() {
|
||||
const vo = this.afterSaleInfo.afterSaleAllowOperationVO;
|
||||
if (vo && vo.rog) return true;
|
||||
return this.afterSaleInfo.serviceStatus === "BUYER_RETURN";
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
// 获取售后详情
|
||||
getDetail() {
|
||||
@@ -463,12 +541,39 @@ export default {
|
||||
//查询物流
|
||||
logisticsSeller() {
|
||||
this.logisticsModal = true;
|
||||
this.logisticsInfo = {};
|
||||
API_Order.getAfterSaleTraces(this.sn).then((res) => {
|
||||
if (res.success && res.result != null) {
|
||||
this.logisticsInfo = res.result;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 商家确认收货 / 拒收
|
||||
sellerConfirmSubmit(type) {
|
||||
const isPass = type === "PASS";
|
||||
this.$Modal.confirm({
|
||||
title: isPass ? "确认收货" : "确认拒收",
|
||||
content: isPass ? "请确认已经收到退货货物?" : "确认拒收此货物?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
this.confirmLoading = true;
|
||||
API_Order.afterSaleSellerConfirm(this.sn, {
|
||||
serviceStatus: type,
|
||||
remark: this.params.remark || "",
|
||||
}).then((res) => {
|
||||
this.$Modal.remove();
|
||||
this.confirmLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success(isPass ? "收货成功" : "拒收成功");
|
||||
this.getDetail();
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$Modal.remove();
|
||||
this.confirmLoading = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
//关闭物流弹出框
|
||||
logisticsClose() {
|
||||
this.logisticsModal = false;
|
||||
@@ -479,7 +584,7 @@ export default {
|
||||
this.$Message.error("请输入备注信息");
|
||||
return;
|
||||
}
|
||||
if (this.params.actualRefundPrice == "") {
|
||||
if (this.params.serviceStatus === "PASS" && this.params.actualRefundPrice === "") {
|
||||
this.$Message.error("请输入退款金额");
|
||||
return;
|
||||
}
|
||||
@@ -493,10 +598,11 @@ export default {
|
||||
});
|
||||
},
|
||||
filterOrderStatus(status) {
|
||||
// 获取订单状态中文
|
||||
const ob = this.afterSaleStatusList.filter((e) => {
|
||||
return e.status === status;
|
||||
});
|
||||
const list =
|
||||
this.afterSaleInfo.serviceType === "RETURN_MONEY"
|
||||
? this.afterSaleRefundStatusList
|
||||
: this.afterSaleStatusList;
|
||||
const ob = list.filter((e) => e.status === status);
|
||||
return ob.length > 0 ? ob[0].name : status;
|
||||
},
|
||||
// 根据订单状态判断是否显示物流信息
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<el-button v-if="allowOperation.editConsignee" plain type="primary" @click="editAddress">修改收货地址</el-button>
|
||||
<el-button v-if="allowOperation.cancel" plain type="warning" @click="orderCancel">订单取消</el-button>
|
||||
<el-button v-if="orderInfo.order.orderStatus === 'UNPAID'" type="primary" @click="confirmPrice">收款</el-button>
|
||||
<el-button v-if="canOrderTake" type="primary" @click="orderTake">订单核验</el-button>
|
||||
<el-button plain @click="orderLog">订单日志</el-button>
|
||||
<el-button v-if="canPartDelivery" type="primary" @click="openPartDelivery">分包裹发货</el-button>
|
||||
<el-button v-if="$route.query.orderType != 'VIRTUAL'" plain type="primary" style="float:right;" @click="printOrder">打印发货单</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
@@ -37,6 +39,10 @@
|
||||
{{ orderInfo.order.createTime }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-item" v-if="orderInfo.order.verificationCode">
|
||||
<div class="div-item-left">核验码:</div>
|
||||
<div class="div-item-right">{{ orderInfo.order.verificationCode }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 30%; float: left; margin-left: 20px">
|
||||
<div class="div-item" v-if="orderInfo.order.needReceipt == false">
|
||||
@@ -366,6 +372,59 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="partDeliveryModal" title="分包裹发货" width="760px">
|
||||
<el-form ref="partDeliveryForm" :model="partDeliveryForm" label-width="100px" :rules="partDeliveryRules">
|
||||
<el-form-item label="物流公司" prop="logisticsId">
|
||||
<el-select v-model="partDeliveryForm.logisticsId" placeholder="请选择物流公司" filterable style="width: 260px">
|
||||
<el-option
|
||||
v-for="item in checkedLogistics"
|
||||
:key="getLogisticsId(item)"
|
||||
:label="getLogisticsName(item)"
|
||||
:value="getLogisticsId(item)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="物流单号" prop="logisticsNo">
|
||||
<el-input v-model="partDeliveryForm.logisticsNo" placeholder="请输入物流单号" style="width: 260px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发货商品" prop="partDeliveryDTOList">
|
||||
<div class="delivery-item-group">
|
||||
<div v-for="item in deliverableOrderItems" :key="getOrderItemId(item)" class="delivery-item">
|
||||
<el-checkbox
|
||||
:model-value="isPartDeliveryItemSelected(item)"
|
||||
@change="(checked) => togglePartDeliveryItem(item, checked)"
|
||||
>
|
||||
<span class="delivery-item-name">{{ item.goodsName }}</span>
|
||||
<span class="delivery-item-num">订单数量 x{{ item.num }}</span>
|
||||
</el-checkbox>
|
||||
<el-input-number
|
||||
v-model="partDeliveryForm.deliveryNumMap[getOrderItemId(item)]"
|
||||
:disabled="!isPartDeliveryItemSelected(item)"
|
||||
:min="1"
|
||||
:max="getMaxDeliveryNum(item)"
|
||||
:precision="0"
|
||||
controls-position="right"
|
||||
size="small"
|
||||
class="delivery-num-input"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="!deliverableOrderItems.length" class="delivery-empty">暂无可发货商品</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div v-if="orderPackages.length" class="package-list">
|
||||
<div class="package-title">已有包裹</div>
|
||||
<el-table :data="orderPackages" border size="small">
|
||||
<el-table-column prop="logisticsName" label="物流公司" min-width="120" />
|
||||
<el-table-column prop="logisticsNo" label="物流单号" min-width="160" />
|
||||
</el-table>
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="partDeliveryModal = false">关闭</el-button>
|
||||
<el-button type="primary" :loading="partDeliverySubmitting" @click="submitPartDelivery">确认发货</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="printModal" width="530px" @close="printCancel">
|
||||
<template #header>
|
||||
<div style="line-height:26px;height:26px;">
|
||||
@@ -427,12 +486,23 @@
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<el-dialog v-model="orderTakeModal" title="订单核验" width="530px">
|
||||
<el-form ref="orderTakeForm" :model="orderTakeForm" label-width="100px" :rules="orderTakeValidate">
|
||||
<el-form-item label="核验码" prop="qrCode">
|
||||
<el-input v-model="orderTakeForm.qrCode" placeholder="请输入核验码" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="orderTakeModal = false">取消</el-button>
|
||||
<el-button type="primary" @click="orderTakeSubmit">核验</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<multipleMap ref="map" @callback="selectedRegion" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as API_Logistics from "@/api/logistics";
|
||||
import * as API_Order from "@/api/order";
|
||||
import * as RegExp from "@/libs/RegExp.js";
|
||||
|
||||
@@ -487,6 +557,15 @@ export default {
|
||||
logisticsNo: "", //发货单号
|
||||
logisticsId: "", //物流公司
|
||||
},
|
||||
partDeliveryModal: false,
|
||||
partDeliverySubmitting: false,
|
||||
partDeliveryForm: {
|
||||
logisticsNo: "",
|
||||
logisticsId: "",
|
||||
selectedOrderItemIds: [],
|
||||
deliveryNumMap: {},
|
||||
},
|
||||
orderPackages: [],
|
||||
//验证要调整的订单金额
|
||||
modifyPriceValidate: {
|
||||
reason: [
|
||||
@@ -505,6 +584,13 @@ export default {
|
||||
},
|
||||
addressModal: false, //弹出修改收件信息框
|
||||
printModal: false,
|
||||
orderTakeModal: false,
|
||||
orderTakeForm: {
|
||||
qrCode: "",
|
||||
},
|
||||
orderTakeValidate: {
|
||||
qrCode: [{ required: true, message: "核验码不能为空", trigger: "blur" }],
|
||||
},
|
||||
//收件地址表单
|
||||
addressForm: {
|
||||
consigneeName: "",
|
||||
@@ -517,6 +603,10 @@ export default {
|
||||
logisticsNo: [{ required: true, message: "发货单号不能为空", trigger: "change" }],
|
||||
logisticsId: [{ required: true, message: "请选择物流公司", trigger: "blur" }],
|
||||
},
|
||||
partDeliveryRules: {
|
||||
logisticsNo: [{ required: true, message: "发货单号不能为空", trigger: "change" }],
|
||||
logisticsId: [{ required: true, message: "请选择物流公司", trigger: "change" }],
|
||||
},
|
||||
addressRule: {
|
||||
consigneeName: [
|
||||
{ required: true, message: "收货人姓名不能为空", trigger: "blur" },
|
||||
@@ -537,6 +627,28 @@ export default {
|
||||
data: [], // 表单数据
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
canPartDelivery() {
|
||||
const status = this.orderInfo.order && this.orderInfo.order.orderStatus;
|
||||
return (
|
||||
this.$route.query.orderType !== "VIRTUAL" &&
|
||||
["UNDELIVERED", "PARTS_DELIVERED"].includes(status) &&
|
||||
this.deliverableOrderItems.length > 0
|
||||
);
|
||||
},
|
||||
deliverableOrderItems() {
|
||||
return (this.data || []).filter((item) => this.getOrderItemId(item));
|
||||
},
|
||||
canOrderTake() {
|
||||
if (this.allowOperation.take) return true;
|
||||
const order = this.orderInfo?.order;
|
||||
if (!order) return false;
|
||||
const isVirtual =
|
||||
this.$route.query.orderType === "VIRTUAL" ||
|
||||
order.orderType === "VIRTUAL";
|
||||
return isVirtual && order.orderStatus === "TAKE";
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
$route (to, from) {
|
||||
this.$router.go(0);
|
||||
@@ -558,6 +670,106 @@ export default {
|
||||
gotoHomes () {
|
||||
return false
|
||||
},
|
||||
getOrderItemId(item) {
|
||||
return item && (item.id || item.orderItemId || item.sn);
|
||||
},
|
||||
getLogisticsId(item) {
|
||||
return item && (item.logisticsId || item.id);
|
||||
},
|
||||
getLogisticsName(item) {
|
||||
return item && (item.logisticsName || item.name || item.logisticsCompany || item.logisticsId || item.id);
|
||||
},
|
||||
getMaxDeliveryNum(item) {
|
||||
const num = Number(item && item.num);
|
||||
return Number.isFinite(num) && num > 0 ? num : 999999;
|
||||
},
|
||||
isPartDeliveryItemSelected(item) {
|
||||
const id = this.getOrderItemId(item);
|
||||
return !!id && this.partDeliveryForm.selectedOrderItemIds.includes(id);
|
||||
},
|
||||
togglePartDeliveryItem(item, checked) {
|
||||
const id = this.getOrderItemId(item);
|
||||
if (!id) return;
|
||||
if (checked) {
|
||||
if (!this.partDeliveryForm.selectedOrderItemIds.includes(id)) {
|
||||
this.partDeliveryForm.selectedOrderItemIds.push(id);
|
||||
}
|
||||
if (!this.partDeliveryForm.deliveryNumMap[id]) {
|
||||
this.partDeliveryForm.deliveryNumMap[id] = this.getMaxDeliveryNum(item);
|
||||
}
|
||||
return;
|
||||
}
|
||||
this.partDeliveryForm.selectedOrderItemIds = this.partDeliveryForm.selectedOrderItemIds.filter((itemId) => itemId !== id);
|
||||
delete this.partDeliveryForm.deliveryNumMap[id];
|
||||
},
|
||||
buildPartDeliveryDTOList() {
|
||||
return this.partDeliveryForm.selectedOrderItemIds
|
||||
.map((orderItemId) => ({
|
||||
orderItemId,
|
||||
deliveryNum: Number(this.partDeliveryForm.deliveryNumMap[orderItemId]),
|
||||
}))
|
||||
.filter((item) => item.orderItemId && item.deliveryNum > 0);
|
||||
},
|
||||
resetPartDeliveryForm() {
|
||||
this.partDeliveryForm = {
|
||||
logisticsNo: "",
|
||||
logisticsId: "",
|
||||
selectedOrderItemIds: [],
|
||||
deliveryNumMap: {},
|
||||
};
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.partDeliveryForm) {
|
||||
this.$refs.partDeliveryForm.clearValidate();
|
||||
}
|
||||
});
|
||||
},
|
||||
openPartDelivery() {
|
||||
this.resetPartDeliveryForm();
|
||||
this.partDeliveryModal = true;
|
||||
this.getCheckedLogistics();
|
||||
this.getOrderPackages();
|
||||
},
|
||||
getCheckedLogistics() {
|
||||
API_Order.getLogisticsChecked().then((res) => {
|
||||
if (res.success) {
|
||||
this.checkedLogistics = Array.isArray(res.result) ? res.result : [];
|
||||
}
|
||||
});
|
||||
},
|
||||
getOrderPackages() {
|
||||
API_Order.getPackage(this.sn).then((res) => {
|
||||
if (res.success) {
|
||||
this.orderPackages = Array.isArray(res.result) ? res.result : [];
|
||||
}
|
||||
});
|
||||
},
|
||||
submitPartDelivery() {
|
||||
this.$refs.partDeliveryForm.validate((valid) => {
|
||||
if (!valid) return;
|
||||
const partDeliveryDTOList = this.buildPartDeliveryDTOList();
|
||||
if (!partDeliveryDTOList.length) {
|
||||
this.$Message.error("请选择本次发货商品并填写发货数量");
|
||||
return;
|
||||
}
|
||||
this.partDeliverySubmitting = true;
|
||||
API_Order.partDelivery(this.sn, {
|
||||
orderSn: this.sn,
|
||||
logisticsNo: this.partDeliveryForm.logisticsNo,
|
||||
logisticsId: this.partDeliveryForm.logisticsId,
|
||||
partDeliveryDTOList,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("发货成功");
|
||||
this.partDeliveryModal = false;
|
||||
this.getDataList();
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
this.partDeliverySubmitting = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
//确认收款
|
||||
confirmPrice () {
|
||||
@@ -602,7 +814,7 @@ export default {
|
||||
// 获取订单详情
|
||||
getDataList () {
|
||||
this.loading = true;
|
||||
API_Order.orderDetail(this.sn).then((res) => {
|
||||
API_Order.getOrderDetail(this.sn).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.orderInfo = res.result;
|
||||
@@ -623,7 +835,7 @@ export default {
|
||||
modifyPriceSubmit () {
|
||||
this.$refs.modifyPriceForm.validate((valid) => {
|
||||
if (valid) {
|
||||
API_Order.updateOrderPrice(this.sn, this.modifyPriceForm).then((res) => {
|
||||
API_Order.modifyOrderPrice(this.sn, this.modifyPriceForm).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("修改订单金额成功");
|
||||
this.modal = false;
|
||||
@@ -655,7 +867,7 @@ export default {
|
||||
orderCancelSubmit () {
|
||||
this.$refs.orderCancelForm.validate((valid) => {
|
||||
if (valid) {
|
||||
API_Order.orderCancel(this.sn, this.orderCancelForm).then((res) => {
|
||||
API_Order.cancelOrder(this.sn, this.orderCancelForm).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("取消成功");
|
||||
this.getDataList();
|
||||
@@ -673,6 +885,25 @@ export default {
|
||||
handelCancel () {
|
||||
this.orderLogModal = false;
|
||||
},
|
||||
orderTake() {
|
||||
this.orderTakeForm.qrCode = this.orderInfo.order.verificationCode || "";
|
||||
this.orderTakeModal = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.orderTakeForm?.clearValidate();
|
||||
});
|
||||
},
|
||||
orderTakeSubmit() {
|
||||
this.$refs.orderTakeForm.validate((valid) => {
|
||||
if (!valid) return;
|
||||
API_Order.orderTake(this.sn, this.orderTakeForm.qrCode).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("订单核验成功");
|
||||
this.orderTakeModal = false;
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
//打印发货单
|
||||
printOrder () {
|
||||
this.printModal = true;
|
||||
@@ -734,6 +965,54 @@ export default {
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.delivery-item-group {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.delivery-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
margin: 0 0 8px 0;
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.delivery-item-name {
|
||||
display: inline-block;
|
||||
max-width: 420px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
vertical-align: middle;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.delivery-item-num {
|
||||
margin-left: 12px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.delivery-num-input {
|
||||
width: 120px;
|
||||
margin-left: 12px;
|
||||
}
|
||||
|
||||
.delivery-empty {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.package-list {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.package-title {
|
||||
margin-bottom: 8px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.flex-card {
|
||||
display: flex;
|
||||
height: 600px;
|
||||
|
||||
@@ -232,17 +232,12 @@
|
||||
|
||||
<script>
|
||||
import { saveShopCoupon, getShopCoupon, editShopCoupon } from "@/api/promotion";
|
||||
import {
|
||||
savePlatformCoupon,
|
||||
getPlatformCoupon,
|
||||
editPlatformCoupon,
|
||||
} from "@/api/promotion";
|
||||
import { getGoodsCategoryAll } from "@/api/goods";
|
||||
import { regular } from "@/utils";
|
||||
import skuSelect from "@/views/lili-dialog";
|
||||
|
||||
export default {
|
||||
name: "edit-platform-coupon",
|
||||
name: "add-coupon",
|
||||
components: {
|
||||
skuSelect,
|
||||
},
|
||||
@@ -360,7 +355,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getCoupon() {
|
||||
getPlatformCoupon(this.id).then((res) => {
|
||||
getShopCoupon(this.id).then((res) => {
|
||||
let data = res.result;
|
||||
if (!data.promotionGoodsList) data.promotionGoodsList = [];
|
||||
this.rangeTimeType = data.rangeDayType === "DYNAMICTIME" ? 0 : 1;
|
||||
@@ -453,7 +448,7 @@ export default {
|
||||
if (this.modalType === 0) {
|
||||
delete params.id;
|
||||
|
||||
savePlatformCoupon(params).then((res) => {
|
||||
saveShopCoupon(params).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("优惠券发送成功");
|
||||
@@ -464,7 +459,7 @@ export default {
|
||||
delete params.consumeLimit;
|
||||
delete params.updateTime;
|
||||
|
||||
editPlatformCoupon(params).then((res) => {
|
||||
editShopCoupon(params).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("优惠券修改成功");
|
||||
@@ -476,7 +471,7 @@ export default {
|
||||
});
|
||||
},
|
||||
closeCurrentPage() {
|
||||
this.$store.commit("removeTag", "add-platform-coupon");
|
||||
this.$store.commit("removeTag", "add-coupon");
|
||||
localStorage.pageOpenedList = JSON.stringify(this.$store.state.app.pageOpenedList);
|
||||
this.$router.go(-1);
|
||||
},
|
||||
@@ -535,7 +530,7 @@ export default {
|
||||
this.form.promotionGoodsList = list;
|
||||
},
|
||||
async getCagetoryList() {
|
||||
let data = await getCategoryTree();
|
||||
let data = await getGoodsCategoryAll();
|
||||
this.goodsCategoryList = data.result;
|
||||
this.goodsCategoryList = this.goodsCategoryList.map((item) => {
|
||||
if (item.children) {
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
<div class="operation padding-row" v-if="getType !== 'ACTIVITY'">
|
||||
<el-button type="primary" @click="add">添加优惠券</el-button>
|
||||
<el-button @click="delAll">批量关闭</el-button>
|
||||
<el-button type="info" @click="receivePage()">优惠券领取记录</el-button>
|
||||
<el-button type="warning" @click="receivePage()">优惠券领取记录</el-button>
|
||||
</div>
|
||||
|
||||
<el-table
|
||||
@@ -182,11 +182,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getShopCouponList, updateCouponStatus } from "@/api/promotion";
|
||||
import {
|
||||
getPlatformCouponList,
|
||||
updatePlatformCouponStatus,
|
||||
deletePlatformCoupon,
|
||||
getShopCouponList,
|
||||
updateCouponStatus,
|
||||
deleteShopCoupon,
|
||||
} from "@/api/promotion";
|
||||
import { formatPromotionCouponValidityHtml } from "@/utils/promotions";
|
||||
|
||||
@@ -223,6 +222,7 @@ export default {
|
||||
selectDate: [],
|
||||
showActionColumn: true,
|
||||
showStatusColumn: true,
|
||||
isSyncingSelection: false,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -233,6 +233,8 @@ export default {
|
||||
},
|
||||
selectedList: {
|
||||
handler(val) {
|
||||
if (this.isSyncingSelection) return;
|
||||
if (this.isSameSelection(val, this.selectList)) return;
|
||||
this.$nextTick(() => {
|
||||
this.syncTableSelection(val);
|
||||
});
|
||||
@@ -312,15 +314,31 @@ export default {
|
||||
};
|
||||
return map[type] || "";
|
||||
},
|
||||
isSameSelection(next, current) {
|
||||
const a = next || [];
|
||||
const b = current || [];
|
||||
if (a.length !== b.length) return false;
|
||||
const nextIds = a.map((item) => item.id).sort().join(",");
|
||||
const currentIds = b.map((item) => item.id).sort().join(",");
|
||||
return nextIds === currentIds;
|
||||
},
|
||||
syncTableSelection(selected) {
|
||||
const table = this.$refs.table;
|
||||
if (!table) return;
|
||||
const nextList = selected ? [...selected] : [];
|
||||
this.isSyncingSelection = true;
|
||||
table.clearSelection();
|
||||
if (!selected || !selected.length) return;
|
||||
this.data.forEach((row) => {
|
||||
if (selected.some((item) => item.id === row.id)) {
|
||||
table.toggleRowSelection(row, true);
|
||||
}
|
||||
if (nextList.length) {
|
||||
this.data.forEach((row) => {
|
||||
if (nextList.some((item) => item.id === row.id)) {
|
||||
table.toggleRowSelection(row, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
this.selectList = nextList;
|
||||
this.selectCount = nextList.length;
|
||||
this.$nextTick(() => {
|
||||
this.isSyncingSelection = false;
|
||||
});
|
||||
},
|
||||
check() {
|
||||
@@ -337,7 +355,7 @@ export default {
|
||||
this.getDataList();
|
||||
},
|
||||
add() {
|
||||
this.$router.push({ name: "add-platform-coupon" });
|
||||
this.$router.push({ name: "add-coupon" });
|
||||
},
|
||||
changePage(v) {
|
||||
this.searchForm.pageNumber = v;
|
||||
@@ -357,6 +375,7 @@ export default {
|
||||
this.$refs.table?.clearSelection();
|
||||
},
|
||||
changeSelect(e) {
|
||||
if (this.isSyncingSelection) return;
|
||||
this.selectList = e;
|
||||
this.selectCount = e.length;
|
||||
if (this.getType === "ACTIVITY") this.check();
|
||||
@@ -370,7 +389,7 @@ export default {
|
||||
this.searchForm.startTime = null;
|
||||
this.searchForm.endTime = null;
|
||||
}
|
||||
getPlatformCouponList(this.searchForm)
|
||||
getShopCouponList(this.searchForm)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
@@ -388,7 +407,7 @@ export default {
|
||||
},
|
||||
see(v, only) {
|
||||
const data = only ? { onlyView: true, id: v.id } : { id: v.id };
|
||||
this.$router.push({ name: "edit-platform-coupon", query: data });
|
||||
this.$router.push({ name: "add-coupon", query: data });
|
||||
},
|
||||
close(v) {
|
||||
this.$Modal.confirm({
|
||||
@@ -396,7 +415,7 @@ export default {
|
||||
content: "确认要关闭此优惠券么?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
updatePlatformCouponStatus({
|
||||
updateCouponStatus({
|
||||
couponIds: v.id,
|
||||
effectiveDays: 0,
|
||||
})
|
||||
@@ -419,7 +438,7 @@ export default {
|
||||
content: "确认要删除此优惠券么?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
deletePlatformCoupon(v.id)
|
||||
deleteShopCoupon(v.id)
|
||||
.then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
@@ -444,7 +463,7 @@ export default {
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
const ids = this.selectList.map((e) => e.id);
|
||||
updatePlatformCouponStatus({
|
||||
updateCouponStatus({
|
||||
couponIds: ids.toString(),
|
||||
promotionStatus: "CLOSE",
|
||||
}).then((res) => {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-card>
|
||||
<el-form ref="form" :model="form" label-width="120px">
|
||||
<el-form ref="form" :model="form" label-width="120px" :rules="formRule">
|
||||
<div class="base-info-item">
|
||||
<h4>基本信息</h4>
|
||||
<div class="form-item-view">
|
||||
<el-form-item label="活动名称" prop="promotionName">
|
||||
<el-input
|
||||
v-model="form.promotionName"
|
||||
disabled
|
||||
:disabled="fieldDisabled"
|
||||
placeholder="活动名称"
|
||||
clearable
|
||||
style="width: 260px"
|
||||
@@ -18,7 +18,7 @@
|
||||
<el-date-picker
|
||||
type="datetimerange"
|
||||
v-model="form.rangeTime"
|
||||
disabled
|
||||
:disabled="fieldDisabled"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
@@ -30,7 +30,7 @@
|
||||
<el-form-item label="活动描述" prop="description">
|
||||
<el-input
|
||||
v-model="form.description"
|
||||
disabled
|
||||
:disabled="fieldDisabled"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
clearable
|
||||
@@ -44,17 +44,17 @@
|
||||
<el-form-item label="优惠门槛" prop="fullMoney">
|
||||
<el-input
|
||||
v-model="form.fullMoney"
|
||||
disabled
|
||||
:disabled="fieldDisabled"
|
||||
placeholder="优惠门槛"
|
||||
clearable
|
||||
style="width: 260px"
|
||||
/>
|
||||
<span class="describe">消费达到当前金额可以参与优惠</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="赠送优惠券">
|
||||
<el-radio-group v-model="form.discountType">
|
||||
<el-radio-button value="fullMinusFlag" disabled>减现金</el-radio-button>
|
||||
<el-radio-button value="fullRateFlag" disabled>打折</el-radio-button>
|
||||
<el-form-item label="优惠方式">
|
||||
<el-radio-group v-model="form.discountType" :disabled="fieldDisabled">
|
||||
<el-radio-button value="fullMinusFlag">减现金</el-radio-button>
|
||||
<el-radio-button value="fullRateFlag">打折</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
@@ -63,7 +63,7 @@
|
||||
prop="fullMinus"
|
||||
>
|
||||
<el-input
|
||||
disabled
|
||||
:disabled="fieldDisabled"
|
||||
v-model="form.fullMinus"
|
||||
placeholder="优惠金额"
|
||||
clearable
|
||||
@@ -76,26 +76,27 @@
|
||||
prop="fullRate"
|
||||
>
|
||||
<el-input-number
|
||||
:disabled="fieldDisabled"
|
||||
v-model="form.fullRate"
|
||||
placeholder="优惠折扣"
|
||||
:max="9.9"
|
||||
:min="0.1"
|
||||
:max="9.9"
|
||||
:step="0.1"
|
||||
:precision="1"
|
||||
v-model="form.fullRate"
|
||||
style="width: 260px"
|
||||
/>
|
||||
<span class="describe">优惠折扣为0-10之间数字,可有一位小数</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="额外赠送">
|
||||
<el-checkbox v-model="form.freeFreightFlag" disabled>免邮费</el-checkbox>
|
||||
<el-checkbox v-model="form.couponFlag" disabled>送优惠券</el-checkbox>
|
||||
<el-checkbox v-model="form.giftFlag" disabled>送赠品</el-checkbox>
|
||||
<el-checkbox v-model="form.pointFlag" disabled>送积分</el-checkbox>
|
||||
<el-checkbox v-model="form.freeFreightFlag" :disabled="fieldDisabled">免邮费</el-checkbox>
|
||||
<el-checkbox v-model="form.couponFlag" :disabled="fieldDisabled">送优惠券</el-checkbox>
|
||||
<el-checkbox v-model="form.giftFlag" :disabled="fieldDisabled">送赠品</el-checkbox>
|
||||
<el-checkbox v-model="form.pointFlag" :disabled="fieldDisabled">送积分</el-checkbox>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="form.couponFlag" label="赠送优惠券" prop="couponId">
|
||||
<el-select
|
||||
v-model="form.couponId"
|
||||
:disabled="form.promotionStatus != 'NEW'"
|
||||
:disabled="fieldDisabled"
|
||||
filterable
|
||||
remote
|
||||
:remote-method="getCouponList"
|
||||
@@ -118,7 +119,7 @@
|
||||
remote
|
||||
:remote-method="getGiftList"
|
||||
placeholder="输入赠品名称搜索"
|
||||
disabled
|
||||
:disabled="fieldDisabled"
|
||||
:loading="giftLoading"
|
||||
style="width: 260px"
|
||||
>
|
||||
@@ -134,23 +135,36 @@
|
||||
<el-input
|
||||
v-model="form.point"
|
||||
type="number"
|
||||
disabled
|
||||
:disabled="fieldDisabled"
|
||||
style="width: 260px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用范围" prop="scopeType">
|
||||
<el-radio-group v-model="form.scopeType">
|
||||
<el-radio-button value="ALL" disabled>全品类</el-radio-button>
|
||||
<el-radio-button value="PORTION_GOODS" disabled>指定商品</el-radio-button>
|
||||
<el-radio-group v-model="form.scopeType" :disabled="fieldDisabled">
|
||||
<el-radio-button value="ALL">全品类</el-radio-button>
|
||||
<el-radio-button value="PORTION_GOODS">指定商品</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
style="width: 100%"
|
||||
v-if="form.scopeType == 'PORTION_GOODS'"
|
||||
>
|
||||
<el-table border :data="form.promotionGoodsList" style="width: 100%">
|
||||
<el-table-column type="selection" width="60" align="center" />
|
||||
<el-form-item style="width: 100%" v-if="form.scopeType == 'PORTION_GOODS'">
|
||||
<div v-if="!fieldDisabled" style="display: flex; margin-bottom: 10px">
|
||||
<el-button type="primary" @click="openSkuList">选择商品</el-button>
|
||||
<el-button type="danger" plain style="margin-left: 10px" @click="delSelectGoods">
|
||||
批量删除
|
||||
</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
border
|
||||
:data="form.promotionGoodsList"
|
||||
style="width: 100%"
|
||||
@selection-change="changeSelect"
|
||||
>
|
||||
<el-table-column
|
||||
v-if="!fieldDisabled"
|
||||
type="selection"
|
||||
width="60"
|
||||
align="center"
|
||||
/>
|
||||
<el-table-column label="商品名称" min-width="120" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
@@ -190,40 +204,95 @@
|
||||
<span v-if="row">{{ row.quantity }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column v-if="!fieldDisabled" label="操作" width="100" align="center">
|
||||
<template #default="{ $index }">
|
||||
<a class="link-text" @click="delGoods($index)">删除</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-form-item>
|
||||
|
||||
<div>
|
||||
<el-button @click="$router.push({ name: 'promotions/full-discount' })">返回</el-button>
|
||||
<el-button @click="closeCurrentPage">返回</el-button>
|
||||
<el-button
|
||||
v-if="!fieldDisabled"
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<liliDialog ref="liliDialog" @selectedGoodsData="selectedGoodsData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPlatformCouponList, getFullDiscountById } from "@/api/promotion";
|
||||
import {
|
||||
getShopCouponList,
|
||||
getFullDiscountById,
|
||||
newFullDiscount,
|
||||
editFullDiscount,
|
||||
} from "@/api/promotion";
|
||||
import { getGoodsSkuListDataSeller } from "@/api/goods";
|
||||
import { regular } from "@/utils";
|
||||
import vueQr from "vue-qr";
|
||||
|
||||
export default {
|
||||
name: "add-full-discount",
|
||||
components: {
|
||||
"vue-qr": vueQr,
|
||||
},
|
||||
data() {
|
||||
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();
|
||||
}
|
||||
};
|
||||
const checkDiscount = (rule, value, callback) => {
|
||||
if (value === null || value === undefined || value === "") {
|
||||
callback(new Error("请填写优惠折扣"));
|
||||
} else if (value < 0.1 || value > 9.9) {
|
||||
callback(new Error("请输入0-10的数字,可有一位小数"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
form: {
|
||||
discountType: "fullMinusFlag",
|
||||
scopeType: "ALL",
|
||||
promotionGoodsList: [],
|
||||
promotionStatus: "NEW",
|
||||
},
|
||||
id: this.$route.query.id,
|
||||
submitLoading: false,
|
||||
selectedGoods: [],
|
||||
couponList: [],
|
||||
giftList: [],
|
||||
giftLoading: false,
|
||||
couponLoading: false,
|
||||
formRule: {
|
||||
promotionName: [{ required: true, message: "活动名称不能为空" }],
|
||||
rangeTime: [{ required: true, message: "请选择活动时间" }],
|
||||
description: [{ required: true, message: "请填写活动描述" }],
|
||||
fullMoney: [{ required: true, validator: checkWeight }],
|
||||
fullMinus: [
|
||||
{ required: true, message: "请填写优惠金额" },
|
||||
{ pattern: regular.money, message: "请输入正确金额" },
|
||||
],
|
||||
fullRate: [{ required: true, validator: checkDiscount }],
|
||||
},
|
||||
options: {
|
||||
disabledDate(date) {
|
||||
return date && date.valueOf() < Date.now() - 86400000;
|
||||
@@ -231,7 +300,12 @@ export default {
|
||||
},
|
||||
};
|
||||
},
|
||||
async mounted() {
|
||||
computed: {
|
||||
fieldDisabled() {
|
||||
return !!this.id && this.form.promotionStatus !== "NEW";
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if (this.id) {
|
||||
this.getDetail();
|
||||
}
|
||||
@@ -239,36 +313,149 @@ export default {
|
||||
this.getGiftList();
|
||||
},
|
||||
methods: {
|
||||
closeCurrentPage() {
|
||||
this.$router.back();
|
||||
},
|
||||
openSkuList() {
|
||||
this.$refs.liliDialog.open("goods");
|
||||
const data = JSON.parse(JSON.stringify(this.form.promotionGoodsList));
|
||||
data.forEach((e) => {
|
||||
e.id = e.skuId;
|
||||
});
|
||||
this.$refs.liliDialog.goodsData = data;
|
||||
},
|
||||
getDetail() {
|
||||
getFullDiscountById(this.id).then((res) => {
|
||||
let data = res.result;
|
||||
if (!data.scopeType === "ALL") {
|
||||
const data = res.result;
|
||||
if (data.scopeType === "ALL") {
|
||||
data.promotionGoodsList = [];
|
||||
}
|
||||
if (data.fullMinusFlag) {
|
||||
data.discountType = "fullMinusFlag";
|
||||
delete data.fullMinusFlag;
|
||||
} else {
|
||||
data.discountType = "fullMinusFlag";
|
||||
data.discountType = "fullRateFlag";
|
||||
delete data.fullRateFlag;
|
||||
}
|
||||
data.rangeTime = [];
|
||||
data.rangeTime.push(new Date(data.startTime), new Date(data.endTime));
|
||||
|
||||
data.rangeTime = [new Date(data.startTime), new Date(data.endTime)];
|
||||
if (data.fullRate !== null && data.fullRate !== undefined && data.fullRate !== "") {
|
||||
data.fullRate = parseFloat(Number(data.fullRate).toFixed(1));
|
||||
}
|
||||
this.form = data;
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (!valid) return;
|
||||
const params = JSON.parse(JSON.stringify(this.form));
|
||||
params.startTime = this.$filters.unixToDate(this.form.rangeTime[0] / 1000);
|
||||
params.endTime = this.$filters.unixToDate(this.form.rangeTime[1] / 1000);
|
||||
|
||||
if (params.couponFlag && !params.couponId) {
|
||||
this.$Message.warning("请选择优惠券");
|
||||
return;
|
||||
}
|
||||
if (params.giftFlag && !params.giftId) {
|
||||
this.$Message.warning("请选择赠品");
|
||||
return;
|
||||
}
|
||||
if (params.pointFlag && !params.point) {
|
||||
this.$Message.warning("请填写积分");
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
params.scopeType === "PORTION_GOODS" &&
|
||||
(!params.promotionGoodsList || params.promotionGoodsList.length === 0)
|
||||
) {
|
||||
this.$Message.warning("请选择指定商品");
|
||||
return;
|
||||
}
|
||||
if (params.scopeType === "ALL") {
|
||||
delete params.promotionGoodsList;
|
||||
params.number = -1;
|
||||
} else {
|
||||
const 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.discountType;
|
||||
delete params.rangeTime;
|
||||
if (!this.id) {
|
||||
delete params.id;
|
||||
} else {
|
||||
delete params.updateTime;
|
||||
}
|
||||
|
||||
this.submitLoading = true;
|
||||
const request = this.id ? editFullDiscount(params) : newFullDiscount(params);
|
||||
request.then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success(this.id ? "编辑活动成功" : "添加活动成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
changeSelect(e) {
|
||||
this.selectedGoods = e;
|
||||
},
|
||||
delSelectGoods() {
|
||||
if (this.selectedGoods.length <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: "您确认要删除所选商品吗?",
|
||||
onOk: () => {
|
||||
const ids = this.selectedGoods.map((e) => e.skuId || e.id);
|
||||
this.form.promotionGoodsList = this.form.promotionGoodsList.filter(
|
||||
(item) => !ids.includes(item.skuId)
|
||||
);
|
||||
},
|
||||
});
|
||||
},
|
||||
delGoods(index) {
|
||||
this.form.promotionGoodsList.splice(index, 1);
|
||||
},
|
||||
selectedGoodsData(item) {
|
||||
const 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,
|
||||
goodsId: e.goodsId,
|
||||
});
|
||||
});
|
||||
this.form.promotionGoodsList = list;
|
||||
},
|
||||
getCouponList(query) {
|
||||
let params = {
|
||||
const params = {
|
||||
pageSize: 20,
|
||||
pageNumber: 1,
|
||||
getType: "ACTIVITY",
|
||||
storeId: "",
|
||||
couponName: query,
|
||||
promotionStatus: "START",
|
||||
};
|
||||
this.couponLoading = true;
|
||||
getPlatformCouponList(params).then((res) => {
|
||||
getShopCouponList(params).then((res) => {
|
||||
this.couponLoading = false;
|
||||
if (res.success) {
|
||||
this.couponList = res.result.records;
|
||||
@@ -276,16 +463,16 @@ export default {
|
||||
});
|
||||
},
|
||||
getGiftList(query) {
|
||||
let params = {
|
||||
const params = {
|
||||
pageSize: 20,
|
||||
pageNumber: 1,
|
||||
id: query === this.form.giftId ? this.form.giftId : null,
|
||||
goodsName: query === this.form.giftId ? null : query,
|
||||
marketEnable: "UPPER",
|
||||
authFlag: "PASS"
|
||||
authFlag: "PASS",
|
||||
};
|
||||
this.giftLoading = true;
|
||||
getGoodsSkuData(params).then((res) => {
|
||||
getGoodsSkuListDataSeller(params).then((res) => {
|
||||
this.giftLoading = false;
|
||||
if (res.success) {
|
||||
this.giftList = res.result.records;
|
||||
|
||||
@@ -47,6 +47,9 @@
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<div class="operation padding-row">
|
||||
<el-button type="primary" @click="add">新增</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
@@ -71,10 +74,12 @@
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" width="140" fixed="right">
|
||||
<el-table-column label="操作" align="center" width="160" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<a class="link-text" @click="view(row)">查看</a>
|
||||
<a class="link-text" @click="goDetail(row)">
|
||||
{{ row.promotionStatus === "NEW" ? "编辑" : "查看" }}
|
||||
</a>
|
||||
<template v-if="row.promotionStatus === 'NEW' || row.promotionStatus === 'START'">
|
||||
<span class="op-split">|</span>
|
||||
<a class="link-text" @click="openOrClose(row)">关闭</a>
|
||||
@@ -189,7 +194,10 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
view(row) {
|
||||
add() {
|
||||
this.$router.push({ name: "full-discount-detail" });
|
||||
},
|
||||
goDetail(row) {
|
||||
this.$router.push({ name: "full-discount-detail", query: { id: row.id } });
|
||||
},
|
||||
},
|
||||
@@ -214,4 +222,12 @@ export default {
|
||||
.mt_10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.operation {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.padding-row {
|
||||
padding: 0 0 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,179 +1,195 @@
|
||||
<template>
|
||||
<div class="pintuan-goods">
|
||||
<div class="new-pintuan">
|
||||
<el-card>
|
||||
<h4>活动详情</h4>
|
||||
<el-table border :data="data" style="width: 100%; margin: 10px 0">
|
||||
<el-table-column prop="promotionName" label="活动名称" min-width="120" />
|
||||
<el-table-column prop="startTime" label="活动开始时间" min-width="120" />
|
||||
<el-table-column prop="endTime" label="活动结束时间" min-width="120" />
|
||||
<el-table-column prop="requiredNum" label="成团人数" min-width="90" />
|
||||
<el-table-column prop="limitNum" label="限购数量" min-width="90" />
|
||||
<el-table-column label="状态" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row" :type="promotionStatusTagType(row.promotionStatus)">
|
||||
{{ promotionStatusText(row.promotionStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<h4>商品信息</h4>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
border
|
||||
class="operation"
|
||||
:data="goodsData"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column label="商品名称" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<a class="link-text mr_10" @click="linkTo(row.goodsId, row.skuId)">{{ row.goodsName }}</a>
|
||||
<el-popover trigger="hover" title="扫码在手机中查看" placement="top" width="180">
|
||||
<template #reference>
|
||||
<img
|
||||
src="../../../assets/qrcode.svg"
|
||||
style="vertical-align: middle"
|
||||
class="hover-pointer"
|
||||
width="20"
|
||||
height="20"
|
||||
alt="qrcode"
|
||||
/>
|
||||
</template>
|
||||
<vue-qr
|
||||
:text="wapLinkTo(row.goodsId, row.skuId)"
|
||||
:margin="0"
|
||||
color-dark="#000"
|
||||
color-light="#fff"
|
||||
:size="150"
|
||||
/>
|
||||
</el-popover>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="quantity" label="库存" min-width="80" />
|
||||
<el-table-column label="拼团价格" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.price, "¥") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="page operation mt_10" style="display: flex; justify-content: flex-end">
|
||||
<el-pagination
|
||||
v-model:current-page="searchForm.pageNumber"
|
||||
v-model:page-size="searchForm.pageSize"
|
||||
:page-sizes="[20, 50, 100]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
size="small"
|
||||
@current-change="changePage"
|
||||
@size-change="changePageSize"
|
||||
/>
|
||||
</div>
|
||||
<el-form ref="form" :model="form" label-width="130px" :rules="formValidate">
|
||||
<el-form-item label="活动名称" prop="promotionName">
|
||||
<el-input
|
||||
v-model="form.promotionName"
|
||||
clearable
|
||||
style="width: 260px"
|
||||
maxlength="25"
|
||||
placeholder="请输入活动名称"
|
||||
/>
|
||||
<div class="form-tip">
|
||||
活动名称将显示在店铺拼团活动列表中,供商家管理使用,最多输入25个字符
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="活动时间" prop="rangeTime">
|
||||
<el-date-picker
|
||||
v-model="form.rangeTime"
|
||||
type="datetimerange"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
placeholder="请选择"
|
||||
:disabled-date="options.disabledDate"
|
||||
style="width: 360px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="成团人数" prop="requiredNum">
|
||||
<el-input v-model="form.requiredNum" style="width: 260px" placeholder="请输入成团人数">
|
||||
<template #append>人</template>
|
||||
</el-input>
|
||||
<span class="form-tip inline-tip">成团人数最少为2人,最多不超过10人。</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="限购数量" prop="limitNum">
|
||||
<el-input v-model="form.limitNum" type="number" style="width: 260px" placeholder="请输入限购数量">
|
||||
<template #append>件/人</template>
|
||||
</el-input>
|
||||
<span class="form-tip inline-tip">若设置为0,则为不限制购买数量。</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="虚拟成团" prop="fictitious">
|
||||
<el-radio-group v-model="form.fictitious">
|
||||
<el-radio-button :value="1">开启</el-radio-button>
|
||||
<el-radio-button :value="0">关闭</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div class="form-tip">
|
||||
开启虚拟成团后,24小时内人数未满的团,系统将会模拟匿名买家凑满人数,使该团成团。您只需要对真实拼团买家发货。建议合理开启,以提高成团率。
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="拼团规则" prop="pintuanRule">
|
||||
<el-input
|
||||
v-model="form.pintuanRule"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
clearable
|
||||
maxlength="255"
|
||||
style="width: 260px"
|
||||
placeholder="请输入拼团规则"
|
||||
/>
|
||||
<div class="form-tip">拼团规则字数不能超过255字,将在WAP拼团详情页中显示</div>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="closeCurrentPage">返回</el-button>
|
||||
<el-button type="primary" :loading="submitLoading" @click="handleSubmit">提交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPintuanGoodsList, getPintuanDetail } from "@/api/promotion.js";
|
||||
import vueQr from "vue-qr";
|
||||
import { savePintuan, editPintuan, getPintuanDetail } from "@/api/promotion";
|
||||
|
||||
export default {
|
||||
components: { vueQr },
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
searchForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
id: this.$route.query.id,
|
||||
form: {
|
||||
promotionName: "",
|
||||
promotionTitle: "",
|
||||
pintuanRule: "",
|
||||
requiredNum: "",
|
||||
fictitious: 0,
|
||||
limitNum: "",
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
rangeTime: [],
|
||||
},
|
||||
formValidate: {
|
||||
promotionName: [{ required: true, message: "活动名称不能为空", trigger: "blur" }],
|
||||
requiredNum: [
|
||||
{ required: true, message: "成团人数不能为空", trigger: "blur" },
|
||||
{
|
||||
pattern: /^([2-9]|10)?$/,
|
||||
message: "成团人数不合法",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
limitNum: [
|
||||
{ required: true, message: "限购数量不能为空", trigger: "blur" },
|
||||
{
|
||||
pattern: /^(0|[1-9]\d?|100)$/,
|
||||
message: "限购数量不合法",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
rangeTime: [{ required: true, message: "请选择活动时间", trigger: "change" }],
|
||||
},
|
||||
submitLoading: false,
|
||||
options: {
|
||||
disabledDate(date) {
|
||||
return date && date.valueOf() < Date.now() - 86400000;
|
||||
},
|
||||
},
|
||||
data: [],
|
||||
total: 0,
|
||||
goodsData: [],
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
if (this.id) {
|
||||
this.getDetail();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
promotionStatusText(status) {
|
||||
const map = {
|
||||
NEW: "未开始",
|
||||
START: "已开始",
|
||||
END: "已结束",
|
||||
CLOSE: "已关闭",
|
||||
};
|
||||
return map[status] || "未知";
|
||||
closeCurrentPage() {
|
||||
this.$router.back();
|
||||
},
|
||||
promotionStatusTagType(status) {
|
||||
const map = {
|
||||
NEW: "info",
|
||||
START: "success",
|
||||
END: "danger",
|
||||
CLOSE: "danger",
|
||||
};
|
||||
return map[status] || "danger";
|
||||
},
|
||||
init() {
|
||||
this.getDataList();
|
||||
this.getPintuanMsg();
|
||||
},
|
||||
changePage() {
|
||||
this.getDataList();
|
||||
},
|
||||
changePageSize() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
this.searchForm.pintuanId = this.$route.query.id;
|
||||
getPintuanGoodsList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.goodsData = res.result.records;
|
||||
this.total = res.result.total;
|
||||
handleSubmit() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (!valid) return;
|
||||
this.submitLoading = true;
|
||||
const params = JSON.parse(JSON.stringify(this.form));
|
||||
params.fictitious = !!params.fictitious;
|
||||
params.startTime = this.$filters.unixToDate(this.form.rangeTime[0] / 1000);
|
||||
params.endTime = this.$filters.unixToDate(this.form.rangeTime[1] / 1000);
|
||||
|
||||
if (!params.startTime || !params.endTime) {
|
||||
this.$Message.error("活动时间不能为空");
|
||||
this.submitLoading = false;
|
||||
return;
|
||||
}
|
||||
if (new Date(params.startTime).getTime() < Date.now()) {
|
||||
this.$Message.error("拼团活动开始时间不能小于当前时间");
|
||||
this.submitLoading = false;
|
||||
return;
|
||||
}
|
||||
|
||||
delete params.rangeTime;
|
||||
if (!this.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();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
getPintuanMsg() {
|
||||
getPintuanDetail(this.$route.query.id).then((res) => {
|
||||
if (res.success) this.data.push(res.result);
|
||||
getDetail() {
|
||||
getPintuanDetail(this.id).then((res) => {
|
||||
if (res.success) {
|
||||
const data = res.result;
|
||||
data.rangeTime = [new Date(data.startTime), new Date(data.endTime)];
|
||||
this.form = data;
|
||||
this.form.fictitious = data.fictitious ? 1 : 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
h4 {
|
||||
margin: 20px 0;
|
||||
padding: 0 10px;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
border-left: 3px solid red;
|
||||
.form-tip {
|
||||
color: #cccccc;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.link-text {
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.mr_10 {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.hover-pointer {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mt_10 {
|
||||
margin-top: 10px;
|
||||
.inline-tip {
|
||||
display: inline-block;
|
||||
margin-top: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<h4>活动详情</h4>
|
||||
<el-table border :data="data" style="width: 100%; margin: 10px 0">
|
||||
<el-table-column prop="promotionName" label="活动名称" min-width="120" />
|
||||
<el-table-column prop="startTime" label="活动开始时间" min-width="120" />
|
||||
<el-table-column prop="endTime" label="活动结束时间" min-width="120" />
|
||||
<el-table-column prop="startTime" label="活动开始时间" min-width="160" />
|
||||
<el-table-column prop="endTime" label="活动结束时间" min-width="160" />
|
||||
<el-table-column prop="requiredNum" label="成团人数" min-width="90" />
|
||||
<el-table-column prop="limitNum" label="限购数量" min-width="90" />
|
||||
<el-table-column label="状态" min-width="100">
|
||||
@@ -17,75 +17,130 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<h4>商品信息</h4>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
border
|
||||
class="operation"
|
||||
:data="goodsData"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column label="商品名称" min-width="120">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<a class="link-text mr_10" @click="linkTo(row.goodsId, row.skuId)">{{ row.goodsName }}</a>
|
||||
<el-popover trigger="hover" title="扫码在手机中查看" placement="top" width="180">
|
||||
<template #reference>
|
||||
<img
|
||||
src="../../../assets/qrcode.svg"
|
||||
style="vertical-align: middle"
|
||||
class="hover-pointer"
|
||||
width="20"
|
||||
height="20"
|
||||
alt="qrcode"
|
||||
/>
|
||||
</template>
|
||||
<vue-qr
|
||||
:text="wapLinkTo(row.goodsId, row.skuId)"
|
||||
:margin="0"
|
||||
color-dark="#000"
|
||||
color-light="#fff"
|
||||
:size="150"
|
||||
/>
|
||||
</el-popover>
|
||||
<h4>活动商品</h4>
|
||||
<template v-if="!readonly">
|
||||
<div class="operation">
|
||||
<el-button type="primary" @click="openSkuList">选择商品</el-button>
|
||||
<el-button @click="delAll">批量删除</el-button>
|
||||
<el-button @click="getDataList">刷新</el-button>
|
||||
</div>
|
||||
<el-alert v-if="selectCount > 0" type="info" show-icon :closable="false" class="select-alert">
|
||||
已选择 <span>{{ selectCount }}</span> 项
|
||||
<a class="select-clear" @click="clearSelectAll">清空</a>
|
||||
</el-alert>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="goodsData"
|
||||
style="width: 100%"
|
||||
@selection-change="changeSelect"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column prop="goodsName" label="商品名称" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column prop="quantity" label="库存" width="90" />
|
||||
<el-table-column label="拼团价格" width="160">
|
||||
<template #default="{ row, $index }">
|
||||
<el-input-number
|
||||
v-if="row"
|
||||
v-model="row.price"
|
||||
:min="0.01"
|
||||
:precision="2"
|
||||
controls-position="right"
|
||||
size="small"
|
||||
@change="(val) => updateGoodsPrice($index, val)"
|
||||
/>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="quantity" label="库存" min-width="80" />
|
||||
<el-table-column label="拼团价格" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.price, "¥") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90" align="center">
|
||||
<template #default="{ $index }">
|
||||
<a class="link-text" @click="delGoods($index)">删除</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<div class="page operation mt_10" style="display: flex; justify-content: flex-end">
|
||||
<el-pagination
|
||||
v-model:current-page="searchForm.pageNumber"
|
||||
v-model:page-size="searchForm.pageSize"
|
||||
:page-sizes="[20, 50, 100]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
size="small"
|
||||
@current-change="changePage"
|
||||
@size-change="changePageSize"
|
||||
/>
|
||||
<template v-else>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="goodsData"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column label="商品名称" min-width="140">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<a class="link-text mr_10" @click="linkTo(row.goodsId, row.skuId)">{{ row.goodsName }}</a>
|
||||
<el-popover trigger="hover" title="扫码在手机中查看" placement="top" width="180">
|
||||
<template #reference>
|
||||
<img
|
||||
src="../../../assets/qrcode.svg"
|
||||
class="hover-pointer qrcode-icon"
|
||||
width="20"
|
||||
height="20"
|
||||
alt="qrcode"
|
||||
/>
|
||||
</template>
|
||||
<vue-qr
|
||||
:text="wapLinkTo(row.goodsId, row.skuId)"
|
||||
:margin="0"
|
||||
color-dark="#000"
|
||||
color-light="#fff"
|
||||
:size="150"
|
||||
/>
|
||||
</el-popover>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="quantity" label="库存" width="90" />
|
||||
<el-table-column label="拼团价格" width="120">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.price, "¥") }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<el-pagination
|
||||
v-model:current-page="searchForm.pageNumber"
|
||||
v-model:page-size="searchForm.pageSize"
|
||||
:page-sizes="[10, 20, 50]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
size="small"
|
||||
@current-change="changePage"
|
||||
@size-change="changePageSize"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="foot-btn">
|
||||
<el-button @click="closeCurrentPage">返回</el-button>
|
||||
<el-button v-if="!readonly" type="primary" :loading="submitLoading" @click="save">
|
||||
提交
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<liliDialog ref="liliDialog" @selectedGoodsData="selectedGoodsData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPintuanGoodsList, getPintuanDetail, editPintuan } from "@/api/promotion.js";
|
||||
import liliDialog from "@/views/lili-dialog";
|
||||
import vueQr from "vue-qr";
|
||||
|
||||
export default {
|
||||
components: { vueQr },
|
||||
components: { liliDialog, vueQr },
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
submitLoading: false,
|
||||
promotionStatus: "",
|
||||
searchForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
@@ -93,8 +148,15 @@ export default {
|
||||
data: [],
|
||||
total: 0,
|
||||
goodsData: [],
|
||||
selectList: [],
|
||||
selectCount: 0,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
readonly() {
|
||||
return this.$route.query.status === "view" || this.promotionStatus !== "NEW";
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
promotionStatusText(status) {
|
||||
const map = {
|
||||
@@ -114,8 +176,10 @@ export default {
|
||||
};
|
||||
return map[status] || "danger";
|
||||
},
|
||||
closeCurrentPage() {
|
||||
this.$router.back();
|
||||
},
|
||||
init() {
|
||||
this.getDataList();
|
||||
this.getPintuanMsg();
|
||||
},
|
||||
changePage() {
|
||||
@@ -125,20 +189,119 @@ export default {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.getDataList();
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
this.searchForm.pintuanId = this.$route.query.id;
|
||||
getPintuanGoodsList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success) {
|
||||
this.goodsData = res.result.records;
|
||||
this.total = res.result.total;
|
||||
getPintuanMsg() {
|
||||
getPintuanDetail(this.$route.query.id).then((res) => {
|
||||
if (res.success && res.result) {
|
||||
this.data = [res.result];
|
||||
this.promotionStatus = res.result.promotionStatus;
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
getPintuanMsg() {
|
||||
getPintuanDetail(this.$route.query.id).then((res) => {
|
||||
if (res.success) this.data.push(res.result);
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
const params = {
|
||||
pintuanId: this.$route.query.id,
|
||||
pageNumber: this.readonly ? this.searchForm.pageNumber : 1,
|
||||
pageSize: this.readonly ? this.searchForm.pageSize : 1000,
|
||||
};
|
||||
getPintuanGoodsList(params).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success && res.result) {
|
||||
this.goodsData = res.result.records || [];
|
||||
this.total = res.result.total || 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
openSkuList() {
|
||||
const data = JSON.parse(JSON.stringify(this.goodsData));
|
||||
data.forEach((e) => {
|
||||
e.id = e.skuId;
|
||||
});
|
||||
this.$refs.liliDialog.goodsData = data;
|
||||
this.$refs.liliDialog.open("goods");
|
||||
},
|
||||
selectedGoodsData(selected) {
|
||||
const existingMap = new Map(this.goodsData.map((item) => [item.skuId, item]));
|
||||
this.goodsData = selected.map((item) => {
|
||||
const existed = existingMap.get(item.id);
|
||||
if (existed) {
|
||||
return existed;
|
||||
}
|
||||
return {
|
||||
goodsName: item.goodsName,
|
||||
price: item.price,
|
||||
originalPrice: item.price,
|
||||
quantity: item.quantity,
|
||||
storeId: item.storeId,
|
||||
sellerName: item.sellerName,
|
||||
thumbnail: item.thumbnail,
|
||||
skuId: item.id,
|
||||
categoryPath: item.categoryPath,
|
||||
goodsId: item.goodsId,
|
||||
goodsType: item.goodsType,
|
||||
};
|
||||
});
|
||||
this.clearSelectAll();
|
||||
},
|
||||
updateGoodsPrice(index, value) {
|
||||
if (this.goodsData[index]) {
|
||||
this.goodsData[index].price = value;
|
||||
}
|
||||
},
|
||||
changeSelect(selection) {
|
||||
this.selectList = selection;
|
||||
this.selectCount = selection.length;
|
||||
},
|
||||
clearSelectAll() {
|
||||
this.$refs.table?.clearSelection();
|
||||
this.selectList = [];
|
||||
this.selectCount = 0;
|
||||
},
|
||||
delGoods(index) {
|
||||
this.goodsData.splice(index, 1);
|
||||
this.selectCount = 0;
|
||||
},
|
||||
delAll() {
|
||||
if (this.selectCount <= 0) {
|
||||
this.$Message.warning("您还未选择要删除的数据");
|
||||
return;
|
||||
}
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: `您确认要删除所选 ${this.selectCount} 项数据?`,
|
||||
onOk: () => {
|
||||
const ids = this.selectList.map((e) => e.skuId);
|
||||
this.goodsData = this.goodsData.filter((item) => !ids.includes(item.skuId));
|
||||
this.clearSelectAll();
|
||||
},
|
||||
});
|
||||
},
|
||||
save() {
|
||||
if (!this.goodsData.length) {
|
||||
this.$Message.warning("请选择活动商品");
|
||||
return;
|
||||
}
|
||||
for (const item of this.goodsData) {
|
||||
if (item.price === "" || item.price === null || item.price === undefined) {
|
||||
this.$Message.warning(`请填写【${item.goodsName}】的价格`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
const params = JSON.parse(JSON.stringify(this.data[0]));
|
||||
params.promotionGoodsList = this.goodsData.map((item) => ({
|
||||
...item,
|
||||
promotionId: params.id,
|
||||
startTime: params.startTime,
|
||||
endTime: params.endTime,
|
||||
}));
|
||||
this.submitLoading = true;
|
||||
editPintuan(params).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res.success) {
|
||||
this.$Message.success("修改拼团商品成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
@@ -159,6 +322,22 @@ h4 {
|
||||
border-left: 3px solid red;
|
||||
}
|
||||
|
||||
.operation {
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.select-alert {
|
||||
margin-bottom: 10px;
|
||||
|
||||
.select-clear {
|
||||
margin-left: 12px;
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.link-text {
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
@@ -173,6 +352,16 @@ h4 {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.qrcode-icon {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.foot-btn {
|
||||
margin-top: 16px;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.mt_10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<div class="operation padding-row mb_10">
|
||||
<el-button type="primary" @click="newAct">添加</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
@@ -71,13 +74,23 @@
|
||||
<el-table-column prop="storeName" label="所属店铺" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="startTime" label="活动开始时间" width="180" />
|
||||
<el-table-column prop="endTime" label="活动结束时间" width="180" />
|
||||
<el-table-column label="操作" width="200" align="center" fixed="right">
|
||||
<el-table-column label="操作" width="220" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<a class="link-text" @click="view(row)">查看</a>
|
||||
<template v-if="row.promotionStatus === 'START' || row.promotionStatus === 'NEW'">
|
||||
<template v-if="row.promotionStatus === 'NEW'">
|
||||
<a class="link-text" @click="edit(row)">编辑</a>
|
||||
<span class="op-split">|</span>
|
||||
<a class="link-text" @click="close(row)">关闭</a>
|
||||
<a class="link-text" @click="manage(row, 'manager')">管理</a>
|
||||
</template>
|
||||
<template v-else-if="row.promotionStatus !== 'CLOSE'">
|
||||
<a class="link-text" @click="manage(row, 'view')">查看</a>
|
||||
<template v-if="row.promotionStatus === 'START'">
|
||||
<span class="op-split">|</span>
|
||||
<a class="link-text" @click="close(row)">关闭</a>
|
||||
</template>
|
||||
</template>
|
||||
<template v-else>
|
||||
<a class="link-text" @click="open(row)">开启</a>
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
@@ -101,7 +114,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getPintuanList, deletePintuan, editPintuanStatus } from "@/api/promotion";
|
||||
import { getPintuanList, editPintuanStatus } from "@/api/promotion";
|
||||
export default {
|
||||
name: "pintuan",
|
||||
data() {
|
||||
@@ -176,8 +189,37 @@ export default {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
view(v) {
|
||||
this.$router.push({ name: "pintuan-goods", query: { id: v.id } });
|
||||
newAct() {
|
||||
this.$router.push({ name: "pintuan-edit" });
|
||||
},
|
||||
edit(v) {
|
||||
this.$router.push({ name: "pintuan-edit", query: { id: v.id } });
|
||||
},
|
||||
manage(v, status) {
|
||||
this.$router.push({ name: "pintuan-goods", query: { id: v.id, status } });
|
||||
},
|
||||
open(v) {
|
||||
const sTime = new Date();
|
||||
sTime.setMinutes(sTime.getMinutes() + 10);
|
||||
const eTime = new Date(new Date().setHours(0, 0, 0, 0) + 24 * 60 * 60 * 1000 - 1);
|
||||
const params = {
|
||||
startTime: sTime.getTime(),
|
||||
endTime: eTime.getTime(),
|
||||
};
|
||||
this.$Modal.confirm({
|
||||
title: "确认开启",
|
||||
content: "您确认要开启此拼团活动?(默认为当前时间后十分钟至当天结束)",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
editPintuanStatus(v.id, params).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("开启活动成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
close(v) {
|
||||
this.$Modal.confirm({
|
||||
@@ -185,10 +227,10 @@ export default {
|
||||
content: "您确认要关闭此拼团活动?",
|
||||
loading: true,
|
||||
onOk: () => {
|
||||
updatePintuanStatus(v.id).then((res) => {
|
||||
editPintuanStatus(v.id).then((res) => {
|
||||
this.$Modal.remove();
|
||||
if (res.success) {
|
||||
this.$Message.success("操作成功");
|
||||
this.$Message.success("关闭活动成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
@@ -206,4 +248,19 @@ export default {
|
||||
.mt_10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
.mb_10 {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.link-text {
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.op-split {
|
||||
margin: 0 8px;
|
||||
color: #dcdee2;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -25,58 +25,155 @@
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
border
|
||||
class="operation"
|
||||
:data="goodsList"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="goodsName" label="商品名称" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="商品价格" width="110">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.originalPrice, "¥") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" width="90">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row">{{ row.quantity }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动价格" width="100">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.price, "¥") }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="storeName" label="商家名称" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="活动场次" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row">{{ row.timeLine + ":00" }}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="150" align="center">
|
||||
<template #default="{ row, $index }">
|
||||
<a v-if="row" class="link-text" @click="delGoods($index, row)">删除</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template v-if="!readonly">
|
||||
<div class="operation">
|
||||
<el-button type="primary" @click="openSkuList">选择商品</el-button>
|
||||
</div>
|
||||
<el-tabs v-model="tabCurrent" type="card" class="operation">
|
||||
<el-tab-pane
|
||||
v-for="(tab, tabIndex) in goodsList"
|
||||
:key="tabIndex"
|
||||
:label="tab.hour"
|
||||
:name="String(tabIndex)"
|
||||
>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="tab.list"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="goodsName" label="商品名称" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="商品价格" width="110">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.originalPrice, "¥") }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" width="130">
|
||||
<template #default="{ row, $index }">
|
||||
<el-input-number
|
||||
v-if="row"
|
||||
v-model="row.quantity"
|
||||
:min="1"
|
||||
:disabled="row.promotionApplyStatus === 'PASS'"
|
||||
controls-position="right"
|
||||
size="small"
|
||||
@change="(val) => updateGoodsField(tabIndex, $index, 'quantity', val)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动价格" width="140">
|
||||
<template #default="{ row, $index }">
|
||||
<el-input-number
|
||||
v-if="row"
|
||||
v-model="row.price"
|
||||
:min="0.01"
|
||||
:precision="2"
|
||||
:disabled="row.promotionApplyStatus === 'PASS'"
|
||||
controls-position="right"
|
||||
size="small"
|
||||
@change="(val) => updateGoodsField(tabIndex, $index, 'price', val)"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="120">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<el-tag :type="applyStatusTagType(row.promotionApplyStatus)" size="small">
|
||||
{{ applyStatusText(row.promotionApplyStatus) }}
|
||||
</el-tag>
|
||||
<a
|
||||
v-if="row.promotionApplyStatus === 'REFUSE' && row.failReason"
|
||||
class="reason link-text"
|
||||
@click="showReason(row.failReason)"
|
||||
>
|
||||
拒绝原因
|
||||
</a>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="90" align="center">
|
||||
<template #default="{ row, $index }">
|
||||
<a v-if="row" class="link-text" @click="delGoods(tabIndex, $index, row)">删除</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</template>
|
||||
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<el-pagination
|
||||
v-model:current-page="searchForm.pageNumber"
|
||||
v-model:page-size="searchForm.pageSize"
|
||||
:page-sizes="[20, 50, 100]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
size="small"
|
||||
@current-change="changePage"
|
||||
@size-change="changePageSize"
|
||||
/>
|
||||
<template v-else>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
border
|
||||
class="operation"
|
||||
:data="readonlyGoodsList"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column prop="goodsName" label="商品名称" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="商品价格" width="110">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.originalPrice, "¥") }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="库存" width="90">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row">{{ row.quantity }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动价格" width="100">
|
||||
<template #default="{ row }">
|
||||
<span v-if="row" :style="{ color: $mainColor }">
|
||||
{{ $filters.unitPrice(row.price, "¥") }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="活动场次" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row">{{ row.timeLine }}:00</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row" :type="applyStatusTagType(row.promotionApplyStatus)" size="small">
|
||||
{{ applyStatusText(row.promotionApplyStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<el-pagination
|
||||
v-model:current-page="searchForm.pageNumber"
|
||||
v-model:page-size="searchForm.pageSize"
|
||||
:page-sizes="[20, 50, 100]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
size="small"
|
||||
@current-change="changePage"
|
||||
@size-change="changePageSize"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div class="foot-btn">
|
||||
<el-button @click="closeCurrentPage">返回</el-button>
|
||||
<el-button
|
||||
v-if="!readonly"
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
@click="save"
|
||||
>
|
||||
提交
|
||||
</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<liliDialog ref="liliDialog" @selectedGoodsData="selectedGoodsData" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -84,14 +181,21 @@
|
||||
import {
|
||||
seckillGoodsList,
|
||||
seckillDetail,
|
||||
setSeckillGoods,
|
||||
delSeckillGoods,
|
||||
} from "@/api/promotion.js";
|
||||
import liliDialog from "@/views/lili-dialog";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
liliDialog,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabCurrent: "0",
|
||||
promotionStatus: "",
|
||||
loading: false,
|
||||
submitLoading: false,
|
||||
searchForm: {
|
||||
pageNumber: 1,
|
||||
pageSize: 20,
|
||||
@@ -99,85 +203,220 @@ export default {
|
||||
total: 0,
|
||||
data: [],
|
||||
goodsList: [],
|
||||
readonlyGoodsList: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
readonly() {
|
||||
return this.$route.query.mode === "view" || this.promotionStatus !== "NEW";
|
||||
},
|
||||
tabIndex() {
|
||||
return Number(this.tabCurrent) || 0;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
seckillStatusText(status) {
|
||||
const map = {
|
||||
NEW: "新建",
|
||||
START: "开始",
|
||||
END: "结束",
|
||||
CLOSE: "废弃",
|
||||
NEW: "未开始",
|
||||
START: "已开始",
|
||||
END: "已结束",
|
||||
CLOSE: "已关闭",
|
||||
};
|
||||
return map[status] || status || "-";
|
||||
},
|
||||
seckillStatusTagType(status) {
|
||||
const map = {
|
||||
NEW: "danger",
|
||||
NEW: "info",
|
||||
START: "success",
|
||||
END: "danger",
|
||||
CLOSE: "danger",
|
||||
};
|
||||
return map[status] || "danger";
|
||||
},
|
||||
applyStatusText(status) {
|
||||
const map = {
|
||||
APPLY: "申请中",
|
||||
PASS: "已通过",
|
||||
REFUSE: "已拒绝",
|
||||
};
|
||||
return map[status] || "未申请";
|
||||
},
|
||||
applyStatusTagType(status) {
|
||||
const map = {
|
||||
APPLY: "warning",
|
||||
PASS: "success",
|
||||
REFUSE: "danger",
|
||||
};
|
||||
return map[status] || "info";
|
||||
},
|
||||
closeCurrentPage() {
|
||||
this.$router.back();
|
||||
},
|
||||
init() {
|
||||
this.getSeckillMsg();
|
||||
},
|
||||
changePage() {
|
||||
this.getDataList();
|
||||
this.getReadonlyGoodsList();
|
||||
},
|
||||
changePageSize() {
|
||||
this.searchForm.pageNumber = 1;
|
||||
this.getDataList();
|
||||
this.getReadonlyGoodsList();
|
||||
},
|
||||
getDataList() {
|
||||
getSeckillMsg() {
|
||||
seckillDetail(this.$route.query.id).then((res) => {
|
||||
if (res.success && res.result) {
|
||||
this.data = [res.result];
|
||||
this.promotionStatus = res.result.promotionStatus;
|
||||
if (this.readonly) {
|
||||
this.getReadonlyGoodsList();
|
||||
} else {
|
||||
this.getManageGoodsList();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getManageGoodsList() {
|
||||
if (!this.data[0]?.hours) {
|
||||
return;
|
||||
}
|
||||
this.loading = true;
|
||||
const hourValues = this.data[0].hours.split(",");
|
||||
const hourLabels = this.unixHours(this.data[0].hours);
|
||||
this.goodsList = hourLabels.map((hour, index) => ({
|
||||
hour,
|
||||
timeLine: hourValues[index],
|
||||
list: [],
|
||||
}));
|
||||
|
||||
seckillGoodsList({
|
||||
seckillId: this.$route.query.id,
|
||||
pageNumber: 1,
|
||||
pageSize: 1000,
|
||||
}).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success && res.result?.records?.length) {
|
||||
res.result.records.forEach((item) => {
|
||||
const slot = this.goodsList.find(
|
||||
(g) => String(g.timeLine) === String(item.timeLine)
|
||||
);
|
||||
if (slot) {
|
||||
slot.list.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
getReadonlyGoodsList() {
|
||||
this.loading = true;
|
||||
this.searchForm.seckillId = this.$route.query.id;
|
||||
seckillGoodsList(this.searchForm).then((res) => {
|
||||
this.loading = false;
|
||||
if (res.success && res.result) {
|
||||
this.goodsList = res.result.records;
|
||||
this.total = res.result.total;
|
||||
this.readonlyGoodsList = res.result.records || [];
|
||||
this.total = res.result.total || 0;
|
||||
}
|
||||
});
|
||||
},
|
||||
getSeckillMsg() {
|
||||
seckillDetail(this.$route.query.id).then((res) => {
|
||||
if (res.success && res.result) {
|
||||
this.data = [];
|
||||
this.data.push(res.result);
|
||||
this.promotionStatus = res.result.promotionStatus;
|
||||
this.getDataList();
|
||||
openSkuList() {
|
||||
const existing = this.goodsList[this.tabIndex]?.list || [];
|
||||
this.$refs.liliDialog.goodsData = existing.map((item) => ({
|
||||
...item,
|
||||
id: item.skuId || item.id,
|
||||
}));
|
||||
this.$refs.liliDialog.open("goods");
|
||||
},
|
||||
selectedGoodsData(selected) {
|
||||
const timeLine = this.goodsList[this.tabIndex]?.timeLine;
|
||||
if (timeLine === undefined) {
|
||||
return;
|
||||
}
|
||||
const existingMap = new Map(
|
||||
(this.goodsList[this.tabIndex].list || []).map((item) => [item.skuId, item])
|
||||
);
|
||||
const list = selected.map((item) => {
|
||||
const existed = existingMap.get(item.id);
|
||||
if (existed) {
|
||||
return existed;
|
||||
}
|
||||
return {
|
||||
goodsName: item.goodsName,
|
||||
price: item.price,
|
||||
originalPrice: item.price,
|
||||
promotionApplyStatus: item.promotionApplyStatus || "",
|
||||
quantity: item.quantity,
|
||||
seckillId: this.$route.query.id,
|
||||
storeId: item.storeId,
|
||||
storeName: item.storeName,
|
||||
skuId: item.id,
|
||||
timeLine,
|
||||
};
|
||||
});
|
||||
this.goodsList[this.tabIndex].list = list;
|
||||
},
|
||||
updateGoodsField(tabIndex, index, field, value) {
|
||||
if (this.goodsList[tabIndex]?.list?.[index]) {
|
||||
this.goodsList[tabIndex].list[index][field] = value;
|
||||
}
|
||||
},
|
||||
delGoods(tabIndex, index, row) {
|
||||
if (row.promotionApplyStatus === "PASS") {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: "您确认要删除该商品吗?删除后不可恢复",
|
||||
onOk: () => {
|
||||
delSeckillGoods({
|
||||
seckillId: row.seckillId,
|
||||
id: row.id,
|
||||
}).then((res) => {
|
||||
if (res.success) {
|
||||
this.goodsList[tabIndex].list.splice(index, 1);
|
||||
this.$Message.success("删除成功");
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.goodsList[tabIndex].list.splice(index, 1);
|
||||
this.$Message.success("删除成功");
|
||||
},
|
||||
save() {
|
||||
const applyVos = [];
|
||||
this.goodsList.forEach((slot) => {
|
||||
slot.list.forEach((item) => {
|
||||
applyVos.push(item);
|
||||
});
|
||||
});
|
||||
if (!applyVos.length) {
|
||||
this.$Message.warning("请先选择活动商品");
|
||||
return;
|
||||
}
|
||||
this.submitLoading = true;
|
||||
setSeckillGoods({
|
||||
seckillId: this.$route.query.id,
|
||||
applyVos,
|
||||
}).then((res) => {
|
||||
this.submitLoading = false;
|
||||
if (res?.success) {
|
||||
this.$Message.success("提交活动商品成功");
|
||||
this.closeCurrentPage();
|
||||
}
|
||||
});
|
||||
},
|
||||
delGoods(index, row) {
|
||||
this.$Modal.confirm({
|
||||
title: "确认删除",
|
||||
content: "您确认要删除该商品吗?删除后不可恢复",
|
||||
onOk: () => {
|
||||
const params = {
|
||||
seckillId: row.seckillId,
|
||||
id: row.id,
|
||||
};
|
||||
delSeckillGoods(params).then((res) => {
|
||||
if (res.success) {
|
||||
this.goodsList.splice(index, 1);
|
||||
this.$Message.success("删除成功!");
|
||||
}
|
||||
});
|
||||
},
|
||||
showReason(reason) {
|
||||
this.$Modal.info({
|
||||
title: "拒绝原因",
|
||||
content: reason,
|
||||
});
|
||||
},
|
||||
unixDate(time) {
|
||||
return this.$filters.unixToDate(new Date(time) / 1000);
|
||||
},
|
||||
unixHours(item) {
|
||||
const hourArr = item.split(",");
|
||||
for (let i = 0; i < hourArr.length; i++) {
|
||||
hourArr[i] += ":00";
|
||||
if (!item) {
|
||||
return [];
|
||||
}
|
||||
return hourArr;
|
||||
return item.split(",").map((hour) => `${hour}:00`);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
@@ -188,7 +427,7 @@ export default {
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.operation {
|
||||
margin: 10px 0;
|
||||
margin: 16px 0 10px;
|
||||
}
|
||||
|
||||
.hour-tag {
|
||||
@@ -202,6 +441,18 @@ export default {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.reason {
|
||||
display: block;
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.foot-btn {
|
||||
margin-top: 16px;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.mt_10 {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
@@ -47,102 +47,74 @@
|
||||
</el-card>
|
||||
|
||||
<el-card>
|
||||
<el-tabs v-model="activeTab" class="mt_10">
|
||||
<el-tab-pane label="秒杀活动列表" name="list">
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="data"
|
||||
class="mt_10"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
prop="promotionName"
|
||||
label="活动名称"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column prop="startTime" label="开始时间" width="180" />
|
||||
<el-table-column prop="applyEndTime" label="申请截止时间" width="180" />
|
||||
<el-table-column label="活动状态" width="110">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row" :type="promotionStatusTagType(row.promotionStatus)">
|
||||
{{ promotionStatusText(row.promotionStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="seckillRule"
|
||||
label="申请规则"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="操作" width="250" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<a
|
||||
v-if="row.promotionStatus === 'CLOSE' || row.promotionStatus === 'NEW'"
|
||||
class="link-text"
|
||||
@click="edit(row)"
|
||||
>
|
||||
编辑
|
||||
</a>
|
||||
<a v-else class="link-text" @click="manage(row)">查看</a>
|
||||
<span v-if="row.promotionStatus" class="op-split">|</span>
|
||||
<a
|
||||
v-if="row.promotionStatus == 'NEW'"
|
||||
class="link-text"
|
||||
@click="manage(row)"
|
||||
>
|
||||
管理
|
||||
</a>
|
||||
<span v-if="row.promotionStatus == 'NEW'" class="op-split">|</span>
|
||||
<a
|
||||
v-if="row.promotionStatus == 'START' || row.promotionStatus == 'NEW'"
|
||||
class="link-text"
|
||||
@click="off(row)"
|
||||
>
|
||||
关闭
|
||||
</a>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-table
|
||||
ref="table"
|
||||
v-loading="loading"
|
||||
border
|
||||
:data="data"
|
||||
class="mt_10"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
prop="promotionName"
|
||||
label="活动名称"
|
||||
min-width="140"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column prop="startTime" label="开始时间" width="180" />
|
||||
<el-table-column prop="applyEndTime" label="申请截止时间" width="180" />
|
||||
<el-table-column label="活动状态" width="110">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row" :type="promotionStatusTagType(row.promotionStatus)">
|
||||
{{ promotionStatusText(row.promotionStatus) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="seckillRule"
|
||||
label="申请规则"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="操作" width="120" align="center" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<template v-if="row">
|
||||
<a
|
||||
v-if="row.promotionStatus === 'NEW'"
|
||||
class="link-text"
|
||||
@click="manage(row)"
|
||||
>
|
||||
管理
|
||||
</a>
|
||||
<a v-else class="link-text" @click="view(row)">查看</a>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<el-pagination
|
||||
v-model:current-page="searchForm.pageNumber"
|
||||
v-model:page-size="searchForm.pageSize"
|
||||
:page-sizes="[20, 50, 100]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
size="small"
|
||||
@current-change="changePage"
|
||||
@size-change="changePageSize"
|
||||
/>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="秒杀活动设置" name="setup" lazy>
|
||||
<setupSeckill />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
<div class="mt_10" style="display: flex; justify-content: flex-end">
|
||||
<el-pagination
|
||||
v-model:current-page="searchForm.pageNumber"
|
||||
v-model:page-size="searchForm.pageSize"
|
||||
:page-sizes="[20, 50, 100]"
|
||||
:total="total"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
size="small"
|
||||
@current-change="changePage"
|
||||
@size-change="changePageSize"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { seckillList } from "@/api/promotion";
|
||||
import setupSeckill from "@/views/promotion/seckill/seckill-setup";
|
||||
|
||||
export default {
|
||||
name: "seckill",
|
||||
components: {
|
||||
setupSeckill,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeTab: "list",
|
||||
selectDate: [],
|
||||
loading: true,
|
||||
searchForm: {
|
||||
@@ -191,40 +163,12 @@ export default {
|
||||
this.searchForm.pageSize = 20;
|
||||
this.getDataList();
|
||||
},
|
||||
edit(v) {
|
||||
this.$router.push({ name: "manager-seckill-add", query: { id: v.id } });
|
||||
view(v) {
|
||||
this.$router.push({ name: "seckill-goods", query: { id: v.id, mode: "view" } });
|
||||
},
|
||||
manage(v) {
|
||||
this.$router.push({ name: "seckill-goods", query: { id: v.id } });
|
||||
},
|
||||
off(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
content: "您确定要下架该活动吗?",
|
||||
onOk: () => {
|
||||
updateSeckillStatus(v.id).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("下架成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
expire(v) {
|
||||
this.$Modal.confirm({
|
||||
title: "提示",
|
||||
content: "您确定要作废该活动吗?",
|
||||
onOk: () => {
|
||||
delSeckill(v.id).then((res) => {
|
||||
if (res.success) {
|
||||
this.$Message.success("作废成功");
|
||||
this.getDataList();
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
getDataList() {
|
||||
this.loading = true;
|
||||
if (this.selectDate && this.selectDate[0] && this.selectDate[1]) {
|
||||
@@ -234,7 +178,7 @@ export default {
|
||||
this.searchForm.startTime = null;
|
||||
this.searchForm.endTime = null;
|
||||
}
|
||||
getSeckillList(this.searchForm)
|
||||
seckillList(this.searchForm)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
this.data = res.result.records;
|
||||
|
||||
@@ -156,8 +156,12 @@ export default {
|
||||
},
|
||||
// 选择图片
|
||||
handleSelectImg() {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 选择图片回调
|
||||
callbackSelected(item) {
|
||||
|
||||
@@ -225,8 +225,12 @@ export default {
|
||||
}
|
||||
},
|
||||
handleSelectImg() {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
callbackSelected(item) {
|
||||
this.picModelFlag = false;
|
||||
|
||||
@@ -62,41 +62,43 @@
|
||||
</template>
|
||||
<!-- 折扣广告 -->
|
||||
<template v-if="element.type == 'discountAdvert'">
|
||||
<div
|
||||
class="discountAdvert"
|
||||
:style="{
|
||||
'background-image':
|
||||
'url(' + require('@/assets/nav/decorate.png') + ')',
|
||||
}"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
v-for="(item, index) in element.options.classification"
|
||||
:key="index"
|
||||
class="setup-content"
|
||||
>
|
||||
<img :src="item.img" width="190" height="210" alt="" />
|
||||
<div class="setup-box">
|
||||
<div>
|
||||
<el-button size="small" @click.stop="handleSelectModel(item)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<div class="discountAdvert-wrap">
|
||||
<div
|
||||
class="discountAdvert"
|
||||
:style="{
|
||||
'background-image':
|
||||
'url(' + require('@/assets/nav/decorate.png') + ')',
|
||||
}"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
v-for="(item, index) in element.options.classification"
|
||||
:key="index"
|
||||
class="setup-content"
|
||||
>
|
||||
<img :src="item.img" width="190" height="210" alt="" />
|
||||
<div class="setup-box">
|
||||
<div>
|
||||
<el-button size="small" @click.stop="handleSelectModel(item)"
|
||||
>编辑</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div
|
||||
v-for="(item, index) in element.options.brandList"
|
||||
:key="index"
|
||||
class="setup-content"
|
||||
>
|
||||
<img :src="item.img" width="240" height="105" alt="" />
|
||||
<div class="setup-box">
|
||||
<div>
|
||||
<el-button size="small" @click.stop="handleSelectModel(item)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
v-for="(item, index) in element.options.brandList"
|
||||
:key="index"
|
||||
class="setup-content"
|
||||
>
|
||||
<img :src="item.img" width="240" height="105" alt="" />
|
||||
<div class="setup-box">
|
||||
<div>
|
||||
<el-button size="small" @click.stop="handleSelectModel(item)"
|
||||
>编辑</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -329,8 +331,12 @@ export default {
|
||||
|
||||
handleSelectImg() {
|
||||
// 选择图片
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 回显图片
|
||||
callbackSelected(val) {
|
||||
@@ -402,15 +408,23 @@ export default {
|
||||
}
|
||||
}
|
||||
/** 折扣广告 */
|
||||
.discountAdvert-wrap {
|
||||
width: 1200px;
|
||||
position: relative;
|
||||
}
|
||||
.discountAdvert {
|
||||
width: 1300px;
|
||||
height: 566px;
|
||||
margin-left: -100px;
|
||||
box-sizing: border-box;
|
||||
background-repeat: no-repeat;
|
||||
margin-left: -97px;
|
||||
background-size: 1300px 566px;
|
||||
position: relative;
|
||||
> div {
|
||||
padding-left: 295px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
box-sizing: border-box;
|
||||
&:nth-child(1) img {
|
||||
margin: 10px 10px 0 0;
|
||||
}
|
||||
|
||||
@@ -184,8 +184,12 @@ export default {
|
||||
// 选择图片
|
||||
handleSelectImg(item) {
|
||||
this.selected = item;
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -145,8 +145,12 @@ export default {
|
||||
// 打开选择图片modal
|
||||
handleSelectImg(item) {
|
||||
this.selected = item;
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -277,8 +277,12 @@ export default {
|
||||
// 打开选择图片modal
|
||||
handleSelectImg(item) {
|
||||
this.selected = item;
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -127,8 +127,12 @@ export default {
|
||||
},
|
||||
handleSelectImg() {
|
||||
// 选择图片
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 选择图片回调
|
||||
callbackSelected(val) {
|
||||
|
||||
@@ -208,8 +208,12 @@ export default {
|
||||
this.defaultCallbackImageType = type;
|
||||
this.goodsIndex = index;
|
||||
// 选择图片
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleSelectGoods(val, index) {
|
||||
|
||||
@@ -194,8 +194,12 @@ export default {
|
||||
this.defaultCallbackImageType = type;
|
||||
this.goodsIndex = index;
|
||||
// 选择图片
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
handleSelectGoods(val, index) {
|
||||
|
||||
@@ -284,8 +284,12 @@ export default {
|
||||
},
|
||||
handleSelectImg() {
|
||||
// 选择图片
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 选择图片回显
|
||||
callbackSelected(val) {
|
||||
@@ -300,82 +304,171 @@ export default {
|
||||
.new-goods {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: stretch;
|
||||
> div {
|
||||
width: 393px;
|
||||
height: 440px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.left > .content {
|
||||
> div:nth-child(1) {
|
||||
height: 240px;
|
||||
flex-direction: column;
|
||||
border: 1px solid #eee;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
justify-content: space-between;
|
||||
img {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
}
|
||||
.describe {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
> div:nth-child(2) {
|
||||
border-right: 1px solid #eee;
|
||||
}
|
||||
> div:nth-child(3),
|
||||
> div:nth-child(4) {
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
}
|
||||
|
||||
.middle > .content {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: repeat(3, 1fr);
|
||||
flex-direction: unset;
|
||||
overflow: hidden;
|
||||
> div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
padding: 6px 4px 4px 6px;
|
||||
border-style: solid;
|
||||
border-color: #eee;
|
||||
border-width: 0;
|
||||
border-bottom-width: 1px;
|
||||
border-right-width: 1px;
|
||||
img {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin-top: 2px;
|
||||
flex-shrink: 0;
|
||||
object-fit: cover;
|
||||
}
|
||||
> div {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
p {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.describe {
|
||||
margin-top: 4px;
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
}
|
||||
> div:nth-child(1) {
|
||||
grid-row: span 2;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 8px 6px;
|
||||
img {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
margin-top: 6px;
|
||||
}
|
||||
> div {
|
||||
flex: unset;
|
||||
width: 100%;
|
||||
p {
|
||||
white-space: normal;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
.describe {
|
||||
margin-top: 6px;
|
||||
white-space: normal;
|
||||
}
|
||||
}
|
||||
}
|
||||
> div:nth-child(1),
|
||||
> div:nth-child(2),
|
||||
> div:nth-child(3) {
|
||||
> div:nth-child(3),
|
||||
> div:nth-child(5) {
|
||||
border-right-width: 0;
|
||||
}
|
||||
> div:nth-child(4),
|
||||
> div:nth-child(5) {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.middle > .content {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
grid-template-rows: repeat(3, 1fr);
|
||||
flex-direction: unset;
|
||||
> div {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
border-style: solid;
|
||||
border-color: #eee;
|
||||
border-width: 0;
|
||||
border-bottom-width: 1px;
|
||||
border-right-width: 1px;
|
||||
}
|
||||
> div:nth-child(6),
|
||||
> div:nth-child(3) {
|
||||
> div:nth-child(2n) {
|
||||
border-right-width: 0;
|
||||
}
|
||||
> div:nth-child(n + 5) {
|
||||
border-bottom-width: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.right > .content {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: row;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: repeat(2, 1fr);
|
||||
flex-direction: unset;
|
||||
flex-wrap: unset;
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
> div {
|
||||
position: relative;
|
||||
width: 120px;
|
||||
padding: 5px 10px 0 10px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 4px 4px 2px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
img {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
flex-shrink: 0;
|
||||
display: block;
|
||||
object-fit: cover;
|
||||
}
|
||||
border-bottom: 1px solid #eee;
|
||||
border-right: 1px solid #eee;
|
||||
:nth-child(2) {
|
||||
height: 38px;
|
||||
width: 100%;
|
||||
height: auto;
|
||||
max-height: 32px;
|
||||
line-height: 16px;
|
||||
margin-top: 4px;
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-align: center;
|
||||
}
|
||||
:nth-child(3) {
|
||||
color: $theme_color;
|
||||
margin-top: 5px;
|
||||
margin-top: 2px;
|
||||
line-height: 1.2;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.jiaobiao {
|
||||
position: absolute;
|
||||
width: 23px;
|
||||
height: 23px;
|
||||
top: 10px;
|
||||
right: 16px;
|
||||
top: 6px;
|
||||
right: 6px;
|
||||
background: url("../../../assets/festival_icon.png");
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
@@ -393,10 +486,11 @@ export default {
|
||||
background-position: -60px -30px;
|
||||
}
|
||||
}
|
||||
> div:nth-child(4),
|
||||
> div:nth-child(5),
|
||||
> div:nth-child(6) {
|
||||
border: none;
|
||||
> div:nth-child(3n) {
|
||||
border-right: none;
|
||||
}
|
||||
> div:nth-child(n + 4) {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -421,6 +515,8 @@ export default {
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
height: 370px;
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
}
|
||||
.con-item {
|
||||
width: 185px;
|
||||
@@ -434,6 +530,42 @@ export default {
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
.middle > .content .con-item {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
padding: 6px 4px 4px 6px;
|
||||
img {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
margin-top: 2px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
> div {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
p {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
.describe {
|
||||
margin-top: 4px;
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.left > .content .con-item {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.describe {
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
|
||||
@@ -115,9 +115,13 @@ export default {
|
||||
},
|
||||
handleSelectImg(index){
|
||||
// 选择图片
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.current = index;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -272,8 +272,12 @@ export default {
|
||||
},
|
||||
handleSelectImg() {
|
||||
// 选择图片
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 选择图片回调
|
||||
callbackSelected(val) {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-button @click="refresh">刷新</el-button>
|
||||
<el-button @click="add" type="primary">添加</el-button>
|
||||
</el-row>
|
||||
<el-tabs @click="handleClickType" v-model="currentTab" style="margin-top: 10px">
|
||||
<el-tabs @tab-click="handleClickType" v-model="currentTab" style="margin-top: 10px">
|
||||
<el-tab-pane label="运费模板" name="INFO">
|
||||
<table class="ncsc-default-table order m-b-30" :key="index" v-for="(item,index) in shipInfo">
|
||||
<tbody>
|
||||
@@ -79,50 +79,68 @@
|
||||
<div class="ncsu-trans-type" data-delivery="TRANSTYPE">
|
||||
<div class="entity">
|
||||
<div class="tbl-except">
|
||||
<table cellspacing="0" class="ncsc-default-table">
|
||||
<table cellspacing="0" class="ncsc-default-table ship-template-edit-table">
|
||||
<thead>
|
||||
<tr style="border-bottom: 1px solid #ddd;">
|
||||
<th class="w10"></th>
|
||||
<th class="tl">运送到</th>
|
||||
<th class="w10"></th>
|
||||
<th class="w50">首件(重)</th>
|
||||
<th class="w110">首费</th>
|
||||
<th class="w50">续件(重)</th>
|
||||
<th class="w110">续费</th>
|
||||
<th class="w150">操作</th>
|
||||
<tr>
|
||||
<th class="col-area">运送到</th>
|
||||
<th class="col-num">首件(重)</th>
|
||||
<th class="col-num">首费</th>
|
||||
<th class="col-num">续件(重)</th>
|
||||
<th class="col-num">续费</th>
|
||||
<th class="col-action">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="bd-line" data-group="n1" v-for="(item,index) in form.freightTemplateChildList"
|
||||
:key="index">
|
||||
<td></td>
|
||||
<td class="tl cell-area">
|
||||
<span class="area-group">
|
||||
<p style="display:inline-block">{{item.area}}</p>
|
||||
</span>
|
||||
<tr
|
||||
class="bd-line"
|
||||
v-for="(item,index) in form.freightTemplateChildList"
|
||||
:key="index"
|
||||
>
|
||||
<td class="col-area">
|
||||
<span class="area-group">{{ item.area || '未设置地区' }}</span>
|
||||
</td>
|
||||
<td></td>
|
||||
<td>
|
||||
<el-input-number class="text w40" v-model="item.firstCompany" :max="999" :min="0" :step="0.1" />
|
||||
<td class="col-num">
|
||||
<el-input-number
|
||||
v-model="item.firstCompany"
|
||||
:max="999"
|
||||
:min="0"
|
||||
:step="0.1"
|
||||
controls-position="right"
|
||||
size="small"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<el-input-number class="text w60" v-model="item.firstPrice" :max="999999" :min="0" />
|
||||
<td class="col-num">
|
||||
<el-input-number
|
||||
v-model="item.firstPrice"
|
||||
:max="999999"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
size="small"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<el-input-number class="text w40" v-model="item.continuedCompany" :max="999" :min="0" :step="0.1" />
|
||||
<td class="col-num">
|
||||
<el-input-number
|
||||
v-model="item.continuedCompany"
|
||||
:max="999"
|
||||
:min="0"
|
||||
:step="0.1"
|
||||
controls-position="right"
|
||||
size="small"
|
||||
/>
|
||||
</td>
|
||||
<td>
|
||||
<el-input-number class="text w60" v-model="item.continuedPrice" :max="999999" :min="0" />
|
||||
<td class="col-num">
|
||||
<el-input-number
|
||||
v-model="item.continuedPrice"
|
||||
:max="999999"
|
||||
:min="0"
|
||||
controls-position="right"
|
||||
size="small"
|
||||
/>
|
||||
</td>
|
||||
<td class="nscs-table-handle">
|
||||
<a
|
||||
@click="editRegion(item,index)"
|
||||
style="display:inline-block;margin-bottom:5px;color:#2d8cf0;cursor:pointer;text-decoration:none"
|
||||
>修改</a>
|
||||
<a
|
||||
@click="removeTemplateChildren(index)"
|
||||
style="display:inline-block;margin-bottom:5px;color:#2d8cf0;cursor:pointer;text-decoration:none"
|
||||
>删除</a>
|
||||
<td class="col-action">
|
||||
<a class="action-link" @click="editRegion(item,index)">修改</a>
|
||||
<span class="action-split">|</span>
|
||||
<a class="action-link" @click="removeTemplateChildren(index)">删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -172,10 +190,10 @@ export default {
|
||||
index:'0',
|
||||
selectedIndex: 0, //选中的地址模板下标
|
||||
item: "", //运费模板子模板
|
||||
shipInfo: {}, // 运费模板数据
|
||||
shipInfo: [], // 运费模板数据
|
||||
title: "添加运费模板", // 模态框标题
|
||||
operation: "add", // 操作状态
|
||||
currentTab: "", // 当前模板tab
|
||||
operation: "INFO", // 操作状态
|
||||
currentTab: "INFO", // 当前模板tab
|
||||
// submitLoading:false,
|
||||
saveError: false, // 是否显示错误提示
|
||||
csTab: false, // 添加运费模板显示
|
||||
@@ -211,11 +229,15 @@ export default {
|
||||
methods: {
|
||||
// 初始化数据
|
||||
init() {
|
||||
this.currentTab = "INFO";
|
||||
this.csTab = false;
|
||||
this.operation = "INFO";
|
||||
this.getData();
|
||||
},
|
||||
//切换tabPane
|
||||
handleClickType(v) {
|
||||
if (v == "INFO") {
|
||||
handleClickType(tab) {
|
||||
const tabName = tab.paneName ?? tab.props?.name;
|
||||
if (tabName === "INFO") {
|
||||
this.getData();
|
||||
this.csTab = false;
|
||||
}
|
||||
@@ -297,7 +319,7 @@ export default {
|
||||
//运费模板数据
|
||||
getData() {
|
||||
API_Shop.getShipTemplate().then((res) => {
|
||||
this.shipInfo = res.result;
|
||||
this.shipInfo = Array.isArray(res.result) ? res.result : [];
|
||||
});
|
||||
},
|
||||
/**
|
||||
@@ -619,6 +641,64 @@ em {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.ship-template-edit-table {
|
||||
table-layout: fixed;
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: 10px 12px;
|
||||
vertical-align: middle;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
thead th {
|
||||
text-align: center;
|
||||
font-weight: 500;
|
||||
color: #555;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
|
||||
.col-area {
|
||||
width: 32%;
|
||||
text-align: left;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.col-num {
|
||||
width: 14%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.col-action {
|
||||
width: 12%;
|
||||
text-align: center;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
:deep(.el-input-number) {
|
||||
width: 100%;
|
||||
max-width: 130px;
|
||||
}
|
||||
|
||||
:deep(.el-input-number .el-input__wrapper) {
|
||||
padding-left: 8px;
|
||||
padding-right: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
.action-link {
|
||||
color: #2d8cf0;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.action-split {
|
||||
margin: 0 6px;
|
||||
color: #dcdee2;
|
||||
}
|
||||
|
||||
.div-error {
|
||||
margin-left: 7px;
|
||||
margin-bottom: -8px;
|
||||
|
||||
@@ -156,8 +156,12 @@ export default {
|
||||
},
|
||||
// 点击选择照片
|
||||
handleClickFile() {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
}, // 图片选择器回显
|
||||
callbackSelected(val) {
|
||||
this.picModelFlag = false;
|
||||
|
||||
@@ -160,8 +160,12 @@ export default {
|
||||
},
|
||||
// 点击选择图片
|
||||
handleClickFile(item, index) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 点击链接
|
||||
clickLink(item) {
|
||||
|
||||
@@ -767,9 +767,13 @@ export default {
|
||||
},
|
||||
// 点击选择图片
|
||||
handleClickFile(item, index) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
this.selectedGoods = item;
|
||||
this.picModelFlag = true;
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.ossManage) {
|
||||
this.$refs.ossManage.selectImage = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
removeNotice(index) {
|
||||
this.$nextTick(() => {
|
||||
|
||||
@@ -415,7 +415,7 @@ export default {
|
||||
methods: {
|
||||
goDetail(row) {
|
||||
const sn = row.sn;
|
||||
const path = this.orderOrRefund === "order" ? "order-detail" : "after-order-detail";
|
||||
const path = this.orderOrRefund === "order" ? "order-detail" : "return-goods-order-detail";
|
||||
this.$router.push({ path, query: { sn } });
|
||||
},
|
||||
// 订单图
|
||||
|
||||
Reference in New Issue
Block a user