Commit eba381c7 authored by 黄奎's avatar 黄奎

少价管理修改

parent b3299ace
<style>
</style>
<template> <template>
<div class="flexOne"> <div class="flexOne">
<div class="query-box"> <div class="query-box">
<ul> <ul>
<li> <li>
<span><em>角色名称</em><el-input v-model='msg.Name' placeholder="请输入内容"></el-input></span> <span><em>角色名称</em>
<el-input v-model='msg.Name' placeholder="请输入内容"></el-input>
</span>
</li> </li>
<li> <li>
<span><em>状态</em><el-select v-model='msg.Status' placeholder="不限"> <span><em>状态</em>
<el-select v-model='msg.Status' placeholder="不限">
<el-option label='不限' value=''></el-option> <el-option label='不限' value=''></el-option>
<el-option label='正常' value='0'></el-option> <el-option label='正常' value='0'></el-option>
<el-option label='冻结' value='1'></el-option> <el-option label='冻结' value='1'></el-option>
</el-select> </el-select>
</span> </span>
</li> </li>
<!-- <li>
<span><em>版本</em><el-select v-model='msg.Versions_Id' placeholder="不限">
<el-option label='不限' value=''></el-option>
<el-option v-for='item in versions'
:key="item.Id"
:label="item.VersionsName"
:value="item.Id"
></el-option>
</el-select>
</span>
</li> -->
<li> <li>
<input type="button" class="hollowFixedBtn" @click="resetPageIndex();getList()" value="查询" /> <input type="button" class="hollowFixedBtn" @click="resetPageIndex();getList()" value="查询" />
<input type="button" @click="outerVisible = true,dialogTitle='新增角色',resetForm('addMsg')" class="normalBtn" value="新增" /> <input type="button" @click="outerVisible = true,dialogTitle='新增角色',resetForm('addMsg')" class="normalBtn"
value="新增" />
</li> </li>
</ul> </ul>
</div> </div>
...@@ -37,7 +28,6 @@ ...@@ -37,7 +28,6 @@
<th width="300">角色名称</th> <th width="300">角色名称</th>
<th width="800">描述</th> <th width="800">描述</th>
<th width="100">状态</th> <th width="100">状态</th>
<!-- <th>版本名称</th> -->
<th>操作人</th> <th>操作人</th>
<th>操作</th> <th>操作</th>
</tr> </tr>
...@@ -45,66 +35,56 @@ ...@@ -45,66 +35,56 @@
<td>{{item.Name}}</td> <td>{{item.Name}}</td>
<td>{{item.Description}}</td> <td>{{item.Description}}</td>
<td>{{item.Status==0?'正常':'冻结'}}</td> <td>{{item.Status==0?'正常':'冻结'}}</td>
<!-- <td>{{item.VersionsName}}</td> -->
<td>{{item.EmName}}</td> <td>{{item.EmName}}</td>
<td> <td>
<el-row> <el-row>
<el-tooltip class="item" effect="dark" content="修改" placement="top-start"> <el-tooltip class="item" effect="dark" content="修改" placement="top-start">
<el-button @click="outerVisible = true,dialogTitle='修改角色',updateData(item.Id)" type="primary" icon="el-icon-edit" circle></el-button> <el-button @click="outerVisible = true,dialogTitle='修改角色',updateData(item.Id)" type="primary" icon="el-icon-edit"
circle></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip class="item" effect="dark" content="权限" placement="top-start"> <el-tooltip class="item" effect="dark" content="权限" placement="top-start">
<el-button @click="goUrl('permissionList',item.Id)" type="primary" icon="iconfont icon-quanxianguanli" circle></el-button> <el-button @click="goUrl('permissionList',item.Id)" type="primary" icon="iconfont icon-quanxianguanli"
circle></el-button>
</el-tooltip> </el-tooltip>
</el-row> </el-row>
</td> </td>
</tr> </tr>
</table> </table>
<el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" layout="total,prev, pager, next, jumper" :page-size=msg.pageSize :total=total> <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" layout="total,prev, pager, next, jumper"
:page-size=msg.pageSize :total=total>
</el-pagination> </el-pagination>
<el-dialog custom-class='w450' :title="dialogTitle" :visible.sync="outerVisible" center :before-close="closeChangeMachie"> <el-dialog custom-class='w450' :title="dialogTitle" :visible.sync="outerVisible" center :before-close="closeChangeMachie">
<el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px" > <el-form :model="addMsg" :rules="rules" ref="addMsg" label-width="100px">
<el-form-item maxlength='50' label="角色名称" prop="Name"> <el-form-item maxlength='50' label="角色名称" prop="Name">
<el-input class='w217' type="text" v-model="addMsg.Name" :placeholder="$t('pub.pleaseImport')"></el-input> <el-input class='w217' type="text" v-model="addMsg.Name" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item label="版本" prop="Versions_Id">
<el-select class='w217' v-model='addMsg.Versions_Id' placeholder="请选择">
<el-option v-for='item in versions' :key="item.Id" :label="item.VersionsName" :value="item.Id"></el-option>
</el-select>
</el-form-item> -->
<el-form-item label="状态" prop="Status"> <el-form-item label="状态" prop="Status">
<el-switch v-model="addMsg.Status" active-value="0" inactive-value="1"></el-switch> <el-switch v-model="addMsg.Status" active-value="0" inactive-value="1"></el-switch>
</el-form-item> </el-form-item>
<el-form-item label="描述" prop="Description"> <el-form-item label="描述" prop="Description">
<el-input maxlength='250' class='w217' type="textarea" v-model="addMsg.Description"></el-input> <el-input maxlength='250' class='w217' type="textarea" v-model="addMsg.Description"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<button class="hollowFixedBtn" @click="outerVisible = false,resetForm('addMsg'),getList()">{{$t('pub.cancelBtn')}}</button> &nbsp; <button class="hollowFixedBtn" @click="outerVisible = false,resetForm('addMsg'),getList()">{{$t('pub.cancelBtn')}}</button>
&nbsp;
<button class="normalBtn" type="primary" @click="submitForm('addMsg')">{{$t('pub.saveBtn')}}</button> <button class="normalBtn" type="primary" @click="submitForm('addMsg')">{{$t('pub.saveBtn')}}</button>
</div> </div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
switchValue:'1', switchValue: '1',
dialogTitle: '', dialogTitle: '',
insideDialogTxt: '保存成功!', insideDialogTxt: '保存成功!',
outerVisible: false, outerVisible: false,
innerVisible: false, innerVisible: false,
isRight:true, isRight: true,
versions: [], versions: [],
total: 0, total: 0,
currentPage: 1, currentPage: 1,
...@@ -115,22 +95,28 @@ ...@@ -115,22 +95,28 @@
Status: '0', Status: '0',
Name: '', Name: '',
}, },
addMsg:{ addMsg: {
Id:'0', Id: '0',
Name:'', Name: '',
Description:'', Description: '',
Status:'0', Status: '0',
}, },
rules:{ rules: {
Name:[ Name: [{
{ required: true, message: '请输入名称', trigger: 'blur' } required: true,
], message: '请输入名称',
Status:[ trigger: 'blur'
{ required: false, message: '', trigger: 'change' } }],
], Status: [{
Description:[ required: false,
{ required: false, message: '请输入描述', trigger: 'change' } message: '',
], trigger: 'change'
}],
Description: [{
required: false,
message: '请输入描述',
trigger: 'change'
}],
}, },
verSionMsg: { verSionMsg: {
...@@ -139,60 +125,54 @@ ...@@ -139,60 +125,54 @@
} }
}, },
mounted() { mounted() {
// this.msg.Versions_Id = this.$route.query.id
this.getList() this.getList()
}, },
methods: { methods: {
getList() { //获取列表数据 getList() { //获取列表数据
this.apipost("admin_get_RoleGetPageList", this.msg, res => { this.apipost("admin_get_RoleGetPageList", this.msg, res => {
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
this.dataList = res.data.data.pageData; this.dataList = res.data.data.pageData;
this.total = res.data.data.count; this.total = res.data.data.count;
console.log(this.dataList) } else {}
}else{}
}, err => {}) }, err => {})
}, },
getVersion() { //获取版本信息 getVersion() { //获取版本信息
this.apipost('admin_get_SysVersionsGetList', this.verSionMsg, res => { this.apipost('admin_get_SysVersionsGetList', this.verSionMsg, res => {
this.versions = res.data.data; this.versions = res.data.data;
//console.log(this.versions) }, err => {})
}, err => {
})
}, },
addData(){ //添加角色 addData() { //添加角色
this.apipost("admin_post_RoleSet",this.addMsg,res=>{ this.apipost("admin_post_RoleSet", this.addMsg, res => {
if(res.data.resultCode==1) if (res.data.resultCode == 1) {
{
this.$message.success(res.data.message) this.$message.success(res.data.message)
this.outerVisible=false; this.outerVisible = false;
this.getList() this.getList()
this.resetForm('addMsg'); this.resetForm('addMsg');
}else{ } else {
this.$message.error(res.data.message) this.$message.error(res.data.message)
} }
},err=>{}) }, err => {})
}, },
updateData(id){ //修改角色 updateData(id) { //修改角色
this.addMsg.Id=id; this.addMsg.Id = id;
this.apipost('admin_get_RoleGet',{RoleId:id},res=>{ this.apipost('admin_get_RoleGet', {
if(res.data.resultCode==1){ RoleId: id
console.log(res.data.data) }, res => {
if (res.data.resultCode == 1) {
this.addMsg.Name = res.data.data.Name this.addMsg.Name = res.data.data.Name
this.addMsg.Description = res.data.data.Description this.addMsg.Description = res.data.data.Description
// this.addMsg.Versions_Id = res.data.data.Versions_Id
this.addMsg.Status = res.data.data.Status.toString(); this.addMsg.Status = res.data.data.Status.toString();
}else{} } else {}
},err=>{}) }, err => {})
// this.addMsg = this.dataList[index] },
// this.addMsg.Status = this.dataList[index].Status.toString(); deleteData(id) {
}, this.apipost('admin_post_RoleRemove', {
deleteData(id){ RoleId: id
this.apipost('admin_post_RoleRemove', {RoleId:id}, res => { }, res => {
if(res.data.resultCode==1){ if (res.data.resultCode == 1) {
this.getList() this.getList()
}else{ } else {
alert(res.data.message) alert(res.data.message)
} }
}, err => {}) }, err => {})
...@@ -205,26 +185,32 @@ ...@@ -205,26 +185,32 @@
this.msg.pageIndex = 1; this.msg.pageIndex = 1;
this.currentPage = 1 this.currentPage = 1
}, },
goUrl(name,id){ goUrl(name, id) {
this.$router.push({ name: name,query:{"id":id,blank:'y',tab:'权限设置'}}) this.$router.push({
name: name,
query: {
"id": id,
blank: 'y',
tab: '权限设置'
}
})
}, },
submitForm(addMsg) {//提交创建、修改表单 submitForm(addMsg) { //提交创建、修改表单
this.$refs[addMsg].validate((valid) => { this.$refs[addMsg].validate((valid) => {
if (valid) { if (valid) {
this.addData(); this.addData();
} else { } else {
return false; return false;
} }
}); });
}, },
closeChangeMachie(done){//弹出框关闭初始化弹框内表单 closeChangeMachie(done) { //弹出框关闭初始化弹框内表单
done(); done();
this.resetForm('addMsg'); this.resetForm('addMsg');
}, },
resetForm(formName) {//弹出框取消 初始化谈框内表单 resetForm(formName) { //弹出框取消 初始化谈框内表单
this.addMsg.Id='0'; this.addMsg.Id = '0';
this.addMsg.Status='0'; this.addMsg.Status = '0';
this.$refs[formName].resetFields(); this.$refs[formName].resetFields();
} }
} }
......
<style> <style>
.LM_mainDiv{ .LM_mainDiv {
overflow-y:auto; overflow-y: auto;
} }
.LP_table{
.LP_table {
margin-top: 10px; margin-top: 10px;
background-color: #fff; background-color: #fff;
border-top: 1px solid #d1d1d1; border-top: 1px solid #d1d1d1;
border-left: 1px solid #d1d1d1; border-left: 1px solid #d1d1d1;
border-right: 1px solid #d1d1d1; border-right: 1px solid #d1d1d1;
font-size: 14px; font-size: 14px;
} }
.LP_table tr{
height:40px; .LP_table tr {
} height: 40px;
.LP_table tr th{ }
border-bottom:1px solid #d1d1d1;
border-right:1px solid #d1d1d1; .LP_table tr th {
border-bottom: 1px solid #d1d1d1;
border-right: 1px solid #d1d1d1;
position: relative; position: relative;
background-color: #E6E6E6; background-color: #E6E6E6;
} }
th[class=first]:before{
th[class=first]:before {
content: ""; content: "";
position: absolute; position: absolute;
width: 1px; width: 1px;
height:252px;/*这里需要自己调整,根据td的宽度和高度*/ height: 252px;
top:0; /*这里需要自己调整,根据td的宽度和高度*/
left:0; top: 0;
left: 0;
background-color: #d1d1d1; background-color: #d1d1d1;
display: block; display: block;
transform: rotate(-81deg);/*这里需要自己调整,根据线的位置*/ transform: rotate(-81deg);
/*这里需要自己调整,根据线的位置*/
transform-origin: top; transform-origin: top;
} }
.LP_table td{ .LP_table td {
border-bottom: 1px solid #d1d1d1; border-bottom: 1px solid #d1d1d1;
border-right: 1px solid #d1d1d1; border-right: 1px solid #d1d1d1;
text-align: center; text-align: center;
padding: 5px; padding: 5px;
min-width: 250px; min-width: 250px;
} }
.LP_table .el-button--primary{
padding:5px; .LP_table .el-button--primary {
} padding: 5px;
.Lp_role{ }
.Lp_role {
position: absolute; position: absolute;
top:15px; top: 15px;
left:30px; left: 30px;
} }
.Lp_company{
.Lp_company {
position: absolute; position: absolute;
right:30px; right: 30px;
top:5px; top: 5px;
} }
</style> </style>
<template> <template>
<div> <div>
<div class="LM_mainDiv"> <div class="LM_mainDiv">
<!--保存-->
<table border="0" cellspacing="0" cellpadding="0" class="LP_table"> <table border="0" cellspacing="0" cellpadding="0" class="LP_table">
<tr> <tr>
<th class="first"> <th class="first">
<span class="Lp_role">角色</span> <span class="Lp_role">角色</span>
<span class="Lp_company">公司</span> <span class="Lp_company">公司</span>
</th> </th>
<th>成都</th> <template v-for="item in BranchList">
<th>成都</th> <th>
<th>成都</th> {{item.BName}}
<th>成都</th> </th>
<th>成都</th> </template>
<th>操作</th> <th>
操作
</th>
</tr> </tr>
<tr> <tr v-for="(item,index) in PageData">
<td> <td>
<el-select filterable :placeholder="$t('pub.pleaseSel')" class="w150"> <el-select :placeholder="$t('pub.pleaseSel')" class="w150" v-model="item.RoleId">
<el-option label="不限" value="-1"></el-option> <el-option label="不限" :value="0"></el-option>
<el-option v-for="item in RoleList" :label="item.Name" :value="item.Id" :key="item.Id"></el-option>
</el-select> </el-select>
</td> </td>
<template v-for="subItem in item.DetailExtList">
<td> <td>
<el-input class="w80" placeholder="金額"></el-input> <el-input class="w80" placeholder="金額" v-model="subItem.LessMoney"></el-input>
<el-input class="w80" placeholder="百分比"></el-input> <el-input class="w80" placeholder="百分比" v-model="subItem.LessPercent"></el-input>
</td>
<td>
<el-input class="w80" placeholder="金額"></el-input>
<el-input class="w80" placeholder="百分比"></el-input>
</td>
<td>
<el-input class="w80" placeholder="金額"></el-input>
<el-input class="w80" placeholder="百分比"></el-input>
</td>
<td>
<el-input class="w80" placeholder="金額"></el-input>
<el-input class="w80" placeholder="百分比"></el-input>
</td> </td>
</template>
<td> <td>
<el-input class="w80" placeholder="金額"></el-input> <input type='button' class="normalBtn" @click="SaveLessPrice(item)" value="保存"></input>
<el-input class="w80" placeholder="百分比"></el-input> <input type='button' class="normalBtn" @click="RemoveItem(item,index)" value="删除"></input>
</td> </td>
<td> </tr>
<el-tooltip class="item" effect="dark" content="保存" placement="top-start"> <tfoot>
<el-button type="primary" icon="iconfont icon-baocun" circle></el-button> <tr>
</el-tooltip> <td :colspan="1+BranchList.length">
<input type='button' class="normalBtn" @click="AddItem()" value="新增"></input>
</td> </td>
</tr> </tr>
</tfoot>
</table> </table>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return { return {
getCompanyList: [], //分公司列表
}; BranchList: [],
}, qMsg: {
methods: { PageIndex: 1,
PageSize: 100
}, },
mounted() { PageData: [],
//角色列表
RoleList: []
};
},
methods: {
AddItem() {
var obj = {
Id: 0,
RoleId: 0,
DetailExtList: [],
};
this.BranchList.forEach(item => {
obj.DetailExtList.push({
Id: 0,
ManagerId: 0,
RB_Branch_Id: item.Id,
LessMoney: 0,
LessPercent: 0
});
});
if (this.PageData == null) {
this.PageData = [];
}
this.PageData.push(obj);
},
//保存少价管理
SaveLessPrice(item) {
this.apipost(
"lessprice_post_Set", item,
res => {
if (res.data.resultCode == 1) {
this.Success("操作成功!");
this.GetList();
} else {
this.Error(res.data.message);
}
},
err => {}
);
},
//获取列表
GetList() {
this.apipost(
"lessprice_get_GetPageList", this.qMsg,
res => {
if (res.data.resultCode == 1) {
this.BranchList = res.data.data.branchList;
this.PageData = res.data.data.DataList.pageData;
}
},
err => {}
);
},
//获取列表
GetRoleList() {
this.apipost(
"admin_get_RoleGetList", {},
res => {
if (res.data.resultCode == 1) {
this.RoleList = res.data.data;
}
},
err => {}
);
},
//获取列表
RemoveItem(item, index) {
var that = this;
this.Confirm("是否删除此少价信息?", function () {
if (item.Id > 0) {
that.apipost(
"lessprice_post_Remove", {
ID: item.Id
},
res => {
if (res.data.resultCode == 1) {
that.Success("操作成功!");
that.GetList();
} else {
that.Error(res.data.message);
}
},
err => {}
);
} else {
that.PageData.splice(index, 1);
}
});
},
},
mounted() {
this.GetRoleList();
this.GetList();
},
};
},
};
</script> </script>
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