Commit fa388174 authored by zhengke's avatar zhengke

修改

parent 01434f90
...@@ -18,14 +18,13 @@ ...@@ -18,14 +18,13 @@
</div> </div>
</div> </div>
<el-table :data="tableData" v-loading="loading" border style="width: 100%; margin: 20px 0"> <el-table :data="tableData" v-loading="loading" border style="width: 100%; margin: 20px 0">
<el-table-column prop="GroupId" label="ID" width="150"> </el-table-column> <el-table-column prop="GroupId" label="ID" width="100"> </el-table-column>
<el-table-column prop="GroupName" label="分组名称" width="200"> </el-table-column> <el-table-column prop="GroupName" label="分组名称" width="200"> </el-table-column>
<el-table-column prop="LookGroupList" label="可查看分组" width="300"> <el-table-column prop="LookGroupList" label="可查看分组" width="300">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="(item,index) in scope.row.LookGroupList" :key="index" style="display:inline-block;"> <el-tag v-for="(item,index) in scope.row.LookGroupList" size="mini" style="margin-right:5px;" :key="index">
{{item.GroupName}} {{item.GroupName}}</el-tag>
</span> </template>
</template>
</el-table-column> </el-table-column>
<el-table-column prop="CreateDate" width="200" label="加入时间"></el-table-column> <el-table-column prop="CreateDate" width="200" label="加入时间"></el-table-column>
<el-table-column prop="address" label="操作" fixed="right"> <el-table-column prop="address" label="操作" fixed="right">
...@@ -49,12 +48,12 @@ ...@@ -49,12 +48,12 @@
<!-- 新增修改用户分组 --> <!-- 新增修改用户分组 -->
<el-dialog :title="commonTitle" :visible.sync="IsShowGroup" width="600px" :close-on-click-modal="false"> <el-dialog :title="commonTitle" :visible.sync="IsShowGroup" width="600px" :close-on-click-modal="false">
<div> <div>
<el-form :model="addMsg" ref="addMsg" label-width="150px"> <el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="150px">
<el-form-item label="分组名称"> <el-form-item label="分组名称" prop="GroupName">
<el-input v-model="addMsg.GroupName" class="w300" maxlength="30" placeholder="请输入分组名称"></el-input> <el-input v-model="addMsg.GroupName" class="w300" maxlength="30" placeholder="请输入分组名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="可查看分组"> <el-form-item label="可查看分组">
<el-select v-model="addMsg.GroupIdList" multiple class="w300"> <el-select v-model="addMsg.GroupIdList" @visible-change="getgroupList" multiple class="w300">
<el-option v-for="item in groupArray" :key="item.GroupId" :label="item.GroupName" :value="item.GroupId"> <el-option v-for="item in groupArray" :key="item.GroupId" :label="item.GroupName" :value="item.GroupId">
</el-option> </el-option>
</el-select> </el-select>
...@@ -63,7 +62,7 @@ ...@@ -63,7 +62,7 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="IsShowGroup = false">关 闭</el-button> <el-button size="small" @click="IsShowGroup = false">关 闭</el-button>
<el-button size="small" type="primary" @click="SaveGroup()">确 定</el-button> <el-button size="small" type="primary" @click="SaveGroup('addMsg')">确 定</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
...@@ -95,6 +94,13 @@ ...@@ -95,6 +94,13 @@
}, },
IsShowGroup: false, //是否显示用户分组弹窗 IsShowGroup: false, //是否显示用户分组弹窗
groupArray: [], //用户分组列表 groupArray: [], //用户分组列表
rules: {
GroupName: [{
required: true,
message: '请填写分组名称',
trigger: 'blur'
}],
},
}; };
}, },
created() { created() {
...@@ -115,17 +121,21 @@ ...@@ -115,17 +121,21 @@
this.addMsg.IsSpecial = 0; this.addMsg.IsSpecial = 0;
this.commonTitle = '新增分组' this.commonTitle = '新增分组'
} }
console.log(obj, '数据');
this.IsShowGroup = true; this.IsShowGroup = true;
}, },
//保存用户分组信息 //保存用户分组信息
SaveGroup() { SaveGroup(formName) {
this.apipost("/api/User/SetMemberGroup", this.addMsg, res => { this.$refs[formName].validate((valid) => {
console.log(res); if (valid) {
if (res.data.resultCode == 1) { this.apipost("/api/User/SetMemberGroup", this.addMsg, res => {
this.Success(res.data.message); if (res.data.resultCode == 1) {
this.getList(); this.Success(res.data.message);
this.IsShowGroup = false; this.getList();
this.IsShowGroup = false;
}
});
} else {
return false;
} }
}); });
}, },
...@@ -145,7 +155,7 @@ ...@@ -145,7 +155,7 @@
that.apipost("/api/User/DeleteMemberGroup", { that.apipost("/api/User/DeleteMemberGroup", {
GroupId: item.GroupId GroupId: item.GroupId
}, res => { }, res => {
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
that.Success(res.data.message); that.Success(res.data.message);
that.getList(); that.getList();
} }
...@@ -160,6 +170,8 @@ ...@@ -160,6 +170,8 @@
this.total = res.data.data.count; this.total = res.data.data.count;
let pageData = res.data.data.pageData; let pageData = res.data.data.pageData;
this.tableData = pageData; this.tableData = pageData;
} else {
this.Error(res.data.message);
} }
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment