Commit 7599e5b3 by 前端

Merge branch 'v3.5.0-0227' into 'master'

合并V3.5.0 0227至主干

See merge request !39
2 parents 7179c2d5 70a2b370
......@@ -292,4 +292,16 @@ const getCrowdfundingParams = params => {
sign: true
})
}
export default { getPayListApi, getPayMerchatListApi, liveroomDetailexport, liveroomDetailpage, liveroomOverview, getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi, getDailyOrderQuantityStatistics, exportDailyOrderQuantityStatistics, getCrowdfundingParams }
/**众筹活动直播视频列表 */
const getTencentcloudmediaList = params => {
params.method = 'scrm.api.shopmall.tencentcloudmedia.list'
return http({
url: 'rop-scrm-shopmall/router',
method: 'POST',
data: params,
sign: true
})
}
export default { getPayListApi, getPayMerchatListApi, liveroomDetailexport, liveroomDetailpage, liveroomOverview, getActivityPageApi, getCrowdfundListApi, exportCrowdfundApi, getBrowseListApi, exportBrowseApi, toggleStatusApi, deleteActivityApi, topActivityApi, getSharedApi, addOrUpdateActivityApi, getActivityDetailApi, getCrowdSharedApi, getLiveListApi, getRankListApi, exportRankListApi, getDataBoardApi, getVisitorListApi, getSharedListApi, getDailyOrderQuantityStatistics, exportDailyOrderQuantityStatistics, getCrowdfundingParams, getTencentcloudmediaList }
<!-- 选择商品 - 单选 -->
<template>
<!-- :okText="productList.length ? '确定' : '创建商品'" -->
<GLDialog class="single-pro"
bigTitle="选择商品"
mode="big"
:before-close="handleSingleSelectClose"
:okText="'确定'"
:visible.sync="isSingleSelectVisible"
@onOk="handleSingleSelectConfirm"
@onCancel="handleSingleSelectClose">
<div style="max-height:60vh">
<div class="noproDiv"
v-if="!productList.length && fnCallBack">
<GLDialog
class="single-pro"
:bigTitle="!multiple?'选择商品':`选择商品(已选${infoIdList.length}项)`"
mode="big"
:before-close="handleSingleSelectClose"
:okText="'确定'"
:visible.sync="isSingleSelectVisible"
@onOk="handleSingleSelectConfirm"
@onCancel="handleSingleSelectClose"
>
<div
class="single-pro-box"
v-loading="loading"
>
<div
class="noproDiv"
v-if="!productList.length && fnCallBack"
>
<img src="@/assets/noPro.png" />
<p class="noproP">系统暂无已创建的商品</p>
</div>
<el-radio-group v-model="infoId"
v-if="productList.length"
class="pro-group">
<el-radio :class="['pro-box', item.id == infoId ? 'active' : '']"
v-for="item in productList"
:key="item.id"
:label="item.id">
<img v-show="item.id == infoId"
class="icon-check"
src="@/assets/icon-check.png" />
<img class="goods-img"
:src="item.goodsImage" />
<div class="txt-box">
<p :title="item.goodsName"
class="ellipsis">{{ item.goodsName }}</p>
<p class="f-s-12">销量:{{ item.saleAmount }}</p>
<p class="f-s-12">库存:{{ item.goodsStock }}</p>
<p class="f-s-12">零售价:{{ item.retailPrice }}</p>
<p :title="item.merchantName"
class="ellipsis f-s-12">门店名称:{{ item.merchantName }}</p>
</div>
</el-radio>
</el-radio-group>
<template v-if="multiple">
<el-checkbox-group
v-model="infoIdList"
v-if="productList.length"
class="pro-group"
:max="multipleMax"
>
<el-checkbox
:class="['pro-box', infoIdList.includes(item.id) ? 'active' : '']"
v-for="item in productList"
:key="item.id"
:label="item.id"
>
<!-- <img
v-show="infoIdList.includes(item.id)"
class="icon-check"
src="@/assets/icon-check.png"
/> -->
<div
class="icon-number icon-check"
v-show="infoIdList.includes(item.id)"
>{{infoIdList.findIndex(e => item.id == e) + 1}}</div>
<img
class="goods-img"
:src="item.goodsImage"
/>
<div class="txt-box">
<p
:title="item.goodsName"
class="ellipsis"
>{{ item.goodsName }}</p>
<p class="f-s-12">销量:{{ item.saleAmount }}</p>
<p class="f-s-12">库存:{{ item.goodsStock }}</p>
<p class="f-s-12">零售价:{{ item.retailPrice }}</p>
<p
:title="item.merchantName"
class="ellipsis f-s-12"
>门店名称:{{ item.merchantName }}</p>
</div>
</el-checkbox>
</el-checkbox-group>
</template>
<template v-else>
<el-radio-group
v-model="infoId"
v-if="productList.length"
class="pro-group"
>
<el-radio
:class="['pro-box', item.id == infoId ? 'active' : '']"
v-for="item in productList"
:key="item.id"
:label="item.id"
>
<img
v-show="item.id == infoId"
class="icon-check"
src="@/assets/icon-check.png"
/>
<img
class="goods-img"
:src="item.goodsImage"
/>
<div class="txt-box">
<p
:title="item.goodsName"
class="ellipsis"
>{{ item.goodsName }}</p>
<p class="f-s-12">销量:{{ item.saleAmount }}</p>
<p class="f-s-12">库存:{{ item.goodsStock }}</p>
<p class="f-s-12">零售价:{{ item.retailPrice }}</p>
<p
:title="item.merchantName"
class="ellipsis f-s-12"
>门店名称:{{ item.merchantName }}</p>
</div>
</el-radio>
</el-radio-group>
</template>
</div>
</GLDialog>
</template>
......@@ -46,13 +110,15 @@
// import { getGoodsList } from '@/api/modules/common'
export default {
name: 'selectSingleProDialog',
data() {
data () {
return {
userInfo: {},
infoId: '',
minRatilPrice: '',
productList: [],
fnCallBack: false
fnCallBack: false,
infoIdList: [],
loading: true
}
},
......@@ -61,30 +127,34 @@ export default {
type: Boolean,
default: false
},
selectedProInfo: {
type: Object,
default: () => { }
},
selectedProInfo: [Object, Array],
merchantId: {
type: String,
required: true
},
multiple: Boolean,
multipleMax: {
type: Number,
default: 5
}
},
computed: {},
mounted() {
mounted () {
const { multiple } = this
this.userInfo = this.$globalState.session
this.infoId = this.selectedProInfo.id
if (!multiple) this.infoId = this.selectedProInfo.id
this.getList()
},
methods: {
getList() {
getList () {
const { multiple, selectedProInfo } = this
var params = {
goodsStatus: 1,
isActivityUsing: 1,
goodsSources: [1, 3],
goodsSources: multiple? [3] :[1, 3],//众筹活动不能取门店自建商品
pageNum: 1,
pageSize: 100000,
deliveryType: 1,
......@@ -92,9 +162,15 @@ export default {
}
var that = this
this.$apis.common.getMerchantGoodsListApi(params).then(res => {
this.loading = false
// console.log(res)
this.fnCallBack = true
this.productList = res.list
if (multiple) {
selectedProInfo.length && selectedProInfo.map(e => {
if (e.id) this.infoIdList.push(e.id)
})
}
this.productList.forEach(function (item) {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList && item.specificationDetailList.length > 1) {
......@@ -117,13 +193,13 @@ export default {
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
console.log(item.retailPrice)
item.minRatilPrice = item.retailPrice
}
})
})
},
handleSingleSelectConfirm() {
handleSingleSelectConfirm () {
const { multiple, infoIdList } = this
if (!this.productList.length) {
var params = {
addOrEdit: 1,
......@@ -136,36 +212,74 @@ export default {
})
return true
}
if (!this.infoId) {
this.$message({
if (multiple) {
if (infoIdList.length < 1) return this.$message({
message: '请选择商品',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
const list = []
infoIdList.map(e => {
list.push(this.productList.find(item => item.id === e))
})
this.$emit('handleSingleSelectConfirm', list)
} else {
if (!this.infoId) {
this.$message({
message: '请选择商品',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
var selectInfo = this.productList.find(item => item.id === this.infoId)
this.$emit('handleSingleSelectConfirm', selectInfo)
}
var selectInfo = this.productList.find(item => item.id === this.infoId)
this.$emit('handleSingleSelectConfirm', selectInfo)
},
handleSingleSelectClose() {
handleSingleSelectClose () {
this.$emit('handleSingleSelectClose')
}
}
}
</script>
<style>
<style lang="scss">
.single-pro .pro-group {
margin-left: 50px;
// margin-left: 50px;
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 16px 14px;
padding-bottom: 20px;
.el-checkbox {
margin-right: 0 !important;
transition: all 0.25s;
}
.is-disabled {
opacity: 0.5;
}
.el-checkbox__input {
opacity: 0 !important;
position: absolute;
}
.el-checkbox__label {
padding-left: 0 !important;
}
}
.single-pro-box {
min-height: 20vh;
max-height: 60vh;
transition: all 0.25s;
}
.single-pro .pro-box {
width: 202px;
// width: 202px;
width: 246px;
border: 1px solid #e5e5e5;
border-radius: 6px;
/* margin: 0 10px 10px 0; */
margin: 0 40px 20px 0;
transition: all 0.25s;
// margin: 0 40px 20px 0;
}
.single-pro .pro-box:nth-child(4n) {
margin: 0 20px 20px 0;
// margin: 0 20px 20px 0;
}
.single-pro .pro-box.active {
box-shadow: 0px 6px 20px 0px rgba(122, 122, 122, 0.2);
......@@ -180,6 +294,18 @@ export default {
right: 10px;
width: 32px;
height: 32px;
line-height: 1;
font-size: 20px;
font-weight: 700;
}
.icon-number {
background-color: #5850ff;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
border-radius: 100%;
overflow: hidden;
}
.single-pro p {
margin: 0 0 8px 0;
......@@ -188,9 +314,10 @@ export default {
font-size: 12px;
}
.single-pro .pro-box .goods-img {
width: 202px;
height: 202px;
border-radius: 6px 6px 0 0;
width: 184px;
height: 184px;
display: block;
margin: 20px auto 0;
}
.single-pro .el-radio__input {
position: absolute;
......@@ -201,8 +328,10 @@ export default {
padding: 0;
}
.single-pro .txt-box {
padding: 10px 10px 0;
padding: 16px 20px 0;
color: #666666;
width: 246px;
box-sizing: border-box;
}
.single-pro .ellipsis {
white-space: nowrap;
......
......@@ -183,11 +183,21 @@ export default {
optionList: [],
optionId: 'confId',
optionLabel: 'confName'
},
{
label: '活动类型',
name: 'marketingType',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'activityTypeList'
}
],
tableSearchForm: {
merchantName: '',
activityName: ''
activityName: '',
activityType: ''
},
// 表格
userList: [],
......@@ -212,6 +222,14 @@ export default {
label: '活动门店',
prop: 'merchantName'
},
{
label: '活动类型',
prop: 'marketingType',
formatter: cellValue => {
const data = this.baseData.activityTypeList.filter(item => item.confId == cellValue.marketingType)
return data.length > 0 ? data[0].confName : '--'
}
},
{
label: '活动时间',
addHtml: 'activityTime'
......@@ -244,11 +262,18 @@ export default {
wechat: {
automaticName: '',
roomName: ''
},
baseData: {
activityTypeList: [
{ confId: '3', confName: '众筹' },
{ confId: '5', confName: '膨胀金' }
]
}
}
},
mounted() {
this.getOptionsList('searchFormData')
this.getCrowdfundingParams()
this.getMerchantList()
},
......@@ -287,6 +312,31 @@ export default {
}
},
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName]?.length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
async getCrowdfundingParams() {
/**参数类型 1:众筹活动名称(返回类型String),2:众筹活动门店 */
const activity = await this.$apis.seckillActivity.getCrowdfundingParams({
......
......@@ -1964,8 +1964,12 @@ export default {
margin: 0 8px 0 0 !important;
}
}
.el-select .el-select__tags>span{
width: 80%;
display: flex !important;
}
.el-select .el-tag {
max-width: 60% !important;
max-width: 55% !important;
}
.import-dialog {
.el-dialog__body {
......
......@@ -2,111 +2,53 @@
<template>
<div class="marketing">
<div class="m-b-20">
<GLButton
:size="size"
class="default-blue-btn el-icon-plus"
type="default"
@click="handleEdit('add')"
fn="新增众筹"
mode="el-button"
>新建众筹</GLButton>
<GLButton :size="size" class="default-blue-btn el-icon-plus" type="default" @click="handleEdit('add')" fn="新增众筹"
mode="el-button">新建众筹</GLButton>
<template v-if="!hideStatus">
<el-button
:size="size"
type="default"
class="default-blue-btn"
@click="handleJump"
>订单管理</el-button>
<el-button :size="size" type="default" class="default-blue-btn" @click="handleJump">订单管理</el-button>
</template>
</div>
<div class="container">
<GLCombiForm
ref="showSearch"
:rowNumber="1"
:formObj="searchForm"
:formData="searchFormData"
@handleOk="handleSearch"
@handleRest="handleReset"
></GLCombiForm>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData"
@handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="flex m-b-10 w-100-percent">
<span class="table-title"></span>
<el-button
:size="size"
class="default-blue-btn"
type="default"
@click="handleExport"
>导出</el-button>
<el-button :size="size" class="default-blue-btn" type="default" @click="handleExport">导出</el-button>
</div>
<!-- 表格区域 开始 -->
<single-gltable
ref="activity"
:getListApi="getListApi"
:noDataImg="url"
:searchForm="tableSearchForm"
:tableParams="tableParams"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun"
>
<div
slot="activityImg"
class="table-image"
slot-scope="scope"
>
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.activityImg"
/>
<img
class="img-60 pointer"
slot="reference"
:src="scope.scope.activityImg"
/>
<single-gltable ref="activity" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm"
:tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
@setTableFinishFun="setTableFinishFun">
<div slot="activityImg" class="table-image" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.activityImg" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.activityImg" />
</el-popover>
</div>
<div
slot="linkText"
slot-scope="scope"
>
<div slot="linkText" slot-scope="scope">
<template v-if="scope.scope.incrementFlag == 'Y' || hideStatus">
{{scope.scope[scope.prop] || 0 }}
{{ scope.scope[scope.prop] || 0 }}
</template>
<template v-else>
<p
class="cursor-pointer"
@click="handleDetail(scope)"
>{{ scope.scope[scope.prop] || 0 }}</p>
<p class="cursor-pointer" @click="handleDetail(scope)">{{ scope.scope[scope.prop] || 0 }}</p>
</template>
</div>
<div
class="table-btns"
slot="auth-button"
slot-scope="scope"
>
<GLTableButton
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
<div slot="joinText" slot-scope="scope">
<el-tooltip effect="dark" :content="formatterNumber(scope.scope, scope.prop)" placement="top">
<div class="line-ellipsis">{{ formatterNumber(scope.scope, scope.prop) }}</div>
</el-tooltip>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</single-gltable>
<!-- 表格区域 end -->
</div>
<!-- 众筹分享 -->
<crowdFundingShare
:isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"
:hideStatus="hideStatus"
></crowdFundingShare>
<crowdFundingShare :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"
:hideStatus="hideStatus"></crowdFundingShare>
</div>
</template>
......@@ -214,7 +156,6 @@ export default {
},
condition: row => {
// 结束的直播不能再开
console.log(typeof row.activityStatus)
return [1, 2, 3].includes(+row.activityStatus)
},
listeners: {
......@@ -330,7 +271,7 @@ export default {
mounted () {
this.getCrowdfundingOrderConfig()
this.getCrowdfundingParams()
this.getCrowdfundingParams([1, 2])
this.getOptionsList('searchFormData')
......@@ -437,25 +378,22 @@ export default {
prop: 'verificationNumber'
},
{
label: '定金(元)',
name: 'activityPrice',
width: 140,
formatter: cellValue => {
return (cellValue.activityPrice / 100).toFixed(2)
}
label: '定金/元',
prop: 'activityPrice',
addHtml: 'joinText',
width: 100
},
{
label: '众筹价(元)',
name: 'crowdFundingPrice',
width: 140,
formatter: cellValue => {
return (cellValue.crowdFundingPrice / 100).toFixed(2)
}
label: '众筹价/元',
prop: 'crowdFundingPrice',
addHtml: 'joinText',
width: 100
},
{
label: '库存',
prop: 'goodsStock',
width: 110
prop: 'activityGoodsStock',
addHtml: 'joinText',
width: 100
},
{
label: '创建日期',
......@@ -570,7 +508,9 @@ export default {
del (row) {
var params = {}
params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params, () => {
this.getCrowdfundingParams([1])
})
},
// 1-新增;2-编辑
......@@ -685,41 +625,65 @@ export default {
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
},
async getCrowdfundingParams () {
async getCrowdfundingParams (parameterTypeList) {
/**参数类型 1:众筹活动名称(返回类型String),2:众筹活动门店 */
const activity = await this.$apis.seckillActivity.getCrowdfundingParams({
parameterType: 1
})
let activityNameList = []
if (activity?.parameters && activity.parameters.length) {
activity.parameters.map(e => {
activityNameList.push({
confId: e,
confName: e
})
if (parameterTypeList.includes(1)) {
const activity = await this.$apis.seckillActivity.getCrowdfundingParams({
parameterType: 1
})
}
this.$set(this.searchFormData[0], 'optionList', this.$common.utils.deepClone(activityNameList))
const merchant = await this.$apis.seckillActivity.getCrowdfundingParams({
parameterType: 2
})
let merchantNameList = []
if (merchant?.parameters && merchant.parameters.length) {
merchant.parameters.map(e => {
merchantNameList.push({
confId: e,
confName: e
let activityNameList = []
if (activity?.parameters && activity.parameters.length) {
activity.parameters.map(e => {
activityNameList.push({
confId: e,
confName: e
})
})
}
this.$set(this.searchFormData[0], 'optionList', this.$common.utils.deepClone(activityNameList))
}
if (parameterTypeList.includes(2)) {
const merchant = await this.$apis.seckillActivity.getCrowdfundingParams({
parameterType: 2
})
let merchantNameList = []
if (merchant?.parameters && merchant.parameters.length) {
merchant.parameters.map(e => {
merchantNameList.push({
confId: e,
confName: e
})
})
}
this.$set(this.searchFormData[2], 'optionList', this.$common.utils.deepClone(merchantNameList))
}
this.$set(this.searchFormData[2], 'optionList', this.$common.utils.deepClone(merchantNameList))
},
formatterNumber (cell, key) {
const str = []
cell?.goodsList?.map(e => {
str.push(key != 'activityGoodsStock' ? (e[key] / 100).toFixed(2) : e[key])
})
return str.length > 0 ? str.join(',') : '--'
}
}
}
</script>
<style scoped>
<style>
.el-select .el-select__tags>span {
display: flex !important;
width: 80%;
}
.el-select .el-tag {
max-width: 60% !important;
max-width: 55% !important;
}
.line-ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
......@@ -3,7 +3,7 @@ const packageName = require('./package.json').name
const node_env = process.env.NODE_ENV === 'production'
const publicPath = node_env ? `/child/${packageName}/` : '/'
const resolve = dir => path.join(__dirname, dir)
const CDN_DOMAIN = 'https://cdn.bootcdn.net/'
const CDN_DOMAIN = 'https://img02.glsx.com.cn/'
const cdn = {
css: [`${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/theme-chalk/index.css`],
js: [`${CDN_DOMAIN}ajax/libs/vue/2.6.11/vue.min.js`, `${CDN_DOMAIN}ajax/libs/vue-router/3.2.0/vue-router.min.js`, `${CDN_DOMAIN}ajax/libs/element-ui/2.11.1/index.js`, `${CDN_DOMAIN}ajax/libs/vuex/3.6.2/vuex.min.js`, `${CDN_DOMAIN}ajax/libs/echarts/5.1.2/echarts.min.js`, 'https://webapi.amap.com/loader.js']
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!