|
@@ -1,10 +1,11 @@
|
|
|
<template>
|
|
|
<div class="m-container">
|
|
|
<h2>
|
|
|
- <div class="squrt"></div>营销活动列表
|
|
|
+ <div class="squrt"></div>营销活动
|
|
|
</h2>
|
|
|
|
|
|
<div class="m-core">
|
|
|
+ <el-button type="primary" class='newBand' @click="() => { operationType = 'create'; marketVisible = true }">添加营销活动</el-button>
|
|
|
<save-form
|
|
|
ref="searchForm"
|
|
|
:inline="true"
|
|
@@ -21,15 +22,14 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="search">
|
|
|
<el-input
|
|
|
- v-model="searchForm.search"
|
|
|
+ v-model="searchForm.activityIds"
|
|
|
clearable
|
|
|
- placeholder="活动方案编号"
|
|
|
+ placeholder="关联活动方案"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button native-type="submit" type="primary">搜索</el-button>
|
|
|
<el-button native-type="reset" type="danger">重置</el-button>
|
|
|
- <!-- <el-button @click="marketVisible = true">新建</el-button> -->
|
|
|
</el-form-item>
|
|
|
</save-form>
|
|
|
|
|
@@ -38,7 +38,7 @@
|
|
|
:header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
:data="tableList"
|
|
|
>
|
|
|
- <el-table-column align="center" prop="id" label="营销活动编号">
|
|
|
+ <el-table-column align="center" prop="id" label="营销活动编号" width="200">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<copy-text>{{ scope.row.id }}</copy-text>
|
|
@@ -50,9 +50,9 @@
|
|
|
<copy-text>{{ scope.row.name }}</copy-text>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column align="center" prop="type" label="关联活动方案">
|
|
|
+ <el-table-column align="center" prop="activityIds" label="关联活动方案">
|
|
|
<template slot-scope="scope">
|
|
|
- {{ scope.row.type | songUseTypeFormat }}
|
|
|
+ {{ scope.row.activityIds }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -62,9 +62,7 @@
|
|
|
fixed="right"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-button
|
|
|
- type="text"
|
|
|
- >修改</el-button>
|
|
|
+ <el-button type="text" @click="onUpdate(scope.row)">修改</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -79,12 +77,14 @@
|
|
|
</div>
|
|
|
|
|
|
<el-dialog
|
|
|
- title="修改"
|
|
|
+ :title="(operationType == 'create' ? '添加' : '修改') + '营销活动'"
|
|
|
:visible.sync="marketVisible"
|
|
|
width="550px"
|
|
|
v-if="marketVisible"
|
|
|
>
|
|
|
<market-form
|
|
|
+ :marketId="marketId"
|
|
|
+ :operationType="operationType"
|
|
|
@submited="FetchList"
|
|
|
@close="marketVisible = false"
|
|
|
/>
|
|
@@ -96,6 +96,7 @@
|
|
|
import saveForm from "@/components/save-form";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import marketForm from './modals/market'
|
|
|
+import { marketActivityQueryPage } from './api'
|
|
|
export default {
|
|
|
components: {
|
|
|
saveForm,
|
|
@@ -104,9 +105,12 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ operationType: 'create',
|
|
|
marketVisible: false,
|
|
|
+ marketId: null,
|
|
|
searchForm: {
|
|
|
- search: null
|
|
|
+ search: null,
|
|
|
+ activityIds: null
|
|
|
},
|
|
|
rules: {
|
|
|
// 分页规则
|
|
@@ -118,16 +122,36 @@ export default {
|
|
|
tableList: [],
|
|
|
}
|
|
|
},
|
|
|
+ mounted() {
|
|
|
+ this.FetchList()
|
|
|
+ },
|
|
|
methods: {
|
|
|
search() {
|
|
|
-
|
|
|
+ this.rules.page = 1
|
|
|
+ this.FetchList()
|
|
|
},
|
|
|
onReSet() {
|
|
|
this.$refs.searchForm.resetFields();
|
|
|
+ this.rules.page = 1
|
|
|
this.FetchList();
|
|
|
},
|
|
|
- FetchList() {
|
|
|
-
|
|
|
+ async FetchList() {
|
|
|
+ try {
|
|
|
+ let res = await marketActivityQueryPage({
|
|
|
+ ...this.searchForm,
|
|
|
+ page: this.rules.page,
|
|
|
+ rows: this.rules.limit
|
|
|
+ })
|
|
|
+ this.tableList = res.data.rows || []
|
|
|
+ this.rules.total = res.data.total
|
|
|
+ } catch {
|
|
|
+ //
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onUpdate(row) {
|
|
|
+ this.marketId = row.id
|
|
|
+ this.operationType = 'update'
|
|
|
+ this.marketVisible = true
|
|
|
}
|
|
|
}
|
|
|
}
|