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>
</li> <el-input v-model='msg.Name' placeholder="请输入内容"></el-input>
<li> </span>
<span><em>状态</em><el-select v-model='msg.Status' placeholder="不限"> </li>
<el-option label='不限' value=''></el-option> <li>
<el-option label='正常' value='0'></el-option> <span><em>状态</em>
<el-option label='冻结' value='1'></el-option> <el-select v-model='msg.Status' placeholder="不限">
</el-select> <el-option label='不限' value=''></el-option>
</span> <el-option label='正常' value='0'></el-option>
</li> <el-option label='冻结' value='1'></el-option>
<!-- <li> </el-select>
<span><em>版本</em><el-select v-model='msg.Versions_Id' placeholder="不限"> </span>
<el-option label='不限' value=''></el-option> </li>
<el-option v-for='item in versions' <li>
:key="item.Id" <input type="button" class="hollowFixedBtn" @click="resetPageIndex();getList()" value="查询" />
:label="item.VersionsName" <input type="button" @click="outerVisible = true,dialogTitle='新增角色',resetForm('addMsg')" class="normalBtn"
:value="item.Id" value="新增" />
></el-option> </li>
</el-select> </ul>
</span> </div>
</li> --> <table class="singeRowTable" border="0" cellspacing="0" cellpadding="0">
<li> <tr>
<input type="button" class="hollowFixedBtn" @click="resetPageIndex();getList()" value="查询" /> <th width="300">角色名称</th>
<input type="button" @click="outerVisible = true,dialogTitle='新增角色',resetForm('addMsg')" class="normalBtn" value="新增" /> <th width="800">描述</th>
</li> <th width="100">状态</th>
</ul> <th>操作人</th>
</div> <th>操作</th>
<table class="singeRowTable" border="0" cellspacing="0" cellpadding="0"> </tr>
<tr> <tr v-for="(item,index) in dataList">
<th width="300">角色名称</th> <td>{{item.Name}}</td>
<th width="800">描述</th> <td>{{item.Description}}</td>
<th width="100">状态</th> <td>{{item.Status==0?'正常':'冻结'}}</td>
<!-- <th>版本名称</th> --> <td>{{item.EmName}}</td>
<th>操作人</th> <td>
<th>操作</th> <el-row>
</tr> <el-tooltip class="item" effect="dark" content="修改" placement="top-start">
<tr v-for="(item,index) in dataList"> <el-button @click="outerVisible = true,dialogTitle='修改角色',updateData(item.Id)" type="primary" icon="el-icon-edit"
<td>{{item.Name}}</td> circle></el-button>
<td>{{item.Description}}</td> </el-tooltip>
<td>{{item.Status==0?'正常':'冻结'}}</td>
<!-- <td>{{item.VersionsName}}</td> -->
<td>{{item.EmName}}</td>
<td>
<el-row>
<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-tooltip>
<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-tooltip>
</el-row>
</td>
</tr>
</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>
<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-item maxlength='50' label="角色名称" prop="Name">
<el-input class='w217' type="text" v-model="addMsg.Name" :placeholder="$t('pub.pleaseImport')"></el-input>
</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-switch v-model="addMsg.Status" active-value="0" inactive-value="1"></el-switch>
</el-form-item>
<el-form-item label="描述" prop="Description">
<el-input maxlength='250' class='w217' type="textarea" v-model="addMsg.Description"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<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>
</div>
</el-dialog>
</div>
<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-tooltip>
</el-row>
</td>
</tr>
</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>
<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-item maxlength='50' label="角色名称" prop="Name">
<el-input class='w217' type="text" v-model="addMsg.Name" :placeholder="$t('pub.pleaseImport')"></el-input>
</el-form-item>
<el-form-item label="状态" prop="Status">
<el-switch v-model="addMsg.Status" active-value="0" inactive-value="1"></el-switch>
</el-form-item>
<el-form-item label="描述" prop="Description">
<el-input maxlength='250' class='w217' type="textarea" v-model="addMsg.Description"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<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>
</div>
</el-dialog>
</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,
dataList: [], dataList: [],
msg: { msg: {
pageIndex: 1, pageIndex: 1,
pageSize: 15, pageSize: 15,
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: [{
verSionMsg: { required: false,
Status: 0 message: '请输入描述',
}, trigger: 'change'
} }],
},
mounted() { },
verSionMsg: {
// this.msg.Versions_Id = this.$route.query.id Status: 0
this.getList() },
}, }
methods: { },
getList() { //获取列表数据 mounted() {
this.apipost("admin_get_RoleGetPageList", this.msg, res => { this.getList()
if(res.data.resultCode==1){ },
this.dataList = res.data.data.pageData; methods: {
this.total = res.data.data.count; getList() { //获取列表数据
console.log(this.dataList) this.apipost("admin_get_RoleGetPageList", this.msg, res => {
}else{} if (res.data.resultCode == 1) {
}, err => {}) this.dataList = res.data.data.pageData;
}, this.total = res.data.data.count;
getVersion() { //获取版本信息 } else {}
this.apipost('admin_get_SysVersionsGetList', this.verSionMsg, res => { }, err => {})
this.versions = res.data.data; },
//console.log(this.versions) getVersion() { //获取版本信息
}, err => { this.apipost('admin_get_SysVersionsGetList', this.verSionMsg, res => {
}) this.versions = res.data.data;
}, }, err => {})
addData(){ //添加角色 },
this.apipost("admin_post_RoleSet",this.addMsg,res=>{ addData() { //添加角色
if(res.data.resultCode==1) this.apipost("admin_post_RoleSet", this.addMsg, res => {
{ 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 => {
this.addMsg.Name = res.data.data.Name if (res.data.resultCode == 1) {
this.addMsg.Description = res.data.data.Description this.addMsg.Name = res.data.data.Name
// this.addMsg.Versions_Id = res.data.data.Versions_Id this.addMsg.Description = res.data.data.Description
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 => {})
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
this.getList(); this.getList();
}, },
resetPageIndex() { resetPageIndex() {
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,
submitForm(addMsg) {//提交创建、修改表单 query: {
this.$refs[addMsg].validate((valid) => { "id": id,
if (valid) { blank: 'y',
this.addData(); tab: '权限设置'
}
} else { })
return false; },
} submitForm(addMsg) { //提交创建、修改表单
}); this.$refs[addMsg].validate((valid) => {
}, if (valid) {
closeChangeMachie(done){//弹出框关闭初始化弹框内表单 this.addData();
done(); } else {
this.resetForm('addMsg'); return false;
}, }
resetForm(formName) {//弹出框取消 初始化谈框内表单 });
this.addMsg.Id='0'; },
this.addMsg.Status='0'; closeChangeMachie(done) { //弹出框关闭初始化弹框内表单
this.$refs[formName].resetFields(); done();
} this.resetForm('addMsg');
} },
} resetForm(formName) { //弹出框取消 初始化谈框内表单
this.addMsg.Id = '0';
this.addMsg.Status = '0';
this.$refs[formName].resetFields();
}
}
}
</script> </script>
\ No newline at end of file
<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"> <!--保存-->
<tr>
<th class="first"> <table border="0" cellspacing="0" cellpadding="0" class="LP_table">
<span class="Lp_role">角色</span> <tr>
<span class="Lp_company">公司</span> <th class="first">
</th> <span class="Lp_role">角色</span>
<th>成都</th> <span class="Lp_company">公司</span>
<th>成都</th> </th>
<th>成都</th> <template v-for="item in BranchList">
<th>成都</th> <th>
<th>成都</th> {{item.BName}}
<th>操作</th> </th>
</tr> </template>
<tr> <th>
<td> 操作
<el-select filterable :placeholder="$t('pub.pleaseSel')" class="w150"> </th>
<el-option label="不限" value="-1"></el-option> </tr>
</el-select> <tr v-for="(item,index) in PageData">
</td> <td>
<td> <el-select :placeholder="$t('pub.pleaseSel')" class="w150" v-model="item.RoleId">
<el-input class="w80" placeholder="金額"></el-input> <el-option label="不限" :value="0"></el-option>
<el-input class="w80" placeholder="百分比"></el-input> <el-option v-for="item in RoleList" :label="item.Name" :value="item.Id" :key="item.Id"></el-option>
</td> </el-select>
<td> </td>
<el-input class="w80" placeholder="金額"></el-input> <template v-for="subItem in item.DetailExtList">
<el-input class="w80" placeholder="百分比"></el-input> <td>
</td> <el-input class="w80" placeholder="金額" v-model="subItem.LessMoney"></el-input>
<td> <el-input class="w80" placeholder="百分比" v-model="subItem.LessPercent"></el-input>
<el-input class="w80" placeholder="金額"></el-input> </td>
<el-input class="w80" placeholder="百分比"></el-input> </template>
</td> <td>
<td> <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>
<el-input class="w80" placeholder="百分比"></el-input> </td>
</td> </tr>
<td> <tfoot>
<el-input class="w80" placeholder="金額"></el-input> <tr>
<el-input class="w80" placeholder="百分比"></el-input> <td :colspan="1+BranchList.length">
</td> <input type='button' class="normalBtn" @click="AddItem()" value="新增"></input>
<td> </td>
<el-tooltip class="item" effect="dark" content="保存" placement="top-start"> </tr>
<el-button type="primary" icon="iconfont icon-baocun" circle></el-button> </tfoot>
</el-tooltip> </table>
</td>
</tr>
</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