Browse Source

修改预算表编制

余思翰 1 year ago
parent
commit
6d13ac6f09

+ 76
- 23
oa-ui/src/views/flowable/form/budget/addBudget.vue View File

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-03-25 15:05:59
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-05-10 14:07:41
5
+ * @LastEditTime: 2024-05-21 18:04:09
6 6
 -->
7 7
 <template>
8 8
   <div>
@@ -27,7 +27,7 @@
27 27
           <el-step title="生成预算表" description="生成最终的项目预算表"></el-step>
28 28
         </el-steps>
29 29
         <!-- 选择项目 -->
30
-        <div class="project" v-if="activeStep == 0">
30
+        <div class="project" v-show="activeStep == 0">
31 31
           <el-form ref="form1" :model="projectForm" :rules="projectRule" label-width="120px">
32 32
             <el-form-item label="项目编号:" prop="projectNumber">
33 33
               <div style="display: flex">
@@ -101,7 +101,7 @@
101 101
         </div>
102 102
 
103 103
         <!-- 选择参与人员、车辆和设备 -->
104
-        <div class="staff" v-if="activeStep == 1">
104
+        <div class="staff" v-show="activeStep == 1">
105 105
           <el-breadcrumb separator-class="el-icon-arrow-right">
106 106
             <el-breadcrumb-item>选择项目</el-breadcrumb-item>
107 107
             <el-breadcrumb-item>{{ projectForm.projectNumber }}</el-breadcrumb-item>
@@ -244,7 +244,7 @@
244 244
           </el-form>
245 245
         </div>
246 246
         <!-- 绩效和其他预算 -->
247
-        <div class="other" v-if="activeStep == 2">
247
+        <div class="other" v-show="activeStep == 2">
248 248
           <el-breadcrumb separator-class="el-icon-arrow-right">
249 249
             <el-breadcrumb-item>选择项目</el-breadcrumb-item>
250 250
             <el-breadcrumb-item>{{ projectForm.projectNumber }}</el-breadcrumb-item>
@@ -256,22 +256,66 @@
256 256
             <el-breadcrumb-item>¥ {{ budgetForm.fixCost }}</el-breadcrumb-item>
257 257
           </el-breadcrumb>
258 258
           <el-form>
259
-            <choose-money :workList="workList" :chooseUser="chooseUser" :budgetForm="budgetForm" @getSettle="getSettle"></choose-money>
260
-            <el-form-item label="外协费用:">
261
-              <el-input v-model="budgetForm.outExpense" style="width: 400px"
262
-                @change="getDirectExpense(budgetForm)"></el-input>
263
-            </el-form-item>
264
-            <el-form-item label="商务费用:">
265
-              <el-input v-model="budgetForm.businessExpense" style="width: 400px"
266
-                @change="getDirectExpense(budgetForm)"></el-input>
267
-            </el-form-item>
268
-            <el-form-item label="车船租赁:">
269
-              <el-input v-model="budgetForm.rentExpense" style="width: 400px"
270
-                @change="getDirectExpense(budgetForm)"></el-input>
271
-            </el-form-item>
272
-            <el-form-item label="其他费用:">
273
-              <el-input v-model="budgetForm.otherExpense" style="width: 400px"
274
-                @change="getDirectExpense(budgetForm)"></el-input>
259
+            <choose-money :workList="workList" :chooseUser="chooseUser" :budgetForm="budgetForm"
260
+              @getSettle="getSettle" @getWorkList="setPreSettlement"></choose-money>
261
+            <el-form-item label="其他预算:">
262
+              <table border="1">
263
+                <tr>
264
+                  <td>内容</td>
265
+                  <td>费用金额</td>
266
+                  <td>备注</td>
267
+                </tr>
268
+                <tr>
269
+                  <td>外协费用</td>
270
+                  <td>
271
+                    <el-input-number :controls="false" :precision="2" v-model="budgetForm.outExpense" style="width: 400px"
272
+                      @change="getDirectExpense(budgetForm)"></el-input-number>
273
+                  </td>
274
+                  <td>
275
+                    <el-input type="textarea" v-model="budgetForm.outRemark" style="width: 400px"></el-input>
276
+                  </td>
277
+                </tr>
278
+                <tr>
279
+                  <td>税费成本</td>
280
+                  <td>
281
+                    <el-input-number :controls="false" :precision="2" v-model="budgetForm.taxExpense" style="width: 400px"
282
+                      @change="getDirectExpense(budgetForm)"></el-input-number>
283
+                  </td>
284
+                  <td>
285
+                    <el-input type="textarea" v-model="budgetForm.taxRemark" style="width: 400px"></el-input>
286
+                  </td>
287
+                </tr>
288
+                <tr>
289
+                  <td>经营管理费用</td>
290
+                  <td>
291
+                    <el-input-number :controls="false" :precision="2" v-model="budgetForm.businessExpense" style="width: 400px"
292
+                      @change="getDirectExpense(budgetForm)"></el-input-number>
293
+                  </td>
294
+                  <td>
295
+                    <el-input type="textarea" v-model="budgetForm.businessRemark" style="width: 400px"></el-input>
296
+                  </td>
297
+                </tr>
298
+                <tr>
299
+                  <td>车船租赁</td>
300
+                  <td>
301
+                    <el-input-number :controls="false" :precision="2" v-model="budgetForm.rentExpense" style="width: 400px"
302
+                      @change="getDirectExpense(budgetForm)"></el-input-number>
303
+                  </td>
304
+                  <td>
305
+                    <el-input type="textarea" v-model="budgetForm.rentRemark" style="width: 400px"></el-input>
306
+                  </td>
307
+                </tr>
308
+                <tr>
309
+                  <td>其他费用</td>
310
+                  <td>
311
+                    <el-input-number :controls="false" :precision="2" v-model="budgetForm.otherExpense" style="width: 400px"
312
+                      @change="getDirectExpense(budgetForm)"></el-input-number>
313
+                  </td>
314
+                  <td>
315
+                    <el-input type="textarea" v-model="budgetForm.otherRemark" style="width: 400px"></el-input>
316
+                  </td>
317
+                </tr>
318
+              </table>
275 319
             </el-form-item>
276 320
             <el-form-item label="直接成本小计:">
277 321
               <el-tag type="danger" style="margin-right: 20px; font-size: 14px">
@@ -299,7 +343,7 @@
299 343
           </el-breadcrumb>
300 344
           <budget-table :budgetForm="budgetForm" :projectForm="projectForm" @getTotal="getTotalBudget"></budget-table>
301 345
         </div>
302
-        <div class="finish" v-if="activeStep == 4">
346
+        <div class="finish" v-show="activeStep == 4">
303 347
           <el-result icon="success" title="成功提示" subTitle="预算表生成完成">
304 348
             <template slot="extra"> </template>
305 349
           </el-result>
@@ -428,6 +472,7 @@ export default {
428 472
         outExpense: 0,
429 473
         businessExpense: 0,
430 474
         rentExpense: 0,
475
+        taxExpense: 0,
431 476
         otherExpense: 0,
432 477
         directExpense: 0,
433 478
         totalBudget: 0,
@@ -482,7 +527,7 @@ export default {
482 527
       });
483 528
     },
484 529
     getProjectWorkList() {
485
-      listProjectWork({projectId: this.$route.query.formId}).then(res => {
530
+      listProjectWork({ projectId: this.$route.query.formId }).then(res => {
486 531
         this.workList = res.rows;
487 532
       })
488 533
     },
@@ -535,6 +580,7 @@ export default {
535 580
       this.budgetForm.settleExpense = val.settle;
536 581
       this.budgetForm.workList = val.workList;
537 582
       this.budgetForm.inOutPriceSum = val.inOutPriceSum
583
+      console.log(this.budgetForm);
538 584
       if (this.chooseUser.length != 0) {
539 585
         for (let s of this.chooseUser) {
540 586
           s.inOutPrice = val.inOutPrice
@@ -542,6 +588,9 @@ export default {
542 588
       }
543 589
       this.getDirectExpense(this.budgetForm);
544 590
     },
591
+    setPreSettlement(val){
592
+      this.budgetForm.contentList = val
593
+    },
545 594
     // 计算单个人员的成本
546 595
     calculateUserTotal(user) {
547 596
       let total = parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) * Number(user.days);
@@ -584,6 +633,7 @@ export default {
584 633
         Number(form.settleExpense) +
585 634
         Number(form.outExpense) +
586 635
         Number(form.rentExpense) +
636
+        Number(form.taxExpense) +
587 637
         Number(form.businessExpense) +
588 638
         Number(form.otherExpense);
589 639
       this.budgetForm.directExpense = sum.toFixed(2);
@@ -684,12 +734,15 @@ export default {
684 734
   }
685 735
 
686 736
   .staff,
687
-  .other,
688 737
   .finish {
689 738
     width: 1200px;
690 739
     margin: 0 auto;
691 740
     padding-top: 50px;
692 741
   }
742
+
743
+  .other {
744
+    padding-top: 50px;
745
+  }
693 746
 }
694 747
 
695 748
 .btn {

+ 111
- 85
oa-ui/src/views/flowable/form/budget/components/budgetTable.vue View File

@@ -1,40 +1,83 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2024-05-10 15:50:41
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-05-21 19:18:34
6
+-->
1 7
 <template>
2 8
   <div>
3 9
     <h2 style="text-align:center;">项目直接生产成本预算表</h2>
4 10
     <table border="1" class="table">
5 11
       <tr>
6
-        <td class="head">项目名称</td>
7
-        <td colspan="3">{{ projectForm.projectName }}</td>
8
-        <td class="head">项目编号</td>
9
-        <td colspan="2">{{ projectForm.projectNumber }}</td>
12
+        <td style="width: 100px;">项目名称</td>
13
+        <td colspan="6">{{ projectForm.projectName }}</td>
14
+        <td>项目编号</td>
15
+        <td colspan="1">{{ projectForm.projectNumber }}</td>
16
+      </tr>
17
+      <tr>
18
+        <td :rowspan="workLen">直接成本</td>
19
+        <td>工作简述</td>
20
+        <td>工作类别</td>
21
+        <td>数量</td>
22
+        <td>单价</td>
23
+        <td>单位</td>
24
+        <td>系数</td>
25
+        <td>金额</td>
26
+        <td style="width: 250px;">备注</td>
27
+      </tr>
28
+      <tr v-for="work in budgetForm.contentList">
29
+        <td>{{ work.content }}</td>
30
+        <td>{{ work.workType }}</td>
31
+        <td>{{ work.workload }}</td>
32
+        <td>{{ work.price }}</td>
33
+        <td>{{ work.unit }}</td>
34
+        <td>{{ work.coefficient }}</td>
35
+        <td>{{ work.settle }}</td>
36
+        <td>{{ work.remark ? work.remark : '' }}</td>
37
+      </tr>
38
+      <tr>
39
+        <td :colspan="2">进出场费用</td>
40
+        <td :colspan="5">{{ budgetForm.inOutPriceSum }}</td>
41
+        <td></td>
42
+      </tr>
43
+      <tr>
44
+        <td :colspan="2" class="head">直接成本合计</td>
45
+        <td :colspan="5" class="head">{{ budgetForm.settleExpense }}</td>
46
+        <td></td>
47
+      </tr>
48
+      <tr>
49
+        <td :rowspan="userLen + carLen + deviceLen + 2">间接成本</td>
10 50
       </tr>
11 51
       <tr v-if="userLen != 1">
12
-        <td :rowspan="userLen" class="head">人员</td>
13
-        <td class="head">姓名</td>
14
-        <td class="head">部门</td>
15
-        <td class="head">岗位工资</td>
16
-        <td class="head">人员成本(天)</td>
17
-        <!-- <td class="head">进出场单价</td> -->
18
-        <td class="head">预算天数</td>
19
-        <td class="head">金额</td>
52
+        <td :rowspan="userLen">人员</td>
53
+        <td>姓名</td>
54
+        <td>基本工资</td>
55
+        <td>岗位工资</td>
56
+        <td>人员成本(天)</td>
57
+        <!-- <td>进出场单价</td> -->
58
+        <td>预算天数</td>
59
+        <td>金额</td>
60
+        <td></td>
20 61
       </tr>
21 62
       <tr v-for="user in budgetForm.chooseUser" :key="'user' + user.userId">
22 63
         <td>{{ user.nickName }}</td>
23
-        <td>{{ user.dept.deptName }}</td>
64
+        <td>1780</td>
24 65
         <td>{{ user.salary.salary }}</td>
25
-        <td>{{ parseFloat(user.salary.salary / 31).toFixed(2) }}</td>
66
+        <td>{{ parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) }}</td>
26 67
         <!-- <td>{{ user.inOutPrice }}</td> -->
27 68
         <td>{{ user.days }}</td>
28 69
         <td>{{ user.staffCost }}</td>
70
+        <td></td>
29 71
       </tr>
30 72
       <tr v-if="carLen != 1">
31
-        <td :rowspan="carLen" class="head">车辆</td>
32
-        <td class="head">车牌号</td>
33
-        <td class="head">油耗</td>
34
-        <td class="head">总里程</td>
35
-        <td class="head">折旧成天(天)</td>
36
-        <td class="head">预算天数</td>
37
-        <td class="head">金额</td>
73
+        <td :rowspan="carLen">车辆</td>
74
+        <td>车牌号</td>
75
+        <td>油耗</td>
76
+        <td>总里程</td>
77
+        <td>折旧成天(天)</td>
78
+        <td>预算天数</td>
79
+        <td>金额</td>
80
+        <!-- <td></td> -->
38 81
       </tr>
39 82
       <tr v-for="car in budgetForm.chooseCar" :key="'car' + car.carId">
40 83
         <td>{{ car.licensePlate }}</td>
@@ -43,15 +86,17 @@
43 86
         <td>{{ car.dayCost }}</td>
44 87
         <td>{{ car.days }}</td>
45 88
         <td>{{ car.expense }}</td>
89
+        <td></td>
46 90
       </tr>
47 91
       <tr v-if="deviceLen != 1">
48
-        <td :rowspan="deviceLen" class="head">设备</td>
49
-        <td class="head">设备名称</td>
50
-        <td class="head">规格型号</td>
51
-        <td class="head">品牌</td>
52
-        <td class="head">折旧成本(天)</td>
53
-        <td class="head">预算天数</td>
54
-        <td class="head">金额</td>
92
+        <td :rowspan="deviceLen">设备</td>
93
+        <td>设备名称</td>
94
+        <td>规格型号</td>
95
+        <td>品牌</td>
96
+        <td>折旧成本(天)</td>
97
+        <td>预算天数</td>
98
+        <td>金额</td>
99
+        <!-- <td>备注</td> -->
55 100
       </tr>
56 101
       <tr v-for="device in budgetForm.chooseDevice" :key="'device' + device.deviceId">
57 102
         <td>{{ device.name }}</td>
@@ -60,55 +105,41 @@
60 105
         <td>{{ device.dayCost }}</td>
61 106
         <td>{{ device.days }}</td>
62 107
         <td>{{ device.depreciation }}</td>
108
+        <td></td>
63 109
       </tr>
64 110
       <tr>
65
-        <td colspan="6" class="head">间接成本小计</td>
66
-        <td>{{ budgetForm.fixCost }}</td>
67
-      </tr>
68
-      <tr>
69
-        <td :rowspan="workLen" class="head">预计结算金额</td>
70
-        <td class="head">工作内容</td>
71
-        <td class="head">比例尺</td>
72
-        <td class="head">总工作量</td>
73
-        <td class="head">单价</td>
74
-        <td class="head">系数</td>
75
-        <td class="head">金额</td>
76
-      </tr>
77
-      <tr v-for="(work, index) in budgetForm.workList" :key="'work' + index">
78
-        <td>{{ work.content }}</td>
79
-        <td>{{ work.scale }}</td>
80
-        <td>{{ work.workload }}</td>
81
-        <td>{{ work.price }}</td>
82
-        <td>{{ work.coefficient }}</td>
83
-        <td>{{ work.settle }}</td>
84
-      </tr>
85
-      <tr>
86
-        <td colspan="5" class="head">进出场津贴</td>
87
-        <td>{{ budgetForm.inOutPriceSum }}</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>
111
+        <td :colspan="2" class="head">间接成本合计</td>
112
+        <td :colspan="5" class="head">{{ budgetForm.fixCost }}</td>
113
+        <td></td>
114
+      </tr>
115
+      <tr class="head">
116
+        <td :colspan="3">外协费用</td>
117
+        <td :colspan="5">{{ budgetForm.outExpense }}</td>
118
+        <td>{{ budgetForm.outRemark }}</td>
119
+      </tr>
120
+      <tr class="head">
121
+        <td colspan="3">税费成本</td>
122
+        <td :colspan="5">{{ budgetForm.taxExpense }}</td>
123
+        <td>{{ budgetForm.taxRemark }}</td>
124
+      </tr>
125
+      <tr class="head">
126
+        <td colspan="3">经营管理费用</td>
127
+        <td :colspan="5">{{ budgetForm.businessExpense }}</td>
128
+        <td>{{ budgetForm.businessRemark }}</td>
129
+      </tr>
130
+      <tr class="head">
131
+        <td colspan="3">车船租赁</td>
132
+        <td :colspan="5">{{ budgetForm.rentExpense }}</td>
133
+        <td>{{ budgetForm.rentRemark }}</td>
134
+      </tr>
135
+      <tr class="head">
136
+        <td colspan="3">其他费用</td>
137
+        <td :colspan="5">{{ budgetForm.otherExpense }}</td>
138
+        <td>{{ budgetForm.otherRemark }}</td>
108 139
       </tr>
109 140
       <tr>
110
-        <td colspan="6" class="head">总成本=(间接成本+直接成本)*120%</td>
111
-        <td>{{ totalBudget }}</td>
141
+        <td colspan="3" class="head">成本合计</td>
142
+        <td colspan="5" class="head">{{ costSum }}</td>
112 143
       </tr>
113 144
     </table>
114 145
   </div>
@@ -132,24 +163,18 @@ export default {
132 163
       carLen: 1,
133 164
       deviceLen: 1,
134 165
       workLen: 1,
135
-      totalBudget: 0
166
+      costSum: 0,
167
+      inOutPrice: '',
136 168
     }
137 169
   },
138 170
   created() {
171
+    console.log(this.budgetForm);
139 172
     this.userLen = this.budgetForm.chooseUser.length + 1;
140 173
     this.carLen = this.budgetForm.chooseCar.length + 1;
141 174
     this.deviceLen = this.budgetForm.chooseDevice.length + 1;
142
-    this.workLen = this.budgetForm.workList.length + 6;
143
-    this.totalBudget = ((Number(this.budgetForm.directExpense) + Number(this.budgetForm.fixCost)) * 1.2).toFixed(2);
144
-    let sum = 0
145
-    for(let s of this.budgetForm.chooseUser){
146
-      sum = sum + (Number(s.inOutPrice) * Number(s.days))
147
-    }
148
-    this.budgetForm.inOutPriceSum = sum.toFixed(2)
149
-    this.$emit('getTotal',this.totalBudget)
150
-  },
151
-  methods: {
152
-
175
+    this.workLen = this.budgetForm.contentList.length + 3;
176
+    this.costSum = (Number(this.budgetForm.directExpense) + Number(this.budgetForm.fixCost)).toFixed(2);
177
+    this.$emit('getTotal', this.totalBudget);
153 178
   },
154 179
 }
155 180
 </script>
@@ -163,6 +188,7 @@ export default {
163 188
   text-align: center;
164 189
   border-collapse: collapse;
165 190
   margin: 0 auto;
191
+
166 192
   /*设置背景颜色*/
167 193
   /* background-color: #bfa; */
168 194
   td {

+ 159
- 131
oa-ui/src/views/flowable/form/budget/components/chooseMoney.vue View File

@@ -1,36 +1,7 @@
1 1
 <template>
2 2
   <div>
3 3
     <el-form>
4
-      <el-form-item label="项目概况:">
5
-        <!-- <div style="display:flex;flex-wrap:wrap;">
6
-          <el-card v-for="(work, index) in workList" :key="index" class="card">
7
-            <div class="work-item">
8
-              <div class="work-label" style="min-width:70px">工作内容:</div>
9
-              <div>{{ work.content }}</div>
10
-            </div>
11
-            <div class="work-item">
12
-              <div class="work-label">等级或比例尺:</div>
13
-              <div>{{ work.scale }}</div>
14
-            </div>
15
-            <div class="work-item">
16
-              <div class="work-label">单位:</div>
17
-              <div>{{ work.unit }}</div>
18
-            </div>
19
-            <div class="work-item">
20
-              <div class="work-label">工作量:</div>
21
-              <div>{{ work.workload }}</div>
22
-            </div>
23
-            <div class="work-item">
24
-              <div class="work-label">要求完成时间:</div>
25
-              <div>{{ work.deadline }}</div>
26
-            </div>
27
-            <div class="work-item">
28
-              <div class="work-label">备注:</div>
29
-              <div>{{ work.remark }}</div>
30
-            </div>
31
-          </el-card>
32
-        </div> -->
33
-
4
+      <el-form-item label="项目概况:" label-width="90px">
34 5
         <table border="1">
35 6
           <tr>
36 7
             <td style="width: 320px">工作内容</td>
@@ -62,29 +33,33 @@
62 33
           </tr>
63 34
         </table>
64 35
       </el-form-item>
65
-      <el-form-item label="预结算:">
36
+      <el-form-item label="预结算:" label-width="90px">
66 37
         <table border="1">
67 38
           <tr>
68
-            <td style="width: 250px">工作内容</td>
39
+            <td style="width: 250px">工作简述</td>
69 40
             <td>工作类别</td>
70 41
             <td>工作项目</td>
71 42
             <!-- <td>项目细项</td> -->
72 43
             <td>比例尺</td>
73 44
             <td>地类类型</td>
74 45
             <td style="width:90px;">单价</td>
75
-            <td style="width:90px;">总工作量</td>
46
+            <td>单位</td>
47
+            <td style="width:90px;">数量</td>
76 48
             <td style="width:70px;">系数</td>
77 49
             <td style="min-width:70px;">总额</td>
50
+            <td style="min-width:70px;">备注</td>
78 51
           </tr>
79
-          <tr v-for="(work, index) in workList" :key="index">
80
-            <td>
81
-              {{ work.content }}
52
+          <tr v-for="(work, index) in contentList" :key="index">
53
+            <td style="position:relative;">
54
+              <div class="delete-btn" @click="deletWorkItem(index)">
55
+                <i class="el-icon-circle-close"></i>
56
+              </div>
57
+              <el-input type="textarea" v-model="work.content"></el-input>
82 58
             </td>
83 59
             <td>
84
-              <el-select v-model="work.workType" :style="{ width: '100%' }" :loading="work.workSelect.workTypeLoading"
60
+              <el-select v-model="work.workType" :style="{ width: '100%' }"
85 61
                 @change="getWorkItemList(work, work.workType)">
86
-                <el-option v-for="item in work.workSelect.workTypeList" :key="item.value" :label="item.label"
87
-                  :value="item.value">
62
+                <el-option v-for="item in workTypeList" :key="item.value" :label="item.label" :value="item.value">
88 63
                 </el-option>
89 64
               </el-select>
90 65
             </td>
@@ -114,10 +89,16 @@
114 89
               </el-select>
115 90
             </td>
116 91
             <td>
117
-              {{ work.price }} / {{ work.unit }}
92
+              {{ work.price }}
118 93
             </td>
119 94
             <td>
120
-              {{ work.workload }}
95
+              <el-select v-model="work.unit" placeholder="请选择" clearable>
96
+                <el-option v-for="dict in dict.type.cmc_unit" :key="dict.value" :label="dict.label"
97
+                  :value="dict.label" />
98
+              </el-select>
99
+            </td>
100
+            <td>
101
+              <el-input v-model="work.workload" @change="getTotal(work)"></el-input>
121 102
             </td>
122 103
             <td>
123 104
               <el-input-number v-model="work.coefficient" :controls="false" :precision="2" :step="0.01" :max="10"
@@ -125,16 +106,19 @@
125 106
               </el-input-number>
126 107
               <el-button type="text" @click="getCoefficientRemark(work.workType)">系数备注</el-button>
127 108
             </td>
128
-            <td class="workTotal">
129
-              {{ work.settle }}
109
+            <td>
110
+              <el-input v-model="work.settle"></el-input>
111
+            </td>
112
+            <td>
113
+              <el-input type="textarea" v-model="work.remark"></el-input>
130 114
             </td>
131 115
           </tr>
132 116
           <tr>
133
-            <td colspan="8">合计</td>
117
+            <td colspan="9">合计</td>
134 118
             <td>{{ (Number(settle) - Number(inOutPriceSum)).toFixed(2) }}</td>
135 119
           </tr>
136 120
         </table>
137
-        <div style="color:red">tips:预结算表中的系数为:困难系统和调整系数相乘的值(1分制)。例如:困难系数1,调整系数0.8,最终系数为0.8</div>
121
+        <el-button icon="el-icon-plus" type="primary" size="mini" @click="addWorkList"></el-button>
138 122
       </el-form-item>
139 123
       <el-form-item label="进出场费用:">
140 124
         <el-input v-numeric v-model="inOutPrice" style="width:200px;" @change="getInoutpriceSum">
@@ -150,7 +134,6 @@
150 134
         <el-tag type="danger" style="margin-right:20px;font-size:14px;">¥{{ settle }}</el-tag>
151 135
       </el-form-item>
152 136
     </el-form>
153
-
154 137
   </div>
155 138
 </template>
156 139
 
@@ -159,7 +142,7 @@ import { getWorkTypeList, getWorkItemList, getSubItemList, getScaleGradeList, ge
159 142
 import { deepClone } from '@/utils'
160 143
 import { getPriceRemarkByWorkType } from '@/api/oa/price/price'
161 144
 export default {
162
-  components: {},
145
+  dicts: ['cmc_scale_grade', 'cmc_unit'],
163 146
   props: {
164 147
     workList: {
165 148
       type: Array,
@@ -176,7 +159,7 @@ export default {
176 159
   },
177 160
   data() {
178 161
     return {
179
-      // 工作选项
162
+      workTypeList: [],
180 163
       workSelect: {
181 164
         // 项目列表
182 165
         projectList: [],
@@ -193,6 +176,36 @@ export default {
193 176
         subItemLoading: true,
194 177
         scaleGradeLoading: true,
195 178
       },
179
+      contentList: [
180
+        {
181
+          content: '',
182
+          workType: '',
183
+          workItem: '',
184
+          scaleGrade: '',
185
+          groundType: '0',
186
+          price: '',
187
+          unit: '',
188
+          workload: '',
189
+          coefficient: 1,
190
+          settle: 0,
191
+          workSelect: {
192
+            // 项目列表
193
+            projectList: [],
194
+            // 工作类别列表
195
+            workTypeList: [],
196
+            // 工作项目
197
+            workItemList: [],
198
+            // 项目细项
199
+            subItemList: [],
200
+            // 比例尺
201
+            scaleGradeList: [],
202
+            workTypeLoading: true,
203
+            workItemLoading: true,
204
+            subItemLoading: true,
205
+            scaleGradeLoading: true,
206
+          }
207
+        }
208
+      ],
196 209
       settle: 0,
197 210
       inOutPrice: 0,
198 211
       peopleNumber: 0,
@@ -200,22 +213,56 @@ export default {
200 213
     }
201 214
   },
202 215
   created() {
203
-    for (let work of this.workList) {
204
-      this.setValue(work, 'workSelect', deepClone(this.workSelect));
205
-      this.getWorkTypeList(work);
206
-    }
216
+    this.getWorkTypeList();
207 217
   },
208 218
   mounted() {
209 219
     this.getSettleSum();
210
-
211 220
   },
212 221
   methods: {
222
+    addWorkList() {
223
+      this.contentList.push({
224
+        content: '',
225
+        workType: '',
226
+        workItem: '',
227
+        scaleGrade: '',
228
+        groundType: '0',
229
+        price: '',
230
+        unit: '',
231
+        workload: '',
232
+        coefficient: 1,
233
+        settle: 0,
234
+        workSelect: {
235
+          // 项目列表
236
+          projectList: [],
237
+          // 工作类别列表
238
+          workTypeList: [],
239
+          // 工作项目
240
+          workItemList: [],
241
+          // 项目细项
242
+          subItemList: [],
243
+          // 比例尺
244
+          scaleGradeList: [],
245
+          workTypeLoading: true,
246
+          workItemLoading: true,
247
+          subItemLoading: true,
248
+          scaleGradeLoading: true,
249
+        }
250
+      });
251
+    },
252
+    deletWorkItem(index) {
253
+      let arr = this.contentList;
254
+      if (arr.length == 1) {
255
+        return;
256
+      }
257
+      if (index >= 0 && index < arr.length) {
258
+        arr.splice(index, 1);
259
+      }
260
+    },
213 261
     /* 获取工作类别 */
214
-    getWorkTypeList(work) {
262
+    getWorkTypeList() {
215 263
       getWorkTypeList().then(res => {
216 264
         if (res) {
217
-          this.setValue(work.workSelect, 'workTypeList', this.setArray(res));
218
-          this.setValue(work.workSelect, 'workTypeLoading', false);
265
+          this.workTypeList = this.setArray(res);
219 266
         }
220 267
       });
221 268
     },
@@ -233,30 +280,12 @@ export default {
233 280
         }
234 281
       })
235 282
     },
236
-    /* 获取项目细项 */
237
-    getSubItemList(work, workItem) {
238
-      getSubItemList({ workItem }).then(res => {
239
-        if (res) {
240
-          let subItemList = this.setArray(res);
241
-          work.workSelect.subItemLoading = false;
242
-          work.workSelect.subItemList = subItemList;
243
-          work.subItem = subItemList[0].label;
244
-          if (work.scaleGrade == undefined) {
245
-            this.setValue(work, 'scaleGrade', '无');
246
-          }
247
-          if (work.groundType == undefined) {
248
-            this.setValue(work, 'groundType', '0');
249
-          }
250
-          this.getUnitPrice(work, work.workItem, work.subItem, work.scaleGrade, work.groundType);
251
-        }
252
-      })
253
-    },
254 283
     /* 获取比例尺 */
255 284
     getScaleGradeList(work, workItem) {
256 285
       if (work.scale) {
257
-        this.setValue(work, 'scaleGrade', work.scale);
286
+        this.$set(work, 'scaleGrade', work.scale);
258 287
         if (work.groundType == undefined) {
259
-          this.setValue(work, 'groundType', '0');
288
+          this.$set(work, 'groundType', '0');
260 289
         }
261 290
         this.getUnitPrice(work, work.workItem, work.subItem, work.scaleGrade, work.groundType);
262 291
       } else {
@@ -265,27 +294,27 @@ export default {
265 294
             let scaleGradeList = this.setArray(res);
266 295
             work.workSelect.scaleGradeLoading = false;
267 296
             work.workSelect.scaleGradeList = scaleGradeList;
268
-            this.setValue(work, 'scaleGrade', scaleGradeList[0].label)
297
+            this.$set(work, 'scaleGrade', scaleGradeList[0].label)
269 298
             // work.scaleGrade = scaleGradeList[0].label;
270 299
             if (work.scaleGrade == undefined) {
271
-              this.setValue(work, 'scaleGrade', '无');
300
+              this.$set(work, 'scaleGrade', '无');
272 301
             }
273 302
             if (work.groundType == undefined) {
274
-              this.setValue(work, 'groundType', '0');
303
+              this.$set(work, 'groundType', '0');
275 304
             }
276 305
             this.getUnitPrice(work, work.workItem, work.subItem, work.scaleGrade, work.groundType);
277 306
           }
278 307
         })
279 308
       }
280
-
281 309
     },
282 310
     /* 获取单价 */
283 311
     getUnitPrice(work, workItem, subItem, scaleGrade, groundType) {
284 312
       getUnitPrice({ workItem, subItem, scaleGrade, groundType: groundType }).then(res => {
285 313
         if (res.length != 0) {
286 314
           work.priceId = res.data.id;
287
-          this.setValue(work, 'price', res.data.price)
288
-          this.setValue(work, 'coefficient', 1)
315
+          this.$set(work, 'price', res.data.price)
316
+          this.$set(work, 'unit', res.data.unit)
317
+          this.$set(work, 'coefficient', 1)
289 318
           if (work.workload != undefined || work.workload != '') {
290 319
 
291 320
             this.getTotal(work);
@@ -296,45 +325,65 @@ export default {
296 325
     /* 获取总额 */
297 326
     getTotal(work) {
298 327
       let total = this.calculateTotal(work.price, work.coefficient, work.workload, 1);
299
-      this.setValue(work, 'settle', total)
328
+      if (total < 600) {
329
+        total = 600
330
+        this.$message.warning('不足600,按600算')
331
+      }
332
+      this.$set(work, 'settle', total)
300 333
       this.getSettleSum();
301 334
     },
302
-    /* 计算总额 */
303
-    calculateTotal(price, coefficient, workload, percent) {
304
-      return ((parseFloat(price) * parseFloat(coefficient) * parseFloat(workload)) * percent).toFixed(2);
305
-    },
306 335
     getSettleSum() {
307 336
       let sum = 0;
308
-      for (let work of this.workList) {
337
+      for (let work of this.contentList) {
309 338
         sum = sum + Number(work.settle)
310 339
       }
311 340
       sum = sum + this.inOutPriceSum;
312 341
       this.settle = sum.toFixed(2);
313 342
       let days = 0
314
-      for (let user of this.chooseUser) {
315
-        days = days + Number(user.days)
316
-      }
317
-      this.peopleNumber = days
318
-      if (this.budgetForm.inOutPriceSum && this.budgetForm.inOutPriceSum != 0) {
319
-        if (this.inOutPriceSum == 0) {
320
-          this.settle = Number(this.settle) + Number(this.budgetForm.inOutPriceSum)
321
-          this.inOutPrice = Number(this.budgetForm.inOutPriceSum) / this.peopleNumber
322
-          this.inOutPriceSum = this.budgetForm.inOutPriceSum
323
-        }
324
-      }
343
+      // for (let user of this.chooseUser) {
344
+      //   days = days + Number(user.days)
345
+      // }
346
+      // this.peopleNumber = days
347
+      // if (this.budgetForm.inOutPriceSum && this.budgetForm.inOutPriceSum != 0) {
348
+      //   if (this.inOutPriceSum == 0) {
349
+      //     this.settle = Number(this.settle) + Number(this.budgetForm.inOutPriceSum)
350
+      //     this.inOutPrice = Number(this.budgetForm.inOutPriceSum) / this.peopleNumber
351
+      //     this.inOutPriceSum = this.budgetForm.inOutPriceSum
352
+      //   }
353
+      // }
325 354
       let obj = {}
326 355
       obj.workList = this.workList;
327 356
       obj.settle = this.settle;
328 357
       obj.inOutPrice = this.inOutPrice;
329 358
       obj.peopleNumber = this.peopleNumber;
330 359
       obj.inOutPriceSum = this.inOutPriceSum;
360
+      console.log(this.inOutPriceSum);
331 361
       this.$emit('getSettle', obj);
362
+      this.$emit('getWorkList',this.contentList)
332 363
     },
333 364
     getInoutpriceSum() {
334 365
       this.inOutPriceSum = Number(this.inOutPrice) * Number(this.peopleNumber);
335 366
       this.getSettleSum()
336 367
     },
337
-    //数组去重
368
+    /* 计算总额 */
369
+    calculateTotal(price, coefficient, workload, percent) {
370
+      return ((parseFloat(price) * parseFloat(coefficient) * parseFloat(workload)) * percent).toFixed(2);
371
+    },
372
+    getCoefficientRemark(workType) {
373
+      getPriceRemarkByWorkType({ workType }).then(res => {
374
+        if (res.code == 200) {
375
+          if (workType != undefined)
376
+            this.$notify({
377
+              title: workType,
378
+              dangerouslyUseHTMLString: true,
379
+              message: res.msg,
380
+              duration: 0
381
+            });
382
+        }
383
+
384
+      })
385
+    },
386
+    // 数组去重,并格式化为label、value形式
338 387
     setArray(arr) {
339 388
       if (arr != [] && arr != undefined) {
340 389
         let datalist = [...new Set(arr)];
@@ -350,25 +399,7 @@ export default {
350 399
         return [];
351 400
       }
352 401
     },
353
-    setValue(key, name, val) {
354
-      this.$set(key, name, val)
355
-    },
356
-    getCoefficientRemark(workType) {
357
-      getPriceRemarkByWorkType({workType}).then(res => {
358
-        console.log(res);
359
-        if (res.code == 200) {
360
-          if(workType != undefined)
361
-            this.$notify({
362
-              title: workType ,
363
-              dangerouslyUseHTMLString: true,
364
-              message: res.msg,
365
-              duration: 0
366
-            });
367
-        }
368
-
369
-      })
370
-    }
371
-  }
402
+  },
372 403
 }
373 404
 </script>
374 405
 
@@ -388,18 +419,15 @@ table {
388 419
   }
389 420
 }
390 421
 
391
-.card {
392
-  flex: 1;
393
-  margin: 0 5px;
394
-}
395
-
396
-.work-item {
397
-  display: flex;
398
-  border-bottom: 1px solid rgb(228, 228, 228);
399
-
400
-  .work-label {
401
-    text-align: right;
402
-    font-weight: bold;
422
+.delete-btn {
423
+  position: absolute;
424
+  left: -30px;
425
+  top: 50%;
426
+  transform: translate(0, -50%);
427
+  color: #F56C6C;
428
+  cursor: pointer;
429
+  i{
430
+    font-size: 25px;
403 431
   }
404 432
 }
405 433
 </style>

+ 31
- 2
oa-ui/src/views/flowable/form/budget/components/choosePeople.vue View File

@@ -19,7 +19,11 @@
19 19
       <!-- <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> -->
20 20
       <el-table-column label="姓名" align="center" key="nickName" prop="nickName" :show-overflow-tooltip="true" />
21 21
       <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" :show-overflow-tooltip="true" />
22
-      <el-table-column label="年龄" align="center" key="age" prop="age" :show-overflow-tooltip="true" />
22
+      <el-table-column label="年龄" align="center" key="age" prop="age" :show-overflow-tooltip="true">
23
+        <template slot-scope="scope">
24
+          {{ getAgeByIdCard(scope.row.idCard) }}
25
+        </template>
26
+      </el-table-column>
23 27
       <el-table-column label="性别" align="center" key="sex" prop="sex" :show-overflow-tooltip="true">
24 28
         <template slot-scope="scope">
25 29
           {{ scope.row.sex == 0 ? '男' : '女' }}
@@ -106,7 +110,32 @@ export default {
106 110
     },
107 111
     clearChoose() {
108 112
       this.$refs.chooseUser.clearSelection();
109
-    }
113
+    },
114
+    getAgeByIdCard(idCard) {
115
+      const sexAndAge = {}
116
+      //获取用户身份证号码
117
+      const userCard = idCard
118
+      //如果用户身份证号码为undefined则返回空
119
+      if (!userCard) {
120
+        return sexAndAge
121
+      }
122
+      // 获取出生日期
123
+      const yearBirth = userCard.substring(6, 10)
124
+      const monthBirth = userCard.substring(10, 12)
125
+      const dayBirth = userCard.substring(12, 14)
126
+      // 获取当前年月日并计算年龄
127
+      const myDate = new Date()
128
+      const monthNow = myDate.getMonth() + 1
129
+      const dayNow = myDate.getDate()
130
+      let age = myDate.getFullYear() - yearBirth
131
+
132
+      if (monthNow < monthBirth || (monthNow == monthBirth && dayNow < dayBirth)) {
133
+        age--
134
+      }
135
+      // 得到年龄
136
+      sexAndAge.age = age
137
+      return sexAndAge.age
138
+    },
110 139
   },
111 140
 }
112 141
 </script>

+ 15
- 17
oa-ui/src/views/flowable/form/projectProcess/arrangeProject.vue View File

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-03-19 09:24:06
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-05-20 16:20:49
5
+ * @LastEditTime: 2024-05-21 09:41:42
6 6
 -->
7 7
 <template>
8 8
   <div class="app-container">
@@ -56,7 +56,7 @@
56 56
         </el-col>
57 57
         <el-col :span="12" :xs="24">
58 58
           <el-form-item label="组织交底文档:" prop="organizeDocument">
59
-            <FileUpload ref="orz" :limit="1" :filePathName="'组织交底文件'" :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']"
59
+            <FileUpload v-if="$route.query.taskName == '项目安排'" ref="orz" :limit="1" :filePathName="'组织交底文件'" :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf']"
60 60
               @input="setOrganizeDocument">
61 61
             </FileUpload>
62 62
             <div v-if="$route.query.taskName != '项目安排'" class="upload-list">
@@ -228,18 +228,18 @@ export default {
228 228
       updateProject(this.form)
229 229
       const params = { taskId: this.taskForm.taskId };
230 230
       // 获取下一个流程节点
231
-      // getNextFlowNode(params).then(res => {
232
-      //   this.$set(this.taskForm.variables, "formId", this.taskForm.formId);
233
-      //   this.$set(this.taskForm.variables, "budgetInitiator", this.peopleForm.userId);
234
-      //   getUsersDeptLeaderByDept({ deptId: 105 }).then(res => {
235
-      //     let userId = res.data.userId;
236
-      //     this.$set(this.taskForm.variables, "approval", userId);
237
-      //     complete(this.taskForm).then(response => {
238
-      //       this.$modal.msgSuccess(response.msg);
239
-      //       this.$emit('goBack');
240
-      //     });
241
-      //   })
242
-      // })
231
+      getNextFlowNode(params).then(res => {
232
+        this.$set(this.taskForm.variables, "formId", this.taskForm.formId);
233
+        this.$set(this.taskForm.variables, "budgetInitiator", this.peopleForm.userId);
234
+        getUsersDeptLeaderByDept({ deptId: 105 }).then(res => {
235
+          let userId = res.data.userId;
236
+          this.$set(this.taskForm.variables, "approval", userId);
237
+          complete(this.taskForm).then(response => {
238
+            this.$modal.msgSuccess(response.msg);
239
+            this.$emit('goBack');
240
+          });
241
+        })
242
+      })
243 243
     },
244 244
     cancel() {
245 245
       this.form = {}
@@ -268,8 +268,6 @@ export default {
268 268
 
269 269
 <style lang="scss" scoped>
270 270
 .upload-list {
271
-  display: flex;
272
-  text-align: left;
273
-  justify-content: space-around;
271
+  
274 272
 }
275 273
 </style>

Loading…
Cancel
Save