Vccc6 %!s(int64=4) %!d(string=hai) anos
pai
achega
5ef6b4bfe2

+ 1 - 1
.eslintrc.js

@@ -13,7 +13,7 @@ module.exports = {
     // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
     'plugin:vue/essential', 
     // https://github.com/standard/standard/blob/master/docs/RULES-en.md
-    'standard'
+    //'standard'
   ],
   // required to lint *.vue files
   plugins: [

+ 1 - 1
build/webpack.base.conf.js

@@ -40,7 +40,7 @@ module.exports = {
   },
   module: {
     rules: [
-      ...(config.dev.useEslint ? [createLintingRule()] : []),
+      //...(config.dev.useEslint ? [createLintingRule()] : []),
       {
         test: /\.vue$/,
         loader: 'vue-loader',

+ 2 - 1
config/dev.env.js

@@ -3,5 +3,6 @@ const merge = require('webpack-merge')
 const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
-  NODE_ENV: '"development"'
+  NODE_ENV: '"development"',
+  //API_ROOT: '"/api/"'
 })

+ 12 - 2
config/index.js

@@ -10,10 +10,20 @@ module.exports = {
     // Paths
     assetsSubDirectory: 'static',
     assetsPublicPath: '/',
-    proxyTable: {},
+    proxyTable: {
+      '/api': {
+        //target: 'http://192.168.0.47:7081', // 接口的域名
+        target: 'https://zfb.4dkankan.com/zfb', // 接口的域名
+        // secure: false,  // 如果是https接口,需要配置这个参数
+        changeOrigin: true, // 如果接口跨域,需要进行这个参数配置
+        pathRewrite: {
+          '^/api': ''
+        }
+      }
+    },
 
     // Various Dev Server settings
-    host: 'localhost', // can be overwritten by process.env.HOST
+    host: '0.0.0.0', // can be overwritten by process.env.HOST
     port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
     autoOpenBrowser: false,
     errorOverlay: true,

+ 2 - 1
config/prod.env.js

@@ -1,4 +1,5 @@
 'use strict'
 module.exports = {
-  NODE_ENV: '"production"'
+  NODE_ENV: '"production"',
+  //API_ROOT:'"http://zfb.4dkankan.com/"'
 }

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5805 - 120
package-lock.json


+ 6 - 1
package.json

@@ -79,5 +79,10 @@
     "> 1%",
     "last 2 versions",
     "not ie <= 8"
-  ]
+  ],
+  "eslintConfig": {
+    "rules": {
+      "eslint-disable-next-line":false
+    }
+  }
 }

+ 204 - 16
src/pages/authentication/index.vue

@@ -1,7 +1,7 @@
 <!--  -->
 <template>
 <div class='con' v-loading.fullscreen.lock="loading">
-  <el-dialog title="企业信息" width="45%" :visible.sync="dialogFormVisible">
+  <el-dialog title="企业信息" width="45%" :visible.sync="dialogFormVisible"><!--企业的详细信息窗口-->
     <el-form :model="form" :label-position="'left'" :label-width="formLabelWidth">
       <div class="con-main">
         <div class="d-l">
@@ -53,7 +53,85 @@
       <el-button type="info" v-else>{{c_state===1?'已通过':'已拒绝'}}</el-button>
     </div>
   </el-dialog>
-  <div class="h-header">
+
+  <el-dialog title="新增企业" width="45%" :visible.sync="dialogAddCpnyVisible">
+    <el-form :model="form" :label-position="'left'" :label-width="formLabelWidth">
+      <div style="padding:0 30px">
+        <div class="add-l">
+          <el-form-item label="*企业名称">
+            <el-input show-word-limit maxlength="20" v-model="ac_name"></el-input>
+          </el-form-item>
+          <el-form-item label="*所属区域">
+            <!--<el-input v-model="ac_belongArea"  placeholder="请以一个空格为间隔,如“XX省 XX市 XX区”" rows="2" type="textarea" resize="none"></el-input>-->
+            <el-input v-model="ac_add_province" style="width:25%"></el-input><span>省</span>
+            <el-input v-model="ac_add_city" style="width:25%"></el-input><span>市</span>
+            <el-input v-model="ac_add_area" style="width:25%"></el-input><span>区</span>
+          </el-form-item>
+          <el-form-item label="*详细地址">
+            <el-input show-word-limit maxlength="50" v-model="ac_address"></el-input>
+          </el-form-item>
+          <el-form-item label="*企业LOGO">
+            <el-upload
+              :headers="{token}"
+              :action="serverName+'/company/uploadLogo'"
+              :show-file-list="true"
+              :before-upload="beforeAvatarUpload"
+              :on-change="handleChange"
+              :file-list="fileList"
+              :on-success="upload_success"
+              :on-error="upload_fail">
+              <div class="zfb-load">
+                <el-button style="float:left;" size="small" type="primary">点击上传</el-button>
+                <div style="font-size:10px;float:left;" slot="tip">1.支持png、jpg和gif图片格式;</div>
+                <div style="font-size:10px;float:left;" slot="tip">2.最多可上传1张图;</div>
+                <div style="font-size:10px;float:left;" slot="tip">3.最大可上传10M的图片。</div>
+              </div>
+            </el-upload>
+          </el-form-item>
+          <el-form-item label="企业简介">
+            <el-input type="textarea" resize="none" rows="9" show-word-limit maxlength="100" v-model="ac_introduce"></el-input>
+          </el-form-item>
+        </div>
+
+        <div class="add-r">
+          <el-form-item label="*联系人">
+            <el-input show-word-limit maxlength="20" v-model="ac_user"></el-input>
+          </el-form-item>
+          <el-form-item label="*手机号">
+            <el-input v-model="ac_phone"></el-input>
+          </el-form-item>
+          <el-form-item label="企业官网">
+            <el-input v-model="ac_website" rows="2" type="textarea" resize="none"></el-input>
+          </el-form-item>
+          <el-form-item label="*企业资质">
+            <el-upload
+              :action="serverName+'/company/uploadLogo'"
+              :show-file-list="true"
+              :before-upload="beforeAvatarUpload"
+              :on-change="handleChange"
+              :file-list="fileList2"
+              :on-success="upload_success"
+              :on-error="upload_fail">
+              <div class="zfb-load">
+                <el-button style="float:left" size="small" type="primary">点击上传</el-button>
+                <div style="font-size:10px;float:left;" slot="tip">1.支持png、jpg和gif图片格式;</div>
+                <div style="font-size:10px;float:left;" slot="tip">2.最多可上传1张图;</div>
+                <div style="font-size:10px;float:left;" slot="tip">3.最大可上传10M的图片。</div>
+              </div>
+            </el-upload>
+          </el-form-item>
+        </div>
+      </div>
+    </el-form>
+    <div style="text-align:center" class="dialog-footer">
+      <div>
+        <el-button @click="dialogAddCpnyVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addCompany()">提 交</el-button>
+      </div>
+    </div>
+  </el-dialog>
+
+  <div class="h-header"><!--企业认证的头部内容-->
     <vcenter>
       <div>
         <el-dropdown>
@@ -82,11 +160,16 @@
       <div>
         <el-button @click="refresh" type="primary">搜索</el-button>
       </div>
+
+      <div style="float:right;padding-right:20px">
+        <el-button @click="showAdd" type="primary">新增企业</el-button>
+      </div>
+
     </vcenter>
   </div>
   <div class="h-body">
     <el-table height="520" :data="tableData" style="width: 100%;padding:0 20px;">
-      <el-table-column v-for="(item,i) in tableHeader" :key="i" :prop="item.name" :label="item.label">
+      <el-table-column v-for="(item,i) in tableHeader" :key="i" :prop="item.name" :label="item.label"><!--企业认证表格前三个标题:提交日期、企业名称、手机号-->
       </el-table-column>
       <el-table-column label="状态">
         <template slot-scope="scope">
@@ -111,6 +194,9 @@
 // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 // 例如:import 《组件名称》 from '《组件路径》';
 import vcenter from '@/components/vcenter'
+import {
+  serverName
+} from '@/utils/http'
 const tableHeader = [{
   name: 'createTime',
   label: '提交日期'
@@ -150,9 +236,13 @@ export default {
         text: '全部',
         id: ''
       },
+      serverName,
+      fileList:[],
+      fileList2:[],
       tableData: [],
       tableHeader,
       dialogFormVisible: false,
+      dialogAddCpnyVisible: false,
       currentPage: 1,
       value3: true,
       loading: false,
@@ -173,13 +263,25 @@ export default {
       c_zizhi: '',
       c_state: '',
       inpuKey: '',
-      pickerOptions2: {
+      ac_name:'',
+      ac_belongArea:'',
+      ac_add_province:'',
+      ac_add_city:'',
+      ac_add_area:'',
+      ac_address:'',
+      ac_logo:'',
+      ac_introduce:'',
+      ac_user:'',
+      ac_phone:'',
+      ac_website:'',
+      ac_zizhi:'',
+      pickerOptions2: {                             //:picker-options="pickerOptions2"
         shortcuts: [{
           text: '最近一周',
           onClick (picker) {
-            const end = new Date()
+            const end = new Date()//声明只读Date类型变量,此时end和start为当前时间
             const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)//start的时间设为距离现在一周前的日期
             picker.$emit('pick', [start, end])
           }
         }, {
@@ -187,7 +289,7 @@ export default {
           onClick (picker) {
             const end = new Date()
             const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)//start的时间设为距离现在一个月前的日期
             picker.$emit('pick', [start, end])
           }
         }, {
@@ -195,7 +297,7 @@ export default {
           onClick (picker) {
             const end = new Date()
             const start = new Date()
-            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
+            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)//start的时间设为距离现在三个月前的日期
             picker.$emit('pick', [start, end])
           }
         }]
@@ -204,7 +306,11 @@ export default {
     }
   },
   // 监听属性 类似于data概念
-  computed: {},
+  computed: {
+    token () {
+      return window.localStorage.getItem('zfb_token')
+    }
+  },
   // 监控data中的数据变化
   watch: {
     currentPage () {
@@ -216,27 +322,27 @@ export default {
   },
   // 方法集合
   methods: {
-    fix_website (value) {
+    fix_website (value) {                               //value值如有“https://”的话在新窗口打开value存的地址,没有的话添加前缀名后再打开
       if (this.$base.isContain(value, 'http://') || this.$base.isContain(value, 'https://')) {
         window.open(value, '_blank')
       } else {
         window.open('http://' + value, '_blank')
       }
     },
-    handleSizeChange (val) {
+    handleSizeChange (val) {                            
       console.log(`每页 ${val} 条`)
     },
     handleCurrentChange (val) {
       console.log(`当前页: ${val}`)
     },
-    refresh () {
+    refresh () {                                          //重新加载数据
       this.loading = true
       this.getData()
       this.loading = false
     },
-    clearInfo () {
-      this.dialogFormVisible = false
-      this.$bus.$emit('refresh', true)
+    clearInfo () {                                        
+      this.dialogFormVisible = false                      //隐藏弹窗
+      this.$bus.$emit('refresh', true)                    //触发当前实例上的refresh()
       this.refresh()
     },
 
@@ -319,7 +425,7 @@ export default {
       this.c_introduce = list.introduce || ''
       this.c_state = list.state
     },
-    fixState (state) {
+    fixState (state) {                        //通过state值返回一个obj对象表示审核状态,内容有status,文本text,选择器名class
       let obj = {}
       switch (state) {
         case 0:
@@ -350,6 +456,79 @@ export default {
           break
       }
       return obj
+    },
+    beforeAvatarUpload (file) {
+      const isLt10M = file.size / 1024 / 1024 < 10
+      if (!isLt10M) {
+        this.$message.error('上传图片大小不能超过 10MB!')
+        return false
+      }
+      const isFormat = file.type === 'image/jpg' || file.type === 'image/png' || file.type === 'image/gif'
+      if (!isFormat) {
+        this.$message.error('上传图片格式错误!')
+        return false
+      }
+      return isLt10M && isFormat
+    },
+    showAdd(){
+      this.dialogAddCpnyVisible = !this.dialogAddCpnyVisible
+    },
+    handleChange (file, fileList) {
+      console.log('file', file)
+      console.log('fileList', fileList)
+
+      if (fileList.length > 1) {
+        this.fileList = fileList.slice(-1)
+      }
+    },
+    upload_success (data) {
+      console.log('上传成功')
+
+      this.homepic = data.message
+    },
+    upload_fail (data) {
+      this.$notify.error({
+        title: '上传失败',
+        message: data.message
+      })
+    },
+    //新增企业
+    addCompany(){
+      let params = {
+        name: this.ac_name,
+        area: this.ac_add_province + '省 ' + this.ac_add_city + '市 ' + this.ac_add_area + '区',
+        address: this.ac_address,
+        logo: this.ac_logo,
+        introduce: this.ac_introduce,
+        contacts: this.ac_user,
+        phone: this.ac_phone,
+        website: this.ac_website,
+        qualification: this.ac_zizhi
+      }
+      this.$http({
+        method: 'post',
+        data: params,
+        url: '/company/back/save',
+        headers: {
+          token: window.localStorage.getItem('zfb_token')
+        }
+      }).then(res =>{
+        if(res.code === 200){
+          this.$alert('新增成功', '提示', {
+            confirmButtonText: '确定',
+            callback: action => {
+              this.dialogAddCpnyVisible = false
+              this.clearInfo()
+              this.refresh()
+            }
+          })
+        }else{
+          this.$notify.error({
+            title:'错误',
+            message:res.message
+          })
+        }
+      })
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
@@ -429,6 +608,15 @@ export default {
     }
   }
 
+  .add-l{
+    display: inline-block;
+    width:45%;
+  }
+  .add-r{
+    width:45%;
+    float: right;
+  }
+
   .ei-num {
     .el-input-number {
       width: 90%;

+ 439 - 0
src/pages/device/index.vue

@@ -0,0 +1,439 @@
+<template>
+  <div id="device-management">
+    <div class="device-management-body" v-loading.fullscreen.lock="fullscreenLoading">
+      <div class="order-management-body">
+        <div class="order-management-inner">
+          <div class="base-info">
+            <!-- <span>关键词:</span> -->
+            <span>用户名:</span>
+            <el-input style="width:220px;" @keyup.enter.native="currentPage=1&&_getCameraData()" v-model="searchKey" placeholder="请输入用户名"></el-input>
+            <el-button type="primary" @click="currentPage=1&&_getCameraData()" color='red'>搜索</el-button>
+            <el-button icon="el-icon-plus" type="primary" style="float: right;" @click="showCameraDialog" color='red'>添加相机</el-button>
+          </div>
+        </div>
+        <!-- 全部 -->
+        <div class="device-management_bottom">
+          <div class="order-management-table">
+            <el-table ref="order_table" class='e-table' :data="cameras" style="width: 100%">
+              <el-table-column prop="childName" label="设备ID">
+              </el-table-column>
+              <el-table-column prop="userName" label="手机号(用户名)">
+              </el-table-column>
+              <el-table-column prop="goodsName" label="设备类型">
+              </el-table-column>
+              <el-table-column prop="snCode" label="sn码">
+              </el-table-column>
+              <el-table-column width="300" label="激活时间">
+                <template slot-scope="scope">
+                  <div>{{scope.row.activatedTime}}</div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="own" label="出货类型">
+              </el-table-column>
+              <el-table-column prop="companyName" label="客户名称">
+                <template slot-scope="scope">
+                  <div>{{scope.row.companyName||'-'}}</div>
+                </template>
+              </el-table-column>
+              <el-table-column prop="balance" label="当前余额(点)">
+              </el-table-column>
+              <el-table-column label="操作">
+                <template slot-scope="scope">
+                  <el-button type="text" @click="showDialog(scope.row)" class="edit_btn">点数</el-button>
+                  <el-button type="text" v-if="scope.row.userName!='未绑定'" @click="_unbindDevice(scope.row)" class="delete_btn">解绑</el-button>
+                </template>
+              </el-table-column>
+            </el-table>
+          </div>
+          <div class="order-management-pagination">
+            <el-pagination  @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pagesize" layout="total, prev, pager, next, jumper" :total="total">
+            </el-pagination>
+          </div>
+        </div>
+        <el-dialog width="450px" title="点数修改" :visible.sync="dialogFormVisible">
+          <el-form :model="form" >
+            <el-form-item >
+              <div style="display: flex;justify-content: space-between;font-size: 14px;">
+                <span>设备ID:
+              <span>{{currentChildName}}</span>
+                </span>
+                <span>当前余额:
+              <span>{{currentBalance}}</span>
+                </span>
+              </div>
+            </el-form-item>
+            <el-form-item label="充值类型">
+              <el-select v-model="form.region" placeholder="请选择点数修改类型">
+                <el-option label="系统赠送" value=0></el-option>
+                <el-option label="退充值款" value=-2></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="充值点数" width="100%">
+              <el-input @keyup.native="_checkInput" maxlength="5" :suffix-icon="form.region==-2?'el-icon-minus':'el-icon-plus'" v-model.number="form.point"></el-input>
+            </el-form-item>
+          </el-form>
+          <div slot="footer" class="dialog-footer">
+            <el-button @click="dialogFormVisible = false">取 消</el-button>
+            <el-button type="primary" @click="_modifyPoints">确 定</el-button>
+          </div>
+        </el-dialog>
+        <el-dialog width="470px" title="添加相机" :visible.sync="cameraVisible">
+          <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="80px">
+            <el-form-item label="出库类型" prop="own">
+              <el-select v-model="ruleForm.own" placeholder="请选择出库类型">
+                <el-option label="正常销售" value="0"></el-option>
+                <el-option label="礼品赠送" value="2"></el-option>
+                <el-option label="员工自用" value="1"></el-option>
+                <el-option label="其他" value="3"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="相机类型" prop="type">
+              <el-select v-model="ruleForm.type" placeholder="请选择相机类型">
+                <el-option label="四维看看Pro八目相机" value="1"></el-option>
+                <el-option label="四维看看Lite双目相机" value="0"></el-option>
+                <el-option label="四维看看双目转台相机" value="3"></el-option>
+                <el-option label="四维看看激光相机" value="4"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="wifi名称" prop="wifi">
+              <el-input v-model="ruleForm.wifi"></el-input>
+            </el-form-item>
+            <el-form-item label="物理地址" prop="address">
+              <el-input v-model="ruleForm.address"></el-input>
+            </el-form-item>
+            <el-form-item label="sn码" prop="snCode">
+              <el-input v-model="ruleForm.snCode"></el-input>
+            </el-form-item>
+            <el-form-item label="初始点数" @keyup.native="_checkPointInput" prop="initPoint">
+              <el-input v-model="ruleForm.initPoint"></el-input>
+            </el-form-item>
+            <el-form-item label="订单号" prop="orderNum">
+              <el-input v-model="ruleForm.orderNum"></el-input>
+            </el-form-item>
+            <el-form-item label="客户名称" prop="own">
+              <el-select v-model="ruleForm.companyId" placeholder="请选择">
+                <el-option v-for="(item,i) in companyList" :key="i" :label="item.companyName" :value="item.id">{{item.companyName}}</el-option>
+              </el-select>
+            </el-form-item>
+          </el-form>
+          <div slot="footer" class="dialog-footer">
+            <el-button @click="cameraVisible = false">取 消</el-button>
+            <el-button type="primary" @click="_addCamera">确 定</el-button>
+          </div>
+        </el-dialog>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+
+export default {
+  data () {
+    return {
+      tabs: [{ name: '设备ID', idx: 0 }, { name: '手机号', idx: 1 }, { name: '当前余额', idx: 2 }, { name: '历史充值', idx: 3 }],
+      expands: [],
+      expandedArr: [],
+      cameras: [],
+      currentPage: 1,
+      key_input: '',
+      fullscreenLoading: false,
+      product: {
+        'name': '',
+        'packageName': '',
+        'count': '',
+        'amount': '',
+        'url': ''
+      },
+      // labelPosition: 'right',
+      receive: {
+        'name': '',
+        'phone': '',
+        'address': '',
+        'invoice': '',
+        'expressNum': ''
+      },
+      searchKey: '',
+      total: 0,
+      // expressNum_input: "",
+      searchDate: [],
+      searchOrderNumber: '',
+      searchPhone: '',
+      searchExpressNum: '',
+      hasClickSearch: false,
+      tabIndex: 0,
+      dialogFormVisible: false,
+      cameraVisible: false,
+      form: {
+        point: '',
+        region: '',
+        date1: '',
+        date2: '',
+        delivery: false,
+        type: [],
+        resource: '',
+        desc: ''
+      },
+      ruleForm: {
+        wifi: '',
+        address: '',
+        initPoint: '',
+        type: [],
+        own: [],
+        snCode: '',
+        orderNum: '',
+        companyId: ''
+      },
+      rules: {
+        wifi: [
+          { required: true, message: '请输入WiFi名称', trigger: 'blur' }
+          // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
+        ],
+        address: [
+          { required: true, message: '请输入物理地址', trigger: 'blur' }
+          // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
+        ],
+        snCode: [
+          { required: true, message: '请输入SN码', trigger: 'blur' }
+          // { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
+        ],
+        initPoint: [
+          { required: true, message: '请输入初始点数', trigger: 'blur' }
+          // { type: "number", message: '必须为数字值', trigger: 'blur' }
+        ]
+
+      },
+      cameraInfo: {
+        wifi: '',
+        type: '',
+        address: '',
+        initPoint: '',
+        orderNum: '',
+        companyId: ''
+      },
+      companyList: [],
+      formLabelWidth: '30%',
+      value2: true,
+      currentChildName: '',
+      currentDeviceId: '',
+      currentBalance: '',
+      pagesize: 10
+    }
+  },
+  watch: {
+    currentPage () {
+      this._getCameraData()
+    }
+  },
+  methods: {
+    _getCameraData () {
+      this.fullscreenLoading = true
+      if (!Number(this.currentPage)) this.currentPage = 1
+      let params = {
+        userName: window.localStorage.getItem('zfb_username')
+      }
+      this.$http({
+        method:'post',
+        url:'/company/selectCompanyDevice',
+        data: params,
+        headers:{
+          token: window.localStorage.getItem('zfb_token')
+        }
+      }).then(res => {
+        this.fullscreenLoading = false
+        console.log(res)
+        if (res.code === 0) {
+          let temp = res.data.list
+          // let temp = res.message
+          for (var i = 0; i < temp.length; i++) {
+            switch (temp[i]['own']) {
+              case 0:
+                temp[i]['own'] = '正常销售'
+                break
+              case 1:
+                temp[i]['own'] = '员工自用'
+                break
+              case 2:
+                temp[i]['own'] = '礼品赠送'
+                break
+              case 3:
+                temp[i]['own'] = '其他'
+                break
+            }
+            temp[i]['userName'] = temp[i]['userName'] ? temp[i]['userName'] : '未绑定'
+            temp[i]['activatedTime'] = temp[i]['activatedTime'] ? new Date(temp[i]['activatedTime']).format('yyyy-MM-dd hh:mm:ss') : '/'
+          }
+          this.cameras = temp
+          this.total = res.data.total ? res.data.total : this.total
+        }
+      })
+    },
+    handleCurrentChange (val) {
+      this.currentPage = val
+    },
+    showDialog (row) {
+      this.form.region = ''
+      this.form.point = ''
+      this.currentChildName = row.childName
+      this.currentDeviceId = row.id
+      this.currentBalance = row.balance
+      this.dialogFormVisible = true
+    },
+    async getCompanyList () {
+      let result = await this.$http.post('/manager/company/listAll')
+      this.companyList = result.data
+    },
+    async _unbindDevice (row) {
+      this.$confirm('确定把该设备从账号中解除绑定', '解绑设备', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(async () => {
+        this.fullscreenLoading = true
+        console.log(row)
+        let res = await this.$http.post('/manager/camera/unbind', {
+          cameraId: row.id
+        })
+        if (res.code === 0) {
+          this.$message({
+            type: 'success',
+            message: '解绑成功!'
+          })
+          this._getCameraData()
+        } else {
+          this.$alert('解绑失败', '提示', {
+            confirmButtonText: '确定'
+          })
+        }
+        this.fullscreenLoading = false
+      }).catch(() => {
+        this.$message({
+          type: 'info',
+          message: '已取消解绑'
+        })
+        this.fullscreenLoading = false
+      })
+    },
+    _checkInput: function (e) {
+      this.form.point += ''
+      this.form.point = this.form.point.replace(/[^\d]/g, '')
+      if (Number(this.form.point) && this.form.point > 10000) {
+        this.form.point = 10000
+      }
+    },
+    _checkPointInput: function (e) {
+      this.ruleForm.initPoint += ''
+      this.ruleForm.initPoint = this.ruleForm.initPoint.replace(/[^\d]/g, '')
+      if (Number(this.ruleForm.initPoint) && this.ruleForm.initPoint > 10000) {
+        this.ruleForm.initPoint = 10000
+      }
+    },
+    async _modifyPoints () {
+      let body = this.form.region
+      let points = this.form.point
+      let cameraId = this.currentDeviceId
+
+      if (!body) {
+        this.$alert('请选择充值类型', '提示', {
+          confirmButtonText: '确定',
+          callback: action => {
+
+          }
+        })
+      } else {
+        let res = await this.$http.post('/manager/camera/modifyPoints', {
+          body: Number(body),
+          cameraId,
+          points
+        })
+
+        if (res.code === 0) {
+          this.$message({
+            type: 'success',
+            message: '充值成功!'
+          })
+          this._getCameraData()
+          this.dialogFormVisible = false
+        } else {
+          this.$alert(res.msg, '提示', {
+            confirmButtonText: '确定'
+          })
+        }
+      }
+    },
+
+    async _addCamera () {
+      let {
+        wifi: wifiName,
+        address: childName,
+        initPoint: balance,
+        own,
+        type,
+        snCode,
+        companyId,
+        orderNum: orderSn
+      } = this.ruleForm
+      if (wifiName === '' || childName === '' || snCode === '' || balance === '' || own === '' || type === '') {
+        return
+      }
+
+      this.fullscreenLoading = true
+      let res = await this.$http.post('/manager/camera/add', {
+        childName,
+        wifiName,
+        orderSn,
+        snCode,
+        companyId,
+        balance: Number(balance),
+        type: Number(type),
+        own
+      })
+      this.fullscreenLoading = false
+      if (res.code === 0) {
+        this.$alert('该相机信息已成功添加入库', '添加成功', {
+          confirmButtonText: '确定'
+        })
+        this._getCameraData()
+        this.ruleForm.address = ''
+        this.ruleForm.wifi = ''
+        this.ruleForm.own = ''
+        this.ruleForm.orderNum = ''
+        this.ruleForm.snCode = ''
+        this.ruleForm.type = ''
+        this.ruleForm.initPoint = ''
+        this.ruleForm.companyId = ''
+
+        this.cameraVisible = false
+      } else {
+        this.$alert(res.msg, '添加失败', {
+          confirmButtonText: '确定'
+        })
+      }
+    },
+    showCameraDialog (row) {
+      this.cameraVisible = true
+    }
+  },
+  created () {
+    this._getCameraData()
+    this.getCompanyList()
+  }
+}
+
+</script>
+<style lang="css" scoped>
+@import './style.css';
+</style>
+<style type="text/css">
+.el-table__expand-icon>i {
+  display: none !important;
+}
+
+.edit_btn span {
+  color: #09e1c0
+}
+
+.delete_btn span {
+  color: #f56c6c
+}
+
+</style>

+ 170 - 0
src/pages/device/style.css

@@ -0,0 +1,170 @@
+.device-management-body {
+  width: 100%;
+  float: left;
+  /*  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  -moz-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);*/
+  /*border: 1px solid #ebeef5;*/
+}
+
+.order_check_row {
+  display: flex;
+  width: 100%;
+}
+
+.product_info {
+  width: 50%;
+  flex-direction: column;
+  display: flex;
+  padding: 20px;
+  background: #fff;
+}
+
+.order_info {
+  width: 50%;
+  padding: 20px;
+  margin-left: 20px;
+  background: #fff;
+}
+
+.product_info_title {
+  text-align: left;
+  font-weight: 700;
+  margin-bottom: 20px;
+}
+
+.product_info_body {
+  margin-left: 30px;
+  display: flex;
+}
+
+.product_info_body_img {
+  width: 110px;
+  height: 110px;
+  border: 1px solid #ddd;
+}
+
+.product_img {
+  margin: 5px auto;
+  width: 100px;
+  height: 100px;
+}
+
+.product_info_body_info {
+  margin-left: 50px;
+}
+
+.product_info_body_info_item {
+  line-height: 27px;
+  text-align: left;
+}
+
+.product_info_body_info_item_title {
+  width: 100px;
+  display: inline-block;
+  margin-right: 20px;
+  font-weight: 700;
+}
+
+.order_info_title {
+  text-align: left;
+  font-weight: 700;
+  margin-bottom: 20px;
+}
+
+.order_info_body {
+  margin-left: 30px;
+  text-align: left;
+}
+
+/* .order_info_body_info {} */
+
+.order_info_body_info_item {
+  line-height: 23px;
+  padding: 10px 0;
+  border-bottom: 1px solid #f5f5f5;
+  text-align: left;
+}
+
+.order_info_body_info_item_title {
+  width: 100px;
+  display: inline-block;
+  margin-right: 20px;
+  font-weight: 700;
+}
+
+.order-management-body {
+  width: 100%;
+  margin: 30px 0 20px 0;
+  float: left;
+}
+
+.order-management-inner {
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  -moz-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  /*border: 1px solid #ebeef5;*/
+  padding: 20px;
+  background: #fff;
+  border-radius: 5px;
+}
+
+.base-info {
+  margin: 20px 0;
+}
+
+.device-management_bottom {
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  -moz-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  -webkit-box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
+  /*border: 1px solid #ebeef5;*/
+  margin-top: 30px;
+  background: #fff;
+  border-radius: 5px;
+  padding: 20px 0;
+}
+
+.device-management_tab {
+  margin: 0 0 20px;
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+}
+
+.device-management_tab ul {
+  display: inline-block;
+}
+
+.device-management_tab li {
+  display: inline-block;
+  cursor: pointer;
+  color: #999;
+  line-height: 1;
+}
+
+.device-management_tab_li_active {
+  color: #000!important;
+  font-weight: bold;
+}
+
+.order-management-table {
+  margin: 0 20px;
+}
+
+.order-management-pagination {
+  padding: 20px 20px 0;
+  position: relative;
+  text-align: right;
+}
+
+.el-select {
+  width: 340px!important;
+}
+
+.el-input {
+  width: 340px;
+}
+
+.el-icon-plus:before {
+  color: #09e1c0;
+}

+ 493 - 0
src/pages/equipment/index.vue

@@ -0,0 +1,493 @@
+<template slot-scope="scope">
+  <div class="con" v-loading.fullscreen.lock="loading">
+    <el-dialog width="470px" title="添加相机" :visible.sync="cameraVisible">
+      <el-form label-width="80px">
+        <el-form-item label="出库类型">
+          <el-select v-model="ruleForm.own" placeholder="请选择出库类型">
+            <el-option label="正常销售" value="0"></el-option>
+            <el-option label="礼品赠送" value="2"></el-option>
+            <el-option label="员工自用" value="1"></el-option>
+            <el-option label="其他" value="3"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="相机类型">
+          <el-select v-model="ruleForm.type" placeholder="请选择相机类型">
+            <el-option label="四维看看Pro八目相机" value="1"></el-option>
+            <el-option label="四维看看Lite双目相机" value="0"></el-option>
+            <el-option label="四维看看双目转台相机" value="3"></el-option>
+            <el-option label="四维看看激光相机" value="4"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="wifi名称">
+          <el-input v-model="ruleForm.wifi"></el-input>
+        </el-form-item>
+        <el-form-item label="物理地址">
+          <el-input v-model="ruleForm.address"></el-input>
+        </el-form-item>
+        <el-form-item label="sn码">
+          <el-input v-model="ruleForm.snCode"></el-input>
+        </el-form-item>
+        <el-form-item label="初始点数">
+          <el-input v-model="ruleForm.initPoint"></el-input>
+        </el-form-item>
+        <el-form-item label="订单号">
+          <el-input v-model="ruleForm.orderNum"></el-input>
+        </el-form-item>
+        <el-form-item label="客户名称">
+          <el-select v-model="ruleForm.companyId" placeholder="请选择">
+            <el-option></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="cameraVisible = false">取 消</el-button>
+        <el-button type="primary" @click="addCamera">确 定</el-button>
+      </div>
+    </el-dialog>
+
+    <div class="h-header">
+      <vcenter>
+        <div class="h-input">
+          <el-input v-model="userName" placeholder="请输入用户名"></el-input>
+        </div>
+        <div>
+          <el-button type="primary" @click="search">搜索</el-button>
+        </div>
+        <div style="float: right; padding-right: 20px">
+          <el-button type="primary" @click="cameraVisible = true"
+            >添加相机</el-button
+          >
+        </div>
+        <!-- <div style="float:right;padding-right:50px">
+                  <el-button type="primary" @click="ShebeiVisible = true">添加设备</el-button>
+                </div> -->
+      </vcenter>
+    </div>
+
+    <div class="h-body">
+      <el-table
+        height="520"
+        :data="tableData"
+        style="width: 100%; padding: 0 20px"
+      >
+        <el-table-column
+          v-for="(item, i) in tableHeader"
+          :key="i"
+          :prop="item.name"
+          :label="item.label"
+        >
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <div>点数</div>
+            <div>解绑</div>
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="p-con">
+        <el-pagination
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+          :current-page.sync="currentPage"
+          :page-size="size"
+          layout="prev, pager, next, jumper"
+          :total="total"
+        ></el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import vcenter from "@/components/vcenter";
+export default {
+  components: { vcenter },
+  data() {
+    return {
+      c_userName: "",
+      loading: false,
+      currentPage: 1,
+      size: 10,
+      total: 0,
+      userName: "",
+      companyList:[],
+      childName: "",
+      tableData: [],
+      tableHeader: [
+        { name: "childName", label: "设备ID" },
+        { name: "userName", label: "手机号(用户名)" },
+        { name: "goodsName", label: "设备类型" },
+        { name: "snCode", label: "sn码" },
+        { name: "activatedTime", label: "激活时间" },
+        { name: "own", label: "出货类型" },
+        { name: "companyName", label: "客户名称" },
+        { name: "balance", label: "当前余额(点)" },
+      ],
+      // ShebeiVisible: false,
+      cameraVisible: false,
+      ruleForm: {
+        wifi: "",
+        address: "",
+        initPoint: "",
+        type: [],
+        own: [],
+        snCode: "",
+        orderNum: "",
+        companyId: "",
+      },
+      addEq: {
+        userName: "",
+        companyId: "",
+        shebeiNum: "",
+        shebeiId: "",
+      },
+      addDevies: [
+        {
+          value: "",
+          isAvailable: false,
+          hasCheck: false,
+        },
+      ],
+      errMsg: "",
+      num: "",
+    };
+  },
+  methods: {
+    handleSizeChange(val) {
+      console.log(`每页 ${val} 条`);
+    },
+    handleCurrentChange(val) {
+      console.log(`当前页: ${val}`);
+    },
+    getData() {
+      let result;
+      let params = {
+        userName: this.userName || "",
+        // userName: this.userName || '',
+        // childName: this.childName || ''
+      };
+      this.$http({
+        method: "post",
+        data: params,
+        url: "/camera/pageList",
+        header: {
+          token: window.localStorage.getItem("zfb_token"),
+          pageNum: this.currentPage,
+          pageSize: this.size,
+        },
+      }).then( res => {
+        this.tabelData = res.message;
+        // this.total = result.message.total
+        // this.currentPage = result.message.pageNum
+      });
+    },
+    addCamera() {
+      let params = {
+        wifi: "",
+        address: "",
+        initPoint: "",
+        type: [],
+        own: [],
+        snCode: "",
+        orderNum: "",
+        companyId: "",
+      };
+      this.$http({
+        method: "post",
+        url: "/camera/add",
+        data: params,
+        header: {
+          token: window.localStorage.getItem("zfb_token"),
+          pageNum: this.currentPage,
+          pageSize: this.size,
+        }
+      }).then(res => {
+        if(res.code === 200){
+          this.$alert('相机添加成功','提示',{
+            confirmButtonText: '确定',
+            callback: action => {
+
+            }
+          })
+        }else{
+          this.$alert('相机添加失败','提示',{
+            confirmButtonText: '确定',
+            callback: action => {
+
+            }
+          })
+        }
+      })
+    },
+    async getCompanyList(){
+      let result = await this.$http.post('/company/listAll')
+      this.companyList = result
+    },
+    refresh() {
+      this.loading = true;
+      this.getData();
+      this.loading = false;
+    },
+    search() {
+      this.currentPage === 1 ? this.refresh() : (this.currentPage = 1);
+      this.getData()
+    },
+    checkLegal(item) {
+      if (item.value) {
+        let params = {
+          childName: item.value,
+        };
+        this.$http({
+          method: "post",
+          data: params,
+          url: "/company/checkDevice",
+          headers: {
+            token: window.localStorage.getItem("zfb_token"),
+          },
+        }).then((res) => {
+          if (res.code === 200) {
+            item.isAvailable = true;
+          } else {
+            item.isAvailable = false;
+            this.errMsg = "该ID不可用";
+          }
+          item.hasCheck = true;
+        });
+      } else {
+        item.isAvailable = false;
+        item.hasCheck = true;
+        this.errMsg = "ID不能为空";
+      }
+    },
+  },
+  mounted() {
+    this.getCompanyList()
+    console.log("mounted");
+    this.refresh();
+  },
+  watch: {
+    currentPage() {
+      this.refresh();
+    },
+    size() {
+      this.refresh();
+    },
+    num(newVal, oldVal) {
+      if (newVal > oldVal) {
+        this.addDevies.push({
+          value: "",
+          isAvailable: false,
+          hasCheck: false,
+        });
+      } else {
+        this.addDevies.pop();
+      }
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.con {
+  .time-data {
+    position: relative;
+    .select-data {
+      position: absolute;
+      left: 0;
+      top: 0;
+      opacity: 0;
+      cursor: pointer;
+    }
+    > span {
+      color: #0175dc;
+    }
+  }
+  .ei-num {
+    .el-input-number {
+      width: 90%;
+    }
+  }
+  .clear-music {
+    position: relative;
+    text-align: right;
+    top: -30px;
+    color: #999;
+    cursor: pointer;
+  }
+  .musicIcon {
+    width: 100%;
+    height: 100%;
+    line-height: 1;
+    margin-top: 35px;
+    img {
+      width: 50px;
+      height: auto;
+    }
+    p {
+      font-weight: bold;
+      font-size: 14px;
+      color: #000;
+      line-height: 20px;
+      height: 20px;
+      margin-top: 20px;
+    }
+  }
+  .icon-plus {
+    margin-left: 15px;
+    width: 40px;
+    height: 38px;
+    line-height: 38px;
+    text-align: center;
+    background: #f5f7fa;
+    color: #999;
+    cursor: pointer;
+    font-size: 13px;
+    display: inline-block;
+    border: 1px solid #dcdfe6;
+    border-radius: 4px;
+    &:hover {
+      border: 1px solid #c0c4cc;
+    }
+  }
+  .add-num {
+    margin-left: 15px;
+    width: 250px;
+    .icon-close,
+    .icon-correct {
+      line-height: 1;
+      color: #999;
+    }
+    input[type="number"]::-webkit-inner-spin-button,
+    input[type="number"]::-webkit-outer-spin-button {
+      -webkit-appearance: none;
+      margin: 0;
+    }
+  }
+
+  .ei-input {
+    width: 100%;
+    max-height: 200px;
+    overflow-y: auto;
+    .input-con {
+      display: inline-block;
+      width: 45%;
+      margin: 2px 5px 2px 0;
+      height: 60px;
+      position: relative;
+      .el-input_err {
+        & /deep/ .el-input__inner {
+          border: 1px solid #f56c6c;
+        }
+      }
+      .el-input_success {
+        & /deep/ .el-input__inner {
+          border: 1px solid #67c23a;
+        }
+      }
+      span {
+        color: #f56c6c;
+        font-size: 12px;
+        line-height: 1;
+        padding-top: 4px;
+        position: absolute;
+        left: 0;
+      }
+    }
+  }
+  .h-header {
+    height: 80px;
+    background-color: #fff;
+    padding-left: 20px;
+    box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.1);
+    border-radius: 3px;
+
+    div {
+      display: inline-block;
+    }
+
+    .h-input {
+      width: 220px;
+    }
+  }
+
+  .h-body {
+    width: 100%;
+    margin: 30px 0 0;
+    padding-top: 20px;
+    box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.1);
+    border-radius: 3px;
+    background-color: #fff;
+
+    .logo-add {
+      div {
+        cursor: pointer;
+        line-height: 40px;
+        border: 1px dotted #dcdfe6;
+        border-radius: 4px;
+        font-weight: bold;
+        font-size: 18px;
+        display: inline-block;
+        width: 40px;
+        height: 40px;
+        background: #f5f7fa;
+        position: relative;
+        img {
+          width: 100%;
+          height: 100%;
+          position: absolute;
+          top: 0;
+          left: 0;
+        }
+        span {
+          position: absolute;
+          z-index: 100;
+          left: 0;
+          top: 0;
+          width: 100%;
+          height: 100%;
+        }
+      }
+    }
+
+    .o-span {
+      color: #0175dc;
+      cursor: pointer;
+    }
+
+    .p-con {
+      width: 100%;
+      text-align: right;
+      padding: 25px 20px 30px;
+    }
+  }
+
+  .d-table {
+    border: 1px solid #ccc;
+    .d-con {
+      max-height: 200px;
+      overflow-y: scroll;
+    }
+    .d-header {
+      font-weight: bold;
+    }
+    .d-header,
+    .d-body {
+      height: 40px;
+      line-height: 40px;
+      width: 100%;
+      border-bottom: 1px solid #ccc;
+      &:last-child {
+        border: none;
+      }
+      span {
+        text-align: center;
+        display: inline-block;
+        width: 24%;
+      }
+      .unbind {
+        cursor: pointer;
+      }
+    }
+  }
+}
+</style>

+ 384 - 22
src/pages/home/index.vue

@@ -23,8 +23,36 @@
         <el-button type="primary" @click="save_reCharge()">确 定</el-button>
       </div>
     </el-dialog>
-    <el-dialog title="新增设备" width="30%" :visible.sync="dialogFormVisible">
-      <el-form :model="form" :label-position="'left'" :label-width="formLabelWidth">
+    <el-dialog title="子账号管理" width="30%" :visible.sync="dialogFormVisible">
+      <el-dialog title="新增子账号" :visible.sync="addZiVisible" append-to-body width="20%">
+        <el-form  style="padding-bottom:30px;">
+          <el-form-item label="姓名">
+            <el-input v-model="addZi.nickName" placeholder="请输入姓名"></el-input>
+          </el-form-item>
+          <el-form-item label="手机号">
+            <el-input v-model="addZi.phone" placeholder="请输入手机号码"></el-input>
+          </el-form-item>
+        </el-form>
+        <div style="text-align:center" class="dialog-footer">
+          <el-button @click="addZiVisible = false">取 消</el-button>
+          <el-button type="primary" @click="addZi_save">保 存</el-button>
+        </div>
+      </el-dialog>
+      <el-dialog title="修改子账号" :visible.sync="changeZiVisible" append-to-body width="20%">
+        <el-form style="padding-bottom:30px;">
+          <el-form-item label="姓名">
+            <el-input v-model="changeZi.nickName" placeholder="请输入姓名"></el-input>
+          </el-form-item>
+          <el-form-item label="手机号">
+            <el-input v-model="changeZi.phone" placeholder="请输入手机号码"></el-input>
+          </el-form-item>
+        </el-form>
+        <div style="text-align:center" class="dialog-footer">
+          <el-button @click="changeZiVisible = false">取 消</el-button>
+          <el-button type="primary" @click="saveZichange">保 存</el-button>
+        </div>
+      </el-dialog>
+      <el-form :model="form" :label-position="'left'" :label-width="formLabelWidth" style="padding-bottom:30px;">
         <el-form-item label="企业名称:">
           <span>{{c_userName}}</span>
         </el-form-item>
@@ -32,7 +60,7 @@
           <span>{{c_name}}</span>
         </el-form-item>
         <el-form-item label="子账号数量:">
-          <span>{{parseInt(c_subNum||0) + parseInt(c_num||0)}}</span>
+          <span>{{parseInt(c_subNum||0) /*+ parseInt(c_num||0)*/}}</span>
           <i v-if="!isAdd" @click="isAdd=!isAdd" class="iconfont icon-plus"></i>
           <div v-else class="el-input-number add-num">
             <span @click="isAdd=!isAdd" class="el-input-number__decrease">
@@ -46,31 +74,123 @@
             </div>
           </div>
         </el-form-item>
-        <el-form-item label="设备数量">
-          <div class="ei-num">
-            <el-input-number v-model="num" :min="0" label="描述文字"></el-input-number>
+        <el-form-item label="已添加子账号数:">
+          <span>{{ShowChildUser.length}}个</span>
+          <div style="float:right;color:blue;cursor:pointer;padding-right:30px" @click="addZiVisible = true">
+            <span><i class="el-icon-circle-plus-outline"></i> 新增子账号</span>
+          </div>
+        </el-form-item>
+        <!--<el-form-item label="已添加子账号:">
+          <div>
+            <div>
+              <ul style="height:120px;overflow:auto;">
+                <li v-for="(item,i) in ShowChildUser" :key="i">
+                  <span>{{item}}</span>
+                  <span @click="changeZiphone" style="display:inline-block;color:red;cursor:pointer;padding-left:120px;">修改账号</span>
+                  <span @click="delChildUser" style="float:right;color:red;cursor:pointer;padding-right:30px;">取消绑定</span>
+                </li>
+              </ul>
+            </div>
+            <span style="font-size:10px;cursor:pointer;color:blue;" @click="ZiNum += 1">+ 添加子账号</span>
+          </div>
+          <div v-if="isAddChild" style="border:solid 1px #999;">
+            <div style="padding-left:50px;padding-top:10px">
+              <el-form-item label="*姓名" label-width="80px">
+                <el-input v-model="Zi.ZiName" style="width:75%;" placeholder="请输入姓名"></el-input>
+              </el-form-item>
+              <el-form-item label="*手机号" label-width="80px">
+                <el-input v-model="Zi.ZiPhone" style="width:75%;" placeholder="请输入手机号"></el-input>
+              </el-form-item>
+            </div>
+            <div style="text-align:center;padding-bottom:5px" class="dialog-footer">
+              <el-button size="small" @click="isAddChild=!isAddChild">取消</el-button>
+              <el-button size="small" type="primary" @click="SaveChildUser">确定</el-button>
+            </div>
           </div>
         </el-form-item>
-        <el-form-item label="设备ID" v-if="num>0">
+
+        <el-form-item label="新增子账号:" v-if="ZiNum>0">
           <div class="ei-input">
-            <div v-for="(item,i) in addDevies" class="input-con" :key="i">
+            <div v-for="(item,i) in addZi" :key="i">
+              <div>账号{{i+1}}</div>
               <el-input
-                :class="{'el-input_err':!item.isAvailable&&item.hasCheck,'el-input_success':item.isAvailable}"
-                v-model="item.value"
-                :placeholder="'ID'+(i+1)"
-                @blur="checkLegal(item)"
-              />
-              <span v-if="!item.isAvailable&&item.hasCheck">{{errMsg}}</span>
+                style="width:70%"
+                v-model="item.name"
+                :class="{'el-input_err':!item.isAvailable&&item.hasCheck,'el-input_success':item.Available}"
+                :placeholder="'联系人'+(i+1)"
+                
+              ></el-input>
+              <el-input
+                style="width:70%"
+                v-model="item.phone"
+                :class="{'el-input_err':!item.isAvailable&&item.hasCheck,'el-input_success':item.Available}"
+                :placeholder="'手机号'+(i+1)"
+                
+              ></el-input>
+              <div><br></div>
             </div>
           </div>
-        </el-form-item>
+        </el-form-item>-->
+
+        <el-table
+          height="240"
+          :data="ShowChildUser"
+          :border="true"
+        >
+          <!--<el-table-column label="ID" prop="id" width="60%"></el-table-column>-->
+          <el-table-column label="姓名" prop="nickName"></el-table-column>
+          <el-table-column label="手机号" width="200px" prop="phone"></el-table-column>
+          <el-table-column label="操作">
+            <template slot-scope="scope">
+              <span @click="ChangeZi(scope.row)" style="cursor:pointer;color:blue;">修改</span>
+              <span @click="JiebangZi(scope.row)" style="cursor:pointer;color:red;">解绑</span>
+            </template>
+          </el-table-column>
+        </el-table>
+
       </el-form>
+
       <div style="text-align:center" class="dialog-footer">
-        <el-button @click="dialogFormVisible = false">取 消</el-button>
-        <el-button type="primary" @click="save(c_userName)">保 存</el-button>
+        <el-button type="primary" @click="ZiGuanli_save">保 存</el-button>
       </div>
     </el-dialog>
 
+    <el-dialog width="490px" title="新增设备" :visible.sync="ShebeiVisible">
+          <el-form label-width="80px">
+            <el-form-item label="企业名称:">
+              <span>{{c_userName}}</span>
+            </el-form-item>
+            <el-form-item label="企业账号:">
+              <span>{{c_name}}</span>
+            </el-form-item>
+
+            <el-form-item label="设备数量">
+              <div class="ei-num">
+                <el-input-number v-model="num" :min="0" label="描述文字"></el-input-number>
+              </div>
+            </el-form-item>
+            
+            <el-form-item label="设备ID" v-if="num>0">
+              <div class="ei-input">
+                <div v-for="(item,i) in addDevies" class="input-con" :key="i">
+                  <el-input
+                    :class="{'el-input_err':!item.isAvailable&&item.hasCheck,'el-input_success':item.isAvailable}"
+                    v-model="item.value"
+                    :placeholder="'ID'+(i+1)"
+                    @blur="checkLegal(item)"
+                  />
+                  <span v-if="!item.isAvailable&&item.hasCheck">{{errMsg}}</span>
+                </div>
+              </div>
+            </el-form-item>
+            
+          </el-form>
+          <div style="text-align:center" class="dialog-footer">
+            <el-button @click="ShebeiVisible = false">取 消</el-button>
+            <el-button type="primary" @click="save(c_userName)">保 存</el-button>
+          </div>
+        </el-dialog>
+
     <el-dialog title="设备查看" width="30%" :visible.sync="deviceFormVisible">
       <el-form :model="form_device" :label-position="'left'" :label-width="formLabelWidth">
         <el-form-item label="企业账号:">
@@ -162,6 +282,10 @@
         <div>
           <el-button type="primary" @click="search(inpuKey)">搜索</el-button>
         </div>
+        <!--<div>
+          <el-button @click="ShebeiVisible = !ShebeiVisible">添加设备</el-button>
+          <el-button @click="dialogFormVisible = !dialogFormVisible">添加子账号</el-button>
+        </div>-->
       </vcenter>
     </div>
     <div class="h-body">
@@ -196,7 +320,7 @@
                 <span v-if="!scope['row'].bgMusic">+</span>
               </div>
             </div>
-            <span v-else-if="item.label==='子账号数量'">{{scope['row'].subNum+scope['row'].num}}</span>
+            <span v-else-if="item.label==='子账号数量'">{{scope['row'].subNum/*+scope['row'].num*/}}</span>
             <div
               class="time-data"
               v-else-if="item.label==='到期时间'"
@@ -214,10 +338,11 @@
             <span v-else>{{scope.row[item.name]}}</span>
           </template>
         </el-table-column>
-        <el-table-column label="操作">
+        <el-table-column label="操作" width="200px">
           <template slot-scope="scope">
             <span class="o-span" @click="show_reCharge(scope.row)">充值</span>
             <span class="o-span" @click="add(scope.row)">设备</span>
+            <span class="o-span" @click="ShowZi(scope.row)">子账号</span>
           </template>
         </el-table-column>
       </el-table>
@@ -243,6 +368,10 @@ import { serverName } from '@/utils/http'
 
 const tableHeader = [
   {
+    name: 'id',
+    label: 'ID'
+  },
+  {
     name: 'userName',
     label: '企业账户'
   },
@@ -321,6 +450,43 @@ export default {
         text: '企业账号',
         id: 'account'
       },
+      ZiNum:1,
+      //子管理参数
+      ZiGuanli: {
+        id:'',
+        subNum:'',
+        subUsers:''
+      },
+      addZi: {
+          id:'',
+          nickName: '',
+          phone:'',
+          //isAvailable: false,
+          //hasCheck: false
+      },
+      changeZi:{
+        id:'',
+        nickName:'',
+        phone:''
+      },
+      Zi:[{
+        //ZiNum:0,
+        ZiName:'',//子账号姓名输入值
+        ZiPhone:''//子账号手机号输入值
+      }],
+      ShowChildUser:[
+        {
+          id:'',
+          nickName:'',
+          phone:''
+        }
+      ],//子账号展示
+      addEq:{
+        companyName:'',
+        companyId:'',
+        shebeiNum:'',
+        shebeiId:''
+      },
       placeholder,
       fileList: [],
       currentlogo_id: '',
@@ -328,18 +494,22 @@ export default {
       saveTypes,
       saveType: 'scene',
       isAdd: false,
+      //isAddChild: false,//子账号添加框显示
       serverName,
       c_num: '',
       tableData: [],
       tableHeader,
-      dialogFormVisible: false,
+      ShebeiVisible:false,//添加设备显示
+      dialogFormVisible: false,//子账号管理显示
+      addZiVisible:false,//添加子账号显示
+      changeZiVisible:false,//修改子账号显示
       chargeVisible: false,
       deviceFormVisible: false,
       loadinglogoVisible: false,
       currentPage: 1,
       num: 1,
       loading: false,
-      formLabelWidth: '100px',
+      formLabelWidth: '150px',
       errMsg: '该ID不可用',
       userName: '',
       recharge_id: '',
@@ -395,6 +565,7 @@ export default {
     size () {
       this.refresh()
     },
+    //监听需要新增的设备数num
     num (newVal, oldVal) {
       if (newVal > oldVal) {
         this.addDevies.push({
@@ -405,6 +576,19 @@ export default {
       } else {
         this.addDevies.pop()
       }
+    },
+    //监听需要新增的子账号数ZiNum
+    ZiNum(newVal,oldVal){
+      if (newVal > oldVal) {
+        this.addZi.push({
+          name: '',
+          phone:'',
+          isAvailable: false,
+          hasCheck: false
+        })
+      } else {
+        this.addZi.pop()
+      }
     }
   },
   // 方法集合
@@ -695,7 +879,7 @@ export default {
       }, 0)
     },
     add (item) {
-      this.dialogFormVisible = true
+      this.ShebeiVisible = true
       this.c_subNum = item.subNum
       this.c_num = item.num
       this.c_userName = item.userName
@@ -721,6 +905,7 @@ export default {
       }
       this.refresh()
     },
+    //将addDevies[]里value为true的对象push进temp[]中,返回用 ; 间隔元素的temp[]
     canIsave () {
       let temp = []
       for (let i = 0; i < this.addDevies.length; i++) {
@@ -733,6 +918,7 @@ export default {
       }
       return temp.join(';')
     },
+    //保存‘新增设备’
     save (userName) {
       let params = {
         childName: this.canIsave() || null,
@@ -831,6 +1017,182 @@ export default {
         this.total = result.message.total
         this.currentPage = result.message.pageNum
       }
+    },
+    //显示子管理窗口
+    ShowZi(row){
+      this.c_subNum = row.subNum
+      this.c_num = row.num
+      this.c_userName = row.userName
+      this.c_name = row.name
+      this.c_id = row.id
+      this.dialogFormVisible = true
+      this.ZiGuanli.id = row.id
+      this.ZiGuanli.subNum = row.subNum
+      //this.ZiGuanli.subUsers = this.ShowChildUser
+      let params = {
+        id: row.id
+      }
+      this.$http({
+        method: 'post',
+        data: params,
+        url: '/company/selectUserList',
+        headers:{
+          token: window.localStorage.getItem('zfb_token')
+        }
+      }).then(res => {
+        if(res.code === 200){
+          this.ShowChildUser = res.message.list
+        }else{
+          this.$notify.error({
+            title:'子账号加载失败',
+            message: res.message
+          })
+        }
+      })
+    },
+    //保存‘新增子账号’,userName是企业账号,id为设备ID,subNum为子账号数量
+    addZi_save(){
+      let i = 0;
+      let phoneList = new Array()
+      for(i;i<this.ShowChildUser.length;i++){
+        phoneList[i] = this.ShowChildUser[i].phone
+      }
+      //先进行已有子账号和子账号容量的比较
+      if(this.ShowChildUser.length < (parseInt(this.c_subNum) /*+ parseInt(this.c_num)*/)){
+        //进行该企业已有子账号和新增子账号比较是否已存在
+        if( phoneList.indexOf(this.addZi.phone) == -1 ){
+
+          let params = {
+            // id:'',
+            // name: this.addZi.name,
+            phone: this.addZi.phone
+          }
+          this.$http({
+            method: 'post',
+            data: params,
+            url: '/user/checkUserExists',
+            headers: {
+              token: window.localStorage.getItem('zfb_token')
+            }
+          }).then(res => {
+            //返回状态码是否200
+            if(res.code === 200){
+              if(res.message == true){
+                this.$notify.error({
+                  title: '添加失败',
+                  message: '该账号已被其他企业绑定'
+                })
+              }
+              else if(res.code == false){
+                this.ShowChildUser.unshift({...this.addZi})
+                this.addZi = {nickName:'',phone:'',id:''}
+                this.addZiVisible = false
+              }
+            }
+          })
+        }else{
+          this.$notify.error({
+              title: '添加失败',
+              message: '子账号已被该企业绑定'
+            })
+        }
+      }else{
+        this.$notify.error({
+              title: '添加失败',
+              message: '子账号数量已满'
+            })
+      }
+    },
+    //修改子账号
+    ChangeZi(row){
+      this.changeZiVisible = true
+      this.changeZi.id = row.id
+      this.changeZi.nickName = row.nickName
+      this.changeZi.phone = row.phone
+    },
+    //保存子账号修改
+    saveZichange(){
+      let i
+      for(i=0;i<this.ShowChildUser.length;i++){
+        if(this.ShowChildUser[i].id == this.changeZi.id){
+          this.ShowChildUser[i].nickName = this.changeZi.nickName
+          this.ShowChildUser[i].phone = this.changeZi.phone
+        }
+      }
+      //this.ZiGuanli.subUsers = this.ShowChildUser
+      this.changeZiVisible = false
+    },
+    JiebangZi(row){
+      this.$confirm('确定要解绑该子账号?','提示',{
+        confirmButtonText:'确定',
+        cancelButtonText:'取消',
+        type:'warning'
+      }).then(()=>{
+        let i
+        for(i=0;i<this.ShowChildUser.length;i++){
+          if(this.ShowChildUser[i].id == row.id){
+            this.ShowChildUser.splice(i,1)
+          }
+        }
+      })
+      /*let params = {
+        name: row.name,
+        phone: row.phone
+      }
+      let result = this.$http({
+        method: 'post',
+        data: params,
+        url: '',
+        headers: {
+          token: window.localStorage.getItem('zfb_token')
+        }
+      })
+      if (result.code === 200){
+        this.$confirm('确定要解绑该子账号?','提示',{
+          confirmButtonText:'确定',
+          cancelButtonText:'取消',
+          type:'warning'
+        }).then(()=>{
+          this.ShowZi()
+        })
+      }else{
+        this.$notify.error({
+          title:'子账号解绑失败'
+        })
+      }*/
+    },
+    //子管理窗口保存
+    ZiGuanli_save(){
+      let params = {
+        id: this.ZiGuanli.id,
+        //subNum: this.ZiGuanli.subNum,
+        subNum: (parseInt(this.c_subNum) /*+ parseInt(this.c_num)*/).toString(),
+        subUsers: this.ShowChildUser
+      }
+      this.$http({
+        method: 'post',
+        data: params,
+        url: '/company/saveSubUsers',
+        headers: {
+          token: window.localStorage.getItem('zfb_token')
+        }
+      }).then(res => {
+        if(res.code === 200){
+          this.c_subNum = (parseInt(this.c_subNum) /*+ parseInt(this.c_num)*/).toString()
+          this.c_num = ''
+          this.ShowChildUser = res.message.list
+          this.$notify.success({
+            title: '保存成功'
+          })
+          this.dialogFormVisible = false
+          location.reload()//刷新页面
+        }else{
+          this.$notify.error({
+            title: '保存失败',
+            message: res.error
+          })
+        }
+      })
     }
   },
   // 生命周期 - 创建完成(可以访问当前this实例)

+ 27 - 3
src/pages/layout/aside.vue

@@ -6,7 +6,7 @@
         <span>导航面板</span>
       </vcenter>
     </div>
-    <ul class="aside-ul">
+    <ul class="aside-ul" v-if="roleType == -1">
       <li class="aside-li" v-for="(item,i) in aside" :key="i">
         <div @click="clickNav(item)" :class="{'aside-li-div':true,'active':item.id&&item.id===activeIdx}" >
           <vcenter>
@@ -25,6 +25,16 @@
         </ul>
       </li>
     </ul>
+    <ul class="aside-ul" v-if=" roleType != -1">
+      <li class="aside-li">
+        <div class="aside-li-div">
+          <vcenter>
+            <i class="el-icon-tickets" style="float:left;width:27px;"></i>
+            <span style="vertical-align: middle;">场景管理</span>
+          </vcenter>
+        </div>
+      </li>
+    </ul>
   </div>
 </div>
 </template>
@@ -40,7 +50,7 @@ const aside = [{
   subItem: [{
     name: '企业账号',
     id: '1-1',
-    url: '/'
+    url: '/home'
   }, {
     name: '企业认证',
     id: '1-2',
@@ -84,6 +94,19 @@ const aside = [{
   icon: 'icon-xinxifabu',
   url: '/download',
   isShow: false
+},{
+  name:'设备管理',
+  id:'5',
+  icon:'icon-xinxifabu',
+  url:'/equipment',
+  isShow:false
+},
+{
+  name:'场景管理',
+  id:'6',
+  icon:'icon-guanggao',
+  url:'/scene',
+  isShow: false
 }]
 export default {
 
@@ -93,7 +116,8 @@ export default {
   data () {
     return {
       aside,
-      a_tips: 0
+      a_tips: 0,
+      roleType: window.localStorage.getItem('zfb_roleType')
     }
   },
   computed: {

+ 4 - 1
src/pages/login/index.vue

@@ -43,6 +43,7 @@
 
 <script>
 import vcenter from '@/components/vcenter'
+import {serverName} from '@/utils/http'
 export default {
   name: 'login',
   components: {
@@ -70,6 +71,7 @@ export default {
     }
 
     return {
+      serverName,
       fullscreenLoading: false,
       checked: true,
       logoImg: require('@/assets/images/index_logo@2x.png'),
@@ -103,6 +105,7 @@ export default {
         this.fullscreenLoading = true
         if (res.code === 200) {
           window.localStorage.setItem('zfb_token', String(res.message.token))
+          window.localStorage.setItem('zfb_roleType', res.message.type)
           if (this.checked) {
             window.localStorage.setItem('zfb_username', this.ruleForm2.username)
             window.localStorage.setItem('zfb_pass', this.ruleForm2.pass)
@@ -110,7 +113,7 @@ export default {
             window.localStorage.setItem('zfb_username', '')
             window.localStorage.setItem('zfb_pass', '')
           }
-          this.$router.push('/')
+          this.$router.push('/scene')
         } else {
           this.fullscreenLoading = false
           this.$notify.error({

+ 1 - 0
src/pages/rental-info/index.vue

@@ -514,6 +514,7 @@ export default {
           pageSize: this.size
         }
       })
+      //发布日期和状态格式规范
       for (let i = 0; i < result.message.list.length; i++) {
         result.message.list[i].createTime = this.$base.dateFormat('yyyy-MM-dd hh:mm', new Date(result.message.list[i].createTime))
         result.message.list[i].state = this.fixState(result.message.list[i].state)

+ 389 - 0
src/pages/scene/index.vue

@@ -0,0 +1,389 @@
+<template>
+    <div class="con" v-loading.fullscreen.lock="loading">
+        <div class="h-header">
+            <vcenter>
+                <div class="h-input">
+                    <el-input v-model="CompanyName" placeholder="请输入公司名称"></el-input>
+                </div>
+                <div class="h-input">
+                  <el-input v-model="SceneName" placeholder="请输入场景名称"></el-input>
+                </div>
+                <div class="h-input">
+                    <el-input v-model="ShebeiID" placeholder="请输入设备ID"></el-input>
+                </div>
+                <div>
+                    <el-button type="primary" @click="search">搜索</el-button>
+                </div>
+            </vcenter>
+        </div>
+
+        <div class="h-body">
+          <div style="padding-left:20px;">
+          <vcenter>
+          <!--<el-tabs>
+            <el-tab-pane @click="" label="新场景"></el-tab-pane>
+            <el-tab-pane @click="" label="旧场景"></el-tab-pane>
+          </el-tabs>-->
+          </vcenter>
+          </div>
+            <el-table height="520" :data="tableData" style="width: 100%;padding:0 20px;">
+                <el-table-column
+                 v-for="(item,i) in tableHeader"
+                 :key="i"
+                 :prop="item.name"
+                 :label="item.label"
+                >
+                </el-table-column>
+                <el-table-column label="操作">
+                  <template slot-scope="scope">
+                  <span @click="S_download(scope.row)" style="cursor:pointer;color:blue;">下载场景</span>
+                  </template>
+                </el-table-column>
+            </el-table>
+            <div class="p-con">
+                <el-pagination
+                 @size-change="handleSizeChange"
+                 @current-change="handleCurrentChange"
+                 :current-page.sync="currentPage"
+                 :page-size="size"
+                 layout="prev, pager, next, jumper"
+                 :total="total"
+                ></el-pagination>
+            </div>
+        </div>
+
+    </div>
+</template>
+
+<script>
+import vcenter from '@/components/vcenter'
+export default {
+    components:{vcenter},
+    data(){
+        return{
+            CompanyName:'',
+            SceneName:'',
+            ShebeiID:'',
+            currentPage:1,
+            size:10,
+            total:0,
+            tableHeader:[
+                {name:'sceneName',label:'场景名称'},{name:'webSite',label:'场景链接'},
+                {name:'companyName',label:'企业名称'},{name:'childName',label:'拍摄设备ID'},
+                {name:'createTime',label:'拍摄时间'},{name:'viewCount',label:'场景访问量'},
+                {name:'num',label:'场景码'}
+            ],
+            tableData:[],
+            loading: false,
+            type:'',
+
+        }
+    },
+    methods:{
+      S_download(row){
+        let webSite = row.num
+        /*let i = webSite.indexOf('=')
+        let sceneCode = webSite.slice(i+1)*/
+        this.loading = true
+        this.$http({
+          method: 'get',
+          url:`/scene/downloadSceneData?sceneNum=${webSite}`,
+          headers:{
+            token: this.token
+          }
+        }).then(res =>{
+          this.loading = false
+          if (res.code === 200){
+            window.open(`/${res.message}`, '_blank')
+          } else {
+            return this.$alert(res.message, '提示', {
+              confirmButtonText: '确定'
+            })
+          }
+        })
+      },
+        handleSizeChange(val){
+            console.log(`每页 ${val} 条`)
+        },
+        handleCurrentChange(val){
+            console.log(`当前页: ${val}`)
+        },
+        async getData () {
+          let params = {
+            companyName: this.CompanyName || '',
+            childName: this.ShebeiID || '',
+            sceneName: this.SceneName || '',
+            //startTime: this.value5 ? this.value5[0] : '',
+            //endTime: this.value5 ? this.value5[1] : '',
+            //state: this.dropdown_active.id !== '' ? this.dropdown_active.id : '',
+            type: this.type
+          }
+          let result = await this.$http({
+            method: 'post',
+            data: params,
+            url: '/scene/pageList',
+            headers: {
+              token: window.localStorage.getItem('zfb_token'),
+              pageNum: this.currentPage,
+              pageSize: this.size
+            }
+          })
+          //发布日期和状态格式规范
+          /*for (let i = 0; i < result.message.list.length; i++) {
+            result.message.list[i].createTime = this.$base.dateFormat('yyyy-MM-dd hh:mm', new Date(result.message.list[i].createTime))
+            result.message.list[i].state = this.fixState(result.message.list[i].state)
+          }*/
+          if (result.code === 200){
+            this.tableData = result.message.list
+          }else{
+            return this.$alert(result.error, '提示', {
+              confirmButtonText: '确定'
+            })
+          }
+
+          this.total = result.message.total
+          this.currentPage = result.message.pageNum
+        },
+        refresh () {
+          this.loading = true
+          this.getData()
+          this.loading = false
+        },
+        search(){
+          this.currentPage === 1 ? this.refresh() : this.currentPage = 1
+        }
+    },
+    mounted(){
+      this.refresh()
+    },
+    watch:{
+      currentPage(){
+        this.refresh()
+      },
+      size(){
+        this.refresh()
+      },
+      num (newVal, oldVal) {
+      if (newVal > oldVal) {
+        this.addDevies.push({
+          value: '',
+          isAvailable: false,
+          hasCheck: false
+        })
+        } else {
+        this.addDevies.pop()
+        }
+      }
+    }
+}
+</script>
+
+<style lang="scss" scoped>
+.con {
+  .time-data{
+    position: relative;
+    .select-data{
+      position: absolute;
+      left: 0;
+      top: 0;
+      opacity: 0;
+      cursor: pointer;
+    }
+    >span{
+      color: #0175dc;
+    }
+  }
+  .ei-num {
+    .el-input-number {
+      width: 90%;
+    }
+  }
+  .clear-music {
+    position: relative;
+    text-align: right;
+    top: -30px;
+    color: #999;
+    cursor: pointer;
+  }
+  .musicIcon {
+    width: 100%;
+    height: 100%;
+    line-height: 1;
+    margin-top: 35px;
+    img {
+      width: 50px;
+      height: auto;
+    }
+    p {
+      font-weight: bold;
+      font-size: 14px;
+      color: #000;
+      line-height: 20px;
+      height: 20px;
+      margin-top: 20px;
+    }
+  }
+  .icon-plus {
+    margin-left: 15px;
+    width: 40px;
+    height: 38px;
+    line-height: 38px;
+    text-align: center;
+    background: #f5f7fa;
+    color: #999;
+    cursor: pointer;
+    font-size: 13px;
+    display: inline-block;
+    border: 1px solid #dcdfe6;
+    border-radius: 4px;
+    &:hover {
+      border: 1px solid #c0c4cc;
+    }
+  }
+  .add-num {
+    margin-left: 15px;
+    width: 250px;
+    .icon-close,
+    .icon-correct {
+      line-height: 1;
+      color: #999;
+    }
+    input[type="number"]::-webkit-inner-spin-button,
+    input[type="number"]::-webkit-outer-spin-button {
+      -webkit-appearance: none;
+      margin: 0;
+    }
+  }
+
+  .ei-input {
+    width: 100%;
+    max-height: 200px;
+    overflow-y: auto;
+    .input-con {
+      display: inline-block;
+      width: 45%;
+      margin: 2px 5px 2px 0;
+      height: 60px;
+      position: relative;
+      .el-input_err {
+        & /deep/ .el-input__inner {
+          border: 1px solid #f56c6c;
+        }
+      }
+      .el-input_success {
+        & /deep/ .el-input__inner {
+          border: 1px solid #67c23a;
+        }
+      }
+      span {
+        color: #f56c6c;
+        font-size: 12px;
+        line-height: 1;
+        padding-top: 4px;
+        position: absolute;
+        left: 0;
+      }
+    }
+  }
+  .h-header {
+    height: 80px;
+    background-color: #fff;
+    padding-left: 20px;
+    box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.1);
+    border-radius: 3px;
+
+    div {
+      display: inline-block;
+    }
+
+    .h-input {
+      width: 220px;
+    }
+  }
+
+  .h-body {
+    width: 100%;
+    margin: 30px 0 0;
+    padding-top: 20px;
+    box-shadow: 0 0 12px 0 rgba(0, 0, 0, 0.1);
+    border-radius: 3px;
+    background-color: #fff;
+    
+    .tabs{
+      padding-left: 100px;
+    }
+
+    .logo-add {
+      div {
+        cursor: pointer;
+        line-height: 40px;
+        border: 1px dotted #dcdfe6;
+        border-radius: 4px;
+        font-weight: bold;
+        font-size: 18px;
+        display: inline-block;
+        width: 40px;
+        height: 40px;
+        background: #f5f7fa;
+        position: relative;
+        img {
+          width: 100%;
+          height: 100%;
+          position: absolute;
+          top: 0;
+          left: 0;
+        }
+        span {
+          position: absolute;
+          z-index: 100;
+          left: 0;
+          top: 0;
+          width: 100%;
+          height: 100%;
+        }
+      }
+    }
+
+    .o-span {
+      color: #0175dc;
+      cursor: pointer;
+    }
+
+    .p-con {
+      width: 100%;
+      text-align: right;
+      padding: 25px 20px 30px;
+    }
+  }
+
+  .d-table {
+    border: 1px solid #ccc;
+    .d-con {
+      max-height: 200px;
+      overflow-y: scroll;
+    }
+    .d-header {
+      font-weight: bold;
+    }
+    .d-header,
+    .d-body {
+      height: 40px;
+      line-height: 40px;
+      width: 100%;
+      border-bottom: 1px solid #ccc;
+      &:last-child {
+        border: none;
+      }
+      span {
+        text-align: center;
+        display: inline-block;
+        width: 24%;
+
+      }
+      .unbind{
+        cursor: pointer;
+      }
+    }
+  }
+}
+</style>

+ 19 - 1
src/router/index.js

@@ -9,7 +9,7 @@ const router = new Router({
       component: () => import('@/pages/layout/'),
       children: [
         {
-          path: '/',
+          path: '/home',
           name: '企业账号',
           component: () => import('@/pages/home'),
           meta: {index: '1-1'}
@@ -55,6 +55,24 @@ const router = new Router({
           name: '场景下载',
           component: () => import('@/pages/download'),
           meta: {index: '4'}
+        },
+        {
+          path:'/equipment',
+          name:'设备管理',
+          component:() => import('@/pages/equipment'),
+          meta:{index: '5'}
+        },
+        // {
+        //   path: '/device',
+        //   name: '设备管理',
+        //   component: require('@/pages/device').default,
+        //   meta: {index: '5'}
+        // },
+        {
+          path:'/scene',
+          name:'场景管理',
+          component:()=>import('@/pages/scene'),
+          meta:{index:'6'}
         }
       ]
     },

+ 3 - 3
src/utils/http.js

@@ -3,9 +3,9 @@ import Vue from 'vue'
 import router from '../router'
 
 var isProduction = process.env.NODE_ENV === 'production'
-// const serverName = isProduction ? '' : 'http://192.168.0.207:7081/'
+const serverName = isProduction ? '' : '/api'
 
-const serverName = isProduction ? '' : 'https://admin.zhifangbao.com/'
+//const serverName = isProduction ? '' : 'https://admin.zhifangbao.com/'
 
 const vue = new Vue()
 
@@ -54,7 +54,7 @@ axios.interceptors.response.use(
         }
         break
       case 500:
-        vue.$alert(data.message, '提示', {
+        vue.$alert(data.message || data.error, '提示', {
           confirmButtonText: '确定',
           callback: function () {
           }