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 { dataURItoBlob } from 'dropzone'
import request from './request' import request from './request'
// 导出商品数据
export function outportApi(data) {
return request.get('store/product/excel', data)
}
/* /*
上传视频 local 上传视频 local
*/ */
@ -114,32 +122,32 @@ export function brandStatusApi(id, status) {
/** /**
* @description 标签 -- 新增表单 * @description 标签 -- 新增表单
*/ */
export function labelCreateApi() { export function labelCreateApi() {
return request.get('product/label/create/form') return request.get('product/label/create/form')
} }
/** /**
* @description 标签 -- 编辑表单 * @description 标签 -- 编辑表单
*/ */
export function labelUpdateApi(id) { export function labelUpdateApi(id) {
return request.get(`product/label/update/${id}/form`) return request.get(`product/label/update/${id}/form`)
} }
/** /**
* @description 标签 -- 列表 * @description 标签 -- 列表
*/ */
export function labelListApi(data) { export function labelListApi(data) {
return request.get('product/label/lst', data) return request.get('product/label/lst', data)
} }
/** /**
* @description 标签 -- 删除 * @description 标签 -- 删除
*/ */
export function labelDeleteApi(id) { export function labelDeleteApi(id) {
return request.delete(`product/label/delete/${id}`) return request.delete(`product/label/delete/${id}`)
} }
/** /**
* @description 标签列表 -- 修改状态 * @description 标签列表 -- 修改状态
*/ */
export function labelStatusApi(id, status) { export function labelStatusApi(id, status) {
return request.post(`product/label/status/${id}`, { status }) return request.post(`product/label/status/${id}`, { status })
} }
/** /**
* @description 商品列表 -- 列表 * @description 商品列表 -- 列表
@ -300,8 +308,8 @@ export function presellProDetailApi(id) {
/** /**
* @description 预售商品 -- 编辑 * @description 预售商品 -- 编辑
*/ */
export function presellUpdateApi(id,data) { export function presellUpdateApi(id, data) {
return request.post(`store/product/presell/update/${id}`,data) return request.post(`store/product/presell/update/${id}`, data)
} }
/** /**
* @description 预售商品审核 -- 表单提交 * @description 预售商品审核 -- 表单提交
@ -325,7 +333,7 @@ export function preSellAgreeInfo() {
* @description 申请管理 -- 预售协议保存 * @description 申请管理 -- 预售协议保存
*/ */
export function preSellAgreeUpdate(data) { export function preSellAgreeUpdate(data) {
return request.post(`agreement/sys_product_presell_agree`,data) return request.post(`agreement/sys_product_presell_agree`, data)
} }
/** /**
* @description 助力 -- 列表 * @description 助力 -- 列表
@ -386,79 +394,79 @@ export function assistReviewDetailApi(id) {
/** /**
* @description 助力商品 -- 详情(编辑和查看) * @description 助力商品 -- 详情(编辑和查看)
*/ */
export function assistProductUpdateApi(id,data) { export function assistProductUpdateApi(id, data) {
return request.post(`store/product/assist/update/${id}`,data) return request.post(`store/product/assist/update/${id}`, data)
} }
/** /**
* @description 服务保障 -- 添加 * @description 服务保障 -- 添加
*/ */
export function guaranteeAddApi() { export function guaranteeAddApi() {
return request.get(`guarantee/create/form`) return request.get(`guarantee/create/form`)
} }
/** /**
* @description 服务保障 -- 列表 * @description 服务保障 -- 列表
*/ */
export function guaranteeLstApi(data) { export function guaranteeLstApi(data) {
return request.get(`guarantee/lst`,data) return request.get(`guarantee/lst`, data)
} }
/** /**
* @description 服务保障 -- 编辑排序 * @description 服务保障 -- 编辑排序
*/ */
export function guaranteeSortApi(id,data) { export function guaranteeSortApi(id, data) {
return request.post(`guarantee/sort/${id}`,data) return request.post(`guarantee/sort/${id}`, data)
} }
/** /**
* @description 服务保障 -- 修改显示状态 * @description 服务保障 -- 修改显示状态
*/ */
export function guaranteeStatusApi(id, status) { export function guaranteeStatusApi(id, status) {
return request.post(`guarantee/status/${id}`, status ) return request.post(`guarantee/status/${id}`, status)
} }
/** /**
* @description 服务保障 -- 编辑 * @description 服务保障 -- 编辑
*/ */
export function guaranteeUpdateApi(id) { export function guaranteeUpdateApi(id) {
return request.get(`guarantee/update/${id}/form`) return request.get(`guarantee/update/${id}/form`)
} }
/** /**
* @description 服务保障 -- 删除 * @description 服务保障 -- 删除
*/ */
export function guaranteeDeleteApi(id) { export function guaranteeDeleteApi(id) {
return request.delete(`guarantee/delete/${id}`) return request.delete(`guarantee/delete/${id}`)
} }
/** /**
* @description 商品列表 -- 编辑排序 * @description 商品列表 -- 编辑排序
*/ */
export function productSort(id, data) { export function productSort(id, data) {
return request.post(`store/reply/sort/${id}`,data) return request.post(`store/reply/sort/${id}`, data)
} }
/** 商品列表 -- 获取标签项 */ /** 商品列表 -- 获取标签项 */
export function getProductLabelApi() { export function getProductLabelApi() {
return request.get(`product/label/option`) return request.get(`product/label/option`)
} }
/** 商品列表 -- 编辑标签 */ /** 商品列表 -- 编辑标签 */
export function updatetProductLabel(id, data) { export function updatetProductLabel(id, data) {
return request.post(`store/product/labels/${id}`, data) return request.post(`store/product/labels/${id}`, data)
} }
/** 秒杀列表 -- 编辑标签 */ /** 秒杀列表 -- 编辑标签 */
export function updatetSeckillLabel(id, data) { export function updatetSeckillLabel(id, data) {
return request.post(`seckill/product/labels/${id}`, data) return request.post(`seckill/product/labels/${id}`, data)
} }
/** 预售列表 -- 编辑标签 */ /** 预售列表 -- 编辑标签 */
export function updatetPresellLabel(id, data) { export function updatetPresellLabel(id, data) {
return request.post(`store/product/presell/labels/${id}`, data) return request.post(`store/product/presell/labels/${id}`, data)
} }
/** 助力列表 -- 编辑标签 */ /** 助力列表 -- 编辑标签 */
export function updatetAssistLabel(id, data) { export function updatetAssistLabel(id, data) {
return request.post(`store/product/assist/labels/${id}`, data) return request.post(`store/product/assist/labels/${id}`, data)
} }
/** 拼团列表 -- 编辑标签 */ /** 拼团列表 -- 编辑标签 */
export function updatetCombinationLabel(id, data) { export function updatetCombinationLabel(id, data) {
return request.post(`store/product/group/labels/${id}`, data) return request.post(`store/product/group/labels/${id}`, data)
} }
/** /**
* @description 上传视频 * @description 上传视频
*/ */
export function productGetTempKeysApi() { export function productGetTempKeysApi() {
return request.get(`upload/temp_key`) return request.get(`upload/temp_key`)
} }
/** 商品列表 -- 批量设置标签 */ /** 商品列表 -- 批量设置标签 */
@ -491,15 +499,15 @@ export function deletePriceRuleApi(id) {
} }
/** 价格说明 -- 是否显示 */ /** 价格说明 -- 是否显示 */
export function priceRuleStatusApi(id, status) { export function priceRuleStatusApi(id, status) {
return request.post(`price_rule/status/${id}`,status) return request.post(`price_rule/status/${id}`, status)
} }
/** 参数模板 -- 添加 */ /** 参数模板 -- 添加 */
export function productSpecs(data) { export function productSpecs(data) {
return request.post(`store/params/temp/create`,data) return request.post(`store/params/temp/create`, data)
} }
/** 参数模板 -- 编辑 */ /** 参数模板 -- 编辑 */
export function specsUpdate(id, data) { export function specsUpdate(id, data) {
return request.post(`store/params/temp/update/${id}`,data) return request.post(`store/params/temp/update/${id}`, data)
} }
/** 参数模板 -- 详情 */ /** 参数模板 -- 详情 */
export function productSpecsInfo(id) { export function productSpecsInfo(id) {
@ -525,6 +533,6 @@ export function merProductLstApi(data) {
return request.get(`store/product/list`, data) return request.get(`store/product/list`, data)
} }
/** 商品列表 -- 商品操作记录 */ /** 商品列表 -- 商品操作记录 */
export function operateRecordList(id,data) { export function operateRecordList(id, data) {
return request.get(`store/product/get_operate_list/${id}`,data) return request.get(`store/product/get_operate_list/${id}`, data)
} }

View File

@ -1,25 +1,20 @@
<template> <template>
<el-dialog <el-dialog v-if="dialogVisible" title="商品审核" :visible.sync="dialogVisible" width="900px" :before-close="handleClose"
v-if="dialogVisible" class="projectInfo">
title="商品审核"
:visible.sync="dialogVisible"
width="900px"
:before-close="handleClose"
class="projectInfo"
>
<el-tabs v-if="projectData && isShow" v-model="activeNames" v-loading="loading"> <el-tabs v-if="projectData && isShow" v-model="activeNames" v-loading="loading">
<el-tab-pane label="商品信息" name="first"> <el-tab-pane label="商品信息" name="first">
<div class="acea-row"> <div class="acea-row">
<span class="sp100">商品名称{{ projectData.store_name }}</span> <span class="sp100">商品名称{{ projectData.store_name }}</span>
<span class="sp">平台分类{{ projectData.storeCategory?projectData.storeCategory.cate_name:'' }}</span> <span class="sp">平台分类{{ projectData.storeCategory ? projectData.storeCategory.cate_name : '' }}</span>
<span class="sp">品牌{{ projectData.brand?projectData.brand.brand_name:'' }}</span> <span class="sp">品牌{{ projectData.brand ? projectData.brand.brand_name : '' }}</span>
<span class="sp">商品关键字{{ projectData.keyword }}</span> <span class="sp">商品关键字{{ projectData.keyword }}</span>
<span class="sp">商品单位{{ projectData.unit_name }}</span> <span class="sp">商品单位{{ projectData.unit_name }}</span>
<span class="sp">运费模板{{ projectData.temp?projectData.temp.name:'' }}</span> <span class="sp">运费模板{{ projectData.temp ? projectData.temp.name : '' }}</span>
<span class="sp100"> <span class="sp100">
商品分类 商品分类
<template v-if="projectData.merCateId"> <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> </template>
<span v-else>-</span> <span v-else>-</span>
</span> </span>
@ -27,31 +22,20 @@
<span class="sp100"> <span class="sp100">
商品封面图 商品封面图
<div class="demo-image__preview"> <div class="demo-image__preview">
<el-image <el-image style="width: 60px; height: 60px" :src="projectData.image"
style="width: 60px; height: 60px" :preview-src-list="[projectData.image]" />
:src="projectData.image"
:preview-src-list="[projectData.image]"
/>
</div> </div>
</span> </span>
<span class="sp100">商品轮播图 <span class="sp100">商品轮播图
<div <div v-for="(item, index) in projectData.slider_image" :key="index" class="pictrue">
v-for="(item,index) in projectData.slider_image" <el-image style="width: 60px; height: 60px" :src="item" :preview-src-list="[item]" />
:key="index"
class="pictrue"
>
<el-image
style="width: 60px; height: 60px"
:src="item"
:preview-src-list="[item]"
/>
</div> </div>
</span> </span>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="商品详情" name="second"> <el-tab-pane label="商品详情" name="second">
<span class="sp100">商品详情</span> <span class="sp100">商品详情</span>
<div class="contentPic" v-html="projectData.content"/> <div class="contentPic" v-html="projectData.content" />
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="其他设置" name="third"> <el-tab-pane label="其他设置" name="third">
<span class="sp100">商品排序{{ projectData.sort }}</span> <span class="sp100">商品排序{{ projectData.sort }}</span>
@ -66,14 +50,12 @@
<el-table-column align="center" label="图片" min-width="80"> <el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="demo-image__preview"> <div class="demo-image__preview">
<el-image <el-image style="width: 60px; height: 60px" :src="scope.row.image" />
style="width: 60px; height: 60px"
:src="scope.row.image"
/>
</div> </div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" /> <span class="priceBox" v-text="scope.row[iii]" />
</template> </template>
@ -96,13 +78,14 @@
</template> </template>
<template v-if="projectData.spec_type === 1"> <template v-if="projectData.spec_type === 1">
<el-table :data="ManyAttrValue" border class="tabNumWidth" size="mini"> <el-table :data="ManyAttrValue" border class="tabNumWidth" size="mini">
<template v-if="manyTabDate"> <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"
<template slot-scope="scope"> :label="manyTabTit[iii].title" min-width="80">
<span class="priceBox" v-text="scope.row[iii]" /> <template slot-scope="scope">
</template> <span class="priceBox" v-text="scope.row[iii]" />
</el-table-column> </template>
</template> </el-table-column>
</template>
<el-table-column align="center" label="图片" min-width="80"> <el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="upLoadPicBox"> <div class="upLoadPicBox">
@ -110,7 +93,8 @@
</div> </div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span class="priceBox">{{ scope.row[iii] }}</span> <span class="priceBox">{{ scope.row[iii] }}</span>
</template> </template>
@ -139,7 +123,7 @@
<el-radio :label="-1">拒绝</el-radio> <el-radio :label="-1">拒绝</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="ruleForm.status===-1" label="原因" prop="refusal"> <el-form-item v-if="ruleForm.status === -1" label="原因" prop="refusal">
<el-input v-model="ruleForm.refusal" type="textarea" placeholder="请输入原因" /> <el-input v-model="ruleForm.refusal" type="textarea" placeholder="请输入原因" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@ -296,8 +280,8 @@ export default {
this.OneattrValue[0]['stock'] = this.OneattrValue[0]['assistSku']['stock'] this.OneattrValue[0]['stock'] = this.OneattrValue[0]['assistSku']['stock']
} else { } else {
this.ManyAttrValue = [] this.ManyAttrValue = []
res.data.attrValue.forEach((o,i)=>{ res.data.attrValue.forEach((o, i) => {
if(o.assistSku){ if (o.assistSku) {
this.ManyAttrValue.push(o) this.ManyAttrValue.push(o)
this.ManyAttrValue[i]['price'] = this.ManyAttrValue[i]['assistSku']['assist_price'] this.ManyAttrValue[i]['price'] = this.ManyAttrValue[i]['assistSku']['assist_price']
this.ManyAttrValue[i]['stock'] = this.ManyAttrValue[i]['assistSku']['stock'] this.ManyAttrValue[i]['stock'] = this.ManyAttrValue[i]['assistSku']['stock']
@ -324,49 +308,57 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.projectInfo ::v-deep .el-dialog__body{ .projectInfo ::v-deep .el-dialog__body {
padding-top: 0 !important; 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 { .projectInfo ::v-deep .el-tabs__content {
padding-left: 10px !important;
}
.tabPic {
width: 40px !important;
height: 40px !important;
img {
width: 100%; width: 100%;
margin-bottom: 15px; height: 100%;
display: inline-block;
} }
.third{ }
.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;
border: 1px dotted rgba(0, 0, 0, 0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
display: inline-block;
img {
width: 100%; width: 100%;
display: flex; height: 100%;
}
.pictrue {
width: 60px;
height: 60px;
border: 1px dotted rgba(0, 0, 0, 0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
display: inline-block;
img {
width: 100%;
height: 100%;
}
}
.demo-image__preview{
display: inline-block;
} }
}
.demo-image__preview {
display: inline-block;
}
</style> </style>

View File

@ -61,6 +61,12 @@
<el-input v-model="tableFrom.keyword" @keyup.enter.native="getList(1)" placeholder="请输入商品名称,关键字,产品编号" <el-input v-model="tableFrom.keyword" @keyup.enter.native="getList(1)" placeholder="请输入商品名称,关键字,产品编号"
class="selWidth" /> class="selWidth" />
</el-form-item> </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-form-item>
<el-button type="primary" size="small" @click="getList(1)">搜索</el-button> <el-button type="primary" size="small" @click="getList(1)">搜索</el-button>
<el-button size="small" @click="searchReset()">重置</el-button> <el-button size="small" @click="searchReset()">重置</el-button>
@ -68,6 +74,7 @@
</el-form> </el-form>
</div> </div>
<el-card class="mt14"> <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-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()" <el-tab-pane v-for="(item, index) in headeNum" :key="index" :name="item.type.toString()"
:label="item.name + '(' + item.count + ')'" /> :label="item.name + '(' + item.count + ')'" />
@ -290,13 +297,15 @@ import {
updatetProductLabel, updatetProductLabel,
batchesLabelsApi, batchesLabelsApi,
batchesRecommendApi, batchesRecommendApi,
batchesOnOffApi batchesOnOffApi,
outportApi
} from '@/api/product' } from '@/api/product'
import { roterPre } from '@/settings' import { roterPre } from '@/settings'
import infoFrom from './info' import infoFrom from './info'
import ueditorFrom from '@/components/ueditorFrom' import ueditorFrom from '@/components/ueditorFrom'
import previewBox from '@/components/previewBox/index' import previewBox from '@/components/previewBox/index'
import proDetail from './proDetails.vue'; import proDetail from './proDetails.vue';
import createWorkBook from '@/utils/newToExcel.js';
const proOptions = [{ const proOptions = [{
name: '热门榜单', name: '热门榜单',
value: 'is_hot' value: 'is_hot'
@ -320,6 +329,7 @@ export default {
}, },
data() { data() {
return { return {
timeVal: [],
props: { props: {
emitPath: false emitPath: false
}, },
@ -402,6 +412,7 @@ export default {
is_trader: '', is_trader: '',
hot_type: '', hot_type: '',
star: '', star: '',
date: '',
svip_price_type: '', svip_price_type: '',
product_id: this.$route.query.id ? this.$route.query.id : "" product_id: this.$route.query.id ? this.$route.query.id : ""
}, },
@ -442,6 +453,8 @@ export default {
/**重置 */ /**重置 */
searchReset() { searchReset() {
this.timeVal = [];
this.tableFrom.date = '';
this.$refs.searchForm.resetFields() this.$refs.searchForm.resetFields()
this.getList(1) this.getList(1)
}, },
@ -686,6 +699,37 @@ export default {
this.$message.error(res.message) 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() { batch() {
if (this.multipleSelection.length === 0) return this.$message.warning('请先选择商品') if (this.multipleSelection.length === 0) return this.$message.warning('请先选择商品')
this.$refs.infoFrom.dialogVisible = true this.$refs.infoFrom.dialogVisible = true

View File

@ -1,27 +1,23 @@
<template> <template>
<el-dialog <el-dialog v-if="dialogVisible" title="商品审核" :visible.sync="dialogVisible" :append-to-body='isAppend' width="860px"
v-if="dialogVisible" :before-close="handleClose" class="projectInfo">
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-tabs v-if="projectData && isShow" v-model="activeNames" v-loading="loading">
<el-tab-pane label="商品信息" name="first"> <el-tab-pane label="商品信息" name="first">
<div class="acea-row"> <div class="acea-row">
<span class="sp">商品名称{{ projectData.store_name }}</span> <span class="sp">商品名称{{ projectData.store_name }}</span>
<span class="sp">平台分类{{ projectData.storeCategory?projectData.storeCategory.cate_name:'' }}</span> <span class="sp">平台分类{{ projectData.storeCategory ? projectData.storeCategory.cate_name : '' }}</span>
<span class="sp">品牌{{ projectData.brand?projectData.brand.brand_name:'其他' }}</span> <span class="sp">品牌{{ projectData.brand ? projectData.brand.brand_name : '其他' }}</span>
<span class="sp">商品关键字{{ projectData.keyword }}</span> <span class="sp">商品关键字{{ projectData.keyword }}</span>
<span class="sp">商品单位{{ projectData.unit_name }}</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="sp" v-if="projectData.temp && projectData.temp.name">运费模板{{
<span class="sp100" v-if="projectData.temp && projectData.temp.info">运费说明{{ projectData.temp?projectData.temp.info:'' }}</span> 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"> <span class="sp100">
商品分类 商品分类
<template v-if="projectData.merCateId"> <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> </template>
<span v-else>-</span> <span v-else>-</span>
</span> </span>
@ -29,50 +25,45 @@
<span class="sp100"> <span class="sp100">
商品封面图 商品封面图
<div class="demo-image__preview"> <div class="demo-image__preview">
<el-image <el-image style="width: 60px; height: 60px" :src="projectData.image"
style="width: 60px; height: 60px" :preview-src-list="[projectData.image]" />
:src="projectData.image"
:preview-src-list="[projectData.image]"
/>
</div> </div>
</span> </span>
<span v-if="projectData.video_link" class="sp100"> <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"
您的浏览器不支持 video 标签 controls="controls">
</video> 您的浏览器不支持 video 标签
</video>
</span> </span>
<span class="sp100">商品轮播图 <span class="sp100">商品轮播图
<div <div v-for="(item, index) in projectData.slider_image" :key="index" class="pictrue">
v-for="(item,index) in projectData.slider_image" <el-image style="width: 60px; height: 60px" :src="item" :preview-src-list="[item]" />
:key="index"
class="pictrue"
>
<el-image
style="width: 60px; height: 60px"
:src="item"
:preview-src-list="[item]"
/>
</div> </div>
</span> </span>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="商品详情" name="second"> <el-tab-pane label="商品详情" name="second">
<span class="sp100">商品详情</span> <el-form v-if="projectData && projectData.content">
<div class="contentPic" v-html="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>
<el-tab-pane label="其他设置" name="third"> <el-tab-pane label="其他设置" name="third">
<span class="sp100">商品排序{{ projectData.sort }}</span> <span class="sp100">商品排序{{ projectData.sort }}</span>
<span class="third mb20"> <span class="third mb20">
<span>商品推荐</span> <span>商品推荐</span>
<el-checkbox-group v-model="checkboxGroup" size="small"> <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> </el-checkbox-group>
</span> </span>
<span v-if="projectData.guarantee && projectData.guarantee.templateValue.length" class="third mb20"> <span v-if="projectData.guarantee && projectData.guarantee.templateValue.length" class="third mb20">
<span>服务保障</span> <span>服务保障</span>
<span v-for="(item,index) in projectData.guarantee.templateValue" :key="index"> <span v-for="(item, index) in projectData.guarantee.templateValue" :key="index">
<span v-if="item.value">{{index+1}}. {{item.value.guarantee_name}}</span> <span v-if="item.value">{{ index + 1 }}. {{ item.value.guarantee_name }}</span>
</span> </span>
</span> </span>
</el-tab-pane> </el-tab-pane>
@ -86,14 +77,12 @@
<el-table-column align="center" label="图片" min-width="80"> <el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="demo-image__preview"> <div class="demo-image__preview">
<el-image <el-image style="width: 60px; height: 60px" :src="scope.row.image" />
style="width: 60px; height: 60px"
:src="scope.row.image"
/>
</div> </div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span class="priceBox" v-text="scope.row[iii]" /> <span class="priceBox" v-text="scope.row[iii]" />
</template> </template>
@ -114,13 +103,14 @@
</template> </template>
<template v-if="projectData.spec_type === 1"> <template v-if="projectData.spec_type === 1">
<el-table :data="ManyAttrValue" border size="small"> <el-table :data="ManyAttrValue" border size="small">
<template v-if="manyTabDate"> <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"
<template slot-scope="scope"> :label="manyTabTit[iii].title" min-width="80">
<span class="priceBox" v-text="scope.row[iii]" /> <template slot-scope="scope">
</template> <span class="priceBox" v-text="scope.row[iii]" />
</el-table-column> </template>
</template> </el-table-column>
</template>
<el-table-column align="center" label="图片" min-width="80"> <el-table-column align="center" label="图片" min-width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="upLoadPicBox"> <div class="upLoadPicBox">
@ -128,7 +118,8 @@
</div> </div>
</template> </template>
</el-table-column> </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"> <template slot-scope="scope">
<span class="priceBox">{{ scope.row[iii] }}</span> <span class="priceBox">{{ scope.row[iii] }}</span>
</template> </template>
@ -157,14 +148,14 @@
<el-radio :label="-1">拒绝</el-radio> <el-radio :label="-1">拒绝</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="ruleForm.status===-1" label="原因" prop="refusal"> <el-form-item v-if="ruleForm.status === -1" label="原因" prop="refusal">
<el-input v-model="ruleForm.refusal" type="textarea" placeholder="请输入原因" /> <el-input v-model="ruleForm.refusal" type="textarea" placeholder="请输入原因" />
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button size="small" @click="dialogVisible = false"> </el-button> <el-button size="small" @click="dialogVisible = false"> </el-button>
<el-button size="small" type="primary" @click="onSubmit"> </el-button> <el-button size="small" type="primary" @click="onSubmit"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
@ -285,7 +276,7 @@ export default {
computed: { computed: {
attrValue() { attrValue() {
const obj = Object.assign({}, defaultObj.attrValue[0]) const obj = Object.assign({}, defaultObj.attrValue[0])
if(this.svip_type == 0)delete obj.svip_price if (this.svip_type == 0) delete obj.svip_price
delete obj.image delete obj.image
return obj return obj
}, },
@ -296,6 +287,9 @@ export default {
} }
}, },
methods: { methods: {
srcParse(e) {
return e.image[0]
},
onSubmit() { onSubmit() {
this.isShow ? this.ruleForm.id = this.proId : this.ruleForm.id = this.ids this.isShow ? this.ruleForm.id = this.proId : this.ruleForm.id = this.ids
productStatusApi(this.ruleForm).then(res => { productStatusApi(this.ruleForm).then(res => {
@ -318,7 +312,7 @@ export default {
productDetailApi(id).then(res => { productDetailApi(id).then(res => {
this.projectData = res.data this.projectData = res.data
this.svip_type = res.data.svip_price_type this.svip_type = res.data.svip_price_type
if (this.projectData.spec_type === 0) { if (this.projectData.spec_type === 0) {
this.OneattrValue = res.data.attrValue this.OneattrValue = res.data.attrValue
} else { } else {
@ -350,48 +344,57 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.projectInfo ::v-deep .el-dialog__body{ .projectInfo ::v-deep .el-dialog__body {
padding-top: 0 !important; padding-top: 0 !important;
} }
.projectInfo ::v-deep .el-tabs__content{
padding-left: 10px !important; .projectInfo ::v-deep .el-tabs__content {
} padding-left: 10px !important;
.tabPic{ }
width: 40px !important;
height: 40px !important; .tabPic {
img{ width: 40px !important;
width: 100%; height: 40px !important;
height: 100%;
} img {
}
.sp {
display: block;
width: 33%;
margin-bottom: 20px;
}
.sp100 {
width: 100%; width: 100%;
margin-bottom: 15px; height: 100%;
display: inline-block;
} }
.third{ }
.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;
border: 1px dotted rgba(0, 0, 0, 0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
display: inline-block;
img {
width: 100%; width: 100%;
display: flex; height: 100%;
}
.pictrue {
width: 60px;
height: 60px;
border: 1px dotted rgba(0, 0, 0, 0.1);
margin-right: 10px;
position: relative;
cursor: pointer;
display: inline-block;
img {
width: 100%;
height: 100%;
}
}
.demo-image__preview{
display: inline-block;
} }
}
.demo-image__preview {
display: inline-block;
}
</style> </style>