Bläddra i källkod

修改增加预算里的项目编号为自动填写

余思翰 1 år sedan
förälder
incheckning
b3f2020ce4
2 ändrade filer med 181 tillägg och 11 borttagningar
  1. 13
    11
      oa-ui/src/views/oa/budget/addBudget.vue
  2. 168
    0
      oa-ui/src/views/oa/budget/components/budgetForm.vue

+ 13
- 11
oa-ui/src/views/oa/budget/addBudget.vue Visa fil

@@ -2,11 +2,11 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-03-25 15:05:59
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-04-03 16:34:02
5
+ * @LastEditTime: 2024-04-03 17:29:25
6 6
 -->
7 7
 <template>
8 8
   <div>
9
-    <div v-if="taskName == '预算编制'">
9
+    <div>
10 10
       <div class="header">
11 11
         <!-- <div class="back">
12 12
         <el-button type="primary" plain @click="goBack">返回</el-button>
@@ -45,7 +45,6 @@
45 45
                   disabled
46 46
                   style="width: 300px"
47 47
                 />
48
-                <el-button @click="openProject = true">选择</el-button>
49 48
               </div>
50 49
             </el-form-item>
51 50
             <el-form-item label="项目名称:" prop="projectName">
@@ -486,14 +485,14 @@
486 485
         <chooseDevice @chooseList="getChooseDevice"></chooseDevice>
487 486
       </el-dialog>
488 487
     </div>
489
-    <div>
490
-      
491
-    </div>
488
+    <!-- <div v-if="taskName != '预算编制'">
489
+      <budgetForm></budgetForm>
490
+    </div> -->
492 491
   </div>
493 492
 </template>
494 493
 
495 494
 <script>
496
-import { listProject } from "@/api/oa/project/project";
495
+import { getProject } from "@/api/oa/project/project";
497 496
 import { getSalary } from "@/api/oa/staff/salary";
498 497
 import choosePeople from "./components/choosePeople.vue";
499 498
 import chooseCar from "./components/chooseCar.vue";
@@ -506,6 +505,7 @@ import { addBudgetCar } from "@/api/oa/budget/budgetCar.js";
506 505
 import { addBudgetDevice } from "@/api/oa/budget/budgetDevice.js";
507 506
 import { addBudgetSettle } from "@/api/oa/budget/budgetSettle.js";
508 507
 import { Snowflake } from "@/utils/snowFlake.js";
508
+import budgetForm from "./components/budgetForm.vue";
509 509
 import {
510 510
   complete,
511 511
   rejectTask,
@@ -523,6 +523,7 @@ export default {
523 523
     chooseDevice,
524 524
     chooseMoney,
525 525
     budgetTable,
526
+    budgetForm,
526 527
   },
527 528
   props: {
528 529
     taskForm: {
@@ -609,10 +610,11 @@ export default {
609 610
     },
610 611
     // 查询项目列表
611 612
     getProjectList() {
612
-      listProject(this.queryParams).then(response => {
613
-        console.log(response.rows);
614
-        this.projectList = response.rows;
615
-        this.projectTotal = response.total;
613
+      getProject(this.taskForm.formId).then(response => {
614
+        // console.log(response.rows);
615
+        // this.projectList = response.rows;
616
+        // this.projectTotal = response.total;
617
+        this.projectForm = response.data;
616 618
       });
617 619
     },
618 620
     // 选择项目

+ 168
- 0
oa-ui/src/views/oa/budget/components/budgetForm.vue Visa fil

@@ -0,0 +1,168 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2024-04-03 16:28:09
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-04-03 17:17:48
6
+-->
7
+<template>
8
+  <div>
9
+    <h2 style="text-align: center">项目直接生产成本预算表</h2>
10
+    <table border="1" class="table">
11
+      <tr>
12
+        <td class="head">项目名称</td>
13
+        <td colspan="3">{{ projectForm.projectName }}</td>
14
+        <td class="head">项目编号</td>
15
+        <td colspan="2">{{ projectForm.projectNumber }}</td>
16
+      </tr>
17
+      <tr>
18
+        <td :rowspan="userLen" class="head">人员</td>
19
+        <td class="head">姓名</td>
20
+        <td class="head">岗位工资</td>
21
+        <td class="head">人员成本(天)</td>
22
+        <td class="head">进出场单价</td>
23
+        <td class="head">预算天数</td>
24
+        <td class="head">金额</td>
25
+      </tr>
26
+      <tr v-for="user in chooseUser" :key="'user' + user.userId">
27
+        <td>{{ user.nickName }}</td>
28
+        <td>{{ user.salary.salary }}</td>
29
+        <td>{{ parseFloat(user.salary.salary / 31).toFixed(2) }}</td>
30
+        <td>{{ user.inOutPrice }}</td>
31
+        <td>{{ user.days }}</td>
32
+        <td>{{ user.staffCost }}</td>
33
+      </tr>
34
+      <tr>
35
+        <td :rowspan="carLen" class="head">车辆</td>
36
+        <td class="head">车牌号</td>
37
+        <td class="head">油耗</td>
38
+        <td class="head">总里程</td>
39
+        <td class="head">折旧成天(天)</td>
40
+        <td class="head">预算天数</td>
41
+        <td class="head">金额</td>
42
+      </tr>
43
+      <tr v-for="car in chooseCar" :key="'car' + car.carId">
44
+        <td>{{ car.licensePlate }}</td>
45
+        <td>{{ car.mileage }}</td>
46
+        <td>{{ car.distance }}</td>
47
+        <td>{{ car.dayCost }}</td>
48
+        <td>{{ car.days }}</td>
49
+        <td>{{ car.expense }}</td>
50
+      </tr>
51
+      <tr>
52
+        <td :rowspan="deviceLen" class="head">设备</td>
53
+        <td class="head">设备名称</td>
54
+        <td class="head">规格型号</td>
55
+        <td class="head">品牌</td>
56
+        <td class="head">折旧成本(天)</td>
57
+        <td class="head">预算天数</td>
58
+        <td class="head">金额</td>
59
+      </tr>
60
+      <tr v-for="device in chooseDevice" :key="'device' + device.deviceId">
61
+        <td>{{ device.name }}</td>
62
+        <td>{{ device.series }}</td>
63
+        <td>{{ device.brand }}</td>
64
+        <td>{{ device.dayCost }}</td>
65
+        <td>{{ device.days }}</td>
66
+        <td>{{ device.depreciation }}</td>
67
+      </tr>
68
+      <tr>
69
+        <td colspan="6" class="head">固定成本小计</td>
70
+        <td>{{ budgetForm.fixCost }}</td>
71
+      </tr>
72
+      <tr>
73
+        <td :rowspan="workLen" class="head">预计结算金额</td>
74
+        <td class="head">工作内容</td>
75
+        <td class="head">比例尺</td>
76
+        <td class="head">总工作量</td>
77
+        <td class="head">单价</td>
78
+        <td class="head">系数</td>
79
+        <td class="head">金额</td>
80
+      </tr>
81
+      <tr v-for="(work, index) in workList" :key="'work' + index">
82
+        <td>{{ work.content }}</td>
83
+        <td>{{ work.scale }}</td>
84
+        <td>{{ work.workLoad }}</td>
85
+        <td>{{ work.price }}</td>
86
+        <td>{{ work.coefficient }}</td>
87
+        <td>{{ work.total }}</td>
88
+      </tr>
89
+      <tr>
90
+        <td colspan="5" class="head">外协费用</td>
91
+        <td>{{ budgetForm.outExpense }}</td>
92
+      </tr>
93
+      <tr>
94
+        <td colspan="5" class="head">商务费用</td>
95
+        <td>{{ budgetForm.businessExpense }}</td>
96
+      </tr>
97
+      <tr>
98
+        <td colspan="5" class="head">车船租赁</td>
99
+        <td>{{ budgetForm.rentExpense }}</td>
100
+      </tr>
101
+      <tr>
102
+        <td colspan="5" class="head">其他费用</td>
103
+        <td>{{ budgetForm.otherExpense }}</td>
104
+      </tr>
105
+      <tr>
106
+        <td colspan="6" class="head">直接成本小计</td>
107
+        <td>{{ budgetForm.directExpense }}</td>
108
+      </tr>
109
+      <tr>
110
+        <td colspan="6" class="head">总成本=(固定成本+直接成本)*120%</td>
111
+        <td>{{ totalBudget }}</td>
112
+      </tr>
113
+      <!-- <tr>
114
+        <td class="head">编制人</td>
115
+        <td colspan="2">{{  }}</td>
116
+        <td class="head">审核人</td>
117
+        <td colspan="3"></td>
118
+      </tr> -->
119
+    </table>
120
+  </div>
121
+</template>
122
+
123
+<script>
124
+import { listBudget } from "@/api/oa/budget/budget";
125
+import { listBudgetCar, getBudgetCar } from "@/api/oa/budget/budgetCar";
126
+import { listBudgetDevice, getBudgetDevice } from "@/api/oa/budget/budgetDevice";
127
+import { listBudgetSettle, getBudgetSettle } from "@/api/oa/budget/budgetSettle";
128
+import { listBudgetStaff, getBudgetStaff } from "@/api/oa/budget/budgetStaff";
129
+export default {
130
+  data() {
131
+    return {
132
+      projectId: "103",
133
+      budgetForm: {},
134
+      projectForm: {},
135
+      userLen: 1,
136
+      carLen: 1,
137
+      deviceLen: 1,
138
+      workLen: 1,
139
+      totalBudget: 0,
140
+      chooseCar: [],
141
+      chooseDevice: [],
142
+      chooseUser: [],
143
+      workList:[]
144
+    };
145
+  },
146
+  created() {
147
+    this.initBudgetForm();
148
+    this.userLen = this.chooseUser.length + 1;
149
+    this.carLen = this.chooseCar.length + 1;
150
+    this.deviceLen = this.chooseDevice.length + 1;
151
+    this.workLen = this.workList.length + 5;
152
+    this.totalBudget = (
153
+      (Number(this.budgetForm.directExpense) + Number(this.budgetForm.fixCost)) *
154
+      1.2
155
+    ).toFixed(2);
156
+  },
157
+  methods: {
158
+    initBudgetForm() {
159
+      listBudget({ pageNum: 1, pageSize: 20, projectId: this.projectId }).then(res => {
160
+        console.log(res);
161
+        this.budgetForm = res.rows[0];
162
+      });
163
+    },
164
+  },
165
+};
166
+</script>
167
+
168
+<style lang="scss" scoped></style>

Loading…
Avbryt
Spara