feat(activity): 报单赠送

This commit is contained in:
woody 2025-10-16 09:39:13 +08:00
parent 938e262743
commit 7700825478
8 changed files with 2002 additions and 59 deletions

View File

@ -1,7 +1,7 @@
import request from '@/utils/request'
// 加购升级-活动列表
export function upgradeList(params) {
// 活动列表 actType区分
export function getActivityList(params) {
return request({
url: '/activity/manage/activity/list',
method: 'get',
@ -36,3 +36,48 @@ export function upgradeRecordList(params) {
})
}
// 报单赠送获取详情
export function getDeclarationActivityDetail(params) {
return request({
url: '/activity/manage/acDeclarationConfig/get-detail',
method: 'get',
params
})
}
// 报单赠送-活动创建
export function addDeclarationActivityList(data) {
return request({
url: '/activity/manage/acDeclarationConfig/save',
method: 'post',
data
})
}
// 报单赠送-活动更新
export function updateDeclarationActivityList(data) {
return request({
url: '/activity/manage/acDeclarationConfig/update',
method: 'post',
data
})
}
// 报单赠送-活动删除
export function delDeclarationActivityList(data) {
return request({
url: '/activity/manage/acDeclarationConfig/delete',
method: 'post',
data
})
}
// 报单赠送记录列表
export function declarationActivityRecordList(params) {
return request({
url: '/activity/manage/declarationActivityRecord/list',
method: 'get',
params
})
}

View File

@ -2086,6 +2086,33 @@ export const constantRoutes = [
}
]
},
{
path: 'declarationActivity',
name: 'DeclarationActivity',
component: ParentView,
meta: { title: '报单赠送' },
children: [
{
path: 'declarationActivityList',
name: 'DeclarationActivityList',
component: () => import('@/views/marketing/declarationActivity/index'),
meta: { title: '报单赠送' }
},
{
path: 'updateInfo',
name: 'updateInfo',
component: () => import('@/views/marketing/declarationActivity/updateInfo'),
meta: { title: '基本信息' },
hidden: true
},
{
path: 'declarationActivityRecordList',
name: 'DeclarationActivityRecordList',
component: () => import('@/views/marketing/declarationActivity/record'),
meta: { title: '报单赠送记录' }
}
]
},
// {
// path: 'benefitsGift',
// name: 'BenefitsGift',

View File

@ -1,39 +1,33 @@
<!--
* @Descripttion:
* @version:
* @Author: 王三华
* @Date: 2024-02-22 10:55:31
-->
<!--
* @Descripttion:
* @version:
* @Author: 王三华
* @Date: 2023-05-04 20:20:52
-->
<template>
<div class="">
<div class="tit">权益赠送</div>
<div class="xian"></div>
<div class="xian" />
<div class="table">
<!-- 批量操作 -->
<table>
<tr>
<th colspan="1"
class="tableLeft">
<el-button type="primary"
<th
colspan="1"
class="tableLeft"
>
<el-button
type="primary"
size="mini"
@click="addNewGoods"
size="mini">{{'添加'}}
>{{ '添加' }}
</el-button>
</th>
</tr>
</table>
<table class="table_b">
<tr style="border-top:0">
<td style="border:0"></td>
<td style="border:0" />
<!-- <td colspan="2">{{ '结算等级' }}</td> -->
<td colspan="6"
style="padding-bottom:0">
<td
colspan="6"
style="padding-bottom:0"
>
<div class="tableFlex">
<!-- <div class="tableFlex_i">结算等级</div> -->
<div class="tableFlex_i">会员点位</div>
@ -42,9 +36,11 @@
</div>
</td>
</tr>
<tr v-for="item,index in agbrList"
:key="index">
<td style="border:0"></td>
<tr
v-for="item,index in agbrList"
:key="index"
>
<td style="border:0" />
<!-- <td colspan="2"
style="padding-bottom:0">
<div class="tableFlex">
@ -61,8 +57,10 @@
</div>
</div>
</td> -->
<td colspan="6"
style="padding-bottom:0">
<td
colspan="6"
style="padding-bottom:0"
>
<div class="tableFlex">
<!-- <div class="tableFlex_i">
@ -86,29 +84,37 @@
:value="item.pkId">
</el-option>
</el-select> -->
<el-input placeholder="会员点位"
<el-input
v-model="item.memberPoint"
placeholder="会员点位"
size="medium"
v-model="item.memberPoint"></el-input>
/>
</div>
<div class="tableFlex_i">
<el-select v-model="item.grade"
size="medium">
<el-option v-for="item in gradeList"
<el-select
v-model="item.grade"
size="medium"
>
<el-option
v-for="item in gradeList"
:key="item.pkId"
:label="item.gradeName"
:value="item.pkId">
</el-option>
:value="item.pkId"
/>
</el-select>
</div>
<div class="tableFlex_i">
<el-select v-model="item.legalRight"
<el-select
v-model="item.legalRight"
size="medium"
placeholder="赠送权益">
<el-option v-for="item in registerist"
placeholder="赠送权益"
>
<el-option
v-for="item in registerist"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
:value="item.value"
/>
</el-select>
</div>
</div>
@ -127,15 +133,15 @@ import ImageUpload from '@/components/ImageUpload'
export default {
components: {
topBar,
ImageUpload,
ImageUpload
},
data() {
return {
ggVisible: false,
allData: [], //
registerist:[],
gradeList:[],
agbrList:[]
allData: [], //
registerist: [],
gradeList: [],
agbrList: []
}
},
mounted() {
@ -144,9 +150,9 @@ export default {
methods: {
getPage(allData) {
if (allData != '') {
allData.forEach(item=>{
if(!item.giftConfigList){
item.giftConfigList=[]
allData.forEach(item => {
if (!item.giftConfigList) {
item.giftConfigList = []
}
})
this.agbrList = allData
@ -165,7 +171,7 @@ export default {
pkGrade: '',
grade: '',
memberPoint: '',
legalRight: '',
legalRight: ''
})
},
tableRowClassName({ row, rowIndex }) {
@ -175,8 +181,8 @@ export default {
return 'success-row'
}
return ''
},
},
}
}
}
</script>

View File

@ -0,0 +1,406 @@
<template>
<div class="page">
<topBar
v-if="topList.length > 0"
:top-list="topList"
:moren="moren"
/>
<div class="main">
<div class="form_all">
<el-form
ref="select"
:model="select"
label-width="auto"
>
<el-row :gutter="40">
<!-- 一层 -->
<el-col :span="4">
<el-form-item :label="'活动名称'">
<el-input
v-model="select.actName"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="'活动状态'">
<el-select
v-model="select.activityStatus"
clearable
:placeholder="'请选择'"
>
<el-option
v-for="item in actStatus"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="'开始日期'">
<el-date-picker
v-model="creationTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
@change="changeTime"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="'结束日期'">
<el-date-picker
v-model="creationTime1"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
@change="changeTime1"
/>
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item :label="'创建日期'">
<el-date-picker
v-model="creationTime2"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
@change="changeTime2"
/>
</el-form-item>
</el-col> -->
<el-col :span="4">
<el-button
type="primary"
size="small"
@click="getDataList"
> {{ '搜索' }}</el-button>
<el-button
size="small"
class="resetBtn"
@click="reset"
> {{ '重置' }}</el-button>
</el-col>
</el-row>
</el-form>
</div>
<div class="main_a">
<div class="mainbtn">
<el-button
v-hasButtons="['declarationActivityAdd']"
size="small"
class="addBtn"
@click="addHandle"
>{{ '添加' }}</el-button>
<el-button
v-hasButtons="['declarationActivityExport']"
size="small"
class="exportBtn"
@click="handleExport"
> {{ '导出' }}</el-button>
</div>
<div class="maintable">
<el-table
v-loading="loading"
:data="tableData"
style="width: 100%"
height="710px"
:header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
/>
<el-table-column
align="center"
prop="actName"
:label="'活动名称'"
/>
<el-table-column
align="center"
prop="actStartDate"
:label="'开始日期'"
/>
<el-table-column
align="center"
prop="actEndDate"
:label="'结束日期'"
/>
<el-table-column
align="center"
prop="status"
:label="'活动状态'"
/>
<el-table-column
align="center"
prop="creationTime"
:label="'创建日期'"
/>
<el-table-column
align="center"
prop="time"
:label="'操作'"
fixed="right"
>
<template slot-scope="scope">
<el-button
v-hasButtons="['declarationActivityDetail']"
type="text"
style="color: #48B2FD;"
size="small"
@click="redirectDetail(scope.row.pkId, 4)"
>
{{ '查看' }}
</el-button>
<el-button
v-hasButtons="['declarationActivityUpdate']"
type="text"
style="color: #F3A900;"
size="small"
@click="redirectDetail(scope.row.pkId, 2)"
>
{{ '修改' }}
</el-button>
<el-button
v-hasButtons="['declarationActivityDelete']"
type="text"
size="small"
style="color: #C8161D"
@click="handleDelete(scope.row.pkId)"
>
{{ '删除' }}
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getDataList"
/>
</div>
</template>
<script>
import topBar from '@/components/topBar'
import * as api from '@/api/activity.js'
import { activityStatus } from '@/api/giftGoods.js'
export default {
name: 'Bzpz',
components: {
topBar
},
filters: {
isAgree(val) {
if (!val) {
return '允许'
} else {
return '禁止'
}
}
},
data() {
return {
creationTime: [],
creationTime1: [],
creationTime2: [],
select: {},
//
queryParams: {
pageNum: 1,
pageSize: 50
},
addOrEdit: '',
total: 0,
dialogVisible: false,
tableData: [],
loading: false,
moren: 'declarationActivityList',
topList: [
{
name: '报单赠送',
path: 'declarationActivityList'
}
],
form: {
name: ''
},
rules: {
name: [{ required: true, message: '请输入规格类型', trigger: 'blur' }]
},
actStatus: []
}
},
mounted() {
//
this.getData()
//
this.getDataList()
},
methods: {
//
reset() {
this.select = {}
this.creationTime = []
this.creationTime1 = []
this.creationTime2 = []
this.getDataList()
},
getData() {
activityStatus().then((res) => {
this.actStatus = res.data
})
},
changeTime(val) {
this.select.startActStartDate = val ? val[0] : ''
this.select.endActStartDate = val ? val[1] : ''
},
changeTime1(val) {
this.select.startActEndDate = val ? val[0] : ''
this.select.endActEndDate = val ? val[1] : ''
},
changeTime2(val) {
this.select.startCreationTime = val ? val[0] : ''
this.select.endCreationTime = val ? val[1] : ''
},
//
redirectDetail(id, index) {
this.$router.push({
path: 'updateInfo',
query: {
pkId: id,
controlType: index
}
})
},
//
handleDelete(id) {
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
api.delDeclarationActivityList({
pkId: id
}).then((res) => {
this.getDataList()
})
})
},
handleClose() {
this.dialogVisible = false
this.$refs['form'].clearValidate()
this.$refs['form'].resetFields()
},
addHandle() {
this.$router.push({
path: 'updateInfo',
query: {
controlType: 1
}
})
},
//
getDataList() {
this.loading = true
api
.getActivityList(
Object.assign({}, this.queryParams, this.select, { actType: 32 })
)
.then((res) => {
this.tableData = res.rows
this.total = res.total
this.loading = false
})
},
handleSelectionChange(val) {},
/** 导出按钮操作 */
handleExport() {
this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then((_) => {
this.download(
'activity/manage/acDeclarationConfig/export',
Object.assign({}, { actType: 31 }, this.queryParams, this.select),
`${'加购升级'}${new Date().getTime()}.xlsx`
)
})
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
return 'warning-row'
} else if (rowIndex % 2 == 0) {
return 'success-row'
}
return ''
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-table .warning-row {
background: #f9f9f9;
}
::v-deep .el-table .success-row {
background: #ffffff;
}
::v-deep .el-table thead {
color: #000000;
}
::v-deep .el-select {
width: 100%;
}
.page {
padding: 20px;
background: #f9f9f9;
font-size: 14px;
.main {
// background: #ffffff;
border-radius: 8px;
display: flex;
flex-direction: column;
.main_a {
background: #fff;
border-radius: 8px;
justify-content: space-between;
align-items: center;
box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
}
.mainbtn {
padding: 0;
}
.maintable {
flex: 1;
}
}
}
::v-deep .el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 100%;
}
.form_all {
padding: 0 20px;
margin-bottom: 10px;
background: #fff;
}
</style>

View File

@ -0,0 +1,358 @@
<template>
<div class="page">
<topBar
v-if="topList.length > 0"
:top-list="topList"
:moren="moren"
/>
<div class="main">
<div class="form_all">
<el-form
ref="select"
:model="select"
label-width="auto"
>
<el-row :gutter="40">
<!-- 一层 -->
<el-col :span="4">
<el-form-item :label="'活动名称'">
<el-input
v-model="select.actName"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item :label="'活动状态'">
<el-select
v-model="select.activityStatus"
clearable
:placeholder="'请选择'"
>
<el-option
v-for="item in actStatus"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="'开始日期'">
<el-date-picker
v-model="creationTime"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
@change="changeTime"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item :label="'结束日期'">
<el-date-picker
v-model="creationTime1"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
@change="changeTime1"
/>
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item :label="'创建日期'">
<el-date-picker
v-model="creationTime2"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetimerange"
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
@change="changeTime2"
/>
</el-form-item>
</el-col> -->
<el-col :span="4">
<el-button
type="primary"
size="small"
@click="getDataList"
> {{ '搜索' }}</el-button>
<el-button
size="small"
class="resetBtn"
@click="reset"
> {{ '重置' }}</el-button>
</el-col>
</el-row>
</el-form>
</div>
<div class="main_a">
<div class="mainbtn">
<el-button
v-hasButtons="['declarationActivityRecordExport']"
size="small"
class="exportBtn"
@click="handleExport"
> {{ '导出' }}</el-button>
</div>
<div class="maintable">
<el-table
v-loading="loading"
:data="tableData"
style="width: 100%"
height="710px"
:header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
/>
<el-table-column
align="center"
prop="memberCode"
label="会员编号"
/>
<el-table-column
align="center"
prop="memberName"
label="会员姓名"
/>
<el-table-column
align="center"
prop="actName"
:label="'活动名称'"
/>
<el-table-column
align="center"
prop="originalLevelVal"
label="原等级"
/>
<el-table-column
align="center"
prop="upgradeLevelVal"
label="新等级"
/>
<!-- <el-table-column
align="center"
prop="actStartDate"
:label="'开始日期'"
/>
<el-table-column
align="center"
prop="actEndDate"
:label="'结束日期'"
/> -->
<!-- <el-table-column
align="center"
prop="status"
:label="'活动状态'"
/> -->
<el-table-column
align="center"
prop="creationTime"
:label="'创建日期'"
/>
</el-table>
</div>
</div>
</div>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getDataList"
/>
</div>
</template>
<script>
import topBar from '@/components/topBar'
import * as api from '@/api/activity.js'
import { activityStatus } from '@/api/giftGoods.js'
export default {
name: 'Bzpz',
components: {
topBar
},
filters: {
isAgree(val) {
if (!val) {
return '允许'
} else {
return '禁止'
}
}
},
data() {
return {
creationTime: [],
creationTime1: [],
creationTime2: [],
select: {},
//
queryParams: {
pageNum: 1,
pageSize: 50
},
addOrEdit: '',
total: 0,
dialogVisible: false,
tableData: [],
loading: false,
moren: 'declarationActivityRecordList',
topList: [
{
name: '加购升级记录',
path: 'declarationActivityRecordList'
}
],
form: {
name: ''
},
rules: {
name: [{ required: true, message: '请输入规格类型', trigger: 'blur' }]
},
actStatus: []
}
},
mounted() {
//
this.getData()
//
this.getDataList()
},
methods: {
//
reset() {
this.select = {}
this.creationTime = []
this.creationTime1 = []
this.creationTime2 = []
this.getDataList()
},
getData() {
activityStatus().then((res) => {
this.actStatus = res.data
})
},
changeTime(val) {
this.select.startActStartDate = val ? val[0] : ''
this.select.endActStartDate = val ? val[1] : ''
},
changeTime1(val) {
this.select.startActEndDate = val ? val[0] : ''
this.select.endActEndDate = val ? val[1] : ''
},
changeTime2(val) {
this.select.startCreationTime = val ? val[0] : ''
this.select.endCreationTime = val ? val[1] : ''
},
//
redirectDetail(id, index) {
this.$router.push({
path: 'updateInfo',
query: {
pkId: id,
controlType: index
}
})
},
//
getDataList() {
this.loading = true
api
.upgradeRecordList(
Object.assign({}, this.queryParams, this.select, { actType: 31 })
)
.then((res) => {
this.tableData = res.rows
this.total = res.total
this.loading = false
})
},
handleSelectionChange(val) {},
/** 导出按钮操作 */
handleExport() {
this.$confirm('是否确认导出所有数据项?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then((_) => {
this.download(
'activity/manage/addUpgradeRecord/listExport',
Object.assign({}, { actType: 31 }, this.queryParams, this.select),
`${'加购升级记录'}${new Date().getTime()}.xlsx`
)
})
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
return 'warning-row'
} else if (rowIndex % 2 == 0) {
return 'success-row'
}
return ''
}
}
}
</script>
<style scoped lang="scss">
::v-deep .el-table .warning-row {
background: #f9f9f9;
}
::v-deep .el-table .success-row {
background: #ffffff;
}
::v-deep .el-table thead {
color: #000000;
}
::v-deep .el-select {
width: 100%;
}
.page {
padding: 20px;
background: #f9f9f9;
font-size: 14px;
.main {
// background: #ffffff;
border-radius: 8px;
display: flex;
flex-direction: column;
.main_a {
background: #fff;
border-radius: 8px;
justify-content: space-between;
align-items: center;
box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
}
.mainbtn {
padding: 0;
}
.maintable {
flex: 1;
}
}
}
::v-deep .el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 100%;
}
.form_all {
padding: 0 20px;
margin-bottom: 10px;
background: #fff;
}
</style>

View File

@ -0,0 +1,723 @@
<template>
<div class="">
<div class="tit">报单赠送</div>
<div class="xian" />
<div class="table">
<table>
<tr>
<th
colspan="5"
class="tableLeft"
>
<el-button
type="primary"
size="mini"
@click="addNewGoods"
>{{ '添加' }}
</el-button>
</th>
<th
colspan="7"
style="padding-bottom:0"
>
<div class="tableFlex">
<div class="tableFlex_i" />
<div class="tableFlex_i" />
<div class="tableFlex_i"> <el-input
v-model="batchReset.quantity"
:placeholder="'赠送数量'"
/></div>
<div class="tableAdd" />
</div>
</th>
<th
colspan="2"
style="padding-bottom:0"
>
<div class="tableFlex">
<div class="tableFlex_i"><el-button
type="primary"
size="mini"
@click="batchHandle"
>{{ '批量操作' }}</el-button></div>
<div class="tableFlex_i"><el-button
size="mini"
@click="reset"
> {{ '重置' }}</el-button></div>
</div>
</th>
</tr>
</table>
<table
v-for="(item, idx) in allData"
:key="idx"
class="table_b"
>
<tr style="border-top:0">
<td style="border:0" />
<td colspan="2">会员权限</td>
<td colspan="2">会员等级</td>
<td
colspan="7"
style="padding-bottom:0"
>
<div class="tableFlex">
<div class="tableFlex_i">{{ '赠送产品' }}</div>
<div class="tableFlex_i">{{ '产品规格' }}</div>
<div class="tableFlex_i">{{ '赠送数量' }}</div>
<div class="tableAdd" />
</div>
</td>
<td
colspan="2"
style="border:0"
/>
</tr>
<tr
v-for="ctem,cndex in item.acDeclarationConfigParam"
:key="cndex"
>
<td style="border:0" />
<td colspan="2">
<el-select v-model="ctem.registerAuthority">
<el-option v-for="item in registerList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</td>
<td colspan="2">
<el-select v-model="ctem.specifyLevel">
<el-option v-for="item in gradeRangList" :key="item.pkId" :label="item.gradeName" :value="item.pkId"></el-option>
</el-select>
</td>
<td
colspan="7"
style="padding-bottom:0"
>
<div
v-for="stem,sndex in ctem.acDeclarationProductParamList"
v-show="ctem.acDeclarationProductParamList.length>0"
:key="sndex"
class="tableFlex"
>
<div class="tableFlex_i">
<el-input
v-model="stem.productName"
:placeholder="'请选择赠送产品'"
@focus="getProduct(cndex,sndex)"
/>
</div>
<div class="tableFlex_i">
<el-input
v-model="stem.specsName"
disabled
/>
</div>
<div class="tableFlex_i">
<el-input v-model="stem.quantity" />
</div>
<div class="tableAdd">
<img
src="@/assets/images/iconpop.png"
alt=""
@click="reduceProduct(cndex,sndex)"
>
<img
src="@/assets/images/iconadd.png"
alt=""
@click="addProduct(cndex)"
>
</div>
</div>
<div
v-show="ctem.acDeclarationProductParamList.length==0"
class="tableAddPro"
>
{{ '添加产品' }}
<img
src="@/assets/images/iconadd.png"
alt=""
@click="addProduct(cndex)"
>
</div>
</td>
<td
colspan="2"
style="border:0"
>
<div class="tableAdd">
<img src="@/assets/images/iconpop.png" alt="" @click="reduceRow(cndex)">
</div>
</td>
</tr>
</table>
</div>
<el-dialog
:title="'添加'"
:visible.sync="dialogVisible"
:close-on-click-modal="false"
width="40%"
center
:before-close="handleClose"
>
<div class="cpHeight">
<el-row>
<el-col :span="22"> <el-input
v-model="select.queryInfo"
clearable
:placeholder="'请输入'"
prefix-icon="el-icon-search"
@keyup.enter.native="getDataList"
/>
</el-col>
<el-col :span="2">
<el-button
type="primary"
size="small"
@click="getDataList"
> {{ '搜索' }}</el-button>
</el-col>
</el-row>
<div style="height:10px" />
<el-table
ref="multipleTable"
:data="dialogList"
style="width: 100%"
:header-cell-style="{ background: '#EEEEEE' }"
:row-class-name="tableRowClassName"
@select-all="onSelectAll"
@select="selected"
>
<el-table-column
type="selection"
width="55"
/>
<el-table-column
align="center"
prop="productName"
:label="'产品名称'"
/>
<el-table-column
align="center"
prop="productCode"
:label="'产品编号'"
/>
<el-table-column
align="center"
prop="productName"
:label="'规格'"
>
<template slot-scope="scope">
<div
v-show="scope.row.selSkuNameList==''||scope.row.selSkuNameList==undefined"
class="blueCor"
@click="selSku(scope.row.pkId,scope.$index)"
>{{ '选择规格' }}</div>
<div
v-show="scope.row.selSkuNameList!=''&&scope.row.selSkuNameList!=undefined"
class="blueCor"
@click="selSku(scope.row.pkId,scope.$index)"
>{{ scope.row.selSkuNameList }}</div>
</template>
</el-table-column>
<el-table-column
align="center"
prop="productName"
:label="'商品数量'"
>
<template slot-scope="scope">
<el-input-number
v-model="scope.row.quantity"
size="mini"
:min="1"
/>
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getDataList"
/>
<span
slot="footer"
class="dialog-footer"
>
<el-button @click="handleClose">{{ '取消' }}</el-button>
<el-button
type="primary"
@click="sureProduct"
>{{ '确认' }}</el-button>
</span>
</el-dialog>
<el-dialog
:title="'规格'"
:visible.sync="ggVisible"
:close-on-click-modal="false"
width="40%"
center
:before-close="handleCloseGg"
>
<div>
<el-form>
<el-form-item
v-for="item,index in skuList"
:key="index"
:label="item.typeName"
>
<el-radio-group v-model="item.pkProductSku">
<el-radio
v-for="ctem,cndex in item.specsList"
:key="ctem.pkId"
:label="ctem.pkId"
@change="getCheckBox(item.pkId,item.specsName)"
>{{ ctem.specsName }}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
</div>
<span
slot="footer"
class="dialog-footer"
>
<el-button @click="handleCloseGg">{{ '取消' }}</el-button>
<el-button
type="primary"
@click="sureSku"
>{{ '确认' }}</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import * as api from '@/api/giftGoods.js'
import topBar from '@/components/topBar'
import ImageUpload from '@/components/ImageUpload'
import { isLocals } from '../../../utils/numberToCurrency'
import {
getgradeRanglist,
getRegistration
} from '@/api/level'
export default {
components: {
topBar,
ImageUpload
},
data() {
return {
dialogVisible: false,
ggVisible: false,
queryParams: {
pageNum: 1,
pageSize: 50
},
total: 0,
moren: 'setGiftGoodsInfo',
topList: [
{
name: '基本信息',
path: 'addGiftGoodsInfo'
},
{
name: '规则设置',
path: 'setGiftGoodsInfo'
}
],
allData: [], //
allGoods: [], //
isArea: '',
batchReset: {},
select: {}, //
dialogList: [], //
selectData: [], //
skuList: [], //
selSkuList: '',
selSkuNameList: '',
selIndex: '',
showCndex: '',
showIndex: '',
pageData: {},
queryData: [],
registerList: [],
gradeRangList: [],
}
},
mounted() {
this.getgradeRanglist()
this.getMemberAuthEnum()
this.init()
},
methods: {
isLocals,
init() {
this.allData.push({
acDeclarationConfigParam: []
})
},
getgradeRanglist() {
getgradeRanglist().then((res) => {
if (res.code === 200) {
this.gradeRangList = res.data
}
})
},
getMemberAuthEnum() {
getRegistration().then((res) => {
if (res.code === 200) {
this.registerList = res.data
}
})
},
sureSku() {
this.$set(this.dialogList[this.selIndex], 'selSkuList', this.selSkuList)
this.$set(
this.dialogList[this.selIndex],
'selSkuNameList',
this.selSkuNameList
)
this.ggVisible = false
},
sureProduct() {
if (this.selectData.length === 0) {
this.$message({
message: '请选择产品',
type: 'warning'
})
return false
} else {
this.allData.forEach((item) => {
item.acDeclarationConfigParam[this.showCndex].acDeclarationProductParamList[
this.showIndex
].pkProduct = this.selectData.pkId
item.acDeclarationConfigParam[this.showCndex].acDeclarationProductParamList[
this.showIndex
].productName = this.selectData.productName
item.acDeclarationConfigParam[this.showCndex].acDeclarationProductParamList[
this.showIndex
].specsName = this.selectData.selSkuNameList
item.acDeclarationConfigParam[this.showCndex].acDeclarationProductParamList[
this.showIndex
].specsNameId = this.selectData.selSkuList
item.acDeclarationConfigParam[this.showCndex].acDeclarationProductParamList[
this.showIndex
].quantity = this.selectData.quantity
})
// this.dialogVisible = false
this.handleClose()
this.$forceUpdate()
}
},
batchHandle() {
this.allData.forEach((item) => {
item.acDeclarationConfigParam.forEach((ctem) => {
ctem.acDeclarationProductParamList.forEach((stem) => {
stem.quantity = this.batchReset.quantity
})
})
})
},
getAllData() {
return this.allData[0].acDeclarationConfigParam
},
reset() {
this.batchReset = {}
},
getCheckBox() {
const arr1 = []
const arr2 = []
this.skuList.forEach((item) => {
item.specsList.forEach((ctem) => {
if (ctem.pkId == item.pkProductSku) {
arr1.push(ctem.pkId)
arr2.push(ctem.specsName)
}
})
})
this.selSkuList = arr1.join(',')
this.selSkuNameList = arr2.join(',')
},
handleClose() {
this.selectData = []
this.dialogVisible = false
},
handleCloseGg() {
this.ggVisible = false
},
getProduct(cndex, index) {
this.showCndex = cndex
this.showIndex = index
this.getDataList()
this.dialogVisible = true
},
addProduct(cndex, sndex) {
this.allData.forEach((item) => {
item.acDeclarationConfigParam[cndex].acDeclarationProductParamList.push({
pkProduct: '',
productName: '',
specsName: '',
specsNameId: '',
quantity: ''
})
})
},
reduceProduct(cndex, sndex) {
this.allData.forEach((item) => {
if (this.isArea == item.orderType) {
item.acDeclarationConfigParam[cndex].acDeclarationProductParamList.splice(sndex, 1)
}
})
},
addNewGoods() {
this.allData.forEach((item) => {
item.acDeclarationConfigParam.push({
registerAuthority: '',
specifyLevel: '',
acDeclarationProductParamList: [
{
pkProduct: '',
productName: '',
specsName: '',
specsNameId: '',
quantity: ''
}
]
})
})
},
reduceRow(index) {
this.allData.forEach((item) => {
item.acDeclarationConfigParam.splice(index, 1)
})
},
selSku(pkId, index) {
this.selIndex = index
api
.getProductSpecs({
pkProduct: pkId
})
.then((res) => {
const arr1 = []
const arr2 = []
res.data.forEach((item) => {
item.pkProductSku = item.specsList[0].pkId
arr1.push(item.specsList[0].pkId)
arr2.push(item.specsList[0].specsName)
})
this.selSkuList = arr1.join(',')
this.selSkuNameList = arr2.join(',')
this.skuList = res.data
this.ggVisible = true
})
},
getDataList() {
api
.getProductAll(Object.assign({ isPutOn: 0 }, this.queryParams, this.select, { isExistSpecs: 1 }))
.then((res) => {
res.rows.forEach((item) => {
item.quantity = 1
})
this.dialogList = res.rows
this.total = res.total
})
},
onSelectAll() {
this.$refs.multipleTable.clearSelection()
},
selected(selection, row) {
//
this.$refs.multipleTable.clearSelection()
//
//
console.log(selection, row)
if (selection.length == 0) return
this.$refs.multipleTable.toggleRowSelection(row, true)
this.selectData = row
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
return 'warning-row'
} else if (rowIndex % 2 == 0) {
return 'success-row'
}
return ''
}
}
}
</script>
<style lang="scss" scoped>
// .page {
// padding: 20px;
// background: #f9f9f9;
// font-size: 14px;
.main_a {
// height: calc(100vh - 124px);
// display: flex;
// flex-direction: column;
// height: calc(100vh - 164px);
// height: 100%;
}
.main {
background: #ffffff;
border-radius: 8px;
height: calc(100vh - 164px);
padding-bottom: 20px;
box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
}
::v-deep .el-select {
width: 100%;
}
// }
.footer {
height: 68px;
background: #ffffff;
box-shadow: 0px -3px 20px 0px rgba(204, 204, 204, 0.5);
// margin: 0 20px;
display: flex;
justify-content: center;
align-items: center;
.thebtn1 {
background: #3181e5;
color: #ffffff;
padding: 9px 45px;
}
.thebtn2 {
background: #cccccc;
color: #ffffff;
padding: 9px 45px;
}
}
.tit {
font-size: 14px;
font-weight: bold;
color: #333333;
padding: 0 20px;
border-left: 5px solid #c8161d;
margin: 20px 0 10px 0;
}
.xian {
height: 1px;
background: rgba(0, 0, 0, 0.1);
}
.demo-ruleForm {
padding: 20px 0;
}
::v-deep .el-date-editor--datetimerange {
width: auto !important;
}
.flexed {
display: flex;
}
.flexed_l {
margin-right: 20px;
}
.table {
padding: 0 20px;
margin-top: 1px;
}
table {
width: 100%;
background: #fff;
border-collapse: collapse;
border: 1px solid #cccccc;
border-spacing: 0;
table-layout: fixed;
border-collapse: collapse;
//
// (2*/
}
.table_b {
border-top: 0;
}
th {
padding: 10px 10px;
text-align: center;
border: 1px solid #cccccc;
overflow: hidden;
border-top: 0;
}
td {
padding: 10px 10px;
text-align: center;
border: 1px solid #cccccc;
border-top: 0;
overflow: hidden;
}
.tableFlex {
display: flex;
align-items: center;
margin-bottom: 10px;
.tableFlex_i {
flex: 1;
::v-deep .el-input__inner {
width: 90%;
}
}
}
.tableAdd {
width: 50px;
img {
width: 19px;
height: 19px;
}
}
.tableAddPro {
display: flex;
align-items: center;
justify-content: center;
img {
width: 19px;
height: 19px;
margin-left: 10px;
}
}
.tableLeft {
text-align: left;
}
.tabList {
display: flex;
align-items: center;
padding: 20px 0px 0 20px;
.tabList_i {
padding: 10px;
font-size: 14px;
font-weight: 400;
color: #999999;
cursor: pointer;
}
.tabAct {
background: #108ee9;
color: #fff;
}
}
.clearBtm {
border-bottom: 0;
}
.cpHeight {
height: 50vh;
overflow-y: auto;
}
.blueCor {
color: #589ff8;
cursor: pointer;
}
::v-deep .el-input__icon{
line-height: 33px;
}
::v-deep .el-button{
margin-top: 0;
}
</style>

View File

@ -0,0 +1,378 @@
<template>
<div class="page">
<div class="topbox">
<div
v-for="(item, index) in topList"
:key="index"
class="levelList_i"
:class="tabActive == item.id ? 'act' : ''"
@click.prevent="handleLink(item.id)"
>
{{ item.name }}
</div>
</div>
<div class="main">
<div v-show="tabActive == 0">
<div class="tit">基本信息</div>
<div class="xian" />
<el-form
ref="ruleForm"
:model="ruleForm"
:rules="rules"
label-width="auto"
class="demo-ruleForm"
>
<el-row>
<el-col :span="8">
<el-form-item :label="'活动名称'" prop="actName">
<el-input
v-model="ruleForm.actName"
clearable
:disabled="lookOver"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="16">
<el-form-item :label="'活动说明'" prop="actExplain">
<editor
ref="sptwEditor"
v-model="ruleForm.actExplain"
:read-only="lookOver"
:min-height="196"
:upload-url="uploadImgUrl"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item :label="'活动封面'" prop="actCover">
<imageUpload v-model="ruleForm.actCover" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item :label="'活动时间'" prop="ruleFormTime">
<el-date-picker
v-model="ruleForm.ruleFormTime"
:disabled="lookOver"
value-format="yyyy-MM-dd"
type="daterange"
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
@change="changeTime"
/>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item :label="'展示时间'" prop="ruleFormTime1">
<el-date-picker
v-model="ruleForm.ruleFormTime1"
:disabled="lookOver"
value-format="yyyy-MM-dd"
type="daterange"
:range-separator="'至'"
:start-placeholder="'开始日期'"
:end-placeholder="'结束日期'"
@change="changeTime1"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<UpdateInfo v-show="tabActive == 2" ref="updateInfo" />
</div>
<div v-show="controlType != 4" class="footer">
<el-button size="small" class="cancelBtn" @click="$router.back()">
{{ '取消' }}</el-button>
<el-button size="small" class="sureBtn" @click="submit('ruleForm')">
{{ '确认' }}</el-button>
</div>
<!-- </div> -->
</div>
</template>
<script>
import Editor from '@/components/Editor'
import * as api from '@/api/giftGoods.js'
import ImageUpload from '@/components/ImageUpload'
import UpdateInfo from '@/views/marketing/declarationActivity/update'
import { updateDeclarationActivityList, addDeclarationActivityList, getDeclarationActivityDetail } from '@/api/activity.js'
export default {
name: 'AddDirectPushUpgrade',
components: {
ImageUpload,
UpdateInfo,
Editor
},
data() {
return {
tabActive: 0,
topList: [
{
name: '基本信息',
id: 0
},
{
name: '报单赠送',
id: 2
}
],
uploadImgUrl: process.env.VUE_APP_BASE_API + '/system/upload',
ruleForm: {
ruleFormTime: [],
ruleFormTime1: [],
actName: '',
actExplain: '',
actCover: ''
},
rules: {
actName: [
{ required: true, message: '请输入活动名称', trigger: 'blur' }
],
actExplain: [
{ required: true, message: '请输入活动说明', trigger: 'blur' }
],
actCover: [
{ required: true, message: '请上传活动封面', trigger: 'change' }
],
ruleFormTime: [
{ required: true, message: '请选择活动时间', trigger: 'change' }
],
ruleFormTime1: [
{ required: true, message: '请选择展示时间', trigger: 'change' }
]
},
lookOver: false,
gradeList: [],
awardsList: [],
registList: [],
pkId: '',
repurchaseCouponsShowList: [],
controlType: '',
addData: {}
}
},
mounted() {
this.getData()
// 1=,2=,3=4
if (
this.$route.query.controlType == 4 ||
this.$route.query.controlType == 3
) {
this.lookOver = true
} else {
this.lookOver = false
}
this.controlType = this.$route.query.controlType
this.pkId = this.$route.query.pkId || ''
if (this.pkId) {
this.getDetails()
}
},
methods: {
splitDate(date) {
return date.split(' ')[0]
},
getDetails() {
getDeclarationActivityDetail({
pkId: this.pkId
})
.then((res) => {
this.addData = res.data
this.$set(this.ruleForm, 'actName', res.data.actName)
this.$set(
this.ruleForm,
'actExplain',
res.data.actExplain
)
this.$set(this.ruleForm, 'actCover', res.data.actCover)
this.ruleForm.pkId = res.data.pkId
this.ruleForm.actStartDate = res.data.actStartDate
this.ruleForm.actEndDate = res.data.actEndDate
this.ruleForm.disStartDate = res.data.disStartDate
this.ruleForm.disEndDate = res.data.disEndDate
const actStartDate = this.splitDate(res.data.actStartDate)
const actEndDate = this.splitDate(res.data.actEndDate)
const disStartDate = this.splitDate(res.data.disStartDate)
const disEndDate = this.splitDate(res.data.disEndDate)
this.$set(this.ruleForm, 'ruleFormTime', [
actStartDate,
actEndDate
])
this.$set(this.ruleForm, 'ruleFormTime1', [
disStartDate,
disEndDate
])
this.$refs.updateInfo.initData(
this.addData.acDeclarationConfigParams || []
)
})
},
// tab
handleLink(id) {
this.tabActive = id
},
//
changeTime(val) {
this.ruleForm.actStartDate = val[0]
this.ruleForm.actEndDate = val[1]
},
changeTime1(val) {
this.ruleForm.disStartDate = val[0]
this.ruleForm.disEndDate = val[1]
},
getData() {
api.awardsList().then((res) => {
this.awardsList = res.rows
})
api.gradeList().then((res) => {
this.gradeList = res.rows
})
api.registerPowerState().then((res) => {
this.registList = res.data
})
},
submit() {
this.$refs['ruleForm'].validate((valid) => {
if (valid) {
const obj = Object.assign(
{},
{
controlType: this.controlType,
activityParam: {
...this.ruleForm,
actStartDate: this.ruleForm.actStartDate + ' 00:00:00',
actEndDate: this.ruleForm.actEndDate + ' 23:59:59',
disStartDate: this.ruleForm.disStartDate + ' 00:00:00',
disEndDate: this.ruleForm.disEndDate + ' 23:59:59'
},
acDeclarationConfigParams:
this.$refs.updateInfo.getAllData()
// authorityList: this.$refs.updateInfo.form.waresAuthorityList
}
)
const api = this.controlType === 1 ? addDeclarationActivityList : updateDeclarationActivityList
api(obj).then((res) => {
if (res.code === 200) {
this.$message({
message: res.msg || '操作成功',
type: 'success'
})
this.$router.back()
}
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.page {
padding: 20px;
background: #f9f9f9;
font-size: 14px;
.main_a {
height: calc(100vh - 144px);
display: flex;
flex-direction: column;
}
.main {
background: #ffffff;
border-radius: 8px;
// height: calc(100vh - 124px);
box-shadow: 0px 2px 20px 0px rgba(238, 238, 238, 0.5);
}
::v-deep .el-select {
width: 100%;
}
}
.footer {
height: 68px;
background: #ffffff;
box-shadow: 0px -3px 20px 0px rgba(204, 204, 204, 0.5);
// margin: 0 20px;
display: flex;
justify-content: center;
align-items: center;
.thebtn1 {
background: #3181e5;
color: #ffffff;
padding: 9px 45px;
}
.thebtn2 {
background: #cccccc;
color: #ffffff;
padding: 9px 45px;
}
}
.tit {
font-size: 14px;
font-weight: bold;
color: #333333;
padding: 0 20px;
border-left: 5px solid #c8161d;
margin: 20px 0 10px 0;
}
.xian {
height: 1px;
background: rgba(0, 0, 0, 0.1);
}
.demo-ruleForm {
padding: 20px 0;
}
::v-deep .el-date-editor--datetimerange {
width: auto !important;
}
.flexed {
display: flex;
}
.flexed_l {
margin-right: 20px;
}
.topbox {
align-items: center;
padding: 0px 0 15px 0;
display: flex;
// background: skyblue;
.levelList_i {
margin-left: 20px;
position: relative;
cursor: pointer;
padding: 0 5px;
width: 88px;
height: 34px;
border-radius: 17px;
border: 1px solid #cccccc;
font-size: 14px;
font-family: MicrosoftYaHei;
text-align: center;
line-height: 32px;
}
.act {
color: #ffffff;
background: #c8161d;
}
}
::v-deep .el-form-item {
margin-bottom: 20px !important;
}
</style>

View File

@ -324,7 +324,7 @@ export default {
getDataList() {
this.loading = true
api
.upgradeList(
.getActivityList(
Object.assign({}, this.queryParams, this.select, { actType: 31 })
)
.then((res) => {