|
|
@@ -24,6 +24,17 @@
|
|
|
</el-option>
|
|
|
</el-select>
|
|
|
</el-col>
|
|
|
+ <el-col :span="4">
|
|
|
+ <em>类型:</em>
|
|
|
+ <el-select v-model="panel.adminType">
|
|
|
+ <el-option
|
|
|
+ v-for="item in panel.typeList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-button size="" type="primary" @click="query" plain>查询</el-button>
|
|
|
</el-col>
|
|
|
@@ -32,7 +43,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="change">
|
|
|
- <el-button @click="addAdmin">新增管理员</el-button>
|
|
|
+ <el-button @click="addAdmin">新增</el-button>
|
|
|
<el-button @click="editList">编辑</el-button>
|
|
|
<el-button @click="delList">删除</el-button>
|
|
|
</div>
|
|
|
@@ -72,6 +83,19 @@
|
|
|
label="手机号"
|
|
|
>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="AdminType "
|
|
|
+ label="角色"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+<!-- // 1 会员 2 系统 3 店铺 4 教练-->
|
|
|
+ <span v-if="scope.row.AdminType == 1" style="color: #005EA2">会员</span>
|
|
|
+ <span v-if="scope.row.AdminType == 2" style="color: green">系统管理员</span>
|
|
|
+ <span v-if="scope.row.AdminType == 3" style="color: #8c939d">店铺管理员</span>
|
|
|
+ <span v-if="scope.row.AdminType == 4">教练</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
<el-table-column
|
|
|
prop="ShopName"
|
|
|
label="所属门店"
|
|
|
@@ -151,6 +175,16 @@
|
|
|
></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="用户角色">
|
|
|
+ <el-select v-model="form.adminType " placeholder="请选择用户角色">
|
|
|
+ <el-option
|
|
|
+ v-for="item in form.adminTypeList"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="备注">
|
|
|
<el-input v-model="form.memo"></el-input>
|
|
|
</el-form-item>
|
|
|
@@ -182,7 +216,7 @@
|
|
|
data() {
|
|
|
return {
|
|
|
dialogVisible: false,
|
|
|
- dialogTitle: '新增管理员',
|
|
|
+ dialogTitle: '新增',
|
|
|
// panel 配置项目
|
|
|
panel: {
|
|
|
userCode: '',
|
|
|
@@ -202,6 +236,13 @@
|
|
|
multipleSelection: [],
|
|
|
detectedmac: '',
|
|
|
time1: globalBt(),
|
|
|
+ type: ' ',
|
|
|
+ adminType: '',
|
|
|
+ typeList: [
|
|
|
+ {value: '', label: '全部'},
|
|
|
+ {value: 3, label: '店铺管理员'},
|
|
|
+ {value: 4, label: '教练'},
|
|
|
+ ],
|
|
|
},
|
|
|
multipleSelection: [],
|
|
|
pageination: {
|
|
|
@@ -219,13 +260,17 @@
|
|
|
phone: '',
|
|
|
memo: '',
|
|
|
btnState: 0,
|
|
|
+ adminType: 3,
|
|
|
+ adminTypeList: [
|
|
|
+ {value: 3, label: '店铺管理员'},
|
|
|
+ {value: 4, label: '教练'},
|
|
|
+ ],
|
|
|
},
|
|
|
shops: [],
|
|
|
tableData: []
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.panelSelect();
|
|
|
this.getTableQuery();
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -283,6 +328,7 @@
|
|
|
password: that.form.password,
|
|
|
name: that.form.name,
|
|
|
phone: that.form.phone,
|
|
|
+ adminType: that.form.adminType,
|
|
|
memo: that.form.memo,
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
@@ -390,6 +436,10 @@
|
|
|
ShopListQuery(postdata).then(res => {
|
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
|
+ if(json.Rs == ''){
|
|
|
+ that.$message.error('当前没有可选的店铺,请先在店面管理中添加店铺!');
|
|
|
+ return false
|
|
|
+ }
|
|
|
that.panel.options = turnShopResToOption(json.Rs);
|
|
|
that.shops = turnShopResToOption(json.Rs);
|
|
|
that.form.shopId = json.Rs[0].ShopID;
|
|
|
@@ -420,11 +470,11 @@
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
- let userId = that.multipleSelection[0].Id;
|
|
|
+ let userId = that.multipleSelection[0].Id;
|
|
|
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
- userId : userId ,
|
|
|
+ userId: userId,
|
|
|
status: 9,//0禁用1启用9删除
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
@@ -480,7 +530,7 @@
|
|
|
},
|
|
|
clearForm() {
|
|
|
// clear
|
|
|
- this.form.shopId = this.shops[0].value;
|
|
|
+ this.form.shopId = 0;
|
|
|
this.form.name = '';
|
|
|
this.form.userCode = '';
|
|
|
this.form.password = '';
|
|
|
@@ -493,7 +543,7 @@
|
|
|
// 重载店面列表
|
|
|
this.panelSelect();
|
|
|
this.dialogVisible = true
|
|
|
- this.dialogTitle = '新增管理员'
|
|
|
+ this.dialogTitle = '新增'
|
|
|
this.form.btnState = 0;
|
|
|
},
|
|
|
// 编辑管理员
|
|
|
@@ -527,8 +577,9 @@
|
|
|
this.form.password = '';
|
|
|
this.form.phone = row.Phone;
|
|
|
this.form.memo = row.Memo;
|
|
|
+ this.form.adminType = row.AdminType;
|
|
|
this.dialogVisible = true
|
|
|
- this.dialogTitle = '编辑管理员'
|
|
|
+ this.dialogTitle = '编辑'
|
|
|
this.form.btnState = 1;
|
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
|
@@ -548,6 +599,7 @@
|
|
|
shopId: this.panel.shopId,
|
|
|
name: this.panel.name,
|
|
|
phone: this.panel.phone,
|
|
|
+ adminType: this.panel.adminType,
|
|
|
start: 1,//
|
|
|
tableMax: 9999,//
|
|
|
};
|
|
|
@@ -622,14 +674,22 @@
|
|
|
return parseFloat(column).toFixed(2);
|
|
|
},
|
|
|
},
|
|
|
+ watch: {
|
|
|
+ $route(to) {
|
|
|
+ if (to.name == 'AdminManage') {
|
|
|
+ this.getTableQuery();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
@import "../assets/css/panel.css";
|
|
|
|
|
|
- .context { height: 770px;
|
|
|
- overflow-y: scroll;
|
|
|
+ .context {
|
|
|
+ height: 770px;
|
|
|
+ overflow-y: scroll;
|
|
|
|
|
|
display: block;
|
|
|
margin: 0 auto;
|
|
|
@@ -693,12 +753,15 @@
|
|
|
float: right;
|
|
|
margin-left: 10px;
|
|
|
}
|
|
|
+
|
|
|
/deep/ .el-dialog .el-select .el-input__inner {
|
|
|
width: 240px;
|
|
|
}
|
|
|
+
|
|
|
/deep/ .el-dialog .el-select {
|
|
|
width: 530px;
|
|
|
}
|
|
|
+
|
|
|
/deep/ .el-dialog .el-select .el-input__inner {
|
|
|
width: 530px;
|
|
|
}
|