Commit 6a449ea7 by 前端

Merge branch 'v3.16.1' into 'master'

V3.16.1

See merge request !25
2 parents 3fa702c6 68dac2d5
...@@ -42,6 +42,16 @@ const getCarlifeGoodsApi = params => { ...@@ -42,6 +42,16 @@ const getCarlifeGoodsApi = params => {
}) })
} }
const getSelfSupportGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.discover.page'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
const addGoodsApi = params => { const addGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.upgrade.add.or.update' params.method = 'scrm.api.shopmall.goods.configuration.upgrade.add.or.update'
...@@ -130,12 +140,23 @@ const exportGoodsApi = params => { ...@@ -130,12 +140,23 @@ const exportGoodsApi = params => {
sign: true sign: true
}) })
} }
const getSelfGoodsDetailApi = params => {
params.method = 'scrm.api.shopmall.goods.getById'
return http({
url,
method: 'post',
data: params,
sign: true
})
}
export default { export default {
getGoodsListApi, getGoodsListApi,
updateGoodsStatusApi, updateGoodsStatusApi,
delGoodsApi, delGoodsApi,
getCarlifeGoodsApi, getCarlifeGoodsApi,
getSelfSupportGoodsApi,
addGoodsApi, addGoodsApi,
getGoodsDetail, getGoodsDetail,
getMerchantListApi, getMerchantListApi,
...@@ -143,5 +164,6 @@ export default { ...@@ -143,5 +164,6 @@ export default {
getVisitorListApi, getVisitorListApi,
getSharedListApi, getSharedListApi,
exportBrowseApi, exportBrowseApi,
exportGoodsApi exportGoodsApi,
getSelfGoodsDetailApi
} }
\ No newline at end of file \ No newline at end of file
<template> <template>
<div class="category-list-ctnr"> <div>
<ownerPreference></ownerPreference>
</div>
<!-- <div class="category-list-ctnr">
<GLTabs ref='GLTabs' class="tabs" v-model="activeName" :tabPaneList="tabPaneList" <GLTabs ref='GLTabs' class="tabs" v-model="activeName" :tabPaneList="tabPaneList"
@tab-click="handleClick" removeTab="removeTab"></GLTabs> @tab-click="handleClick" removeTab="removeTab"></GLTabs>
...@@ -38,19 +41,19 @@ ...@@ -38,19 +41,19 @@
<template v-if="activeName=='2'"> <template v-if="activeName=='2'">
<ownerPreference></ownerPreference> <ownerPreference></ownerPreference>
</template> </template>
</div> </div> -->
</template> </template>
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import pullDownNav from './components/pullDownNav' // import pullDownNav from './components/pullDownNav'
import ownerPreference from "views/category/ownerPreference"; import ownerPreference from "views/category/ownerPreference";
export default { export default {
name: 'App', name: 'App',
components: { components: {
pullDownNav, // pullDownNav,
ownerPreference ownerPreference
}, },
data() { data() {
...@@ -139,7 +142,7 @@ export default { ...@@ -139,7 +142,7 @@ export default {
} }
}, },
created() { created() {
this.getChannelList() // this.getChannelList()
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
......
...@@ -9,39 +9,19 @@ ...@@ -9,39 +9,19 @@
@change="changeChannelImg"></glsx-preview> @change="changeChannelImg"></glsx-preview>
<div class="text-tip" style="margin: 0;">建议尺寸:120*120</div> <div class="text-tip" style="margin: 0;">建议尺寸:120*120</div>
</div> </div>
<div slot="selectBrandSlot"> <div slot="selectBrandSlot" class="mode-slot">
<el-radio-group v-model="formObj.categoryStyle"> <div class="mode-item" v-for="item in modeList" :key="item.id">
<el-radio :label="0">标准商品-竖向排列 <el-radio v-model="formObj.categoryStyle" :label="item.id">{{item.name}}</el-radio>
</el-radio> <div>
<el-radio :label="1">标准商品-横向排列 <el-popover
</el-radio>
<el-radio :label="2">种草样式</el-radio>
</el-radio-group>
<div class="category-style">
<el-popover
popper-class="tool-gltip" popper-class="tool-gltip"
placement="top-start" placement="top-start"
width="200" width="200"
trigger="hover"> trigger="hover">
<img src="@/assets/category/vertical.png" style="width:300px;height:300px;"/> <img :src="require(`@/assets/category/${item.url}.png`)" style="width:300px;height:300px;"/>
<img slot="reference" src="@/assets/category/vertical.png"> <img slot="reference" :src="require(`@/assets/category/${item.url}.png`)">
</el-popover> </el-popover>
<el-popover </div>
popper-class="tool-gltip"
placement="top-start"
width="200"
trigger="hover">
<img src="@/assets/category/transverse.png" style="width:300px;height:300px;"/>
<img slot="reference" src="@/assets/category/transverse.png">
</el-popover>
<el-popover
popper-class="tool-gltip"
placement="top-start"
width="200"
trigger="hover">
<img src="@/assets/category/recommend.png" style="width:300px;height:300px;"/>
<img slot="reference" src="@/assets/category/recommend.png">
</el-popover>
</div> </div>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
...@@ -54,7 +34,28 @@ ...@@ -54,7 +34,28 @@
</template> </template>
<script> <script>
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
const MODE_LIST = [
{
id: 0,
url: 'vertical',
name: '商品-竖向排列'
},
{
id: 1,
url: 'transverse',
name: '商品-横向排列'
},
{
id: 2,
url: 'recommend',
name: '种草样式A'
},
{
id: 3,
url: 'recommend2',
name: '种草样式B'
}
]
export default { export default {
name: 'add', name: 'add',
components: { components: {
...@@ -63,8 +64,10 @@ export default { ...@@ -63,8 +64,10 @@ export default {
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
modeList: MODE_LIST,
formObj: { formObj: {
id: '', id: '',
categoryType: 1,
categoryName: '', categoryName: '',
categoryStyle: 0, categoryStyle: 0,
videoCoverArr: [] videoCoverArr: []
...@@ -107,6 +110,23 @@ export default { ...@@ -107,6 +110,23 @@ export default {
isDisabled: false isDisabled: false
}, },
{ {
label: '分类归属',
name: 'categoryType',
type: 'radio',
optionList: [
{
label: '配置升级',
id: 1
},
{
label: '车主优选',
id: 2
},
],
optionId: 'id',
optionLabel: 'label'
},
{
label: '分类图标', label: '分类图标',
name: 'categoryImage', name: 'categoryImage',
addHtml: 'videoCoverSlot' addHtml: 'videoCoverSlot'
...@@ -126,7 +146,6 @@ export default { ...@@ -126,7 +146,6 @@ export default {
} }
}, },
methods: { methods: {
changeChannelImg(val) { changeChannelImg(val) {
this.$refs.baseInfoRef.$refs.formRef.validateField('coverUrl') this.$refs.baseInfoRef.$refs.formRef.validateField('coverUrl')
}, },
...@@ -134,7 +153,6 @@ export default { ...@@ -134,7 +153,6 @@ export default {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => { this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
let params = JSON.parse(JSON.stringify(this.formObj)) let params = JSON.parse(JSON.stringify(this.formObj))
params.categoryType = 2 //类型 1 配置升级 2 车主优选
params.categoryLevel = 1 //分类等级(1:一级分类,2:二级分类) params.categoryLevel = 1 //分类等级(1:一级分类,2:二级分类)
params.categoryImage = this.formObj.videoCoverArr[0] params.categoryImage = this.formObj.videoCoverArr[0]
delete params.videoCoverArr delete params.videoCoverArr
...@@ -156,7 +174,7 @@ export default { ...@@ -156,7 +174,7 @@ export default {
getCaseDetailApi() { getCaseDetailApi() {
this.$apis.category.batchDetailApi({id: this.$route.query.id}).then(res => { this.$apis.category.batchDetailApi({id: this.$route.query.id}).then(res => {
if (res) { if (res) {
const attrList = ['id', 'categoryName', 'categoryStyle'] const attrList = ['id', 'categoryName', 'categoryStyle', 'categoryType']
attrList.forEach(key => { attrList.forEach(key => {
this.formObj[key] = res[key] this.formObj[key] = res[key]
}) })
...@@ -198,9 +216,17 @@ export default { ...@@ -198,9 +216,17 @@ export default {
} }
} }
} }
.mode-slot{
display: flex;
.mode-item{
width: 145px;
img{
width: 103.97px;
height: 86.5px;
}
}
}
.category-style { .category-style {
img { img {
width: 104px; width: 104px;
height: 102.6px; height: 102.6px;
......
...@@ -28,7 +28,11 @@ ...@@ -28,7 +28,11 @@
</div> </div>
<div class="category-style" v-if="scope.scope.categoryStyle == 2"> <div class="category-style" v-if="scope.scope.categoryStyle == 2">
<img src="@/assets/category/recommend.png"> <img src="@/assets/category/recommend.png">
<span>种草模式</span> <span>种草模式A</span>
</div>
<div class="category-style" v-if="scope.scope.categoryStyle == 3">
<img src="@/assets/category/recommend2.png">
<span>种草模式B</span>
</div> </div>
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
...@@ -113,12 +117,19 @@ export default { ...@@ -113,12 +117,19 @@ export default {
prop: 'categoryName' prop: 'categoryName'
}, },
{ {
label: '分类归属',
prop: 'categoryType',
formatter: cellValue => {
return cellValue.categoryType==1 ? '配置升级' : '车主优选'
}
},
{
label: '分类图标', label: '分类图标',
addHtml: 'categoryImage', addHtml: 'categoryImage',
width: 150 width: 150
}, },
{ {
label: '分类布局', label: '布局样式',
addHtml: 'categoryStyle', addHtml: 'categoryStyle',
width: 220 width: 220
}, },
...@@ -147,7 +158,6 @@ export default { ...@@ -147,7 +158,6 @@ export default {
methods: { methods: {
getParams() { getParams() {
var params = JSON.parse(JSON.stringify(this.tableSearchForm)) var params = JSON.parse(JSON.stringify(this.tableSearchForm))
params.categoryType = 2
params.categoryLevel = 1 params.categoryLevel = 1
if (this.tableSearchForm.createDate?.length) { if (this.tableSearchForm.createDate?.length) {
params.beginCreateTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' params.beginCreateTime = new Date(this.tableSearchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
......
...@@ -13,12 +13,18 @@ ...@@ -13,12 +13,18 @@
<glsx-combi-form :isInline="false" ref="goodsInfoRef" labelWidth="154px" defaultWidth="432px" <glsx-combi-form :isInline="false" ref="goodsInfoRef" labelWidth="154px" defaultWidth="432px"
:formObj.sync="formObj" :formData="goodsFormData" :formRules="goodsRule"> :formObj.sync="formObj" :formData="goodsFormData" :formRules="goodsRule">
<div slot="uploadSlot" class="upload-calss"> <div slot="uploadSlot" class="upload-calss">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.coverList" <glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.coverList"></glsx-preview>
@change="changeChannelImg"></glsx-preview>
<span class="tip">建议尺寸750*750,图片格式为jpg,jpeg,png,大小2M以内</span> <span class="tip">建议尺寸750*750,图片格式为jpg,jpeg,png,大小2M以内</span>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div slot="propagateCoverSlot" class="propagate-cover-class">
<div class="upload-wrap">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.styleBImgList"></glsx-preview>
<span class="preview" @click="showPreviewDialog=true">预览</span>
</div>
<span class="tip">分类布局选择种草样式B时商品宣传大图,建议720*540,大小2M以内</span>
</div>
<div slot="paymentSlot"> <div slot="paymentSlot">
<el-radio-group :disabled="disabled" v-model="formObj.paymentType"> <el-radio-group :disabled="disabled" v-model="formObj.paymentType">
<el-radio :label="1">全款</el-radio> <el-radio :label="1">全款</el-radio>
...@@ -95,10 +101,6 @@ ...@@ -95,10 +101,6 @@
</div> </div>
</div> </div>
</div> </div>
<div slot="categorySlot">
<brandCascader :curInfo="curCategoryInfo" :disabled="disabled" @clickItem="selectCategory"
class="category-class"></brandCascader>
</div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<GLFooter style="margin-top: 16px;"> <GLFooter style="margin-top: 16px;">
...@@ -107,7 +109,7 @@ ...@@ -107,7 +109,7 @@
</GLFooter> </GLFooter>
<selectCarDialog v-if="carDialogVisible" :echoData="vehicleSeriesRequestList" @handleClose="handleCarSeriesClose" <selectCarDialog v-if="carDialogVisible" :echoData="vehicleSeriesRequestList" @handleClose="handleCarSeriesClose"
@handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog> @handleConfirm="handleConfirm" :dialogVisible="carDialogVisible"></selectCarDialog>
<selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" <selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" :goodsInfo="{}"
@handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods> @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods>
<selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" <selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog"
:goodsId="formObj.smartcarlifeInfoId" :selectedList="saleMerchantList" :goodsId="formObj.smartcarlifeInfoId" :selectedList="saleMerchantList"
...@@ -116,6 +118,9 @@ ...@@ -116,6 +118,9 @@
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" /> <img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video> <video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</el-dialog> </el-dialog>
<div v-if="showPreviewDialog" class="preview-dialog" @click="showPreviewDialog = false">
<img class="preview-img" src="@/assets/preview.png" alt=""/>
</div>
</div> </div>
</template> </template>
<script> <script>
...@@ -156,7 +161,6 @@ const notPriceColumns = [ ...@@ -156,7 +161,6 @@ const notPriceColumns = [
} }
] ]
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import brandCascader from './components/brandCascader'
import selectGoods from './components/selectGoods' import selectGoods from './components/selectGoods'
import selectCarDialog from '@/views/store/components/selectCarDialog' import selectCarDialog from '@/views/store/components/selectCarDialog'
import selectMerchantDialog from './components/selectMerchantDialog' import selectMerchantDialog from './components/selectMerchantDialog'
...@@ -165,7 +169,6 @@ export default { ...@@ -165,7 +169,6 @@ export default {
name: 'add', name: 'add',
components: { components: {
glsxCombiForm, glsxCombiForm,
brandCascader,
selectGoods, selectGoods,
selectCarDialog, selectCarDialog,
selectMerchantDialog selectMerchantDialog
...@@ -184,19 +187,18 @@ export default { ...@@ -184,19 +187,18 @@ export default {
}, },
data() { data() {
return { return {
showPreviewDialog: false,
dialogVisibleImg:false, dialogVisibleImg:false,
goodsVisible: false, goodsVisible: false,
carDialogVisible: false, carDialogVisible: false,
merchantDialogVisible: false, merchantDialogVisible: false,
disabled: false, disabled: false,
dialogSrc:'', dialogSrc:'',
goodsInfo: {},
routeInfo: {}, routeInfo: {},
defaultProps: { defaultProps: {
children: 'categoryName', children: 'categoryName',
label: 'childs' label: 'childs'
}, },
curCategoryInfo: {},
posterOptions: { posterOptions: {
width: '104px', width: '104px',
height: '104px', height: '104px',
...@@ -236,12 +238,13 @@ export default { ...@@ -236,12 +238,13 @@ export default {
minSellPrice: '', minSellPrice: '',
retailPrice: '', retailPrice: '',
coverList: [], coverList: [],
styleBImgList: [],
styleBImg: '',
paymentType: 1, paymentType: 1,
depositPrice: '', depositPrice: '',
vehicleSeriesType: 1, vehicleSeriesType: 1,
goodsVideo: '', goodsVideo: '',
associationClassifyFirstId: '', associationClassifyFirstId: ''
associationClassifySecondId: ''
}, },
saleMerchantList: [], saleMerchantList: [],
vehicleSeriesRequestList: [], vehicleSeriesRequestList: [],
...@@ -324,17 +327,7 @@ export default { ...@@ -324,17 +327,7 @@ export default {
}, },
trigger: 'change' trigger: 'change'
}], }],
categoryName: [{ associationClassifyFirstId: [{required: true, message: '请选择关联商品分类', trigger: 'change'}],
required: true,
validator: (rule, value, callback) => {
if (!this.formObj.associationClassifyFirstId || !this.formObj.associationClassifySecondId) {
callback(new Error('请选择关联商品分类'))
} else {
callback()
}
},
trigger: 'change'
}],
}, },
formData: [ formData: [
{ {
...@@ -352,6 +345,11 @@ export default { ...@@ -352,6 +345,11 @@ export default {
isDisabled: false isDisabled: false
}, },
{ {
label: '种草样式B宣传图',
name: 'propagateCover',
addHtml: 'propagateCoverSlot'
},
{
label: '收款方式', label: '收款方式',
name: 'paymentType', name: 'paymentType',
addHtml: 'paymentSlot' addHtml: 'paymentSlot'
...@@ -402,11 +400,20 @@ export default { ...@@ -402,11 +400,20 @@ export default {
name: 'carSeriesName', name: 'carSeriesName',
addHtml: 'carSeriesSlot', addHtml: 'carSeriesSlot',
}, },
// {
// label: '关联商品分类',
// name: 'categoryName',
// addHtml: 'categorySlot'
// },
{ {
label: '关联商品分类', label: '关联商品分类',
name: 'categoryName', name: 'associationClassifyFirstId',
addHtml: 'categorySlot' type: 'select',
} optionList: [],
optionId: 'id',
optionLabel: 'categoryName',
isDisabled: false
},
], ],
selectedtableParams: { selectedtableParams: {
listName: 'list', listName: 'list',
...@@ -418,7 +425,7 @@ export default { ...@@ -418,7 +425,7 @@ export default {
} }
}, },
created() { created() {
// this.getCategory() this.getCategory()
const urlParam = this.$route.params const urlParam = this.$route.params
this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id)) this.routeInfo = JSON.parse(decodeURIComponent(urlParam.id))
const {id, type} = this.routeInfo const {id, type} = this.routeInfo
...@@ -427,6 +434,8 @@ export default { ...@@ -427,6 +434,8 @@ export default {
this.posterOptions.isClose = false this.posterOptions.isClose = false
const _target = this.goodsFormData.find(item => item.name == 'goodsName') const _target = this.goodsFormData.find(item => item.name == 'goodsName')
_target.isDisabled = true _target.isDisabled = true
const _classifyTarget = this.formData.find(item => item.name == 'associationClassifyFirstId')
_classifyTarget.isDisabled = true
this.selectedtableParams.tableOption = null this.selectedtableParams.tableOption = null
} }
if (id) { if (id) {
...@@ -434,6 +443,19 @@ export default { ...@@ -434,6 +443,19 @@ export default {
} }
}, },
methods: { methods: {
getCategory() {
const params = {
pageSize: 10000,
pageNum: 1,
categoryType: 1
}
this.$apis.category.getCategoryListApi(params).then(res => {
if (res?.list?.length) {
const _target = this.formData.find(item => item.name == 'associationClassifyFirstId')
_target.optionList = res.list
}
})
},
// 上传视频 // 上传视频
handleVideoChange(e) { handleVideoChange(e) {
let file = e.srcElement.files[0] let file = e.srcElement.files[0]
...@@ -590,11 +612,13 @@ export default { ...@@ -590,11 +612,13 @@ export default {
getParams() { getParams() {
let obj = JSON.parse(JSON.stringify(this.formObj)) let obj = JSON.parse(JSON.stringify(this.formObj))
obj.goodsImage = obj.coverList[0] obj.goodsImage = obj.coverList[0]
obj.styleBImg = obj.styleBImgList[0]
obj.depositPrice = obj.depositPrice ? Number(Number(obj.depositPrice * 10 * 10).toFixed(0)) : 0 obj.depositPrice = obj.depositPrice ? Number(Number(obj.depositPrice * 10 * 10).toFixed(0)) : 0
if (obj.paymentType == 1) delete obj.depositPrice if (obj.paymentType == 1) delete obj.depositPrice
delete obj.minSellPrice delete obj.minSellPrice
delete obj.retailPrice delete obj.retailPrice
delete obj.coverList delete obj.coverList
delete obj.styleBImgList
let saleMerchantList = this.saleMerchantList.map(item => { let saleMerchantList = this.saleMerchantList.map(item => {
let {merchantId, merchantName, activityPrice, originalPrice} = item let {merchantId, merchantName, activityPrice, originalPrice} = item
...@@ -616,8 +640,7 @@ export default { ...@@ -616,8 +640,7 @@ export default {
} }
if (this.routeInfo.id) params.id = this.routeInfo.id if (this.routeInfo.id) params.id = this.routeInfo.id
return params return params
} },
,
handleSave() { handleSave() {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => { this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
if (valid) { if (valid) {
...@@ -651,12 +674,9 @@ export default { ...@@ -651,12 +674,9 @@ export default {
this.formObj[key] = res[key] this.formObj[key] = res[key]
} }
} }
this.curCategoryInfo = {
categoryName: res.associationClassifySecondName,
id: res.associationClassifySecondId
}
this.formObj.goodsType = '1' this.formObj.goodsType = '1'
this.formObj.coverList = [res.goodsImage] this.formObj.coverList = [res.goodsImage]
this.formObj.styleBImgList = res.styleBImg ? [res.styleBImg] : []
this.saleMerchantList = res.saleMerchantList?.map(item => { this.saleMerchantList = res.saleMerchantList?.map(item => {
let activityPrice = item.activityPrice ? Number(Number(item.activityPrice / 100).toFixed(2)) : 0 let activityPrice = item.activityPrice ? Number(Number(item.activityPrice / 100).toFixed(2)) : 0
let originalPrice = item.originalPrice ? Number(Number(item.originalPrice / 100).toFixed(2)) : 0 let originalPrice = item.originalPrice ? Number(Number(item.originalPrice / 100).toFixed(2)) : 0
...@@ -689,6 +709,30 @@ export default { ...@@ -689,6 +709,30 @@ export default {
color: #666666; color: #666666;
} }
.propagate-cover-class{
.preview{
color: #5850ff;
font-weight: 400;
font-size: 14px;
line-height: 20px;
align-self: self-end;
margin-left: 10px;
cursor: pointer;
}
.upload-wrap{
display: flex;
}
.tip{
height: 20px;
line-height: 20px;
align-self: flex-end;
font-weight: 400;
font-size: 14px;
color: #999999;
}
}
.goods-wrap { .goods-wrap {
padding: 20px 20px 1px; padding: 20px 20px 1px;
width: 1000px; width: 1000px;
...@@ -849,4 +893,22 @@ export default { ...@@ -849,4 +893,22 @@ export default {
color: #999999; color: #999999;
margin-bottom: -35px; margin-bottom: -35px;
} }
.preview-dialog{
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 99;
bottom: 0;
background: rgba(0, 0, 0, 0.5);
.preview-img{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 390px;
height: 720px;
}
}
</style> </style>
...@@ -15,15 +15,19 @@ ...@@ -15,15 +15,19 @@
<el-button :size="size" <el-button :size="size"
type="primary" type="primary"
@click="resetTable">查询</el-button> @click="resetTable">查询</el-button>
<el-button :size="size" v-if="goodsInfo.goodsSource==2"
@click="resetSearch">重置</el-button>
</span> </span>
</glsx-combi-form> </glsx-combi-form>
<GLTable ref="goodsRef" <GLTable ref="goodsRef"
:noDataImg="url" :noDataImg="url"
:searchForm="searchForm" :searchForm="searchForm"
:tableParams="tableParams" :tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"
:pageConf="pageConf" :pageConf="pageConf"
@refreshTable="getList" @refreshTable="getList"
:getListApi="getListApi" :getListApi="getListApi"
:pageSizes="pageSizes"
:hasNum="false" :hasNum="false"
:setTableFinishFun="setTableFinishFun"> :setTableFinishFun="setTableFinishFun">
<div slot="radioHtml" <div slot="radioHtml"
...@@ -33,12 +37,22 @@ ...@@ -33,12 +37,22 @@
:label="scope.scope.id" :label="scope.scope.id"
@click.native="handleClick(scope.scope)"></el-radio> @click.native="handleClick(scope.scope)"></el-radio>
</div> </div>
<div slot="selfRadioHtml"
class="store-table"
slot-scope="scope">
<el-radio v-model="curInfo.goodsId"
:label="scope.scope.goodsId"
@click.native="handleClick(scope.scope)"></el-radio>
</div>
<div slot="imageSlot" slot-scope="scope"> <div slot="imageSlot" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block"> <el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.goodsImage" /> <img class="table-popover-img" :src="scope.scope.goodsImage" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" /> <img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover> </el-popover>
</div> </div>
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImage" alt="">{{ scope.scope.goodsName }}
</div>
</GLTable> </GLTable>
</GLDialog> </GLDialog>
</div> </div>
...@@ -46,6 +60,65 @@ ...@@ -46,6 +60,65 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
const MERCHANT_SEARCH_ITEM = {
label: '门店名称',
name: 'merchantName',
type: 'input',
width: '200px',
labelWidth: '10px',
isClear: true
}
const defaultTableCol = [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '缩略图',
addHtml: 'imageSlot'
},
{
label: '价格(元)',
formatter: cellValue => {
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice/100).toFixed(2)) : '--'
}
}
]
const merchantGoodsTableCol = [
{
label: '',
prop: '',
width: 80,
addHtml: 'selfRadioHtml'
},
{
label: '商品信息',
addHtml: 'goodsNameSlot'
},
{
label: '门店名称',
prop: 'merchantName'
},
{
label: '零售价(元)',
formatter: cellValue => {
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice/100).toFixed(2)) : '--'
}
},
{
label: '划线价(元)',
formatter: cellValue => {
return cellValue.originalPrice ? Number(Number(cellValue.originalPrice/100).toFixed(2)) : '--'
}
}
]
export default { export default {
name: 'selectStore', name: 'selectStore',
data() { data() {
...@@ -67,7 +140,7 @@ export default { ...@@ -67,7 +140,7 @@ export default {
name: 'goodsName', name: 'goodsName',
type: 'input', type: 'input',
placeholder: '请输入商品名称', placeholder: '请输入商品名称',
width: '300px', width: '200px',
labelWidth: '10px', labelWidth: '10px',
isClear: true isClear: true
} }
...@@ -79,30 +152,10 @@ export default { ...@@ -79,30 +152,10 @@ export default {
getListApi: this.$apis.goods.getCarlifeGoodsApi, getListApi: this.$apis.goods.getCarlifeGoodsApi,
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableColumns: [ tableColumns:defaultTableCol
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '商品名称',
prop: 'goodsName'
},
{
label: '缩略图',
addHtml: 'imageSlot'
},
{
label: '价格(元)',
formatter: cellValue => {
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice/100).toFixed(2)) : '--'
}
}
]
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageSizes: [5, 10, 20, 30, 40],
baseData: {} baseData: {}
} }
}, },
...@@ -133,8 +186,13 @@ export default { ...@@ -133,8 +186,13 @@ export default {
// minSellPrice: minSellPrice ? Number(Number(minSellPrice*10*10).toFixed(0)) : 0, // minSellPrice: minSellPrice ? Number(Number(minSellPrice*10*10).toFixed(0)) : 0,
// retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0, // retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0,
// } // }
this.searchForm.discoverGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : '' this.searchForm.discoverGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : '' //1查看,2编辑,空是新增,编辑进来要传id
this.searchForm.goodsType = this.routeInfo.goodsType this.searchForm.goodsType = this.routeInfo.goodsType // 1是配置 2是车主
if(this.goodsInfo.goodsSource==2){ //来源是门店自营的搜素和列表字段都要改
this.searchFormData.push(MERCHANT_SEARCH_ITEM)
this.tableParams.tableColumns = merchantGoodsTableCol
this.getListApi = this.$apis.goods.getSelfSupportGoodsApi
}
}, },
mounted() { mounted() {
...@@ -146,6 +204,22 @@ export default { ...@@ -146,6 +204,22 @@ export default {
resetTable() { resetTable() {
this.$refs.goodsRef.refreshTable() this.$refs.goodsRef.refreshTable()
}, },
resetSearch(){
this.searchForm = {
goodsName: '',
discoverGoodsId: '',
goodsType: ''
}
this.resetTable()
},
beforeSearchFn() {
return new Promise(resolve => {
if(this.goodsInfo.goodsSource==2){
delete this.searchForm.goodsType
}
resolve()
})
},
setTableFinishFun() { setTableFinishFun() {
this.$refs.goodsRef.tableHeightValues = '460px' this.$refs.goodsRef.tableHeightValues = '460px'
}, },
...@@ -174,6 +248,14 @@ export default { ...@@ -174,6 +248,14 @@ export default {
margin-top: 1px; margin-top: 1px;
} }
} }
.goodsNameSlot{
img{
width: 36px;
height: 36px;
vertical-align: middle;
margin-right: 8px;
}
}
.select-store { .select-store {
.storeDailog { .storeDailog {
width: 500px; width: 500px;
......
...@@ -4,9 +4,7 @@ ...@@ -4,9 +4,7 @@
<preferList v-if="activeName == '2'"></preferList> <preferList v-if="activeName == '2'"></preferList>
<div v-else class="table-wrap"> <div v-else class="table-wrap">
<GLCombiForm ref="showSearch" class="search-wrap" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"> <GLCombiForm ref="showSearch" class="search-wrap" :rowNumber="1" :formObj="tableSearchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset">
<div slot="categorySlot">
<brandCascader ref="cascaderRef" @clickItem="selectCategory" class="category-slot-class"></brandCascader>
</div>
</GLCombiForm> </GLCombiForm>
<div class="operate-wrap"> <div class="operate-wrap">
<span class="table-title">发现商品列表</span> <span class="table-title">发现商品列表</span>
...@@ -69,13 +67,11 @@ ...@@ -69,13 +67,11 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import brandCascader from './components/brandCascader'
import preferList from './preferList' import preferList from './preferList'
import { exportFn } from '@/common/constant' import { exportFn } from '@/common/constant'
export default { export default {
name: 'App', name: 'App',
components: { components: {
brandCascader,
preferList preferList
}, },
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
...@@ -84,6 +80,9 @@ ...@@ -84,6 +80,9 @@
if(from.path.indexOf('/goods/addPrefer')==0 || (from.path.indexOf('/goods/browseList')==0 && from.query.activeName== 2)) {vm.activeName='2'} if(from.path.indexOf('/goods/addPrefer')==0 || (from.path.indexOf('/goods/browseList')==0 && from.query.activeName== 2)) {vm.activeName='2'}
}) })
}, },
created() {
this.getCategory()
},
data() { data() {
return { return {
tableSearchForm: { tableSearchForm: {
...@@ -190,9 +189,12 @@ ...@@ -190,9 +189,12 @@
type: 'input' type: 'input'
}, },
{ {
label: '商品分类', label: '分类名称',
name: 'goodsCategory', name: 'associationClassifyFirstId',
addHtml: 'categorySlot' type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'categoryName',
}, },
], ],
getListApi: this.$apis.goods.getGoodsListApi, getListApi: this.$apis.goods.getGoodsListApi,
...@@ -254,7 +256,7 @@ ...@@ -254,7 +256,7 @@
label: '分类', label: '分类',
width: 150, width: 150,
formatter: cellValue => { formatter: cellValue => {
return `${cellValue.associationClassifyFirstName||''}-${cellValue.associationClassifySecondName||''}` return `${cellValue.associationClassifyFirstName||''}`
} }
}, },
{ {
...@@ -281,7 +283,6 @@ ...@@ -281,7 +283,6 @@
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' } pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
} }
}, },
created() {},
mounted() {}, mounted() {},
methods: { methods: {
// 明细 // 明细
...@@ -312,6 +313,20 @@ ...@@ -312,6 +313,20 @@
} }
}) })
}, },
getCategory() {
const params = {
pageSize: 10000,
pageNum: 1,
categoryType: 1
}
this.$apis.category.getCategoryListApi(params).then(res => {
if (res?.list?.length) {
const _target = this.searchFormData.find(item => item.name == 'associationClassifyFirstId')
_target && (_target.optionList = res.list)
console.log(this.searchFormData)
}
})
},
handleExport () { handleExport () {
var params = this.$common.utils.deepClone(this.searchForm) var params = this.$common.utils.deepClone(this.searchForm)
params.goodsType = 1 params.goodsType = 1
......
...@@ -24,14 +24,32 @@ ...@@ -24,14 +24,32 @@
<span :class="['status', scope.scope.goodsStatus==1 ? 'success-status': 'error-status']"></span> <span :class="['status', scope.scope.goodsStatus==1 ? 'success-status': 'error-status']"></span>
<span>{{ scope.scope.goodsStatus == 1 ? '上架' : '下架' }}</span> <span>{{ scope.scope.goodsStatus == 1 ? '上架' : '下架' }}</span>
</div> </div>
<div slot="merchantNameSlot" slot-scope="scope">
<template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1">
<span>{{ filterData(scope.scope,'merchantName').slice(0, 1).join('、') }}</span>
<el-popover
placement="top"
width="fit-content"
trigger="hover">
<div v-for="(item,index) in filterData(scope.scope, 'merchantName')" :key="index">
{{ item }}
</div>
<span class="more-info" slot="reference">...[{{ scope.scope.saleMerchantList.length }}]</span>
</el-popover>
</template>
<template v-else>
<span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span>
<span v-else>{{ filterData(scope.scope, 'merchantName').join('、') }}</span>
</template>
</div>
<div slot="merchantPriceSlot" slot-scope="scope"> <div slot="merchantPriceSlot" slot-scope="scope">
<template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1"> <template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1">
<span>{{ filterData(scope.scope).slice(0, 1).join('、') }}</span> <span>{{ filterData(scope.scope, 'price').slice(0, 1).join('、') }}</span>
<el-popover <el-popover
placement="top" placement="top"
width="fit-content" width="fit-content"
trigger="hover"> trigger="hover">
<div v-for="(item,index) in filterData(scope.scope)" :key="index"> <div v-for="(item,index) in filterData(scope.scope, 'price')" :key="index">
{{ item }} {{ item }}
</div> </div>
<span class="more-info" slot="reference">...[{{ scope.scope.saleMerchantList.length }}]</span> <span class="more-info" slot="reference">...[{{ scope.scope.saleMerchantList.length }}]</span>
...@@ -39,7 +57,7 @@ ...@@ -39,7 +57,7 @@
</template> </template>
<template v-else> <template v-else>
<span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span> <span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span>
<span v-else>{{ filterData(scope.scope).join('、') }}</span> <span v-else>{{ filterData(scope.scope, 'price').join('、') }}</span>
</template> </template>
</div> </div>
<div <div
...@@ -58,12 +76,12 @@ ...@@ -58,12 +76,12 @@
</div> </div>
<div slot="giveIntegralSlot" slot-scope="scope"> <div slot="giveIntegralSlot" slot-scope="scope">
<template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1"> <template v-if="scope.scope.saleMerchantList && scope.scope.saleMerchantList.length > 1">
<span>{{ filterData(scope.scope, 1).slice(0, 1).join('、') }}</span> <span>{{ filterData(scope.scope, 'score').slice(0, 1).join('、') }}</span>
<el-popover <el-popover
placement="top" placement="top"
width="400" width="400"
trigger="hover"> trigger="hover">
<div v-for="(item,index) in filterData(scope.scope,1)" :key="index"> <div v-for="(item,index) in filterData(scope.scope,'score')" :key="index">
{{ item }} {{ item }}
</div> </div>
<span class="more-info" slot="reference">...({{ scope.scope.saleMerchantList.length }})</span> <span class="more-info" slot="reference">...({{ scope.scope.saleMerchantList.length }})</span>
...@@ -71,7 +89,7 @@ ...@@ -71,7 +89,7 @@
</template> </template>
<template v-else> <template v-else>
<span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span> <span v-if="!scope.scope.saleMerchantList || !scope.scope.saleMerchantList.length">--</span>
<span v-else>{{ filterData(scope.scope, 1).join('、') }}</span> <span v-else>{{ filterData(scope.scope, 'score').join('、') }}</span>
</template> </template>
</div> </div>
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
...@@ -197,25 +215,30 @@ export default { ...@@ -197,25 +215,30 @@ export default {
}, },
{ {
label: '来源', label: '来源',
name: 'source', name: 'goodsSource',
type: 'select', type: 'select',
optionList: [ optionList: [
{ {
id: '', id: '',
name: '全部' name: '全部'
}, },
// {
// id: '1',
// name: '云中鹤'
// },
{ {
id: '2', id: 1,
name: '嘀加智享' name: '嘀加智享'
}, },
{
id: 2,
name: '门店自营'
},
], ],
optionId: 'id', optionId: 'id',
optionLabel: 'name' optionLabel: 'name'
}, },
{
label: '门店名称',
name: 'merchantName',
type: 'input'
},
], ],
getListApi: this.$apis.goods.getGoodsListApi, getListApi: this.$apis.goods.getGoodsListApi,
tableParams: { tableParams: {
...@@ -226,10 +249,10 @@ export default { ...@@ -226,10 +249,10 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '来源', label: '来源',
prop: 'sourse', prop: 'goodsSource',
width: 150, width: 150,
formatter: cellValue => { formatter: cellValue => {
return '嘀加智享平台' return cellValue.goodsSource==1 ? '嘀加智享平台' : '门店自营'
} }
}, },
{ {
...@@ -241,6 +264,12 @@ export default { ...@@ -241,6 +264,12 @@ export default {
label: '缩略图', label: '缩略图',
addHtml: 'imageSlot' addHtml: 'imageSlot'
}, },
{
label: '门店名称',
prop: 'merchantName',
width: 200,
addHtml: 'merchantNameSlot'
},
// { // {
// label: '供货价格(元)', // label: '供货价格(元)',
// formatter: cellValue => { // formatter: cellValue => {
...@@ -411,16 +440,18 @@ export default { ...@@ -411,16 +440,18 @@ export default {
} }
}) })
}, },
filterData({saleMerchantList: list}, notFormat) { filterData({saleMerchantList: list}, type) {
if (notFormat) { if (type=='score') {
return list?.map(item => { return list?.map(item => {
return `${item.merchantName || '--'}:${item.giveIntegral || '0'}` return `${item.merchantName || '--'}:${item.giveIntegral || '0'}`
}) || [] }) || []
} else { } else if(type=='price') {
return list?.map(item => { return list?.map(item => {
let activityPrice = item.activityPrice ? Number((Number(item.activityPrice) / 100).toFixed(2)) : 0 let activityPrice = item.activityPrice ? Number((Number(item.activityPrice) / 100).toFixed(2)) : 0
return `${item.merchantName || '--'}:${activityPrice || '0'}` return `${activityPrice || '0'}`
}) || [] }) || []
}else{
return list?.map(item => item.merchantName) || []
} }
}, },
getParams() { getParams() {
......
...@@ -83,13 +83,24 @@ ...@@ -83,13 +83,24 @@
<img :src="shareData.posterUrl" /> <img :src="shareData.posterUrl" />
</div> </div>
</div> </div>
<div class="share-content"> <div class="share-qrcode">
<div> <div class="share-content qrcode-item">
<div class="share-title">小程序码</div> <div>
<el-button type="primary" @click="handleSaveImg(shareData.qrCodeUrl, '小程序码')">保存图片</el-button> <div class="share-title">小程序码</div>
<el-button type="primary" @click="handleSaveImg(shareData.qrCodeUrl, '小程序码')">保存图片</el-button>
</div>
<div class="qr-code">
<img :src="shareData.qrCodeUrl" />
</div>
</div> </div>
<div class="qr-code"> <div class="share-content qrcode-item" v-if="activeName==6">
<img :src="shareData.qrCodeUrl" /> <div>
<div class="share-title">员工注册码</div>
<el-button type="primary" @click="handleSaveImg(shareData.registerQrCodeUrl, '员工注册码')">保存图片</el-button>
</div>
<div class="qr-code">
<img :src="shareData.registerQrCodeUrl" />
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -483,6 +494,14 @@ export default { ...@@ -483,6 +494,14 @@ export default {
} }
} }
} }
.share-qrcode{
display: flex;
flex-direction: column;
gap: 10px;
.qrcode-item{
height: 159px;
}
}
.share-footer { .share-footer {
width: 680px; width: 680px;
height: 90px; height: 90px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!