Browse Source

1.1补充

master
zkthink 5 years ago
parent
commit
aabfa9f40d
  1. 37
      src/api/Apply.js
  2. 19
      src/api/Finance.js
  3. 103
      src/api/Marketing.js
  4. BIN
      src/assets/empty.png
  5. 2
      src/components/marketEchart/bar.vue
  6. 22
      src/router/index.js
  7. 18
      src/store/modules/account.js
  8. 236
      src/views/finance/cash-deposit/index.vue
  9. 12
      src/views/finance/cash/details.vue
  10. 4
      src/views/finance/cash/index.vue
  11. 39
      src/views/management/apply/deletes.vue
  12. 273
      src/views/management/apply/detail.vue
  13. 128
      src/views/management/apply/dialog.vue
  14. 305
      src/views/management/apply/index.vue
  15. 0
      src/views/management/merchantList/index.vue
  16. 120
      src/views/marketing/add/index.vue
  17. 39
      src/views/marketing/delete/index.vue
  18. 101
      src/views/marketing/details/component/auditDialog.vue
  19. 58
      src/views/marketing/details/component/auditLog.vue
  20. 68
      src/views/marketing/details/component/goods.vue
  21. 14
      src/views/marketing/details/index.vue
  22. 61
      src/views/marketing/details/info.vue
  23. 152
      src/views/marketing/details/marketData.vue
  24. 145
      src/views/marketing/details/shop.vue
  25. 154
      src/views/marketing/index.vue

37
src/api/Apply.js

@ -0,0 +1,37 @@
import axiosApi from './AxiosApi.js'
const apiList = {
getList: `/authority/tenantApply/page`,
auditApply: `/authority/tenantApply/audit`,
deleteApply: `/authority/tenantApply/remove`,
applyInfo: `/authority/tenantApply`
}
export default {
getList(data) {
return axiosApi({
method: 'POST',
url: apiList.getList,
data
})
},
auditApply(data) {
return axiosApi({
method: 'POST',
url: apiList.auditApply,
data
})
},
deleteApply(data) {
return axiosApi({
method: 'POST',
url: apiList.deleteApply,
data
})
},
applyInfo(id) {
return axiosApi({
method: 'GET',
url: `${apiList.applyInfo}/${id}`
})
}
}

19
src/api/Cash.js → src/api/Finance.js

@ -3,7 +3,9 @@ import axiosApi from './AxiosApi.js'
const apiList = {
getCashList: `/authority/cashOutDetail/page/audit`,
getDetail: '/authority/cashOutDetail/audit/',
audiCash: '/authority/cashOutDetail/audit'
audiCash: '/authority/cashOutDetail/audit',
getDepositList: `/authority/depositJournal/page`, // 保证金列表
getDepositSum: `/authority/depositJournal/summary` // 保证金总金额
}
export default {
// 提现审核列表
@ -28,5 +30,20 @@ export default {
url: apiList.audiCash,
data
})
},
// 保证金列表
getDepositList(data) {
return axiosApi({
method: 'POST',
url: apiList.getDepositList,
data
})
},
// 保证金总金额
getDepositSum() {
return axiosApi({
method: 'POST',
url: apiList.getDepositSum
})
}
}

103
src/api/Marketing.js

@ -1,7 +1,19 @@
import axiosApi from './AxiosApi.js'
const apiList = {
addPromotion: `/authority/promotion`
addPromotion: `/authority/promotion/addPromotion`,
getList: `/authority/promotion/findAdminPromotionList`,
getDetails: `/authority/promotion/query`,
delPromotion: `/authority/promotion/delete`,
updatePromotion: `/authority/promotion/updatePromotion`,
finishPromotion: `/authority/promotion/end`,
applyShop: `/authority/promotionApplyInfo/page`, // 参入店铺
auditLog: `/authority/promotionAuditLog/query`,
getGoodList: `/authority/product/findAdminProductListByIds`,
auditPromotion: `/authority/promotionApplyInfo/auditPromotion`,
closeApplyInfo: `/authority/promotionApplyInfo/closeApplyInfo`,
getDetail: `/authority/promotionStat/detail`,
findTenantStatDetail: `/authority/promotionStat/findTenantStatDetail`
}
export default {
addPromotion(data) {
@ -10,5 +22,94 @@ export default {
url: apiList.addPromotion,
data
})
},
getList(data) {
return axiosApi({
method: 'POST',
url: apiList.getList,
data
})
},
getDetails(id) {
return axiosApi({
method: 'GET',
url: `${apiList.getDetails}/${id}`
})
},
delPromotion(data) {
return axiosApi({
method: 'POST',
url: apiList.delPromotion,
data
})
},
updatePromotion(data) {
return axiosApi({
method: 'POST',
url: apiList.updatePromotion,
data
})
},
finishPromotion(data) {
return axiosApi({
method: 'POST',
url: apiList.finishPromotion,
data
})
},
// 参与店铺
applyShop(data) {
return axiosApi({
method: 'POST',
url: apiList.applyShop,
data
})
},
// 审核记录
auditLog(data) {
return axiosApi({
method: 'POST',
url: apiList.auditLog,
data
})
},
// 查看商品
getGoodList(data) {
return axiosApi({
method: 'POST',
url: apiList.getGoodList,
data
})
},
// 报名审核
auditPromotion(data) {
return axiosApi({
method: 'POST',
url: apiList.auditPromotion,
data
})
},
// 清退报名
closeApplyInfo(data) {
return axiosApi({
method: 'POST',
url: apiList.closeApplyInfo,
data
})
},
/** 活动数据 */
getDetail(id) {
return axiosApi({
method: 'GET',
url: `${apiList.getDetail}/${id}`
})
},
// 商家数据明细
findTenantStatDetail(data) {
return axiosApi({
method: 'GET',
url: apiList.findTenantStatDetail,
data
})
}
}

BIN
src/assets/empty.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

2
src/components/marketEchart/bar.vue

@ -41,7 +41,7 @@ export default {
const y = Object.assign(
{},
{
name: '金额/元',
name: '金额/元',
nameLocation: 'end',
nameTextStyle: {
color: '#999999',

22
src/router/index.js

@ -39,9 +39,27 @@ const constRouter = [
{
path: '/management',
name: '商家管理',
component: () => import('@/views/management/index'),
component: () => import('@/views/management/merchantList/index'),
meta: { title: '商家管理', affix: true }
},
{
path: '/apply',
name: '入驻申请',
component: () => import('@/views/management/apply/index'),
meta: { title: '入驻申请', affix: true }
},
{
path: '/apply/detail',
name: '申请详情',
component: () => import('@/views/management/apply/detail'),
meta: { title: '申请详情', affix: true }
}
]
},
{
path: '/',
component: Layout,
children: [
{
path: '/applet',
name: 'applet',
@ -102,7 +120,7 @@ const constRouter = [
}
},
{
path: '/marketing/details',
path: '/marketing/details/:id',
component: () => import('@/views/marketing/details/index'),
meta: {
title: '活动详情',

18
src/store/modules/account.js

@ -17,7 +17,21 @@ export default {
meta: {
title: '商家管理',
icon: 'el-icon-office-building'
}
},
children: [
{
path: '/management',
meta: {
title: '商家列表'
}
},
{
path: '/apply',
meta: {
title: '入驻申请'
}
}
]
},
{
path: '/',
@ -77,7 +91,7 @@ export default {
name: '保证金',
meta: {
title: '保证金',
icon: 'el-icon-s-finance'
icon: 'el-icon-money'
}
}
]

236
src/views/finance/cash-deposit/index.vue

@ -1,18 +1,246 @@
<template>
<div>
<h1>保证金</h1>
<div class="cash_deposit_page">
<div class="top_content">
保证金总额<i class="el-icon-warning-outline icon"></i>
<span>{{ total }}</span>
</div>
<div class="product-content">
<p class="title">交易记录</p>
<div class="toolbar">
<el-form
:inline="true"
:model="formParams"
>
<el-form-item label="店铺名称">
<el-input v-model="formParams.model.storeName" size="mini" />
</el-form-item>
<el-form-item label="保证金状态">
<el-select
v-model="formParams.model.state"
size="mini"
>
<el-option
v-for="(item, index) in stateList"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="缴纳时间">
<el-date-picker
v-model="date"
size="mini"
type="datetimerange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="mini"
@click="fetch"
>
查询
</el-button>
<el-button
plain
size="mini"
@click="reset"
>
重置
</el-button>
</el-form-item>
</el-form>
</div>
<el-table
:data="tableData.records"
border
style="width: 100%"
>
<el-table-column
prop="storeName"
label="店铺名称"
/>
<el-table-column
prop="depositType"
label="保证金类型"
:formatter="getType"
/>
<el-table-column
prop="promotionName"
label="活动名称"
/>
<el-table-column
prop="orderCode"
label="交易流水号"
/>
<el-table-column
prop="amount"
label="保证金金额"
/>
<el-table-column
prop="state"
label="保证金状态"
:formatter="getState"
/>
<el-table-column
prop="createTime"
label="缴纳/退保时间"
/>
</el-table>
</div>
<pagination
v-show="tableData.total > 0"
:limit.sync="formParams.size"
:page.sync="formParams.current"
:total="Number(tableData.total)"
@pagination="fetch"
/>
</div>
</template>
<script>
import Finance from '@/api/Finance'
import Pagination from '@/components/Pagination'
export default {
components: {
Pagination
},
data() {
return {
formParams: {
size: 10,
current: 1,
model: {
depositType: 1,
promotionId: '',
state: '',
orderCode: '',
amount: '',
storeName: '',
startTime: '',
endTime: ''
}
},
date: [],
stateList: [
{ label: '全部', value: '' },
{ label: '冻结中', value: 0 },
{ label: '已退回', value: 1 }
],
total: '',
tableData: {}
}
},
created() {
this.getDepositList()
this.getDepositSum()
},
methods: {
async getDepositList() {
const vm = this
vm.formParams.model.startTime = vm.date[0] || ''
vm.formParams.model.endTime = vm.date[1] || ''
const res = await Finance.getDepositList(vm.formParams)
const resData = res.data
if (resData.code === 0 ) {
vm.tableData = resData.data
}
},
async getDepositSum() {
const vm = this
const res = await Finance.getDepositSum()
const resData = res.data
if (resData.code === 0) {
vm.total = resData.data.total || 0
}
},
reset() {
this.formParams = {
size: 10,
current: 1,
model: {
depositType: 1,
promotionId: '',
state: '',
orderCode: '',
amount: '',
storeName: '',
startTime: '',
endTime: ''
}
}
this.date = []
},
fetch() {
this.getDepositList()
},
getType(row, item, cellValue) {
return cellValue === 1 ? '营销活动保证金' : ''
},
getState(row, item, cellValue) {
const ob = { 0: '冻结中', 1: '已退回' }
return ob[cellValue]
}
}
}
</script>
<style lang='less' scoped></style>
<style lang='less' scoped>
.cash_deposit_page {
min-height: calc(100% - 20px);
margin-top: 20px;
background: #fff;
padding: 20px;
box-sizing: border-box;
.top_content {
height: 100px;
line-height: 100px;
font-size: 20px;
.icon {
color: red;
font-size: 20px;
}
span {
font-size: 28px;
color: #FFAE11;
margin-left: 20px;
}
}
.product-content {
p.title {
background: #D7D7D7;
margin: 0;
padding: 10px;
}
}
}
/deep/ .el-table {
th {
background: #EEF3FF;
color:#333333;
font-size:16px;
font-weight: 400;
border-color: #E0E5EB;
text-align: center;
}
td {
font-size: 14px;
text-align: center;
color: #666666;
}
.cell {
text-align: center;
white-space: pre-line;/*保留换行符*/
}
}
</style>

12
src/views/finance/cash/details.vue

@ -34,7 +34,7 @@
</template>
<script>
import Cash from '@/api/Cash'
import Finance from '@/api/Finance'
export default {
props: {
dialogData: {
@ -65,13 +65,19 @@ export default {
},
methods: {
async getDetail(id) {
const res = await Cash.getDetail( id )
const res = await Finance.getDetail( id )
const resData = res.data
if (resData.code === 0) {
const d = resData.data
this.info = d
this.dataList.map(item => {
item.value = d[item.field]
if (item.field === 'cardholderName') {
item.value = `${item.value.slice(0, 1)}**`
}
if (item.field === 'cardNumber') {
item.value = `${item.value.slice(0, 4)}****************`
}
})
Object.keys(this.params).map(item => {
this.params[item] = d[item]
@ -82,7 +88,7 @@ export default {
return v ? (v / 100).toFixed(2) : 0
},
confirm() {
Cash.audiCash(this.params).then(() => {
Finance.audiCash(this.params).then(() => {
this.$message({
message: '处理成功',
type: 'success'

4
src/views/finance/cash/index.vue

@ -118,7 +118,7 @@
<script>
import Pagination from '@/components/Pagination'
import Cash from '@/api/Cash'
import Finance from '@/api/Finance'
import cashDetails from './details'
export default {
components: {
@ -151,7 +151,7 @@ export default {
},
methods: {
async getCashList() {
const res = await Cash.getCashList(this.formParams)
const res = await Finance.getCashList(this.formParams)
const resData = res.data
if (resData.code === 0) {
this.tableData = resData.data

39
src/views/management/apply/deletes.vue

@ -0,0 +1,39 @@
<template>
<el-dialog
:title="dialogVisible.title"
:visible.sync="dialogVisible.visible"
width="30%"
>
<span>确认要删除本记录吗</span>
<span slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
dialogVisible: {
type: Object,
default: () => {}
}
},
data() {
return {}
},
methods: {
confirm() {
this.$emit('confirm')
},
close() {
this.$emit('closed')
}
}
}
</script>
<style lang='less' scoped>
</style>

273
src/views/management/apply/detail.vue

@ -0,0 +1,273 @@
<template>
<div class="detail_page">
<div class="content">
<div class="head_box">
{{ getTitle() }}
<div class="btn_list">
<el-button v-if="Number(info.auditState) === 1" type="primary" @click="handle">处理</el-button>
<el-button @click="cancel">返回列表</el-button>
</div>
</div>
<div class="detail">
<div class="shop_info">
<p class="detail_title">店铺信息</p>
<p v-for="(item, index) in shopInfoList" :key="index" class="detail_text">
<span>
<font>*</font>
{{ item.name + ':' }}
</span>
<span>{{ item.value }}</span>
</p>
</div>
<div class="person_info">
<p class="detail_title">个人信息</p>
<p v-for="(item, index) in personInfoList" :key="index" class="detail_text">
<span>
<font>*</font>
{{ item.name + ':' }}
</span>
<span>{{ item.value }}</span>
</p>
<p class="detail_img">
<span>
<font>*</font>
证件照片
</span>
<img :src="info.idCardCopyFilePath" alt="" />
<img :src="info.idCardNationalFilePath" alt="" />
</p>
<p v-if="Number(info.organizationType) === 1" class="detail_img">
<span>
<font>*</font>
手持证件照
</span>
<img :src="info.handHoldCardPath" alt="" />
</p>
</div>
<div v-if="Number(info.auditState) === 2" class="shop_info">
<p class="detail_title">授权信息</p>
<p v-for="(item, index) in authInfoList" :key="index" class="detail_text">
<span>
<font>*</font>
{{ item.name + ':' }}
</span>
<span>{{ item.value }}</span>
</p>
</div>
</div>
</div>
<dialogs :dialog-data="dialogData" @closed="closed" />
</div>
</template>
<script>
import dialogs from './dialog'
import Apply from '@/api/Apply'
export default {
components: {
dialogs
},
data() {
return {
shopInfoList: [
{ name: '店铺名称', value: '', field: 'storeName' },
{ name: '店铺类型', value: '', field: 'organizationType' },
{ name: '客服电话', value: '', field: 'customerPhone' },
{ name: '店铺负责人', value: '', field: 'storeHead' },
{ name: '负责人电话', value: '', field: 'headMobile' },
{ name: '店铺地址', value: '', field: 'storeAddressProvince' }
],
personInfoList: [
{ name: '名称', value: '', field: 'legalPerson' },
{ name: '证件类型', value: '', field: 'idDocType' },
{ name: '身份证号码', value: '', field: 'idCardNumber' },
{ name: '身份证有效期', value: '', field: 'idCardValidTimeStart' }
],
authInfoList: [
{ name: '生效日期', value: '', field: 'effectTime' },
{ name: '生效时限', value: '', field: 'effectTimeLimit' }
],
dialogData: {},
info: {}
}
},
computed: {
query() {
return this.$route.query
}
},
created() {
this.applyInfo()
},
methods: {
async applyInfo() {
const vm = this
const res = await Apply.applyInfo(this.query.id)
const resData = res.data
if (resData.code === 0) {
const d = resData.data
vm.info = d
vm.getData(d)
}
},
getTitle() {
const ob = {
1: '待审核列表/查看详情',
2: '审核通过列表/查看详情',
3: '已拒绝列表/查看详情'
}
return ob[this.query.type]
},
getData(info) {
const vm = this
// const info = vm.$route.query.info
vm.getObjData(vm.shopInfoList, info)
vm.getObjData(vm.personInfoList, info)
vm.getObjData(vm.authInfoList, info)
},
getObjData(arr, o) {
const t = {
1: '个人',
2: '个体工商户',
3: '企业',
4: '其他组织'
}
const ob = {
1: '中国大陆居民身份证',
2: '中国香港居民来往内地通行证',
3: '中国澳门居民来往内地通行证',
4: '中国台湾居民来往内地通行证',
5: '其他国家或地区居民护照'
}
arr.map(item => {
item.value = o[item.field]
if (item.field === 'organizationType') {
item.value = t[Number(o.organizationType || '')]
}
if (item.field === 'storeAddressProvince') {
item.value = `${o.storeAddressProvince || ''}${o.storeAddressCity || ''}${o.storeAddressDetail || ''}`
}
if (item.field === 'idCardValidTimeStart') {
item.value = `${o.idCardValidTimeStart || ''}──${o.idCardValidTimeEnd || ''}`
}
if (item.field === 'idDocType') {
item.value = ob[Number(o.idDocType || '')]
}
if (item.field === 'effectTimeLimit') {
item.value = `${o.effectTimeLimit}`
}
if (item.field === 'effectTime') {
item.value = o.effectDateType === 1 ? o.auditTime : o.effectTime
}
})
},
cancel() {
this.$router.push({ path: '/apply' })
},
handle() {
this.dialogData = {
title: '处理审核',
visible: true,
info: this.info
}
},
closed(v) {
this.applyInfo()
this.dialogData.visible = v
}
}
}
</script>
<style lang='less' scoped>
.detail_page {
margin-top: 10px;
background-color: #fff;
height: calc(100% - 10px);
.content {
padding: 20px;
.head_box {
overflow: hidden;
height: 80px;
line-height: 80px;
font-size: 24px;
border-bottom: 1px solid #E0E5EB;
.btn_list {
display: inline-block;
float: right;
}
}
.detail {
min-height: 500px;
background:rgba(255,255,255,1);
box-shadow:0px 0px 10px 0px rgba(51,51,51,0.15);
border-radius:4px;
padding: 1px 100px 20px;
margin-top: 15px;
.detail_title {
font-size: 24px;
color: #333333;
position: relative;
margin:50px 20px 20px;
&:before {
content: '';
display: block;
position: absolute;
top: 5px;
left: -20px;
width: 4px;
height: 24px;
background-color: #3A68F2;
}
}
}
.detail_text {
span {
display: inline-block;
color: #333333;
font-size: 16px;
&:nth-child(1) {
width: 150px;
text-indent: 20px;
font {
color: red;
}
}
&:nth-child(2) {
color: #666666;
}
}
}
.detail_img {
position: relative;
span {
position: absolute;
top: 0;
left: 0;
display: inline-block;
color: #333333;
font-size: 16px;
width: 150px;
text-indent: 20px;
font {
color: red;
}
}
img {
width: 265px;
height: 170px;
border-radius:4px;
&:nth-of-type(1) {
margin:0 30px 0 150px;
}
}
}
}
}
</style>

128
src/views/management/apply/dialog.vue

@ -0,0 +1,128 @@
<template>
<el-dialog
:title="dialogData.title"
:visible.sync="dialogData.visible"
width="40%"
>
<el-form
ref="form" label-width="120px" :model="form"
:rules="rules"
required
>
<el-form-item label="入驻处理">
<el-radio-group v-model="form.auditState">
<el-radio :label="2">同意入驻</el-radio>
<el-radio :label="3">拒绝入驻</el-radio>
</el-radio-group>
</el-form-item>
<div v-if="form.auditState===2">
<el-form-item label="生效日期">
<el-radio-group v-model="form.effectDateType">
<el-radio :label="1">即时生效</el-radio>
<el-radio :label="2">指定日期</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.effectDateType===2" label="" prop="effectTime">
<el-date-picker
v-model="form.effectTime"
type="date"
placeholder="选择生效日期"
value-format="yyyy-MM-dd"
/>
</el-form-item>
<el-form-item label="生效时限" prop="effectTimeLimit">
<el-col :span="22">
<el-input v-model.number="form.effectTimeLimit" placeholder="请输入生效时限" />
</el-col>
<el-col :span="2">
</el-col>
</el-form-item>
</div>
<el-form-item v-if="form.auditState===3" label="拒绝原因" prop="rejectReason">
<el-input v-model="form.rejectReason" type="textarea" placeholder="请输入拒绝原因" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirm"> </el-button>
<el-button @click="cancel"> </el-button>
</span>
</el-dialog>
</template>
<script>
import Apply from '@/api/Apply'
export default {
props: {
dialogData: {
type: Object,
default: () => {}
}
},
data() {
return {
form: {
auditState: 2, //
effectDateType: 1, //
effectTime: '', //
effectTimeLimit: '', //
rejectReason: '' //
},
rules: {
effectTime: [
{ required: true, message: '请选择生效日期', trigger: 'change' }
],
effectTimeLimit: [
{ required: true, message: '请输入生效时限', trigger: 'blur' },
{ type: 'number', message: '生效时限必须为数字值' }
],
rejectReason: [
{ required: true, message: '请输入拒绝原因', trigger: 'blur' }
]
}
}
},
methods: {
reset() {
this.form = {
auditState: 2,
effectDateType: 1,
effectTime: '',
effectTimeLimit: '',
rejectReason: ''
}
},
cancel() {
this.reset()
this.$emit('closed', false)
},
confirm() {
const vm = this
vm.$refs.form.validate((valid) => {
if (valid) {
Apply.auditApply(Object.assign({}, vm.form, { id: vm.dialogData.info.id })).then(res => {
if (res.data.code === 0) {
vm.$message({
type: 'success',
message: '审核成功'
})
} else {
vm.$message.error(res.data.msg)
}
vm.cancel()
})
} else {
return false
}
})
}
}
}
</script>
<style scoped lang='less'>
</style>

305
src/views/management/apply/index.vue

@ -0,0 +1,305 @@
<template>
<div class="apply_page">
<div class="content">
<el-tabs
v-model="formParams.model.auditState"
@tab-click="selectItem"
>
<el-tab-pane
v-for="(item, index) in tabList"
:key="index"
:label="item.name"
:name="item.id"
/>
</el-tabs>
<div class="toolbar">
<el-form
:inline="true"
:model="formParams"
>
<el-form-item label="商家名称">
<el-input v-model="formParams.model.merchantName" size="mini" />
</el-form-item>
<el-form-item label="注册手机号">
<el-input v-model="formParams.model.headMobile" size="mini" />
</el-form-item>
<el-form-item label="店铺类型">
<el-select
v-model="formParams.model.organizationType"
size="mini"
>
<el-option
v-for="(item, index) in typeList"
:key="index"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="申请时间">
<el-date-picker
v-model="date"
size="mini"
type="daterange"
range-separator="至"
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd"
@change="handleChange"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
size="mini"
@click="query"
>
查询
</el-button>
<el-button
plain
size="mini"
@click="reset"
>
重置
</el-button>
</el-form-item>
</el-form>
</div>
<div class="content_table">
<div class="table">
<el-table
:data="tableData.records"
border
style="width: 100%"
>
<el-table-column
prop="merchantName"
label="商家名称"
/>
<el-table-column
prop="organizationType"
:formatter="getType"
label="店铺类型"
/>
<el-table-column
prop="headMobile"
label="注册手机号"
/>
<el-table-column
prop="applyTime"
label="申请时间"
/>
<el-table-column label="操作">
<template
slot-scope="scope"
>
<el-button
v-if="scope.row.auditState===1"
type="text"
size="small"
@click.native.prevent="handle(scope.row)"
>
处理
</el-button>
<el-button
v-if="scope.row.auditState===2 || scope.row.auditState===3"
type="text"
size="small"
@click.native.prevent="details(scope.row)"
>
详情
</el-button>
<el-button
v-if="scope.row.auditState===3"
type="text"
size="small"
@click.native.prevent="deletes(scope.row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="tableData.total > 0"
:limit.sync="formParams.size"
:page.sync="formParams.current"
:total="Number(tableData.total)"
@pagination="query"
/>
</div>
</div>
<deletes :dialog-visible="dialogVisible" @confirm="confirm" @closed="closed" />
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import Apply from '@/api/Apply'
import deletes from './deletes'
export default {
components: {
Pagination,
deletes
},
data() {
return {
formParams: {
current: 1,
size: 10,
map: {},
order: 'descending',
sort: 'id',
model: {
merchantName: '', //
headMobile: '',
organizationType: '',
applyTimeStart: '', // ()
applyTimeEnd: '', // ()
auditState: '1'
}
},
activeName: 1,
date: [],
dialogVisible: {},
typeList: [
{ label: '全部', value: '' },
{ label: '个人', value: 1 },
{ label: '个体工商户', value: 2 },
{ label: '企业', value: 3 },
{ label: '其他组织', value: 4 }
],
tableData: {},
tabList: [
{ name: '待处理', id: '1' },
{ name: '已通过', id: '2' },
{ name: '已拒绝', id: '3' }
]
}
},
created() {
this.getList()
},
methods: {
async getList() {
const res = await Apply.getList(this.formParams)
const resData = res.data
if (resData.code === 0) {
this.tableData = resData.data
}
},
selectItem() {
this.getList()
},
query() {
this.getList()
},
reset() {
this.formParams = {
current: 1,
size: 10,
map: {},
order: 'descending',
sort: 'id',
model: {
auditState: '1',
merchantName: '', //
headMobile: '',
organizationType: '',
applyTimeStart: '', // ()
applyTimeEnd: ''// ()
}
}
this.date = []
},
handleChange(value) {
this.formParams.model.applyTimeStart = (value && value[0]) || ''
this.formParams.model.applyTimeEnd = (value && value[1]) || ''
},
getType(row, item, value) {
let t = ''
this.typeList.forEach(item => {
if (item.value === Number(value) ) {
t = item.label
}
})
return t
},
details(item) {
this.$router.push({ path: '/apply/detail', query: {
info: item,
id: item.id,
type: Number(this.formParams.model.auditState)
}})
},
handle(item) {
this.$router.push({ path: '/apply/detail', query: {
info: item,
id: item.id,
type: Number(this.formParams.model.auditState)
}})
},
deletes(id) {
this.dialogVisible = {
title: '删除',
visible: true,
id: id
}
},
closed() {
this.dialogVisible = {}
},
async confirm(v) {
const res = await Apply.deleteApply({ id: this.dialogVisible.id })
const resData = res.data
if (resData.code === 0) {
this.$message({
type: 'success',
message: '删除成功'
})
this.getList()
} else {
this.$message.error(resData.msg)
}
this.closed()
}
}
}
</script>
<style lang='less' scoped>
.apply_page {
padding: 10px 20px;
box-sizing: border-box;
.content {
background-color: #fff;
padding: 20px;
// .toolbar {
// padding: 10px;
// }
}
}
/deep/ .el-table {
th {
background: #EEF3FF;
color:#333333;
font-size:16px;
font-weight: 400;
border-color: #E0E5EB;
text-align: center;
}
td {
font-size: 14px;
text-align: center;
color: #666666;
}
}
</style>

0
src/views/management/index.vue → src/views/management/merchantList/index.vue

120
src/views/marketing/add/index.vue

@ -12,11 +12,11 @@
<el-form ref="form" :model="form" label-width="100px">
<h2>基础信息</h2>
<el-form-item label="活动名称:">
<el-input v-model="form.name" placeholder="请输入活动名称" />
<el-input v-model="form.name" placeholder="请输入活动名称" :disabled="unStart" />
</el-form-item>
<el-form-item label="活动介绍:">
<el-input v-model="form.description" type="textarea" placeholder="请输入活动介绍" />
<el-input v-model="form.description" type="textarea" placeholder="请输入活动介绍" :disabled="unStart" />
</el-form-item>
<el-form-item label="活动时间:">
@ -27,6 +27,8 @@
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm"
:disabled="applyEnd"
:picker-options="pickerOptions"
/>
</el-form-item>
@ -38,52 +40,53 @@
start-placeholder="开始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd HH:mm"
:picker-options="pickerOptions1"
/>
</el-form-item>
<el-form-item label="活动保证金:">
<el-radio-group v-model="form.isNeedSecurityDeposit">
<el-radio :label="1">需要</el-radio>
<el-radio :label="2">不需要</el-radio>
<el-radio :label="1" :disabled="unStart">需要</el-radio>
<el-radio :label="0" :disabled="unStart">不需要</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="form.isNeedSecurityDeposit===1" label="保证金金额:">
<el-input v-model="form.securityDeposit" placeholder="请输入活动保证金金额" />
<el-input v-model="form.securityDeposit" placeholder="请输入活动保证金金额" :disabled="unStart" />
</el-form-item>
<el-form-item label="活动标签">
<el-input v-model="form.tag" placeholder="请输入活动标签" />
<el-input v-model="form.tag" placeholder="请输入活动标签" :disabled="unStart" />
</el-form-item>
<h2>优惠规则</h2>
<el-form-item label="优惠方式:">
<el-radio-group v-model="form.promotionType" @change="selectDiscount">
<el-radio :label="1">满减</el-radio>
<el-radio :label="2">优惠券</el-radio>
<el-radio :label="1" :disabled="unStart">满减</el-radio>
<el-radio :label="2" :disabled="unStart">优惠券</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="优惠方案:">
<el-radio-group v-model="form.promotionPlan" @change="selectPreScheme">
<el-radio :label="1" :disabled="form.promotionType ===2">叠加优惠</el-radio>
<el-radio :label="2">阶梯优惠</el-radio>
<el-radio :label="1" :disabled="form.promotionType ===2 || unStart">叠加优惠</el-radio>
<el-radio :label="2" :disabled="unStart">阶梯优惠</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-for="(item,index) in list" :key="index">
<el-col :span="10">
每满
<el-input v-model="item.fullAmount" style="width: 80%;" />
<el-input v-model="item.fullAmount" style="width: 80%;" :disabled="unStart" />
</el-col>
<el-col :span="10">
<el-input v-model="item.discountAmount" style="width: 80%;" />
<el-input v-model="item.discountAmount" style="width: 80%;" :disabled="unStart" />
</el-col>
</el-form-item>
<el-form-item v-if="form.promotionPlan===2">
<el-button type="primary" @click="add">添加层级</el-button>
<el-button type="primary" :disabled="unStart" @click="add">添加层级</el-button>
</el-form-item>
</el-form>
</el-col>
@ -96,7 +99,7 @@
action="/api/authority/file/upload"
:show-file-list="false"
:on-success="handleAvatarSuccess"
:disabled="type"
:disabled="unStart"
>
<img
v-if="form.image"
@ -105,7 +108,7 @@
height="80"
/>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
<el-button size="small" type="primary">点击上传</el-button>
<el-button size="small" type="primary" :disabled="unStart">点击上传</el-button>
</el-upload>
</div>
</el-col>
@ -122,7 +125,7 @@ export default {
form: {
name: '',
description: '',
isNeedSecurityDeposit: 2,
isNeedSecurityDeposit: 0,
securityDeposit: '',
tag: '',
promotionType: 1,
@ -141,15 +144,68 @@ export default {
},
dataObj: {
folderId: 1
},
pickerOptions: {
disabledDate: (time) => {
const t = this.$route.query.info
if (this.date1[0] !== "" && t && t.status === 2) {
return time.getTime() < new Date(this.date1[0]).getTime()
}
}
},
pickerOptions1: {
disabledDate: (time) => {
const t = this.$route.query.info
if (this.date2[0] !== "" && t && (t.status === 3 || t.status === 4)) {
return time.getTime() < new Date(this.date2[0]).getTime()
}
}
}
}
},
computed: {
info() {
return this.$route.query.info || {}
},
unStart() {
const t = this.$route.query.info
return t && !(t.status === 1)
},
applyEnd() {
const t = this.$route.query.info
return t && (t.status === 3 || t.status === 4)
}
},
created() {
this.headers.token = 'Bearer ' + db.get('TOKEN', '')
this.headers.tenant = 'MDAwMA=='
this.setForm()
},
methods: {
setForm() {
const vm = this
const o = vm.form
this.$route.meta.title = vm.info.id ? '修改活动' : '新增活动'
if (vm.info.id) {
Object.keys(o).forEach(item => {
o[item] = vm.info[item]
if (item === 'securityDeposit') {
o[item] = vm.info[item] / 100
}
})
const list = vm.info.promotionDetail
if (list.length) {
list.map(item => {
item.fullAmount /= 100
item.discountAmount /= 100
})
vm.list = list
}
this.date1 = [vm.info.activityStartTime, vm.info.activityEndTime]
this.date2 = [vm.info.applyStartTime, vm.info.applyEndTime]
}
},
selectDiscount(v) {
if (v === 2) {
this.form.promotionPlan = 2
@ -172,8 +228,33 @@ export default {
},
save() {
const vm = this
Object.assign(vm.form, { activityStartTime: vm.date1[0] || '', activityEndTime: vm.date1[1] || '', applyStartTime: vm.date2[0] || '', applyEndTime: vm.date2[1] || '', promotionDetail: vm.list })
Marketing.addPromotion(vm.form).then(res => {
const temp = []
vm.list.forEach(item => {
temp.push({
fullAmount: item.fullAmount * 100,
discountAmount: item.discountAmount * 100
})
})
const params = Object.assign({}, vm.form, {
activityStartTime: vm.date1[0] || '', activityEndTime: vm.date1[1] || '',
applyStartTime: vm.date2[0] || '', applyEndTime: vm.date2[1] || '',
promotionDetail: temp,
securityDeposit: vm.form.securityDeposit * 100
})
if (vm.info.id) {
return Marketing.updatePromotion(Object.assign(params, { id: vm.info.id })).then(res => {
const r = res.data
if (r.code === 0) {
this.$message({
message: '修改成功',
type: 'success'
})
vm.reset()
vm.cancel()
}
})
}
return Marketing.addPromotion(params).then(res => {
const r = res.data
if (r.code === 0) {
this.$message({
@ -181,6 +262,7 @@ export default {
type: 'success'
})
vm.reset()
vm.cancel()
}
})
},

39
src/views/marketing/delete/index.vue

@ -0,0 +1,39 @@
<template>
<el-dialog
:title="dialogVisible.title"
:visible.sync="dialogVisible.visible"
width="30%"
>
<span>{{ dialogVisible.text }}</span>
<span slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="confirm"> </el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: {
dialogVisible: {
type: Object,
default: () => {}
}
},
data() {
return {}
},
methods: {
confirm() {
this.$emit('confirm', false)
},
close() {
this.$emit('closed', false)
}
}
}
</script>
<style lang='less' scoped>
</style>

101
src/views/marketing/details/component/auditDialog.vue

@ -0,0 +1,101 @@
<template>
<el-dialog
:title="dialogData.title"
:visible.sync="dialogData.visible"
width="30%"
>
<div v-if="dialogData.type===1" class="audit">
<el-form label-width="80px">
<el-form-item>
<el-radio-group v-model="formParams.status">
<el-radio :label="2">审核通过</el-radio>
<el-radio :label="3">审核不通过</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注">
<el-input
v-model="formParams.auditRemark"
type="textarea"
/>
</el-form-item>
</el-form>
</div>
<div v-else class="clean">
<p>确认要清退本商家吗?</p>
<p>清退后商家的所有商品将退出本次活动</p>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="confirm">{{ dialogData.type===1 ? ' ': ' 退' }}</el-button>
<el-button @click="cancel"> </el-button>
</span>
</el-dialog>
</template>
<script>
import Marketing from '@/api/Marketing'
export default {
props: {
dialogData: {
type: Object,
default: () => {}
}
},
data() {
return {
formParams: {
auditRemark: '',
status: 3,
id: this.dialogData.id
}
}
},
methods: {
cancel() {
this.$emit('closed', false)
},
confirm() {
if (this.dialogData.type === 1) {
this.auditPromotion()
} else {
this.closeApplyInfo()
}
},
async auditPromotion() {
const res = await Marketing.auditPromotion(Object.assign({}, this.formParams, { id: this.dialogData.id } ) )
const resData = res.data
if (resData.code === 0) {
this.$message({
type: 'success',
message: '审核成功'
})
this.$emit('applyShop')
this.cancel()
}
},
async closeApplyInfo() {
const res = await Marketing.closeApplyInfo({ id: this.dialogData.id })
const resData = res.data
if (resData.code === 0) {
this.$message({
type: 'success',
message: '清退成功'
})
this.$emit('applyShop')
this.cancel()
}
}
}
}
</script>
<style scoped lang='less'>
.clean {
p {
text-align: center;
&:nth-child(2) {
color: #888888;
}
}
}
</style>

58
src/views/marketing/details/component/auditLog.vue

@ -1,62 +1,78 @@
<template>
<div class="goods_page">
<el-table
:data="tableData.records"
:data="tableData"
border
style="width: 100%"
>
<el-table-column
prop="value1"
prop="processStage"
:formatter="getType"
label="动态"
/>
<el-table-column
prop="value2"
prop="createTime"
label="时间"
/>
<el-table-column
prop="value3"
prop="auditBy"
label="操作人"
/>
<el-table-column
prop="value4"
prop="auditRemark"
label="其它信息"
/>
</el-table>
<pagination
<!-- <pagination
v-show="tableData.total > 0"
:limit.sync="formParams.size"
:page.sync="formParams.current"
:total="Number(tableData.total)"
@pagination="fetch"
/>
/> -->
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
// import Pagination from '@/components/Pagination'
import Marketing from '@/api/Marketing'
export default {
components: {
Pagination
// Pagination
},
props: {
info: {
type: Object,
default: () => []
}
},
data() {
return {
formParams: {
size: 10,
current: 1
},
tableData: {
records: [
{ value1: '报名', value2: '2020-06-20 17:54', value3: '飞猪旗舰店', value4: '哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈哈' }
],
total: 1
}
// formParams: {
// size: 10,
// current: 1
// },
tableData: []
}
},
created() {
this.auditLog()
},
methods: {
fetch() {
async auditLog() {
const res = await Marketing.auditLog({ applyId: this.info.id })
const resData = res.data
if (resData.code === 0) {
this.tableData = resData.data
}
},
getType(row, item, cellValue) {
const list = {
1: '报名', 2: '审核通过', 3: '审核不通过'
}
return list[cellValue]
}
}
}

68
src/views/marketing/details/component/goods.vue

@ -1,7 +1,7 @@
<template>
<div class="goods_page">
<el-table
:data="tableData.records"
:data="tableData.adminProductVOList"
border
style="width: 100%"
>
@ -13,43 +13,46 @@
class="product-img"
height="90"
width="90"
:src="scope.row.value1"
:src="scope.row.productImg"
/>
</template>
</el-table-column>
<el-table-column
prop="value2"
prop="productName"
label="产品名称"
/>
<el-table-column
prop="value3"
prop="id"
label="产品id"
/>
<el-table-column
prop="value4"
prop="price"
label="售价 (元)"
:formatter="getPrice"
/>
<el-table-column
prop="value5"
prop="applyPrice"
label="原价 (元)"
:formatter="getPrice"
/>
<el-table-column
prop="value6"
prop="stock"
label="库存 (件)"
/>
<el-table-column
prop="value7"
prop="sellCount"
label="累计销量 (件)"
/>
<el-table-column
prop="value8"
prop="status"
:formatter="getStatus"
label="上架状态"
/>
</el-table>
<pagination
v-show="tableData.total > 0"
:limit.sync="formParams.size"
:page.sync="formParams.current"
:limit.sync="formParams.pageSize"
:page.sync="formParams.pageIndex"
:total="Number(tableData.total)"
@pagination="fetch"
/>
@ -57,31 +60,52 @@
</template>
<script>
import Marketing from '@/api/Marketing'
import Pagination from '@/components/Pagination'
export default {
components: {
Pagination
},
props: {
info: {
type: Object,
default: () => []
}
},
data() {
return {
formParams: {
size: 10,
current: 1
pageSize: 10,
pageIndex: 1,
productIds: this.info.productIds
},
tableData: {
records: [
{ value1: 'http://cereshop.oss-cn-shenzhen.aliyuncs.com/0000/2020/06/3453cdcc-640d-4f97-afe1-f1bffdf61bc1.jpg', value2: 'BB霜',
value3: '231243544', value4: '99.9', value5: '169', value6: '888', value7: '19877', value8: '上架' }
],
total: 1
}
tableData: {}
}
},
created() {
this.getGoodList()
},
methods: {
async getGoodList() {
const res = await Marketing.getGoodList(this.formParams)
const resData = res.data
if (resData.code === 0) {
this.tableData = resData.data
}
},
fetch() {
this.getGoodList()
},
getStatus(row, item, value) {
const ob = {
1: '上架',
0: '下架'
}
return ob[value]
},
getPrice(row, item, value) {
return value / 100
}
}
}

14
src/views/marketing/details/index.vue

@ -1,11 +1,11 @@
<template>
<div class="marketing_details">
<div class="content">
<el-tabs @tab-click="selectItem">
<el-tabs v-model="compoentsName">
<el-tab-pane v-for="(item, index) in tabList" :key="index" :label="item.name" :name="item.id" />
</el-tabs>
<div class="components">
<component :is="compoentsName" />
<component :is="compoentsName" :params="params" />
</div>
</div>
</div>
@ -27,10 +27,14 @@ export default {
compoentsName: 'info'
}
},
methods: {
selectItem(v) {
this.compoentsName = v.name
computed: {
params() {
return this.$route.params
}
},
created() {},
methods: {
}
}
</script>

61
src/views/marketing/details/info.vue

@ -24,8 +24,7 @@
<p>{{ item.value }}</p>
</li>
<li>
<p></p>
<p>每满500减50</p>
<p v-for="(item,index) in promotionDetail" :key="index">{{ item }}</p>
</li>
</ul>
</div>
@ -33,23 +32,61 @@
</template>
<script>
import Marketing from '@/api/Marketing'
export default {
props: {
params: {
type: Object,
default: () => {}
}
},
data() {
return {
list: [
{ name: '活动名称:', value: '满减活动' },
{ name: '活动介绍:', value: '满减活动满减活动满减活动满减活动满减活动满减活动满减活动满减活动满减活减活动满减活动满减活动满减活动满减活动满减活动' },
{ name: '报名时间:', value: '2020-09-21 15:00 — 2020-11-23 15:00' },
{ name: '起止时间:', value: '2020-09-21 15:00 — 2020-11-23 15:00' },
{ name: '活动保证金:', value: '需要' },
{ name: '保证金金额:', value: '2000' },
{ name: '活动标签:', value: '618活动' }
{ name: '活动名称:', value: '-' },
{ name: '活动介绍:', value: '-' },
{ name: '报名时间:', value: '-' },
{ name: '起止时间:', value: '-' },
{ name: '活动保证金:', value: '-' },
{ name: '保证金金额:', value: '-' },
{ name: '活动标签:', value: '-' }
],
list1: [
{ name: '优惠方式:', value: '满减' },
{ name: '优惠方案:', value: '叠加优惠' }
{ name: '优惠方式:', value: '-' },
{ name: '优惠方案:', value: '-' }
],
img: 'http://cereshop.oss-cn-shenzhen.aliyuncs.com/0000/2020/06/3453cdcc-640d-4f97-afe1-f1bffdf61bc1.jpg'
img: '',
promotionDetail: []
}
},
created() {
this.getDetails()
},
methods: {
async getDetails() {
const vm = this
const res = await Marketing.getDetails(vm.params.id)
const o = vm.list
const t = vm.list1
const resData = res.data
if (resData.code === 0) {
const info = resData.data
o[0].value = info.name
o[1].value = info.description
o[2].value = `${info.applyStartTime}-${info.applyEndTime}`
o[3].value = `${info.activityStartTime}-${info.activityEndTime}`
o[4].value = info.isNeedSecurityDeposit ? '需要' : '不需要'
o[5].value = info.securityDeposit / 100
o[6].value = info.tag
t[0].value = info.promotionType === 1 ? '满减' : '优惠券'
t[1].value = info.promotionPlan === 1 ? '叠加优惠' : '阶梯优惠'
vm.img = info.image
if (info.promotionDetail && info.promotionDetail.length) {
info.promotionDetail.forEach(item => {
vm.promotionDetail.push(`每满${item.fullAmount / 100}${item.discountAmount / 100}`)
})
}
}
}
}
}

152
src/views/marketing/details/marketData.vue

@ -9,7 +9,7 @@
</ul>
</div>
<div class="visit_data">
<div v-if="false" class="visit_data">
<div class="item_box">
<p class="echart_title">访问分布情况</p>
<map-chart :mapdata="mapData" />
@ -31,7 +31,7 @@
<div class="tendency_data">
<div class="item_box">
<p class="echart_title">趋势图</p>
<el-tabs @tab-click="selectItem">
<el-tabs v-model="activeName">
<el-tab-pane v-for="(item, index) in tabList" :key="index" :label="item.name" :name="item.id" />
</el-tabs>
<bar :chart-data="tendencyData" style="height: calc(100% - 54px)" />
@ -41,19 +41,29 @@
商家成交排行榜
<span>成交额/</span>
</p>
<ul>
<li v-for="(item,index) in rankList" :key="index">
<ul v-if="merchantRank.length">
<li v-for="(item,index) in merchantRank" :key="index">
<p>
<span>{{ index + 1 }}</span>
</p>
<p>{{ item.name }}</p>
<p>{{ item.value }}</p>
<p>{{ item.storeName }}</p>
<p>{{ item.tradeAmount / 100 }}</p>
</li>
</ul>
<div
v-else
class="empty"
>
<img
:src="empty"
alt=""
/>
<p>暂无数据</p>
</div>
</div>
</div>
<div class="sale_data">
<div v-if="false" class="sale_data">
<div class="item_box">
<p class="echart_title">销售类别分类</p>
<pie :chart-data="saleData" />
@ -78,50 +88,56 @@
<div class="merchants_detail">
<p>
商家数据明细
<span>导出</span>
<span v-if="false">导出</span>
</p>
<el-table
:data="tableData.records"
:data="tableData.statItemDTOList"
border
style="width: 100%"
>
<el-table-column
prop="value1"
prop="storeName"
label="店铺名称"
/>
<el-table-column
prop="value2"
prop="tenantCode"
label="店铺编码"
/>
<el-table-column
prop="value3"
prop="tradeProductCount"
:formatter="getNum"
label="参与商品数 (件)"
/>
<el-table-column
prop="value4"
prop="tradeUserCount"
:formatter="getNum"
label="访客数 (人)"
/>
<el-table-column
prop="value5"
prop="orderCount"
:formatter="getNum"
label="订单数 (笔)"
/>
<el-table-column
prop="value6"
prop="payedUserCount"
:formatter="getNum"
label="成交客户数 (笔)"
/>
<el-table-column
prop="value7"
:formatter="getPrice"
prop="pricePerUser"
label="客单件 (元)"
/>
<el-table-column
prop="value8"
:formatter="getPrice"
prop="tradeAmount"
label="成交总额 (元)"
/>
</el-table>
<pagination
v-show="tableData.total > 0"
:limit.sync="formParams.size"
:page.sync="formParams.current"
:limit.sync="formParams.pageSize"
:page.sync="formParams.pageIndex"
:total="Number(tableData.total)"
@pagination="fetch"
/>
@ -130,6 +146,8 @@
</template>
<script>
import empty from '@/assets/empty.png'
import Marketing from '@/api/Marketing'
import Pagination from '@/components/Pagination'
import bar from '@/components/marketEchart/bar'
import pie from '@/components/marketEchart/pie'
@ -144,14 +162,21 @@ export default {
cake,
mapChart
},
props: {
params: {
type: Object,
default: () => {}
}
},
data() {
return {
empty: empty,
dataList: [
{ name: '成交总额(元)', value: '12454323', tips: '活动开始之后参与活动的商品总成交额' },
{ name: '支付订单数(笔)', value: '3450', tips: '活动期间活动商品带来的支付成功订单数,不包括退款订单' },
{ name: '支付客户数(人)', value: '3450', tips: '对活动商品进行支付的客户数' },
{ name: '参与商家数(家)', value: '3450', tips: '本活动报名成功的商家数量' },
{ name: '参与商品数(件)', value: '4322', tips: '本活动报名中的商家所有的活动商品数,不按最小SKU算' }
{ name: '成交总额(元)', value: 0, tips: '活动开始之后参与活动的商品总成交额', field: 'tradeAmout' },
{ name: '支付订单数(笔)', value: 0, tips: '活动期间活动商品带来的支付成功订单数,不包括退款订单', field: 'tradeOrderCount' },
{ name: '支付客户数(人)', value: 0, tips: '对活动商品进行支付的客户数', field: 'tradeUserCount' },
{ name: '参与商家数(家)', value: 0, tips: '本活动报名成功的商家数量', field: 'tradeTenantCount' },
{ name: '参与商品数(件)', value: 0, tips: '本活动报名中的商家所有的活动商品数,不按最小SKU算', field: 'tradeProductCount' }
],
rankList: [
@ -167,12 +192,14 @@ export default {
{ name: '阿里巴巴小店', value: '12321,3232' }
],
merchantRank: [],
tabList: [
{ name: '销售额', id: 'sale' },
{ name: '访问量', id: 'visit' }
{ name: '销售额', id: 'sale' }
// { name: '访', id: 'visit' }
],
activeName: 'sale',
tendencyData: {
xData: ['2/1', '2/2', '2/3', '2/4', '2/5', '2/6', '2/7', '2/8', '2/9', '2/10', '2/11', '2/12'],
xData: [],
series: {
type: 'bar',
itemStyle: {
@ -196,7 +223,7 @@ export default {
}
}
},
data: [100, 200, 80, 400, 680, 270, 700, 950, 567, 675, 234, 567],
data: [],
barMaxWidth: '20px'
}
},
@ -222,23 +249,59 @@ export default {
},
mapData: [{ fProvince: "北京", fCity: '北京', fVisitCount: 199 }],
formParams: {
size: 10,
current: 1
pageSize: 10,
pageIndex: 1
},
tableData: {
records: [
{ value1: '艾莉小店', value2: 'MG239', value3: '66', value4: '66', value5: '66', value6: '66', value7: 323.2, value8: '324234.09' }
],
total: 1
}
}
},
created() {
this.getDetail()
this.findTenantStatDetail()
},
methods: {
async getDetail() {
const arr = this.dataList
const res = await Marketing.getDetail(this.params.id)
const resData = res.data
if (resData.code === 0) {
const d = resData.data
const x = []
const y = []
arr.map(item => {
item.value = d[item.field] || 0
if (item.field === 'tradeAmout') {
item.value /= 100
}
})
if (d.promotionStatDayDTOList && d.promotionStatDayDTOList.length) {
d.promotionStatDayDTOList.forEach(item => {
x.push(item.statDay.replace(/-/, '/'))
y.push(item.tradeAmount / 100)
})
}
this.tendencyData.xData = x
this.tendencyData.series.data = y
this.merchantRank = d.promotionTenantRankDTOList || []
}
},
async findTenantStatDetail() {
const res = await Marketing.findTenantStatDetail(Object.assign({}, this.formParams, { promotionId: this.params.id }))
const resData = res.data
if (resData.code === 0) {
this.tableData = resData.data
}
},
fetch() {
this.findTenantStatDetail()
},
selectItem(v) {
console.log(v.name)
getPrice(row, item, value) {
return value / 100
},
getNum(row, item, value) {
return value || 0
}
}
}
@ -411,6 +474,21 @@ export default {
}
}
.empty {
// height: calc(100% - 50px);
img {
width:80px;
height:80px;
margin: 100px auto 10px;
display: block;
}
p {
text-align: center;
color: #333333;
}
}
/deep/ .el-table {
th {
background: #EEF3FF;

145
src/views/marketing/details/shop.vue

@ -6,11 +6,11 @@
:model="formParams"
>
<el-form-item label="店铺名称">
<el-input v-model="formParams.name" size="mini" />
<el-input v-model="formParams.model.storeName" size="mini" />
</el-form-item>
<el-form-item label="店铺编码">
<el-input v-model="formParams.code" size="mini" />
<el-input v-model="formParams.model.tenantCode" size="mini" />
</el-form-item>
<el-form-item label="审核状态">
@ -31,10 +31,17 @@
<el-button
type="primary"
size="mini"
@click="query"
@click="fetch"
>
查询
</el-button>
<el-button
plain
size="mini"
@click="reset"
>
重置
</el-button>
</el-form-item>
</el-form>
</div>
@ -47,23 +54,24 @@
style="width: 100%"
>
<el-table-column
prop="name"
prop="storeName"
label="店铺名称"
/>
<el-table-column
prop="status"
prop="tenantCode"
label="店铺编码"
/>
<el-table-column
prop="type"
prop="productCount"
label="参与商品数"
/>
<el-table-column
prop="custom"
prop="auditCount"
label="审核次数"
/>
<el-table-column
prop="goods"
prop="status"
:formatter="getStatus"
label="审核状态"
/>
<el-table-column label="操作">
@ -85,16 +93,18 @@
审核记录
</el-button>
<el-button
v-if="scope.row.status===1"
type="text"
size="small"
@click.native.prevent="handle(scope.row)"
@click.native.prevent="audit(scope.row.id)"
>
处理
审核
</el-button>
<el-button
v-if="scope.row.status===2"
type="text"
size="small"
@click.native.prevent="quit(scope.row)"
@click.native.prevent="clean(scope.row.id)"
>
清退
</el-button>
@ -115,76 +125,137 @@
:title="dialog.title"
:visible.sync="dialog.visible"
:fullscreen="!true"
:before-close="close"
width="55%"
>
<goods v-if="dialog.type===1" />
<audit-log v-if="dialog.type===2" />
<goods v-if="dialog.type===1" :info="info" />
<audit-log v-if="dialog.type===2" :info="info" />
</Dialog>
<auditDialog :dialog-data="dialogData" @closed="closed" @applyShop="applyShop" />
</div>
</template>
<script>
import Marketing from '@/api/Marketing'
import Pagination from '@/components/Pagination'
import goods from './component/goods'
import auditLog from './component/auditLog'
import auditDialog from './component/auditDialog'
import { Dialog } from 'element-ui'
export default {
components: {
Pagination,
goods,
Dialog,
auditLog
auditLog,
auditDialog
},
props: {
params: {
type: Object,
default: () => {}
}
},
data() {
return {
formParams: {
name: '',
code: '',
status: '',
model: {
storeName: '',
tenantCode: '',
status: '',
promotionId: this.params.id
},
size: 10,
current: 1
},
statusList: [
{ label: '全部', value: '' },
{ label: '待审核', value: '1' },
{ label: '审核通过', value: '2' },
{ label: '审核通过', value: '3' }
{ label: '待审核', value: 1 },
{ label: '审核通过', value: 2 },
{ label: '审核通过', value: 3 }
],
tableData: {
records: [
{ name: '阿里小店', status: 'N95', type: '23', custom: 12, goods: '待审核' }
],
total: 1
},
dialog: {}
tableData: {},
dialog: {},
info: '',
dialogData: {}
}
},
created() {
this.applyShop()
},
methods: {
fetch() {
async applyShop() {
const res = await Marketing.applyShop(this.formParams)
const resData = res.data
if (resData.code === 0) {
this.tableData = resData.data
}
},
query() {
getStatus(row, item, cellValue) {
let t = ''
this.statusList.forEach(item => {
if (item.value === cellValue) {
t = item.label
}
})
return t
},
details() {
reset() {
this.formParams = {
model: {
storeName: '',
tenantCode: '',
status: '',
promotionId: this.params.id
},
size: 10,
current: 1
}
},
fetch() {
this.applyShop()
},
details(item) {
this.info = item
this.dialog = {
title: '活动商品',
visible: true,
type: 1
}
},
records() {
records(item) {
this.info = item
this.dialog = {
title: '审核记录',
visible: true,
type: 2
}
},
handle() {
audit(id) {
this.dialogData = {
title: '审核',
type: 1,
id: id,
visible: true
}
},
quit() {
clean(id) {
this.dialogData = {
title: '清退',
type: 2,
id: id,
visible: true
}
},
close() {
this.dialog = {
title: '',
visible: false,
type: ''
}
},
closed(v) {
this.dialogData.visible = v
}
}
}

154
src/views/marketing/index.vue

@ -12,7 +12,7 @@
<el-form-item label="活动状态">
<el-select
v-model="formParams.status"
v-model="formParams.promotionStatus"
size="mini"
>
<el-option
@ -26,11 +26,11 @@
<el-form-item label="营销方式">
<el-select
v-model="formParams.type"
v-model="formParams.promotionType"
size="mini"
>
<el-option
v-for="(item, index) in typeList"
v-for="(item, index) in promotionTypeList"
:key="index"
:label="item.label"
:value="item.value"
@ -45,6 +45,13 @@
>
查询
</el-button>
<el-button
plain
size="mini"
@click="reset"
>
重置
</el-button>
<el-button
type="primary"
size="mini"
@ -70,18 +77,20 @@
/>
<el-table-column
prop="status"
:formatter="getStatus"
label="活动状态"
/>
<el-table-column
prop="type"
prop="promotionType"
label="营销方式"
:formatter="getType"
/>
<el-table-column
prop="custom"
prop="tenantCount"
label="商家数"
/>
<el-table-column
prop="goods"
prop="productCount"
label="商品数量"
/>
<el-table-column label="操作">
@ -91,11 +100,12 @@
<el-button
type="text"
size="small"
@click.native.prevent="details(scope.row)"
@click.native.prevent="details(scope.row.id)"
>
详情
</el-button>
<el-button
v-if="scope.row.status!==5"
type="text"
size="small"
@click.native.prevent="edit(scope.row)"
@ -103,16 +113,18 @@
编辑
</el-button>
<el-button
v-if="scope.row.status===4"
type="text"
size="small"
@click.native.prevent="stop(scope.row)"
@click.native.prevent="stop(scope.row.id)"
>
结束
</el-button>
<el-button
v-if="scope.row.status===5"
type="text"
size="small"
@click.native.prevent="deletes(scope.row)"
@click.native.prevent="deletes(scope.row.id)"
>
删除
</el-button>
@ -122,69 +134,139 @@
</div>
<pagination
v-show="tableData.total > 0"
:limit.sync="formParams.size"
:page.sync="formParams.current"
:limit.sync="formParams.pageSize"
:page.sync="formParams.pageIndex"
:total="Number(tableData.total)"
@pagination="fetch"
/>
</div>
</div>
<delete :dialog-visible="dialogVisible" @confirm="confirm" @closed="closed" />
</div>
</template>
<script>
import Pagination from '@/components/Pagination'
import Marketing from '@/api/Marketing'
import Delete from './delete/index'
export default {
components: {
Pagination
Pagination,
Delete
},
data() {
return {
formParams: {
name: '',
status: '',
type: '',
size: 10,
current: 1
promotionStatus: '',
promotionType: '',
type: 1,
pageSize: 10,
pageIndex: 1
},
statusList: [
{ label: '全部', value: '' },
{ label: '报名进行中', value: 1 },
{ label: '报名未开始', value: 2 },
{ label: '活动进行中', value: 3 },
{ label: '活动已结束', value: 4 },
{ label: '活动待开始', value: 5 }
{ label: '报名未开始', value: 1 },
{ label: '报名进行中', value: 2 },
{ label: '活动未开始', value: 3 },
{ label: '活动进行中', value: 4 },
{ label: '活动已结束', value: 5 }
],
typeList: [
promotionTypeList: [
{ label: '全部', value: '' },
{ label: '满减', value: 1 },
{ label: '优惠券', value: 2 }
],
tableData: {
records: [
{ name: '618大促', status: '报名状态中', type: '满减', custom: 12, goods: 15 }
]
tableData: {},
dialogVisible: {
title: '',
visible: false,
text: ''
}
}
},
created() {
this.getList()
},
methods: {
query() {},
async getList() {
const res = await Marketing.getList(this.formParams)
const resData = res.data
if (resData.code === 0) {
this.tableData = resData.data
}
},
query() {
this.getList()
},
add() {
this.$router.push({ path: '/marketing/add' })
},
details() {
this.$router.push({ path: '/marketing/details' })
details(id) {
this.$router.push({ path: `/marketing/details/${id}` })
},
edit() {
edit(item) {
this.$router.push({ path: '/marketing/add', query: { info: item }})
},
stop() {
reset() {
this.formParams = {
name: '',
promotionStatus: '',
promotionType: '',
type: 1,
pageSize: 10,
pageIndex: 1
}
},
deletes() {
deletes(id) {
const vm = this
vm.dialogVisible = {
visible: true,
title: '删除活动',
text: '确认删除此活动吗?',
type: 1,
id: id
}
},
stop(id) {
const vm = this
vm.dialogVisible = {
visible: true,
title: '结束活动',
text: '未到活动结束时间,确定要提前结束吗?',
type: 2,
id: id
}
},
confirm(v) {
const vm = this
const fn = vm.dialogVisible.type === 1 ? 'delPromotion' : 'finishPromotion'
Marketing[fn]({ id: vm.dialogVisible.id }).then(res => {
vm.getList()
})
vm.dialogVisible.visible = v
},
closed(v) {
this.dialogVisible.visible = v
},
fetch() {}
fetch() {
this.getList()
},
getDict(arr, id) {
let t = id
arr.forEach(item => {
if (item.value === id) {
t = item.label
}
})
return t
},
getStatus(item, cell, cellValue) {
return this.getDict(this.statusList, cellValue)
},
getType(item, cell, cellValue) {
return this.getDict(this.promotionTypeList, cellValue)
}
}
}
</script>

Loading…
Cancel
Save