feat: 商品模块改造
This commit is contained in:
parent
270396a95d
commit
7b5719829d
|
@ -51,6 +51,13 @@ export const mer_admin = {
|
||||||
data
|
data
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
//商品分页 V2
|
||||||
|
productV2Page: data => {
|
||||||
|
return $http.post(
|
||||||
|
`/merchant-api/product/v2/page?pageNumber=${data.p.pageNumber}&pageSize=${data.p.pageSize}`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
},
|
||||||
//商品规格分页
|
//商品规格分页
|
||||||
getProductSpecificationPage: (data, params) => {
|
getProductSpecificationPage: (data, params) => {
|
||||||
return $http.request({
|
return $http.request({
|
||||||
|
@ -64,6 +71,18 @@ export const mer_admin = {
|
||||||
getProductOverview: data => {
|
getProductOverview: data => {
|
||||||
return $http.post(`/merchant-api/product/overview`, data);
|
return $http.post(`/merchant-api/product/overview`, data);
|
||||||
},
|
},
|
||||||
|
//商品概况 V2
|
||||||
|
productV2Overview: data => {
|
||||||
|
return $http.post(`/merchant-api/product/v2/overview`, data);
|
||||||
|
},
|
||||||
|
//商品详情
|
||||||
|
productDetail: data => {
|
||||||
|
return $http.request({
|
||||||
|
method: 'get',
|
||||||
|
url: '/merchant-api/product/detail',
|
||||||
|
params: data
|
||||||
|
})
|
||||||
|
},
|
||||||
//商户商品分类
|
//商户商品分类
|
||||||
getProductCategory: data => {
|
getProductCategory: data => {
|
||||||
return $http.request({
|
return $http.request({
|
||||||
|
|
|
@ -1,155 +1,174 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="page-container">
|
||||||
<div v-if="isMerchant" style="height: calc(100vh - 200px)">
|
<div v-if="isMerchant">
|
||||||
<obj-table-plus
|
<el-card class="search-card" shadow="never">
|
||||||
ref="oTable"
|
<el-form :model="formInline" ref="searchForm" label-position="top" class="search-form" size="small">
|
||||||
style="height: 100%"
|
<el-row :gutter="15">
|
||||||
:tableCols="tableCols"
|
<el-col :span="6">
|
||||||
:tableProp="tableProp"
|
<el-form-item label="商品名称" prop="name">
|
||||||
@query="queryList"
|
<el-input v-model="formInline.name" placeholder="请输入商品名称" clearable></el-input>
|
||||||
v-model="dataList"
|
</el-form-item>
|
||||||
:tableEvent="tableEvent"
|
</el-col>
|
||||||
:enableAutoQuery="false"
|
<el-col :span="6" v-if="marketList.length > 0">
|
||||||
>
|
<el-form-item label="店铺" prop="shopId">
|
||||||
<template slot="tableTop">
|
<el-select v-model="formInline.shopId" placeholder="请选择店铺" style="width: 100%;">
|
||||||
<el-form :inline="true" :model="formInline" class="demo-form-inline">
|
<el-option v-for="item in storeList" :key="item.shopId" :label="item.shopName" :value="item.shopId"></el-option>
|
||||||
<!-- <el-form-item label="平台分类">
|
</el-select>
|
||||||
<el-select v-model="formInline.region" placeholder="活动区域">
|
</el-form-item>
|
||||||
<el-option label="区域一" value="shanghai"></el-option>
|
</el-col>
|
||||||
<el-option label="区域二" value="beijing"></el-option>
|
<el-col :span="6">
|
||||||
</el-select>
|
<el-form-item label="状态" prop="status">
|
||||||
</el-form-item> -->
|
<el-select v-model="formInline.status" placeholder="请选择状态" style="width: 100%;" clearable>
|
||||||
<!-- <el-form-item label="商户分类">
|
<el-option label="上架" value="UP"></el-option>
|
||||||
<el-select v-model="formInline.region" placeholder="活动区域">
|
<el-option label="下架" value="DOWN"></el-option>
|
||||||
<el-option label="区域一" value="shanghai"></el-option>
|
</el-select>
|
||||||
<el-option label="区域二" value="beijing"></el-option>
|
</el-form-item>
|
||||||
</el-select>
|
</el-col>
|
||||||
</el-form-item> -->
|
<el-col :span="6">
|
||||||
<el-form-item label="商品搜索">
|
<el-form-item label="是否折扣" prop="isDiscount">
|
||||||
<el-input
|
<el-select v-model="formInline.isDiscount" placeholder="请选择是否折扣" style="width: 100%;" clearable>
|
||||||
v-model="formInline.name"
|
<el-option label="是" :value="1"></el-option>
|
||||||
placeholder="商品搜索"
|
<el-option label="否" :value="0"></el-option>
|
||||||
></el-input>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="marketList.length > 0" label="菜市场">
|
</el-col>
|
||||||
<el-select
|
</el-row>
|
||||||
@change="getData"
|
<el-row>
|
||||||
v-model="formInline.marketId"
|
<el-col :span="24" class="search-buttons">
|
||||||
placeholder="请选择菜市场"
|
<el-button type="primary" @click="handleSearch" icon="el-icon-search" size="small">查询</el-button>
|
||||||
|
<el-button @click="handleReset" icon="el-icon-refresh" size="small">重置</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="stats-card" shadow="never">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="stat-item">
|
||||||
|
<div class="stat-label">总商品数量(个)</div>
|
||||||
|
<div class="stat-value">{{ overview.productCount || 0 }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="stat-item">
|
||||||
|
<div class="stat-label">上架中商品数量(个)</div>
|
||||||
|
<div class="stat-value">{{ overview.productOnSaleCount || 0 }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="stat-item">
|
||||||
|
<div class="stat-label">折扣商品数量(个)</div>
|
||||||
|
<div class="stat-value">{{ overview.productDiscountCount || 0 }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<div class="stat-item">
|
||||||
|
<div class="stat-label">仓库中商品数量(个)</div>
|
||||||
|
<div class="stat-value">{{ overview.productWarehouseCount || 0 }}</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="table-card" shadow="never">
|
||||||
|
<div style="margin-bottom: 15px;">
|
||||||
|
<el-button type="primary" size="small" @click="addProduct">添加商品</el-button>
|
||||||
|
<el-button :disabled="selectList.length <= 0" type="danger" size="small" @click="deleteProduct">批量删除</el-button>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
:data="dataList"
|
||||||
|
v-loading="loading"
|
||||||
|
style="width: 100%"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" fixed="left"></el-table-column>
|
||||||
|
<el-table-column label="商品图" align="center" width="80">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<el-image
|
||||||
|
v-if="row.productMainImg"
|
||||||
|
:src="row.productMainImg"
|
||||||
|
:preview-src-list="[row.productMainImg]"
|
||||||
|
style="width: 40px; height: 40px;"
|
||||||
|
fit="cover"
|
||||||
|
></el-image>
|
||||||
|
<span v-else>暂无商品图</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="name" label="商品名称" align="center">
|
||||||
|
<template slot-scope="{ row }">{{ row.name || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="shopName" label="店铺名称" align="center">
|
||||||
|
<template slot-scope="{ row }">{{ row.shopName || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品售价" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<span style="color: red;">
|
||||||
|
<span v-if="row.minSalePrice == row.maxSalePrice">¥{{ row.minSalePrice || 0 }}</span>
|
||||||
|
<span v-else>¥{{ row.minSalePrice || 0 }}~¥{{ row.maxSalePrice || 0 }}</span>
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="折扣" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<span v-if="row.isDiscount === 1">{{ row.discount }}折</span>
|
||||||
|
<span v-else>-</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="saleNum" label="销量" align="center">
|
||||||
|
<template slot-scope="{ row }">{{ row.saleNum || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="stockNum" label="库存" align="center">
|
||||||
|
<template slot-scope="{ row }">{{ row.stockNum || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="状态" align="center">
|
||||||
|
<template slot-scope="{ row }">
|
||||||
|
<el-popconfirm
|
||||||
|
:title="row.status == 'DOWN' ? '当前为下架状态,是否更改为上架状态?' : '当前为上架状态,是否更改为下架状态?'"
|
||||||
|
:confirm-button-text="row.status == 'DOWN' ? '确认上架' : '确认下架'"
|
||||||
|
@confirm="toggleStatus(row)"
|
||||||
>
|
>
|
||||||
<el-option
|
<el-tag
|
||||||
v-for="item in marketList"
|
slot="reference"
|
||||||
:key="item.marketId"
|
size="mini"
|
||||||
:label="item.marketName"
|
:type="row.status == 'DOWN' ? 'info' : 'success'"
|
||||||
:value="item.marketId"
|
style="cursor: pointer;"
|
||||||
></el-option>
|
>
|
||||||
</el-select>
|
{{ row.status == "DOWN" ? "已下架" : "上架中" }}
|
||||||
</el-form-item>
|
</el-tag>
|
||||||
<el-form-item v-if="marketList.length > 0" label="店铺">
|
</el-popconfirm>
|
||||||
<el-select v-model="formInline.shopId" placeholder="请选择店铺">
|
</template>
|
||||||
<el-option
|
</el-table-column>
|
||||||
v-for="item in storeList"
|
<el-table-column label="操作 (提示:下架后可进行操作)" align="center" width="340" fixed="right">
|
||||||
:key="item.shopId"
|
<template slot-scope="{ row }">
|
||||||
:label="item.shopName"
|
<el-button size="mini" :disabled="row.status != 'DOWN'" type="primary" @click="editProduct(row)">编辑</el-button>
|
||||||
:value="item.shopId"
|
<el-button size="mini" :disabled="row.status != 'DOWN'" type="primary" @click="priceAdjustment(row)">改价</el-button>
|
||||||
></el-option>
|
<el-button size="mini" :disabled="row.status != 'DOWN'" type="primary" @click="changeInventory(row)">改库存</el-button>
|
||||||
</el-select>
|
<el-button size="mini" :disabled="row.status != 'DOWN'" type="primary" @click="setDiscounts(row)">设置折扣</el-button>
|
||||||
</el-form-item>
|
</template>
|
||||||
<el-form-item label="是否预售商品">
|
</el-table-column>
|
||||||
<el-select
|
</el-table>
|
||||||
v-model="formInline.isAdvanceSell"
|
<el-pagination
|
||||||
placeholder="请选择是否预售"
|
@size-change="handleSizeChange"
|
||||||
>
|
@current-change="handleCurrentChange"
|
||||||
<el-option label="是" :value="1"></el-option>
|
:current-page="pagination.pageNumber"
|
||||||
<el-option label="否" :value="0"></el-option>
|
:page-sizes="[10, 20, 30, 50]"
|
||||||
</el-select>
|
:page-size="pagination.pageSize"
|
||||||
</el-form-item>
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
<el-form-item>
|
:total="pagination.total"
|
||||||
<el-button type="primary" @click="$refs.oTable.reload()"
|
class="pagination-container"
|
||||||
>查询</el-button
|
></el-pagination>
|
||||||
>
|
</el-card>
|
||||||
<el-button type="primary" @click="Reset">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
<div class="stat-list">
|
|
||||||
<div class="stat-item">
|
|
||||||
<i style="font-size: 22px" class="el-icon-s-goods"></i>
|
|
||||||
<div class="stat-right">
|
|
||||||
<div class="stat-title">总商品数量(个)</div>
|
|
||||||
<div class="stat-value">
|
|
||||||
<span style="font-size: 20px">{{
|
|
||||||
overview.productCount
|
|
||||||
}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-item">
|
|
||||||
<i style="font-size: 22px" class="el-icon-s-shop"></i>
|
|
||||||
<div class="stat-right">
|
|
||||||
<div class="stat-title">上架中商品数量(个)</div>
|
|
||||||
<div class="stat-value">
|
|
||||||
<span style="font-size: 20px">{{
|
|
||||||
overview.productOnSaleCount
|
|
||||||
}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-item">
|
|
||||||
<i style="font-size: 22px" class="el-icon-s-marketing"></i>
|
|
||||||
<div class="stat-right">
|
|
||||||
<div class="stat-title">折扣商品数量(个)</div>
|
|
||||||
<div class="stat-value">
|
|
||||||
<span style="font-size: 20px">{{
|
|
||||||
overview.productDiscountCount
|
|
||||||
}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="stat-item">
|
|
||||||
<i style="font-size: 22px" class="el-icon-s-promotion"></i>
|
|
||||||
<div class="stat-right">
|
|
||||||
<div class="stat-title">仓库中商品数量(个)</div>
|
|
||||||
<div class="stat-value">
|
|
||||||
<span style="font-size: 20px">{{
|
|
||||||
overview.productWarehouseCount
|
|
||||||
}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<el-tabs v-model="activeName" @tab-click="handleClick">
|
|
||||||
<el-tab-pane label="在售" name="在售"></el-tab-pane>
|
|
||||||
<el-tab-pane label="仓库中" name="仓库中"></el-tab-pane>
|
|
||||||
<el-tab-pane label="折扣" name="折扣"></el-tab-pane>
|
|
||||||
</el-tabs>
|
|
||||||
<div class="mb-2">
|
|
||||||
<el-button type="primary" size="small" @click="addProduct"
|
|
||||||
>添加商品</el-button
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
:disabled="selectList.length <= 0"
|
|
||||||
type="danger"
|
|
||||||
size="small"
|
|
||||||
@click="deleteProduct"
|
|
||||||
>批量删除</el-button
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</obj-table-plus>
|
|
||||||
<!-- 添加或编辑 -->
|
<!-- 添加或编辑 -->
|
||||||
<add-or-update
|
<add-or-update @queryList="fetchData" ref="addOrUpdate"></add-or-update>
|
||||||
@queryList="$refs.oTable.reload()"
|
|
||||||
ref="addOrUpdate"
|
|
||||||
></add-or-update>
|
|
||||||
<!-- 改价格 -->
|
<!-- 改价格 -->
|
||||||
<AddPrice ref="AddPrice" @queryList="$refs.oTable.reload()"></AddPrice>
|
<AddPrice ref="AddPrice" @queryList="fetchData"></AddPrice>
|
||||||
<!-- 改库存 -->
|
<!-- 改库存 -->
|
||||||
<addStock ref="addStock" @queryList="$refs.oTable.reload()"></addStock>
|
<addStock ref="addStock" @queryList="fetchData"></addStock>
|
||||||
<!-- 打折扣 -->
|
<!-- 打折扣 -->
|
||||||
<AddDiscount
|
<AddDiscount ref="AddDiscount" @queryList="fetchData"></AddDiscount>
|
||||||
ref="AddDiscount"
|
|
||||||
@queryList="$refs.oTable.reload()"
|
|
||||||
></AddDiscount>
|
|
||||||
</div>
|
</div>
|
||||||
<div style="height: calc(100vh - 200px)" v-else>
|
<div style="height: calc(100vh - 200px)" v-else>
|
||||||
<el-empty :image-size="200" description="请先去完成商品哦"></el-empty>
|
<el-empty :image-size="200" description="请先去完成商品哦"></el-empty>
|
||||||
|
@ -167,20 +186,18 @@ export default {
|
||||||
components: { AddOrUpdate, AddPrice, addStock, AddDiscount },
|
components: { AddOrUpdate, AddPrice, addStock, AddDiscount },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
activeName: "在售",
|
|
||||||
dataList: [],
|
dataList: [],
|
||||||
|
loading: false,
|
||||||
|
pagination: {
|
||||||
|
pageNumber: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
total: 0
|
||||||
|
},
|
||||||
formInline: {
|
formInline: {
|
||||||
name: "",
|
name: "",
|
||||||
marketId: "",
|
|
||||||
shopId: "",
|
shopId: "",
|
||||||
isAdvanceSell: 0
|
status: null,
|
||||||
},
|
isDiscount: null
|
||||||
tableProp: {
|
|
||||||
"auto-resize": true,
|
|
||||||
border: true,
|
|
||||||
height: "auto",
|
|
||||||
"row-id": "id",
|
|
||||||
"show-overflow": false
|
|
||||||
},
|
},
|
||||||
productFilterType: "SALE",
|
productFilterType: "SALE",
|
||||||
selectList: [],
|
selectList: [],
|
||||||
|
@ -190,31 +207,42 @@ export default {
|
||||||
created() {
|
created() {
|
||||||
this.formInline = {
|
this.formInline = {
|
||||||
name: "",
|
name: "",
|
||||||
marketId: this.marketId,
|
|
||||||
shopId: this.shopId,
|
shopId: this.shopId,
|
||||||
isAdvanceSell: 0
|
status: null,
|
||||||
|
isDiscount: null
|
||||||
};
|
};
|
||||||
this.$nextTick(() => {
|
this.fetchData();
|
||||||
this.$refs.oTable.reload();
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//如果有多个菜市场调用
|
handleSearch() {
|
||||||
getData() {
|
this.pagination.pageNumber = 1;
|
||||||
// this.$api.mer_admin
|
this.fetchData();
|
||||||
// .storeList({ marketId: this.formInline.marketId })
|
},
|
||||||
// .then((res) => {
|
handleReset() {
|
||||||
// this.formInline.shopId = res.data.data[0].shopId;
|
this.$refs.searchForm.resetFields();
|
||||||
// this.$nextTick(() => {
|
this.formInline = {
|
||||||
// this.$refs.oTable.reload();
|
name: "",
|
||||||
// });
|
shopId: this.shopId,
|
||||||
// });
|
status: null,
|
||||||
|
isDiscount: null
|
||||||
|
};
|
||||||
|
this.handleSearch();
|
||||||
|
},
|
||||||
|
handleSizeChange(val) {
|
||||||
|
this.pagination.pageSize = val;
|
||||||
|
this.fetchData();
|
||||||
|
},
|
||||||
|
handleCurrentChange(val) {
|
||||||
|
this.pagination.pageNumber = val;
|
||||||
|
this.fetchData();
|
||||||
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
this.selectList = val;
|
||||||
},
|
},
|
||||||
addProduct() {
|
addProduct() {
|
||||||
this.$refs.addOrUpdate.toggle().add(this.formInline.shopId);
|
this.$refs.addOrUpdate.toggle().add(this.formInline.shopId);
|
||||||
},
|
},
|
||||||
deleteProduct() {
|
deleteProduct() {
|
||||||
console.log(this.selectList);
|
|
||||||
let integers = this.selectList.map(item => {
|
let integers = this.selectList.map(item => {
|
||||||
return item.id;
|
return item.id;
|
||||||
});
|
});
|
||||||
|
@ -224,9 +252,8 @@ export default {
|
||||||
type: "warning"
|
type: "warning"
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("111");
|
|
||||||
this.$api.mer_admin.BatchDeleteProducts(integers).then(res => {
|
this.$api.mer_admin.BatchDeleteProducts(integers).then(res => {
|
||||||
this.$refs.oTable.reload();
|
this.fetchData();
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
@ -236,13 +263,13 @@ export default {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
queryList(pageNo, pageSize) {
|
fetchData() {
|
||||||
console.log(this.formInline);
|
this.loading = true;
|
||||||
this.$api.mer_admin
|
this.$api.mer_admin
|
||||||
.getProductPage({
|
.productV2Page({
|
||||||
p: {
|
p: {
|
||||||
pageNumber: pageNo,
|
pageNumber: this.pagination.pageNumber,
|
||||||
pageSize: pageSize
|
pageSize: this.pagination.pageSize
|
||||||
},
|
},
|
||||||
...this.formInline,
|
...this.formInline,
|
||||||
productFilterType: this.productFilterType,
|
productFilterType: this.productFilterType,
|
||||||
|
@ -250,241 +277,46 @@ export default {
|
||||||
productQuerySortParam: []
|
productQuerySortParam: []
|
||||||
})
|
})
|
||||||
.then(res => {
|
.then(res => {
|
||||||
console.log(res);
|
this.dataList = res.data.data.data;
|
||||||
this.$refs.oTable.complete(
|
this.pagination.total = Number(res.data.data.total);
|
||||||
res.data.data.data,
|
|
||||||
Number(res.data.data.total)
|
|
||||||
);
|
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
this.$refs.oTable.complete(false);
|
this.dataList = [];
|
||||||
|
this.pagination.total = 0;
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
});
|
});
|
||||||
this.$api.mer_admin.getProductOverview(this.formInline).then(res => {
|
this.$api.mer_admin.productV2Overview(this.formInline).then(res => {
|
||||||
console.log(res, "概况");
|
|
||||||
this.overview = res.data.data;
|
this.overview = res.data.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
Reset() {
|
toggleStatus(row) {
|
||||||
this.formInline = {
|
let data = {
|
||||||
name: "",
|
ids: [row.id],
|
||||||
marketId: this.marketId,
|
status: row.status === "UP" ? "DOWN" : "UP"
|
||||||
shopId: this.shopId,
|
|
||||||
isAdvanceSell: 0
|
|
||||||
};
|
};
|
||||||
this.$refs.oTable.reload();
|
this.$api.mer_admin.putOnShelvesProducts(data).then(res => {
|
||||||
|
this.fetchData();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
handleClick() {
|
async editProduct(row) {
|
||||||
switch (this.activeName) {
|
const res = await this.$api.mer_admin.productDetail({ id: row.id });
|
||||||
case "在售":
|
this.$refs.addOrUpdate.toggle(res.data.data).update();
|
||||||
this.productFilterType = "SALE";
|
},
|
||||||
break;
|
async priceAdjustment(row) {
|
||||||
case "仓库中":
|
const res = await this.$api.mer_admin.productDetail({ id: row.id });
|
||||||
this.productFilterType = "WAREHOUSE";
|
this.$refs.AddPrice.toggle(res.data.data).update();
|
||||||
break;
|
},
|
||||||
case "折扣":
|
async changeInventory(row) {
|
||||||
this.productFilterType = "DISCOUNT";
|
const res = await this.$api.mer_admin.productDetail({ id: row.id });
|
||||||
break;
|
this.$refs.addStock.toggle(res.data.data).update();
|
||||||
}
|
},
|
||||||
this.$refs.oTable.reload();
|
async setDiscounts(row) {
|
||||||
|
const res = await this.$api.mer_admin.productDetail({ id: row.id });
|
||||||
|
this.$refs.AddDiscount.toggle(res.data.data).update();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
tableCols() {
|
|
||||||
return [
|
|
||||||
{ type: "checkbox", width: "60px", fixed: "left" },
|
|
||||||
// { type: "seq", width: "60px", align: "center", title: "序号" },
|
|
||||||
{
|
|
||||||
title: "商品图",
|
|
||||||
field: "productPhotoList",
|
|
||||||
align: "center",
|
|
||||||
width: "80px",
|
|
||||||
type: "jsx",
|
|
||||||
render: ({ row }) => {
|
|
||||||
if (row.productPhotoList.length > 0) {
|
|
||||||
return (
|
|
||||||
<el-image
|
|
||||||
preview-src-list={row.productPhotoList.map(item => {
|
|
||||||
return item.url;
|
|
||||||
})}
|
|
||||||
src={row.productPhotoList[0].url}
|
|
||||||
></el-image>
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return <span>暂无商品图</span>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "商品名称",
|
|
||||||
align: "center",
|
|
||||||
field: "name"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "商品售价",
|
|
||||||
align: "center",
|
|
||||||
field: "minSalePrice",
|
|
||||||
type: "jsx",
|
|
||||||
render: ({ row }) => {
|
|
||||||
if (row.minSalePrice == row.maxSalePrice) {
|
|
||||||
return <span>¥{row.minSalePrice}</span>;
|
|
||||||
} else {
|
|
||||||
return (
|
|
||||||
<span>
|
|
||||||
¥{row.minSalePrice}~¥{row.maxSalePrice}
|
|
||||||
</span>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "折扣",
|
|
||||||
align: "center",
|
|
||||||
field: "discountActivity",
|
|
||||||
type: "jsx",
|
|
||||||
render: ({ row }) => {
|
|
||||||
if (row.discountActivity) {
|
|
||||||
return <span>{row.discountActivity.ruleObject.discount}折</span>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "销量",
|
|
||||||
align: "center",
|
|
||||||
field: "saleNum"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "库存",
|
|
||||||
align: "center",
|
|
||||||
field: "stockNum"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "是否为预售商品",
|
|
||||||
align: "center",
|
|
||||||
field: "isAdvanceSell",
|
|
||||||
type: "jsx",
|
|
||||||
render: ({ row }) => {
|
|
||||||
return <span>{row.isAdvanceSell == 1 ? "是" : "否"}</span>;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "状态",
|
|
||||||
// fixed: "right",
|
|
||||||
type: "jsx",
|
|
||||||
align: "center",
|
|
||||||
"title-suffix": {
|
|
||||||
message: "点击上架/下架切换责任书状态",
|
|
||||||
icon: "vxe-icon-question-circle-fill"
|
|
||||||
},
|
|
||||||
render: ({ row }) => {
|
|
||||||
let Enable = () => {
|
|
||||||
let data = {
|
|
||||||
ids: [row.id],
|
|
||||||
status: "UP"
|
|
||||||
};
|
|
||||||
if (row.status == "UP") {
|
|
||||||
data.status = "DOWN";
|
|
||||||
} else {
|
|
||||||
data.status = "UP";
|
|
||||||
}
|
|
||||||
this.$api.mer_admin.putOnShelvesProducts(data).then(res => {
|
|
||||||
console.log(res);
|
|
||||||
this.$refs.oTable.reload();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<el-popconfirm
|
|
||||||
title={
|
|
||||||
row.status == "DOWN"
|
|
||||||
? "当前为下架状态,是否更改为上架状态?"
|
|
||||||
: "当前为上架状态,是否更改为下架状态?"
|
|
||||||
}
|
|
||||||
confirmButtonText={
|
|
||||||
row.status == "DOWN" ? "确认上架" : "确认下架"
|
|
||||||
}
|
|
||||||
onConfirm={Enable}
|
|
||||||
>
|
|
||||||
<el-button
|
|
||||||
slot="reference"
|
|
||||||
size="mini"
|
|
||||||
plain
|
|
||||||
type={row.status == "DOWN" ? "info" : "success"}
|
|
||||||
>
|
|
||||||
{row.status == "DOWN" ? "已下架" : "上架中"}
|
|
||||||
</el-button>
|
|
||||||
</el-popconfirm>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: "操作 (提示:下架后可进行操作)",
|
|
||||||
fixed: "right",
|
|
||||||
type: "jsx",
|
|
||||||
align: "center",
|
|
||||||
width: "340px",
|
|
||||||
render: ({ row }) => {
|
|
||||||
let edit = () => {
|
|
||||||
this.$refs.addOrUpdate.toggle(row).update();
|
|
||||||
};
|
|
||||||
let priceAdjustment = () => {
|
|
||||||
console.log(row);
|
|
||||||
this.$refs.AddPrice.toggle(row).update();
|
|
||||||
};
|
|
||||||
let changeInventory = () => {
|
|
||||||
this.$refs.addStock.toggle(row).update();
|
|
||||||
};
|
|
||||||
let setDiscounts = () => {
|
|
||||||
this.$refs.AddDiscount.toggle(row).update();
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<div>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
disabled={row.status != "DOWN"}
|
|
||||||
type="primary"
|
|
||||||
onClick={edit}
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
disabled={row.status != "DOWN"}
|
|
||||||
type="primary"
|
|
||||||
onClick={priceAdjustment}
|
|
||||||
>
|
|
||||||
改价
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
disabled={row.status != "DOWN"}
|
|
||||||
type="primary"
|
|
||||||
onClick={changeInventory}
|
|
||||||
>
|
|
||||||
改库存
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
disabled={row.status != "DOWN"}
|
|
||||||
type="primary"
|
|
||||||
onClick={setDiscounts}
|
|
||||||
>
|
|
||||||
设置折扣
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
];
|
|
||||||
},
|
|
||||||
tableEvent() {
|
|
||||||
return {
|
|
||||||
"checkbox-all": ({ records, reserves }) => {
|
|
||||||
this.selectList = [...records, ...reserves];
|
|
||||||
},
|
|
||||||
"checkbox-change": ({ records, reserves }) => {
|
|
||||||
this.selectList = [...records, ...reserves];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
...mapState("userData", [
|
...mapState("userData", [
|
||||||
"isMerchant",
|
"isMerchant",
|
||||||
"marketList",
|
"marketList",
|
||||||
|
@ -496,27 +328,46 @@ export default {
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style scoped>
|
||||||
.stat-list {
|
.page-container {
|
||||||
display: flex;
|
}
|
||||||
align-items: center;
|
.search-card {
|
||||||
/* justify-content: space-between; */
|
margin-bottom: 15px;
|
||||||
// flex-wrap: wrap;
|
}
|
||||||
margin-bottom: 10px;
|
.stats-card {
|
||||||
padding: 10px;
|
margin-bottom: 15px;
|
||||||
border: 1px solid #ccc;
|
|
||||||
}
|
}
|
||||||
.stat-item {
|
.stat-item {
|
||||||
width: 20%;
|
text-align: center;
|
||||||
margin: 20px 20px;
|
background-color: #f5f5f5;
|
||||||
display: flex;
|
padding: 15px;
|
||||||
align-items: center;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
.stat-right {
|
.stat-label {
|
||||||
margin-left: 12px;
|
font-size: 14px;
|
||||||
font-size: 18px;
|
color: #606266;
|
||||||
}
|
|
||||||
.stat-title {
|
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
.stat-value {
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #409EFF;
|
||||||
|
}
|
||||||
|
.search-form .el-form-item {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.search-buttons {
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.pagination-container {
|
||||||
|
margin-top: 20px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.search-form .el-form-item__label {
|
||||||
|
padding-bottom: 0px !important;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
File diff suppressed because it is too large
Load Diff
|
@ -100,11 +100,7 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-card class="table-card" shadow="never">
|
<!-- 表格 -->
|
||||||
<div slot="header">
|
|
||||||
<span>订单列表</span>
|
|
||||||
</div>
|
|
||||||
<!-- 表格 -->
|
|
||||||
<el-table
|
<el-table
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
|
@ -135,26 +131,25 @@
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:show-header="true">
|
:show-header="true">
|
||||||
<el-table-column label="序号">
|
<el-table-column prop="productName" label="商品名称">
|
||||||
<template slot-scope="productScope">
|
<template slot-scope="productScope">{{ productScope.row.productName || '-' }}</template>
|
||||||
{{ productScope.$index + 1 }}
|
</el-table-column>
|
||||||
</template>
|
<el-table-column prop="productCount" label="商品数量">
|
||||||
|
<template slot-scope="productScope">{{ productScope.row.productCount || '-' }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="productName" label="商品名称"></el-table-column>
|
|
||||||
<el-table-column prop="productCount" label="商品数量"></el-table-column>
|
|
||||||
<el-table-column label="商品原价">
|
<el-table-column label="商品原价">
|
||||||
<template slot-scope="productScope">
|
<template slot-scope="productScope">
|
||||||
¥ {{ (productScope.row.originPrice / 100).toFixed(2) }}
|
¥ {{ (productScope.row.originPrice / 100).toFixed(2) || '0.00' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="商品终价">
|
<el-table-column label="商品终价">
|
||||||
<template slot-scope="productScope">
|
<template slot-scope="productScope">
|
||||||
¥ {{ (productScope.row.finalPrice / 100).toFixed(2) }}
|
¥ {{ (productScope.row.finalPrice / 100).toFixed(2) || '0.00' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="商品订单金额">
|
<el-table-column label="商品订单金额">
|
||||||
<template slot-scope="productScope">
|
<template slot-scope="productScope">
|
||||||
¥ {{ (productScope.row.productOrderMoney / 100).toFixed(2) }}
|
¥ {{ (productScope.row.productOrderMoney / 100).toFixed(2) || '0.00' }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="productImg" label="商品图片">
|
<el-table-column prop="productImg" label="商品图片">
|
||||||
|
@ -164,6 +159,7 @@
|
||||||
style="width: 40px; height: 40px;"
|
style="width: 40px; height: 40px;"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
:preview-src-list="[productScope.row.productImg]"></el-image>
|
:preview-src-list="[productScope.row.productImg]"></el-image>
|
||||||
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -174,16 +170,18 @@
|
||||||
{{ shopScope.$index + 1 }}
|
{{ shopScope.$index + 1 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="shopOrderNo" label="店铺订单号"></el-table-column>
|
<el-table-column prop="shopOrderNo" label="店铺订单号">
|
||||||
|
<template slot-scope="shopScope">{{ shopScope.row.shopOrderNo || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="shopName" label="店铺名称">
|
<el-table-column prop="shopName" label="店铺名称">
|
||||||
<template slot-scope="shopScope">
|
<template slot-scope="shopScope">
|
||||||
{{ shopScope.row.shopName || "暂无" }}
|
{{ shopScope.row.shopName || "-" }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="订单状态">
|
<el-table-column prop="status" label="订单状态">
|
||||||
<template slot-scope="shopScope">
|
<template slot-scope="shopScope">
|
||||||
<el-tag :type="getShopStatusType(shopScope.row.status)" size="small">
|
<el-tag :type="getShopStatusType(shopScope.row.status)" size="small">
|
||||||
{{ getShopStatusText(shopScope.row.status) }}
|
{{ getShopStatusText(shopScope.row.status) || '-' }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -198,46 +196,62 @@
|
||||||
{{ (pagination.pageNumber - 1) * pagination.pageSize + scope.$index + 1 }}
|
{{ (pagination.pageNumber - 1) * pagination.pageSize + scope.$index + 1 }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="unitOrderNo" label="结算订单号" min-width="120"></el-table-column>
|
<el-table-column prop="unitOrderNo" label="结算订单号" min-width="120">
|
||||||
<el-table-column prop="createTime" label="下单时间" width="90"></el-table-column>
|
<template slot-scope="scope">{{ scope.row.unitOrderNo || '-' }}</template>
|
||||||
<el-table-column prop="receiverName" label="收货人姓名" width="80"></el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="receiverPhone" label="收货人电话" width="100"></el-table-column>
|
<el-table-column prop="createTime" label="下单时间" width="90">
|
||||||
<el-table-column prop="poi" label="收货人地址" min-width="150"></el-table-column>
|
<template slot-scope="scope">{{ scope.row.createTime || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="receiverName" label="收货人姓名" width="80">
|
||||||
|
<template slot-scope="scope">{{ scope.row.receiverName || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="receiverPhone" label="收货人电话" width="100">
|
||||||
|
<template slot-scope="scope">{{ scope.row.receiverPhone || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="poi" label="收货人地址" min-width="150">
|
||||||
|
<template slot-scope="scope">{{ scope.row.poi || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="市场订单金额" min-width="100">
|
<el-table-column label="市场订单金额" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>¥ {{ (scope.row.unitOrderMoney / 100).toFixed(2) }}</span>
|
<span>¥ {{ (scope.row.unitOrderMoney / 100).toFixed(2) || '0.00' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="市场订单商品金额" min-width="120">
|
<el-table-column label="市场订单商品金额" min-width="120">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>¥ {{ (scope.row.productMoney / 100).toFixed(2) }}</span>
|
<span>¥ {{ (scope.row.productMoney / 100).toFixed(2) || '0.00' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="市场订单配送费" min-width="110">
|
<el-table-column label="市场订单配送费" min-width="110">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>¥ {{ (scope.row.deliveryMoney / 100).toFixed(2) }}</span>
|
<span>¥ {{ (scope.row.deliveryMoney / 100).toFixed(2) || '0.00' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="调度费" width="60">
|
<el-table-column label="调度费" width="60">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>¥ {{ (scope.row.dispatchMoney / 100).toFixed(2) }}</span>
|
<span>¥ {{ (scope.row.dispatchMoney / 100).toFixed(2) || '0.00' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="包装费" width="60">
|
<el-table-column label="包装费" width="60">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>¥ {{ (scope.row.packageMoney / 100).toFixed(2) }}</span>
|
<span>¥ {{ (scope.row.packageMoney / 100).toFixed(2) || '0.00' }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" label="订单状态" width="100">
|
<el-table-column prop="status" label="订单状态" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag :type="getStatusTagType(scope.row.status)" size="small">
|
<el-tag :type="getStatusTagType(scope.row.status)" size="small">
|
||||||
{{ getStatusText(scope.row.status) }}
|
{{ getStatusText(scope.row.status) || '-' }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="marketId" label="市场编号" width="90"></el-table-column>
|
<el-table-column prop="marketId" label="市场编号" width="90">
|
||||||
<el-table-column prop="marketName" label="市场名称" min-width="100"></el-table-column>
|
<template slot-scope="scope">{{ scope.row.marketId || '-' }}</template>
|
||||||
<el-table-column prop="refundReason" label="申请退款原因" min-width="80"></el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column prop="marketName" label="市场名称" min-width="100">
|
||||||
|
<template slot-scope="scope">{{ scope.row.marketName || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="refundReason" label="申请退款原因" min-width="80">
|
||||||
|
<template slot-scope="scope">{{ scope.row.refundReason || '-' }}</template>
|
||||||
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
|
@ -251,7 +265,6 @@
|
||||||
:total="pagination.total"
|
:total="pagination.total"
|
||||||
class="pagination-container"
|
class="pagination-container"
|
||||||
></el-pagination>
|
></el-pagination>
|
||||||
</el-card>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue