liuxiaona 2 年 前
コミット
79be4a57c9

+ 110 - 0
project/src/components/channelCode/codeIndex.vue

@@ -0,0 +1,110 @@
1
+<template>
2
+  <div class="con">
3
+    <div class="searchBox">
4
+      <el-button type="primary" size="mini" @click="createdchannel_code">新建渠道活码</el-button>
5
+      <self-input label_name="搜索渠道" @inputChange='(val)=>{channel_val = val;initFlag=!initFlag}'></self-input>
6
+      <self-input label_name="客服" @inputChange='(val)=>{customer_val = val;initFlag=!initFlag}'></self-input>
7
+      <div class="reset" @click="resetEvent">重置</div>
8
+    </div>
9
+    <div class="mainBox">
10
+      <div class="groupBox">
11
+        <groupList></groupList>
12
+      </div>
13
+      <div class="tableBox">
14
+        <publicTable
15
+          :propsData="{
16
+            desCol:desCol,
17
+            source:'codeIndex',
18
+            initFlag:initFlag,
19
+            channel_val:channel_val,
20
+            customer_val:customer_val
21
+          }"
22
+          ></publicTable>
23
+      </div>
24
+    </div>
25
+  </div>
26
+</template>
27
+
28
+<script>
29
+import selfInput from '@/components/assembly/screen/input.vue'
30
+import publicTable from './publicTable.vue'
31
+import groupList from './groupList.vue'
32
+export default {
33
+  name: "codeIndex",
34
+  components:{
35
+    publicTable,
36
+    selfInput,
37
+    groupList
38
+  },
39
+  data() {
40
+    return {
41
+      initFlag:false,
42
+      channel_val:'',
43
+      customer_val:'',
44
+      desCol:[
45
+        { prop: "name", label: "渠道名称" },
46
+        { prop: "assign_count", label: "创建人" },
47
+        { prop: "waiting_add_count", label: "分组" },
48
+        { prop: "passed_count", label: "扫码总人数",}
49
+      ],
50
+    }
51
+  },
52
+  methods:{
53
+    resetEvent () {//重置
54
+      this.initFlag = !this.initFlag
55
+      this.channel_val = ''
56
+      this.customer_val = ''
57
+    },
58
+    createdchannel_code(){//新建渠道活码
59
+
60
+    }
61
+  }
62
+}
63
+</script>
64
+
65
+<style lang="scss" scoped>
66
+.con{
67
+  padding-right: 10px;
68
+  .searchBox{
69
+    display: flex;
70
+    align-items: center;
71
+    background-color: #fff;
72
+    padding: 5px 10px ;
73
+    position: relative;
74
+    .reset {
75
+      width: 80px;
76
+      height: 30px;
77
+      background: #00b38a;
78
+      border-radius: 100px 3px 3px 3px;
79
+      border: 1px solid #d2d2d2;
80
+      color: #ffffff;
81
+      font-size: 14px;
82
+      line-height: 30px;
83
+      text-align: center;
84
+      position: absolute;
85
+      bottom: 0;
86
+      right: 0;
87
+      letter-spacing: 2px;
88
+      cursor: pointer;
89
+    }
90
+  }
91
+  .mainBox{
92
+    display: flex;
93
+    align-items: flex-start;
94
+    margin-top: 10px;
95
+    .groupBox{
96
+      width: 20%;
97
+      background-color: #fff;
98
+      flex-shrink: 0;
99
+      margin-right: 10px;
100
+      height: calc(100vh - 60px - 62px - 20px - 10px);
101
+    }
102
+    .tableBox{
103
+      flex: 1;
104
+      background-color: #fff;
105
+      height: calc(100vh - 60px - 62px - 20px - 10px);
106
+    }
107
+  }
108
+}
109
+
110
+</style>

+ 53 - 0
project/src/components/channelCode/dialogGroup.vue

@@ -0,0 +1,53 @@
1
+<template>
2
+  <el-dialog
3
+    :append-to-body="true"
4
+    custom-class="channel_code_group"
5
+    :title="propsData.dialogTitle+'分组'"
6
+    :visible.sync="dialogVisible"
7
+    width="30%">
8
+    <div class="dialogBox">
9
+      <div class="lable">分组名称</div>
10
+      <el-input
11
+        size="small"
12
+        placeholder="请输入内容"
13
+        maxlength="8"
14
+        v-model="groupName"
15
+        clearable>
16
+      </el-input>
17
+    </div>
18
+    <span slot="footer" class="dialog-footer">
19
+        <el-button size="mini" @click="dialogVisible=false">取 消</el-button>
20
+        <el-button size="mini" type="primary" @click="dialogVisible=false">确 定</el-button>
21
+      </span>
22
+  </el-dialog>
23
+</template>
24
+
25
+<script>
26
+export default {
27
+  name: "dialogGroup",
28
+  props:['propsData'],
29
+  data(){
30
+    return{
31
+      groupName:'',
32
+      dialogTitle:'',
33
+      dialogVisible:false,
34
+    }
35
+  }
36
+}
37
+</script>
38
+
39
+<style lang="scss">
40
+.channel_code_group{
41
+  .dialogBox{
42
+    display: flex;
43
+    align-items: center;
44
+    .lable{
45
+      font-weight: 600;
46
+      margin-right: 10px;
47
+      font-size: 14px;
48
+      flex-shrink: 0;
49
+    }
50
+  }
51
+}
52
+
53
+</style>

+ 144 - 0
project/src/components/channelCode/groupList.vue

@@ -0,0 +1,144 @@
1
+<template>
2
+  <div>
3
+    <div class="title">
4
+      <span class="fWeight600 c-000 f14">渠道分组</span>
5
+      <span class="addGroupBox" @click="$refs.dialogGroupRef.dialogVisible = true">
6
+        <i class="el-icon-plus f12"></i>
7
+        添加分组
8
+      </span>
9
+    </div>
10
+    <div class="listBox">
11
+      <div v-for="item in listArrs" :key="item.id" class="item_css"
12
+           @click="itemClick(item.id)"
13
+           :class="acIdx==item.id ? 'ac_css' : ''">
14
+        <i class="el-icon-folder"></i>
15
+        <span>{{item.name ? item.name : '-'}}</span>
16
+        <span class="lMarauto">
17
+<!--          <span class="c-ddd">{{item.nums||item.nums==0 ? item.nums : '-'}}</span>-->
18
+
19
+          <el-dropdown @command="handleCommand">
20
+            <span class="el-dropdown-link">
21
+              <i class="el-icon-more"></i>
22
+            </span>
23
+            <el-dropdown-menu slot="dropdown" >
24
+              <el-dropdown-item :command="'editName/'+item.id+'/'+item.name">修改名称</el-dropdown-item>
25
+              <el-dropdown-item :command="'deleGroup/'+item.id">删除分组</el-dropdown-item>
26
+              <el-dropdown-item :command="'moveUp/'+item.id">上移</el-dropdown-item>
27
+              <el-dropdown-item :command="'moveDown/'+item.id">下移</el-dropdown-item>
28
+              <el-dropdown-item :command="'placeTop/'+item.id">置顶</el-dropdown-item>
29
+              <el-dropdown-item :command="'placeBottom/'+item.id">置底</el-dropdown-item>
30
+            </el-dropdown-menu>
31
+          </el-dropdown>
32
+
33
+        </span>
34
+
35
+      </div>
36
+    </div>
37
+
38
+    <dialogGroup
39
+      ref="dialogGroupRef"
40
+      :propsData="{
41
+      dialogTitle:dialogTitle
42
+    }"></dialogGroup>
43
+  </div>
44
+</template>
45
+
46
+<script>
47
+import dialogGroup from './dialogGroup.vue'
48
+export default {
49
+  name: "groupList",
50
+  components:{
51
+    dialogGroup
52
+  },
53
+  data(){
54
+    return{
55
+      dialogTitle:'',
56
+      acIdx:0,
57
+      listArrs:[
58
+        {
59
+          id:0,
60
+          name:'全部',
61
+          nums:0
62
+        },
63
+        {
64
+          id:1,
65
+          name:'默认分组',
66
+          nums:0
67
+        },
68
+        {
69
+          id:2,
70
+          name:'自定义分组',
71
+          nums:0
72
+        }
73
+      ]
74
+
75
+    }
76
+  },
77
+  methods:{
78
+    handleCommand(command){
79
+      let eventName = command.split('/')[0]
80
+      let id = command.split('/')[1]
81
+      let name = command.split('/')[2]
82
+      if(eventName == 'editName'){
83
+        this.deleGroup(name)
84
+      }
85
+
86
+    },
87
+    deleGroup(name){//删除分组
88
+      this.$nextTick(()=>{
89
+        this.dialogTitle = '修改'
90
+        this.$refs.dialogGroupRef.groupName = name
91
+        this.$refs.dialogGroupRef.dialogVisible = true
92
+      })
93
+    },
94
+
95
+    itemClick(id){
96
+      this.acIdx = id
97
+    },
98
+    showMore(){
99
+
100
+    }
101
+  }
102
+}
103
+</script>
104
+
105
+<style lang="scss" scoped>
106
+.title{
107
+  padding: 10px;
108
+  display: flex;
109
+  align-items: center;
110
+  justify-content: space-between;
111
+  .addGroupBox{
112
+    color: #00b38a;
113
+    font-size: 13px;
114
+    cursor: pointer;
115
+
116
+  }
117
+}
118
+.listBox{
119
+  margin-top: 10px;
120
+  .item_css{
121
+    display: flex;
122
+    align-items: center;
123
+    padding: 15px 10px;
124
+    font-size: 14px;
125
+    cursor: pointer;
126
+    border-left: 2px solid transparent;
127
+    .el-icon-folder{
128
+      margin-right: 4px;
129
+      color: #00b38a;
130
+    }
131
+    .el-icon-more{
132
+      //transform:rotate(90deg);
133
+      font-size: 12px;
134
+      color: #999;
135
+      cursor: pointer;
136
+    }
137
+  }
138
+  .ac_css,.item_css:hover{
139
+    border-left: 2px solid #00b38a;
140
+    background-color: rgba(0,179,138,0.1);
141
+  }
142
+
143
+}
144
+</style>

+ 126 - 0
project/src/components/channelCode/publicTable.vue

@@ -0,0 +1,126 @@
1
+<template>
2
+  <div>
3
+  <!-- table -->
4
+    <el-table v-loading="loading" ref="multipleTable"
5
+              border
6
+              :height='height'
7
+              :data="tableData"
8
+              tooltip-effect="dark"
9
+              :header-cell-style="()=>{return { backgroundColor: '#f9f9f9 !important' }}"
10
+              style="width: 100%">
11
+      <template v-for="item in propsData.desCol">
12
+        <el-table-column :key="item.prop" :label="item.label" align="center"
13
+                         :show-overflow-tooltip="item.showOverTooltip"
14
+                         :min-width="item.min_width?item.min_width:120">
15
+          <template #header v-if="item.tooltip">
16
+            {{item.label?item.label:'-'}}
17
+            <el-tooltip class="disinblock" :content="item.tooltip" placement="top">
18
+              <i class="el-icon-question"></i>
19
+            </el-tooltip>
20
+          </template>
21
+          <template slot-scope="scope">
22
+            <div>{{scope.row[item.prop] ? scope.row[item.prop] : '-'}}</div>
23
+          </template>
24
+        </el-table-column>
25
+      </template>
26
+
27
+
28
+      <el-table-column label="操作" align="center" min-width="180px">
29
+        <template slot-scope="scope">
30
+          <template v-if="propsData.source=='codeIndex'">
31
+            <div class="flex">
32
+              <div class="c-00B38A pointer">禁用</div>
33
+              <div class="c-00B38A pointer lMar8">删除</div>
34
+              <div class="c-00B38A pointer lMar8">复制</div>
35
+              <div class="c-00B38A pointer lMar8">下载</div>
36
+              <div class="c-00B38A pointer lMar8">分析数据</div>
37
+            </div>
38
+          </template>
39
+        </template>
40
+      </el-table-column>
41
+    </el-table>
42
+    <div class="pagination" v-show="total>0">
43
+      <el-pagination background :current-page="page" @current-change="handleCurrentChange" layout="prev, pager, next" :page-count='Number(pages)'>
44
+      </el-pagination>
45
+    </div>
46
+  </div>
47
+</template>
48
+
49
+<script>
50
+export default {
51
+  name: "publicTable",
52
+  props:['propsData'],
53
+  data(){
54
+    return{
55
+      loading: false,
56
+      dataLoading: false,
57
+      page: 1,
58
+      pages: 0,
59
+      total: 0,
60
+      page_size: 20,
61
+      height: '',
62
+      tableData:[]
63
+    }
64
+  },
65
+  watch:{
66
+    'propsData.initFlag'(){
67
+      this.init(1)
68
+    }
69
+  },
70
+  created() {
71
+    this.height = document.documentElement.clientHeight - 300 > 400 ? document.documentElement.clientHeight - 300 : 400
72
+    this.init(1)
73
+  },
74
+  methods:{
75
+
76
+    init (page, type) {
77
+      if (type != 'export') {
78
+        this.page = page ? page : this.page;
79
+      } else {
80
+        if (this.total == 0) {
81
+          this.$message({
82
+            message: '暂无数据可导出',
83
+            type: "warning"
84
+          })
85
+          return
86
+        }
87
+      }
88
+      this.loading = true
89
+      this.$axios.get(this.URL.BASEURL + this.URL.batchAddCustomer_statistic, {
90
+        params:{
91
+          start_date: '2022-05-14',
92
+          end_date: '2022-06-13',
93
+          page: type == 'export' ? 1 : this.page,
94
+          pagesize: type == 'export' ? this.$store.state.exportNumber : this.page_size,
95
+        }
96
+      }).then((res) => {
97
+        var res = res.data
98
+        this.loading = false
99
+        if (res && res.errno == 0) {
100
+          if (type == 'export') {
101
+            this.exportEvent(res.rst.data)
102
+          } else {
103
+            this.tableData = res.rst.data
104
+            this.total = res.rst.pageInfo.total;
105
+            this.pages = res.rst.pageInfo.pages;
106
+          }
107
+        } else if (res.errno != 4002) {
108
+          this.$message({
109
+            message: res.err,
110
+            type: "warning"
111
+          })
112
+        }
113
+      }).catch((err) => {
114
+        this.loading = false
115
+      });
116
+    },
117
+    handleCurrentChange (val) {
118
+      this.init(val)
119
+    },
120
+  }
121
+}
122
+</script>
123
+
124
+<style lang="scss" scoped>
125
+
126
+</style>

+ 11 - 0
project/src/router/allRouter.js

@@ -34,6 +34,7 @@ const wxAccountList = () => import(/* webpackChunkName: 'wxAccountList' */ '@/co
34 34
 const thePublicTrend = () => import(/* webpackChunkName: 'thePublicTrend' */ '@/components/dataBoard/thePublicTrend.vue')
35 35
 const playletFansActTrend = () => import(/* webpackChunkName: 'playletFansActTrend' */ '@/components/dataBoard/playletFansActTrend.vue')
36 36
 const batchAddFriend = () => import(/* webpackChunkName: 'batchAddFriend' */ '@/components/marketingGuest/batchAddFriend/index.vue')
37
+const codeIndex = () => import(/* webpackChunkName: 'codeIndex' */ '@/components/channelCode/codeIndex.vue')
37 38
 const importRecord = () => import(/* webpackChunkName: 'importRecord' */ '@/components/marketingGuest/batchAddFriend/addFriend/importRecord.vue')
38 39
 const importRecordDetial = () => import(/* webpackChunkName: 'importRecordDetial' */ '@/components/marketingGuest/batchAddFriend/addFriend/importRecordDetial.vue')
39 40
 // const putOnwarning = () => import(/* webpackChunkName: 'putOnwarning' */ '@/components/dataBoard/putOnwarning/warningManage.vue')
@@ -99,6 +100,16 @@ export var allRouter = [
99 100
         }
100 101
       },
101 102
       {
103
+        path: 'codeIndex',
104
+        name: 'codeIndex',
105
+        component: codeIndex,
106
+        meta: {
107
+          keepAlive: false,
108
+          isLogin: true,
109
+          title: '渠道活码'
110
+        }
111
+      },
112
+      {
102 113
         path: 'importRecord',
103 114
         name: 'batchAddFriend',
104 115
         component: importRecord,