Commit eba381c7 authored by 黄奎's avatar 黄奎

少价管理修改

parent b3299ace
<style>
.LM_mainDiv{
overflow-y:auto;
}
.LP_table{
.LM_mainDiv {
overflow-y: auto;
}
.LP_table {
margin-top: 10px;
background-color: #fff;
border-top: 1px solid #d1d1d1;
border-left: 1px solid #d1d1d1;
border-right: 1px solid #d1d1d1;
font-size: 14px;
}
.LP_table tr{
height:40px;
}
.LP_table tr th{
border-bottom:1px solid #d1d1d1;
border-right:1px solid #d1d1d1;
}
.LP_table tr {
height: 40px;
}
.LP_table tr th {
border-bottom: 1px solid #d1d1d1;
border-right: 1px solid #d1d1d1;
position: relative;
background-color: #E6E6E6;
}
th[class=first]:before{
}
th[class=first]:before {
content: "";
position: absolute;
width: 1px;
height:252px;/*这里需要自己调整,根据td的宽度和高度*/
top:0;
left:0;
height: 252px;
/*这里需要自己调整,根据td的宽度和高度*/
top: 0;
left: 0;
background-color: #d1d1d1;
display: block;
transform: rotate(-81deg);/*这里需要自己调整,根据线的位置*/
transform: rotate(-81deg);
/*这里需要自己调整,根据线的位置*/
transform-origin: top;
}
}
.LP_table td{
.LP_table td {
border-bottom: 1px solid #d1d1d1;
border-right: 1px solid #d1d1d1;
text-align: center;
padding: 5px;
min-width: 250px;
}
.LP_table .el-button--primary{
padding:5px;
}
.Lp_role{
}
.LP_table .el-button--primary {
padding: 5px;
}
.Lp_role {
position: absolute;
top:15px;
left:30px;
}
.Lp_company{
top: 15px;
left: 30px;
}
.Lp_company {
position: absolute;
right:30px;
top:5px;
}
right: 30px;
top: 5px;
}
</style>
<template>
<div>
<div>
<div class="LM_mainDiv">
<table border="0" cellspacing="0" cellpadding="0" class="LP_table">
<tr>
<th class="first">
<span class="Lp_role">角色</span>
<span class="Lp_company">公司</span>
</th>
<th>成都</th>
<th>成都</th>
<th>成都</th>
<th>成都</th>
<th>成都</th>
<th>操作</th>
</tr>
<tr>
<td>
<el-select filterable :placeholder="$t('pub.pleaseSel')" class="w150">
<el-option label="不限" value="-1"></el-option>
</el-select>
</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>
<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-tooltip class="item" effect="dark" content="保存" placement="top-start">
<el-button type="primary" icon="iconfont icon-baocun" circle></el-button>
</el-tooltip>
</td>
</tr>
</table>
<!--保存-->
<table border="0" cellspacing="0" cellpadding="0" class="LP_table">
<tr>
<th class="first">
<span class="Lp_role">角色</span>
<span class="Lp_company">公司</span>
</th>
<template v-for="item in BranchList">
<th>
{{item.BName}}
</th>
</template>
<th>
操作
</th>
</tr>
<tr v-for="(item,index) in PageData">
<td>
<el-select :placeholder="$t('pub.pleaseSel')" class="w150" v-model="item.RoleId">
<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>
</td>
<template v-for="subItem in item.DetailExtList">
<td>
<el-input class="w80" placeholder="金額" v-model="subItem.LessMoney"></el-input>
<el-input class="w80" placeholder="百分比" v-model="subItem.LessPercent"></el-input>
</td>
</template>
<td>
<input type='button' class="normalBtn" @click="SaveLessPrice(item)" value="保存"></input>
<input type='button' class="normalBtn" @click="RemoveItem(item,index)" value="删除"></input>
</td>
</tr>
<tfoot>
<tr>
<td :colspan="1+BranchList.length">
<input type='button' class="normalBtn" @click="AddItem()" value="新增"></input>
</td>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
getCompanyList: [],
};
},
methods: {
},
mounted() {
export default {
data() {
return {
//分公司列表
BranchList: [],
qMsg: {
PageIndex: 1,
PageSize: 100
},
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>
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