|
@@ -2,13 +2,18 @@
|
2
|
2
|
* @Author: ysh
|
3
|
3
|
* @Date: 2025-05-07 11:01:39
|
4
|
4
|
* @LastEditors: Please set LastEditors
|
5
|
|
- * @LastEditTime: 2025-05-13 18:05:08
|
|
5
|
+ * @LastEditTime: 2025-05-14 14:18:45
|
6
|
6
|
-->
|
7
|
7
|
<template>
|
8
|
8
|
<div class="main" v-loading="loading">
|
9
|
9
|
<h2 class="text-center">项目直接生产成本预算表</h2>
|
10
|
10
|
<p style="text-align: center">编制人:{{ budgetForm.compilerUser ? budgetForm.compilerUser.nickName : '' }}</p>
|
11
|
11
|
<el-divider></el-divider>
|
|
12
|
+ <div class="mt20 mb20" v-if="showAlter">
|
|
13
|
+ <el-alert title="任务被退回,请修改后重新提交" type="error" :closable="false">
|
|
14
|
+ <return-comment :taskForm="taskForm" @isReturn="isReturn"></return-comment>
|
|
15
|
+ </el-alert>
|
|
16
|
+ </div>
|
12
|
17
|
<el-descriptions :column="3" border class="descriptions">
|
13
|
18
|
<el-descriptions-item label="项目编号">
|
14
|
19
|
{{ project.projectNumber }}
|
|
@@ -40,23 +45,12 @@
|
40
|
45
|
<td style="width: 200px">备注</td>
|
41
|
46
|
</tr>
|
42
|
47
|
<tr v-for="(work, index) in workContentList" :key="index">
|
43
|
|
- <td>
|
44
|
|
- {{ work.content }}
|
45
|
|
- </td>
|
46
|
|
- <td>
|
47
|
|
- {{ work.scale }}
|
48
|
|
- </td>
|
49
|
|
- <td>
|
50
|
|
- {{ work.unit }}
|
51
|
|
- </td>
|
52
|
|
- <td>
|
53
|
|
- {{ work.workload }}
|
54
|
|
- </td>
|
55
|
|
- <td>
|
56
|
|
- {{ work.deadline }}
|
57
|
|
- </td>
|
58
|
|
- <td class="remark-cell">
|
59
|
|
- {{ work.remark }}
|
|
48
|
+ <td>{{ work.content }}</td>
|
|
49
|
+ <td>{{ work.scale }} </td>
|
|
50
|
+ <td>{{ work.unit }}</td>
|
|
51
|
+ <td>{{ work.workload }}</td>
|
|
52
|
+ <td>{{ work.deadline }}</td>
|
|
53
|
+ <td class="remark-cell">{{ work.remark }}
|
60
|
54
|
</td>
|
61
|
55
|
</tr>
|
62
|
56
|
</table>
|
|
@@ -97,12 +91,13 @@
|
97
|
91
|
<td v-else>
|
98
|
92
|
{{ work.coefficient }}
|
99
|
93
|
</td>
|
100
|
|
- <td style="text-align:right;">{{ work.settle ? work.settle.toFixed(2) : '0.00' }}</td>
|
|
94
|
+ <td style="text-align:right;">{{ work.settle ? Number(work.settle).toFixed(2) : '0.00' }}</td>
|
101
|
95
|
<td class="remark-cell">{{ work.remark ? work.remark : '' }}</td>
|
102
|
96
|
</tr>
|
103
|
97
|
<tr>
|
104
|
98
|
<td :colspan="7" class="head amount">内业绩效额合计</td>
|
105
|
|
- <td :colspan="1" class="head amount" style="text-align:right;">
|
|
99
|
+ <td :colspan="1" class="head amount" :class="{ 'performance-error': isPerformanceExceeded() }"
|
|
100
|
+ style="text-align:right;">
|
106
|
101
|
{{ budgetForm.settleExpense ? budgetForm.settleExpense.toFixed(2) : '0.00' }}
|
107
|
102
|
</td>
|
108
|
103
|
<td></td>
|
|
@@ -126,27 +121,28 @@
|
126
|
121
|
<td>{{ staff.user ? staff.user.nickName : '' }}</td>
|
127
|
122
|
<td>{{ staff.dayCost }}</td>
|
128
|
123
|
<td v-if="taskName == '分管审核'">
|
129
|
|
- <el-input-number style="width:80px;" :controls="false" v-model="staff.days" :min="0"
|
130
|
|
- :step="0.01" @change="(val) => updateInnerStaffAmount(staff, val, 'days')"></el-input-number>
|
|
124
|
+ <el-input-number style="width:80px;" :controls="false" v-model="staff.days" :min="0" :step="0.01"
|
|
125
|
+ @change="(val) => updateInnerStaffAmount(staff, val, 'days')"></el-input-number>
|
131
|
126
|
</td>
|
132
|
127
|
<td v-else>{{ staff.days }}</td>
|
133
|
128
|
<td style="text-align:right;">{{ staff.staffCost }}</td>
|
134
|
129
|
<td v-if="taskName == '分管审核'">
|
135
|
|
- <el-input-number style="width:80px;" :controls="false" v-model="staff.performance" :min="0"
|
136
|
|
- :step="0.01" @change="(val) => updateInnerStaffAmount(staff, val, 'performance')"></el-input-number>
|
|
130
|
+ <el-input-number style="width:80px;" :controls="false" v-model="staff.performance" :min="0" :step="0.01"
|
|
131
|
+ @change="(val) => updateInnerStaffAmount(staff, val, 'performance')"></el-input-number>
|
137
|
132
|
</td>
|
138
|
|
- <td v-else style="text-align:right;">{{ staff.performance }}</td>
|
|
133
|
+ <td v-else>{{ staff.performance }}</td>
|
139
|
134
|
<td style="text-align:right;">{{ staff.amount }}</td>
|
140
|
135
|
<td class="remark-cell">{{ staff.remark }}</td>
|
141
|
|
- </tr>
|
|
136
|
+ </tr>
|
142
|
137
|
<tr>
|
143
|
138
|
<td colspan="4" class="head amount">内业人员成本合计</td>
|
144
|
139
|
<td class="head amount" style="text-align:right;">{{innerStaffList.reduce((sum, staff) => sum +
|
145
|
140
|
(Number(staff.staffCost) || 0),
|
146
|
141
|
0).toFixed(2)}}</td>
|
147
|
|
- <td class="head amount" style="text-align:right;">{{innerStaffList.reduce((sum, staff) => sum +
|
148
|
|
- (Number(staff.performance) || 0),
|
149
|
|
- 0).toFixed(2)}}</td>
|
|
142
|
+ <td class="head amount" :class="{ 'performance-error': isPerformanceExceeded() }" style="text-align:right;">
|
|
143
|
+ {{innerStaffList.reduce((sum, staff) => sum +
|
|
144
|
+ (Number(staff.performance) || 0),
|
|
145
|
+ 0).toFixed(2)}}</td>
|
150
|
146
|
<td class="head amount" style="text-align:right;">{{innerStaffList.reduce((sum, staff) => sum +
|
151
|
147
|
(Number(staff.amount) || 0),
|
152
|
148
|
0).toFixed(2)}}</td>
|
|
@@ -173,13 +169,13 @@
|
173
|
169
|
<td>{{ staff.dayCost }}</td>
|
174
|
170
|
<td>200</td>
|
175
|
171
|
<td v-if="taskName == '分管审核'">
|
176
|
|
- <el-input-number style="width:80px;" :controls="false" v-model="staff.days" :min="0"
|
177
|
|
- :step="0.01" @change="(val) => updateOuterStaffAmount(staff, val, 'days')"></el-input-number>
|
|
172
|
+ <el-input-number style="width:80px;" :controls="false" v-model="staff.days" :min="0" :step="0.01"
|
|
173
|
+ @change="(val) => updateOuterStaffAmount(staff, val, 'days')"></el-input-number>
|
178
|
174
|
</td>
|
179
|
175
|
<td v-else>{{ staff.days }}</td>
|
180
|
176
|
<td v-if="taskName == '分管审核'">
|
181
|
|
- <el-input-number style="width:80px;" :controls="false" v-model="staff.coefficient" :min="0"
|
182
|
|
- :step="0.01" @change="(val) => updateOuterStaffAmount(staff, val, 'coefficient')"></el-input-number>
|
|
177
|
+ <el-input-number style="width:80px;" :controls="false" v-model="staff.coefficient" :min="0" :step="0.01"
|
|
178
|
+ @change="(val) => updateOuterStaffAmount(staff, val, 'coefficient')"></el-input-number>
|
183
|
179
|
</td>
|
184
|
180
|
<td v-else>{{ staff.coefficient }}</td>
|
185
|
181
|
<td style="text-align:right;">{{ staff.staffCost }}</td>
|
|
@@ -215,8 +211,8 @@
|
215
|
211
|
<td>{{ car.car ? car.car.licensePlate : '' }}</td>
|
216
|
212
|
<td>{{ car.car ? car.car.dayCost : '' }}</td>
|
217
|
213
|
<td v-if="taskName == '分管审核'">
|
218
|
|
- <el-input-number style="width:80px;" :controls="false" v-model="car.days" :min="0"
|
219
|
|
- :step="0.01" @change="(val) => updateCarAmount(car, val)"></el-input-number>
|
|
214
|
+ <el-input-number style="width:80px;" :controls="false" v-model="car.days" :min="0" :step="0.01"
|
|
215
|
+ @change="(val) => updateCarAmount(car, val)"></el-input-number>
|
220
|
216
|
</td>
|
221
|
217
|
<td v-else>{{ car.days }}</td>
|
222
|
218
|
<td style="text-align:right;">{{ car.amount }}</td>
|
|
@@ -247,8 +243,8 @@
|
247
|
243
|
<td>{{ device.device ? device.device.brand : '' }}</td>
|
248
|
244
|
<td>{{ device.device ? device.device.dayCost : '' }}</td>
|
249
|
245
|
<td v-if="taskName == '分管审核'">
|
250
|
|
- <el-input-number style="width:80px;" :controls="false" v-model="device.days" :min="0"
|
251
|
|
- :step="0.01" @change="(val) => updateDeviceAmount(device, val)"></el-input-number>
|
|
246
|
+ <el-input-number style="width:80px;" :controls="false" v-model="device.days" :min="0" :step="0.01"
|
|
247
|
+ @change="(val) => updateDeviceAmount(device, val)"></el-input-number>
|
252
|
248
|
</td>
|
253
|
249
|
<td v-else>{{ device.days }}</td>
|
254
|
250
|
<td style="text-align:right;">{{ device.amount }}</td>
|
|
@@ -266,13 +262,17 @@
|
266
|
262
|
<tr style="background-color:#f8f8f9">
|
267
|
263
|
<td>序号</td>
|
268
|
264
|
<td>开支项</td>
|
269
|
|
- <td>金额</td>
|
|
265
|
+ <td style="min-width:120px">金额</td>
|
270
|
266
|
<td>备注</td>
|
271
|
267
|
</tr>
|
272
|
268
|
<tr v-for="site, index in siteList" :key="'site' + site.expenseId">
|
273
|
269
|
<td>{{ index + 1 }}</td>
|
274
|
270
|
<td>{{ site.name }}</td>
|
275
|
|
- <td style="text-align:right;">{{ site.amount }}</td>
|
|
271
|
+ <td v-if="taskName == '分管审核'">
|
|
272
|
+ <el-input-number style="width:100%;" :controls="false" v-model="site.amount" :min="0" :step="0.01"
|
|
273
|
+ @change="(val) => updateSiteAmount(site, val)"></el-input-number>
|
|
274
|
+ </td>
|
|
275
|
+ <td v-else style="text-align:right;">{{ site.amount }}</td>
|
276
|
276
|
<td class="remark-cell">{{ site.remark }}</td>
|
277
|
277
|
</tr>
|
278
|
278
|
<tr>
|
|
@@ -362,20 +362,24 @@
|
362
|
362
|
</tr>
|
363
|
363
|
<tr>
|
364
|
364
|
<td>人员成本</td>
|
365
|
|
- <td style="text-align:right;">{{ isNaN(budgetForm.staffCost) ? 0 : Number(budgetForm.staffCost).toFixed(2) }}</td>
|
|
365
|
+ <td style="text-align:right;">{{ isNaN(budgetForm.staffCost) ? 0 : Number(budgetForm.staffCost).toFixed(2)
|
|
366
|
+ }}</td>
|
366
|
367
|
</tr>
|
367
|
368
|
<tr>
|
368
|
369
|
<td>车辆成本</td>
|
369
|
|
- <td style="text-align:right;">{{ isNaN(budgetForm.carCost) ? 0 : Number(budgetForm.carCost).toFixed(2) }}</td>
|
|
370
|
+ <td style="text-align:right;">{{ isNaN(budgetForm.carCost) ? 0 : Number(budgetForm.carCost).toFixed(2) }}
|
|
371
|
+ </td>
|
370
|
372
|
</tr>
|
371
|
373
|
<tr>
|
372
|
374
|
<td>设备成本</td>
|
373
|
|
- <td style="text-align:right;">{{ isNaN(budgetForm.deviceCost) ? 0 : Number(budgetForm.deviceCost).toFixed(2) }}</td>
|
|
375
|
+ <td style="text-align:right;">{{ isNaN(budgetForm.deviceCost) ? 0 : Number(budgetForm.deviceCost).toFixed(2)
|
|
376
|
+ }}</td>
|
374
|
377
|
</tr>
|
375
|
378
|
<tr>
|
376
|
379
|
<td>现场开支成本</td>
|
377
|
|
- <td style="text-align:right;">{{ isNaN(budgetForm.siteSum) ? 0 : Number(budgetForm.siteSum).toFixed(2) }}</td>
|
378
|
|
- </tr>
|
|
380
|
+ <td style="text-align:right;">{{ isNaN(budgetForm.siteSum) ? 0 : Number(budgetForm.siteSum).toFixed(2) }}
|
|
381
|
+ </td>
|
|
382
|
+ </tr>
|
379
|
383
|
<tr>
|
380
|
384
|
<td>经营相关成本</td>
|
381
|
385
|
<td style="text-align:right;">{{ isNaN(totalJYAmount) ? 0 : Number(totalJYAmount).toFixed(2) }}</td>
|
|
@@ -386,6 +390,20 @@
|
386
|
390
|
</tr>
|
387
|
391
|
</table>
|
388
|
392
|
</el-descriptions-item>
|
|
393
|
+ <el-descriptions-item label="合同总价" :span="3" v-if="$store.getters.roles.includes('leader')">
|
|
394
|
+ <table border="1" style="width:100%;">
|
|
395
|
+ <tr style="background-color:#f8f8f9">
|
|
396
|
+ <td>序号</td>
|
|
397
|
+ <td>合同名称</td>
|
|
398
|
+ <td>合同总价</td>
|
|
399
|
+ </tr>
|
|
400
|
+ <tr v-for="contract, index in contractList" :key="contract.contractId">
|
|
401
|
+ <td>{{ index + 1 }}</td>
|
|
402
|
+ <td>{{ contract.contractName }}</td>
|
|
403
|
+ <td>{{ contract.amount }}</td>
|
|
404
|
+ </tr>
|
|
405
|
+ </table>
|
|
406
|
+ </el-descriptions-item>
|
389
|
407
|
<el-descriptions-item label="分管领导审核意见" :span="3">
|
390
|
408
|
<div v-if="taskName == '分管审核' && !budgetForm.managerComment" class="alert alert-warning"
|
391
|
409
|
style="padding: 10px; border: 1px solid #f0ad4e; background-color: #fcf8e3; color: #8a6d3b;">
|
|
@@ -434,12 +452,14 @@ import { listBudget, updateBudget } from "@/api/oa/budget/budget";
|
434
|
452
|
import { listBudgetCar, updateBudgetCar } from "@/api/oa/budget/budgetCar";
|
435
|
453
|
import { listBudgetDevice, updateBudgetDevice } from "@/api/oa/budget/budgetDevice";
|
436
|
454
|
import { listBudgetSettle, updateBudgetSettle } from "@/api/oa/budget/budgetSettle";
|
437
|
|
-import { listBudgetStaff } from "@/api/oa/budget/budgetStaff";
|
|
455
|
+import { listBudgetStaff, updateBudgetStaff } from "@/api/oa/budget/budgetStaff";
|
438
|
456
|
import { listProjectWork } from "@/api/oa/project/projectWork";
|
439
|
|
-import { listSite } from "@/api/oa/budget/budgetSite.js";
|
|
457
|
+import { listSite, updateSite } from "@/api/oa/budget/budgetSite.js";
|
440
|
458
|
import { getProject } from "@/api/oa/project/project";
|
441
|
459
|
import { getUsersManageLeader, getUserByPost } from "@/api/system/post";
|
442
|
460
|
import { complete, getNextFlowNode } from "@/api/flowable/todo";
|
|
461
|
+import { listProjectContract } from "@/api/oa/contract/projectContract";
|
|
462
|
+import { getContract } from "@/api/oa/contract/contract";
|
443
|
463
|
import InnerStaffCost from './components/InnerStaffCost.vue';
|
444
|
464
|
import OuterStaffCost from './components/OuterStaffCost.vue';
|
445
|
465
|
import CarCost from './components/CarCost.vue';
|
|
@@ -479,11 +499,14 @@ export default {
|
479
|
499
|
siteList: [],
|
480
|
500
|
totalJYAmount: 0,
|
481
|
501
|
returnOpen: false,
|
|
502
|
+ contractList: [],
|
|
503
|
+ showAlter: true,
|
482
|
504
|
}
|
483
|
505
|
},
|
484
|
506
|
created() {
|
485
|
507
|
this.initBudgetForm();
|
486
|
508
|
this.getProjectWorkList();
|
|
509
|
+ this.getContractInfo();
|
487
|
510
|
},
|
488
|
511
|
methods: {
|
489
|
512
|
initBudgetForm() {
|
|
@@ -567,12 +590,29 @@ export default {
|
567
|
590
|
let siteRes = await listSite({ pageSize: 100, budgetId });
|
568
|
591
|
this.siteList = siteRes.rows;
|
569
|
592
|
this.budgetForm.siteSum = this.siteList.reduce((sum, site) => sum + (Number(site.amount) || 0), 0);
|
|
593
|
+
|
|
594
|
+ // 检查内业人员绩效总额是否超过内业绩效总额
|
|
595
|
+ const totalPerformance = this.innerStaffList.reduce((sum, staff) => sum + (Number(staff.performance) || 0), 0);
|
|
596
|
+ if (totalPerformance > Number(this.budgetForm.settleExpense)) {
|
|
597
|
+ this.$message.warning('内业人员绩效总额超过内业绩效总额,请检查');
|
|
598
|
+ }
|
570
|
599
|
}
|
571
|
600
|
this.loading = false;
|
572
|
601
|
}).catch(() => {
|
573
|
602
|
this.loading = false;
|
574
|
603
|
});
|
575
|
604
|
},
|
|
605
|
+ getContractInfo() {
|
|
606
|
+ listProjectContract({ projectId: this.taskForm.formId }).then(res => {
|
|
607
|
+ let contractIds = res.rows;
|
|
608
|
+ this.contractList = [];
|
|
609
|
+ for (let contractId of contractIds) {
|
|
610
|
+ getContract(contractId.contractId).then(response => {
|
|
611
|
+ this.contractList.push(response.data);
|
|
612
|
+ })
|
|
613
|
+ }
|
|
614
|
+ })
|
|
615
|
+ },
|
576
|
616
|
safeNumber(value) {
|
577
|
617
|
const num = Number(value);
|
578
|
618
|
return isNaN(num) ? 0 : num;
|
|
@@ -586,6 +626,7 @@ export default {
|
586
|
626
|
})
|
587
|
627
|
},
|
588
|
628
|
async preserve() {
|
|
629
|
+ this.$message.warning('正在保存,请勿关闭页面');
|
589
|
630
|
if (this.taskName == '分管审核') {
|
590
|
631
|
this.budgetForm.manager = this.$store.getters.userId;
|
591
|
632
|
this.budgetForm.managerTime = this.parseTime(new Date(), '{y}-{m}-{d}');
|
|
@@ -593,6 +634,16 @@ export default {
|
593
|
634
|
this.budgetForm.auditor = this.$store.getters.userId;
|
594
|
635
|
this.budgetForm.zjlTime = this.parseTime(new Date(), '{y}-{m}-{d}');
|
595
|
636
|
}
|
|
637
|
+ if (this.taskName != '经营审核') {
|
|
638
|
+ await Promise.all([
|
|
639
|
+ ...this.carList.map(car => updateBudgetCar(car)),
|
|
640
|
+ ...this.deviceList.map(device => updateBudgetDevice(device)),
|
|
641
|
+ ...this.innerStaffList.map(staff => updateBudgetStaff(staff)),
|
|
642
|
+ ...this.outerStaffList.map(staff => updateBudgetStaff(staff)),
|
|
643
|
+ ...this.workList.map(work => updateBudgetSettle(work)),
|
|
644
|
+ ...this.siteList.map(site => updateSite(site))
|
|
645
|
+ ]);
|
|
646
|
+ }
|
596
|
647
|
await updateBudget(this.budgetForm)
|
597
|
648
|
this.$message.success('保存成功');
|
598
|
649
|
},
|
|
@@ -611,10 +662,19 @@ export default {
|
611
|
662
|
return
|
612
|
663
|
}
|
613
|
664
|
let zjlRes = await getUserByPost({ postName: '总经理' });
|
614
|
|
- let zjlUserId = zjlRes.data.userId;
|
|
665
|
+ let zjlUserId = zjlRes.data[0].userId;
|
615
|
666
|
this.$set(this.taskForm.variables, 'approval', zjlUserId);
|
616
|
667
|
}
|
617
|
|
- return
|
|
668
|
+ else if (this.taskName == '总经理审核') {
|
|
669
|
+ if (!this.budgetForm.zjlComment) {
|
|
670
|
+ this.$message.error('请填写审核意见')
|
|
671
|
+ return
|
|
672
|
+ }
|
|
673
|
+ let dszRes = await getUserByPost({ postName: '董事长' });
|
|
674
|
+ let dszUserId = dszRes.data[0].userId;
|
|
675
|
+ this.$set(this.taskForm.variables, 'approval', dszUserId);
|
|
676
|
+ this.$set(this.taskForm.variables, "skip", true);
|
|
677
|
+ }
|
618
|
678
|
//提交到下一个流程
|
619
|
679
|
getNextFlowNode({ taskId: this.taskForm.taskId }).then(res => {
|
620
|
680
|
complete(this.taskForm).then(response => {
|
|
@@ -630,7 +690,6 @@ export default {
|
630
|
690
|
Number(this.budgetForm.winExpense || 0) +
|
631
|
691
|
Number(this.budgetForm.taxExpense || 0) +
|
632
|
692
|
Number(this.budgetForm.travelExpense || 0);
|
633
|
|
- // Calculate total budget by adding all components
|
634
|
693
|
const innerStaffTotal = this.innerStaffList.reduce((sum, staff) => sum + (Number(staff.amount) || 0), 0);
|
635
|
694
|
const outerStaffTotal = this.outerStaffList.reduce((sum, staff) => sum + (Number(staff.amount) || 0), 0);
|
636
|
695
|
const carTotal = this.carList.reduce((sum, car) => sum + (Number(car.amount) || 0), 0);
|
|
@@ -666,8 +725,13 @@ export default {
|
666
|
725
|
staff.amount = (Number(staff.staffCost) + Number(staff.performance)).toFixed(2);
|
667
|
726
|
let innerStaffTotal = this.innerStaffList.reduce((sum, staff) => sum + (Number(staff.amount) || 0), 0);
|
668
|
727
|
let outerStaffTotal = this.outerStaffList.reduce((sum, staff) => sum + (Number(staff.amount) || 0), 0);
|
|
728
|
+ let innerStaffPerformance = this.innerStaffList.reduce((sum, staff) => sum + (Number(staff.performance) || 0), 0);
|
669
|
729
|
this.budgetForm.staffCost = (innerStaffTotal + outerStaffTotal).toFixed(2);
|
670
|
730
|
this.updateTotalJYAmount();
|
|
731
|
+ if (innerStaffPerformance > this.budgetForm.settleExpense) {
|
|
732
|
+ this.$message.error('内业人员成本超过内业绩效总额,请修改');
|
|
733
|
+ return;
|
|
734
|
+ }
|
671
|
735
|
},
|
672
|
736
|
updateOuterStaffAmount(staff, value, field) {
|
673
|
737
|
staff[field] = value;
|
|
@@ -681,18 +745,37 @@ export default {
|
681
|
745
|
updateCarAmount(car, value) {
|
682
|
746
|
car.days = value;
|
683
|
747
|
car.amount = (Number(car.car.dayCost) * Number(car.days)).toFixed(2);
|
|
748
|
+ let carTotal = this.carList.reduce((sum, car) => sum + (Number(car.amount) || 0), 0);
|
|
749
|
+ this.budgetForm.carCost = carTotal.toFixed(2);
|
684
|
750
|
this.updateTotalJYAmount();
|
685
|
751
|
},
|
686
|
752
|
updateDeviceAmount(device, value) {
|
687
|
753
|
device.days = value;
|
688
|
754
|
device.amount = (Number(device.device.dayCost) * Number(device.days)).toFixed(2);
|
|
755
|
+ let deviceTotal = this.deviceList.reduce((sum, device) => sum + (Number(device.amount) || 0), 0);
|
|
756
|
+ this.budgetForm.deviceCost = deviceTotal.toFixed(2);
|
689
|
757
|
this.updateTotalJYAmount();
|
690
|
758
|
},
|
|
759
|
+ updateSiteAmount(site, value) {
|
|
760
|
+ site.amount = value;
|
|
761
|
+ let siteTotal = this.siteList.reduce((sum, site) => sum + (Number(site.amount) || 0), 0);
|
|
762
|
+ this.budgetForm.siteSum = siteTotal.toFixed(2);
|
|
763
|
+ this.updateTotalJYAmount();
|
|
764
|
+ },
|
|
765
|
+ isPerformanceExceeded() {
|
|
766
|
+ const totalPerformance = this.innerStaffList.reduce((sum, staff) => sum + (Number(staff.performance) || 0), 0);
|
|
767
|
+ return totalPerformance > Number(this.budgetForm.settleExpense);
|
|
768
|
+ },
|
|
769
|
+ isReturn(val) {
|
|
770
|
+ this.showAlter = val;
|
|
771
|
+ },
|
691
|
772
|
},
|
692
|
773
|
}
|
693
|
774
|
</script>
|
694
|
775
|
|
695
|
776
|
<style lang="scss" scoped>
|
|
777
|
+@import "@/assets/styles/element-reset.scss";
|
|
778
|
+
|
696
|
779
|
.mylabel {
|
697
|
780
|
font-weight: bold;
|
698
|
781
|
}
|
|
@@ -794,4 +877,22 @@ table {
|
794
|
877
|
line-height: 30px;
|
795
|
878
|
/* 如果需要垂直居中 */
|
796
|
879
|
}
|
|
880
|
+
|
|
881
|
+.performance-error {
|
|
882
|
+ background-color: #fef0f0 !important;
|
|
883
|
+ color: #f56c6c !important;
|
|
884
|
+ border: 1px solid #fbc4c4 !important;
|
|
885
|
+}
|
|
886
|
+
|
|
887
|
+.performance-error:hover {
|
|
888
|
+ background-color: #fde2e2 !important;
|
|
889
|
+}
|
|
890
|
+
|
|
891
|
+.performance-error .el-input-number {
|
|
892
|
+ .el-input__inner {
|
|
893
|
+ background-color: #fef0f0;
|
|
894
|
+ border-color: #f56c6c;
|
|
895
|
+ color: #f56c6c;
|
|
896
|
+ }
|
|
897
|
+}
|
797
|
898
|
</style>
|