Bladeren bron

修改预算编制到流程中

余思翰 1 jaar geleden
bovenliggende
commit
fe33031bd8

+ 7
- 2
oa-ui/src/views/flowable/task/todo/detail/index.vue Bestand weergeven

@@ -30,6 +30,7 @@
30 30
             @goBack="goBack"></device-form>
31 31
           <project-process :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '项目流转'"
32 32
             @goBack="goBack"></project-process>
33
+          <add-budget :taskName="taskName" :taskForm="taskForm" v-else-if="taskForm.procDefName == '项目预算'" @goBack="goBack"></add-budget>
33 34
           <el-row type="flex" justify="center" v-show="isShowApprove()">
34 35
             <el-button v-if="!formKeyExist" icon="el-icon-edit-outline" type="success" size="mini"
35 36
               @click="handleComplete">审核通过
@@ -177,6 +178,7 @@ import CwTable from "@/views/flowable/form/cwTable.vue";
177 178
 import carForm from "@/views/flowable/form/carForm.vue";
178 179
 import deviceForm from "@/views/flowable/form/deviceForm";
179 180
 import projectProcess from "@/views/flowable/form/projectProcess/index.vue"
181
+import AddBudget from '@/views/oa/budget/addBudget.vue';
180 182
 
181 183
 export default {
182 184
   name: "Record",
@@ -193,7 +195,8 @@ export default {
193 195
     JyTable,
194 196
     carForm,
195 197
     deviceForm,
196
-    projectProcess
198
+    projectProcess,
199
+    AddBudget
197 200
   },
198 201
   props: {},
199 202
   data() {
@@ -549,7 +552,9 @@ export default {
549 552
     },
550 553
     // 是否显示审批通过
551 554
     isShowApprove() {
552
-      if (this.taskName == '员工填报' || this.taskForm.procDefName == '用车审批' || this.taskForm.procDefName == '用车审批(工会)' || this.taskForm.procDefName == '设备审批'|| this.taskForm.procDefName == '项目流转') {
555
+      if (this.taskName == '员工填报' || this.taskForm.procDefName == '用车审批'
556
+       || this.taskForm.procDefName == '用车审批(工会)' || this.taskForm.procDefName == '设备审批'|| this.taskForm.procDefName == '项目流转'
557
+       || this.taskForm.procDefName == '项目预算') {
553 558
         return false
554 559
       } else {
555 560
         return true

+ 578
- 396
oa-ui/src/views/oa/budget/addBudget.vue
Diff onderdrukt omdat het te groot bestand
Bestand weergeven


+ 15
- 0
oa-ui/src/views/oa/budget/budgetDetails.vue Bestand weergeven

@@ -0,0 +1,15 @@
1
+<template>
2
+  <div>
3
+
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+  export default {
9
+    
10
+  }
11
+</script>
12
+
13
+<style lang="scss" scoped>
14
+
15
+</style>

+ 0
- 0
oa-ui/src/views/oa/budget/components/budgetForm.vue Bestand weergeven


+ 9
- 10
oa-ui/src/views/oa/budget/components/chooseMoney.vue Bestand weergeven

@@ -21,7 +21,7 @@
21 21
             {{ work.unit }}
22 22
           </td>
23 23
           <td>
24
-            {{ work.workLoad }}
24
+            {{ work.workload }}
25 25
           </td>
26 26
           <td>
27 27
             {{ work.deadline }}
@@ -87,13 +87,13 @@
87 87
             {{ work.price }} / {{ work.unit }}
88 88
           </td>
89 89
           <td>
90
-            {{ work.workLoad }}
90
+            {{ work.workload }}
91 91
           </td>
92 92
           <td>
93 93
             <el-input v-model="work.coefficient" placeholder="请输入系数" @blur="getTotal(work)"></el-input>
94 94
           </td>
95 95
           <td class="workTotal">
96
-            {{ work.total }}
96
+            {{ work.settle }}
97 97
           </td>
98 98
         </tr>
99 99
         <tr>
@@ -227,7 +227,7 @@ export default {
227 227
           work.priceId = res.data.id;
228 228
           this.setValue(work, 'price', res.data.price)
229 229
           this.setValue(work, 'coefficient', 1)
230
-          if (work.workLoad != undefined || work.workLoad != '') {
230
+          if (work.workload != undefined || work.workload != '') {
231 231
             this.getTotal(work);
232 232
           }
233 233
         }
@@ -235,24 +235,23 @@ export default {
235 235
     },
236 236
     /* 获取总额 */
237 237
     getTotal(work) {
238
-      let total = this.calculateTotal(work.price, work.coefficient, work.workLoad, 1);
239
-      this.setValue(work, 'total', total)
238
+      let total = this.calculateTotal(work.price, work.coefficient, work.workload, 1);
239
+      this.setValue(work, 'settle', total)
240 240
       this.getSettleSum();
241 241
     },
242 242
     /* 计算总额 */
243
-    calculateTotal(price, coefficient, workLoad, percent) {
244
-      return ((parseFloat(price) * parseFloat(coefficient) * parseFloat(workLoad)) * percent).toFixed(2);
243
+    calculateTotal(price, coefficient, workload, percent) {
244
+      return ((parseFloat(price) * parseFloat(coefficient) * parseFloat(workload)) * percent).toFixed(2);
245 245
     },
246 246
     getSettleSum() {
247 247
       let sum = 0;
248 248
       for(let work of this.workList){
249
-        sum = sum + Number(work.total)
249
+        sum = sum + Number(work.settle)
250 250
       }
251 251
       this.settle = sum.toFixed(2);
252 252
       let obj = {}
253 253
       obj.workList = this.workList;
254 254
       obj.settle = this.settle;
255
-      console.log(this.workList);
256 255
       this.$emit('getSettle', obj)
257 256
     },
258 257
     //数组去重

+ 124
- 145
oa-ui/src/views/oa/budget/index.vue Bestand weergeven

@@ -1,126 +1,45 @@
1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2024-03-21 17:49:15
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-04-03 14:51:37
6
+-->
1 7
 <!--
2 8
  * @Author: wrh
3 9
  * @Date: 2024-03-25 17:38:39
4
- * @LastEditors: wrh
5
- * @LastEditTime: 2024-03-27 10:00:27
10
+ * @LastEditors: Please set LastEditors
11
+ * @LastEditTime: 2024-04-03 14:41:00
6 12
 -->
7 13
 <template>
8 14
   <div class="app-container">
9
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
10
-      <el-form-item label="项目id" prop="projectId">
11
-        <el-input
15
+    <el-form
16
+      :model="queryParams"
17
+      ref="queryForm"
18
+      size="small"
19
+      :inline="true"
20
+      v-show="showSearch"
21
+      label-width="68px"
22
+    >
23
+      <el-form-item label="项目编号" prop="projectId">
24
+        <el-select
12 25
           v-model="queryParams.projectId"
13
-          placeholder="请输入项目id"
14
-          clearable
15
-          @keyup.enter.native="handleQuery"
16
-        />
17
-      </el-form-item>
18
-      <el-form-item label="人员成本" prop="staffCost">
19
-        <el-input
20
-          v-model="queryParams.staffCost"
21
-          placeholder="请输入人员成本"
22
-          clearable
23
-          @keyup.enter.native="handleQuery"
24
-        />
25
-      </el-form-item>
26
-      <el-form-item label="车辆成本" prop="carCost">
27
-        <el-input
28
-          v-model="queryParams.carCost"
29
-          placeholder="请输入车辆成本"
30
-          clearable
31
-          @keyup.enter.native="handleQuery"
32
-        />
33
-      </el-form-item>
34
-      <el-form-item label="设备成本" prop="deviceCost">
35
-        <el-input
36
-          v-model="queryParams.deviceCost"
37
-          placeholder="请输入设备成本"
38
-          clearable
39
-          @keyup.enter.native="handleQuery"
40
-        />
41
-      </el-form-item>
42
-      <el-form-item label="固定成本" prop="fixCost">
43
-        <el-input
44
-          v-model="queryParams.fixCost"
45
-          placeholder="请输入固定成本"
46
-          clearable
47
-          @keyup.enter.native="handleQuery"
48
-        />
49
-      </el-form-item>
50
-      <el-form-item label="预结算额" prop="settleExpense">
51
-        <el-input
52
-          v-model="queryParams.settleExpense"
53
-          placeholder="请输入预结算额"
54
-          clearable
55
-          @keyup.enter.native="handleQuery"
56
-        />
57
-      </el-form-item>
58
-      <el-form-item label="外协费用" prop="outExpense">
59
-        <el-input
60
-          v-model="queryParams.outExpense"
61
-          placeholder="请输入外协费用"
62
-          clearable
63
-          @keyup.enter.native="handleQuery"
64
-        />
65
-      </el-form-item>
66
-      <el-form-item label="商务费用" prop="businessExpense">
67
-        <el-input
68
-          v-model="queryParams.businessExpense"
69
-          placeholder="请输入商务费用"
70
-          clearable
71
-          @keyup.enter.native="handleQuery"
72
-        />
73
-      </el-form-item>
74
-      <el-form-item label="车船租赁" prop="rentExpense">
75
-        <el-input
76
-          v-model="queryParams.rentExpense"
77
-          placeholder="请输入车船租赁"
78
-          clearable
79
-          @keyup.enter.native="handleQuery"
80
-        />
81
-      </el-form-item>
82
-      <el-form-item label="其他费用" prop="otherExpense">
83
-        <el-input
84
-          v-model="queryParams.otherExpense"
85
-          placeholder="请输入其他费用"
26
+          filterable
27
+          placeholder="请选择"
86 28
           clearable
87
-          @keyup.enter.native="handleQuery"
88
-        />
89
-      </el-form-item>
90
-      <el-form-item label="直接成本" prop="directExpense">
91
-        <el-input
92
-          v-model="queryParams.directExpense"
93
-          placeholder="请输入直接成本"
94
-          clearable
95
-          @keyup.enter.native="handleQuery"
96
-        />
97
-      </el-form-item>
98
-      <el-form-item label="预算总额" prop="totalBudget">
99
-        <el-input
100
-          v-model="queryParams.totalBudget"
101
-          placeholder="请输入预算总额"
102
-          clearable
103
-          @keyup.enter.native="handleQuery"
104
-        />
105
-      </el-form-item>
106
-      <el-form-item label="编制人" prop="compiler">
107
-        <el-input
108
-          v-model="queryParams.compiler"
109
-          placeholder="请输入编制人"
110
-          clearable
111
-          @keyup.enter.native="handleQuery"
112
-        />
113
-      </el-form-item>
114
-      <el-form-item label="审核人" prop="auditor">
115
-        <el-input
116
-          v-model="queryParams.auditor"
117
-          placeholder="请输入审核人"
118
-          clearable
119
-          @keyup.enter.native="handleQuery"
120
-        />
29
+        >
30
+          <el-option
31
+            v-for="item in projectList"
32
+            :key="item.projectId"
33
+            :label="item.projectNumber"
34
+            :value="item.projectId"
35
+          >
36
+          </el-option>
37
+        </el-select>
121 38
       </el-form-item>
122 39
       <el-form-item>
123
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
40
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"
41
+          >搜索</el-button
42
+        >
124 43
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
125 44
       </el-form-item>
126 45
     </el-form>
@@ -134,7 +53,8 @@
134 53
           size="mini"
135 54
           @click="handleAdd"
136 55
           v-hasPermi="['oa:budget:add']"
137
-        >新增</el-button>
56
+          >新增</el-button
57
+        >
138 58
       </el-col>
139 59
       <el-col :span="1.5">
140 60
         <el-button
@@ -145,7 +65,8 @@
145 65
           :disabled="single"
146 66
           @click="handleUpdate"
147 67
           v-hasPermi="['oa:budget:edit']"
148
-        >修改</el-button>
68
+          >修改</el-button
69
+        >
149 70
       </el-col>
150 71
       <el-col :span="1.5">
151 72
         <el-button
@@ -156,7 +77,8 @@
156 77
           :disabled="multiple"
157 78
           @click="handleDelete"
158 79
           v-hasPermi="['oa:budget:remove']"
159
-        >删除</el-button>
80
+          >删除</el-button
81
+        >
160 82
       </el-col>
161 83
       <el-col :span="1.5">
162 84
         <el-button
@@ -166,16 +88,26 @@
166 88
           size="mini"
167 89
           @click="handleExport"
168 90
           v-hasPermi="['oa:budget:export']"
169
-        >导出</el-button>
91
+          >导出</el-button
92
+        >
170 93
       </el-col>
171 94
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
172 95
     </el-row>
173 96
 
174
-    <el-table v-loading="loading" :data="budgetList" @selection-change="handleSelectionChange">
97
+    <el-table
98
+      v-loading="loading"
99
+      :data="budgetList"
100
+      @selection-change="handleSelectionChange"
101
+    >
175 102
       <el-table-column type="selection" width="55" align="center" />
176 103
       <!-- <el-table-column label="预算id" align="center" prop="budgetId" /> -->
177 104
       <el-table-column label="项目编号" align="center" prop="project.projectNumber" />
178
-      <el-table-column label="项目名称" align="center" prop="project.projectName" />
105
+      <el-table-column
106
+        label="项目名称"
107
+        align="center"
108
+        prop="project.projectName"
109
+        width="200px"
110
+      />
179 111
       <el-table-column label="人员成本" align="center" prop="staffCost" />
180 112
       <el-table-column label="车辆成本" align="center" prop="carCost" />
181 113
       <el-table-column label="设备成本" align="center" prop="deviceCost" />
@@ -191,26 +123,35 @@
191 123
       <el-table-column label="审核人" align="center" prop="auditorUser.nickName" />
192 124
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
193 125
         <template slot-scope="scope">
194
-          <el-button
126
+          <!-- <el-button
195 127
             size="mini"
196 128
             type="text"
197 129
             icon="el-icon-edit"
198 130
             @click="handleUpdate(scope.row)"
199 131
             v-hasPermi="['oa:budget:edit']"
200
-          >修改</el-button>
132
+            >修改</el-button
133
+          > -->
201 134
           <el-button
135
+            size="mini"
136
+            type="text"
137
+            icon="el-icon-view"
138
+            @click="handleDetails(scope.row)"
139
+            >详情</el-button
140
+          >
141
+          <!-- <el-button
202 142
             size="mini"
203 143
             type="text"
204 144
             icon="el-icon-delete"
205 145
             @click="handleDelete(scope.row)"
206 146
             v-hasPermi="['oa:budget:remove']"
207
-          >删除</el-button>
147
+            >删除</el-button
148
+          > -->
208 149
         </template>
209 150
       </el-table-column>
210 151
     </el-table>
211
-    
152
+
212 153
     <pagination
213
-      v-show="total>0"
154
+      v-show="total > 0"
214 155
       :total="total"
215 156
       :page.sync="queryParams.pageNum"
216 157
       :limit.sync="queryParams.pageSize"
@@ -268,14 +209,27 @@
268 209
         <el-button @click="cancel">取 消</el-button>
269 210
       </div>
270 211
     </el-dialog>
212
+    <!-- 预算详情 -->
213
+    <el-dialog :title="title" :visible.sync="detailsOpen" width="1000px" append-to-body>
214
+      
215
+    </el-dialog>
271 216
   </div>
272 217
 </template>
273 218
 
274 219
 <script>
275
-import { listBudget, getBudget, delBudget, addBudget, submitBudget, updateBudget } from "@/api/oa/budget/budget";
276
-
220
+import {
221
+  listBudget,
222
+  getBudget,
223
+  delBudget,
224
+  addBudget,
225
+  submitBudget,
226
+  updateBudget,
227
+} from "@/api/oa/budget/budget";
228
+import { listProject } from "@/api/oa/project/project";
229
+import budgetTable from './components/budgetTable.vue';
277 230
 export default {
278 231
   name: "Budget",
232
+  components:{ budgetTable }, 
279 233
   data() {
280 234
     return {
281 235
       // 遮罩层
@@ -318,12 +272,14 @@ export default {
318 272
       // 表单参数
319 273
       form: {},
320 274
       // 表单校验
321
-      rules: {
322
-      }
275
+      rules: {},
276
+      projectList: [],
277
+      detailsOpen: false,
323 278
     };
324 279
   },
325 280
   created() {
326 281
     this.getList();
282
+    this.getProjectList();
327 283
   },
328 284
   methods: {
329 285
     /** 查询cmc预算管理列表 */
@@ -331,10 +287,19 @@ export default {
331 287
       this.loading = true;
332 288
       listBudget(this.queryParams).then(response => {
333 289
         this.budgetList = response.rows;
290
+        console.log(this.budgetList);
334 291
         this.total = response.total;
335 292
         this.loading = false;
336 293
       });
337 294
     },
295
+    getProjectList() {
296
+      listProject({
297
+        pageNum: 1,
298
+        pageSize: 99999999,
299
+      }).then(response => {
300
+        this.projectList = response.rows;
301
+      });
302
+    },
338 303
     // 取消按钮
339 304
     cancel() {
340 305
       this.open = false;
@@ -358,7 +323,7 @@ export default {
358 323
         totalBudget: null,
359 324
         compiler: null,
360 325
         auditor: null,
361
-        createTime: null
326
+        createTime: null,
362 327
       };
363 328
       this.resetForm("form");
364 329
     },
@@ -374,27 +339,33 @@ export default {
374 339
     },
375 340
     // 多选框选中数据
376 341
     handleSelectionChange(selection) {
377
-      this.ids = selection.map(item => item.budgetId)
378
-      this.single = selection.length!==1
379
-      this.multiple = !selection.length
342
+      this.ids = selection.map(item => item.budgetId);
343
+      this.single = selection.length !== 1;
344
+      this.multiple = !selection.length;
380 345
     },
381 346
     /** 新增按钮操作 */
382 347
     handleAdd() {
383 348
       // this.reset();
384 349
       // this.open = true;
385 350
       // this.title = "添加cmc预算管理";
386
-      this.$router.push({ path: '/budget/add' })
351
+      this.$router.push({ path: "/budget/add" });
387 352
     },
388 353
     /** 修改按钮操作 */
389 354
     handleUpdate(row) {
390 355
       this.reset();
391
-      const budgetId = row.budgetId || this.ids
356
+      const budgetId = row.budgetId || this.ids;
392 357
       getBudget(budgetId).then(response => {
393 358
         this.form = response.data;
394 359
         this.open = true;
395 360
         this.title = "修改cmc预算管理";
396 361
       });
397 362
     },
363
+    // 详情按钮
364
+    handleDetails(row) {
365
+      this.detailsOpen = true;
366
+      console.log(row);
367
+      this.title = row.project.projectNumber + "预算详情";
368
+    },
398 369
     /** 提交按钮 */
399 370
     submitForm() {
400 371
       this.$refs["form"].validate(valid => {
@@ -418,19 +389,27 @@ export default {
418 389
     /** 删除按钮操作 */
419 390
     handleDelete(row) {
420 391
       const budgetIds = row.budgetId || this.ids;
421
-      this.$modal.confirm('是否确认删除cmc预算管理编号为"' + budgetIds + '"的数据项?').then(function() {
422
-        return delBudget(budgetIds);
423
-      }).then(() => {
424
-        this.getList();
425
-        this.$modal.msgSuccess("删除成功");
426
-      }).catch(() => {});
392
+      this.$modal
393
+        .confirm('是否确认删除cmc预算管理编号为"' + budgetIds + '"的数据项?')
394
+        .then(function () {
395
+          return delBudget(budgetIds);
396
+        })
397
+        .then(() => {
398
+          this.getList();
399
+          this.$modal.msgSuccess("删除成功");
400
+        })
401
+        .catch(() => {});
427 402
     },
428 403
     /** 导出按钮操作 */
429 404
     handleExport() {
430
-      this.download('oa/budget/export', {
431
-        ...this.queryParams
432
-      }, `budget_${new Date().getTime()}.xlsx`)
433
-    }
434
-  }
405
+      this.download(
406
+        "oa/budget/export",
407
+        {
408
+          ...this.queryParams,
409
+        },
410
+        `budget_${new Date().getTime()}.xlsx`
411
+      );
412
+    },
413
+  },
435 414
 };
436 415
 </script>

Laden…
Annuleren
Opslaan