|
@@ -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实例)
|