Commit 575ab1c7 authored by youjie's avatar youjie

共同奖金分配

parent 099b6e1d
...@@ -310,6 +310,58 @@ ...@@ -310,6 +310,58 @@
style="margin-left: 10px;" style="margin-left: 10px;"
/> />
</div> </div>
</div>
<div style="margin-bottom: 80px;">
<div>部门共同奖金分配</div>
<div
v-for="(x,y) in addMsg.DeptAwardList"
:key="y"
style="display: flex;align-items: center;margin-bottom: 10px;"
>
<q-select
filled
stack-label
option-value="Id"
option-label="EmployeeName"
v-model="x.EmpId"
use-input
:options="myEmployeeList"
label="奖励分配人员"
:dense="false"
emit-value
map-options
@filter="filterEmployee"
style="width: 240px;margin-right: 5px;"
@input='getDeptPersonnel(x,y)'
/>
<q-input
clearable
filled
v-model="x.Rate"
style="width: 190px;"
type="number"
@input="$forceUpdate()"
label="奖励分配比例"
/>
<q-btn
round
size="xs"
color="deep-orange"
icon="delete"
v-if="addMsg.DeptAwardList.length > 1"
@click="addMsg.DeptAwardList.splice(y, 1)"
style="margin-left: 10px;"
/>
<q-btn
round
size="xs"
color="primary"
icon="add"
v-if="addMsg.DeptAwardList.length == y + 1"
@click="addMsg.DeptAwardList.push({ EmpId: '',EmName:'', Rate: '' })"
style="margin-left: 10px;"
/>
</div>
</div> </div>
<div style="width: 100%;height: 50px;position: absolute;left: 0;bottom: 0;background: #FFF;display: flex;align-items: center;padding: 0 20px;justify-content: flex-end;"> <div style="width: 100%;height: 50px;position: absolute;left: 0;bottom: 0;background: #FFF;display: flex;align-items: center;padding: 0 20px;justify-content: flex-end;">
<q-btn <q-btn
...@@ -401,6 +453,9 @@ export default { ...@@ -401,6 +453,9 @@ export default {
ZGAwardList: [ ZGAwardList: [
{ StartValue: '', EndValue: '', Rate: '' } { StartValue: '', EndValue: '', Rate: '' }
], ],
DeptAwardList:[
{EmpId:null,EmName:null,Rate:null}
]
} }
} else {//修改 } else {//修改
this.addMsg = JSON.parse(JSON.stringify(this.selectData)) this.addMsg = JSON.parse(JSON.stringify(this.selectData))
...@@ -414,6 +469,7 @@ export default { ...@@ -414,6 +469,7 @@ export default {
this.addMsg.PeopleMoney = this.addMsg.PeopleMoney?this.addMsg.PeopleMoney:0 this.addMsg.PeopleMoney = this.addMsg.PeopleMoney?this.addMsg.PeopleMoney:0
this.addMsg.ExtraMoney = this.addMsg.ExtraMoney?this.addMsg.ExtraMoney:0 this.addMsg.ExtraMoney = this.addMsg.ExtraMoney?this.addMsg.ExtraMoney:0
this.addMsg.EnableZGAward = this.addMsg.EnableZGAward?String(this.addMsg.EnableZGAward):'0' this.addMsg.EnableZGAward = this.addMsg.EnableZGAward?String(this.addMsg.EnableZGAward):'0'
this.addMsg.DeptAwardList = this.addMsg.DeptAwardList?this.addMsg.DeptAwardList:[{EmpId:null,EmName:null,Rate:null}]
if(this.addMsg.EmpList.length== this.employeeList.length){ if(this.addMsg.EmpList.length== this.employeeList.length){
this.personnel=true this.personnel=true
}else{ }else{
...@@ -581,6 +637,27 @@ export default { ...@@ -581,6 +637,27 @@ export default {
}else{ }else{
msg.ZGAwardList = [] msg.ZGAwardList = []
} }
if(msg.DeptAwardList.length>0){
for(let i=0;i<msg.DeptAwardList.length;i++){
let x = msg.DeptAwardList[i]
if(!x.EmpId){
this.$q.notify({
type: 'negative',
message: `请选择奖励分配人员`,
position: 'top'
})
return
}
if(!x.Rate){
this.$q.notify({
type: 'negative',
message: `请输入奖励分配比例`,
position: 'top'
})
return
}
}
}
this.$emit('success',msg) this.$emit('success',msg)
} }
}, },
...@@ -634,6 +711,10 @@ export default { ...@@ -634,6 +711,10 @@ export default {
} }
}, },
getDeptPersonnel(item,i){
let obj = this.myEmployeeList.filter(x=>{return x.Id==item.EmpId})
if(obj&&obj.length>0)this.addMsg.DeptAwardList[i].EmName = obj[0].EmployeeName
},
getpersonnel(type){ getpersonnel(type){
if(type==1){//人员全选 if(type==1){//人员全选
if(this.addMsg.EmpList.length== this.employeeList.length){ if(this.addMsg.EmpList.length== this.employeeList.length){
......
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