This commit is contained in:
DESKTOP-GMUNQ1B\k 2024-03-27 15:49:00 +08:00
parent 314dfd7032
commit d268c67ec1
4 changed files with 264 additions and 217 deletions

View File

@ -9,6 +9,14 @@
// +----------------------------------------------------------------------
import { dataURItoBlob } from 'dropzone'
import request from './request'
// 导出商品数据
export function outportApi(data) {
return request.get('store/product/excel', data)
}
/*
上传视频 local
*/

View File

@ -1,12 +1,6 @@
<template>
<el-dialog
v-if="dialogVisible"
title="商品审核"
:visible.sync="dialogVisible"
width="900px"
:before-close="handleClose"
class="projectInfo"
>
<el-dialog v-if="dialogVisible" title="商品审核" :visible.sync="dialogVisible" width="900px" :before-close="handleClose"
class="projectInfo">
<el-tabs v-if="projectData && isShow" v-model="activeNames" v-loading="loading">
<el-tab-pane label="商品信息" name="first">
<div class="acea-row">
@ -19,7 +13,8 @@
<span class="sp100">
商品分类
<template v-if="projectData.merCateId">
<span v-for="(item, index) in projectData.merCateId" :key="index" class="mr10">{{ item.category?item.category.cate_name:'' }}</span>
<span v-for="(item, index) in projectData.merCateId" :key="index" class="mr10">{{
item.category ? item.category.cate_name : '' }}</span>
</template>
<span v-else>-</span>
</span>
@ -27,24 +22,13 @@
<span class="sp100">
商品封面图
<div class="demo-image__preview">
<el-image
style="width: 60px; height: 60px"
:src="projectData.image"
:preview-src-list="[projectData.image]"
/>
<el-image style="width: 60px; height: 60px" :src="projectData.image"
:preview-src-list="[projectData.image]" />
</div>
</span>
<span class="sp100">商品轮播图
<div
v-for="(item,index) in projectData.slider_image"
:key="index"
class="pictrue"
>
<el-image
style="width: 60px; height: 60px"
:src="item"
:preview-src-list="[item]"
/>
<div v-for="(item, index) in projectData.slider_image" :key="index" class="pictrue">
<el-image style="width: 60px; height: 60px" :src="item" :preview-src-list="[item]" />
</div>
</span>
</div>
@ -66,14 +50,12 @@
<el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 60px; height: 60px"
:src="scope.row.image"
/>
<el-image style="width: 60px; height: 60px" :src="scope.row.image" />
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
<el-table-column v-for="(item, iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center"
min-width="120">
<template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" />
</template>
@ -97,7 +79,8 @@
<template v-if="projectData.spec_type === 1">
<el-table :data="ManyAttrValue" border class="tabNumWidth" size="mini">
<template v-if="manyTabDate">
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="80">
<el-table-column v-for="(item, iii) in manyTabDate" :key="iii" align="center"
:label="manyTabTit[iii].title" min-width="80">
<template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" />
</template>
@ -110,7 +93,8 @@
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
<el-table-column v-for="(item, iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center"
min-width="120">
<template slot-scope="scope">
<span class="priceBox">{{ scope.row[iii] }}</span>
</template>
@ -327,17 +311,21 @@ export default {
.projectInfo ::v-deep .el-dialog__body {
padding-top: 0 !important;
}
.projectInfo ::v-deep .el-tabs__content {
padding-left: 10px !important;
}
.tabPic {
width: 40px !important;
height: 40px !important;
img {
width: 100%;
height: 100%;
}
}
.sp {
display: block;
width: 33%;
@ -349,10 +337,12 @@ export default {
margin-bottom: 15px;
display: inline-block;
}
.third {
width: 100%;
display: flex;
}
.pictrue {
width: 60px;
height: 60px;
@ -361,11 +351,13 @@ export default {
position: relative;
cursor: pointer;
display: inline-block;
img {
width: 100%;
height: 100%;
}
}
.demo-image__preview {
display: inline-block;
}

View File

@ -61,6 +61,12 @@
<el-input v-model="tableFrom.keyword" @keyup.enter.native="getList(1)" placeholder="请输入商品名称,关键字,产品编号"
class="selWidth" />
</el-form-item>
<el-form-item label="时间:" prop="date">
<el-date-picker v-model="timeVal" value-format="yyyy/MM/dd" format="yyyy/MM/dd" type="daterange"
start-placeholder="开始日期" end-placeholder="结束日期" @change="handleDateChange" />
</el-form-item>
<el-form-item>
<el-button type="primary" size="small" @click="getList(1)">搜索</el-button>
<el-button size="small" @click="searchReset()">重置</el-button>
@ -68,6 +74,7 @@
</el-form>
</div>
<el-card class="mt14">
<el-button size="small" type="primary" @click="exports">导出</el-button>
<el-tabs v-model="tableFrom.type" @tab-click="getList(1), getLstFilterApi()">
<el-tab-pane v-for="(item, index) in headeNum" :key="index" :name="item.type.toString()"
:label="item.name + '(' + item.count + ')'" />
@ -290,13 +297,15 @@ import {
updatetProductLabel,
batchesLabelsApi,
batchesRecommendApi,
batchesOnOffApi
batchesOnOffApi,
outportApi
} from '@/api/product'
import { roterPre } from '@/settings'
import infoFrom from './info'
import ueditorFrom from '@/components/ueditorFrom'
import previewBox from '@/components/previewBox/index'
import proDetail from './proDetails.vue';
import createWorkBook from '@/utils/newToExcel.js';
const proOptions = [{
name: '热门榜单',
value: 'is_hot'
@ -320,6 +329,7 @@ export default {
},
data() {
return {
timeVal: [],
props: {
emitPath: false
},
@ -402,6 +412,7 @@ export default {
is_trader: '',
hot_type: '',
star: '',
date: '',
svip_price_type: '',
product_id: this.$route.query.id ? this.$route.query.id : ""
},
@ -442,6 +453,8 @@ export default {
/**重置 */
searchReset() {
this.timeVal = [];
this.tableFrom.date = '';
this.$refs.searchForm.resetFields()
this.getList(1)
},
@ -686,6 +699,37 @@ export default {
this.$message.error(res.message)
})
},
handleDateChange(e) {
this.tableFrom.date = e[0] + '-' + e[1];
},
//
async exports() {
let excelData = JSON.parse(JSON.stringify(this.tableFrom)), data = []
excelData.page = 1
let pageCount = 1
let lebData = {};
for (let i = 0; i < pageCount; i++) {
lebData = await this.downData(excelData)
pageCount = Math.ceil(lebData.count / excelData.limit)
if (lebData.export.length) {
data = data.concat(lebData.export)
excelData.page++
}
}
createWorkBook(lebData.header, lebData.title, data, lebData.foot, lebData.filename);
return
},
/**订单列表 */
downData(excelData) {
return new Promise((resolve, reject) => {
outportApi(excelData).then((res) => {
return resolve(res.data)
})
})
},
batch() {
if (this.multipleSelection.length === 0) return this.$message.warning('请先选择商品')
this.$refs.infoFrom.dialogVisible = true

View File

@ -1,13 +1,6 @@
<template>
<el-dialog
v-if="dialogVisible"
title="商品审核"
:visible.sync="dialogVisible"
:append-to-body='isAppend'
width="860px"
:before-close="handleClose"
class="projectInfo"
>
<el-dialog v-if="dialogVisible" title="商品审核" :visible.sync="dialogVisible" :append-to-body='isAppend' width="860px"
:before-close="handleClose" class="projectInfo">
<el-tabs v-if="projectData && isShow" v-model="activeNames" v-loading="loading">
<el-tab-pane label="商品信息" name="first">
<div class="acea-row">
@ -16,12 +9,15 @@
<span class="sp">品牌{{ projectData.brand ? projectData.brand.brand_name : '其他' }}</span>
<span class="sp">商品关键字{{ projectData.keyword }}</span>
<span class="sp">商品单位{{ projectData.unit_name }}</span>
<span class="sp" v-if="projectData.temp && projectData.temp.name">运费模板{{ projectData.temp?projectData.temp.name:'' }}</span>
<span class="sp100" v-if="projectData.temp && projectData.temp.info">运费说明{{ projectData.temp?projectData.temp.info:'' }}</span>
<span class="sp" v-if="projectData.temp && projectData.temp.name">运费模板{{
projectData.temp ? projectData.temp.name : '' }}</span>
<span class="sp100" v-if="projectData.temp && projectData.temp.info">运费说明{{
projectData.temp ? projectData.temp.info : '' }}</span>
<span class="sp100">
商品分类
<template v-if="projectData.merCateId">
<span v-for="(item, index) in projectData.merCateId" :key="index" class="mr10">{{ item.category?item.category.cate_name:'' }}</span>
<span v-for="(item, index) in projectData.merCateId" :key="index" class="mr10">{{
item.category ? item.category.cate_name : '' }}</span>
</template>
<span v-else>-</span>
</span>
@ -29,44 +25,39 @@
<span class="sp100">
商品封面图
<div class="demo-image__preview">
<el-image
style="width: 60px; height: 60px"
:src="projectData.image"
:preview-src-list="[projectData.image]"
/>
<el-image style="width: 60px; height: 60px" :src="projectData.image"
:preview-src-list="[projectData.image]" />
</div>
</span>
<span v-if="projectData.video_link" class="sp100">
主图视频
<video style="width:40%;height: 180px;border-radius: 10px;" :src="projectData.video_link" controls="controls">
<video style="width:40%;height: 180px;border-radius: 10px;" :src="projectData.video_link"
controls="controls">
您的浏览器不支持 video 标签
</video>
</span>
<span class="sp100">商品轮播图
<div
v-for="(item,index) in projectData.slider_image"
:key="index"
class="pictrue"
>
<el-image
style="width: 60px; height: 60px"
:src="item"
:preview-src-list="[item]"
/>
<div v-for="(item, index) in projectData.slider_image" :key="index" class="pictrue">
<el-image style="width: 60px; height: 60px" :src="item" :preview-src-list="[item]" />
</div>
</span>
</div>
</el-tab-pane>
<el-tab-pane label="商品详情" name="second">
<span class="sp100">商品详情</span>
<div class="contentPic" v-html="projectData.content"/>
<el-form v-if="projectData && projectData.content">
<el-form-item label="商品详情:">
<el-image style="width:100px;" :src="srcParse(projectData.content)"
:preview-src-list="[srcParse(projectData.content)]"></el-image>
</el-form-item>
</el-form>
</el-tab-pane>
<el-tab-pane label="其他设置" name="third">
<span class="sp100">商品排序{{ projectData.sort }}</span>
<span class="third mb20">
<span>商品推荐</span>
<el-checkbox-group v-model="checkboxGroup" size="small">
<el-checkbox v-for="(item, index) in recommend" :key="index" disabled :label="item.value">{{ item.name }}</el-checkbox>
<el-checkbox v-for="(item, index) in recommend" :key="index" disabled :label="item.value">{{ item.name
}}</el-checkbox>
</el-checkbox-group>
</span>
<span v-if="projectData.guarantee && projectData.guarantee.templateValue.length" class="third mb20">
@ -86,14 +77,12 @@
<el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope">
<div class="demo-image__preview">
<el-image
style="width: 60px; height: 60px"
:src="scope.row.image"
/>
<el-image style="width: 60px; height: 60px" :src="scope.row.image" />
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120">
<el-table-column v-for="(item, iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center"
min-width="120">
<template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" />
</template>
@ -115,7 +104,8 @@
<template v-if="projectData.spec_type === 1">
<el-table :data="ManyAttrValue" border size="small">
<template v-if="manyTabDate">
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="80">
<el-table-column v-for="(item, iii) in manyTabDate" :key="iii" align="center"
:label="manyTabTit[iii].title" min-width="80">
<template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" />
</template>
@ -128,7 +118,8 @@
</div>
</template>
</el-table-column>
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="80">
<el-table-column v-for="(item, iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center"
min-width="80">
<template slot-scope="scope">
<span class="priceBox">{{ scope.row[iii] }}</span>
</template>
@ -296,6 +287,9 @@ export default {
}
},
methods: {
srcParse(e) {
return e.image[0]
},
onSubmit() {
this.isShow ? this.ruleForm.id = this.proId : this.ruleForm.id = this.ids
productStatusApi(this.ruleForm).then(res => {
@ -353,31 +347,38 @@ export default {
.projectInfo ::v-deep .el-dialog__body {
padding-top: 0 !important;
}
.projectInfo ::v-deep .el-tabs__content {
padding-left: 10px !important;
}
.tabPic {
width: 40px !important;
height: 40px !important;
img {
width: 100%;
height: 100%;
}
}
.sp {
display: block;
width: 33%;
margin-bottom: 20px;
}
.sp100 {
width: 100%;
margin-bottom: 15px;
display: inline-block;
}
.third {
width: 100%;
display: flex;
}
.pictrue {
width: 60px;
height: 60px;
@ -386,11 +387,13 @@ export default {
position: relative;
cursor: pointer;
display: inline-block;
img {
width: 100%;
height: 100%;
}
}
.demo-image__preview {
display: inline-block;
}