|
@@ -2,12 +2,12 @@
|
2
|
2
|
* @Author: ysh
|
3
|
3
|
* @Date: 2024-06-21 18:51:51
|
4
|
4
|
* @LastEditors: Please set LastEditors
|
5
|
|
- * @LastEditTime: 2025-04-03 16:58:09
|
|
5
|
+ * @LastEditTime: 2025-04-21 09:34:14
|
6
|
6
|
-->
|
7
|
7
|
<template>
|
8
|
8
|
<div class="app-container">
|
9
|
9
|
<h2 class="text-center">项目直接生产成本预算表</h2>
|
10
|
|
- <p style="text-align: center;">编制人:{{ $store.getters.name }}</p>
|
|
10
|
+ <p style="text-align: center">编制人:{{ $store.getters.name }}</p>
|
11
|
11
|
<el-divider></el-divider>
|
12
|
12
|
<div class="mt20 mb20" v-if="showAlter">
|
13
|
13
|
<el-alert title="任务被退回,请修改后重新提交" type="error" :closable="false">
|
|
@@ -15,12 +15,24 @@
|
15
|
15
|
</el-alert>
|
16
|
16
|
</div>
|
17
|
17
|
<el-descriptions title="项目信息" labelClassName="mylabel">
|
18
|
|
- <el-descriptions-item label="项目编号">{{ project.projectNumber }}</el-descriptions-item>
|
19
|
|
- <el-descriptions-item label="项目名称">{{ project.projectName }}</el-descriptions-item>
|
20
|
|
- <el-descriptions-item label="项目负责人">{{ getUserName(project.projectLeader) }}</el-descriptions-item>
|
21
|
|
- <el-descriptions-item label="项目类型">{{ project.projectType }}</el-descriptions-item>
|
22
|
|
- <el-descriptions-item label="承担部门">{{ getDeptNames(project.undertakingDept) }}</el-descriptions-item>
|
23
|
|
- <el-descriptions-item label="甲方单位">{{ project.partyA ? project.partyA.partyAName : "" }}</el-descriptions-item>
|
|
18
|
+ <el-descriptions-item label="项目编号">{{
|
|
19
|
+ project.projectNumber
|
|
20
|
+ }}</el-descriptions-item>
|
|
21
|
+ <el-descriptions-item label="项目名称">{{
|
|
22
|
+ project.projectName
|
|
23
|
+ }}</el-descriptions-item>
|
|
24
|
+ <el-descriptions-item label="项目负责人">{{
|
|
25
|
+ getUserName(project.projectLeader)
|
|
26
|
+ }}</el-descriptions-item>
|
|
27
|
+ <el-descriptions-item label="项目类型">{{
|
|
28
|
+ project.projectType
|
|
29
|
+ }}</el-descriptions-item>
|
|
30
|
+ <el-descriptions-item label="承担部门">{{
|
|
31
|
+ getDeptNames(project.undertakingDept)
|
|
32
|
+ }}</el-descriptions-item>
|
|
33
|
+ <el-descriptions-item label="甲方单位">{{
|
|
34
|
+ project.partyA ? project.partyA.partyAName : ""
|
|
35
|
+ }}</el-descriptions-item>
|
24
|
36
|
</el-descriptions>
|
25
|
37
|
<el-divider><b>间接成本</b></el-divider>
|
26
|
38
|
<!-- 选择人员 -->
|
|
@@ -43,15 +55,34 @@
|
43
|
55
|
<el-form-item label="预算表单备注" label-width="100px">
|
44
|
56
|
<el-input type="textarea" v-model="budgetForm.remark" placeholder="请输入预算备注" :rows="4"></el-input>
|
45
|
57
|
</el-form-item>
|
|
58
|
+ <el-form-item label="附件上传" label-width="100px">
|
|
59
|
+ <FileUpload v-if="budgetForm.document == null || budgetForm.document == ''" :disabled="taskName != '预算编制'"
|
|
60
|
+ :limit="1" :filePathName="'预算编制/附件上传'" :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf', 'rar', 'zip']"
|
|
61
|
+ @input="getDocumentPath"></FileUpload>
|
|
62
|
+ <div v-if="budgetForm.document">
|
|
63
|
+ <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + budgetForm.document}`)">
|
|
64
|
+ {{ getFileName(budgetForm.document) }}
|
|
65
|
+ </el-link>
|
|
66
|
+ <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + budgetForm.document}`"
|
|
67
|
+ :underline="false" target="_blank">
|
|
68
|
+ <span class="el-icon-download">下载文件</span>
|
|
69
|
+ </el-link>
|
|
70
|
+ <FileUpload v-if="taskName == '预算编制'" :limit="1" :filePathName="'预算编制/附件上传'"
|
|
71
|
+ :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf', 'rar', 'zip']" @input="getDocumentPath"></FileUpload>
|
|
72
|
+ </div>
|
|
73
|
+ </el-form-item>
|
46
|
74
|
</el-form>
|
47
|
75
|
<!-- 统计 -->
|
48
|
76
|
<div class="text-center">
|
49
|
77
|
<el-tag class="ml10 mr10" type="success">间接成本:{{ isNaN(budgetForm.fixCost) ? 0 : budgetForm.fixCost }}</el-tag>
|
50
|
|
- <el-tag class="ml10 mr10">直接成本:{{ isNaN(budgetForm.directExpense) ? 0 : budgetForm.directExpense }}</el-tag>
|
51
|
|
- <el-tag class="ml10 mr10" type="danger">预算总成本:{{ isNaN(budgetForm.totalBudget) ? 0 : budgetForm.totalBudget
|
52
|
|
- }}</el-tag>
|
|
78
|
+ <el-tag class="ml10 mr10">直接成本:{{
|
|
79
|
+ isNaN(budgetForm.directExpense) ? 0 : budgetForm.directExpense
|
|
80
|
+ }}</el-tag>
|
|
81
|
+ <el-tag class="ml10 mr10" type="danger">预算总成本:{{
|
|
82
|
+ isNaN(budgetForm.totalBudget) ? 0 : budgetForm.totalBudget
|
|
83
|
+ }}</el-tag>
|
53
|
84
|
</div>
|
54
|
|
- <div class="mt20 text-center" style="color:#909399;font-size:12px;">
|
|
85
|
+ <div class="mt20 text-center" style="color: #909399; font-size: 12px">
|
55
|
86
|
tips:预览表单,请先保存之后刷新再查看
|
56
|
87
|
</div>
|
57
|
88
|
<el-divider></el-divider>
|
|
@@ -70,21 +101,38 @@
|
70
|
101
|
<script>
|
71
|
102
|
import { Snowflake } from "@/utils/snowFlake.js";
|
72
|
103
|
import { getProject } from "@/api/oa/project/project";
|
73
|
|
-import { listBudget, addBudget, updateBudget, delBudget } from "@/api/oa/budget/budget.js";
|
|
104
|
+import {
|
|
105
|
+ listBudget,
|
|
106
|
+ addBudget,
|
|
107
|
+ updateBudget,
|
|
108
|
+ delBudget,
|
|
109
|
+} from "@/api/oa/budget/budget.js";
|
74
|
110
|
import { listBudgetCar, addBudgetCar, delBudgetCar } from "@/api/oa/budget/budgetCar.js";
|
75
|
|
-import { listBudgetStaff, addBudgetStaff, delBudgetStaff } from "@/api/oa/budget/budgetStaff.js";
|
76
|
|
-import { listBudgetDevice, addBudgetDevice, delBudgetDevice } from "@/api/oa/budget/budgetDevice.js";
|
77
|
|
-import { listBudgetSettle, addBudgetSettle, delBudgetSettle } from "@/api/oa/budget/budgetSettle.js";
|
|
111
|
+import {
|
|
112
|
+ listBudgetStaff,
|
|
113
|
+ addBudgetStaff,
|
|
114
|
+ delBudgetStaff,
|
|
115
|
+} from "@/api/oa/budget/budgetStaff.js";
|
|
116
|
+import {
|
|
117
|
+ listBudgetDevice,
|
|
118
|
+ addBudgetDevice,
|
|
119
|
+ delBudgetDevice,
|
|
120
|
+} from "@/api/oa/budget/budgetDevice.js";
|
|
121
|
+import {
|
|
122
|
+ listBudgetSettle,
|
|
123
|
+ addBudgetSettle,
|
|
124
|
+ delBudgetSettle,
|
|
125
|
+} from "@/api/oa/budget/budgetSettle.js";
|
78
|
126
|
import { getUsersDeptLeaderByDept, getUsersManageLeaderByDept } from "@/api/system/post";
|
79
|
127
|
import { complete, getNextFlowNode } from "@/api/flowable/todo";
|
80
|
128
|
import budgetInfo from "./budgetInfo.vue";
|
81
|
|
-import ReturnComment from '@/views/flowable/form/components/flowBtn/returnComment.vue';
|
82
|
|
-import ReturnBtn from '@/views/flowable/form/components/flowBtn/returnBtn.vue';
|
83
|
|
-import CarTable from './carTable.vue';
|
84
|
|
-import MoneyTable from './moneyTable.vue';
|
|
129
|
+import ReturnComment from "@/views/flowable/form/components/flowBtn/returnComment.vue";
|
|
130
|
+import ReturnBtn from "@/views/flowable/form/components/flowBtn/returnBtn.vue";
|
|
131
|
+import CarTable from "./carTable.vue";
|
|
132
|
+import MoneyTable from "./moneyTable.vue";
|
85
|
133
|
import PeopleTable from "./staffTable.vue";
|
86
|
|
-import DeviceTable from './deviceTable.vue';
|
87
|
|
-import OtherTable from './otherTable.vue';
|
|
134
|
+import DeviceTable from "./deviceTable.vue";
|
|
135
|
+import OtherTable from "./otherTable.vue";
|
88
|
136
|
export default {
|
89
|
137
|
components: {
|
90
|
138
|
ReturnComment,
|
|
@@ -94,13 +142,14 @@ export default {
|
94
|
142
|
DeviceTable,
|
95
|
143
|
MoneyTable,
|
96
|
144
|
OtherTable,
|
97
|
|
- budgetInfo
|
|
145
|
+ budgetInfo,
|
98
|
146
|
},
|
99
|
147
|
data() {
|
100
|
148
|
return {
|
|
149
|
+ baseUrl: process.env.VUE_APP_BASE_API,
|
101
|
150
|
budgetForm: {
|
102
|
151
|
budgetId: new Snowflake(1n, 1n, 0n).nextId().toString(),
|
103
|
|
- projectId: '',
|
|
152
|
+ projectId: "",
|
104
|
153
|
fixCost: 0,
|
105
|
154
|
directExpense: 0,
|
106
|
155
|
totalBudget: 0,
|
|
@@ -110,7 +159,7 @@ export default {
|
110
|
159
|
showAlter: true,
|
111
|
160
|
returnOpen: false,
|
112
|
161
|
viewOpen: false,
|
113
|
|
- }
|
|
162
|
+ };
|
114
|
163
|
},
|
115
|
164
|
props: {
|
116
|
165
|
taskForm: {
|
|
@@ -132,8 +181,8 @@ export default {
|
132
|
181
|
}
|
133
|
182
|
},
|
134
|
183
|
immediate: true, // 立即生效
|
135
|
|
- deep: true //监听对象或数组的时候,要用到深度监听
|
136
|
|
- }
|
|
184
|
+ deep: true, //监听对象或数组的时候,要用到深度监听
|
|
185
|
+ },
|
137
|
186
|
},
|
138
|
187
|
created() {
|
139
|
188
|
this.getProjectInfo();
|
|
@@ -141,17 +190,18 @@ export default {
|
141
|
190
|
},
|
142
|
191
|
methods: {
|
143
|
192
|
initBudgetForm() {
|
144
|
|
- listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(res => {
|
145
|
|
- if (res.rows[0] && res.rows[0].budgetId) {
|
146
|
|
- this.flag = true
|
147
|
|
- this.budgetForm = res.rows[0];
|
148
|
|
- this.budgetId = res.rows[0].budgetId
|
149
|
|
- } else {
|
150
|
|
- this.flag = false
|
151
|
|
- this.budgetForm.projectId = this.taskForm.formId
|
152
|
|
-
|
|
193
|
+ listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(
|
|
194
|
+ res => {
|
|
195
|
+ if (res.rows[0] && res.rows[0].budgetId) {
|
|
196
|
+ this.flag = true;
|
|
197
|
+ this.budgetForm = res.rows[0];
|
|
198
|
+ this.budgetId = res.rows[0].budgetId;
|
|
199
|
+ } else {
|
|
200
|
+ this.flag = false;
|
|
201
|
+ this.budgetForm.projectId = this.taskForm.formId;
|
|
202
|
+ }
|
153
|
203
|
}
|
154
|
|
- })
|
|
204
|
+ );
|
155
|
205
|
},
|
156
|
206
|
getProjectInfo() {
|
157
|
207
|
getProject(this.taskForm.formId).then(response => {
|
|
@@ -161,30 +211,30 @@ export default {
|
161
|
211
|
// 保存
|
162
|
212
|
preserve() {
|
163
|
213
|
if (!this.flag) {
|
164
|
|
- this.addBudgetForm(this.budgetForm)
|
|
214
|
+ this.addBudgetForm(this.budgetForm);
|
165
|
215
|
this.flag = true;
|
166
|
216
|
} else {
|
167
|
|
- this.updateBudgetForm(this.budgetForm)
|
|
217
|
+ this.updateBudgetForm(this.budgetForm);
|
168
|
218
|
}
|
169
|
|
- this.$message.success('保存成功');
|
|
219
|
+ this.$message.success("保存成功");
|
170
|
220
|
},
|
171
|
221
|
viewForm() {
|
172
|
222
|
this.viewOpen = true;
|
173
|
223
|
},
|
174
|
224
|
// 提交下一个流程
|
175
|
225
|
async submitNextFlow() {
|
176
|
|
- if (this.taskName == '预算编制') {
|
|
226
|
+ if (this.taskName == "预算编制") {
|
177
|
227
|
this.preserve();
|
178
|
228
|
}
|
179
|
229
|
const params = { taskId: this.taskForm.taskId };
|
180
|
230
|
const deptIdsStr = this.project.undertakingDept;
|
181
|
|
- const deptIdsArr = (deptIdsStr.split(',')).map(Number);
|
182
|
|
- let approvalList = []
|
|
231
|
+ const deptIdsArr = deptIdsStr.split(",").map(Number);
|
|
232
|
+ let approvalList = [];
|
183
|
233
|
for (let deptId of deptIdsArr) {
|
184
|
|
- let res = await getUsersManageLeaderByDept({ deptId })
|
|
234
|
+ let res = await getUsersManageLeaderByDept({ deptId });
|
185
|
235
|
if (res.code == 200 && res.data) {
|
186
|
236
|
res.data.forEach(element => {
|
187
|
|
- approvalList.push(element.userId)
|
|
237
|
+ approvalList.push(element.userId);
|
188
|
238
|
});
|
189
|
239
|
}
|
190
|
240
|
}
|
|
@@ -214,8 +264,8 @@ export default {
|
214
|
264
|
for (let work of form.contentList) {
|
215
|
265
|
work.budgetId = form.budgetId;
|
216
|
266
|
addBudgetSettle(work).then(res => {
|
217
|
|
- this.$message.success('预算添加成功')
|
218
|
|
- })
|
|
267
|
+ this.$message.success("预算添加成功");
|
|
268
|
+ });
|
219
|
269
|
}
|
220
|
270
|
},
|
221
|
271
|
updateBudgetForm(form) {
|
|
@@ -231,51 +281,51 @@ export default {
|
231
|
281
|
car.budgetId = form.budgetId;
|
232
|
282
|
addBudgetCar(car);
|
233
|
283
|
}
|
234
|
|
- })
|
|
284
|
+ });
|
235
|
285
|
delBudgetDevice(form.budgetId).then(res => {
|
236
|
286
|
for (let device of form.chooseDevice) {
|
237
|
287
|
device.budgetId = form.budgetId;
|
238
|
288
|
addBudgetDevice(device);
|
239
|
289
|
}
|
240
|
|
- })
|
|
290
|
+ });
|
241
|
291
|
delBudgetSettle(form.budgetId).then(res => {
|
242
|
292
|
for (let work of form.contentList) {
|
243
|
293
|
work.budgetId = form.budgetId;
|
244
|
|
- addBudgetSettle(work)
|
|
294
|
+ addBudgetSettle(work);
|
245
|
295
|
}
|
246
|
|
- this.$message.success('预算添加成功')
|
247
|
|
- })
|
|
296
|
+ this.$message.success("预算添加成功");
|
|
297
|
+ });
|
248
|
298
|
},
|
249
|
299
|
getChooseUser(val) {
|
250
|
|
- this.$set(this.budgetForm, 'chooseUser', val);
|
|
300
|
+ this.$set(this.budgetForm, "chooseUser", val);
|
251
|
301
|
},
|
252
|
302
|
getStaffCost(val) {
|
253
|
|
- this.$set(this.budgetForm, 'staffCost', val);
|
|
303
|
+ this.$set(this.budgetForm, "staffCost", val);
|
254
|
304
|
},
|
255
|
305
|
getChooseCar(val) {
|
256
|
|
- this.$set(this.budgetForm, 'chooseCar', val);
|
|
306
|
+ this.$set(this.budgetForm, "chooseCar", val);
|
257
|
307
|
},
|
258
|
308
|
getCarCost(val) {
|
259
|
|
- this.$set(this.budgetForm, 'carCost', val);
|
|
309
|
+ this.$set(this.budgetForm, "carCost", val);
|
260
|
310
|
},
|
261
|
311
|
getChooseDevice(val) {
|
262
|
|
- this.$set(this.budgetForm, 'chooseDevice', val);
|
|
312
|
+ this.$set(this.budgetForm, "chooseDevice", val);
|
263
|
313
|
},
|
264
|
314
|
getDeviceCost(val) {
|
265
|
|
- this.$set(this.budgetForm, 'deviceCost', val);
|
|
315
|
+ this.$set(this.budgetForm, "deviceCost", val);
|
266
|
316
|
},
|
267
|
317
|
getContentList(val) {
|
268
|
|
- this.$set(this.budgetForm, 'contentList', val);
|
|
318
|
+ this.$set(this.budgetForm, "contentList", val);
|
269
|
319
|
},
|
270
|
320
|
getSettleExpense(val) {
|
271
|
|
- this.$set(this.budgetForm, 'settleExpense', val);
|
|
321
|
+ this.$set(this.budgetForm, "settleExpense", val);
|
272
|
322
|
},
|
273
|
323
|
getOtherCost(val) {
|
274
|
|
- this.$set(this.budgetForm, 'outExpense', val.outExpense);
|
275
|
|
- this.$set(this.budgetForm, 'rentExpense', val.rentExpense);
|
276
|
|
- this.$set(this.budgetForm, 'otherExpense', val.otherExpense);
|
277
|
|
- this.$set(this.budgetForm, 'taxExpense', val.taxExpense);
|
278
|
|
- this.$set(this.budgetForm, 'businessExpense', val.businessExpense);
|
|
324
|
+ this.$set(this.budgetForm, "outExpense", val.outExpense);
|
|
325
|
+ this.$set(this.budgetForm, "rentExpense", val.rentExpense);
|
|
326
|
+ this.$set(this.budgetForm, "otherExpense", val.otherExpense);
|
|
327
|
+ this.$set(this.budgetForm, "taxExpense", val.taxExpense);
|
|
328
|
+ this.$set(this.budgetForm, "businessExpense", val.businessExpense);
|
279
|
329
|
},
|
280
|
330
|
getFixCost() {
|
281
|
331
|
const staffCost = this.safeNumber(this.budgetForm.staffCost);
|
|
@@ -296,28 +346,43 @@ export default {
|
296
|
346
|
const taxExpense = this.safeNumber(this.budgetForm.taxExpense);
|
297
|
347
|
const businessExpense = this.safeNumber(this.budgetForm.businessExpense);
|
298
|
348
|
const otherExpense = this.safeNumber(this.budgetForm.otherExpense);
|
299
|
|
- const sum = settleExpense + outExpense + rentExpense + taxExpense + businessExpense + otherExpense;
|
|
349
|
+ const sum =
|
|
350
|
+ settleExpense +
|
|
351
|
+ outExpense +
|
|
352
|
+ rentExpense +
|
|
353
|
+ taxExpense +
|
|
354
|
+ businessExpense +
|
|
355
|
+ otherExpense;
|
300
|
356
|
this.budgetForm.directExpense = sum.toFixed(2);
|
301
|
357
|
},
|
302
|
358
|
getTotalBudget() {
|
303
|
|
- this.budgetForm.totalBudget = (Number(this.budgetForm.fixCost) + Number(this.budgetForm.directExpense)).toFixed(2);
|
|
359
|
+ this.budgetForm.totalBudget = (
|
|
360
|
+ Number(this.budgetForm.fixCost) + Number(this.budgetForm.directExpense)
|
|
361
|
+ ).toFixed(2);
|
304
|
362
|
},
|
305
|
363
|
isReturn(val) {
|
306
|
|
- this.showAlter = val
|
|
364
|
+ this.showAlter = val;
|
307
|
365
|
},
|
308
|
366
|
commentByRole() {
|
309
|
|
- if (this.taskName == '分管审核') {
|
310
|
|
- return this.form.managerComment
|
311
|
|
- } else if (this.taskName == '总经理审批') {
|
312
|
|
- return this.form.gmComment
|
|
367
|
+ if (this.taskName == "分管审核") {
|
|
368
|
+ return this.form.managerComment;
|
|
369
|
+ } else if (this.taskName == "总经理审批") {
|
|
370
|
+ return this.form.gmComment;
|
|
371
|
+ }
|
|
372
|
+ },
|
|
373
|
+ getDocumentPath(val) {
|
|
374
|
+ let arr = val.split('/upload')
|
|
375
|
+ this.budgetForm.document = arr[1]
|
|
376
|
+ if (val == "") {
|
|
377
|
+ this.budgetForm.document = ""
|
313
|
378
|
}
|
314
|
379
|
}
|
315
|
380
|
},
|
316
|
|
-}
|
|
381
|
+};
|
317
|
382
|
</script>
|
318
|
383
|
|
319
|
384
|
<style lang="scss" scoped>
|
320
|
385
|
.mylabel {
|
321
|
386
|
font-weight: bold;
|
322
|
387
|
}
|
323
|
|
-</style>
|
|
388
|
+</style>
|