瀏覽代碼

修改预算撤回、更新等操作

余思翰 1 年之前
父節點
當前提交
0b10ff8afc

+ 2
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBudgetCarMapper.xml 查看文件

20
 
20
 
21
     <resultMap type="CmcCar" id="CmcCarResult">
21
     <resultMap type="CmcCar" id="CmcCarResult">
22
         <result property="carId"    column="car_id"    />
22
         <result property="carId"    column="car_id"    />
23
+        <result property="brand"    column="brand"    />
23
         <result property="licensePlate"    column="license_plate"    />
24
         <result property="licensePlate"    column="license_plate"    />
24
         <result property="driver"    column="driver"    />
25
         <result property="driver"    column="driver"    />
25
         <result property="dayCost"    column="day_cost"    />
26
         <result property="dayCost"    column="day_cost"    />
31
     </resultMap>
32
     </resultMap>
32
 
33
 
33
     <sql id="selectCmcBudgetCarVo">
34
     <sql id="selectCmcBudgetCarVo">
34
-        select bc.budget_car_id, bc.budget_id, bc.car_id, c.license_plate, c.driver, u.nick_name, c.day_cost, bc.days, bc.depreciation, bc.distance, bc.mileage, bc.expense, bc.remark from cmc_budget_car as bc
35
+        select bc.budget_car_id, bc.budget_id, bc.car_id, c.license_plate, c.driver, c.brand, u.nick_name, c.day_cost, bc.days, bc.depreciation, bc.distance, bc.mileage, bc.expense, bc.remark from cmc_budget_car as bc
35
         left join cmc_car as c on c.car_id = bc.car_id
36
         left join cmc_car as c on c.car_id = bc.car_id
36
         left join sys_user as u on c.driver = u.user_id
37
         left join sys_user as u on c.driver = u.user_id
37
     </sql>
38
     </sql>

+ 2
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBudgetStaffMapper.xml 查看文件

17
 
17
 
18
     <resultMap type="SysUser" id="SysUserResult">
18
     <resultMap type="SysUser" id="SysUserResult">
19
         <result property="userId"    column="user_id"    />
19
         <result property="userId"    column="user_id"    />
20
+        <result property="deptId"    column="dept_id"    />
20
         <result property="nickName"    column="nick_name"    />
21
         <result property="nickName"    column="nick_name"    />
21
         <result property="postLevel"    column="post_level"    />
22
         <result property="postLevel"    column="post_level"    />
22
         <result property="salaryLevel"    column="salary_level"    />
23
         <result property="salaryLevel"    column="salary_level"    />
30
     </resultMap>
31
     </resultMap>
31
 
32
 
32
     <sql id="selectCmcBudgetStaffVo">
33
     <sql id="selectCmcBudgetStaffVo">
33
-        select bs.budget_staff_id, bs.budget_id, bs.user_id, u.nick_name, bs.days, ps.salary, bs.staff_cost, bs.remark from cmc_budget_staff as bs
34
+        select bs.budget_staff_id, bs.budget_id, bs.user_id, u.dept_id, u.nick_name, bs.days, ps.salary, bs.staff_cost, bs.remark from cmc_budget_staff as bs
34
         left join sys_user as u on u.user_id = bs.user_id
35
         left join sys_user as u on u.user_id = bs.user_id
35
         left join cmc_post_salary as ps on u.salary_level = ps.salary_level and u.post_level = ps.post_level
36
         left join cmc_post_salary as ps on u.salary_level = ps.salary_level and u.post_level = ps.post_level
36
     </sql>
37
     </sql>

+ 278
- 177
oa-back/sql/cmc_oa(小余测试数据).sql
文件差異過大導致無法顯示
查看文件


二進制
oa-ui/src/assets/images/login.jpg 查看文件


+ 110
- 20
oa-ui/src/views/flowable/form/budget/addBudget.vue 查看文件

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-03-25 15:05:59
3
  * @Date: 2024-03-25 15:05:59
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-06-11 18:20:03
5
+ * @LastEditTime: 2024-06-12 16:03:19
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div>
8
   <div>
9
     <div>
9
     <div>
10
+        <el-alert v-if="reBackDescription != ''" title="预算被退回" type="warning" show-icon
11
+          :description="reBackDescription">
12
+        </el-alert>
10
       <div class="header">
13
       <div class="header">
11
-        <!-- <div class="back">
12
-        <el-button type="primary" plain @click="goBack">返回</el-button>
13
-      </div> -->
14
         <div class="title">
14
         <div class="title">
15
           <div class="title-text">新增预算</div>
15
           <div class="title-text">新增预算</div>
16
           <div class="title-tips">
16
           <div class="title-tips">
135
                 </tr>
135
                 </tr>
136
                 <tr v-for="user in chooseUser" :key="user.userId">
136
                 <tr v-for="user in chooseUser" :key="user.userId">
137
                   <td>{{ user.nickName }}</td>
137
                   <td>{{ user.nickName }}</td>
138
-                  <td>{{ user.dept.deptName }}</td>
138
+                  <td>{{ user.dept ? user.dept.deptName : user.deptName }}</td>
139
                   <td>{{ 1780 }}</td>
139
                   <td>{{ 1780 }}</td>
140
                   <td>{{ user.salary.salary }}</td>
140
                   <td>{{ user.salary.salary }}</td>
141
                   <td>{{ parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) }}</td>
141
                   <td>{{ parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) }}</td>
260
             <el-breadcrumb-item>¥ {{ budgetForm.fixCost }}</el-breadcrumb-item>
260
             <el-breadcrumb-item>¥ {{ budgetForm.fixCost }}</el-breadcrumb-item>
261
           </el-breadcrumb>
261
           </el-breadcrumb>
262
           <el-form>
262
           <el-form>
263
-            <choose-money :workList="workList" :chooseUser="chooseUser" :budgetForm="budgetForm" @getSettle="getSettle"
264
-              @getWorkList="setPreSettlement"></choose-money>
263
+            <choose-money :workList="workList" :settleList="contentList" :chooseUser="chooseUser"
264
+              :budgetForm="budgetForm" @getSettle="getSettle" @getWorkList="setPreSettlement"></choose-money>
265
             <el-form-item label="关联合同:" label-width="90px" v-if="contract.contractId">
265
             <el-form-item label="关联合同:" label-width="90px" v-if="contract.contractId">
266
               <table border="1">
266
               <table border="1">
267
                 <tr class="head">
267
                 <tr class="head">
363
             <el-breadcrumb-item>直接成本小计</el-breadcrumb-item>
363
             <el-breadcrumb-item>直接成本小计</el-breadcrumb-item>
364
             <el-breadcrumb-item>¥ {{ budgetForm.directExpense }}</el-breadcrumb-item>
364
             <el-breadcrumb-item>¥ {{ budgetForm.directExpense }}</el-breadcrumb-item>
365
           </el-breadcrumb>
365
           </el-breadcrumb>
366
-          <budget-table :budgetForm="budgetForm" :projectForm="projectForm"  @getTotal="getTotalBudget"></budget-table>
366
+          <budget-table :budgetForm="budgetForm" :projectForm="projectForm" @getTotal="getTotalBudget"></budget-table>
367
         </div>
367
         </div>
368
         <div class="finish" v-show="activeStep == 4">
368
         <div class="finish" v-show="activeStep == 4">
369
           <el-result icon="success" title="成功提示" subTitle="预算表生成完成">
369
           <el-result icon="success" title="成功提示" subTitle="预算表生成完成">
447
 import chooseDevice from "./components/chooseDevice.vue";
447
 import chooseDevice from "./components/chooseDevice.vue";
448
 import chooseMoney from "./components/chooseMoney.vue";
448
 import chooseMoney from "./components/chooseMoney.vue";
449
 import budgetTable from "./components/budgetTable.vue";
449
 import budgetTable from "./components/budgetTable.vue";
450
-import { addBudget } from "@/api/oa/budget/budget.js";
451
-import { addBudgetStaff } from "@/api/oa/budget/budgetStaff.js";
452
-import { addBudgetCar } from "@/api/oa/budget/budgetCar.js";
453
-import { addBudgetDevice } from "@/api/oa/budget/budgetDevice.js";
454
-import { addBudgetSettle } from "@/api/oa/budget/budgetSettle.js";
450
+import { listBudget, addBudget, updateBudget, delBudget } from "@/api/oa/budget/budget.js";
451
+import { listBudgetStaff, addBudgetStaff, delBudgetStaff } from "@/api/oa/budget/budgetStaff.js";
452
+import { listBudgetCar, addBudgetCar, delBudgetCar } from "@/api/oa/budget/budgetCar.js";
453
+import { listBudgetDevice, addBudgetDevice, delBudgetDevice } from "@/api/oa/budget/budgetDevice.js";
454
+import { listBudgetSettle, addBudgetSettle, delBudgetSettle } from "@/api/oa/budget/budgetSettle.js";
455
 import { Snowflake } from "@/utils/snowFlake.js";
455
 import { Snowflake } from "@/utils/snowFlake.js";
456
 import budgetForm from "./components/budgetForm.vue";
456
 import budgetForm from "./components/budgetForm.vue";
457
+import { flowRecordFull } from "@/api/flowable/finished";
457
 import {
458
 import {
458
   complete,
459
   complete,
459
   rejectTask,
460
   rejectTask,
532
       openDevice: false,
533
       openDevice: false,
533
       chooseCar: [],
534
       chooseCar: [],
534
       chooseDevice: [],
535
       chooseDevice: [],
535
-      contract:{}
536
+      contentList: [],
537
+      contract: {},
538
+      reBackDescription: "",
539
+      flag: false,
536
     };
540
     };
537
   },
541
   },
538
   created() {
542
   created() {
540
     this.getProjectContract();
544
     this.getProjectContract();
541
     this.getProjectWorkList();
545
     this.getProjectWorkList();
542
   },
546
   },
547
+  mounted() {
548
+    this.initBudgetForm();
549
+    this.getAlter();
550
+  },
543
   methods: {
551
   methods: {
552
+    getAlter() {
553
+      const params = { procInsId: this.taskForm.procInsId, deployId: this.taskForm.deployId }
554
+      flowRecordFull(params).then(res => {
555
+        if(res.data.flowList)
556
+          this.reBackDescription = res.data.flowList[1].comment.type + ':' + res.data.flowList[1].comment.comment
557
+      })
558
+    },
559
+    // 初始化预算表,先从后台查询是否有数据
560
+    initBudgetForm() {
561
+      listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(res => {
562
+        if (res.rows[0] && res.rows[0].budgetId) {
563
+          this.flag = true
564
+          this.budgetForm = res.rows[0];
565
+          const budgetId = res.rows[0].budgetId
566
+          return Promise.all([
567
+            listBudgetCar({ budgetId }),
568
+            listBudgetDevice({ budgetId }),
569
+            listBudgetSettle({ budgetId }),
570
+            listBudgetStaff({ budgetId }),
571
+          ]);
572
+        }
573
+      }).then(([response1, response2, response3, response4]) => {
574
+        if (response1.rows) {
575
+          this.chooseCar = response1.rows
576
+          for (let car of this.chooseCar) {
577
+            car.licensePlate = car.car.licensePlate
578
+            car.dayCost = car.car.dayCost
579
+            car.brand = car.car.brand
580
+          }
581
+        }
582
+        if (response2.rows) {
583
+          this.chooseDevice = response2.rows;
584
+          for (let device of this.chooseDevice) {
585
+            device.brand = device.device.brand
586
+            device.dayCost = device.device.dayCost
587
+            device.name = device.device.name
588
+            device.series = device.device.series
589
+          }
590
+        }
591
+        if (response3.rows) {
592
+          this.contentList = response3.rows;
593
+        }
594
+        if (response4.rows) {
595
+          this.chooseUser = response4.rows;
596
+          for (let user of this.chooseUser) {
597
+            user.nickName = this.getUserName(user.userId)
598
+            user.deptName = this.getDeptName(user.user.deptId)
599
+          }
600
+        }
601
+      })
602
+
603
+    },
544
     goBack() {
604
     goBack() {
545
       let obj = { path: "/budget/add" };
605
       let obj = { path: "/budget/add" };
546
       this.$tab.closeOpenPage(obj);
606
       this.$tab.closeOpenPage(obj);
556
     getProjectContract() {
616
     getProjectContract() {
557
       listProjectContract({ projectId: this.taskForm.formId }).then(res => {
617
       listProjectContract({ projectId: this.taskForm.formId }).then(res => {
558
         if (res.rows) {
618
         if (res.rows) {
559
-          if(res.rows.length == 1){
560
-            getContract(res.rows[0].contractId).then(result=>{
619
+          if (res.rows.length == 1) {
620
+            getContract(res.rows[0].contractId).then(result => {
561
               if (result.data) {
621
               if (result.data) {
562
                 this.contract = result.data;
622
                 this.contract = result.data;
563
                 this.budgetForm.contract = result.data;
623
                 this.budgetForm.contract = result.data;
594
         this.activeStep += 1;
654
         this.activeStep += 1;
595
         this.calculateThatCost();
655
         this.calculateThatCost();
596
       } else if (this.activeStep == 3) {
656
       } else if (this.activeStep == 3) {
597
-        this.addBudgetForm(this.budgetForm);
657
+        if (this.flag) {
658
+          this.updateBudgetForm(this.budgetForm)
659
+        } else {
660
+          this.addBudgetForm(this.budgetForm);
661
+        }
598
         this.activeStep += 1;
662
         this.activeStep += 1;
599
       } else {
663
       } else {
600
         this.activeStep += 1;
664
         this.activeStep += 1;
606
     },
670
     },
607
     getChooseCar(val) {
671
     getChooseCar(val) {
608
       this.chooseCar = val;
672
       this.chooseCar = val;
609
-      for(let car of this.chooseCar){
673
+      for (let car of this.chooseCar) {
610
         car.mileage = 1.5
674
         car.mileage = 1.5
611
       }
675
       }
612
       this.openCar = false;
676
       this.openCar = false;
700
       }
764
       }
701
       for (let work of form.contentList) {
765
       for (let work of form.contentList) {
702
         work.budgetId = form.budgetId;
766
         work.budgetId = form.budgetId;
703
-        addBudgetSettle(work).then(res=>{
767
+        addBudgetSettle(work).then(res => {
704
           this.$message.success('预算添加成功')
768
           this.$message.success('预算添加成功')
705
         })
769
         })
706
       }
770
       }
707
     },
771
     },
772
+    updateBudgetForm(form) {
773
+      updateBudget(form);
774
+      delBudgetStaff(form.budgetId).then(res => {
775
+        for (let user of form.chooseUser) {
776
+
777
+          addBudgetStaff(user);
778
+        }
779
+      });
780
+      delBudgetCar(form.budgetId).then(res => {
781
+        for (let car of form.chooseCar) {
782
+          addBudgetCar(car);
783
+        }
784
+      })
785
+      delBudgetDevice(form.budgetId).then(res => {
786
+        for (let device of form.chooseDevice) {
787
+          addBudgetDevice(device);
788
+        }
789
+      })
790
+      delBudgetSettle(form.budgetId).then(res => {
791
+        for (let work of form.contentList) {
792
+          addBudgetSettle(work)
793
+        }
794
+        this.$message.success('预算添加成功')
795
+      })
796
+    },
708
     calculateThatCost() {
797
     calculateThatCost() {
709
       let staffCost = 0;
798
       let staffCost = 0;
710
       let carCost = 0;
799
       let carCost = 0;
810
     padding: 3px;
899
     padding: 3px;
811
   }
900
   }
812
 }
901
 }
813
-.head{
902
+
903
+.head {
814
   font-weight: bold;
904
   font-weight: bold;
815
 }
905
 }
816
 
906
 

+ 393
- 24
oa-ui/src/views/flowable/form/budget/budgetInfo.vue 查看文件

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-04-03 16:28:09
3
  * @Date: 2024-04-03 16:28:09
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-06-05 10:27:53
5
+ * @LastEditTime: 2024-06-12 18:26:04
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div class="main">
8
   <div class="main">
9
+    <div v-if="taskName == '预算审核'">
10
+      <h2 class="text-center">项目信息</h2>
11
+      <el-descriptions :column="3" border class="descriptions">
12
+        <el-descriptions-item label="项目编号">
13
+          {{ projectForm.projectNumber }}
14
+        </el-descriptions-item>
15
+        <el-descriptions-item label="项目名称">
16
+          {{ projectForm.projectName }}
17
+        </el-descriptions-item>
18
+        <el-descriptions-item label="项目负责人">
19
+          {{ getUserName(projectForm.projectLeader) }}
20
+        </el-descriptions-item>
21
+        <el-descriptions-item label="项目备注" :span="3">
22
+          {{ projectForm.remark }}
23
+        </el-descriptions-item>
24
+        <el-descriptions-item label="项目概况">
25
+          <div>
26
+            <table border="1" style="width: 100%;">
27
+              <tr>
28
+                <td style="width: 250px">工作内容</td>
29
+                <td style="width: 100px">等级或比例尺</td>
30
+                <td style="width: 100px">单位</td>
31
+                <td style="width: 100px">工作量</td>
32
+                <td style="width: 100px">要求完成时间</td>
33
+                <td style="width: 200px">备注</td>
34
+              </tr>
35
+              <tr v-for="(work, index) in workContentList" :key="index">
36
+                <td>
37
+                  {{ work.content }}
38
+                </td>
39
+                <td>
40
+                  {{ work.scale }}
41
+                </td>
42
+                <td>
43
+                  {{ work.unit }}
44
+                </td>
45
+                <td>
46
+                  {{ work.workload }}
47
+                </td>
48
+                <td>
49
+                  {{ work.deadline }}
50
+                </td>
51
+                <td>
52
+                  {{ work.remark }}
53
+                </td>
54
+              </tr>
55
+            </table>
56
+          </div>
57
+        </el-descriptions-item>
58
+      </el-descriptions>
59
+    </div>
9
     <h2 style="text-align: center">项目直接生产成本预算表</h2>
60
     <h2 style="text-align: center">项目直接生产成本预算表</h2>
10
     <p style="text-align: center;">编制人:{{ budgetForm.compilerUser ? budgetForm.compilerUser.nickName : '' }}</p>
61
     <p style="text-align: center;">编制人:{{ budgetForm.compilerUser ? budgetForm.compilerUser.nickName : '' }}</p>
11
-    <table border="1" class="table">
62
+    <table border="1" class="table" v-if="taskName == '预算审核'">
63
+      <tr>
64
+        <td style="width: 100px;">项目名称</td>
65
+        <td colspan="6">{{ budgetForm.project ? budgetForm.project.projectName : '' }}</td>
66
+        <td style="min-width: 100px;">项目编号</td>
67
+        <td colspan="1">{{ budgetForm.project ? budgetForm.project.projectNumber : '' }}</td>
68
+      </tr>
69
+      <tr>
70
+        <td :rowspan="workLen + 2">直接成本</td>
71
+        <td>工作简述</td>
72
+        <td>工作内容</td>
73
+        <td>数量</td>
74
+        <td>单价</td>
75
+        <td>单位</td>
76
+        <td>系数</td>
77
+        <td>金额</td>
78
+        <td style="min-width: 150px;">备注</td>
79
+      </tr>
80
+      <tr v-for="work in workList">
81
+        <td>{{ work.content }}</td>
82
+        <td>{{ work.cmcPrice ? work.cmcPrice.workItem : '' }}</td>
83
+        <td>
84
+          <el-input-number :controls="false" style="width:100px;" v-model="work.workload"
85
+            @change="computeWorkSettle(work)"></el-input-number>
86
+        </td>
87
+        <td>{{ work.price }}</td>
88
+        <td>{{ work.unit }}</td>
89
+        <td>
90
+          <el-input-number :controls="false" style="width:100px;" v-model="work.coefficient"
91
+            @change="computeWorkSettle(work)"></el-input-number>
92
+          <el-button type="text" @click="getCoefficientRemark(work)">系数备注</el-button>
93
+        </td>
94
+        <td>{{ work.settle }}</td>
95
+        <td>{{ work.remark ? work.remark : '' }}</td>
96
+      </tr>
97
+      <tr>
98
+        <td :colspan="6" class="head">直接成本合计</td>
99
+        <td :colspan="1" class="head">{{ budgetForm.settleExpense }}</td>
100
+        <td></td>
101
+      </tr>
102
+      <tr>
103
+        <td :rowspan="userLen + carLen + deviceLen + 2">间接成本</td>
104
+      </tr>
105
+      <tr v-if="userLen != 1">
106
+        <td :rowspan="userLen">人员</td>
107
+        <td>姓名</td>
108
+        <td>基本工资</td>
109
+        <td>岗位工资</td>
110
+        <td>人员成本(天)</td>
111
+        <td>预算天数</td>
112
+        <td>金额</td>
113
+        <td></td>
114
+      </tr>
115
+      <tr v-for="user in chooseUser" :key="'user' + user.userId">
116
+        <td>{{ user.user ? user.user.nickName : '' }}</td>
117
+        <td>1780</td>
118
+        <td>{{ user.salary.salary }}</td>
119
+        <td>{{ parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) }}</td>
120
+        <td>
121
+          <el-input-number :controls="false" style="width:100px;" v-model="user.days"
122
+            @blur="computedFixCostSettle(user, 'user')"></el-input-number>
123
+        </td>
124
+        <td>{{ user.staffCost }}</td>
125
+        <td></td>
126
+      </tr>
127
+      <tr v-if="carLen != 1">
128
+        <td :rowspan="carLen">车辆</td>
129
+        <td>车牌号</td>
130
+        <td>油耗</td>
131
+        <td>总里程</td>
132
+        <td>折旧成天(天)</td>
133
+        <td>预算天数</td>
134
+        <td>金额</td>
135
+      </tr>
136
+      <tr v-for="car in chooseCar" :key="'car' + car.carId">
137
+        <td>{{ car.car ? car.car.licensePlate : '' }}</td>
138
+        <td>{{ car.mileage }}</td>
139
+        <td>
140
+          <el-input-number :controls="false" style="width:100px;" v-model="car.distance"
141
+            @blur="computedFixCostSettle(car, 'car')"></el-input-number>
142
+        </td>
143
+        <td>{{ car.car ? car.car.dayCost : '' }}</td>
144
+        <td>
145
+          <el-input-number :controls="false" style="width:100px;" v-model="car.days"
146
+            @blur="computedFixCostSettle(car, 'car')"></el-input-number>
147
+        </td>
148
+        <td>{{ car.expense }}</td>
149
+        <td></td>
150
+      </tr>
151
+      <tr v-if="deviceLen != 1">
152
+        <td :rowspan="deviceLen">设备</td>
153
+        <td>设备名称</td>
154
+        <td>规格型号</td>
155
+        <td>品牌</td>
156
+        <td>折旧成本(天)</td>
157
+        <td>预算天数</td>
158
+        <td>金额</td>
159
+      </tr>
160
+      <tr v-for="device in chooseDevice" :key="'device' + device.deviceId">
161
+        <td>{{ device.device ? device.device.name : '' }}</td>
162
+        <td>{{ device.device ? device.device.series : '' }}</td>
163
+        <td>{{ device.device ? device.device.brand : '' }}</td>
164
+        <td>{{ device.device ? device.device.dayCost : '' }}</td>
165
+        <td>
166
+          <el-input-number :controls="false" style="width:100px;" v-model="device.days"
167
+            @blur="computedFixCostSettle(device, 'device')"></el-input-number>
168
+        </td>
169
+        <td>{{ device.depreciation }}</td>
170
+        <td></td>
171
+      </tr>
172
+      <tr>
173
+        <td :colspan="6" class="head">间接成本合计</td>
174
+        <td :colspan="1" class="head">{{ budgetForm.fixCost }}</td>
175
+        <td></td>
176
+      </tr>
177
+      <tr class="head">
178
+        <td :colspan="3">外协费用</td>
179
+        <td :colspan="5">
180
+          <el-input-number :controls="false" style="width:100%;" v-model="budgetForm.outExpense"
181
+            @blur="computedDirectExpense()"></el-input-number>
182
+        </td>
183
+        <td>
184
+          <el-input type="textarea" v-model="budgetForm.outRemark"></el-input>
185
+        </td>
186
+      </tr>
187
+      <tr class="head">
188
+        <td colspan="3">车船租赁</td>
189
+        <td :colspan="5">
190
+          <el-input-number :controls="false" style="width:100%;" v-model="budgetForm.rentExpense"
191
+            @blur="computedDirectExpense()"></el-input-number>
192
+        </td>
193
+        <td>
194
+          <el-input type="textarea" v-model="budgetForm.rentRemark"></el-input>
195
+        </td>
196
+      </tr>
197
+      <tr class="head">
198
+        <td colspan="3">其他费用</td>
199
+        <td :colspan="5">
200
+          <el-input-number :controls="false" style="width:100%;" v-model="budgetForm.otherExpense"
201
+            @blur="computedDirectExpense()"></el-input-number>
202
+        </td>
203
+        <td>
204
+          <el-input type="textarea" v-model="budgetForm.otherRemark"></el-input>
205
+        </td>
206
+      </tr>
207
+      <tr class="head">
208
+        <td colspan="3">税费成本</td>
209
+        <td :colspan="5">
210
+          <el-input-number :controls="false" style="width:100%;" v-model="budgetForm.taxExpense"
211
+            @blur="computedDirectExpense()"></el-input-number>
212
+        </td>
213
+        <td>
214
+          <el-input type="textarea" v-model="budgetForm.taxRemark"></el-input>
215
+        </td>
216
+      </tr>
217
+      <tr class="head">
218
+        <td colspan="3">经营管理费用</td>
219
+        <td :colspan="5">
220
+          <el-input-number :controls="false" style="width:100%;" v-model="budgetForm.businessExpense"
221
+            @blur="computedDirectExpense()"></el-input-number>
222
+        </td>
223
+        <td>
224
+          <el-input type="textarea" v-model="budgetForm.businessRemark"></el-input>
225
+        </td>
226
+      </tr>
227
+      <tr>
228
+        <td colspan="3" class="head">成本合计</td>
229
+        <td colspan="5" class="head">{{ budgetForm.totalBudget }}</td>
230
+      </tr>
231
+      <tr v-if="contract.contractId">
232
+        <td colspan="3" class="head">利润</td>
233
+        <td colspan="2" class="head">{{ profit.toFixed(2) }}</td>
234
+        <td colspan="3" class="head">合同总价约</td>
235
+        <td colspan="1" class="head">{{ contract.contractId ? contract.amount : '' }}</td>
236
+      </tr>
237
+    </table>
238
+    <table border="1" class="table" v-else>
12
       <tr>
239
       <tr>
13
         <td style="width: 100px;">项目名称</td>
240
         <td style="width: 100px;">项目名称</td>
14
         <td colspan="6">{{ budgetForm.project ? budgetForm.project.projectName : '' }}</td>
241
         <td colspan="6">{{ budgetForm.project ? budgetForm.project.projectName : '' }}</td>
54
         <td>金额</td>
281
         <td>金额</td>
55
         <td></td>
282
         <td></td>
56
       </tr>
283
       </tr>
57
-      <tr v-for="user in chooseUser" :key="'user' + user.userId">
284
+      <tr v-for="user, index in chooseUser" :key="'user' + index">
58
         <td>{{ user.user ? user.user.nickName : '' }}</td>
285
         <td>{{ user.user ? user.user.nickName : '' }}</td>
59
         <td>1780</td>
286
         <td>1780</td>
60
         <td>{{ user.salary.salary }}</td>
287
         <td>{{ user.salary.salary }}</td>
72
         <td>预算天数</td>
299
         <td>预算天数</td>
73
         <td>金额</td>
300
         <td>金额</td>
74
       </tr>
301
       </tr>
75
-      <tr v-for="car in chooseCar" :key="'car' + car.carId">
302
+      <tr v-for="car, index in chooseCar" :key="'car' + index">
76
         <td>{{ car.car ? car.car.licensePlate : '' }}</td>
303
         <td>{{ car.car ? car.car.licensePlate : '' }}</td>
77
         <td>{{ car.mileage }}</td>
304
         <td>{{ car.mileage }}</td>
78
         <td>{{ car.distance }}</td>
305
         <td>{{ car.distance }}</td>
90
         <td>预算天数</td>
317
         <td>预算天数</td>
91
         <td>金额</td>
318
         <td>金额</td>
92
       </tr>
319
       </tr>
93
-      <tr v-for="device in chooseDevice" :key="'device' + device.deviceId">
320
+      <tr v-for="device, index in chooseDevice" :key="'device' + index">
94
         <td>{{ device.device ? device.device.name : '' }}</td>
321
         <td>{{ device.device ? device.device.name : '' }}</td>
95
         <td>{{ device.device ? device.device.series : '' }}</td>
322
         <td>{{ device.device ? device.device.series : '' }}</td>
96
         <td>{{ device.device ? device.device.brand : '' }}</td>
323
         <td>{{ device.device ? device.device.brand : '' }}</td>
147
 </template>
374
 </template>
148
 
375
 
149
 <script>
376
 <script>
150
-import { listBudget } from "@/api/oa/budget/budget";
151
-import { listBudgetCar } from "@/api/oa/budget/budgetCar";
152
-import { listBudgetDevice } from "@/api/oa/budget/budgetDevice";
153
-import { listBudgetSettle } from "@/api/oa/budget/budgetSettle";
154
-import { listBudgetStaff } from "@/api/oa/budget/budgetStaff";
377
+import { listBudget,updateBudget } from "@/api/oa/budget/budget";
378
+import { listBudgetCar,updateBudgetCar } from "@/api/oa/budget/budgetCar";
379
+import { listBudgetDevice,updateBudgetDevice } from "@/api/oa/budget/budgetDevice";
380
+import { listBudgetSettle,updateBudgetSettle } from "@/api/oa/budget/budgetSettle";
381
+import { listBudgetStaff,updateBudgetStaff } from "@/api/oa/budget/budgetStaff";
155
 import { listProjectWork } from "@/api/oa/project/projectWork";
382
 import { listProjectWork } from "@/api/oa/project/projectWork";
156
 import { mapGetters } from 'vuex';
383
 import { mapGetters } from 'vuex';
384
+import { getProject } from "@/api/oa/project/project";
157
 import { listProjectContract, addProjectContract } from "@/api/oa/contract/projectContract";
385
 import { listProjectContract, addProjectContract } from "@/api/oa/contract/projectContract";
158
 import { listContract, getContract, delContract, addContract, updateContract } from "@/api/oa/contract/contract";
386
 import { listContract, getContract, delContract, addContract, updateContract } from "@/api/oa/contract/contract";
159
 import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm } from "@/api/flowable/todo";
387
 import { complete, rejectTask, returnList, returnTask, getNextFlowNode, delegate, flowTaskForm } from "@/api/flowable/todo";
160
 import { getUser } from '@/api/system/user'
388
 import { getUser } from '@/api/system/user'
161
 import { getUsersManageLeader } from "@/api/system/post";
389
 import { getUsersManageLeader } from "@/api/system/post";
390
+import { getPriceRemarkByWorkType } from '@/api/oa/price/price'
162
 export default {
391
 export default {
163
   computed: {
392
   computed: {
164
     ...mapGetters(["name", "userId"]),
393
     ...mapGetters(["name", "userId"]),
177
       projectId: '',
406
       projectId: '',
178
       budgetForm: {
407
       budgetForm: {
179
       },
408
       },
180
-      projectForm: {},
409
+      projectForm: {
410
+        projectRegistrantUser: {
411
+          nickName: ''
412
+        }
413
+      },
181
       userLen: 1,
414
       userLen: 1,
182
       carLen: 1,
415
       carLen: 1,
183
       deviceLen: 1,
416
       deviceLen: 1,
233
             }
466
             }
234
             this.getProjectWorkList();
467
             this.getProjectWorkList();
235
           })
468
           })
469
+          this.getProjectList();
236
           listProjectContract({ projectId: this.taskForm.formId }).then(res => {
470
           listProjectContract({ projectId: this.taskForm.formId }).then(res => {
237
             if (res.total == 1) {
471
             if (res.total == 1) {
238
               getContract(res.rows[0].contractId).then(response => {
472
               getContract(res.rows[0].contractId).then(response => {
242
             }
476
             }
243
           })
477
           })
244
         }
478
         }
245
-
479
+      });
480
+    },
481
+    // 查询项目列表
482
+    getProjectList() {
483
+      getProject(this.taskForm.formId).then(response => {
484
+        this.projectForm = response.data;
246
       });
485
       });
247
     },
486
     },
248
     getProjectWorkList() {
487
     getProjectWorkList() {
253
     confirmSucess(taskName) {
492
     confirmSucess(taskName) {
254
       const params = { taskId: this.taskForm.taskId };
493
       const params = { taskId: this.taskForm.taskId };
255
       if (taskName == '预算审核') {
494
       if (taskName == '预算审核') {
256
-        getNextFlowNode(params).then(res => {
257
-          getUsersManageLeader({ userId: this.budgetForm.compiler }).then(res => {
258
-            let userId = res.data.userId;
259
-            this.$set(this.taskForm.variables, "approval", userId);
260
-            complete(this.taskForm).then(response => {
261
-              this.$modal.msgSuccess(response.msg);
262
-              this.$emit("goBack");
263
-            });
264
-          });
265
-        });
495
+        this.updateBudgetForm();
496
+        // getNextFlowNode(params).then(res => {
497
+        //   getUsersManageLeader({ userId: this.budgetForm.compiler }).then(res => {
498
+        //     let userId = res.data.userId;
499
+        //     this.$set(this.taskForm.variables, "approval", userId);
500
+        //     complete(this.taskForm).then(response => {
501
+        //       this.$modal.msgSuccess(response.msg);
502
+        //       this.$emit("goBack");
503
+        //     });
504
+        //   });
505
+        // });
266
       } else if (taskName == '预算批准') {
506
       } else if (taskName == '预算批准') {
267
         getNextFlowNode(params).then(res => {
507
         getNextFlowNode(params).then(res => {
268
           complete(this.taskForm).then(response => {
508
           complete(this.taskForm).then(response => {
271
           });
511
           });
272
         })
512
         })
273
       }
513
       }
274
-
275
-    }
514
+    },
515
+    updateBudgetForm() {
516
+      console.log(this.budgetForm);
517
+      console.log(this.chooseUser);
518
+      console.log(this.chooseDevice);
519
+      console.log(this.chooseCar);
520
+      updateBudget(this.budgetForm);
521
+      for(let car of this.chooseCar){
522
+        updateBudgetCar(car)
523
+      }
524
+      for(let device of this.chooseDevice){
525
+        updateBudgetDevice(device)
526
+      }
527
+      for(let user of this.chooseUser){
528
+        updateBudgetStaff(user)
529
+      }
530
+      for(let work of this.workList){
531
+        updateBudgetSettle(work)
532
+      }
533
+    },
534
+    // 计算作业结算金额
535
+    computeWorkSettle(work) {
536
+      let workload = Number(work.workload);
537
+      let price = Number(work.price);
538
+      let coefficient = Number(work.coefficient);
539
+      if (!isNaN(workload) && !isNaN(price) && !isNaN(coefficient)) {
540
+        let result = workload * price * coefficient;
541
+        this.$set(work, 'settle', result.toFixed(2));
542
+        this.computedSettleExpense();
543
+        this.computedDirectExpense();
544
+      } else {
545
+        this.$message.error('请确保参与计算的值都为数字')
546
+      }
547
+    },
548
+    computedFixCostSettle(item, type) {
549
+      if (type == 'user') {
550
+        let salaryPerDay = (Number(item.salary.salary) + 1780 || 0) / 21.75; // 转换为每天的薪资,或默认为0  
551
+        let totalDays = Number(item.days) || 0; // 转换为天数,或默认为0  
552
+        // 计算总薪资  
553
+        let total = (salaryPerDay * totalDays).toFixed(2);
554
+        this.$set(item, 'staffCost', total);
555
+        this.getCost("staffCost", "staffCost", this.chooseUser);
556
+      } else if (type == 'car') {
557
+        let total1 = (Number(item.mileage) || 0) * (Number(item.distance) || 0);
558
+        let total2 = (Number(item.car.dayCost) || 0) * (Number(item.days) || 0);
559
+        this.$set(item, "depreciation", total2);
560
+        let sum = (total1 + total2).toFixed(2); // sum 是一个字符串  
561
+        this.$set(item, "expense", sum); // expense 将是一个字符串,包含两位小数的总和   
562
+        this.getCost("expense", "carCost", this.chooseCar);
563
+      } else {
564
+        let total = (Number(item.device.dayCost) || 0) * (Number(item.days) || 0);
565
+        this.$set(item, "depreciation", total.toFixed(2));
566
+        this.getCost("depreciation", "deviceCost", this.chooseDevice);
567
+      }
568
+      this.getFixCost();
569
+      this.computedTotalBudget();
570
+    },
571
+    getCost(name1, name2, list) {
572
+      let sum = 0;
573
+      for (let user of list) {
574
+        sum = sum + Number(user[name1]);
575
+      }
576
+      this.budgetForm[name2] = sum.toFixed(2);
577
+    },
578
+    getFixCost() {
579
+      let total =
580
+        Number(this.budgetForm.staffCost) +
581
+        Number(this.budgetForm.carCost) +
582
+        Number(this.budgetForm.deviceCost);
583
+      this.budgetForm.fixCost = total.toFixed(2);
584
+    },
585
+    computedSettleExpense() {
586
+      let sum = this.workList.reduce((accumulator, work) => {
587
+        const settleValue = Number(work.settle);
588
+        // 如果settleValue不是NaN(即它可以被转换为数字)  
589
+        if (!isNaN(settleValue)) {
590
+          return accumulator + settleValue;
591
+        }
592
+        return accumulator;
593
+      }, 0); // 初始累加器值为0  
594
+      this.$set(this.budgetForm, 'settleExpense', sum.toFixed(2))
595
+    },
596
+    computedDirectExpense() {
597
+      const { settleExpense, outExpense, businessExpense, taxExpense, rentExpense, otherExpense } = this.budgetForm;
598
+      const expenses = [settleExpense, outExpense, businessExpense, taxExpense, rentExpense, otherExpense];
599
+      // 使用 reduce 函数计算总和  
600
+      let sum = expenses.reduce((acc, curr) => {
601
+        // 确保每个当前值都是数字(如果不是,则默认为0)  
602
+        const num = Number(curr) || 0;
603
+        return acc + num;
604
+      }, 0);
605
+      this.$set(this.budgetForm, 'directExpense', `${sum.toFixed(2)}`);
606
+      this.computedTotalBudget();
607
+    },
608
+    computedTotalBudget() {
609
+      const { fixCost, directExpense } = this.budgetForm;
610
+      // 确保 fixCost 和 directExpense 是数字,如果不是则默认为 0  
611
+      const totalBudget = (Number(fixCost) || 0) + (Number(directExpense) || 0);
612
+      this.$set(this.budgetForm, 'totalBudget', totalBudget.toFixed(2));
613
+      this.profit = (Number(this.contract.amount) || 0) - (Number(totalBudget) || 0);
614
+    },
615
+    getCoefficientRemark(work) {
616
+      let workType = work.cmcPrice.workType
617
+      getPriceRemarkByWorkType({ workType }).then(res => {
618
+        if (res.code == 200) {
619
+          if (workType != undefined)
620
+            this.$notify({
621
+              title: workType,
622
+              dangerouslyUseHTMLString: true,
623
+              message: res.msg,
624
+              duration: 0
625
+            });
626
+        }
627
+      })
628
+    },
276
   },
629
   },
277
 };
630
 };
278
 </script>
631
 </script>
296
   }
649
   }
297
 }
650
 }
298
 
651
 
652
+.descriptions {
653
+  width: 1200px;
654
+  margin: 0 auto;
655
+}
656
+
299
 .head {
657
 .head {
300
   line-height: 35px;
658
   line-height: 35px;
301
   font-weight: bold;
659
   font-weight: bold;
302
 }
660
 }
661
+
662
+::v-deep .el-descriptions-item__label.is-bordered-label {
663
+  color: #5a5757;
664
+  background: rgba($color: #a9adb3, $alpha: 0.1);
665
+  width: 150px;
666
+  min-width: 150px;
667
+}
668
+
669
+::v-deep .el-descriptions .is-bordered .el-descriptions-item__cell {
670
+  border: 1px solid #cdd0d3;
671
+}
303
 </style>
672
 </style>

+ 44
- 1
oa-ui/src/views/flowable/form/budget/components/chooseMoney.vue 查看文件

139
     budgetForm: {
139
     budgetForm: {
140
       type: Object,
140
       type: Object,
141
       require: true
141
       require: true
142
+    },
143
+    settleList: {
144
+      type: Array
142
     }
145
     }
143
   },
146
   },
144
   data() {
147
   data() {
197
   created() {
200
   created() {
198
     this.getWorkTypeList();
201
     this.getWorkTypeList();
199
   },
202
   },
203
+  watch: {
204
+    settleList(val) {
205
+      this.initContenList();
206
+    }
207
+  },
200
   mounted() {
208
   mounted() {
201
     this.getSettleSum();
209
     this.getSettleSum();
202
   },
210
   },
203
   methods: {
211
   methods: {
212
+    initContenList() {
213
+      if (this.settleList.length != 0) {
214
+        this.contentList = this.settleList;
215
+        for (let c of this.contentList) {
216
+          this.$set(c, 'workSelect', {
217
+            // 项目列表
218
+            projectList: [],
219
+            // 工作类别列表
220
+            workTypeList: [],
221
+            // 工作项目
222
+            workItemList: [],
223
+            // 项目细项
224
+            subItemList: [],
225
+            // 比例尺
226
+            scaleGradeList: [],
227
+            workTypeLoading: true,
228
+            workItemLoading: true,
229
+            subItemLoading: true,
230
+            scaleGradeLoading: true,
231
+          })
232
+          this.$set(c, 'workType', c.cmcPrice.workType)
233
+          this.$set(c, 'scaleGrade', c.cmcPrice.scaleGrade)
234
+          this.$set(c, 'workItem', c.cmcPrice.workItem)
235
+          this.$set(c, 'unit', c.cmcPrice.unit)
236
+          if (c.groundType == '0') {
237
+            this.$set(c, 'price', c.cmcPrice.commonPrice)
238
+          }else{
239
+            this.$set(c, 'price', c.cmcPrice.complexPrice)
240
+          }
241
+          this.getTotal(c)
242
+        }
243
+      }
244
+    },
204
     addWorkList() {
245
     addWorkList() {
205
       this.contentList.push({
246
       this.contentList.push({
206
         content: '',
247
         content: '',
381
     padding: 3px;
422
     padding: 3px;
382
   }
423
   }
383
 }
424
 }
384
-.head{
425
+
426
+.head {
385
   font-weight: bold;
427
   font-weight: bold;
386
 }
428
 }
429
+
387
 .delete-btn {
430
 .delete-btn {
388
   position: absolute;
431
   position: absolute;
389
   left: -30px;
432
   left: -30px;

+ 3
- 2
oa-ui/src/views/login.vue 查看文件

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-01-03 09:23:11
3
  * @Date: 2024-01-03 09:23:11
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-03-05 17:52:02
5
+ * @LastEditTime: 2024-06-12 17:34:58
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <el-row class="login-wrapper">
8
   <el-row class="login-wrapper">
163
   .login-bg {
163
   .login-bg {
164
     flex: 1.8;
164
     flex: 1.8;
165
     min-width: 0%;
165
     min-width: 0%;
166
-    background: url('../assets/images/xizang02.jpg') no-repeat;
166
+    background: url('../assets/images/login.jpg') no-repeat;
167
+    background-size: 100% 100%;
167
     position: relative;
168
     position: relative;
168
   }
169
   }
169
 
170
 

Loading…
取消
儲存