Sfoglia il codice sorgente

修改预算整体页面,新增预算退回功能

余思翰 4 mesi fa
parent
commit
314cc4e16e

+ 198
- 828
oa-ui/src/views/flowable/form/budget/addBudget.vue
File diff soppresso perché troppo grande
Vedi File


+ 1
- 1
oa-ui/src/views/flowable/form/budget/budget.vue Vedi File

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-04-08 16:08:33
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-10-08 15:23:50
5
+ * @LastEditTime: 2024-12-16 09:20:14
6 6
 -->
7 7
 <template>
8 8
   <div>

+ 59
- 15
oa-ui/src/views/flowable/form/budget/budgetInfo.vue Vedi File

@@ -1,8 +1,8 @@
1 1
 <!--
2 2
  * @Author: ysh
3 3
  * @Date: 2024-04-03 16:28:09
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-09-20 13:52:12
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-12-16 09:46:32
6 6
 -->
7 7
 <template>
8 8
   <div class="main">
@@ -25,7 +25,7 @@
25 25
         <el-descriptions-item label="项目备注" :span="3">
26 26
           {{ projectForm.remark }}
27 27
         </el-descriptions-item>
28
-        <el-descriptions-item label="项目概况" :span="3">
28
+        <el-descriptions-item label="项目计划工作量" :span="3">
29 29
           <div>
30 30
             <table border="1" style="width: 100%;">
31 31
               <tr style="background-color:#f8f8f9">
@@ -59,7 +59,7 @@
59 59
             </table>
60 60
           </div>
61 61
         </el-descriptions-item>
62
-        <el-descriptions-item label="直接成本" :span="3">
62
+        <el-descriptions-item label="预结算额" :span="3">
63 63
           <table border="1" style="width:100%">
64 64
             <tr style="background-color:#f8f8f9" v-if="workList.length != 0">
65 65
               <td>工作简述</td>
@@ -76,7 +76,7 @@
76 76
               <td>{{ work.content }}</td>
77 77
               <td>{{ work.cmcPrice ? work.cmcPrice.workItem : '' }}</td>
78 78
               <td>
79
-                {{ work.scaleGrade  }}
79
+                {{ work.scaleGrade }}
80 80
               </td>
81 81
               <td v-if="taskName == '分管审核' || taskName == '总经理审核'">
82 82
                 <el-input-number :controls="false" style="width:100px;" v-model="work.workload"
@@ -99,7 +99,7 @@
99 99
               <td>{{ work.remark ? work.remark : '' }}</td>
100 100
             </tr>
101 101
             <tr>
102
-              <td :colspan="7" class="head">直接成本合计</td>
102
+              <td :colspan="7" class="head">预结算额合计</td>
103 103
               <td :colspan="1" class="head">{{ budgetForm.settleExpense }}</td>
104 104
               <td></td>
105 105
             </tr>
@@ -121,9 +121,19 @@
121 121
             <tr v-for="user in chooseUser" :key="'user' + user.userId">
122 122
               <td>{{ user.user ? user.user.nickName : '' }}</td>
123 123
               <td>1780</td>
124
-              <td>{{ user.salary.salary }}</td>
125
-              <td>{{ parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) }}</td>
126
-              <td v-if="taskName == '分管审核' || taskName == '总经理审核'">
124
+              <td>
125
+                <span v-if="taskName == '分管审核' || taskName == '总经理审核' || taskName == '预算批准'">
126
+                  {{ user.salary.salary }}
127
+                </span>
128
+                <span v-else>/</span>
129
+              </td>
130
+              <td>
131
+                <span v-if="taskName == '分管审核' || taskName == '总经理审核' || taskName == '预算批准'">
132
+                  {{ parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) }}
133
+                </span>
134
+                <span v-else>/</span>
135
+              </td>
136
+              <td v-if="taskName == '分管审核' || taskName == '总经理审核' || taskName == '预算批准'">
127 137
                 <el-input-number :controls="false" style="width:100px;" v-model="user.days"
128 138
                   @blur="computedFixCostSettle(user, 'user')"></el-input-number>
129 139
               </td>
@@ -322,8 +332,13 @@
322 332
     </div>
323 333
 
324 334
     <el-row v-if="taskName == '分管审核' || taskName == '总经理审核' || taskName == '预算批准'" class="text-center mt20 mb20">
335
+      <el-button type="danger" @click="returnOpen = true">退 回</el-button>
325 336
       <el-button type="success" @click="confirmSucess(taskName)">提 交</el-button>
326 337
     </el-row>
338
+    <el-dialog title="退回" :visible.sync="returnOpen" width="40%" append-to-body>
339
+      <return-btn :taskForm="taskForm" :comment="commentByRole()" @goBack="$emit('goBack')" @saves=""
340
+        @cancel="returnOpen = false"></return-btn>
341
+    </el-dialog>
327 342
   </div>
328 343
 </template>
329 344
 
@@ -343,7 +358,13 @@ import { getUser } from '@/api/system/user'
343 358
 import { getUsersManageLeaderByDept } from '@/api/system/post'
344 359
 import { getPriceRemarkByWorkType } from '@/api/oa/price/price'
345 360
 import { getUserByPost } from "@/api/system/post";
361
+import ReturnComment from '@/views/flowable/form/components/flowBtn/returnComment.vue';
362
+import ReturnBtn from '@/views/flowable/form/components/flowBtn/returnBtn.vue';
346 363
 export default {
364
+  components: {
365
+    ReturnComment,
366
+    ReturnBtn
367
+  },
347 368
   computed: {
348 369
     ...mapGetters(["name", "userId"]),
349 370
   },
@@ -382,7 +403,8 @@ export default {
382 403
       workList: [],
383 404
       workContentList: [],
384 405
       contract: {},
385
-      profit: 0
406
+      profit: 0,
407
+      returnOpen: false,
386 408
     };
387 409
   },
388 410
   created() {
@@ -394,11 +416,11 @@ export default {
394 416
         this.budgetForm = res.rows[0];
395 417
         this.setSignName();
396 418
         if (this.budgetForm) {
397
-          listBudgetDevice({ pageSize:100, budgetId: this.budgetForm.budgetId }).then(res => {
419
+          listBudgetDevice({ pageSize: 100, budgetId: this.budgetForm.budgetId }).then(res => {
398 420
             this.chooseDevice = res.rows;
399 421
             this.deviceLen = res.rows.length + 1;
400 422
           })
401
-          listBudgetStaff({ pageSize:100, budgetId: this.budgetForm.budgetId }).then(res => {
423
+          listBudgetStaff({ pageSize: 100, budgetId: this.budgetForm.budgetId }).then(res => {
402 424
             this.chooseUser = res.rows;
403 425
             this.userLen = res.rows.length + 1;
404 426
             let days = 0;
@@ -407,11 +429,11 @@ export default {
407 429
             }
408 430
             this.budgetForm.inOutPriceSum = Number(days) * Number(this.chooseUser[0].inOutPrice)
409 431
           })
410
-          listBudgetCar({  pageSize:100,budgetId: this.budgetForm.budgetId }).then(res => {
432
+          listBudgetCar({ pageSize: 100, budgetId: this.budgetForm.budgetId }).then(res => {
411 433
             this.chooseCar = res.rows;
412 434
             this.carLen = res.rows.length + 1;
413 435
           })
414
-          listBudgetSettle({  pageSize:100,budgetId: this.budgetForm.budgetId }).then(res => {
436
+          listBudgetSettle({ pageSize: 100, budgetId: this.budgetForm.budgetId }).then(res => {
415 437
             this.workList = res.rows;
416 438
             this.workLen = res.rows.length;
417 439
 
@@ -467,7 +489,12 @@ export default {
467 489
     },
468 490
     confirmSucess(taskName) {
469 491
       const params = { taskId: this.taskForm.taskId };
492
+      debugger
470 493
       if (taskName == '分管审核') {
494
+        if (this.budgetForm.managerComment == '' || this.budgetForm.managerComment == null) {
495
+          this.$modal.msgError('请填写审核意见');
496
+          return
497
+        }
471 498
         this.updateBudgetForm();
472 499
         getNextFlowNode(params).then(res => {
473 500
           getUserByPost({ postName: "总经理" }).then(res => {
@@ -481,6 +508,10 @@ export default {
481 508
 
482 509
         })
483 510
       } else if (taskName == '总经理审核') {
511
+        if (this.budgetForm.zjlComment == '' || this.budgetForm.zjlComment == null) {
512
+          this.$modal.msgError('请填写审核意见');
513
+          return
514
+        }
484 515
         this.updateBudgetForm();
485 516
         getNextFlowNode(params).then(res => {
486 517
           getUserByPost({ postName: "董事长" }).then(res => {
@@ -493,6 +524,10 @@ export default {
493 524
           })
494 525
         })
495 526
       } else {
527
+        if (this.budgetForm.dszComment == '' || this.budgetForm.dszComment == null) {
528
+          this.$modal.msgError('请填写审核意见');
529
+          return
530
+        }
496 531
         this.updateBudgetForm();
497 532
         getNextFlowNode(params).then(res => {
498 533
           complete(this.taskForm).then(response => {
@@ -630,6 +665,15 @@ export default {
630 665
         }
631 666
       })
632 667
     },
668
+    commentByRole() {
669
+      if (this.taskName == '分管审核') {
670
+        return this.budgetForm.managerComment
671
+      } else if (this.taskName == '总经理审核') {
672
+        return this.budgetForm.zjlComment
673
+      } else if (this.taskName == '董事长批准') {
674
+        return this.budgetForm.dszComment
675
+      }
676
+    }
633 677
   },
634 678
 };
635 679
 </script>
@@ -638,7 +682,7 @@ export default {
638 682
 @import "@/assets/styles/element-reset.scss";
639 683
 
640 684
 .main {
641
-  width: 100%;
685
+  width: 85%;
642 686
   margin: 0 auto;
643 687
   text-align: center;
644 688
 }

+ 183
- 0
oa-ui/src/views/flowable/form/budget/carTable.vue Vedi File

@@ -0,0 +1,183 @@
1
+<template>
2
+  <div>
3
+    <el-form ref="form" :model="form" style="padding: 20px 100px 0">
4
+      <el-form-item label="选择车辆:">
5
+        <span v-if="chooseCar.length != 0">
6
+          <el-tag effect="plain" type="success" v-for="item in chooseCar" style="margin: 5px; font-size: 14px"
7
+            :key="item.licensePlate">
8
+            {{ item.licensePlate + item.brand }}
9
+          </el-tag>
10
+        </span>
11
+        <el-button type="success" plain icon="el-icon-plus" @click="openCar = true" size="mini">选择</el-button>
12
+      </el-form-item>
13
+      <el-form-item  v-if="chooseCar.length != 0">
14
+        <table border="1">
15
+          <tr>
16
+            <td :colspan="7" class="head">车辆成本预算</td>
17
+          </tr>
18
+          <tr>
19
+            <td style="width: 120px">车牌号</td>
20
+            <td style="width: 100px">油耗(元/km)</td>
21
+            <td style="width: 100px">总里程</td>
22
+            <td style="width: 110px">折旧成本(天)</td>
23
+            <td style="width: 110px">预算天数</td>
24
+            <td style="width: 110px">过路费</td>
25
+            <td style="width: 100px">总额</td>
26
+          </tr>
27
+          <tr v-for="car in chooseCar" :key="car.carId">
28
+            <td>{{ car.licensePlate + car.brand }}</td>
29
+            <td>
30
+              {{ car.mileage }}
31
+            </td>
32
+            <td>
33
+              <el-input v-model="car.distance" placeholder="请输入总里程" @blur="calculateCarTotal(car)"></el-input>
34
+            </td>
35
+            <td>
36
+              {{ car.dayCost }}
37
+            </td>
38
+            <td>
39
+              <el-input v-model="car.days" placeholder="请输入天数" @blur="calculateCarTotal(car)"></el-input>
40
+            </td>
41
+            <td>
42
+              <el-input v-model="car.toll" placeholder="请输入过路费" @blur="calculateCarTotal(car)"></el-input>
43
+            </td>
44
+            <td class="carCost">{{ car.expense }}</td>
45
+          </tr>
46
+          <tr>
47
+            <td colspan="6">车辆成本合计</td>
48
+            <td>{{ form.carCost }}</td>
49
+          </tr>
50
+        </table>
51
+      </el-form-item>
52
+    </el-form>
53
+    <!-- 选择车辆对话框 -->
54
+    <el-dialog title="选择车辆" :visible.sync="openCar" width="700px" append-to-body>
55
+      <chooseCar @chooseList="getChooseCar"></chooseCar>
56
+    </el-dialog>
57
+  </div>
58
+</template>
59
+
60
+<script>
61
+import chooseCar from './components/chooseCar'
62
+import { listBudgetCar, addBudgetCar, delBudgetCar } from "@/api/oa/budget/budgetCar.js";
63
+export default {
64
+  components: {
65
+    chooseCar
66
+  },
67
+  props: {
68
+    budgetId: {
69
+      type: String,
70
+      default: ''
71
+    }
72
+  },
73
+  data() {
74
+    return {
75
+      form: {
76
+        carCost: 0
77
+      },
78
+      chooseCar: [],
79
+      openCar: false,
80
+    }
81
+  },
82
+  watch: {
83
+    'form.carCost'(newval) {
84
+      if (!isNaN(newval)) {
85
+        this.$emit('carCost', newval);
86
+      }
87
+    },
88
+    budgetId() {
89
+      this.initForm()
90
+    },
91
+    chooseCar: {
92
+      handler(newVal) {
93
+        this.$emit('chooseCar', newVal)
94
+      },
95
+      immediate: true, // 立即生效
96
+      deep: true  //监听对象或数组的时候,要用到深度监听
97
+    }
98
+  },
99
+  created() {
100
+    this.initForm();
101
+  },
102
+  methods: {
103
+    initForm() {
104
+      if (this.budgetId != '') {
105
+        listBudgetCar({ pageSize: 100, budgetId:this.budgetId }).then((res) => {
106
+          this.chooseCar = res.rows
107
+          for (let car of this.chooseCar) {
108
+            car.licensePlate = car.car.licensePlate
109
+            car.dayCost = car.car.dayCost
110
+            car.brand = car.car.brand
111
+          }
112
+          this.initCarCost();
113
+        })
114
+      }
115
+    },
116
+    initCarCost(){
117
+      let carCost = 0;
118
+      for (let car of this.chooseCar) {
119
+        carCost = carCost + Number(car.expense);
120
+      }
121
+      this.form.carCost = carCost
122
+    },
123
+    getChooseCar(val) {
124
+      this.chooseCar = val;
125
+      for (let car of this.chooseCar) {
126
+        car.mileage = 1.0
127
+      }
128
+      this.openCar = false;
129
+      this.recalculateCost(val, 'expense', 'carCost');
130
+    },
131
+    calculateCarTotal(car) {
132
+      let total1 = Number(car.mileage) * Number(car.distance);
133
+      let total2 = Number(car.dayCost) * Number(car.days);
134
+      let sum = (total1 + total2 + Number(car.toll)).toFixed(2);
135
+      this.$set(car, "depreciation", total2.toFixed(2));
136
+      this.$set(car, "expense", sum);
137
+      this.getCost("expense", "carCost", this.chooseCar);
138
+    },
139
+    recalculateCost(arr, name, formName) {
140
+      let sum = arr.reduce((accumulator, item) => {
141
+        // 检查 carCost 属性是否存在且为数字(或可转换为数字)  
142
+        if (item[name] != null && !isNaN(Number(item[name]))) {
143
+          return accumulator + Number(item[name]);
144
+        }
145
+        return accumulator;
146
+      }, 0);
147
+      this.$set(this.form, formName, sum.toFixed(2));
148
+    },
149
+    getCost(name1, name2, list) {
150
+      let sum = 0;
151
+      for (let user of list) {
152
+        sum = sum + Number(user[name1]);
153
+      }
154
+      this.form[name2] = sum.toFixed(2);
155
+    },
156
+  },
157
+}
158
+</script>
159
+
160
+<style lang="scss" scoped>
161
+table {
162
+  width: 100%;
163
+  /*居中*/
164
+  // margin: 0 auto;
165
+  /*边框*/
166
+  /* border: 1px solid black; */
167
+  text-align: center;
168
+  border-collapse: collapse;
169
+  border: 1px solid #DCDFE6;
170
+
171
+  /*设置背景颜色*/
172
+  /* background-color: #bfa; */
173
+  td {
174
+    padding: 1px;
175
+  }
176
+
177
+  .head {
178
+    background-color: #e7f6f3;
179
+    font-family: '微软雅黑';
180
+    font-size: 18;
181
+  }
182
+}
183
+</style>

+ 170
- 0
oa-ui/src/views/flowable/form/budget/deviceTable.vue Vedi File

@@ -0,0 +1,170 @@
1
+<template>
2
+  <div>
3
+    <el-form ref="form" :model="form" style="padding: 20px 100px 0">
4
+      <el-form-item label="选择设备:">
5
+        <span v-if="chooseDevice.length != 0">
6
+          <el-tag effect="plain" type="success" v-for="item in chooseDevice" style="margin: 5px; font-size: 14px"
7
+            :key="item.code">
8
+            {{ item.name + "-" + item.series + "-" + item.brand }}
9
+          </el-tag>
10
+        </span>
11
+        <el-button type="success" plain icon="el-icon-plus" @click="openDevice = true" size="mini">选择</el-button>
12
+      </el-form-item>
13
+      <el-form-item v-if="chooseDevice.length != 0">
14
+        <table border="1">
15
+          <tr>
16
+            <td :colspan="6" class="head">设备成本预算</td>
17
+          </tr>
18
+          <tr>
19
+            <td style="width: 120px">设备名称</td>
20
+            <td style="width: 120px">规格型号</td>
21
+            <td style="width: 120px">品牌</td>
22
+            <td>折旧成本(天)</td>
23
+            <td style="width: 100px">预算天数</td>
24
+            <td style="width: 100px">总额</td>
25
+          </tr>
26
+          <tr v-for="device in chooseDevice" :key="device.deviceId">
27
+            <td>{{ device.name }}</td>
28
+            <td>{{ device.series }}</td>
29
+            <td>{{ device.brand }}</td>
30
+            <td>
31
+              {{ device.dayCost }}
32
+            </td>
33
+            <td>
34
+              <el-input v-model="device.days" placeholder="请输入天数" @blur="calculateDeviceTotal(device)"></el-input>
35
+            </td>
36
+            <td class="deviceCost">{{ device.depreciation }}</td>
37
+          </tr>
38
+          <tr>
39
+            <td colspan="5">设备成本合计</td>
40
+            <td>{{ form.deviceCost }}</td>
41
+          </tr>
42
+        </table>
43
+      </el-form-item>
44
+    </el-form>
45
+    <!-- 选择设备对话框 -->
46
+    <el-dialog title="选择设备" :visible.sync="openDevice" width="750px" append-to-body>
47
+      <chooseDevice @chooseList="getChooseDevice"></chooseDevice>
48
+    </el-dialog>
49
+  </div>
50
+</template>
51
+
52
+<script>
53
+import chooseDevice from './components/chooseDevice'
54
+import { listBudgetDevice, addBudgetDevice, delBudgetDevice } from "@/api/oa/budget/budgetDevice.js";
55
+export default {
56
+  components: {
57
+    chooseDevice
58
+  },
59
+  props: {
60
+    budgetId: {
61
+      type: String,
62
+      default: ''
63
+    }
64
+  },
65
+  data() {
66
+    return {
67
+      form: {
68
+        deviceCost: 0
69
+      },
70
+      chooseDevice: [],
71
+      openDevice: false,
72
+    }
73
+  },
74
+  watch: {
75
+    'form.deviceCost'(newval) {
76
+      if (!isNaN(newval)) {
77
+        this.$emit('deviceCost', newval);
78
+      }
79
+    },
80
+    budgetId() {
81
+      this.initForm()
82
+    },
83
+    chooseDevice: {
84
+      handler(newVal) {
85
+        this.$emit('chooseDevice', newVal)
86
+      },
87
+      immediate: true, // 立即生效
88
+      deep: true  //监听对象或数组的时候,要用到深度监听
89
+    }
90
+  },
91
+  created() {
92
+    this.initForm();
93
+  },
94
+  methods: {
95
+    initForm() {
96
+      if (this.budgetId != '') {
97
+        listBudgetDevice({ pageSize: 100, budgetId:this.budgetId }).then((res) => {
98
+          this.chooseDevice = res.rows;
99
+          for (let device of this.chooseDevice) {
100
+            device.brand = device.device.brand
101
+            device.dayCost = device.device.dayCost
102
+            device.name = device.device.name
103
+            device.series = device.device.series
104
+          }
105
+          this.initDeviceCost();
106
+        })
107
+      }
108
+    },
109
+    initDeviceCost(){
110
+      let deviceCost = 0;
111
+      for (let device of this.chooseDevice) {
112
+        deviceCost = deviceCost + Number(device.depreciation);
113
+      }
114
+      this.form.deviceCost = deviceCost
115
+    },
116
+    getChooseDevice(val) {
117
+      this.chooseDevice = val;
118
+      this.openDevice = false;
119
+      this.recalculateCost(val, 'depreciation', 'deviceCost');
120
+    },
121
+    calculateDeviceTotal(device) {
122
+      let total = Number(device.dayCost) * Number(device.days);
123
+      this.$set(device, "depreciation", total.toFixed(2));
124
+      this.getCost("depreciation", "deviceCost", this.chooseDevice);
125
+    },
126
+    recalculateCost(arr, name, formName) {
127
+      let sum = arr.reduce((accumulator, item) => {
128
+        // 检查 carCost 属性是否存在且为数字(或可转换为数字)  
129
+        if (item[name] != null && !isNaN(Number(item[name]))) {
130
+          return accumulator + Number(item[name]);
131
+        }
132
+        return accumulator;
133
+      }, 0);
134
+      this.$set(this.form, formName, sum.toFixed(2));
135
+    },
136
+    getCost(name1, name2, list) {
137
+      let sum = 0;
138
+      for (let user of list) {
139
+        sum = sum + Number(user[name1]);
140
+      }
141
+      this.form[name2] = sum.toFixed(2);
142
+    },
143
+  },
144
+}
145
+</script>
146
+
147
+<style lang="scss" scoped>
148
+table {
149
+  width: 100%;
150
+  /*居中*/
151
+  // margin: 0 auto;
152
+  /*边框*/
153
+  /* border: 1px solid black; */
154
+  text-align: center;
155
+  border-collapse: collapse;
156
+  border: 1px solid #DCDFE6;
157
+
158
+  /*设置背景颜色*/
159
+  /* background-color: #bfa; */
160
+  td {
161
+    padding: 1px;
162
+  }
163
+
164
+  .head {
165
+    background-color: #e7f6f3;
166
+    font-family: '微软雅黑';
167
+    font-size: 18;
168
+  }
169
+}
170
+</style>

+ 463
- 0
oa-ui/src/views/flowable/form/budget/moneyTable.vue Vedi File

@@ -0,0 +1,463 @@
1
+<template>
2
+  <div style="padding: 0 20px;">
3
+    <el-form :model="form">
4
+      <el-form-item>
5
+        <table class="mb20" border="1">
6
+          <tr class="head">
7
+            <td colspan="11">项目计划工作量</td>
8
+          </tr>
9
+          <tr class="content-head">
10
+            <td>序号</td>
11
+            <td colspan="2">工作内容</td>
12
+            <td>等级或比例尺</td>
13
+            <td>单位</td>
14
+            <td>工作量</td>
15
+            <td>要求完成时间</td>
16
+            <td colspan="4">备注</td>
17
+          </tr>
18
+          <tr v-for="(work, index) in workList" :key="index">
19
+            <td>
20
+              {{ index + 1 }}
21
+            </td>
22
+            <td colspan="2">
23
+              {{ work.content }}
24
+            </td>
25
+            <td>
26
+              {{ work.scale }}
27
+            </td>
28
+            <td>
29
+              {{ work.unit }}
30
+            </td>
31
+            <td>
32
+              {{ work.workload }}
33
+            </td>
34
+            <td>
35
+              {{ work.deadline }}
36
+            </td>
37
+            <td colspan="4">
38
+              {{ work.remark }}
39
+            </td>
40
+          </tr>
41
+        </table>
42
+      </el-form-item>
43
+      <el-form-item>
44
+        <table border="1">
45
+          <tr class="head">
46
+            <td colspan="11">项目预结算</td>
47
+          </tr>
48
+          <tr class="content-head">
49
+            <td style="width: 100px;">工作简述</td>
50
+            <td style="width: 100px;">工作类别</td>
51
+            <td style="width: 100px;">工作项目</td>
52
+            <td style="width: 80px;">比例尺/等级</td>
53
+            <td style="width: 80px;">地类类型</td>
54
+            <td style="width: 50px;">单价</td>
55
+            <td style="width: 50px;">单位</td>
56
+            <td style="width: 50px;">数量</td>
57
+            <td style="width: 50px;">系数</td>
58
+            <td style="width: 100px;">备注</td>
59
+            <td style="width: 50px;">金额</td>
60
+          </tr>
61
+          <tr v-for="(work, index) in contentList" :key="index">
62
+            <!-- 工作简述 -->
63
+            <td style="position:relative;">
64
+              <div class="delete-btn" @click="deletWorkItem(index)">
65
+                <i class="el-icon-circle-close"></i>
66
+              </div>
67
+              <el-input type="textarea" v-model="work.content"></el-input>
68
+            </td>
69
+            <!-- 选择工作类别 -->
70
+            <td>
71
+              <el-select v-model="work.workType" :style="{ width: '100%' }"
72
+                @change="getWorkItemList(work, work.workType)">
73
+                <el-option v-for="item in workTypeList" :key="item.value" :label="item.label" :value="item.value">
74
+                </el-option>
75
+              </el-select>
76
+            </td>
77
+            <!-- 选择工作项目 -->
78
+            <td>
79
+              <el-select v-model="work.workItem" :style="{ width: '100%' }" :remote="true"
80
+                @change="getScaleGradeList(work, work.workItem)">
81
+                <el-option v-for="item in work.workSelect.workItemList" :key="item.value" :label="item.label"
82
+                  :value="item.value">
83
+                </el-option>
84
+              </el-select>
85
+            </td>
86
+            <!-- 选择比例尺/等级 -->
87
+            <td>
88
+              <el-select v-model="work.scaleGrade" :style="{ width: '100%' }"
89
+                @change="getUnitPrice(work, work.workItem, work.subItem, work.scaleGrade, work.groundType)">
90
+                <el-option v-for="item in work.workSelect.scaleGradeList" :key="item.value" :label="item.label"
91
+                  :value="item.value">
92
+                </el-option>
93
+              </el-select>
94
+            </td>
95
+            <!-- 选择地类 -->
96
+            <td>
97
+              <el-select v-model="work.groundType" :style="{ width: '100%' }"
98
+                @change="getUnitPrice(work, work.workItem, work.subItem, work.scaleGrade, work.groundType)">
99
+                <el-option key="一般地类" label="一般地类" value="0">
100
+                </el-option>
101
+                <el-option key="复杂地类" label="复杂地类" value="1">
102
+                </el-option>
103
+              </el-select>
104
+            </td>
105
+            <!-- 单价 -->
106
+            <td>
107
+              {{ work.price }}
108
+            </td>
109
+            <!-- 单位 -->
110
+            <td>
111
+              {{ work.unit }}
112
+            </td>
113
+            <!-- 数量 -->
114
+            <td>
115
+              <el-input-number :controls="false" :style="{ width: '100%' }" v-model="work.workload"
116
+                @change="getTotal(work)"></el-input-number>
117
+            </td>
118
+            <!-- 系数 -->
119
+            <td>
120
+              <el-input-number v-model="work.coefficient" :controls="false" :precision="2" :step="0.01" :max="10"
121
+                @blur="getTotal(work)" style="width:60px;">
122
+              </el-input-number>
123
+              <el-tooltip content="系数备注" placement="right-start">
124
+                <el-button icon="el-icon-info" type="text" @click="getCoefficientRemark(work.workType)"></el-button>
125
+              </el-tooltip>
126
+
127
+            </td>
128
+            <!-- 备注 -->
129
+            <td>
130
+              <el-input type="textarea" v-model="work.remark"></el-input>
131
+            </td>
132
+            <!-- 总额 -->
133
+            <td>
134
+              {{ work.settle }}
135
+            </td>
136
+          </tr>
137
+          <tr>
138
+            <td colspan="10">预结算合计</td>
139
+            <td colspan="1">{{ Number(settle).toFixed(2) }}</td>
140
+          </tr>
141
+        </table>
142
+        <el-button icon="el-icon-plus" plain type="primary" size="mini" @click="addWorkList"></el-button>
143
+      </el-form-item>
144
+    </el-form>
145
+  </div>
146
+</template>
147
+
148
+<script>
149
+import { listProjectWork } from "@/api/oa/project/projectWork";
150
+import { getPriceRemarkByWorkType } from '@/api/oa/price/price'
151
+import { listBudgetSettle, addBudgetSettle, delBudgetSettle } from "@/api/oa/budget/budgetSettle.js";
152
+import { getWorkTypeList, getWorkItemList, getSubItemList, getScaleGradeList, getUnitPrice } from '@/api/oa/price/price'
153
+export default {
154
+  props: {
155
+    projectId: {
156
+      type: String,
157
+      default: ''
158
+    },
159
+    budgetId: {
160
+      type: String,
161
+      default: ''
162
+    },
163
+  },
164
+  data() {
165
+    return {
166
+      form: {},
167
+      workList: [],//项目概况工作列表
168
+      workTypeList: [],
169
+      contentList: [
170
+        {
171
+          content: '',
172
+          workType: '',
173
+          workItem: '',
174
+          scaleGrade: '',
175
+          groundType: '0',
176
+          price: '',
177
+          unit: '',
178
+          workload: '',
179
+          coefficient: 1,
180
+          settle: 0,
181
+          workSelect: {
182
+            // 项目列表
183
+            projectList: [],
184
+            // 工作类别列表
185
+            workTypeList: [],
186
+            // 工作项目
187
+            workItemList: [],
188
+            // 项目细项
189
+            subItemList: [],
190
+            // 比例尺
191
+            scaleGradeList: [],
192
+          }
193
+        }
194
+      ],
195
+      settle: 0,
196
+    }
197
+  },
198
+  watch: {
199
+    budgetId() {
200
+      this.initTable();
201
+    },
202
+    settle(newval){
203
+      this.$emit('settleExpense',newval)
204
+    },
205
+    contentList:{
206
+      handler(newVal) {
207
+        this.$emit('contentList', newVal)
208
+      },
209
+      immediate: true, // 立即生效
210
+      deep: true  //监听对象或数组的时候,要用到深度监听
211
+    }
212
+  },
213
+  created() {
214
+    this.initTable();
215
+    this.initWorkTypeList();
216
+  },
217
+  methods: {
218
+    initTable() {
219
+      if (this.projectId != '') {
220
+        listProjectWork({ projectId: this.projectId }).then(res => {
221
+          this.workList = res.rows;
222
+        })
223
+      }
224
+      if (this.budgetId != '') {
225
+        listBudgetSettle({ pageSize: 100, budgetId: this.budgetId }).then(res => {
226
+          if (res.total != 0) {
227
+            this.contentList = res.rows;
228
+            this.initContenList();
229
+            this.getSettleSum();
230
+          }
231
+        })
232
+      }
233
+    },
234
+    initContenList() {
235
+      for (let c of this.contentList) {
236
+        this.$set(c, 'workSelect', {
237
+          // 项目列表
238
+          projectList: [],
239
+          // 工作类别列表
240
+          workTypeList: [],
241
+          // 工作项目
242
+          workItemList: [],
243
+          // 项目细项
244
+          subItemList: [],
245
+          // 比例尺
246
+          scaleGradeList: [],
247
+          workTypeLoading: true,
248
+          subItemLoading: true,
249
+          scaleGradeLoading: true,
250
+        })
251
+        this.$set(c, 'workType', c.cmcPrice.workType)
252
+        this.$set(c, 'scaleGrade', c.cmcPrice.scaleGrade)
253
+        this.$set(c, 'workItem', c.cmcPrice.workItem)
254
+        this.$set(c, 'unit', c.cmcPrice.unit)
255
+        if (c.groundType == '0') {
256
+          this.$set(c, 'price', c.cmcPrice.commonPrice)
257
+        } else {
258
+          this.$set(c, 'price', c.cmcPrice.complexPrice)
259
+        }
260
+        this.getTotal(c)
261
+      }
262
+    },
263
+    /* 获取工作类别 */
264
+    initWorkTypeList() {
265
+      getWorkTypeList().then(res => {
266
+        if (res) {
267
+          this.workTypeList = this.setArray(res);
268
+        }
269
+      });
270
+    },
271
+    /* 获取工作项目 */
272
+    getWorkItemList(work, workType) {
273
+      getWorkItemList({ workType: workType }).then(res => {
274
+        if (res) {
275
+          let workItemList = this.setArray(res);
276
+          work.workSelect.workItemList = workItemList;
277
+          work.workItem = workItemList[0].label;
278
+          work.subItem = '';
279
+          this.getScaleGradeList(work, work.workItem);
280
+        }
281
+      })
282
+    },
283
+    /* 获取比例尺 */
284
+    getScaleGradeList(work, workItem) {
285
+      if (work.scale) {
286
+        this.$set(work, 'scaleGrade', work.scale);
287
+        if (work.groundType == undefined) {
288
+          this.$set(work, 'groundType', '0');
289
+        }
290
+        this.getUnitPrice(work, work.workItem, work.subItem, work.scaleGrade, work.groundType);
291
+      } else {
292
+        getScaleGradeList({ workItem }).then(res => {
293
+          if (res) {
294
+            let scaleGradeList = this.setArray(res);
295
+            work.workSelect.scaleGradeLoading = false;
296
+            work.workSelect.scaleGradeList = scaleGradeList;
297
+            this.$set(work, 'scaleGrade', scaleGradeList[0].label)
298
+            // work.scaleGrade = scaleGradeList[0].label;
299
+            if (work.scaleGrade == undefined) {
300
+              this.$set(work, 'scaleGrade', '无');
301
+            }
302
+            if (work.groundType == undefined) {
303
+              this.$set(work, 'groundType', '0');
304
+            }
305
+            this.getUnitPrice(work, work.workItem, work.subItem, work.scaleGrade, work.groundType);
306
+          }
307
+        })
308
+      }
309
+    },
310
+    /* 获取单价 */
311
+    getUnitPrice(work, workItem, subItem, scaleGrade, groundType) {
312
+      getUnitPrice({ workItem, subItem, scaleGrade, groundType: groundType }).then(res => {
313
+        if (res.length != 0) {
314
+          work.priceId = res.data.id;
315
+          this.$set(work, 'price', res.data.price)
316
+          this.$set(work, 'unit', res.data.unit)
317
+          this.$set(work, 'coefficient', 1)
318
+          if (work.workload != undefined || work.workload != '') {
319
+
320
+            this.getTotal(work);
321
+          }
322
+        }
323
+      })
324
+    },
325
+    /* 获取总额 */
326
+    getTotal(work) {
327
+      let total = this.calculateTotal(work.price, work.coefficient, work.workload, 1);
328
+      if (total < 600) {
329
+        total = 600
330
+        this.$message.warning('不足600,按600算')
331
+      }
332
+      this.$set(work, 'settle', total)
333
+      this.getSettleSum();
334
+    },
335
+    /* 计算总额 */
336
+    calculateTotal(price, coefficient, workload, percent) {
337
+      return ((parseFloat(price) * parseFloat(coefficient) * parseFloat(workload)) * percent).toFixed(2);
338
+    },
339
+
340
+    getSettleSum() {
341
+      let sum = 0;
342
+      for (let work of this.contentList) {
343
+        sum = sum + Number(work.settle)
344
+      }
345
+      this.settle = sum.toFixed(2);
346
+      let obj = {}
347
+      obj.workList = this.contentList;
348
+      obj.settle = this.settle;
349
+      this.$emit('getSettle', obj);
350
+      this.$emit('getWorkList', this.contentList)
351
+    },
352
+
353
+    getCoefficientRemark(workType) {
354
+      getPriceRemarkByWorkType({ workType }).then(res => {
355
+        if (res.code == 200) {
356
+          if (workType != undefined)
357
+            this.$notify({
358
+              title: workType,
359
+              dangerouslyUseHTMLString: true,
360
+              message: res.msg,
361
+              duration: 0
362
+            });
363
+        }
364
+
365
+      })
366
+    },
367
+    addWorkList() {
368
+      this.contentList.push({
369
+        content: '',
370
+        workType: '',
371
+        workItem: '',
372
+        scaleGrade: '',
373
+        groundType: '0',
374
+        price: '',
375
+        unit: '',
376
+        workload: '',
377
+        coefficient: 1,
378
+        settle: 0,
379
+        workSelect: {
380
+          // 项目列表
381
+          projectList: [],
382
+          // 工作类别列表
383
+          workTypeList: [],
384
+          // 工作项目
385
+          workItemList: [],
386
+          // 项目细项
387
+          subItemList: [],
388
+          // 比例尺
389
+          scaleGradeList: [],
390
+          workTypeLoading: true,
391
+          workItemLoading: true,
392
+          subItemLoading: true,
393
+          scaleGradeLoading: true,
394
+        }
395
+      });
396
+    },
397
+    deletWorkItem(index) {
398
+      let arr = this.contentList;
399
+      if (arr.length == 1) {
400
+        return;
401
+      }
402
+      if (index >= 0 && index < arr.length) {
403
+        arr.splice(index, 1);
404
+      }
405
+      this.getSettleSum();
406
+    },
407
+    // 数组去重,并格式化为label、value形式
408
+    setArray(arr) {
409
+      if (arr != [] && arr != undefined) {
410
+        let datalist = [...new Set(arr)];
411
+        let list = [];
412
+        for (let i of datalist) {
413
+          let obj = new Object();
414
+          obj.label = i;
415
+          obj.value = i;
416
+          list.push(obj);
417
+        }
418
+        return list;
419
+      } else {
420
+        return [];
421
+      }
422
+    },
423
+  },
424
+}
425
+</script>
426
+
427
+<style lang="scss" scoped>
428
+.delete-btn {
429
+  position: absolute;
430
+  left: -30px;
431
+  top: 50%;
432
+  transform: translate(0, -50%);
433
+  color: #F56C6C;
434
+  cursor: pointer;
435
+
436
+  i {
437
+    font-size: 25px;
438
+  }
439
+}
440
+
441
+table {
442
+  width: 100%;
443
+  /*居中*/
444
+  // margin: 0 auto;
445
+  /*边框*/
446
+  /* border: 1px solid black; */
447
+  text-align: center;
448
+  border-collapse: collapse;
449
+  border: 1px solid #DCDFE6;
450
+
451
+  /*设置背景颜色*/
452
+  /* background-color: #bfa; */
453
+  td {
454
+    padding: 1px;
455
+  }
456
+
457
+  .head {
458
+    background-color: #e7f6f3;
459
+    font-family: '微软雅黑';
460
+    font-size: 18;
461
+  }
462
+}
463
+</style>

+ 141
- 0
oa-ui/src/views/flowable/form/budget/otherTable.vue Vedi File

@@ -0,0 +1,141 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2024-12-11 17:21:00
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-12-12 13:52:17
6
+-->
7
+<template>
8
+  <div>
9
+    <el-form :model="form">
10
+      <el-form-item>
11
+        <table border="1">
12
+          <tr class="head">
13
+            <td>内容</td>
14
+            <td>费用金额</td>
15
+            <td>备注</td>
16
+          </tr>
17
+          <tr>
18
+            <td>外协费用</td>
19
+            <td>
20
+              <el-input-number :controls="false" style="width:100%;" v-model="form.outExpense"
21
+                @blur="computedDirectExpense()"></el-input-number>
22
+            </td>
23
+            <td>
24
+              <el-input type="textarea" v-model="form.outRemark"></el-input>
25
+            </td>
26
+          </tr>
27
+          <tr>
28
+            <td>车船租赁</td>
29
+            <td>
30
+              <el-input-number :controls="false" style="width:100%;" v-model="form.rentExpense"
31
+                @blur="computedDirectExpense()"></el-input-number>
32
+            </td>
33
+            <td>
34
+              <el-input type="textarea" v-model="form.rentRemark"></el-input>
35
+            </td>
36
+          </tr>
37
+          <tr>
38
+            <td>其他费用</td>
39
+            <td>
40
+              <el-input-number :controls="false" style="width:100%;" v-model="form.otherExpense"
41
+                @blur="computedDirectExpense()"></el-input-number>
42
+            </td>
43
+            <td>
44
+              <el-input type="textarea" v-model="form.otherRemark"></el-input>
45
+            </td>
46
+          </tr>
47
+          <tr>
48
+            <td>税费成本</td>
49
+            <td>
50
+              <el-input-number :controls="false" style="width:100%;" v-model="form.taxExpense"
51
+                @blur="computedDirectExpense()"></el-input-number>
52
+            </td>
53
+            <td>
54
+              <el-input type="textarea" v-model="form.taxRemark"></el-input>
55
+            </td>
56
+          </tr>
57
+          <tr>
58
+            <td>经营管理费用</td>
59
+            <td>
60
+              <el-input-number :controls="false" style="width:100%;" v-model="form.businessExpense"
61
+                @blur="computedDirectExpense()"></el-input-number>
62
+            </td>
63
+            <td>
64
+              <el-input type="textarea" v-model="form.businessRemark"></el-input>
65
+            </td>
66
+          </tr>
67
+        </table>
68
+      </el-form-item>
69
+    </el-form>
70
+  </div>
71
+</template>
72
+
73
+<script>
74
+import { listBudget, addBudget, updateBudget, delBudget } from "@/api/oa/budget/budget.js";
75
+export default {
76
+  props: {
77
+    budgetForm: {
78
+      type: Object,
79
+      default: ''
80
+    }
81
+  },
82
+  data() {
83
+    return {
84
+      form: {
85
+        outExpense: 0,
86
+        rentExpense: 0,
87
+        otherExpense: 0,
88
+        taxExpense: 0,
89
+        businessExpense: 0
90
+      }
91
+    }
92
+  },
93
+  watch: {
94
+    budgetForm: {
95
+      handler(newVal) {
96
+        if (newVal) {
97
+          this.initTable(newVal);
98
+        }
99
+      },
100
+      immediate: true, // 立即生效
101
+      deep: true  //监听对象或数组的时候,要用到深度监听
102
+    }
103
+  },
104
+  created() {
105
+    
106
+  },
107
+  methods: {
108
+    initTable(val) {
109
+      this.form = val;
110
+    },
111
+    computedDirectExpense() {
112
+      this.$emit('otherCost', this.form)
113
+    }
114
+  },
115
+}
116
+</script>
117
+
118
+<style lang="scss" scoped>
119
+table {
120
+  width: 100%;
121
+  /*居中*/
122
+  // margin: 0 auto;
123
+  /*边框*/
124
+  /* border: 1px solid black; */
125
+  text-align: center;
126
+  border-collapse: collapse;
127
+  border: 1px solid #DCDFE6;
128
+
129
+  /*设置背景颜色*/
130
+  /* background-color: #bfa; */
131
+  td {
132
+    padding: 1px;
133
+  }
134
+
135
+  .head {
136
+    background-color: #e7f6f3;
137
+    font-family: '微软雅黑';
138
+    font-size: 18;
139
+  }
140
+}
141
+</style>

+ 174
- 0
oa-ui/src/views/flowable/form/budget/staffTable.vue Vedi File

@@ -0,0 +1,174 @@
1
+<template>
2
+  <div class="app-container">
3
+    <el-form ref="form" :model="form" style="padding: 20px 100px 0">
4
+      <!-- 选择人员 -->
5
+      <el-form-item label="选择人员:">
6
+        <span v-if="chooseUser.length != 0">
7
+          <el-tag effect="plain" type="success" v-for="item in chooseUser" style="margin: 5px; font-size: 14px"
8
+            :key="item.userId">
9
+            {{ item.nickName }}
10
+          </el-tag>
11
+        </span>
12
+        <el-button type="success" plain icon="el-icon-plus" @click="openPeople = true" size="mini">选择</el-button>
13
+      </el-form-item>
14
+      <div class="mb20" style="color:#E23D28;font-size:12px;">
15
+        tips:人员成本=(基础工资+岗位工资)/21.75,固定工资中的年功工资暂忽略不计,绩效工资计入直接成本,津贴补贴、五险一金扣除暂未考虑
16
+      </div>
17
+      <el-form-item v-if="chooseUser.length != 0">
18
+        <table border="1">
19
+          <tr>
20
+            <td :colspan="5" class="head">表1:人员成本预算</td>
21
+          </tr>
22
+          <tr>
23
+            <td style="width: 50px">序号</td>
24
+            <td style="width: 80px">姓名</td>
25
+            <td style="width: 100px">部门</td>
26
+            <td style="width: 100px">预算天数</td>
27
+            <td style="width: 100px">总额</td>
28
+          </tr>
29
+          <tr v-for="user, index in chooseUser" :key="user.userId">
30
+            <td>{{ index + 1 }}</td>
31
+            <td>{{ user.nickName }}</td>
32
+            <td>{{ user.dept ? user.dept.deptName : user.deptName }}</td>
33
+            <td>
34
+              <el-input v-model="user.days" placeholder="请输入天数" @blur="calculateUserTotal(user)"></el-input>
35
+            </td>
36
+            <td class="staffCost">{{ user.staffCost }}</td>
37
+          </tr>
38
+          <tr>
39
+            <td colspan="4">人员成本合计</td>
40
+            <td>{{ form.staffCost }}</td>
41
+          </tr>
42
+        </table>
43
+      </el-form-item>
44
+
45
+    </el-form>
46
+
47
+    <!-- 选择人员对话框 -->
48
+    <el-dialog title="选择人员" :visible.sync="openPeople" width="700px" append-to-body>
49
+      <choosePeople @chooseUser="getChooseUser"></choosePeople>
50
+    </el-dialog>
51
+  </div>
52
+</template>
53
+
54
+<script>
55
+import { listBudgetStaff, addBudgetStaff, delBudgetStaff } from "@/api/oa/budget/budgetStaff.js";
56
+import choosePeople from './components/choosePeople.vue';
57
+export default {
58
+  components: {
59
+    choosePeople
60
+  },
61
+  props: {
62
+    budgetId: {
63
+      type: String,
64
+      default: ''
65
+    }
66
+  },
67
+  data() {
68
+    return {
69
+      form: {
70
+        staffCost: 0
71
+      },
72
+      chooseUser: [],
73
+      openPeople: false,
74
+    }
75
+  },
76
+  watch: {
77
+    'form.staffCost'(newval) {
78
+      if (!isNaN(newval)) {
79
+        this.$emit('staffCost', newval);
80
+      }
81
+    },
82
+    budgetId() {
83
+      this.initForm()
84
+    },
85
+    chooseUser: {
86
+      handler(newVal) {
87
+        this.$emit('chooseUser', newVal)
88
+      },
89
+      immediate: true, // 立即生效
90
+      deep: true  //监听对象或数组的时候,要用到深度监听
91
+    }
92
+  },
93
+  created() {
94
+    this.initForm();
95
+  },
96
+  methods: {
97
+    initForm() {
98
+      if (this.budgetId != '') {
99
+        listBudgetStaff({ pageSize: 100, budgetId: this.budgetId }).then((res) => {
100
+          this.chooseUser = res.rows;
101
+          for (let user of this.chooseUser) {
102
+            user.nickName = this.getUserName(user.userId);
103
+            user.deptName = this.getDeptName(user.user.deptId);
104
+          }
105
+          this.initStaffCost()
106
+        })
107
+      }
108
+    },
109
+    initStaffCost(){
110
+      let staffCost = 0;
111
+      for (let user of this.chooseUser) {
112
+        staffCost = staffCost + Number(user.staffCost);
113
+      }
114
+      this.form.staffCost = staffCost
115
+    },
116
+    getChooseUser(val) {
117
+      this.chooseUser = val;
118
+      this.openPeople = false;
119
+      this.recalculateCost(val, 'staffCost', 'staffCost');
120
+    },
121
+    // 计算单个人员的成本
122
+    calculateUserTotal(user) {
123
+      let total = parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) * Number(user.days);
124
+      if (isNaN(total)) {
125
+        total = 0
126
+      }
127
+      this.$set(user, "staffCost", total.toFixed(2));
128
+      this.getCost("staffCost", "staffCost", this.chooseUser);
129
+    },
130
+    recalculateCost(arr, name, formName) {
131
+      let sum = arr.reduce((accumulator, item) => {
132
+        // 检查 carCost 属性是否存在且为数字(或可转换为数字)  
133
+        if (item[name] != null && !isNaN(Number(item[name]))) {
134
+          return accumulator + Number(item[name]);
135
+        }
136
+        return accumulator;
137
+      }, 0);
138
+      this.$set(this.form, formName, sum.toFixed(2));
139
+    },
140
+    getCost(name1, name2, list) {
141
+      let sum = 0;
142
+      for (let user of list) {
143
+        sum = sum + Number(user[name1]);
144
+      }
145
+      this.form[name2] = sum.toFixed(2);
146
+    },
147
+  },
148
+}
149
+</script>
150
+
151
+<style lang="scss" scoped>
152
+table {
153
+  width: 100%;
154
+  /*居中*/
155
+  // margin: 0 auto;
156
+  /*边框*/
157
+  /* border: 1px solid black; */
158
+  text-align: center;
159
+  border-collapse: collapse;
160
+  border: 1px solid #DCDFE6;
161
+
162
+  /*设置背景颜色*/
163
+  /* background-color: #bfa; */
164
+  td {
165
+    padding: 1px;
166
+  }
167
+
168
+  .head {
169
+    background-color: #e7f6f3;
170
+    font-family: '微软雅黑';
171
+    font-size: 18;
172
+  }
173
+}
174
+</style>

Loading…
Annulla
Salva