|
@@ -1,13 +1,14 @@
|
1
|
1
|
<!--
|
2
|
2
|
* @Author: ysh
|
3
|
3
|
* @Date: 2024-04-30 09:03:14
|
4
|
|
- * @LastEditors: wrh
|
5
|
|
- * @LastEditTime: 2024-07-10 17:20:43
|
|
4
|
+ * @LastEditors: Please set LastEditors
|
|
5
|
+ * @LastEditTime: 2024-07-11 17:44:18
|
6
|
6
|
-->
|
7
|
7
|
<template>
|
8
|
8
|
<div class="app-container" v-loading="loading">
|
9
|
9
|
<el-row :gutter="20">
|
10
|
10
|
<el-col :span="flowDisabled ? 19 : 24" :xs="24">
|
|
11
|
+ <el-button type="success" icon="el-icon-printer" @click="printOpen = true">打印</el-button>
|
11
|
12
|
<h2 class="text-center">项目结算表</h2>
|
12
|
13
|
<div class="headers">
|
13
|
14
|
项目信息
|
|
@@ -15,7 +16,8 @@
|
15
|
16
|
</div>
|
16
|
17
|
<el-form ref="settleForm" :model="form" :rules="rules" label-width="160px" :disabled="disabled">
|
17
|
18
|
<el-form-item label="项目编号" prop="projectId">
|
18
|
|
- <el-button icon="el-icon-plus" size="mini" type="primary" @click="prOpen = true">选择项目</el-button>
|
|
19
|
+ <el-button icon="el-icon-plus" size="mini" type="primary" @click="prOpen = true"
|
|
20
|
+ :disabled="taskName != '结算发起'">选择项目</el-button>
|
19
|
21
|
<el-descriptions border v-if="isSelect" style="margin-top: 10px" :column="2">
|
20
|
22
|
<el-descriptions-item label="项目编号" label-class-name="my-label">
|
21
|
23
|
{{ chooseProject.projectNumber }}
|
|
@@ -30,10 +32,10 @@
|
30
|
32
|
{{ chooseProject.contractNumber }}
|
31
|
33
|
</el-descriptions-item>
|
32
|
34
|
<el-descriptions-item label="项目负责人" label-class-name="my-label">
|
33
|
|
- {{ chooseProject.projectLeaderUser ? chooseProject.projectLeaderUser.nickName : "" }}
|
|
35
|
+ {{ getUserName(chooseProject.projectLeader) }}
|
34
|
36
|
</el-descriptions-item>
|
35
|
37
|
<el-descriptions-item label="甲方单位" label-class-name="my-label">
|
36
|
|
- {{ chooseProject.partyA.partyAName }}
|
|
38
|
+ {{ chooseProject.partyA ? chooseProject.partyA.partyAName : '' }}
|
37
|
39
|
</el-descriptions-item>
|
38
|
40
|
<el-descriptions-item label="联系人" label-class-name="my-label">
|
39
|
41
|
{{ chooseProject.contactPerson }}
|
|
@@ -79,13 +81,7 @@
|
79
|
81
|
<FileUpload v-if="taskName == '结算发起'" :limit="1" :filePathName="'项目结算/原始数据'"
|
80
|
82
|
:fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']" @input="setSettleDocument">
|
81
|
83
|
</FileUpload>
|
82
|
|
- <div v-if="form.settleDocument && taskName != '结算发起'" class="upload-list">
|
83
|
|
- <!-- <el-link :href="`${baseUrl}${'/profile/upload' + form.settleDocument}`" :underline="false"
|
84
|
|
- target="_blank">
|
85
|
|
- <span class="el-icon-document" style="color: #00f">
|
86
|
|
- {{ getFileName(form.settleDocument) }}
|
87
|
|
- </span>
|
88
|
|
- </el-link> -->
|
|
84
|
+ <div v-if="form.settleDocument" class="upload-list">
|
89
|
85
|
<el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.settleDocument}`)">
|
90
|
86
|
{{ getFileName(form.settleDocument) }}
|
91
|
87
|
</el-link>
|
|
@@ -95,28 +91,31 @@
|
95
|
91
|
</el-link>
|
96
|
92
|
</div>
|
97
|
93
|
</el-form-item>
|
98
|
|
- <!-- <el-form-item label="项目管理部审核结算单" prop="">
|
99
|
|
- <FileUpload v-if="taskName == '项目管理部结算'" :limit="1" :filePathName="'项目结算/项目管理部审核结算单'"
|
|
94
|
+ <el-form-item label="经营发展部审核结算单" prop="">
|
|
95
|
+ <FileUpload v-if="taskName == '经营发展部校核'" :limit="1" :filePathName="'项目结算/经营发展部审核结算单'"
|
100
|
96
|
:fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']" @input="setModifyDocument">
|
101
|
97
|
</FileUpload>
|
102
|
|
- <div v-if="taskName != '项目管理部结算' && form.modifyDocument" class="upload-list">
|
103
|
|
- <el-link :href="`${baseUrl}${'/profile/upload' + form.modifyDocument}`" :underline="false"
|
104
|
|
- target="_blank">
|
105
|
|
- <span class="el-icon-document" style="color: #00f">
|
106
|
|
- {{ getFileName(form.modifyDocument) }}
|
107
|
|
- </span>
|
|
98
|
+ <div v-if="form.modifyDocument" class="upload-list">
|
|
99
|
+ <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.modifyDocument}`)">
|
|
100
|
+ {{ getFileName(form.modifyDocument) }}
|
|
101
|
+ </el-link>
|
|
102
|
+ <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.modifyDocument}`"
|
|
103
|
+ :underline="false" target="_blank">
|
|
104
|
+ <span class="el-icon-download">下载文件</span>
|
108
|
105
|
</el-link>
|
109
|
106
|
</div>
|
110
|
|
- </el-form-item> -->
|
|
107
|
+ </el-form-item>
|
111
|
108
|
<el-form-item label="分管领导审核结算单" prop="">
|
112
|
109
|
<FileUpload v-if="taskName == '分管审核'" :limit="1" :filePathName="'项目结算/分管领导审核结算单'"
|
113
|
110
|
:fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']" @input="setFinalDocument">
|
114
|
111
|
</FileUpload>
|
115
|
|
- <div v-if="taskName != '分管审核' && form.finalDocument" class="upload-list">
|
116
|
|
- <el-link :href="`${baseUrl}${'/profile/upload' + form.finalDocument}`" :underline="false" target="_blank">
|
117
|
|
- <span class="el-icon-document" style="color: #00f">
|
118
|
|
- {{ getFileName(form.finalDocument) }}
|
119
|
|
- </span>
|
|
112
|
+ <div v-if="form.finalDocument" class="upload-list">
|
|
113
|
+ <el-link type="primary" @click="reviewWord(`${baseUrl}${'/profile/upload' + form.finalDocument}`)">
|
|
114
|
+ {{ getFileName(form.finalDocument) }}
|
|
115
|
+ </el-link>
|
|
116
|
+ <el-link class="ml20" type="warning" :href="`${baseUrl}${'/profile/upload' + form.finalDocument}`"
|
|
117
|
+ :underline="false" target="_blank">
|
|
118
|
+ <span class="el-icon-download">下载文件</span>
|
120
|
119
|
</el-link>
|
121
|
120
|
</div>
|
122
|
121
|
</el-form-item>
|
|
@@ -180,14 +179,14 @@
|
180
|
179
|
<td>
|
181
|
180
|
<tr>
|
182
|
181
|
<td>
|
183
|
|
- <el-button size="mini" type="primary" icon="el-icon-plus"
|
|
182
|
+ <el-button size="mini" type="primary" icon="el-icon-plus" :disabled="isModify"
|
184
|
183
|
@click="handleChoosePrice(work, index)">选择工作内容</el-button>
|
185
|
184
|
</td>
|
186
|
185
|
</tr>
|
187
|
186
|
<tr>
|
188
|
187
|
<td>
|
189
|
|
- <el-input v-model="work.content" type="textarea" clearable
|
190
|
|
- :autosize="{ minRows: 4, maxRows: 10 }"></el-input>
|
|
188
|
+ <el-input v-model="work.content" type="textarea" clearable :autosize="{ minRows: 4, maxRows: 10 }"
|
|
189
|
+ :disabled="isModify"></el-input>
|
191
|
190
|
</td>
|
192
|
191
|
</tr>
|
193
|
192
|
</td>
|
|
@@ -205,12 +204,12 @@
|
205
|
204
|
</td>
|
206
|
205
|
<td>
|
207
|
206
|
<el-input-number :precision="2" style="width: 100px" v-model="work.workload" clearable
|
208
|
|
- @blur="calculateSettle(work)" :controls="false"></el-input-number>
|
|
207
|
+ :disabled="isModify" @blur="calculateSettle(work)" :controls="false"></el-input-number>
|
209
|
208
|
</td>
|
210
|
209
|
<td>
|
211
|
210
|
<div style="display: flex">
|
212
|
211
|
<el-input-number :precision="2" style="width: 100px" v-model="work.coefficient" clearable
|
213
|
|
- @blur="calculateSettle(work)" :controls="false"></el-input-number>
|
|
212
|
+ :disabled="isModify" @blur="calculateSettle(work)" :controls="false"></el-input-number>
|
214
|
213
|
<el-popover placement="top-start" title="系数备注" width="200" trigger="click">
|
215
|
214
|
<div v-html="work.noteTip"></div>
|
216
|
215
|
<i class="el-icon-info" slot="reference" @click="getCoefficientRemark(work, work.workType)"></i>
|
|
@@ -222,7 +221,7 @@
|
222
|
221
|
{{ work.settle }}
|
223
|
222
|
</td>
|
224
|
223
|
<td>
|
225
|
|
- <el-input v-model="work.remark" type="textarea" clearable
|
|
224
|
+ <el-input v-model="work.remark" type="textarea" clearable :disabled="isModify"
|
226
|
225
|
:autosize="{ minRows: 4, maxRows: 10 }"></el-input>
|
227
|
226
|
</td>
|
228
|
227
|
<td>
|
|
@@ -234,12 +233,16 @@
|
234
|
233
|
<td :colspan="8">结算费用合计</td>
|
235
|
234
|
<td>{{ settleSumTr.amount }}</td>
|
236
|
235
|
<td>
|
237
|
|
- <el-input v-model="settleSumTr.remark" type="textarea" clearable
|
|
236
|
+ <el-input v-model="settleSumTr.remark" type="textarea" clearable :disabled="isModify"
|
238
|
237
|
:autosize="{ minRows: 2, maxRows: 10 }"></el-input>
|
239
|
238
|
</td>
|
240
|
239
|
</tr>
|
241
|
240
|
</table>
|
242
|
241
|
<el-button icon="el-icon-plus" type="primary" plain size="mini" @click="addWorkList"></el-button>
|
|
242
|
+ <div v-if="exceed">
|
|
243
|
+ <el-alert :title="'超过预算金额:' + exceedAmount" type="error">
|
|
244
|
+ </el-alert>
|
|
245
|
+ </div>
|
243
|
246
|
</el-form-item>
|
244
|
247
|
|
245
|
248
|
<!-- 结算汇总 -->
|
|
@@ -257,21 +260,23 @@
|
257
|
260
|
<td style="width: 280px">备注</td>
|
258
|
261
|
<td style="width: 100px">操作</td>
|
259
|
262
|
</tr>
|
260
|
|
- <tr v-for="(work, index) in settleSumList" :key="index">
|
|
263
|
+ <tr v-for="( work, index ) in settleSumList " :key="index">
|
261
|
264
|
<td>
|
262
|
265
|
{{ index + 1 }}
|
263
|
266
|
</td>
|
264
|
267
|
<td>
|
265
|
|
- <el-input v-model="work.content" type="textarea" clearable :autosize="{ minRows: 2, maxRows: 10 }">
|
|
268
|
+ <el-input v-model="work.content" type="textarea" clearable :autosize="{ minRows: 2, maxRows: 10 }"
|
|
269
|
+ :disabled="isModify">
|
266
|
270
|
</el-input>
|
267
|
271
|
</td>
|
268
|
272
|
<td>
|
269
|
273
|
<el-input-number :min="0" :precision="2" style="width: 200px" v-model="work.amount" clearable
|
270
|
|
- :controls="false" @blur="calculateActualSumSettle()"></el-input-number>
|
|
274
|
+ :disabled="isModify" :controls="false" @blur="calculateActualSumSettle()"></el-input-number>
|
271
|
275
|
<!-- {{ work.amount }} -->
|
272
|
276
|
</td>
|
273
|
277
|
<td>
|
274
|
|
- <el-input v-model="work.remark" type="textarea" clearable :autosize="{ minRows: 2, maxRows: 10 }">
|
|
278
|
+ <el-input v-model="work.remark" type="textarea" clearable :autosize="{ minRows: 2, maxRows: 10 }"
|
|
279
|
+ :disabled="isModify">
|
275
|
280
|
</el-input>
|
276
|
281
|
</td>
|
277
|
282
|
<td>
|
|
@@ -291,7 +296,7 @@
|
291
|
296
|
<td style="width: 280px">备注</td>
|
292
|
297
|
<td style="width: 100px">操作</td>
|
293
|
298
|
</tr>
|
294
|
|
- <tr v-for="(dept, index) in deptSettleList" :key="index">
|
|
299
|
+ <tr v-for="( dept, index ) in deptSettleList " :key="index">
|
295
|
300
|
<td :rowspan="deptSettleList.length" v-if="index == 0">
|
296
|
301
|
{{ Number(actualSumSettle).toFixed(2) }}
|
297
|
302
|
</td>
|
|
@@ -301,18 +306,20 @@
|
301
|
306
|
<td>
|
302
|
307
|
<!-- <el-input v-model="dept.content" type="textarea" clearable :autosize="{ minRows: 2, maxRows: 10 }">
|
303
|
308
|
</el-input> -->
|
304
|
|
- <el-select v-model="dept.content" placeholder="请选择" filterable clearable style="width:100%;">
|
305
|
|
- <el-option v-for="item in deptList" :key="item.deptId" :label="item.deptName"
|
|
309
|
+ <el-select v-model="dept.content" placeholder="请选择" filterable clearable style="width:100%;"
|
|
310
|
+ :disabled="isModify">
|
|
311
|
+ <el-option v-for=" item in deptList " :key="item.deptId" :label="item.deptName"
|
306
|
312
|
:value="item.deptName">
|
307
|
313
|
</el-option>
|
308
|
314
|
</el-select>
|
309
|
315
|
</td>
|
310
|
316
|
<td>
|
311
|
317
|
<el-input-number :precision="2" style="width: 200px" v-model="dept.amount" clearable :controls="false"
|
312
|
|
- @blur="calculateDeptAmount(index)"></el-input-number>
|
|
318
|
+ :disabled="isModify" @blur="calculateDeptAmount(index)"></el-input-number>
|
313
|
319
|
</td>
|
314
|
320
|
<td>
|
315
|
|
- <el-input v-model="dept.remark" type="textarea" clearable :autosize="{ minRows: 2, maxRows: 10 }">
|
|
321
|
+ <el-input v-model="dept.remark" type="textarea" clearable :autosize="{ minRows: 2, maxRows: 10 }"
|
|
322
|
+ :disabled="isModify">
|
316
|
323
|
</el-input>
|
317
|
324
|
</td>
|
318
|
325
|
<td>
|
|
@@ -324,7 +331,7 @@
|
324
|
331
|
<td :colspan="2">结算说明</td>
|
325
|
332
|
<td :colspan="3">
|
326
|
333
|
<el-input v-model="form.settleComment" type="textarea" clearable placeholder="请输入说明"
|
327
|
|
- :autosize="{ minRows: 2, maxRows: 10 }">
|
|
334
|
+ :autosize="{ minRows: 2, maxRows: 10 }" :disabled="isModify">
|
328
|
335
|
</el-input>
|
329
|
336
|
</td>
|
330
|
337
|
</tr>
|
|
@@ -372,40 +379,6 @@
|
372
|
379
|
</el-form-item>
|
373
|
380
|
</el-col>
|
374
|
381
|
</el-row>
|
375
|
|
- <!-- <el-form-item label="项目管理部(结算)">
|
376
|
|
- <el-input v-model="form.xmComment" type="textarea" :disabled="taskName != '项目管理部结算'" clearable
|
377
|
|
- :autosize="{ minRows: 4, maxRows: 10 }">
|
378
|
|
- </el-input>
|
379
|
|
- </el-form-item>
|
380
|
|
- <el-row>
|
381
|
|
- <el-col :span="6" :xs="24" :offset="12">
|
382
|
|
- <el-form-item label="签名:" label-width="120px">
|
383
|
|
- <span class="auditor"> {{ form.xmUserName }} </span>
|
384
|
|
- </el-form-item>
|
385
|
|
- </el-col>
|
386
|
|
- <el-col :span="6">
|
387
|
|
- <el-form-item label="日期:" label-width="120px">
|
388
|
|
- <span> {{ form.xmTime }} </span>
|
389
|
|
- </el-form-item>
|
390
|
|
- </el-col>
|
391
|
|
- </el-row>
|
392
|
|
- <el-form-item label="项目承担部门(确认)">
|
393
|
|
- <el-input v-model="form.deptComment" type="textarea" :disabled="taskName != '结算发起人确认'" clearable
|
394
|
|
- :autosize="{ minRows: 4, maxRows: 10 }">
|
395
|
|
- </el-input>
|
396
|
|
- </el-form-item>
|
397
|
|
- <el-row>
|
398
|
|
- <el-col :span="6" :xs="24" :offset="12">
|
399
|
|
- <el-form-item label="签名:" label-width="120px">
|
400
|
|
- <span class="auditor"> {{ form.deptUserName }} </span>
|
401
|
|
- </el-form-item>
|
402
|
|
- </el-col>
|
403
|
|
- <el-col :span="6">
|
404
|
|
- <el-form-item label="日期:" label-width="120px">
|
405
|
|
- <span> {{ form.deptTime }} </span>
|
406
|
|
- </el-form-item>
|
407
|
|
- </el-col>
|
408
|
|
- </el-row> -->
|
409
|
382
|
<el-form-item label="经营发展部(校核)">
|
410
|
383
|
<el-input v-model="form.jyComment" type="textarea" :disabled="taskName != '经营发展部校核'" clearable
|
411
|
384
|
:autosize="{ minRows: 4, maxRows: 10 }">
|
|
@@ -457,12 +430,31 @@
|
457
|
430
|
</el-form-item>
|
458
|
431
|
</el-col>
|
459
|
432
|
</el-row>
|
|
433
|
+
|
|
434
|
+ <el-form-item label="董事长(批准)" v-if="exceed">
|
|
435
|
+ <el-input v-model="form.dszComment" type="textarea" :disabled="taskName != '董事长批准'" clearable
|
|
436
|
+ :autosize="{ minRows: 4, maxRows: 10 }">
|
|
437
|
+ </el-input>
|
|
438
|
+ </el-form-item>
|
|
439
|
+ <el-row v-if="exceed">
|
|
440
|
+ <el-col :span="6" :xs="24" :offset="12">
|
|
441
|
+ <el-form-item label="签名:" label-width="120px">
|
|
442
|
+ <span class="auditor"> {{ form.dszUserName }} </span>
|
|
443
|
+ </el-form-item>
|
|
444
|
+ </el-col>
|
|
445
|
+ <el-col :span="6">
|
|
446
|
+ <el-form-item label="日期:" label-width="120px">
|
|
447
|
+ <span> {{ form.dszTime }} </span>
|
|
448
|
+ </el-form-item>
|
|
449
|
+ </el-col>
|
|
450
|
+ </el-row>
|
460
|
451
|
</div>
|
461
|
452
|
</el-form>
|
|
453
|
+ <el-button type="success" icon="el-icon-printer" @click="printOpen = true">打印</el-button>
|
462
|
454
|
<div style="text-align: center" v-if="!disabled">
|
463
|
|
- <el-button type="success" icon="el-icon-printer" @click="printOpen = true">打印</el-button>
|
464
|
455
|
<el-button type="warning" @click="preserve">保存</el-button>
|
465
|
|
- <el-button type="primary" @click="submitNextFlow">提交下一个流程</el-button>
|
|
456
|
+ <el-button type="primary" @click="submitNextFlow" v-if="taskName != '董事长批准'">提交下一个流程</el-button>
|
|
457
|
+ <el-button type="primary" @click="submitNextFlow" v-else>结算批准</el-button>
|
466
|
458
|
</div>
|
467
|
459
|
</el-col>
|
468
|
460
|
<el-col :span="5" :xs="24" v-if="flowDisabled">
|
|
@@ -606,9 +598,16 @@ export default {
|
606
|
598
|
clickWork: {},
|
607
|
599
|
deptId: undefined,
|
608
|
600
|
deptList: [],
|
609
|
|
- isCorrect: true,
|
|
601
|
+ exceed: false, //是否超预算
|
|
602
|
+ exceedAmount: 0,
|
|
603
|
+ isModify: false, //是否可以修改结算工作量
|
610
|
604
|
};
|
611
|
605
|
},
|
|
606
|
+ watch: {
|
|
607
|
+ 'chooseProject.projectId'(val) {
|
|
608
|
+ this.getBudgetSettle();
|
|
609
|
+ }
|
|
610
|
+ },
|
612
|
611
|
created() {
|
613
|
612
|
this.getProjectList(); //获取项目列表
|
614
|
613
|
this.getContractDataList(); //获取合同编码和编号
|
|
@@ -631,40 +630,105 @@ export default {
|
631
|
630
|
});
|
632
|
631
|
} else {
|
633
|
632
|
this.handleSelectProject(this.form.projectId);
|
634
|
|
- this.getBudgetSettle();
|
635
|
633
|
}
|
|
634
|
+ this.isModify = this.taskName != '结算发起' && this.taskName != '经营发展部校核' && this.taskName != '分管审核'
|
636
|
635
|
},
|
637
|
636
|
methods: {
|
638
|
637
|
// 初始化表单
|
639
|
|
- initForm() {
|
640
|
|
- listSettle({ settleId: this.taskForm.formId }).then((res) => {
|
641
|
|
- if (res.total == 1) {
|
642
|
|
- this.form = res.rows[0];
|
643
|
|
- this.flag = true;
|
644
|
|
- this.handleSelectProject(res.rows[0].projectId);
|
645
|
|
- this.listSettleWorkFn();
|
646
|
|
- this.listSettleSummaryFn();
|
647
|
|
- getUser(this.form.reporter).then((res) => {
|
648
|
|
- if (res.data) {
|
649
|
|
- this.form.reporterName = res.data.nickName;
|
650
|
|
- this.deptId = res.data.deptId;
|
|
638
|
+ async initForm() {
|
|
639
|
+ const res = await listSettle({ settleId: this.taskForm.formId });
|
|
640
|
+ if (res.total === 1) {
|
|
641
|
+ this.form = res.rows[0];
|
|
642
|
+ this.flag = true;
|
|
643
|
+ const settleId = this.taskForm.formId;
|
|
644
|
+ const [
|
|
645
|
+ projectResponse,
|
|
646
|
+ budgetResponse,
|
|
647
|
+ settleWorkResponse,
|
|
648
|
+ settleSummaryResponse
|
|
649
|
+ ] = await Promise.all([
|
|
650
|
+ getProject(res.rows[0].projectId),
|
|
651
|
+ listBudget({ projectId: res.rows[0].projectId }),
|
|
652
|
+ listSettleWork({ settleId }),
|
|
653
|
+ listSettleSummary({ settleId })
|
|
654
|
+ ]);
|
|
655
|
+
|
|
656
|
+ if (projectResponse) {
|
|
657
|
+ this.chooseProject = projectResponse.data;
|
|
658
|
+ this.isSelect = true;
|
|
659
|
+ }
|
|
660
|
+ if (budgetResponse && budgetResponse.total === 1) {
|
|
661
|
+ const budgetId = budgetResponse.rows[0].budgetId;
|
|
662
|
+ const budgetSettleResponse = await listBudgetSettle({ budgetId });
|
|
663
|
+ if (budgetSettleResponse.code === 200) {
|
|
664
|
+ this.budgetList = budgetSettleResponse.rows;
|
|
665
|
+ this.budgetSettle = budgetResponse.rows[0].settleExpense;
|
|
666
|
+ } else {
|
|
667
|
+ this.budgetList = [];
|
|
668
|
+ this.budgetSettle = 0;
|
|
669
|
+ }
|
|
670
|
+ } else {
|
|
671
|
+ this.budgetList = [];
|
|
672
|
+ this.budgetSettle = 0;
|
|
673
|
+ }
|
|
674
|
+ // 获取申请工作量列表
|
|
675
|
+ if (settleWorkResponse) {
|
|
676
|
+ this.settleWorkList = settleWorkResponse.rows;
|
|
677
|
+ for (let work of this.settleWorkList) {
|
|
678
|
+ getPrice(work.priceId).then((settleWorkResponse) => {
|
|
679
|
+ if (settleWorkResponse.data) {
|
|
680
|
+ this.setValue(work, "scale", settleWorkResponse.data.scaleGrade);
|
|
681
|
+ this.setValue(work, "unit", settleWorkResponse.data.unit);
|
|
682
|
+ if (work.groundType == "0") {
|
|
683
|
+ work.price = settleWorkResponse.data.commonPrice;
|
|
684
|
+ } else {
|
|
685
|
+ work.price = settleWorkResponse.data.complexPrice;
|
|
686
|
+ }
|
|
687
|
+ }
|
|
688
|
+ });
|
|
689
|
+ }
|
|
690
|
+ }
|
|
691
|
+ // 结算汇总里的扣除明细以及部门结算金额
|
|
692
|
+ if (settleSummaryResponse) {
|
|
693
|
+ this.oldSettleSumList = settleSummaryResponse.rows;
|
|
694
|
+ for (let s of settleSummaryResponse.rows) {
|
|
695
|
+ if (s.content == "结算费用合计") {
|
|
696
|
+ this.settleSumTr = s;
|
|
697
|
+ break;
|
651
|
698
|
}
|
652
|
|
- });
|
653
|
|
- this.getCurrentUser();
|
654
|
|
- } else if (res.total == 0) {
|
655
|
|
- this.flag = false;
|
656
|
|
- if (this.taskName == "结算发起") {
|
657
|
|
- this.form.reporter = this.$store.state.user.id;
|
658
|
|
- this.form.reporterName = this.$store.state.user.name;
|
659
|
|
- this.form.reportTime = parseTime(new Date(), "{y}-{m}-{d}");
|
660
|
699
|
}
|
|
700
|
+ this.settleSumList = settleSummaryResponse.rows.filter((item) => item.tableNumber == "0");
|
|
701
|
+ this.deptSettleList = settleSummaryResponse.rows.filter(
|
|
702
|
+ (item) => item.tableNumber == "1"
|
|
703
|
+ );
|
|
704
|
+ this.calculateActualSumSettle();
|
661
|
705
|
}
|
662
|
|
- setTimeout(() => {
|
663
|
|
- this.loading = false;
|
664
|
|
- this.deptList = this.$store.state.user.deptList
|
665
|
|
- }, 500);
|
666
|
|
- });
|
|
706
|
+ if (this.settleSumTr.amount > this.budgetSettle) {
|
|
707
|
+ this.exceed = true
|
|
708
|
+ } else {
|
|
709
|
+ this.exceed = false
|
|
710
|
+ }
|
|
711
|
+ this.calcaulatExceed()
|
|
712
|
+
|
|
713
|
+ getUser(this.form.reporter).then((res) => {
|
|
714
|
+ if (res.data) {
|
|
715
|
+ this.form.reporterName = res.data.nickName;
|
|
716
|
+ this.deptId = res.data.deptId;
|
|
717
|
+ }
|
|
718
|
+ });
|
|
719
|
+ this.getCurrentUser();
|
|
720
|
+ } else if (res.total == 0) {
|
|
721
|
+ this.flag = false;
|
|
722
|
+ if (this.taskName == "结算发起") {
|
|
723
|
+ this.form.reporter = this.$store.state.user.id;
|
|
724
|
+ this.form.reporterName = this.$store.state.user.name;
|
|
725
|
+ this.form.reportTime = parseTime(new Date(), "{y}-{m}-{d}");
|
|
726
|
+ }
|
|
727
|
+ }
|
|
728
|
+ this.loading = false;
|
|
729
|
+ this.deptList = this.$store.state.user.deptList
|
667
|
730
|
},
|
|
731
|
+
|
668
|
732
|
async getBudgetSettle() {
|
669
|
733
|
let budgetData = await listBudget({ projectId: this.form.projectId })
|
670
|
734
|
if (budgetData.total == 1) {
|
|
@@ -672,10 +736,11 @@ export default {
|
672
|
736
|
let datas = await listBudgetSettle({ budgetId })
|
673
|
737
|
if (datas.code == 200) {
|
674
|
738
|
this.budgetList = datas.rows;
|
675
|
|
- this.budgetList.forEach(item => {
|
676
|
|
- this.budgetSettle = this.budgetSettle + item.settle
|
677
|
|
- })
|
|
739
|
+ this.budgetSettle = budgetData.rows[0].settleExpense
|
678
|
740
|
}
|
|
741
|
+ } else {
|
|
742
|
+ this.budgetList = []
|
|
743
|
+ this.budgetSettle = 0
|
679
|
744
|
}
|
680
|
745
|
},
|
681
|
746
|
// 获取当前处理人
|
|
@@ -688,14 +753,6 @@ export default {
|
688
|
753
|
this.form.jsUserName = this.$store.state.user.name;
|
689
|
754
|
this.form.jsUserId = this.$store.state.user.id;
|
690
|
755
|
this.form.jsTime = parseTime(new Date(), "{y}-{m}-{d}");
|
691
|
|
- // } else if (this.taskName == "项目管理部结算") {
|
692
|
|
- // this.form.xmUserName = this.$store.state.user.name;
|
693
|
|
- // this.form.xmUserId = this.$store.state.user.id;
|
694
|
|
- // this.form.xmTime = parseTime(new Date(), "{y}-{m}-{d}");
|
695
|
|
- // } else if (this.taskName == "结算发起人确认") {
|
696
|
|
- // this.form.deptUserName = this.$store.state.user.name;
|
697
|
|
- // this.form.deptUserId = this.$store.state.user.id;
|
698
|
|
- // this.form.deptTime = parseTime(new Date(), "{y}-{m}-{d}");
|
699
|
756
|
} else if (this.taskName == "经营发展部校核") {
|
700
|
757
|
this.form.jyUserName = this.$store.state.user.name;
|
701
|
758
|
this.form.jyUserId = this.$store.state.user.id;
|
|
@@ -708,31 +765,21 @@ export default {
|
708
|
765
|
this.form.gmUserName = this.$store.state.user.name;
|
709
|
766
|
this.form.gmUserId = this.$store.state.user.id;
|
710
|
767
|
this.form.gmTime = parseTime(new Date(), "{y}-{m}-{d}");
|
|
768
|
+ } else if (this.taskName == "董事长批准") {
|
|
769
|
+ this.form.dszUserName = this.$store.state.user.name;
|
|
770
|
+ this.form.dszUserId = this.$store.state.user.id;
|
|
771
|
+ this.form.dszTime = parseTime(new Date(), "{y}-{m}-{d}");
|
711
|
772
|
}
|
712
|
773
|
this.getReviewerName();
|
713
|
774
|
},
|
714
|
775
|
// 获取审核人
|
715
|
776
|
getReviewerName() {
|
716
|
777
|
if (this.form.zhUserId) {
|
717
|
|
- getUser(this.form.zhUserId).then((res) => {
|
718
|
|
- this.form.zhUserName = res.data.nickName;
|
719
|
|
- });
|
|
778
|
+ this.form.zhUserName = this.getUserName(this.form.zhUserId)
|
720
|
779
|
}
|
721
|
780
|
if (this.form.jsUserId) {
|
722
|
|
- getUser(this.form.jsUserId).then((res) => {
|
723
|
|
- this.form.jsUserName = res.data.nickName;
|
724
|
|
- });
|
|
781
|
+ this.form.jsUserName = this.getUserName(this.form.jsUserId)
|
725
|
782
|
}
|
726
|
|
- // if (this.form.xmUserId) {
|
727
|
|
- // getUser(this.form.xmUserId).then((res) => {
|
728
|
|
- // this.form.xmUserName = res.data.nickName;
|
729
|
|
- // });
|
730
|
|
- // }
|
731
|
|
- // if (this.form.deptUserId) {
|
732
|
|
- // getUser(this.form.deptUserId).then((res) => {
|
733
|
|
- // this.form.deptUserName = res.data.nickName;
|
734
|
|
- // });
|
735
|
|
- // }
|
736
|
783
|
if (this.form.jyUserId) {
|
737
|
784
|
getUser(this.form.jyUserId).then((res) => {
|
738
|
785
|
this.form.jyUserName = res.data.nickName;
|
|
@@ -753,20 +800,15 @@ export default {
|
753
|
800
|
preserve() {
|
754
|
801
|
this.$refs["settleForm"].validate((vaild) => {
|
755
|
802
|
if (vaild) {
|
756
|
|
- if (this.isCorrect) {
|
757
|
|
- if (this.flag) {
|
758
|
|
- this.updateSettleFn();
|
759
|
|
- this.updateSettleSummaryFn();
|
760
|
|
- this.updateSettleWorkFn();
|
761
|
|
- this.$message.success("保存成功");
|
762
|
|
- } else {
|
763
|
|
- this.addSettleFn();
|
764
|
|
- this.$message.success("保存成功");
|
765
|
|
- }
|
|
803
|
+ if (this.flag) {
|
|
804
|
+ this.updateSettleFn();
|
|
805
|
+ this.updateSettleSummaryFn();
|
|
806
|
+ this.updateSettleWorkFn();
|
|
807
|
+ this.$message.success("保存成功");
|
766
|
808
|
} else {
|
767
|
|
- this.$message.error('结算合计总金额不能大于预算内项目结算总金额!')
|
|
809
|
+ this.addSettleFn();
|
|
810
|
+ this.$message.success("保存成功");
|
768
|
811
|
}
|
769
|
|
-
|
770
|
812
|
} else {
|
771
|
813
|
this.$message.error('请完善表单必填项')
|
772
|
814
|
}
|
|
@@ -776,31 +818,33 @@ export default {
|
776
|
818
|
this.$refs["settleForm"].validate((vaild) => {
|
777
|
819
|
if (vaild) {
|
778
|
820
|
this.preserve();
|
779
|
|
- if (this.isCorrect) {
|
780
|
|
- if (this.taskName == "结算发起") {
|
781
|
|
- getUserByRole({ roleId: 4 }).then((res) => {
|
782
|
|
- this.getNextFlowNodeFn(res.data[0]);
|
783
|
|
- });
|
784
|
|
- } else if (this.taskName == "综合事务部处理") {
|
785
|
|
- this.getNextFlowNodeFn(null, 110, false);
|
786
|
|
- } else if (this.taskName == "技术质量部审核") {
|
787
|
|
- this.getNextFlowNodeFn(null, 107, false);
|
788
|
|
- // } else if (this.taskName == "项目管理部结算") {
|
789
|
|
- // this.getNextFlowNodeFn();
|
790
|
|
- // } else if (this.taskName == "结算发起人确认") {
|
791
|
|
- // this.getNextFlowNodeFn(null, 105, false);
|
792
|
|
- } else if (this.taskName == "经营发展部校核") {
|
793
|
|
- this.getNextFlowNodeFn(null, this.deptId, true);
|
794
|
|
- } else if (this.taskName == "分管审核") {
|
795
|
|
- getUserByPost({ postName: "总经理" }).then((res) => {
|
|
821
|
+ if (this.taskName == "结算发起") {
|
|
822
|
+ getUserByRole({ roleId: 4 }).then((res) => {
|
|
823
|
+ this.getNextFlowNodeFn(res.data[0]);
|
|
824
|
+ });
|
|
825
|
+ } else if (this.taskName == "综合事务部处理") {
|
|
826
|
+ this.getNextFlowNodeFn(null, 109, false);
|
|
827
|
+ } else if (this.taskName == "技术质量部审核") {
|
|
828
|
+ this.getNextFlowNodeFn(null, 105, true);
|
|
829
|
+ } else if (this.taskName == "经营发展部校核") {
|
|
830
|
+ this.getNextFlowNodeFn(null, this.deptId, true);
|
|
831
|
+ } else if (this.taskName == "分管审核") {
|
|
832
|
+ getUserByPost({ postName: "总经理" }).then((res) => {
|
|
833
|
+ this.getNextFlowNodeFn(res.data[0].userId);
|
|
834
|
+ });
|
|
835
|
+ } else if (this.taskName == "总经理审批") {
|
|
836
|
+ this.$set(this.taskForm.variables, "exceed", this.exceed);
|
|
837
|
+ if (this.exceed) {
|
|
838
|
+ getUserByPost({ postName: "董事长" }).then((res) => {
|
796
|
839
|
this.getNextFlowNodeFn(res.data[0].userId);
|
797
|
840
|
});
|
798
|
|
- } else if (this.taskName == "总经理审批") {
|
|
841
|
+ } else {
|
799
|
842
|
this.getNextFlowNodeFn();
|
800
|
843
|
}
|
801
|
|
- } else {
|
802
|
|
- this.$message.error('结算合计总金额不能大于预算内项目结算总金额!')
|
|
844
|
+ } else if (this.taskName == "董事长批准") {
|
|
845
|
+ this.getNextFlowNodeFn();
|
803
|
846
|
}
|
|
847
|
+
|
804
|
848
|
} else {
|
805
|
849
|
this.$message.error('请完善表单必填项')
|
806
|
850
|
}
|
|
@@ -812,39 +856,34 @@ export default {
|
812
|
856
|
getNextFlowNode(params).then((res) => {
|
813
|
857
|
if (userId) {
|
814
|
858
|
this.$set(this.taskForm.variables, "approval", userId);
|
815
|
|
- complete(this.taskForm).then((response) => {
|
816
|
|
- this.$modal.msgSuccess(response.msg);
|
817
|
|
- this.$emit("goBack");
|
818
|
|
- });
|
|
859
|
+ this.handleComplete(this.taskForm);
|
819
|
860
|
} else {
|
820
|
861
|
if (deptId && isList) {
|
821
|
862
|
getUsersManageLeaderByDept({ deptId }).then((res) => {
|
822
|
|
- let id = [];
|
823
|
|
- id.push(res.data[0].userId);
|
824
|
|
- // id.push(10);
|
825
|
|
- this.$set(this.taskForm.variables, "approvalList", id);
|
826
|
|
- complete(this.taskForm).then((response) => {
|
827
|
|
- this.$modal.msgSuccess(response.msg);
|
828
|
|
- this.$emit("goBack");
|
829
|
|
- });
|
|
863
|
+ let ids = [];
|
|
864
|
+ res.data.forEach(user => {
|
|
865
|
+ ids.push(user.userId)
|
|
866
|
+ })
|
|
867
|
+ this.$set(this.taskForm.variables, "approvalList", ids);
|
|
868
|
+ this.handleComplete(this.taskForm);
|
830
|
869
|
});
|
831
|
870
|
} else if (deptId && !isList) {
|
832
|
871
|
getUsersDeptLeaderByDept({ deptId }).then((res) => {
|
833
|
872
|
this.$set(this.taskForm.variables, "approval", res.data.userId);
|
834
|
|
- complete(this.taskForm).then((response) => {
|
835
|
|
- this.$modal.msgSuccess(response.msg);
|
836
|
|
- this.$emit("goBack");
|
837
|
|
- });
|
|
873
|
+ this.handleComplete(this.taskForm);
|
838
|
874
|
});
|
839
|
875
|
} else {
|
840
|
|
- complete(this.taskForm).then((response) => {
|
841
|
|
- this.$modal.msgSuccess(response.msg);
|
842
|
|
- this.$emit("goBack");
|
843
|
|
- });
|
|
876
|
+ this.handleComplete(this.taskForm);
|
844
|
877
|
}
|
845
|
878
|
}
|
846
|
879
|
});
|
847
|
880
|
},
|
|
881
|
+ handleComplete(taskForm) {
|
|
882
|
+ complete(taskForm).then(response => {
|
|
883
|
+ this.$modal.msgSuccess(response.msg);
|
|
884
|
+ this.$emit('goBack');
|
|
885
|
+ })
|
|
886
|
+ },
|
848
|
887
|
// 查询项目列表
|
849
|
888
|
getProjectList() {
|
850
|
889
|
listProject({
|
|
@@ -860,6 +899,7 @@ export default {
|
860
|
899
|
getProject(val).then((res) => {
|
861
|
900
|
this.chooseProject = res.data;
|
862
|
901
|
this.isSelect = true;
|
|
902
|
+ this.getBudgetSettle();
|
863
|
903
|
getUser(this.chooseProject.projectRegistrant).then((res) => {
|
864
|
904
|
if (res.data) {
|
865
|
905
|
this.$set(
|
|
@@ -970,11 +1010,16 @@ export default {
|
970
|
1010
|
}
|
971
|
1011
|
this.settleSumTr.amount = sum.toFixed(2);
|
972
|
1012
|
if (sum > this.budgetSettle) {
|
973
|
|
- this.$message.error('结算合计总金额不能大于预算内项目结算总金额!')
|
974
|
|
- this.settleSumTr.amount = this.budgetSettle.toFixed(2);
|
975
|
|
- this.isCorrect = false;
|
|
1013
|
+ this.$confirm('结算合计总金额大于了预算内项目结算总金额,将走《超预算或预算外支付(报销)》流程', '提示', {
|
|
1014
|
+ confirmButtonText: '确定',
|
|
1015
|
+ type: 'warning'
|
|
1016
|
+ }).then(() => {
|
|
1017
|
+ this.exceed = true;
|
|
1018
|
+ this.calcaulatExceed();
|
|
1019
|
+ return
|
|
1020
|
+ })
|
976
|
1021
|
} else {
|
977
|
|
- this.isCorrect = true;
|
|
1022
|
+ this.exceed = false;
|
978
|
1023
|
}
|
979
|
1024
|
},
|
980
|
1025
|
calculateActualSumSettle() {
|
|
@@ -984,6 +1029,8 @@ export default {
|
984
|
1029
|
sum = sum + Number(a.amount);
|
985
|
1030
|
}
|
986
|
1031
|
this.actualSumSettle = Number(this.settleSumTr.amount) - sum;
|
|
1032
|
+ if (this.deptSettleList.length == 1)
|
|
1033
|
+ this.deptSettleList[0].amount = this.actualSumSettle;
|
987
|
1034
|
},
|
988
|
1035
|
calculateDeptAmount(index) {
|
989
|
1036
|
let num = 0;
|
|
@@ -997,6 +1044,10 @@ export default {
|
997
|
1044
|
}
|
998
|
1045
|
}
|
999
|
1046
|
},
|
|
1047
|
+ calcaulatExceed() {
|
|
1048
|
+ if (Number(this.budgetSettle) - Number(this.settleSumTr.amount) < 0)
|
|
1049
|
+ this.exceedAmount = Number(this.settleSumTr.amount) - Number(this.budgetSettle)
|
|
1050
|
+ },
|
1000
|
1051
|
handleChoosePrice(work, index) {
|
1001
|
1052
|
this.clickWork = work;
|
1002
|
1053
|
this.clickWork.index = index;
|
|
@@ -1053,41 +1104,7 @@ export default {
|
1053
|
1104
|
addSettleSummary(item);
|
1054
|
1105
|
}
|
1055
|
1106
|
},
|
1056
|
|
- // 获取数据
|
1057
|
|
- listSettleWorkFn() {
|
1058
|
|
- listSettleWork({ settleId: this.taskForm.formId }).then((res) => {
|
1059
|
|
- this.settleWorkList = res.rows;
|
1060
|
|
- for (let work of this.settleWorkList) {
|
1061
|
|
- getPrice(work.priceId).then((res) => {
|
1062
|
|
- if (res.data) {
|
1063
|
|
- this.setValue(work, "scale", res.data.scaleGrade);
|
1064
|
|
- this.setValue(work, "unit", res.data.unit);
|
1065
|
|
- if (work.groundType == "0") {
|
1066
|
|
- work.price = res.data.commonPrice;
|
1067
|
|
- } else {
|
1068
|
|
- work.price = res.data.complexPrice;
|
1069
|
|
- }
|
1070
|
|
- }
|
1071
|
|
- });
|
1072
|
|
- }
|
1073
|
|
- });
|
1074
|
|
- },
|
1075
|
|
- listSettleSummaryFn() {
|
1076
|
|
- listSettleSummary({ settleId: this.taskForm.formId }).then((res) => {
|
1077
|
|
- this.oldSettleSumList = res.rows;
|
1078
|
|
- for (let s of res.rows) {
|
1079
|
|
- if (s.content == "结算费用合计") {
|
1080
|
|
- this.settleSumTr = s;
|
1081
|
|
- break;
|
1082
|
|
- }
|
1083
|
|
- }
|
1084
|
|
- this.settleSumList = res.rows.filter((item) => item.tableNumber == "0");
|
1085
|
|
- this.deptSettleList = res.rows.filter(
|
1086
|
|
- (item) => item.tableNumber == "1"
|
1087
|
|
- );
|
1088
|
|
- this.calculateActualSumSettle();
|
1089
|
|
- });
|
1090
|
|
- },
|
|
1107
|
+
|
1091
|
1108
|
// 更新数据
|
1092
|
1109
|
updateSettleFn() {
|
1093
|
1110
|
updateSettle(this.form);
|
|
@@ -1181,6 +1198,7 @@ table {
|
1181
|
1198
|
/* border: 1px solid black; */
|
1182
|
1199
|
text-align: center;
|
1183
|
1200
|
border-collapse: collapse;
|
|
1201
|
+ width: 100%;
|
1184
|
1202
|
/*设置背景颜色*/
|
1185
|
1203
|
/* background-color: #bfa; */
|
1186
|
1204
|
}
|