|
@@ -84,6 +84,7 @@
|
84
|
84
|
<td style="width: 80px">姓名</td>
|
85
|
85
|
<td style="width: 100px">部门</td>
|
86
|
86
|
<td style="width: 100px">人员成本(天)</td>
|
|
87
|
+ <td style="width: 100px">单价(元)</td>
|
87
|
88
|
<td style="width: 100px">预算天数</td>
|
88
|
89
|
<td style="width: 100px">预算系数</td>
|
89
|
90
|
<td style="width: 100px">预算绩效</td>
|
|
@@ -97,6 +98,9 @@
|
97
|
98
|
<td>
|
98
|
99
|
{{ user.dayCost }}
|
99
|
100
|
</td>
|
|
101
|
+ <td>
|
|
102
|
+ 200
|
|
103
|
+ </td>
|
100
|
104
|
<td>
|
101
|
105
|
<el-input-number :controls="false" v-model="user.days" placeholder="请输入天数"
|
102
|
106
|
@blur="calculateUserTotal(user)"></el-input-number>
|
|
@@ -213,8 +217,9 @@ export default {
|
213
|
217
|
if (this.budgetId != '') {
|
214
|
218
|
listBudgetStaff({ pageSize: 100, budgetId: this.budgetId }).then((res) => {
|
215
|
219
|
const allUsers = res.rows;
|
216
|
|
- this.innerUsers = allUsers.filter(user => user.type === '内业');
|
217
|
|
- this.outerUsers = allUsers.filter(user => user.type === '外业');
|
|
220
|
+ // 创建深拷贝,确保数据隔离
|
|
221
|
+ this.innerUsers = allUsers.filter(user => user.type === '内业').map(user => JSON.parse(JSON.stringify(user)));
|
|
222
|
+ this.outerUsers = allUsers.filter(user => user.type === '外业').map(user => JSON.parse(JSON.stringify(user)));
|
218
|
223
|
let month = this.parseTime(new Date(), '{y}-{m}')
|
219
|
224
|
for (let user of [...this.innerUsers, ...this.outerUsers]) {
|
220
|
225
|
user.nickName = this.getUserName(user.userId);
|
|
@@ -282,28 +287,37 @@ export default {
|
282
|
287
|
this.$set(this.form, 'outerSettle', outerSettle.toFixed(2));
|
283
|
288
|
},
|
284
|
289
|
getChooseUser(val) {
|
285
|
|
- for (let v of val) {
|
286
|
|
- if (v.deptId === 115) {
|
287
|
|
- v.salary = { salary: 7898.75 }
|
|
290
|
+ // 创建深拷贝,确保数据隔离
|
|
291
|
+ const processedUsers = val.map(v => {
|
|
292
|
+ const userCopy = JSON.parse(JSON.stringify(v));
|
|
293
|
+
|
|
294
|
+ if (userCopy.deptId === 115) {
|
|
295
|
+ userCopy.salary = { salary: 7898.75 }
|
288
|
296
|
}
|
289
|
297
|
let dayCost;
|
290
|
|
- if (!v.salary) {
|
291
|
|
- v.salary = { salary: 0 }
|
|
298
|
+ if (!userCopy.salary) {
|
|
299
|
+ userCopy.salary = { salary: 0 }
|
292
|
300
|
dayCost = ((1780 * 12) / 365).toFixed(2);
|
293
|
301
|
} else {
|
294
|
|
- dayCost = (parseFloat(((v.salary.salary + 1780) * 12) / 365) + v.socialSecurityUnit + v.houseFund).toFixed(2);
|
|
302
|
+ dayCost = (parseFloat(((userCopy.salary.salary + 1780) * 12) / 365) + userCopy.socialSecurityUnit + userCopy.houseFund).toFixed(2);
|
295
|
303
|
}
|
296
|
|
- v.type = this.currentType === 'inner' ? '内业' : '外业';
|
297
|
|
- v.days = 0; // 初始化天数为0
|
298
|
|
- v.staffCost = 0; // 初始化成本为0
|
299
|
|
- v.coefficient = 1; // 初始化系数为1
|
300
|
|
- v.otherCoefficient = 1; // 初始化其他系数为1
|
301
|
|
- v.dayCost = dayCost;
|
302
|
|
- }
|
|
304
|
+ userCopy.type = this.currentType === 'inner' ? '内业' : '外业';
|
|
305
|
+ userCopy.days = 0; // 初始化天数为0
|
|
306
|
+ userCopy.staffCost = 0; // 初始化成本为0
|
|
307
|
+ userCopy.coefficient = 1; // 初始化系数为1
|
|
308
|
+ userCopy.otherCoefficient = 1; // 初始化其他系数为1
|
|
309
|
+ userCopy.dayCost = dayCost;
|
|
310
|
+ userCopy.performance = 0; // 初始化绩效为0
|
|
311
|
+ userCopy.amount = 0; // 初始化金额为0
|
|
312
|
+ userCopy.remark = ''; // 初始化备注为空
|
|
313
|
+
|
|
314
|
+ return userCopy;
|
|
315
|
+ });
|
|
316
|
+
|
303
|
317
|
if (this.currentType === 'inner') {
|
304
|
|
- this.innerUsers = val;
|
|
318
|
+ this.innerUsers = processedUsers;
|
305
|
319
|
} else {
|
306
|
|
- this.outerUsers = val;
|
|
320
|
+ this.outerUsers = processedUsers;
|
307
|
321
|
}
|
308
|
322
|
this.isOpenPeople = false;
|
309
|
323
|
this.updateStaffCosts();
|