Commit 8b3fce63 by 张立顺

v3.3 众筹功能优化

1 parent aaf2f84f
<template>
<div class="sub-el-table-column">
<el-table-column v-for="(item, index) in reverseData" :key="index + 'child'" :label="item.label" :prop="item.prop" :width="item.width" :min-width="item.minWidth" :fixed="item.fixed" :align="item.align || 'left'" :sortable="item.sortable" :render-header="item.renderHeader" v-bind="item.columnattrs ? item.columnattrs : {}" v-on="item.columnlisteners ? item.columnlisteners : {}">
<template slot-scope="scope">
<slot v-if="item.addHtml" :name="item.addHtml" :scope="scope.row" :prop="item.prop" :width="item.width"></slot>
<template v-else-if="item.formatter">
<el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line" placement="top" popper-class="base-popper" trigger="hover" :content="item.formatter(scope.row)">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ item.formatter(scope.row) | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ item.formatter(scope.row) || '--' }} -->
{{ item.formatter(scope.row) | tableCellFormat }}
</span>
</template>
<template v-else-if="getListApi">
<el-popover v-if="scope.row[item.prop] && scope.row[item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line" placement="top" popper-class="base-popper" trigger="hover" :content="scope.row[item.prop]">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ scope.row[item.prop] | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ scope.row[item.prop] || '--' }} -->
{{ scope.row[item.prop] | tableCellFormat }}
</span>
</template>
<template v-else>
<!-- 大于10或 20个字节长度 -->
<el-popover v-if="tableData[scope.$index][item.prop] && tableData[scope.$index][item.prop].length >= Math.ceil((item.width - 36) / 14) * item.line" placement="top" width="200" trigger="hover" :content="tableData[scope.$index][item.prop]">
<span slot="reference" class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
{{ tableData[scope.$index][item.prop] | lineEllipsis(item.width, item.line) }}
</span>
</el-popover>
<!-- <span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }" v-text="tableData[scope.$index][item.prop]"></span> -->
<span v-else class="line-ellipsis" :style="{ '-webkit-line-clamp': item.line ? item.line : '' }">
<!-- {{ tableData[scope.$index][item.prop] || '--' }} -->
{{ tableData[scope.$index][item.prop] | tableCellFormat }}
</span>
</template>
<template v-if="item.addSymbol">
<span v-text="item.addSymbol"></span>
</template>
</template>
<!-- 递归 -->
<sub-el-table-column v-if="item.children" :data="item.children" :tableData="tableData" :getListApi="getListApi"></sub-el-table-column>
</el-table-column>
</div>
</template>
<script>
// import GlSubTableColumn from '../../GlSubTableColumn'
export default {
name: 'sub-el-table-column',
props: {
data: {
type: Array,
default: () => []
},
// 表格数据-外部传入
tableData: {
type: Array,
default: () => []
},
// 获取列表接口
getListApi: {
type: Function,
default: null
}
},
computed: {
reverseData() {
let arr = [...this.data]
let temp = arr.pop()
arr.unshift(temp)
return arr
}
},
// components: {
// GlSubTableColumn
// }
// created(){
// // console.log('data',this.data)
// }
}
</script>
<style lang="scss">
// .sub-el-table-column {
// }
</style>
...@@ -10,102 +10,81 @@ ...@@ -10,102 +10,81 @@
fn="新增众筹" fn="新增众筹"
mode="el-button" mode="el-button"
>新建众筹</GLButton> --> >新建众筹</GLButton> -->
<el-button <el-button :size="size"
:size="size" type="default"
type="default" class="default-blue-btn"
class="default-blue-btn" @click="handleJump">订单管理</el-button>
@click="handleJump"
>订单管理</el-button>
</div> </div>
<div class="container"> <div class="container">
<GLCombiForm <GLCombiForm ref="showSearch"
ref="showSearch" :rowNumber="1"
:rowNumber="1" :formObj="searchForm"
:formObj="searchForm" :formData="searchFormData"
:formData="searchFormData" @handleOk="handleSearch"
@handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
@handleRest="handleReset"
></GLCombiForm>
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title"></span> <span class="table-title"></span>
<el-button <el-button :size="size"
:size="size" class="default-blue-btn"
class="default-blue-btn" type="default"
type="default" @click="handleExport">导出</el-button>
@click="handleExport"
>导出</el-button>
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable <single-gltable ref="activity"
ref="activity" :getListApi="getListApi"
:getListApi="getListApi" :noDataImg="url"
:noDataImg="url" :searchForm="tableSearchForm"
:searchForm="tableSearchForm" :tableParams="tableParams"
:tableParams="tableParams" :pageConf="pageConf"
:pageConf="pageConf" :beforeSearchFn="beforeSearchFn"
:beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
@setTableFinishFun="setTableFinishFun" <div slot="activityImg"
> class="table-image"
<div slot-scope="scope">
slot="activityImg" <el-popover placement="top"
class="table-image" width="160"
slot-scope="scope" trigger="hover"
> popper-class="table-popover-block">
<el-popover <img class="table-popover-img"
placement="top" :src="scope.scope.activityImg" />
width="160" <img class="img-60 pointer"
trigger="hover" slot="reference"
popper-class="table-popover-block" :src="scope.scope.activityImg" />
>
<img
class="table-popover-img"
:src="scope.scope.activityImg"
/>
<img
class="img-60 pointer"
slot="reference"
:src="scope.scope.activityImg"
/>
</el-popover> </el-popover>
</div> </div>
<div <div slot="linkText"
slot="linkText" slot-scope="scope">
slot-scope="scope" <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>
</div> </div>
<div <div class="table-btns"
class="table-btns" slot="auth-button"
slot="auth-button" slot-scope="scope">
slot-scope="scope" <GLTableButton :buttonList="tableButtonList"
> :buttonItem="scope.scope"
<GLTableButton :buttonNum="3"></GLTableButton>
:buttonList="tableButtonList"
:buttonItem="scope.scope"
:buttonNum="3"
></GLTableButton>
</div> </div>
</GLTable> </single-gltable>
<!-- 表格区域 end --> <!-- 表格区域 end -->
</div> </div>
<!-- 众筹分享 --> <!-- 众筹分享 -->
<crowdFundingShare :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></crowdFundingShare> <crowdFundingShare :isShareVisible="isShareVisible"
:shareForm="shareForm"
@handleShareClose="handleShareClose"></crowdFundingShare>
</div> </div>
</template> </template>
<script> <script>
import crowdFundingShare from '../productGroup/components/crowdFundingShareDialog.vue' import crowdFundingShare from '../productGroup/components/crowdFundingShareDialog.vue'
import GLTable from './components/table/index'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant' import { exportFn } from '@/common/constant'
export default { export default {
name: 'crowdFundList', name: 'crowdFundList',
data () { data() {
return { return {
size: 'small', size: 'small',
url: url, url: url,
...@@ -273,7 +252,14 @@ export default { ...@@ -273,7 +252,14 @@ export default {
{ {
label: '活动名称', label: '活动名称',
prop: 'activityName', prop: 'activityName',
width: 220 width: 220,
fixed: 'left'
},
{
label: '门店',
prop: 'merchantName',
width: 220,
fixed: 'left'
}, },
{ {
label: '缩略图', label: '缩略图',
...@@ -281,6 +267,20 @@ export default { ...@@ -281,6 +267,20 @@ export default {
addHtml: 'activityImg' addHtml: 'activityImg'
}, },
{ {
label: '收款模式',
prop: 'payMentModel',
width: 220,
formatter: cellValue => {
const model = {
1: '广联收定金和尾款',
2: '广联收定金门店收尾款',
3: '广联收定金门店收全款退定金',
4: '门店收定金和尾款'
}
return model[cellValue.paymentModel] || '--'
}
},
{
label: '浏览量(次)', label: '浏览量(次)',
prop: 'viewAmount', prop: 'viewAmount',
addHtml: 'linkText', addHtml: 'linkText',
...@@ -373,19 +373,20 @@ export default { ...@@ -373,19 +373,20 @@ export default {
}, },
components: { components: {
crowdFundingShare crowdFundingShare,
singleGltable: GLTable
}, },
mounted () { mounted() {
this.getOptionsList('searchFormData') this.getOptionsList('searchFormData')
}, },
methods: { methods: {
getParams () { getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm)) var params = JSON.parse(JSON.stringify(this.searchForm))
return params return params
}, },
beforeSearchFn () { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.tableSearchForm = this.getParams() this.tableSearchForm = this.getParams()
// delete this.tableSearchForm.createDate // delete this.tableSearchForm.createDate
...@@ -393,13 +394,13 @@ export default { ...@@ -393,13 +394,13 @@ export default {
}) })
}, },
handleJump (path, row = {}) { handleJump(path, row = {}) {
this.$router.push({ this.$router.push({
path: '/orderManage/index' path: '/orderManage/index'
}) })
}, },
secondConfirm (title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, { this.$confirm(txt, title, {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
...@@ -425,16 +426,16 @@ export default { ...@@ -425,16 +426,16 @@ export default {
}, },
//开始 //开始
start (item) { start(item) {
this.startOrEndConfirm('开始', item) this.startOrEndConfirm('开始', item)
}, },
//结束 //结束
end (item) { end(item) {
this.startOrEndConfirm('结束', item) this.startOrEndConfirm('结束', item)
}, },
startOrEndConfirm (txt, row) { startOrEndConfirm(txt, row) {
var title = txt var title = txt
var params = {} var params = {}
params.id = row.id params.id = row.id
...@@ -447,21 +448,21 @@ export default { ...@@ -447,21 +448,21 @@ export default {
}, },
//置顶 //置顶
topping (row) { topping(row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params) this.secondConfirm('删除', '确定置顶此活动?', 'seckillActivity', 'topActivityApi', params)
}, },
//删除 //删除
del (row) { del(row) {
var params = {} var params = {}
params.id = row.id params.id = row.id
this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params) this.secondConfirm('删除', '确定删除此活动?', 'seckillActivity', 'deleteActivityApi', params)
}, },
// 1-新增;2-编辑 // 1-新增;2-编辑
handleEdit (addOrEdit, row) { handleEdit(addOrEdit, row) {
var txtObj = { var txtObj = {
add: '新建', add: '新建',
edit: '编辑', edit: '编辑',
...@@ -485,7 +486,7 @@ export default { ...@@ -485,7 +486,7 @@ export default {
// console.log(JSON.parse(JSON.stringify(option))) // console.log(JSON.parse(JSON.stringify(option)))
// }, // },
// 明细 // 明细
handleDetail ({ prop, scope }) { handleDetail({ prop, scope }) {
let data = { let data = {
viewAmount: { viewAmount: {
type: 1, type: 1,
...@@ -506,30 +507,30 @@ export default { ...@@ -506,30 +507,30 @@ export default {
id: scope.id, id: scope.id,
activityName: scope.activityName, activityName: scope.activityName,
type: data.type, type: data.type,
count: data.count, count: data.count
} }
}) })
}, },
handleExport () { handleExport() {
var params = this.getParams() var params = this.getParams()
this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => { this.$apis.seckillActivity.exportCrowdfundApi(params).then(res => {
exportFn(res) exportFn(res)
}) })
}, },
handleShare (row) { handleShare(row) {
this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => { this.$apis.seckillActivity.getCrowdSharedApi({ id: row.id }).then(res => {
this.shareForm = res this.shareForm = res
this.handleShareClose() this.handleShareClose()
}) })
}, },
handleShareClose () { handleShareClose() {
this.isShareVisible = !this.isShareVisible this.isShareVisible = !this.isShareVisible
}, },
getOptionsList (formName, hasAll = true, refreshSigle) { getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) { if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle) var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle) var index = this[formName].findIndex(k => k.name == refreshSigle)
...@@ -555,11 +556,11 @@ export default { ...@@ -555,11 +556,11 @@ export default {
} }
}, },
handleSearch () { handleSearch() {
this.$refs.activity.refreshTable() this.$refs.activity.refreshTable()
}, },
handleReset () { handleReset() {
this.searchForm = { this.searchForm = {
activityName: '', activityName: '',
activityStatus: '' activityStatus: ''
...@@ -567,7 +568,7 @@ export default { ...@@ -567,7 +568,7 @@ export default {
this.handleSearch() this.handleSearch()
}, },
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun() this.$refs.activity.data.length ? (this.$refs.activity.tableHeightValues = '') : this.$refs.activity.setTableHeightFun()
} }
......
...@@ -46,7 +46,8 @@ ...@@ -46,7 +46,8 @@
:rowNumber="1" :rowNumber="1"
:formObj="searchRankForm" :formObj="searchRankForm"
:formData="searchFormRankData" :formData="searchFormRankData"
@handleOk="handleSearchRank"></GLCombiForm> @handleOk="handleSearchRank"
@handleRest="handleReset"></GLCombiForm>
<div class="flex m-b-10 w-100-percent"> <div class="flex m-b-10 w-100-percent">
<span class="table-title"></span> <span class="table-title"></span>
<el-button :size="size" <el-button :size="size"
...@@ -358,10 +359,10 @@ export default { ...@@ -358,10 +359,10 @@ export default {
this.getLiveData() this.getLiveData()
}, },
mounted() { mounted() {
let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default'), let [dataResetBtn] = this.$refs.dataRef.$el.getElementsByClassName('el-button--default')
[rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default') // [rankResetBtn] = this.$refs.rankRef.$el.getElementsByClassName('el-button--default')
if (dataResetBtn) dataResetBtn.style.display = 'none' if (dataResetBtn) dataResetBtn.style.display = 'none'
if (rankResetBtn) rankResetBtn.style.display = 'none' // if (rankResetBtn) rankResetBtn.style.display = 'none'
}, },
methods: { methods: {
...@@ -386,6 +387,11 @@ export default { ...@@ -386,6 +387,11 @@ export default {
// 直播间数据统计 // 直播间数据统计
// this.getLiveBroadcastRoomDataStatistics() // this.getLiveBroadcastRoomDataStatistics()
}, },
handleReset() {
this.searchRankForm = this.$options.data.call(this).searchRankForm
// this.$refs.rankRef.refreshTable()
// this.handleSearch()
},
getDailyOrderQuantityStatistics() { getDailyOrderQuantityStatistics() {
this.$apis.seckillActivity this.$apis.seckillActivity
.getDailyOrderQuantityStatistics({ id: this.activityId }) .getDailyOrderQuantityStatistics({ id: this.activityId })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!