Commit c079874d authored by zhengke's avatar zhengke

修改

parent 9be14da8
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<el-tooltip class="item" effect="dark" content="查看" placement="top"> <el-tooltip class="item" effect="dark" content="查看" placement="top">
<i class="iconfont icon-sousuo" @click="goUrl(scope.row.Id)"></i> <i class="iconfont icon-sousuo" @click="goUrl(scope.row.Id)"></i>
</el-tooltip> </el-tooltip>
<el-tooltip class="item" effect="dark" content="制单" @click="go" placement="top"> <el-tooltip class="item" effect="dark" content="制单" placement="top">
<i class="iconfont icon-add" @click="generalFinancacls(scope.row)"></i> <i class="iconfont icon-add" @click="generalFinancacls(scope.row)"></i>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -65,10 +65,14 @@ ...@@ -65,10 +65,14 @@
</template> </template>
<el-dialog title="设置发放用户" width="700px" :visible.sync="costmode" center> <el-dialog title="设置发放用户" width="700px" :visible.sync="costmode" center>
<el-table :data="SendEmployeeList" border @selection-change="handleSelectionChange" style="width: 100%"> <el-table :data="SendEmployeeList" border @selection-change="handleSelectionChange" style="width: 100%">
<el-table-column type="selection" width="55" :selectable="checkSelectable"></el-table-column> <el-table-column type="selection" width="50" :selectable="checkSelectable"></el-table-column>
<el-table-column prop="UserName" label="用户"> </el-table-column> <el-table-column prop="EmployeeName" label="用户"> </el-table-column>
<el-table-column prop="StudentCount" label="客人数量"> </el-table-column> <el-table-column prop="CurGuestNum" label="客人数量"> </el-table-column>
<el-table-column prop="CurrentPeriodMoney" label="应发提成金额"> </el-table-column> <el-table-column prop="ClueNumSalary" label="应发提成金额">
<template slot-scope="scope">
{{getTicheng(scope.row)}}
</template>
</el-table-column>
<el-table-column prop="IsGiveOut" label="是否已发放"> <el-table-column prop="IsGiveOut" label="是否已发放">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if='scope.row.IsGiveOut==1'>已发放</span> <span v-if='scope.row.IsGiveOut==1'>已发放</span>
...@@ -87,8 +91,7 @@ ...@@ -87,8 +91,7 @@
<script> <script>
import { import {
CreateEmpBonus, CreateEmpBonus,
queryPersonnelPeriodPage, queryPersonnelPeriodPage
getSellAchievementsSendEmployeeList
} from '../../../api/finance/index' } from '../../../api/finance/index'
export default { export default {
...@@ -110,7 +113,6 @@ ...@@ -110,7 +113,6 @@
StartDate: '', StartDate: '',
pageCount: 0, pageCount: 0,
dataList: [], dataList: [],
iscMaker: false, //是否有制单的权限
CheckID: 0, CheckID: 0,
SendEmployeeList: [], //可发放提成的用户列表 SendEmployeeList: [], //可发放提成的用户列表
multipleSelection: [], multipleSelection: [],
...@@ -120,22 +122,15 @@ ...@@ -120,22 +122,15 @@
}, },
created() {}, created() {},
mounted() { mounted() {
let userinfo = this.getLocalStorage();
userinfo.ActionMenuList.map(x => { //判断权限
// if (x.FunctionCode == "SAGenerate_Commission") { //判断是否有生成的权限
// this.isgenerate = true;
// }
// if (x.FunctionCode == "SACommission_maker") { //判断是否有制单的权限
// this.iscMaker = true;
// }
})
this.getList(); this.getList();
}, },
methods: { methods: {
//制单 //制单
generalFinancacls(item) { generalFinancacls(item) {
this.CheckID = item.Id; this.CheckID = item.Id;
this.SendEmployeeList = item.BonusList;
console.log(item,'数据');
console.log(this.SendEmployeeList,'11111111');
this.tishi('3.6', this.CheckID); this.tishi('3.6', this.CheckID);
}, },
tishi(Money, Id) { tishi(Money, Id) {
...@@ -154,24 +149,14 @@ ...@@ -154,24 +149,14 @@
focus: true focus: true
} }
}).onOk(() => { }).onOk(() => {
this.getcomSendEmployeeList(Id)
});
},
getcomSendEmployeeList(Id) { //获取可发放提成的用户
getSellAchievementsSendEmployeeList({
PeriodId: Id
}).then(res => {
this.SendEmployeeList = res.Data;
this.costmode = true this.costmode = true
}).catch(() => { });
})
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
let zong = 0 let zong = 0
this.multipleSelection.forEach(x => { this.multipleSelection.forEach(x => {
zong = this.accAdd(zong, x.CurrentPeriodMoney) zong = this.accAdd(zong, Number(x.ClueNumSalary+x.CurRewardMoney+x.OpenBonus)-Number(x.BeforeMoney))
}) })
this.totalAmount = zong this.totalAmount = zong
}, },
...@@ -206,18 +191,25 @@ ...@@ -206,18 +191,25 @@
let EmpIds = ''; let EmpIds = '';
let data = [] let data = []
this.multipleSelection.forEach(x => { this.multipleSelection.forEach(x => {
data.push(x.UserId) data.push(x.EmployeeId)
}) })
EmpIds = data.join(',') EmpIds = data.join(',')
setSellAchievementsSendEmployee({ this.goaddFinancial(this.totalAmount, this.CheckID, EmpIds)
PeriodId: this.CheckID, // let EmpIds = '';
EmpIds: EmpIds // let data = []
}).then(res => { // this.multipleSelection.forEach(x => {
this.goaddFinancial(this.totalAmount, this.CheckID, EmpIds) // data.push(x.UserId)
this.$message.success('设置成功'); // })
}).catch(() => { // EmpIds = data.join(',')
// setSellAchievementsSendEmployee({
// PeriodId: this.CheckID,
// EmpIds: EmpIds
// }).then(res => {
// this.goaddFinancial(this.totalAmount, this.CheckID, EmpIds)
// this.$message.success('设置成功');
// }).catch(() => {
}) // })
}); });
}, },
...@@ -229,10 +221,10 @@ ...@@ -229,10 +221,10 @@
Money: Money, Money: Money,
CurrencyId: 21, CurrencyId: 21,
XSTC: 1, XSTC: 1,
School_Id: this.msg.SchoolId == -1 ? 0 : this.msg.SchoolId, School_Id: 0,
OtherType: 51, //业绩提成 OtherType: 51, //业绩提成
ReFinanceId: Id, ReFinanceId: Id,
ReFinanceId2: this.msg.SchoolId, ReFinanceId2: 0,
EduCommissionEmp: EmpIds EduCommissionEmp: EmpIds
} }
let query = { let query = {
...@@ -279,7 +271,13 @@ ...@@ -279,7 +271,13 @@
this.OpenNewUrl('../market/empBonusDetail', { this.OpenNewUrl('../market/empBonusDetail', {
Id: Id Id: Id
}) })
},
//计算提成数
getTicheng(Obj) {
let Num = Number(Obj.ClueNumSalary + Obj.CurRewardMoney + Obj.OpenBonus) - Number(Obj.BeforeMoney);
return Num;
} }
}, },
} }
......
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