Explorar o código

活动扫码入场功能

zhangqiOMG %!s(int64=3) %!d(string=hai) anos
pai
achega
2b17e57b3b

+ 11 - 0
src/components/layout/aside.vue

@@ -70,6 +70,17 @@
       <i class="el-icon-document"></i>
       <span slot="title">热门商品</span>
     </el-menu-item>
+    <el-submenu index="3">
+      <template slot="title">
+        <i class="el-icon-full-screen"></i>
+        <span>入场管理</span>
+      </template>
+      <el-menu-item-group>
+        <el-menu-item index="device-management">设备管理</el-menu-item>
+        <el-menu-item index="visitor-management">访客登记查询</el-menu-item>
+        <el-menu-item index="actDataAnalysis">访客入场信息</el-menu-item>
+      </el-menu-item-group>
+    </el-submenu>
   </el-menu>
 </template>
 <script>

+ 14 - 0
src/router/index.js

@@ -172,6 +172,20 @@ const routes = [
         title: '热门商品'
       },
       component: resolve => require(['@/views/hotProd/list'], resolve)
+    },{
+      path: '/device-management',
+      name: 'device-management',
+      meta: {
+        title: '设备管理'
+      },
+      component: resolve => require(['@/views/adminisson/device-management/list'], resolve)
+    },{
+      path: '/visitor-management',
+      name: 'visitor-management',
+      meta: {
+        title: '访客登记查询'
+      },
+      component: resolve => require(['@/views/adminisson/visitor-management/list'], resolve)
     }]
     
     

+ 130 - 0
src/views/adminisson/all-visitor/list.vue

@@ -0,0 +1,130 @@
+<template>
+<div>
+  <search @onSearch="onSearch">
+  </search>
+  <div class="container">
+    <el-table
+      :data="list"
+      border
+      size="mini"
+      stripe
+      height="calc(100vh - 288px)"
+      style="width: 100%;">
+      <el-table-column
+        prop="createdate"
+        label="登记时间">
+      </el-table-column>
+      <el-table-column
+        prop="flocation"
+        label="入口">
+      </el-table-column>
+      <el-table-column
+        prop="fecid"
+        label="设备码">
+      </el-table-column>
+      <el-table-column
+        prop="fidcard"
+        label="身份证号">
+      </el-table-column>
+      <el-table-column
+        prop="fname"
+        label="姓名">
+      </el-table-column>
+      <el-table-column
+        prop="fphonenumber"
+        label="联系电话">
+      </el-table-column>
+      <el-table-column
+        prop="faddress"
+        label="地址">
+      </el-table-column>
+      <el-table-column
+        prop="findustry"
+        label="行业">
+      </el-table-column>
+      <el-table-column
+        prop="frole"
+        label="职位">
+      </el-table-column>
+      <el-table-column
+        prop="fchannel"
+        label="入会渠道">
+      </el-table-column>
+    </el-table>
+    <div style="margin:20px 0">
+      <el-pagination
+        background
+        small
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-size="param.content.pageSize"
+        layout="total, prev, pager, next, jumper"
+        :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</div>
+  
+</template>
+
+<script>
+
+import search from './modules/operation.vue'
+import details from './modules/details.vue'
+
+export default {
+  components:{
+    search,
+    details
+  },
+  data () {
+    return {
+      param:{
+        "classname": "enterprise.activity.activitysignup",
+        "method": "getvisitmsglist",
+        "content": {
+            "tactivityid": 1,
+            "pageSize": 20, 
+            "pageNumber":1
+        }
+      },
+      total:0,
+      list:[],
+      currentPage:0
+    }
+  },
+  methods:{
+    listData () {
+      this.$api.requested(this.param).then(res => {
+        console.log(res)
+        this.list = res.data
+        this.total = res.total
+        this.currentPage = res.pageNumber
+      });
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    // 搜索数据
+    onSearch (val) {
+      this.param.content.pageNumber = 1
+      this.param.content.where.condition = val
+      this.listData()
+    }
+  },
+  mounted () {
+    this.listData()
+  }
+}
+
+</script>
+<style scope>
+</style>

+ 118 - 0
src/views/adminisson/device-management/list.vue

@@ -0,0 +1,118 @@
+<template>
+  <div>
+    <search @onSearch="onSearch">
+      <div slot="content">
+        <add @onSuccess="listData"></add>
+      </div>
+    </search>
+    <div class="container">
+      <el-table
+        :data="list"
+        style="width: 100%">
+        <el-table-column
+          prop="fecid"
+          label="设备识别码">
+        </el-table-column>
+        <el-table-column
+          prop="flocation"
+          label="设备位置">
+        </el-table-column>
+        <el-table-column
+          prop="ftitle"
+          label="所属活动">
+        </el-table-column>
+        <el-table-column
+          prop="fnotes"
+          label="备注">
+        </el-table-column>
+        <el-table-column
+          label="操作"
+          width="180">
+          <template slot-scope="scope">
+            <edit :row="scope.row" @onSuccess="listData"></edit>
+            <el-divider direction="vertical"></el-divider>
+            <delete-row :row="scope.row" @onDelete="listData"></delete-row>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div style="margin:20px 0">
+        <el-pagination
+          background
+          small
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page="currentPage"
+          :page-size="param.content.pageSize"
+          layout="total, prev, pager, next, jumper"
+          :total="total">
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import add from './modules/add.vue'
+import edit from './modules/edit.vue'
+import deleteRow from './modules/delete.vue'
+import search from './modules/operation.vue'
+
+export default {
+  components:{
+    add,
+    edit,
+    deleteRow,
+    search
+  },
+  data () {
+    return {
+      param:{
+        "classname": "enterprise.activity.scanning",
+        "method": "query_scanninglist",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 20, 
+          "where": {
+            "condition": ""
+          }
+        }
+      },
+      total:0,
+      list:[],
+      currentPage:0
+    }
+  },
+  methods:{
+    listData () {
+      this.$api.requested(this.param).then(res => {
+        console.log(res)
+        this.list = res.data
+        this.total = res.total
+        this.currentPage = res.pageNumber
+      });
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    // 搜索数据
+    onSearch (val) {
+      this.param.content.pageNumber = 1
+      this.param.content.where.condition = val
+      this.listData()
+    },
+  },
+  mounted () {
+    this.listData()
+  }
+}
+
+</script>
+<style>
+</style>

+ 107 - 0
src/views/adminisson/device-management/modules/add.vue

@@ -0,0 +1,107 @@
+<template>
+  <div>
+     <el-button type="primary" size="small" icon="el-icon-plus" @click="dialogFormVisible = true">添加设备</el-button>
+     <el-dialog title="添加" :visible.sync="dialogFormVisible" width="600px">
+      <el-form label-width="100px" :model="form" ref="ruleForm" label-position	="left">
+        <el-form-item label="设备码" prop="fecid">
+          <el-input size="small" v-model="form.fecid" autocomplete="off" placeholder="设备码" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="入口" prop="flocation">
+          <el-input size="small" v-model="form.flocation" type="text" autocomplete="off" placeholder="入口" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="设备备注" prop="fnotes">
+          <el-input size="small" v-model="form.fnotes" type="text" autocomplete="off" placeholder="设备备注" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="所属活动" prop="tactivityid">
+          <el-select size="small" v-model="form.tactivityid" style="width:100%">
+            <el-option v-for="item in list" :key="item.index" :value="item.tactivityid" :label="item.ftitle"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false" size="small">取 消</el-button>
+        <el-button type="primary" @click="add('ruleForm')" size="small">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  data () {
+    return {
+      input:'',
+      dialogFormVisible:false,
+      form:{
+      },
+      list:[]
+    }
+  },
+  methods:{
+    add () {
+      this.$api.requested({
+        "classname": "enterprise.activity.scanning",
+        "method": "insertormodify_scanning",
+        "content":this.form
+      }).then(res=>{
+        if (res.code === 1) {
+          this.dialogFormVisible = false
+          this.$notify({
+            title: '成功',
+            message: '新增成功',
+            type: 'success'
+          })
+          this.form = {}
+          this.$emit('onSuccess')
+        } else {
+          this.$notify({
+          title: '失败',
+            message: res.data,
+            type: 'error'
+          });
+        }
+      })
+    },
+    activitylistData () {
+      this.$api.requested({
+        "classname": "enterprise.activity.activity",
+        "method": "query_activityList",
+        "content": {
+            "getdatafromdbanyway": true,
+            "pageNumber": 1,
+            "pageSize": 100, 
+            "where": {
+                "condition": ""
+            }
+        }
+        }).then(res => {
+        this.list = res.data
+      });
+    },
+  },
+  mounted () {
+    this.activitylistData()
+  }
+}
+
+</script>
+<style>
+input[type=number] {
+    -moz-appearance:textfield;
+}
+input[type=number]::-webkit-inner-spin-button,
+input[type=number]::-webkit-outer-spin-button {
+    -webkit-appearance: none;
+    margin: 0;
+}
+</style>
+<style scoped>
+/* .flex{
+  display: flex;
+  align-items: center;
+  margin: 0 0 10px 0;
+  padding: 15px 20px;
+  background: #fff;
+} */
+
+</style>

+ 44 - 0
src/views/adminisson/device-management/modules/delete.vue

@@ -0,0 +1,44 @@
+<template>
+  <div style="display:inline;">
+    <el-popconfirm
+      confirm-button-text='确定'
+      cancel-button-text='不用了'
+      icon="el-icon-info"
+      icon-color="red"
+      title="确定删除该条数据吗?"
+      @confirm="deleteRow">
+      <el-button slot="reference" type="text" size="mini">删 除</el-button>
+    </el-popconfirm>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['row'],
+  methods: {
+    deleteRow () {
+      this.$api.requested({
+        "classname": "enterprise.activity.scanning",
+        "method": "delete_scanning",
+        "content": {
+            "fecid": this.row.fecid
+        }
+      }).then(res=>{
+        res.code === 1?this.$notify({
+          title: '成功',
+          message: '数据已删除',
+          type: 'success'
+        }):this.$notify({
+          title: '失败',
+          message: res.data,
+          type: 'error'
+        });
+        res.code === 1?this.$emit('onDelete'):''
+      })
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 112 - 0
src/views/adminisson/device-management/modules/edit.vue

@@ -0,0 +1,112 @@
+<template>
+  <div style="display:inline">
+     <el-button type="text" size="small" @click="showDialog">编辑</el-button>
+     <el-dialog title="添加" :visible.sync="dialogFormVisible" width="600px">
+      <el-form label-width="100px" :model="form" ref="ruleForm" label-position	="left">
+        <el-form-item label="设备码" prop="fecid">
+          <el-input size="small" v-model="form.fecid" autocomplete="off" placeholder="设备码" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="入口" prop="flocation">
+          <el-input size="small" v-model="form.flocation" type="text" autocomplete="off" placeholder="入口" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="设备备注" prop="fnotes">
+          <el-input size="small" v-model="form.fnotes" type="text" autocomplete="off" placeholder="设备备注" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="所属活动" prop="tactivityid">
+          <el-select size="small" v-model="form.tactivityid" style="width:100%">
+            <el-option v-for="item in list" :key="item.index" :value="item.tactivityid" :label="item.ftitle"></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="dialogFormVisible = false" size="small">取 消</el-button>
+        <el-button type="primary" @click="add('ruleForm')" size="small">确 定</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['row'],
+  data () {
+    return {
+      input:'',
+      dialogFormVisible:false,
+      form:{
+      },
+      list:[]
+    }
+  },
+  methods:{
+    showDialog () {
+      this.dialogFormVisible = true
+      this.form = Object.assign({},this.form,this.row)
+    },
+    add () {
+      this.$api.requested({
+        "classname": "enterprise.activity.scanning",
+        "method": "insertormodify_scanning",
+        "content":this.form
+      }).then(res=>{
+        if (res.code === 1) {
+          this.dialogFormVisible = false
+          this.$notify({
+            title: '成功',
+            message: '修改成功',
+            type: 'success'
+          })
+          this.form = {}
+          this.$emit('onSuccess')
+        } else {
+          this.$notify({
+          title: '失败',
+            message: res.data,
+            type: 'error'
+          });
+        }
+      })
+    },
+    activitylistData () {
+      this.$api.requested({
+        "classname": "enterprise.activity.activity",
+        "method": "query_activityList",
+        "content": {
+            "getdatafromdbanyway": true,
+            "pageNumber": 1,
+            "pageSize": 100, 
+            "where": {
+                "condition": ""
+            }
+        }
+        }).then(res => {
+        this.list = res.data
+      });
+    },
+  },
+  mounted () {
+    this.activitylistData()
+  }
+}
+
+</script>
+<style>
+input[type=number] {
+    -moz-appearance:textfield;
+}
+input[type=number]::-webkit-inner-spin-button,
+input[type=number]::-webkit-outer-spin-button {
+    -webkit-appearance: none;
+    margin: 0;
+}
+</style>
+<style scoped>
+.flex{
+  display: flex;
+  align-items: center;
+  margin: 0 0 10px 0;
+  padding: 15px 20px;
+  background: #fff;
+}
+
+</style>

+ 37 - 0
src/views/adminisson/device-management/modules/operation.vue

@@ -0,0 +1,37 @@
+<template>
+  <div class="flex">
+     <el-input style="width:250px" placeholder="请输入查询内容" v-model="input" size="small" clearable @clear="onSearch"></el-input>
+     <el-button type="primary" size="small" style="margin:0 10px" @click="onSearch">查询</el-button>
+     <div>
+       <slot name="content"></slot>
+     </div>
+  </div>
+</template>
+
+<script>
+export default {
+
+  data () {
+    return {
+      input:''
+    }
+  },
+  methods:{
+    onSearch () {
+      this.$emit('onSearch',this.input)
+    }
+  }
+}
+
+</script>
+<style>
+</style>
+<style scoped>
+.flex{
+  display: flex;
+  align-items: center;
+  margin: 0 0 10px 0;
+  padding: 15px 20px;
+  background: #fff;
+}
+</style>

+ 139 - 0
src/views/adminisson/visitor-management/list.vue

@@ -0,0 +1,139 @@
+<template>
+<div>
+  <search @onSearch="onSearch">
+  </search>
+  <div class="container">
+    <el-table
+      :data="list"
+      border
+      size="mini"
+      stripe
+      height="calc(100vh - 288px)"
+      style="width: 100%;">
+      <el-table-column
+        prop="createdate"
+        label="登记时间">
+      </el-table-column>
+      <el-table-column
+        prop="fidcard"
+        label="身份证号">
+      </el-table-column>
+      <el-table-column
+        prop="fname"
+        label="姓名">
+      </el-table-column>
+      <el-table-column
+        prop="fphonenumber"
+        label="联系电话">
+      </el-table-column>
+      <el-table-column
+        prop="faddress"
+        label="地址">
+      </el-table-column>
+      <el-table-column
+        prop="fcompname"
+        label="公司">
+      </el-table-column>
+      <el-table-column
+        prop="findustry"
+        label="行业">
+      </el-table-column>
+      <el-table-column
+        prop="frole"
+        label="职位">
+      </el-table-column>
+      <el-table-column
+        prop="visittimes"
+        label="登记次数">
+      </el-table-column>
+      <el-table-column
+        prop="fchannel"
+        label="入会渠道">
+      </el-table-column>
+      <el-table-column
+        label="操作"
+        width="180">
+        <template slot-scope="scope">
+          <details :row="scope.row"></details>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div style="margin:20px 0">
+      <el-pagination
+        background
+        small
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+        :current-page="currentPage"
+        :page-size="param.content.pageSize"
+        layout="total, prev, pager, next, jumper"
+        :total="total">
+      </el-pagination>
+    </div>
+  </div>
+</div>
+  
+</template>
+
+<script>
+
+import search from './modules/operation.vue'
+import details from './modules/details.vue'
+
+export default {
+  components:{
+    search,
+    details
+  },
+  data () {
+    return {
+      param:{
+        "classname": "enterprise.activity.activitysignup",
+        "method": "getsignupmsglist",
+        "content": {
+          "pageNumber": 1,
+          "pageSize": 20, 
+          "where": {
+              "condition": ""
+            }
+        }
+      },
+      total:0,
+      list:[],
+      currentPage:0
+    }
+  },
+  methods:{
+    listData () {
+      this.$api.requested(this.param).then(res => {
+        console.log(res)
+        this.list = res.data
+        this.total = res.total
+        this.currentPage = res.pageNumber
+      });
+    },
+    handleSizeChange(val) {
+      // console.log(`每页 ${val} 条`);
+      this.param.content.pageSize = val
+      this.listData()
+    },
+    handleCurrentChange(val) {
+      // console.log(`当前页: ${val}`);
+      this.param.content.pageNumber = val
+      this.listData()
+    },
+    // 搜索数据
+    onSearch (val) {
+      this.param.content.pageNumber = 1
+      this.param.content.where.condition = val
+      this.listData()
+    }
+  },
+  mounted () {
+    this.listData()
+  }
+}
+
+</script>
+<style scope>
+</style>

+ 25 - 0
src/views/adminisson/visitor-management/modules/details.vue

@@ -0,0 +1,25 @@
+<template>
+  <div>
+    <el-button type="text" size="small" @click="dialogTableVisible = true">登记记录</el-button>
+    <el-dialog title="登记记录" :visible.sync="dialogTableVisible">
+      <el-table size="small" :data="row.visitmsg">
+        <el-table-column property="createdate" label="登记时间"></el-table-column>
+        <el-table-column property="flocation" label="入口"></el-table-column>
+      </el-table>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+export default {
+  props:['row'],
+  data () {
+    return {
+      dialogTableVisible:false
+    }
+  }
+}
+
+</script>
+<style>
+</style>

+ 37 - 0
src/views/adminisson/visitor-management/modules/operation.vue

@@ -0,0 +1,37 @@
+<template>
+  <div class="flex">
+     <el-input style="width:250px" placeholder="请输入查询内容" v-model="input" size="small" clearable @clear="onSearch"></el-input>
+     <el-button type="primary" size="small" style="margin-left:10px" @click="onSearch">查询</el-button>
+     <div>
+       <slot name="content"></slot>
+     </div>
+  </div>
+</template>
+
+<script>
+export default {
+
+  data () {
+    return {
+      input:''
+    }
+  },
+  methods:{
+    onSearch () {
+      this.$emit('onSearch',this.input)
+    }
+  }
+}
+
+</script>
+<style>
+</style>
+<style scoped>
+.flex{
+  display: flex;
+  align-items: center;
+  margin: 0 0 10px 0;
+  padding: 15px 20px;
+  background: #fff;
+}
+</style>