mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-06-24 02:50:22 +08:00
fix: 更新 API 请求参数格式及优化组件样式
- 将 addEvaluation API 的参数从 params 修改为 data,以符合标准请求格式 - 在多个组件中调整样式,提升响应式布局和用户体验 - 优化商品详情页的倒计时显示,增强视觉效果 - 更新购物车操作按钮样式,提升一致性和可用性
This commit is contained in:
@@ -158,7 +158,7 @@ export function addEvaluation (params) {
|
|||||||
url: `/buyer/member/evaluation`,
|
url: `/buyer/member/evaluation`,
|
||||||
method: Method.POST,
|
method: Method.POST,
|
||||||
needToken: true,
|
needToken: true,
|
||||||
params
|
data: params
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,5 +18,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 与 CateNav 商品分类栏、Carousel 左占位一致的列宽
|
// 与 CateNav 商品分类栏、Carousel 左占位一致的列宽
|
||||||
|
$index-main-width: 1200px;
|
||||||
$index-side-col-width: 263.2px;
|
$index-side-col-width: 263.2px;
|
||||||
$index-col-gap: 10px;
|
$index-col-gap: 10px;
|
||||||
|
// 1200 - 263.2*2 - 10*2 = 653.6px
|
||||||
|
$index-center-col-width: $index-main-width - ($index-side-col-width * 2) - ($index-col-gap * 2);
|
||||||
|
|||||||
@@ -3,7 +3,12 @@
|
|||||||
<div class="wrapper" v-if="type === 'goodsDetail'">
|
<div class="wrapper" v-if="type === 'goodsDetail'">
|
||||||
<div class="wr-l"><el-icon :size="23"><AlarmClock /></el-icon> 秒杀活动</div>
|
<div class="wr-l"><el-icon :size="23"><AlarmClock /></el-icon> 秒杀活动</div>
|
||||||
<div class="count-down" v-if="end === ''">
|
<div class="count-down" v-if="end === ''">
|
||||||
<p>倒计时:</p><span>{{ hours }}</span><span>{{ minutes }}</span><span>{{ seconds }}</span>
|
<span class="count-down-label">倒计时:</span>
|
||||||
|
<span class="count-down-num">{{ hours }}</span>
|
||||||
|
<span class="count-down-colon">:</span>
|
||||||
|
<span class="count-down-num">{{ minutes }}</span>
|
||||||
|
<span class="count-down-colon">:</span>
|
||||||
|
<span class="count-down-num">{{ seconds }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>{{end}}</div>
|
<div v-else>{{end}}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -89,36 +94,35 @@ export default {
|
|||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
.count-down {
|
.count-down {
|
||||||
margin-right: -20px;
|
display: flex;
|
||||||
p{
|
align-items: center;
|
||||||
float: left;
|
gap: 4px;
|
||||||
line-height: 20px;
|
font-size: 13px;
|
||||||
|
line-height: 1;
|
||||||
|
|
||||||
|
.count-down-label {
|
||||||
|
flex-shrink: 0;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
> span {
|
|
||||||
position: relative;
|
.count-down-num {
|
||||||
float: left;
|
display: inline-flex;
|
||||||
width: 20px;
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
min-width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
text-align: center;
|
padding: 0 2px;
|
||||||
background-color: #2f3430;
|
background-color: #2f3430;
|
||||||
margin-right: 20px;
|
color: #fff;
|
||||||
color: white;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 20px;
|
line-height: 1;
|
||||||
&::after {
|
border-radius: 2px;
|
||||||
content: ":";
|
|
||||||
display: block;
|
|
||||||
position: absolute;
|
|
||||||
right: -20px;
|
|
||||||
font-weight: bolder;
|
|
||||||
font-size: 14px;
|
|
||||||
width: 20px;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
> span:last-child::after {
|
|
||||||
content: "";
|
.count-down-colon {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,12 @@
|
|||||||
<p class="remarks-content">{{ item.reply }}</p>
|
<p class="remarks-content">{{ item.reply }}</p>
|
||||||
<div>
|
<div>
|
||||||
<div class="comment-img" v-if="item.replyImage">
|
<div class="comment-img" v-if="item.replyImage">
|
||||||
<div v-for="(img, imgIndex) in item.replyImage.split(',')" @click="$previewImage(img)" :key="imgIndex">
|
<div
|
||||||
|
v-for="(img, imgIndex) in item.replyImage.split(',')"
|
||||||
|
:key="imgIndex"
|
||||||
|
:class="{ borderColor: img === item.previewImg }"
|
||||||
|
@click="previewImg(img, item)"
|
||||||
|
>
|
||||||
<img :src="img" alt="">
|
<img :src="img" alt="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ export default {
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav ul {
|
.nav > ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
@@ -234,10 +234,11 @@ export default {
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav li {
|
.nav > ul > li,
|
||||||
|
.location > ul.flex > li {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
float: none;
|
float: none;
|
||||||
line-height: 1;
|
line-height: 36px;
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -331,6 +332,7 @@ export default {
|
|||||||
|
|
||||||
.username-p {
|
.username-p {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 100;
|
||||||
|
|
||||||
div {
|
div {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -345,59 +347,71 @@ export default {
|
|||||||
.drop-items {
|
.drop-items {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
display: none;
|
display: none;
|
||||||
top: 45px;
|
flex-direction: column;
|
||||||
left: 0;
|
top: calc(100% + 10px);
|
||||||
right: 0;
|
left: 50%;
|
||||||
margin: 0 auto;
|
transform: translateX(-50%);
|
||||||
padding: 5px 10px;
|
margin: 0;
|
||||||
z-index: 20;
|
padding: 4px 0;
|
||||||
height: 150px;
|
z-index: 1000;
|
||||||
|
min-width: 100px;
|
||||||
|
width: max-content;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
width: 80px;
|
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
box-shadow: 2px 2px 7px #999;
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
|
||||||
|
list-style: none;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
color: rgb(107, 106, 106);
|
display: block;
|
||||||
|
float: none;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: 1px solid rgb(207, 206, 206);
|
margin: 0;
|
||||||
|
padding: 8px 16px;
|
||||||
|
line-height: 1.4;
|
||||||
|
color: #666;
|
||||||
|
font-size: 13px;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
white-space: nowrap;
|
||||||
|
border-bottom: 1px solid #f0f0f0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
border: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
color: $theme_color;
|
color: $theme_color;
|
||||||
|
background-color: #fff7f7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -20px;
|
top: -6px;
|
||||||
left: 30px;
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
content: '';
|
content: '';
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 0;
|
height: 0;
|
||||||
border: 10px solid #999;
|
border: 6px solid transparent;
|
||||||
border-color: transparent transparent #fff transparent;
|
border-bottom-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 80px;
|
width: 100%;
|
||||||
height: 20px;
|
height: 10px;
|
||||||
top: -20px;
|
top: -10px;
|
||||||
left: 0;
|
left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.drop-items {
|
.drop-items {
|
||||||
display: block;
|
display: flex;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ export default {
|
|||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.model-form {
|
.model-form {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.model-content {
|
.model-content {
|
||||||
|
|||||||
@@ -193,8 +193,10 @@ export default {
|
|||||||
}
|
}
|
||||||
.carousel-wrap {
|
.carousel-wrap {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
overflow: visible;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.bannerAd{
|
.bannerAd{
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
<!-- 侧边导航占位(与 CateNav 分类栏同宽,勿与 CateNav .nav-side 混用类名) -->
|
<!-- 侧边导航占位(与 CateNav 分类栏同宽,勿与 CateNav .nav-side 混用类名) -->
|
||||||
<div class="carousel-side-spacer"></div>
|
<div class="carousel-side-spacer"></div>
|
||||||
<div class="nav-content">
|
<div class="nav-content">
|
||||||
<!-- 轮播图:无数据时不挂载 el-carousel,避免 Element Plus 卸载子项时报错 -->
|
<!-- 轮播图:无有效图片时不挂载 el-carousel;勿对 el-carousel 使用随图片变化的 key,否则 Vue3 patch 会报 emitsOptions 错误 -->
|
||||||
<el-carousel
|
<el-carousel
|
||||||
v-if="carouselList.length"
|
v-if="displaySlides.length"
|
||||||
:key="carouselRenderKey"
|
|
||||||
height="334px"
|
height="334px"
|
||||||
:interval="5000"
|
:interval="5000"
|
||||||
|
:loop="displaySlides.length > 1"
|
||||||
>
|
>
|
||||||
<el-carousel-item
|
<el-carousel-item
|
||||||
v-for="(item, index) in carouselList"
|
v-for="(item, index) in displaySlides"
|
||||||
:key="carouselItemKey(item, index)"
|
:key="carouselItemKey(item, index)"
|
||||||
>
|
>
|
||||||
<div class="swiper-img">
|
<div class="swiper-img">
|
||||||
@@ -96,10 +96,8 @@ export default {
|
|||||||
carouselList() {
|
carouselList() {
|
||||||
return this.data?.options?.list || [];
|
return this.data?.options?.list || [];
|
||||||
},
|
},
|
||||||
carouselRenderKey() {
|
displaySlides() {
|
||||||
const moduleKey = this.data?.key || "carousel";
|
return this.carouselList.filter((item) => item && item.img);
|
||||||
const imgs = this.carouselList.map((item) => item?.img || "").join("|");
|
|
||||||
return `${moduleKey}-${this.carouselList.length}-${imgs}`;
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -291,12 +289,14 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.model-carousel {
|
.model-carousel {
|
||||||
width: 1200px;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 1200px;
|
||||||
height: 340px;
|
height: 340px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
overflow: visible;
|
overflow: hidden;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
position: relative;
|
||||||
|
z-index: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hover-pointer {
|
.hover-pointer {
|
||||||
@@ -358,14 +358,14 @@ export default {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 导航主体:固定列宽与 CateNav 完全一致(263.2 + 10 + 637 + 10 + 263.2 = 1183.4px) */
|
/* 导航主体:263.2 + 10 + 1fr + 10 + 263.2 = 1200px,与下方楼层右缘对齐 */
|
||||||
.nav-body {
|
.nav-body {
|
||||||
width: 1200px;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 1200px;
|
||||||
height: 340px;
|
height: 340px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 263.2px 637px 263.2px;
|
grid-template-columns: 263.2px minmax(0, 1fr) 263.2px;
|
||||||
column-gap: 10px;
|
column-gap: 10px;
|
||||||
align-items: start;
|
align-items: start;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -385,9 +385,8 @@ export default {
|
|||||||
/*导航内容*/
|
/*导航内容*/
|
||||||
.nav-content {
|
.nav-content {
|
||||||
grid-column: 2;
|
grid-column: 2;
|
||||||
width: 637px;
|
width: 100%;
|
||||||
min-width: 637px;
|
min-width: 0;
|
||||||
max-width: 637px;
|
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
height: 333.9px;
|
height: 333.9px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ export default {
|
|||||||
}
|
}
|
||||||
.cate-nav {
|
.cate-nav {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 3;
|
z-index: 5;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
margin: 14px 0 0;
|
margin: 14px 0 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@@ -286,6 +286,7 @@ export default {
|
|||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
color: #333333;
|
color: #333333;
|
||||||
letter-spacing: 0px;
|
letter-spacing: 0px;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.nav-item {
|
.nav-item {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
@@ -317,7 +318,7 @@ export default {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
top: 46px;
|
top: 46px;
|
||||||
z-index: 10;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-side {
|
.nav-side {
|
||||||
@@ -356,11 +357,14 @@ export default {
|
|||||||
.nav-side ul {
|
.nav-side ul {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
}
|
}
|
||||||
.nav-side li {
|
.nav-side li {
|
||||||
padding: 0 0 16.2px 37.4px;
|
padding: 0 0 16.2px 37.4px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
line-height: 18px;
|
line-height: 18px;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
.nav-side-item:hover {
|
.nav-side-item:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -37,7 +37,7 @@
|
|||||||
<div class="width_150">单价(元)</div>
|
<div class="width_150">单价(元)</div>
|
||||||
<div class="width_100">数量</div>
|
<div class="width_100">数量</div>
|
||||||
<div class="width_150">小计</div>
|
<div class="width_150">小计</div>
|
||||||
<div class="width_100">操作</div>
|
<div class="cart-ops-col">操作</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="cartList.length === 0" class="cart-empty">
|
<div v-if="cartList.length === 0" class="cart-empty">
|
||||||
<p>购物车空空如也</p>
|
<p>购物车空空如也</p>
|
||||||
@@ -172,22 +172,21 @@
|
|||||||
<div class="width_150">
|
<div class="width_150">
|
||||||
{{ $filters.unitPrice(goods.subTotal, "¥") }}
|
{{ $filters.unitPrice(goods.subTotal, "¥") }}
|
||||||
</div>
|
</div>
|
||||||
<div class="width_100">
|
<div class="cart-ops-col">
|
||||||
<el-button
|
<div v-if="!goods.errorMessage" class="cart-ops">
|
||||||
v-if="!goods.errorMessage"
|
<el-button
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
class="cart-del-btn"
|
||||||
@click="delGoods(goods.goodsSku.id)"
|
@click="delGoods(goods.goodsSku.id)"
|
||||||
>删除</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
v-if="!goods.errorMessage"
|
size="small"
|
||||||
size="small"
|
class="cart-collect-btn"
|
||||||
type="info"
|
@click="collectGoods(goods.goodsSku.id)"
|
||||||
@click="collectGoods(goods.goodsSku.id)"
|
>收藏</el-button
|
||||||
style="margin-left: 10px"
|
>
|
||||||
>收藏</el-button
|
</div>
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="error-goods" v-if="goods.errorMessage">
|
<div class="error-goods" v-if="goods.errorMessage">
|
||||||
<div style="margin-top: 20px">{{ goods.errorMessage }}</div>
|
<div style="margin-top: 20px">{{ goods.errorMessage }}</div>
|
||||||
@@ -767,6 +766,48 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cart-ops-col {
|
||||||
|
width: 130px;
|
||||||
|
min-width: 130px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-ops {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 8px;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-del-btn {
|
||||||
|
background-color: #ff7d79 !important;
|
||||||
|
border-color: #ff7d79 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
background-color: #ff6b66 !important;
|
||||||
|
border-color: #ff6b66 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.cart-collect-btn {
|
||||||
|
background-color: #fa6419 !important;
|
||||||
|
border-color: #fa6419 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:focus {
|
||||||
|
background-color: #e55a15 !important;
|
||||||
|
border-color: #e55a15 !important;
|
||||||
|
color: #fff !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.el-input-number .el-input__inner {
|
.el-input-number .el-input__inner {
|
||||||
|
|||||||
@@ -28,10 +28,10 @@
|
|||||||
<div class="eval-con">
|
<div class="eval-con">
|
||||||
<div>
|
<div>
|
||||||
<span class="color999">商品评价:</span>
|
<span class="color999">商品评价:</span>
|
||||||
<el-radio-group style="margin-bottom:5px;color:#999" v-model="orderGoods.grade" type="button" button-style="solid">
|
<el-radio-group v-model="orderGoods.grade">
|
||||||
<el-radio label="GOOD">好评</el-radio>
|
<el-radio-button value="GOOD">好评</el-radio-button>
|
||||||
<el-radio label="MODERATE">中评</el-radio>
|
<el-radio-button value="MODERATE">中评</el-radio-button>
|
||||||
<el-radio label="WORSE">差评</el-radio>
|
<el-radio-button value="WORSE">差评</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<el-input type="textarea" maxlength="500" show-word-limit :rows="4" v-model="orderGoods.content" />
|
<el-input type="textarea" maxlength="500" show-word-limit :rows="4" v-model="orderGoods.content" />
|
||||||
</div>
|
</div>
|
||||||
@@ -106,6 +106,12 @@ export default {
|
|||||||
|
|
||||||
if (!this.form.descriptionScore) {
|
if (!this.form.descriptionScore) {
|
||||||
this.$Message.warning('描述评价不能为空')
|
this.$Message.warning('描述评价不能为空')
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this.orderGoods.content || !String(this.orderGoods.content).trim()) {
|
||||||
|
this.$Message.warning('评论内容不能为空')
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@@ -118,17 +124,20 @@ export default {
|
|||||||
serviceScore: this.form.serviceScore,
|
serviceScore: this.form.serviceScore,
|
||||||
deliveryScore: this.form.deliveryScore,
|
deliveryScore: this.form.deliveryScore,
|
||||||
grade: goods.grade,
|
grade: goods.grade,
|
||||||
content: goods.content || '',
|
content: goods.content.trim(),
|
||||||
images: goods.uploadList.toString()
|
images: goods.uploadList.length ? goods.uploadList.join(',') : ''
|
||||||
}
|
}
|
||||||
addEvaluation(params).then(res => {
|
addEvaluation(params).then(res => {
|
||||||
this.loading = false
|
this.loading = false
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.$Message.success('评价成功')
|
this.$Message.success('评价成功')
|
||||||
this.$router.push('/home/CommentList')
|
this.$router.push('/home/CommentList')
|
||||||
|
} else {
|
||||||
|
this.$Message.error(res.message || '评价失败,请稍后重试')
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch((err) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
this.$Message.error(err?.message || '评价失败,请稍后重试')
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
goGoodsDetail (skuId, goodsId) { // 跳转商品详情
|
||||||
|
|||||||
@@ -29,8 +29,13 @@
|
|||||||
<el-input type="number" v-model="form.num" style="width:260px" />
|
<el-input type="number" v-model="form.num" style="width:260px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="提交原因" prop="reason">
|
<el-form-item label="提交原因" prop="reason">
|
||||||
<el-select v-model="form.reason" style="width:260px">
|
<el-select v-model="form.reason" style="width:260px" placeholder="请选择提交原因">
|
||||||
<el-option v-for="item in reasonList" :value="item.id" :key="item.id">{{ item.reason }}</el-option>
|
<el-option
|
||||||
|
v-for="item in reasonList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.reason"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="问题描述" prop="problemDesc">
|
<el-form-item label="问题描述" prop="problemDesc">
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<div class="address-header">
|
<div class="address-header">
|
||||||
<span>
|
<span>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
<el-tag class="ml_10" v-if="item.isDefault" color="red">默认地址</el-tag>
|
<el-tag class="ml_10 default-address-tag" v-if="item.isDefault">默认地址</el-tag>
|
||||||
<el-tag class="ml_10" v-if="item.alias" color="warning">{{item.alias}}</el-tag>
|
<el-tag class="ml_10" v-if="item.alias" color="warning">{{item.alias}}</el-tag>
|
||||||
</span>
|
</span>
|
||||||
<div class="address-action">
|
<div class="address-action">
|
||||||
@@ -121,6 +121,12 @@ export default {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.default-address-tag {
|
||||||
|
background-color: #fff3f2 !important;
|
||||||
|
border: 1px solid $theme_color !important;
|
||||||
|
color: $theme_color !important;
|
||||||
|
}
|
||||||
|
|
||||||
#map-container {
|
#map-container {
|
||||||
width: 500px;
|
width: 500px;
|
||||||
height: 300px;
|
height: 300px;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
:key="index"
|
:key="index"
|
||||||
@click="goodsDetail(item.id, item.goodsId)"
|
@click="goodsDetail(item.id, item.goodsId)"
|
||||||
>
|
>
|
||||||
<img :src="item.thumbnail" :alt="item.thumbnail" width="200" height="200" />
|
<img :src="item.thumbnail" :alt="item.goodsName" />
|
||||||
<p class="ellipsis">{{ item.goodsName }}</p>
|
<p class="ellipsis">{{ item.goodsName }}</p>
|
||||||
<p>{{ $filters.unitPrice(item.price, "¥") }}</p>
|
<p>{{ $filters.unitPrice(item.price, "¥") }}</p>
|
||||||
<span class="del-icon" @click.stop="clearById(item.goodsId)">
|
<span class="del-icon" @click.stop="clearById(item.goodsId)">
|
||||||
@@ -132,15 +132,27 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.track-list {
|
.track-list {
|
||||||
display: flex;
|
display: grid;
|
||||||
flex-wrap: wrap;
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
gap: 12px;
|
||||||
|
padding: 0 15px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
width: 200px;
|
width: 100%;
|
||||||
|
min-width: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
margin-left: 15px;
|
|
||||||
margin-bottom: 10px;
|
|
||||||
border: 1px solid #eee;
|
border: 1px solid #eee;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
object-fit: cover;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
box-shadow: 1px 1px 3px #999;
|
box-shadow: 1px 1px 3px #999;
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
</template>
|
</template>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- 秒杀商品列表 -->
|
<!-- 秒杀商品列表 -->
|
||||||
<div class="goods-list">
|
<div class="seckill-goods-wrap">
|
||||||
|
<div class="goods-list">
|
||||||
<empty v-if="goodsList.length === 0" />
|
<empty v-if="goodsList.length === 0" />
|
||||||
<div v-else class="goods-show-info1" v-for="(item, index) in goodsList" :key="index"
|
<div v-else class="goods-show-info1" v-for="(item, index) in goodsList" :key="index"
|
||||||
@click="goGoodsDetail(item.skuId, item.goodsId)">
|
@click="goGoodsDetail(item.skuId, item.goodsId)">
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
<span>{{ item.storeName }}</span>
|
<span>{{ item.storeName }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<BaseFooter />
|
<BaseFooter />
|
||||||
</div>
|
</div>
|
||||||
@@ -199,10 +201,12 @@ export default {
|
|||||||
|
|
||||||
.time-line {
|
.time-line {
|
||||||
width: 1200px;
|
width: 1200px;
|
||||||
|
max-width: 1200px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
padding: 0 30px;
|
padding: 0 30px;
|
||||||
@@ -242,15 +246,29 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.seckill-goods-wrap {
|
||||||
|
width: 1200px;
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
box-sizing: border-box;
|
||||||
|
|
||||||
|
.goods-list {
|
||||||
|
width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
column-gap: 10px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.goods-show-info1 {
|
.goods-show-info1 {
|
||||||
width: 290px;
|
width: calc(25% - 8px);
|
||||||
|
min-width: 0;
|
||||||
padding: 6px;
|
padding: 6px;
|
||||||
margin: 10px 0px;
|
margin: 10px 0;
|
||||||
margin-left: 8px;
|
|
||||||
position: relative;
|
position: relative;
|
||||||
border: 1px solid #fff;
|
border: 1px solid #fff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.goods-show-info1:hover {
|
.goods-show-info1:hover {
|
||||||
@@ -261,6 +279,22 @@ export default {
|
|||||||
.goods-show-img {
|
.goods-show-img {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 200px;
|
||||||
|
height: auto;
|
||||||
|
aspect-ratio: 1;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-show-num1 {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
font-size: 12px;
|
||||||
|
margin-bottom: 6px;
|
||||||
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-progress-bar__inner {
|
.el-progress-bar__inner {
|
||||||
|
|||||||
@@ -27,9 +27,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div
|
<div class="wap-content-list">
|
||||||
class="wap-content-list"
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="wap-content-item"
|
class="wap-content-item"
|
||||||
:class="{ active: item.selected }"
|
:class="{ active: item.selected }"
|
||||||
@@ -77,13 +75,19 @@
|
|||||||
<script>
|
<script>
|
||||||
import * as API_Goods from "@/api/goods";
|
import * as API_Goods from "@/api/goods";
|
||||||
export default {
|
export default {
|
||||||
|
props: {
|
||||||
|
selectedWay: {
|
||||||
|
type: Array,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
type: "multiple", //单选或者多选 single multiple
|
type: "multiple",
|
||||||
skuList: [], // 商品sku列表
|
selectedList: [],
|
||||||
total: 0, // 商品总数
|
skuList: [],
|
||||||
|
total: 0,
|
||||||
goodsParams: {
|
goodsParams: {
|
||||||
// 商品请求参数
|
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 15,
|
pageSize: 15,
|
||||||
order: "desc",
|
order: "desc",
|
||||||
@@ -92,37 +96,30 @@ export default {
|
|||||||
categoryPath: "",
|
categoryPath: "",
|
||||||
marketEnable: "UPPER",
|
marketEnable: "UPPER",
|
||||||
authFlag: "PASS",
|
authFlag: "PASS",
|
||||||
sort:"createTime"
|
sort: "createTime",
|
||||||
},
|
},
|
||||||
category: [], // 分类
|
category: [],
|
||||||
goodsData: [], // 商品数据
|
goodsData: [],
|
||||||
empty: false, // 空数据
|
empty: false,
|
||||||
loading: false, // 加载状态
|
loading: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: {
|
|
||||||
selectedWay: {
|
|
||||||
type: Array,
|
|
||||||
default: function () {
|
|
||||||
return new Array();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
category(val) {
|
category(val) {
|
||||||
this.goodsParams.categoryPath = val[2];
|
this.goodsParams.categoryPath = val && val.length ? val[2] : "";
|
||||||
},
|
},
|
||||||
selectedWay: {
|
selectedWay: {
|
||||||
handler() {
|
handler(val) {
|
||||||
this.$emit("selected", this.selectedWay);
|
this.selectedList = Array.isArray(val) ? val.slice() : [];
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
},
|
},
|
||||||
"goodsParams.categoryPath": {
|
"goodsParams.categoryPath": {
|
||||||
handler: function () {
|
handler() {
|
||||||
this.goodsData = [];
|
this.goodsData = [];
|
||||||
(this.goodsParams.pageNumber = 0), this.getQueryGoodsList();
|
this.goodsParams.pageNumber = 1;
|
||||||
|
this.getQueryGoodsList();
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
},
|
},
|
||||||
@@ -136,57 +133,59 @@ export default {
|
|||||||
this.goodsParams.pageNumber = 1;
|
this.goodsParams.pageNumber = 1;
|
||||||
this.getQueryGoodsList();
|
this.getQueryGoodsList();
|
||||||
},
|
},
|
||||||
changePageSize(v){
|
changePageSize(v) {
|
||||||
this.goodsParams.pageNumber = v;
|
this.goodsParams.pageNumber = v;
|
||||||
this.getQueryGoodsList();
|
this.getQueryGoodsList();
|
||||||
},
|
},
|
||||||
// 获取商品列表
|
|
||||||
getQueryGoodsList() {
|
getQueryGoodsList() {
|
||||||
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
this.loading = true;
|
||||||
this.initGoods(res);
|
API_Goods.getGoodsSkuData(this.goodsParams)
|
||||||
});
|
.then((res) => {
|
||||||
|
this.initGoods(res);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 获取列表方法
|
|
||||||
initGoods(res) {
|
initGoods(res) {
|
||||||
if (res.result.records.length != 0) {
|
const records = res?.result?.records || [];
|
||||||
res.result.records.forEach((item) => {
|
if (records.length) {
|
||||||
|
records.forEach((item) => {
|
||||||
item.selected = false;
|
item.selected = false;
|
||||||
item.___type = "goods"; //设置为goods让pc wap知道标识
|
item.___type = "goods";
|
||||||
this.selectedWay.forEach((e) => {
|
this.selectedList.forEach((e) => {
|
||||||
if (e.id && e.id === item.id) {
|
if (e.id && e.id === item.id) {
|
||||||
item.selected = true;
|
item.selected = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
/**
|
this.total = res.result.total || 0;
|
||||||
* 解决数据请求中,滚动栏会一直上下跳动
|
this.goodsData = records;
|
||||||
*/
|
this.empty = false;
|
||||||
this.total = res.result.total;
|
|
||||||
this.goodsData = res.result.records;
|
|
||||||
} else {
|
} else {
|
||||||
|
this.goodsData = [];
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 查询商品
|
emitSelected(list) {
|
||||||
|
this.selectedList = list;
|
||||||
|
this.$emit("selected", this.selectedList);
|
||||||
|
},
|
||||||
init() {
|
init() {
|
||||||
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
||||||
// 商品
|
|
||||||
this.initGoods(res);
|
this.initGoods(res);
|
||||||
});
|
});
|
||||||
API_Goods.getCategoryTree({deleteFlag: false}).then((res) => {
|
API_Goods.getCategoryTree({ deleteFlag: false }).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
this.deepGroup(res.result);
|
this.deepGroup(res.result);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
deepGroup(val) {
|
deepGroup(val) {
|
||||||
val.forEach((item) => {
|
val.forEach((item) => {
|
||||||
let childWay = []; //第二级
|
let childWay = [];
|
||||||
// 第二层
|
|
||||||
if (item.children) {
|
if (item.children) {
|
||||||
item.children.forEach((child) => {
|
item.children.forEach((child) => {
|
||||||
// // 第三层
|
|
||||||
if (child.children) {
|
if (child.children) {
|
||||||
child.children.forEach((grandson, index, arr) => {
|
child.children.forEach((grandson, index, arr) => {
|
||||||
arr[index] = {
|
arr[index] = {
|
||||||
@@ -195,52 +194,36 @@ export default {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let children = {
|
childWay.push({
|
||||||
value: child.id,
|
value: child.id,
|
||||||
label: child.name,
|
label: child.name,
|
||||||
children: child.children,
|
children: child.children,
|
||||||
};
|
});
|
||||||
childWay.push(children);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 第一层
|
this.skuList.push({
|
||||||
let way = {
|
|
||||||
value: item.id,
|
value: item.id,
|
||||||
label: item.name,
|
label: item.name,
|
||||||
children: childWay,
|
children: childWay,
|
||||||
};
|
});
|
||||||
|
|
||||||
this.skuList.push(way);
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
checkedGoods(val) {
|
||||||
/**
|
if (this.type !== "multiple") {
|
||||||
* 点击商品
|
|
||||||
*/
|
|
||||||
checkedGoods(val, index) {
|
|
||||||
// 如果单选的话
|
|
||||||
if (this.type != "multiple") {
|
|
||||||
this.goodsData.forEach((item) => {
|
this.goodsData.forEach((item) => {
|
||||||
item.selected = false;
|
item.selected = false;
|
||||||
});
|
});
|
||||||
this.selectedWay = [];
|
|
||||||
val.selected = true;
|
val.selected = true;
|
||||||
this.selectedWay.push(val);
|
this.emitSelected([val]);
|
||||||
|
return;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (val.selected == false) {
|
if (!val.selected) {
|
||||||
val.selected = true;
|
val.selected = true;
|
||||||
this.selectedWay.push(val);
|
this.emitSelected([...this.selectedList, val]);
|
||||||
} else {
|
} else {
|
||||||
val.selected = false;
|
val.selected = false;
|
||||||
for (let i = 0; i < this.selectedWay.length; i++) {
|
this.emitSelected(this.selectedList.filter((item) => item.id !== val.id));
|
||||||
if (this.selectedWay[i].id === val.id) {
|
|
||||||
this.selectedWay.splice(i, 1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -271,9 +254,6 @@ export default {
|
|||||||
margin: 10px 7px;
|
margin: 10px 7px;
|
||||||
padding: 6px 0;
|
padding: 6px 0;
|
||||||
}
|
}
|
||||||
// .wap-content-item{
|
|
||||||
|
|
||||||
// }
|
|
||||||
.active {
|
.active {
|
||||||
background: url("../../assets/selected.png") no-repeat;
|
background: url("../../assets/selected.png") no-repeat;
|
||||||
background-position: right;
|
background-position: right;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<div
|
<div
|
||||||
v-for="(item, index) in data[plant]"
|
v-for="(item, index) in data[plant]"
|
||||||
:key="index"
|
:key="index"
|
||||||
:class="{ active: chiosend[plantIndex]?.id == item.id }"
|
:class="{ active: chiosend[plantIndex] && chiosend[plantIndex].id == item.id }"
|
||||||
class="map-item"
|
class="map-item"
|
||||||
@click="
|
@click="
|
||||||
init(
|
init(
|
||||||
|
|||||||
@@ -380,7 +380,8 @@ export default {
|
|||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
getOrderNumData() {
|
getOrderNumData() {
|
||||||
const { orderStatus, ...searchParams } = this.searchForm;
|
// orderNum 接口仅查 li_order,不含 order_item 关联;keywords/goodsName 会引用 oi 字段导致 SQL 报错
|
||||||
|
const { orderStatus, keywords, goodsName, ...searchParams } = this.searchForm;
|
||||||
API_Order.getOrderNum(searchParams)
|
API_Order.getOrderNum(searchParams)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-card>
|
<el-card>
|
||||||
<div class="operation" style="margin: 10px 0">
|
<div class="operation">
|
||||||
<el-button type="primary" @click="delAll">批量下架</el-button>
|
<el-button type="primary" @click="add">添加</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-table
|
<el-table
|
||||||
@@ -35,44 +35,35 @@
|
|||||||
:data="data"
|
:data="data"
|
||||||
class="mt_10"
|
class="mt_10"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
@selection-change="changeSelect"
|
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" fixed="left" />
|
<el-table-column label="商品名称" min-width="250">
|
||||||
<el-table-column label="商品图片" width="120" align="center" fixed="left">
|
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<img
|
<div v-if="row" class="goods-msg">
|
||||||
v-if="row"
|
<img :src="row.thumbnail" width="60" height="60" alt="" />
|
||||||
:src="row.thumbnail || ''"
|
<div>
|
||||||
alt="商品图"
|
<div class="div-zoom">
|
||||||
style="cursor: pointer; width: 80px; height: 60px; margin: 10px 0; object-fit: contain"
|
<a class="link-text" @click="linkTo(row.goodsId, row.skuId)">{{ row.goodsName }}</a>
|
||||||
/>
|
</div>
|
||||||
</template>
|
<el-popover trigger="hover" title="扫码在手机中查看" placement="top" width="180">
|
||||||
</el-table-column>
|
<template #reference>
|
||||||
<el-table-column label="商品名称" min-width="220" show-overflow-tooltip>
|
<img
|
||||||
<template #default="{ row }">
|
src="../../assets/qrcode.svg"
|
||||||
<template v-if="row">
|
class="hover-pointer"
|
||||||
<div class="div-zoom">
|
width="20"
|
||||||
<a class="link-text" @click="linkTo(row.goodsId, row.skuId)">{{ row.goodsName }}</a>
|
height="20"
|
||||||
</div>
|
alt="qrcode"
|
||||||
<el-popover trigger="hover" title="扫码在手机中查看" placement="top" width="180">
|
/>
|
||||||
<template #reference>
|
</template>
|
||||||
<img
|
<vue-qr
|
||||||
src="../../assets/qrcode.svg"
|
:text="wapLinkTo(row.goodsId, row.skuId)"
|
||||||
class="hover-pointer"
|
:margin="0"
|
||||||
width="20"
|
color-dark="#000"
|
||||||
height="20"
|
color-light="#fff"
|
||||||
alt="qrcode"
|
:size="150"
|
||||||
/>
|
/>
|
||||||
</template>
|
</el-popover>
|
||||||
<vue-qr
|
</div>
|
||||||
:text="wapLinkTo(row.goodsId, row.skuId)"
|
</div>
|
||||||
:margin="0"
|
|
||||||
color-dark="#000"
|
|
||||||
color-light="#fff"
|
|
||||||
:size="150"
|
|
||||||
/>
|
|
||||||
</el-popover>
|
|
||||||
</template>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="商品价格" min-width="110">
|
<el-table-column label="商品价格" min-width="110">
|
||||||
@@ -82,15 +73,16 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="quantity" label="库存" min-width="80" />
|
<el-table-column prop="quantity" label="库存" min-width="80" />
|
||||||
<el-table-column prop="createTime" label="添加时间" min-width="160" />
|
<el-table-column prop="createTime" label="添加时间" min-width="160" />
|
||||||
<el-table-column prop="storeName" label="店铺名称" min-width="120" show-overflow-tooltip />
|
|
||||||
<el-table-column label="佣金金额" min-width="110">
|
<el-table-column label="佣金金额" min-width="110">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<span v-if="row" :style="{ color: $mainColor }">{{ $filters.unitPrice(row.commission, "¥") }}</span>
|
<span v-if="row" :style="{ color: $mainColor }">
|
||||||
|
{{ $filters.unitPrice(row.commission ?? 0, "¥") }}
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" min-width="100" align="center" fixed="right">
|
<el-table-column label="操作" min-width="100" align="center" fixed="right">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<a v-if="row" class="link-text" @click="remove(row)">下架</a>
|
<a v-if="row" class="link-text" @click="remove(row)">删除</a>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -99,7 +91,7 @@
|
|||||||
<el-pagination
|
<el-pagination
|
||||||
v-model:current-page="searchForm.pageNumber"
|
v-model:current-page="searchForm.pageNumber"
|
||||||
v-model:page-size="searchForm.pageSize"
|
v-model:page-size="searchForm.pageSize"
|
||||||
:page-sizes="[20, 50, 100]"
|
:page-sizes="[10, 20, 50]"
|
||||||
:total="total"
|
:total="total"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -108,27 +100,67 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
|
<liliDialog ref="liliDialog" @selectedGoodsData="selectedGoodsData" />
|
||||||
|
|
||||||
|
<el-dialog
|
||||||
|
v-model="modalVisible"
|
||||||
|
:title="modalTitle"
|
||||||
|
width="500px"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
append-to-body
|
||||||
|
>
|
||||||
|
<el-form ref="form" :model="form" label-width="100px" :rules="formValidate">
|
||||||
|
<el-form-item label="分销佣金" prop="commission">
|
||||||
|
<el-input v-model="form.commission" clearable placeholder="请输入分销佣金" />
|
||||||
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { delDistributionGoods, getDistributionGoods } from "@/api/distribution";
|
import {
|
||||||
|
getDistributionGoods,
|
||||||
|
distributionGoodsCancel,
|
||||||
|
distributionGoodsCheck,
|
||||||
|
} from "@/api/distribution";
|
||||||
|
import liliDialog from "@/views/lili-dialog";
|
||||||
import vueQr from "vue-qr";
|
import vueQr from "vue-qr";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "distributionGoods",
|
name: "distributionGoods",
|
||||||
components: { vueQr },
|
components: { liliDialog, vueQr },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
modalVisible: false,
|
||||||
|
modalTitle: "添加分销商品",
|
||||||
|
submitLoading: false,
|
||||||
loading: true,
|
loading: true,
|
||||||
searchForm: {
|
searchForm: {
|
||||||
pageNumber: 1,
|
pageNumber: 1,
|
||||||
pageSize: 20,
|
pageSize: 10,
|
||||||
sort: "createTime",
|
sort: "createTime",
|
||||||
order: "desc",
|
order: "desc",
|
||||||
},
|
},
|
||||||
selectList: [],
|
form: {
|
||||||
selectCount: 0,
|
commission: 1,
|
||||||
|
},
|
||||||
|
skuId: 0,
|
||||||
|
formValidate: {
|
||||||
|
commission: [
|
||||||
|
{ required: true, message: "请输入大于1小于9999的合法佣金金额", trigger: "blur" },
|
||||||
|
{
|
||||||
|
pattern: /^[1-9]\d{0,3}(\.\d{1,2})?$/,
|
||||||
|
message: "请输入大于1小于9999的合法佣金金额",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
data: [],
|
data: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
};
|
};
|
||||||
@@ -137,72 +169,74 @@ export default {
|
|||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
|
add() {
|
||||||
|
this.$refs.liliDialog.goodsData = [];
|
||||||
|
this.$refs.liliDialog.open("goods", "single");
|
||||||
|
},
|
||||||
|
selectedGoodsData(selected) {
|
||||||
|
if (!selected?.length) return;
|
||||||
|
this.modalVisible = true;
|
||||||
|
this.form.commission = 1;
|
||||||
|
this.modalTitle = "添加分销商品";
|
||||||
|
this.skuId = selected[0].id;
|
||||||
|
},
|
||||||
|
handleSubmit() {
|
||||||
|
this.$refs.form.validate((valid) => {
|
||||||
|
if (!valid) return;
|
||||||
|
this.submitLoading = true;
|
||||||
|
distributionGoodsCheck(this.skuId, this.form)
|
||||||
|
.then((res) => {
|
||||||
|
if (res?.success || res?.message === "success") {
|
||||||
|
this.$Message.success("添加成功");
|
||||||
|
}
|
||||||
|
this.modalVisible = false;
|
||||||
|
this.getDataList();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.submitLoading = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
changePage(v) {
|
changePage(v) {
|
||||||
this.searchForm.pageNumber = v;
|
this.searchForm.pageNumber = v;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
this.clearSelectAll();
|
|
||||||
},
|
},
|
||||||
changePageSize(v) {
|
changePageSize(v) {
|
||||||
this.searchForm.pageSize = v;
|
this.searchForm.pageSize = v;
|
||||||
|
this.searchForm.pageNumber = 1;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
handleSearch() {
|
handleSearch() {
|
||||||
this.searchForm.pageNumber = 1;
|
this.searchForm.pageNumber = 1;
|
||||||
this.searchForm.pageSize = 20;
|
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
clearSelectAll() {
|
|
||||||
this.$refs.table?.clearSelection();
|
|
||||||
},
|
|
||||||
changeSelect(e) {
|
|
||||||
this.selectList = e;
|
|
||||||
this.selectCount = e.length;
|
|
||||||
},
|
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
getDistributionGoods(this.searchForm)
|
getDistributionGoods(this.searchForm)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res?.success) {
|
||||||
this.data = res.result.records;
|
const page = res.result || {};
|
||||||
this.total = res.result.total;
|
this.data = page.records || [];
|
||||||
|
this.total = page.total || 0;
|
||||||
|
} else {
|
||||||
|
this.data = [];
|
||||||
|
this.total = 0;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
remove(v) {
|
remove(row) {
|
||||||
this.$Modal.confirm({
|
this.$Modal.confirm({
|
||||||
title: "确认下架",
|
title: "确认删除",
|
||||||
content: "您确认要下架么?",
|
content: "您确认要删除此分销商品吗?",
|
||||||
loading: true,
|
loading: true,
|
||||||
onOk: () => {
|
onOk: () => {
|
||||||
delDistributionGoods(v.id).then((res) => {
|
distributionGoodsCancel(row.id).then((res) => {
|
||||||
this.$Modal.remove();
|
this.$Modal.remove();
|
||||||
if (res.success) {
|
if (res?.success) {
|
||||||
this.$Message.success("下架成功");
|
this.$Message.success("删除成功");
|
||||||
this.getDataList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
delAll() {
|
|
||||||
if (this.selectCount <= 0) {
|
|
||||||
this.$Message.warning("您还未选择要下架的数据");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.$Modal.confirm({
|
|
||||||
title: "确认下架",
|
|
||||||
content: "您确认要下架所选的 " + this.selectCount + " 条数据?",
|
|
||||||
loading: true,
|
|
||||||
onOk: () => {
|
|
||||||
const ids = this.selectList.map((item) => item.id);
|
|
||||||
delDistributionGoods(ids.toString()).then((res) => {
|
|
||||||
this.$Modal.remove();
|
|
||||||
if (res.success) {
|
|
||||||
this.$Message.success("下架成功");
|
|
||||||
this.clearSelectAll();
|
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -217,21 +251,39 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.operation {
|
||||||
|
margin: 10px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.goods-msg {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
gap: 13px;
|
||||||
|
padding: 5px 0;
|
||||||
|
|
||||||
|
img {
|
||||||
|
object-fit: contain;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.link-text {
|
.link-text {
|
||||||
color: #409eff;
|
color: #409eff;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.div-zoom {
|
.div-zoom {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hover-pointer {
|
.hover-pointer {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mt_10 {
|
.mt_10 {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="货号" prop="id">
|
<el-form-item label="货号" prop="sn">
|
||||||
<el-input v-model="searchForm.skuSn" placeholder="请输入货号" clearable style="width: 200px" />
|
<el-input v-model="searchForm.sn" placeholder="请输入货号" clearable style="width: 200px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
||||||
|
|||||||
@@ -55,22 +55,6 @@
|
|||||||
<el-option label="虚拟商品" value="VIRTUAL_GOODS" />
|
<el-option label="虚拟商品" value="VIRTUAL_GOODS" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="商品分组" prop="groupId">
|
|
||||||
<el-select
|
|
||||||
v-model="searchForm.groupId"
|
|
||||||
placeholder="请选择商品分组"
|
|
||||||
clearable
|
|
||||||
filterable
|
|
||||||
style="width: 240px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="item in goodsGroupList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.groupName"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
<el-button type="primary" class="search-btn" @click="handleSearch">搜索</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -90,14 +74,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="batch-operations" style="margin: 10px 0">
|
<div class="batch-operations" style="margin: 10px 0">
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
:disabled="selectedRows.length === 0"
|
|
||||||
style="margin-right: 10px"
|
|
||||||
@click="openSetGoodsGroup"
|
|
||||||
>
|
|
||||||
批量设置分组
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
:disabled="selectedRows.length === 0"
|
:disabled="selectedRows.length === 0"
|
||||||
@@ -209,38 +185,15 @@
|
|||||||
<el-button type="primary" :loading="submitLoading" @click="lower">提交</el-button>
|
<el-button type="primary" :loading="submitLoading" @click="lower">提交</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</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">
|
|
||||||
<el-select v-model="goodsGroupForm.groupId" clearable filterable style="width: 240px">
|
|
||||||
<el-option
|
|
||||||
v-for="item in goodsGroupList"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.groupName"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<el-button @click="goodsGroupFlag = false">取消</el-button>
|
|
||||||
<el-button type="primary" :loading="goodsGroupLoading" @click="submitSetGoodsGroup">确定</el-button>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as API_Shop from "@/api/shops";
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getGoodsListData,
|
getGoodsListData,
|
||||||
getGoodsNumerData,
|
getGoodsNumerData,
|
||||||
upGoods,
|
upGoods,
|
||||||
lowGoods,
|
lowGoods,
|
||||||
getGoodsGroupByPage,
|
|
||||||
addGoodsGroupItems
|
|
||||||
} from "@/api/goods";
|
} from "@/api/goods";
|
||||||
export default {
|
export default {
|
||||||
name: "goods",
|
name: "goods",
|
||||||
@@ -255,7 +208,6 @@ export default {
|
|||||||
pageSize: 20, // 页面大小
|
pageSize: 20, // 页面大小
|
||||||
sort: "create_time", // 默认排序字段
|
sort: "create_time", // 默认排序字段
|
||||||
order: "desc", // 默认排序方式
|
order: "desc", // 默认排序方式
|
||||||
groupId: "",
|
|
||||||
},
|
},
|
||||||
underForm: {
|
underForm: {
|
||||||
// 下架原因
|
// 下架原因
|
||||||
@@ -268,15 +220,6 @@ export default {
|
|||||||
goodsNumerData: {},
|
goodsNumerData: {},
|
||||||
selectedRows: [], // 选中的行数据
|
selectedRows: [], // 选中的行数据
|
||||||
selectAll: false, // 全选状态
|
selectAll: false, // 全选状态
|
||||||
goodsGroupFlag: false,
|
|
||||||
goodsGroupLoading: false,
|
|
||||||
goodsGroupList: [],
|
|
||||||
goodsGroupForm: {
|
|
||||||
groupId: ""
|
|
||||||
},
|
|
||||||
goodsGroupRule: {
|
|
||||||
groupId: [{ required: true, message: "请选择商品分组", trigger: "change" }]
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -322,7 +265,6 @@ export default {
|
|||||||
init() {
|
init() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
this.getNumberData();
|
this.getNumberData();
|
||||||
this.loadGoodsGroupList();
|
|
||||||
},
|
},
|
||||||
// 分页 改变页码
|
// 分页 改变页码
|
||||||
changePage(v) {
|
changePage(v) {
|
||||||
@@ -505,49 +447,6 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
loadGoodsGroupList() {
|
|
||||||
getGoodsGroupByPage({ pageNumber: 1, pageSize: 1000 }).then((res) => {
|
|
||||||
if (res && res.success && res.result) {
|
|
||||||
this.goodsGroupList = res.result.records || [];
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
openSetGoodsGroup() {
|
|
||||||
if (this.selectedRows.length === 0) {
|
|
||||||
this.$Message.warning("请先选择商品");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.goodsGroupFlag = true;
|
|
||||||
this.goodsGroupLoading = false;
|
|
||||||
this.goodsGroupForm = { groupId: "" };
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (this.$refs.goodsGroupForm) this.$refs.goodsGroupForm.resetFields();
|
|
||||||
});
|
|
||||||
this.loadGoodsGroupList();
|
|
||||||
},
|
|
||||||
submitSetGoodsGroup() {
|
|
||||||
this.$refs.goodsGroupForm.validate((valid) => {
|
|
||||||
if (!valid) return;
|
|
||||||
const goodsIds = this.selectedRows.map((item) => item.id);
|
|
||||||
this.goodsGroupLoading = true;
|
|
||||||
addGoodsGroupItems(this.goodsGroupForm.groupId, goodsIds).then((res) => {
|
|
||||||
this.goodsGroupLoading = false;
|
|
||||||
if (res && res.success) {
|
|
||||||
this.$Message.success("设置成功");
|
|
||||||
this.goodsGroupFlag = false;
|
|
||||||
this.selectedRows = [];
|
|
||||||
this.selectAll = false;
|
|
||||||
this.clearTableSelection();
|
|
||||||
this.getDataList();
|
|
||||||
} else if (res && res.message) {
|
|
||||||
this.$Message.error(res.message);
|
|
||||||
}
|
|
||||||
}).catch(() => {
|
|
||||||
this.goodsGroupLoading = false;
|
|
||||||
this.$Message.error("设置失败,请检查权限或后端接口");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.init();
|
this.init();
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
type: "multiple",
|
type: "multiple",
|
||||||
|
selectedList: [],
|
||||||
skuList: [],
|
skuList: [],
|
||||||
total: 0,
|
total: 0,
|
||||||
goodsParams: {
|
goodsParams: {
|
||||||
@@ -106,8 +107,8 @@ export default {
|
|||||||
this.goodsParams.categoryPath = val && val.length ? val.join(",") : "";
|
this.goodsParams.categoryPath = val && val.length ? val.join(",") : "";
|
||||||
},
|
},
|
||||||
selectedWay: {
|
selectedWay: {
|
||||||
handler() {
|
handler(val) {
|
||||||
this.$emit("selected", this.selectedWay);
|
this.selectedList = Array.isArray(val) ? val.slice() : [];
|
||||||
},
|
},
|
||||||
deep: true,
|
deep: true,
|
||||||
immediate: true,
|
immediate: true,
|
||||||
@@ -145,24 +146,29 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
initGoods(res) {
|
initGoods(res) {
|
||||||
if (res.result.records.length != 0) {
|
const records = res?.result?.records || [];
|
||||||
res.result.records.forEach((item) => {
|
if (records.length) {
|
||||||
|
records.forEach((item) => {
|
||||||
item.selected = false;
|
item.selected = false;
|
||||||
item.___type = "goods";
|
item.___type = "goods";
|
||||||
this.selectedWay.forEach((e) => {
|
this.selectedList.forEach((e) => {
|
||||||
if (e.id && e.id === item.id) {
|
if (e.id && e.id === item.id) {
|
||||||
item.selected = true;
|
item.selected = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
this.total = res.result.total;
|
this.total = res.result.total || 0;
|
||||||
this.goodsData = res.result.records;
|
this.goodsData = records;
|
||||||
this.empty = false;
|
this.empty = false;
|
||||||
} else {
|
} else {
|
||||||
this.goodsData = [];
|
this.goodsData = [];
|
||||||
this.empty = true;
|
this.empty = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
emitSelected(list) {
|
||||||
|
this.selectedList = list;
|
||||||
|
this.$emit("selected", this.selectedList);
|
||||||
|
},
|
||||||
init() {
|
init() {
|
||||||
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
API_Goods.getGoodsSkuData(this.goodsParams).then((res) => {
|
||||||
this.initGoods(res);
|
this.initGoods(res);
|
||||||
@@ -201,26 +207,20 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
checkedGoods(val) {
|
checkedGoods(val) {
|
||||||
if (this.type != "multiple") {
|
if (this.type !== "multiple") {
|
||||||
this.goodsData.forEach((item) => {
|
this.goodsData.forEach((item) => {
|
||||||
item.selected = false;
|
item.selected = false;
|
||||||
});
|
});
|
||||||
this.selectedWay = [];
|
|
||||||
val.selected = true;
|
val.selected = true;
|
||||||
this.selectedWay.push(val);
|
this.emitSelected([val]);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
if (val.selected == false) {
|
if (!val.selected) {
|
||||||
val.selected = true;
|
val.selected = true;
|
||||||
this.selectedWay.push(val);
|
this.emitSelected([...this.selectedList, val]);
|
||||||
} else {
|
} else {
|
||||||
val.selected = false;
|
val.selected = false;
|
||||||
for (let i = 0; i < this.selectedWay.length; i++) {
|
this.emitSelected(this.selectedList.filter((item) => item.id !== val.id));
|
||||||
if (this.selectedWay[i].id === val.id) {
|
|
||||||
this.selectedWay.splice(i, 1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
<div
|
<div
|
||||||
v-for="(item, index) in data[plant]"
|
v-for="(item, index) in data[plant]"
|
||||||
:key="index"
|
:key="index"
|
||||||
:class="{ active: chiosend[plantIndex]?.id == item.id }"
|
:class="{ active: chiosend[plantIndex] && chiosend[plantIndex].id == item.id }"
|
||||||
class="map-item"
|
class="map-item"
|
||||||
@click="
|
@click="
|
||||||
init(
|
init(
|
||||||
|
|||||||
@@ -120,7 +120,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="售后状态" width="180">
|
<el-table-column label="售后状态" width="180">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row" :type="serviceStatusTagType(row.serviceStatus)">
|
<el-tag
|
||||||
|
v-if="row"
|
||||||
|
:type="serviceStatusTagType(row.serviceStatus)"
|
||||||
|
effect="plain"
|
||||||
|
>
|
||||||
{{ serviceStatusText(row.serviceStatus) }}
|
{{ serviceStatusText(row.serviceStatus) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
class="search-form"
|
class="search-form"
|
||||||
@keyup.enter="handleSearch"
|
@keyup.enter="handleSearch"
|
||||||
>
|
>
|
||||||
<el-form-item label="关键字" prop="keywords" style="display: block; width: 100%">
|
<el-form-item label="关键字" prop="keywords">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="searchForm.keywords"
|
v-model="searchForm.keywords"
|
||||||
placeholder="请输入商品名称、订单编号搜索"
|
placeholder="请输入商品名称、订单编号搜索"
|
||||||
@@ -112,7 +112,11 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="售后状态" width="180">
|
<el-table-column label="售后状态" width="180">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag v-if="row" :type="serviceStatusTagType(row.serviceStatus)">
|
<el-tag
|
||||||
|
v-if="row"
|
||||||
|
:type="serviceStatusTagType(row.serviceStatus)"
|
||||||
|
effect="plain"
|
||||||
|
>
|
||||||
{{ serviceStatusText(row.serviceStatus) }}
|
{{ serviceStatusText(row.serviceStatus) }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -379,7 +379,8 @@ export default {
|
|||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
getOrderNumData() {
|
getOrderNumData() {
|
||||||
const { orderStatus, ...searchParams } = this.searchForm;
|
// orderNum 接口仅查 li_order,不含 order_item 关联;keywords/goodsName 会引用 oi 字段导致 SQL 报错
|
||||||
|
const { orderStatus, keywords, goodsName, ...searchParams } = this.searchForm;
|
||||||
API_Order.getOrderNum(searchParams)
|
API_Order.getOrderNum(searchParams)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
|
|||||||
Reference in New Issue
Block a user