|
|
|
@ -224,7 +224,12 @@ export default {
|
|
|
|
this.$refs.staffratio.show(row, text);
|
|
|
|
this.$refs.staffratio.show(row, text);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
staffratioData(v) {
|
|
|
|
staffratioData(v) {
|
|
|
|
this.list.splice(v.index, 1, v);
|
|
|
|
console.log(v);
|
|
|
|
|
|
|
|
this.list.forEach((item, index) => {
|
|
|
|
|
|
|
|
if (index == v.index) {
|
|
|
|
|
|
|
|
item[text] = v.list;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
clear(row, text) {
|
|
|
|
clear(row, text) {
|
|
|
|
let form = { ...row };
|
|
|
|
let form = { ...row };
|
|
|
|
@ -247,16 +252,26 @@ export default {
|
|
|
|
this.$refs.pro.show(row);
|
|
|
|
this.$refs.pro.show(row);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
proData(v) {
|
|
|
|
proData(v) {
|
|
|
|
if (v.courseMoney > 0) {
|
|
|
|
console.log(v);
|
|
|
|
|
|
|
|
let form = JSON.parse(JSON.stringify(v));
|
|
|
|
|
|
|
|
console.log(form);
|
|
|
|
|
|
|
|
this.list.splice(form.index, 1, form);
|
|
|
|
|
|
|
|
console.log(this.list);
|
|
|
|
|
|
|
|
this.sumList();
|
|
|
|
|
|
|
|
this.restList(form);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
restList(form) {
|
|
|
|
|
|
|
|
if (form.courseMoney > 0) {
|
|
|
|
var list = [];
|
|
|
|
var list = [];
|
|
|
|
v.proList.forEach((item) => {
|
|
|
|
var listCopy = [];
|
|
|
|
|
|
|
|
form.proList.forEach((item) => {
|
|
|
|
item.courseConsumeCount = item.courseConsumeCount - item.payNumber;
|
|
|
|
item.courseConsumeCount = item.courseConsumeCount - item.payNumber;
|
|
|
|
item.courseRestCount = item.courseRestCount - item.payNumber;
|
|
|
|
item.courseRestCount = item.courseRestCount - item.payNumber;
|
|
|
|
list.push(item);
|
|
|
|
list.push(item);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.list.forEach((item) => {
|
|
|
|
this.list.forEach((item) => {
|
|
|
|
let proList = [];
|
|
|
|
let proList = [];
|
|
|
|
if (item.index != v.index) {
|
|
|
|
if (item.index != form.index) {
|
|
|
|
item.proList.forEach((items, indexs) => {
|
|
|
|
item.proList.forEach((items, indexs) => {
|
|
|
|
if (items.payNumber == 0) {
|
|
|
|
if (items.payNumber == 0) {
|
|
|
|
list[indexs].payNumber = 0;
|
|
|
|
list[indexs].payNumber = 0;
|
|
|
|
@ -265,27 +280,30 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
proList.push(items);
|
|
|
|
proList.push(items);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
item.proList = proList;
|
|
|
|
item.proList = proList;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
listCopy.push(item);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
this.list = listCopy;
|
|
|
|
|
|
|
|
console.log(this.list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.list.splice(v.index, 1, v);
|
|
|
|
|
|
|
|
this.sumList();
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
openRec(row) {
|
|
|
|
openRec(row) {
|
|
|
|
this.$refs.rec.show(row);
|
|
|
|
this.$refs.rec.show(row);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
recData(v) {
|
|
|
|
recData(v) {
|
|
|
|
if (v.recMoney > 0) {
|
|
|
|
let form = JSON.parse(JSON.stringify(v));
|
|
|
|
|
|
|
|
console.log(form);
|
|
|
|
|
|
|
|
if (form.recMoney > 0) {
|
|
|
|
var list = [];
|
|
|
|
var list = [];
|
|
|
|
v.recList.forEach((item) => {
|
|
|
|
form.recList.forEach((item) => {
|
|
|
|
item.cardRestMoney = item.cardRestMoney - item.payMoney;
|
|
|
|
item.cardRestMoney = item.cardRestMoney - item.payMoney;
|
|
|
|
item.cardConsumeMoney = item.cardConsumeMoney - item.payMoney;
|
|
|
|
item.cardConsumeMoney = item.cardConsumeMoney - item.payMoney;
|
|
|
|
list.push(item);
|
|
|
|
list.push(item);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
this.list.forEach((item) => {
|
|
|
|
this.list.forEach((item) => {
|
|
|
|
let recList = [];
|
|
|
|
let recList = [];
|
|
|
|
if (item.index != v.index) {
|
|
|
|
if (item.index != form.index) {
|
|
|
|
item.recList.forEach((items, indexs) => {
|
|
|
|
item.recList.forEach((items, indexs) => {
|
|
|
|
if (items.payMoney == 0) {
|
|
|
|
if (items.payMoney == 0) {
|
|
|
|
list[indexs].payMoney = 0;
|
|
|
|
list[indexs].payMoney = 0;
|
|
|
|
@ -294,11 +312,11 @@ export default {
|
|
|
|
recList.push(items);
|
|
|
|
recList.push(items);
|
|
|
|
console.log(recList);
|
|
|
|
console.log(recList);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
item.recList = recList;
|
|
|
|
item.recList = recList;
|
|
|
|
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.list.splice(v.index, 1, v);
|
|
|
|
this.list.splice(form.index, 1, form);
|
|
|
|
this.sumList();
|
|
|
|
this.sumList();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//关闭弹窗前的回调方法
|
|
|
|
//关闭弹窗前的回调方法
|
|
|
|
@ -322,18 +340,7 @@ export default {
|
|
|
|
delete row.adminList;
|
|
|
|
delete row.adminList;
|
|
|
|
this.$refs.cancel.show(row);
|
|
|
|
this.$refs.cancel.show(row);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//员工占比返回方法
|
|
|
|
|
|
|
|
staffslesData(v) {
|
|
|
|
|
|
|
|
this.list[this.rowIndex].entities = [...v];
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//高管占比返回方法
|
|
|
|
|
|
|
|
managerData(v) {
|
|
|
|
|
|
|
|
this.list[this.rowIndex].managerList = [...v];
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//管理员占比返回方法
|
|
|
|
|
|
|
|
adminData(v) {
|
|
|
|
|
|
|
|
this.list[this.rowIndex].adminList = [...v];
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
//组件传值
|
|
|
|
//组件传值
|
|
|
|
show(form) {
|
|
|
|
show(form) {
|
|
|
|
Object.assign(this.$data, this.$options.data.call(this));
|
|
|
|
Object.assign(this.$data, this.$options.data.call(this));
|
|
|
|
|