Quellcode durchsuchen

修改新增预算模块,新建预算信息表

余思翰 vor 3 Wochen
Ursprung
Commit
a98b91a1f8
19 geänderte Dateien mit 930 neuen und 287 gelöschten Zeilen
  1. 2
    9
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBudgetOtherController.java
  2. 4
    11
      oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBudgetSiteController.java
  3. 2
    2
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcBudgetSiteMapper.java
  4. 2
    2
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcBudgetSiteService.java
  5. 3
    3
      oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcBudgetSiteServiceImpl.java
  6. 3
    3
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBudgetSiteMapper.xml
  7. 1
    0
      oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBudgetStaffMapper.xml
  8. 50
    0
      oa-ui/src/api/oa/budget/budgetSite.js
  9. 136
    36
      oa-ui/src/views/flowable/form/budget/addBudget.vue
  10. 22
    7
      oa-ui/src/views/flowable/form/budget/adjust/budgetAdjust.vue
  11. 1
    1
      oa-ui/src/views/flowable/form/budget/adjust/components/InnerStaffCost.vue
  12. 1
    8
      oa-ui/src/views/flowable/form/budget/adjust/components/OuterStaffCost.vue
  13. 421
    0
      oa-ui/src/views/flowable/form/budget/adjust/newBudgetInfo.vue
  14. 9
    8
      oa-ui/src/views/flowable/form/budget/carTable.vue
  15. 12
    11
      oa-ui/src/views/flowable/form/budget/deviceTable.vue
  16. 1
    1
      oa-ui/src/views/flowable/form/budget/moneyTable.vue
  17. 20
    2
      oa-ui/src/views/flowable/form/budget/otherTable.vue
  18. 224
    176
      oa-ui/src/views/flowable/form/budget/siteExpenses.vue
  19. 16
    7
      oa-ui/src/views/flowable/form/budget/staffTable.vue

+ 2
- 9
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBudgetOtherController.java Datei anzeigen

1
-package com.ruoyi.oa.controller;
1
+package com.ruoyi.web.controller.oa;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
5
-import org.springframework.security.access.prepost.PreAuthorize;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
7
 import org.springframework.web.bind.annotation.GetMapping;
6
 import org.springframework.web.bind.annotation.GetMapping;
8
 import org.springframework.web.bind.annotation.PostMapping;
7
 import org.springframework.web.bind.annotation.PostMapping;
37
     /**
36
     /**
38
      * 查询cmc预算外开支列表
37
      * 查询cmc预算外开支列表
39
      */
38
      */
40
-    @PreAuthorize("@ss.hasPermi('oa:other:list')")
41
     @GetMapping("/list")
39
     @GetMapping("/list")
42
     public TableDataInfo list(CmcBudgetOther cmcBudgetOther)
40
     public TableDataInfo list(CmcBudgetOther cmcBudgetOther)
43
     {
41
     {
49
     /**
47
     /**
50
      * 导出cmc预算外开支列表
48
      * 导出cmc预算外开支列表
51
      */
49
      */
52
-    @PreAuthorize("@ss.hasPermi('oa:other:export')")
53
     @Log(title = "cmc预算外开支", businessType = BusinessType.EXPORT)
50
     @Log(title = "cmc预算外开支", businessType = BusinessType.EXPORT)
54
     @PostMapping("/export")
51
     @PostMapping("/export")
55
     public void export(HttpServletResponse response, CmcBudgetOther cmcBudgetOther)
52
     public void export(HttpServletResponse response, CmcBudgetOther cmcBudgetOther)
62
     /**
59
     /**
63
      * 获取cmc预算外开支详细信息
60
      * 获取cmc预算外开支详细信息
64
      */
61
      */
65
-    @PreAuthorize("@ss.hasPermi('oa:other:query')")
66
     @GetMapping(value = "/{expenseId}")
62
     @GetMapping(value = "/{expenseId}")
67
     public AjaxResult getInfo(@PathVariable("expenseId") Long expenseId)
63
     public AjaxResult getInfo(@PathVariable("expenseId") Long expenseId)
68
     {
64
     {
72
     /**
68
     /**
73
      * 新增cmc预算外开支
69
      * 新增cmc预算外开支
74
      */
70
      */
75
-    @PreAuthorize("@ss.hasPermi('oa:other:add')")
76
     @Log(title = "cmc预算外开支", businessType = BusinessType.INSERT)
71
     @Log(title = "cmc预算外开支", businessType = BusinessType.INSERT)
77
     @PostMapping
72
     @PostMapping
78
     public AjaxResult add(@RequestBody CmcBudgetOther cmcBudgetOther)
73
     public AjaxResult add(@RequestBody CmcBudgetOther cmcBudgetOther)
83
     /**
78
     /**
84
      * 修改cmc预算外开支
79
      * 修改cmc预算外开支
85
      */
80
      */
86
-    @PreAuthorize("@ss.hasPermi('oa:other:edit')")
87
     @Log(title = "cmc预算外开支", businessType = BusinessType.UPDATE)
81
     @Log(title = "cmc预算外开支", businessType = BusinessType.UPDATE)
88
     @PutMapping
82
     @PutMapping
89
     public AjaxResult edit(@RequestBody CmcBudgetOther cmcBudgetOther)
83
     public AjaxResult edit(@RequestBody CmcBudgetOther cmcBudgetOther)
94
     /**
88
     /**
95
      * 删除cmc预算外开支
89
      * 删除cmc预算外开支
96
      */
90
      */
97
-    @PreAuthorize("@ss.hasPermi('oa:other:remove')")
98
     @Log(title = "cmc预算外开支", businessType = BusinessType.DELETE)
91
     @Log(title = "cmc预算外开支", businessType = BusinessType.DELETE)
99
 	@DeleteMapping("/{expenseIds}")
92
 	@DeleteMapping("/{expenseIds}")
100
     public AjaxResult remove(@PathVariable Long[] expenseIds)
93
     public AjaxResult remove(@PathVariable Long[] expenseIds)
101
     {
94
     {
102
-        return toAjax(cmcBudgetOtherService.deleteCmcBudgetOtherByExpenseIds(expenseIds));
95
+        return success(cmcBudgetOtherService.deleteCmcBudgetOtherByExpenseIds(expenseIds));
103
     }
96
     }
104
 }
97
 }

+ 4
- 11
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBudgetSiteController.java Datei anzeigen

1
-package com.ruoyi.oa.controller;
1
+package com.ruoyi.web.controller.oa;
2
 
2
 
3
 import java.util.List;
3
 import java.util.List;
4
 import javax.servlet.http.HttpServletResponse;
4
 import javax.servlet.http.HttpServletResponse;
5
-import org.springframework.security.access.prepost.PreAuthorize;
6
 import org.springframework.beans.factory.annotation.Autowired;
5
 import org.springframework.beans.factory.annotation.Autowired;
7
 import org.springframework.web.bind.annotation.GetMapping;
6
 import org.springframework.web.bind.annotation.GetMapping;
8
 import org.springframework.web.bind.annotation.PostMapping;
7
 import org.springframework.web.bind.annotation.PostMapping;
37
     /**
36
     /**
38
      * 查询cmc现场开支列表
37
      * 查询cmc现场开支列表
39
      */
38
      */
40
-    @PreAuthorize("@ss.hasPermi('oa:site:list')")
41
     @GetMapping("/list")
39
     @GetMapping("/list")
42
     public TableDataInfo list(CmcBudgetSite cmcBudgetSite)
40
     public TableDataInfo list(CmcBudgetSite cmcBudgetSite)
43
     {
41
     {
49
     /**
47
     /**
50
      * 导出cmc现场开支列表
48
      * 导出cmc现场开支列表
51
      */
49
      */
52
-    @PreAuthorize("@ss.hasPermi('oa:site:export')")
53
     @Log(title = "cmc现场开支", businessType = BusinessType.EXPORT)
50
     @Log(title = "cmc现场开支", businessType = BusinessType.EXPORT)
54
     @PostMapping("/export")
51
     @PostMapping("/export")
55
     public void export(HttpServletResponse response, CmcBudgetSite cmcBudgetSite)
52
     public void export(HttpServletResponse response, CmcBudgetSite cmcBudgetSite)
62
     /**
59
     /**
63
      * 获取cmc现场开支详细信息
60
      * 获取cmc现场开支详细信息
64
      */
61
      */
65
-    @PreAuthorize("@ss.hasPermi('oa:site:query')")
66
     @GetMapping(value = "/{expenseId}")
62
     @GetMapping(value = "/{expenseId}")
67
     public AjaxResult getInfo(@PathVariable("expenseId") Long expenseId)
63
     public AjaxResult getInfo(@PathVariable("expenseId") Long expenseId)
68
     {
64
     {
72
     /**
68
     /**
73
      * 新增cmc现场开支
69
      * 新增cmc现场开支
74
      */
70
      */
75
-    @PreAuthorize("@ss.hasPermi('oa:site:add')")
76
     @Log(title = "cmc现场开支", businessType = BusinessType.INSERT)
71
     @Log(title = "cmc现场开支", businessType = BusinessType.INSERT)
77
     @PostMapping
72
     @PostMapping
78
     public AjaxResult add(@RequestBody CmcBudgetSite cmcBudgetSite)
73
     public AjaxResult add(@RequestBody CmcBudgetSite cmcBudgetSite)
83
     /**
78
     /**
84
      * 修改cmc现场开支
79
      * 修改cmc现场开支
85
      */
80
      */
86
-    @PreAuthorize("@ss.hasPermi('oa:site:edit')")
87
     @Log(title = "cmc现场开支", businessType = BusinessType.UPDATE)
81
     @Log(title = "cmc现场开支", businessType = BusinessType.UPDATE)
88
     @PutMapping
82
     @PutMapping
89
     public AjaxResult edit(@RequestBody CmcBudgetSite cmcBudgetSite)
83
     public AjaxResult edit(@RequestBody CmcBudgetSite cmcBudgetSite)
94
     /**
88
     /**
95
      * 删除cmc现场开支
89
      * 删除cmc现场开支
96
      */
90
      */
97
-    @PreAuthorize("@ss.hasPermi('oa:site:remove')")
98
     @Log(title = "cmc现场开支", businessType = BusinessType.DELETE)
91
     @Log(title = "cmc现场开支", businessType = BusinessType.DELETE)
99
-	@DeleteMapping("/{expenseIds}")
100
-    public AjaxResult remove(@PathVariable Long[] expenseIds)
92
+	@DeleteMapping("/{budgetIds}")
93
+    public AjaxResult remove(@PathVariable String[] budgetIds)
101
     {
94
     {
102
-        return toAjax(cmcBudgetSiteService.deleteCmcBudgetSiteByExpenseIds(expenseIds));
95
+        return success(cmcBudgetSiteService.deleteCmcBudgetSiteByExpenseIds(budgetIds));
103
     }
96
     }
104
 }
97
 }

+ 2
- 2
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcBudgetSiteMapper.java Datei anzeigen

54
     /**
54
     /**
55
      * 批量删除cmc现场开支
55
      * 批量删除cmc现场开支
56
      * 
56
      * 
57
-     * @param expenseIds 需要删除的数据主键集合
57
+     * @param budgetIds 需要删除的数据主键集合
58
      * @return 结果
58
      * @return 结果
59
      */
59
      */
60
-    public int deleteCmcBudgetSiteByExpenseIds(Long[] expenseIds);
60
+    public int deleteCmcBudgetSiteByExpenseIds(String[] budgetIds);
61
 }
61
 }

+ 2
- 2
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcBudgetSiteService.java Datei anzeigen

46
     /**
46
     /**
47
      * 批量删除cmc现场开支
47
      * 批量删除cmc现场开支
48
      * 
48
      * 
49
-     * @param expenseIds 需要删除的cmc现场开支主键集合
49
+     * @param budgetIds 需要删除的cmc现场开支主键集合
50
      * @return 结果
50
      * @return 结果
51
      */
51
      */
52
-    public int deleteCmcBudgetSiteByExpenseIds(Long[] expenseIds);
52
+    public int deleteCmcBudgetSiteByExpenseIds(String[] budgetIds);
53
 
53
 
54
     /**
54
     /**
55
      * 删除cmc现场开支信息
55
      * 删除cmc现场开支信息

+ 3
- 3
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcBudgetSiteServiceImpl.java Datei anzeigen

70
     /**
70
     /**
71
      * 批量删除cmc现场开支
71
      * 批量删除cmc现场开支
72
      * 
72
      * 
73
-     * @param expenseIds 需要删除的cmc现场开支主键
73
+     * @param budgetIds 需要删除的cmc现场开支主键
74
      * @return 结果
74
      * @return 结果
75
      */
75
      */
76
     @Override
76
     @Override
77
-    public int deleteCmcBudgetSiteByExpenseIds(Long[] expenseIds)
77
+    public int deleteCmcBudgetSiteByExpenseIds(String[] budgetIds)
78
     {
78
     {
79
-        return cmcBudgetSiteMapper.deleteCmcBudgetSiteByExpenseIds(expenseIds);
79
+        return cmcBudgetSiteMapper.deleteCmcBudgetSiteByExpenseIds(budgetIds);
80
     }
80
     }
81
 
81
 
82
     /**
82
     /**

+ 3
- 3
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBudgetSiteMapper.xml Datei anzeigen

67
     </delete>
67
     </delete>
68
 
68
 
69
     <delete id="deleteCmcBudgetSiteByExpenseIds" parameterType="String">
69
     <delete id="deleteCmcBudgetSiteByExpenseIds" parameterType="String">
70
-        delete from cmc_budget_site where expense_id in 
71
-        <foreach item="expenseId" collection="array" open="(" separator="," close=")">
72
-            #{expenseId}
70
+        delete from cmc_budget_site where budget_id in
71
+        <foreach item="budgetId" collection="array" open="(" separator="," close=")">
72
+            #{budgetId}
73
         </foreach>
73
         </foreach>
74
     </delete>
74
     </delete>
75
 </mapper>
75
 </mapper>

+ 1
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBudgetStaffMapper.xml Datei anzeigen

53
             <if test="userId != null "> and bs.user_id = #{userId}</if>
53
             <if test="userId != null "> and bs.user_id = #{userId}</if>
54
             <if test="days != null "> and bs.days = #{days}</if>
54
             <if test="days != null "> and bs.days = #{days}</if>
55
             <if test="staffCost != null "> and bs.staff_cost = #{staffCost}</if>
55
             <if test="staffCost != null "> and bs.staff_cost = #{staffCost}</if>
56
+            <if test="type != null "> and bs.type = #{type}</if>
56
         </where>
57
         </where>
57
     </select>
58
     </select>
58
     
59
     

+ 50
- 0
oa-ui/src/api/oa/budget/budgetSite.js Datei anzeigen

1
+/*
2
+ * @Author: ysh
3
+ * @Date: 2025-05-12 11:03:30
4
+ * @LastEditors: 
5
+ * @LastEditTime: 2025-05-12 11:03:36
6
+ */
7
+import request from '@/utils/request'
8
+
9
+// 查询cmc现场开支列表
10
+export function listSite(query) {
11
+  return request({
12
+    url: '/oa/site/list',
13
+    method: 'get',
14
+    params: query
15
+  })
16
+}
17
+
18
+// 查询cmc现场开支详细
19
+export function getSite(expenseId) {
20
+  return request({
21
+    url: '/oa/site/' + expenseId,
22
+    method: 'get'
23
+  })
24
+}
25
+
26
+// 新增cmc现场开支
27
+export function addSite(data) {
28
+  return request({
29
+    url: '/oa/site',
30
+    method: 'post',
31
+    data: data
32
+  })
33
+}
34
+
35
+// 修改cmc现场开支
36
+export function updateSite(data) {
37
+  return request({
38
+    url: '/oa/site',
39
+    method: 'put',
40
+    data: data
41
+  })
42
+}
43
+
44
+// 删除cmc现场开支
45
+export function delSite(expenseId) {
46
+  return request({
47
+    url: '/oa/site/' + expenseId,
48
+    method: 'delete'
49
+  })
50
+}

+ 136
- 36
oa-ui/src/views/flowable/form/budget/addBudget.vue Datei anzeigen

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-06-21 18:51:51
3
  * @Date: 2024-06-21 18:51:51
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-05-09 17:29:35
5
+ * @LastEditTime: 2025-05-12 17:25:07
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div class="app-container">
8
   <div class="app-container">
50
     <!-- 分割线 -->
50
     <!-- 分割线 -->
51
     <!-- <el-divider><b>直接成本</b></el-divider> -->
51
     <!-- <el-divider><b>直接成本</b></el-divider> -->
52
     <!-- 现场开支 -->
52
     <!-- 现场开支 -->
53
-    <site-expenses :outer-users="outerUsers" @expensesList="getExpensesList"></site-expenses>
54
-    <!-- 经营填写 -->
55
-
56
-    <!-- 其他成本 -->
57
-    <other-table ref="otherRef" @otherCost="getOtherCost" :budgetForm="budgetForm"></other-table>
53
+    <site-expenses :budgetId="budgetForm.budgetId" :outer-users="outerUsers" @expensesList="getExpensesList"
54
+      @siteSum="getSiteSum"></site-expenses>
55
+    <!-- 经营相关 -->
56
+    <other-table ref="otherRef" @otherCost="getOtherCost" :budgetForm="budgetForm"
57
+      :disabled="taskName != '经营审核'"></other-table>
58
     <!-- 预算备注 -->
58
     <!-- 预算备注 -->
59
     <el-form :model="budgetForm" style="padding: 20px 100px 0">
59
     <el-form :model="budgetForm" style="padding: 20px 100px 0">
60
       <el-form-item label="预算表单备注" label-width="100px">
60
       <el-form-item label="预算表单备注" label-width="100px">
72
             :underline="false" target="_blank">
72
             :underline="false" target="_blank">
73
             <span class="el-icon-download">下载文件</span>
73
             <span class="el-icon-download">下载文件</span>
74
           </el-link>
74
           </el-link>
75
+          <el-link class="ml20" type="warning" :underline="false" target="_blank" v-if="taskName == '预算编制'">
76
+            <span class="el-icon-delete" style="color:#F56C6C" @click="budgetForm.document = ''">删除文件</span>
77
+          </el-link>
75
           <FileUpload v-if="taskName == '预算编制'" :limit="1" :filePathName="'预算编制/附件上传'"
78
           <FileUpload v-if="taskName == '预算编制'" :limit="1" :filePathName="'预算编制/附件上传'"
76
             :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf', 'rar', 'zip']" @input="getDocumentPath"></FileUpload>
79
             :fileType="['doc', 'docx', 'xls', 'xlsx', 'pdf', 'rar', 'zip']" @input="getDocumentPath"></FileUpload>
77
         </div>
80
         </div>
78
       </el-form-item>
81
       </el-form-item>
82
+      <el-form-item label="统计" label-width="100px">
83
+        <!-- <div style="padding: 0 200px;"> -->
84
+        <table border="1" style="width:600px;" class="budget-summary">
85
+          <tr class="header">
86
+            <td><b>名称</b></td>
87
+            <td><b>金额</b></td>
88
+          </tr>
89
+          <tr>
90
+            <td>人员成本</td>
91
+            <td style="text-align:right;">{{ isNaN(budgetForm.staffCost) ? 0 : budgetForm.staffCost }}</td>
92
+          </tr>
93
+          <tr>
94
+            <td>车辆成本</td>
95
+            <td style="text-align:right;">{{ isNaN(budgetForm.carCost) ? 0 : budgetForm.carCost }}</td>
96
+          </tr>
97
+          <tr>
98
+            <td>设备成本</td>
99
+            <td style="text-align:right;">{{ isNaN(budgetForm.deviceCost) ? 0 : budgetForm.deviceCost }}</td>
100
+          </tr>
101
+          <tr>
102
+            <td>现场开支成本</td>
103
+            <td style="text-align:right;">{{ isNaN(budgetForm.siteSum) ? 0 : budgetForm.siteSum }}</td>
104
+          </tr>
105
+          <tr>
106
+            <td>经营相关成本</td>
107
+            <td style="text-align:right;">{{ Number(this.budgetForm.outExpense) +
108
+              Number(this.budgetForm.letterExpense) +
109
+              Number(this.budgetForm.winExpense) + Number(this.budgetForm.taxExpense)
110
+              + Number(this.budgetForm.travelExpense) }}</td>
111
+          </tr>
112
+          <tr class="total">
113
+            <td><b>预算总成本</b></td>
114
+            <td style="text-align:right;"><b>{{ isNaN(budgetForm.totalBudget) ? 0 : budgetForm.totalBudget }}</b></td>
115
+          </tr>
116
+        </table>
117
+        <!-- </div> -->
118
+      </el-form-item>
79
     </el-form>
119
     </el-form>
120
+    <!-- <div class="text-center mb10">
121
+      <el-tag class="ml10 mr10" type="primary">
122
+        内业预算绩效总额:{{ isNaN(budgetForm.settleExpense) ? 0 : budgetForm.settleExpense }}
123
+      </el-tag>
124
+    </div> -->
80
     <!-- 统计 -->
125
     <!-- 统计 -->
81
-    <div class="text-center">
82
-      <el-tag class="ml10 mr10" type="success">间接成本:{{ isNaN(budgetForm.fixCost) ? 0 : budgetForm.fixCost }}</el-tag>
83
-      <el-tag class="ml10 mr10">直接成本:{{
84
-        isNaN(budgetForm.directExpense) ? 0 : budgetForm.directExpense
85
-        }}</el-tag>
86
-      <el-tag class="ml10 mr10" type="danger">预算总成本:{{
87
-        isNaN(budgetForm.totalBudget) ? 0 : budgetForm.totalBudget
88
-        }}</el-tag>
89
-    </div>
126
+
90
     <div class="mt20 text-center" style="color: #909399; font-size: 12px">
127
     <div class="mt20 text-center" style="color: #909399; font-size: 12px">
91
       tips:预览表单,请先保存之后刷新再查看
128
       tips:预览表单,请先保存之后刷新再查看
92
     </div>
129
     </div>
98
       <el-button type="primary" @click="submitNextFlow" v-else>结算批准</el-button>
135
       <el-button type="primary" @click="submitNextFlow" v-else>结算批准</el-button>
99
     </div>
136
     </div>
100
     <el-dialog title="表单预览" :visible.sync="viewOpen" width="70%" append-to-body>
137
     <el-dialog title="表单预览" :visible.sync="viewOpen" width="70%" append-to-body>
101
-      <budget-info :taskName="taskName" :taskForm="taskForm" @goBack="$emit('goBack')"></budget-info>
138
+      <!-- <budget-info :taskName="taskName" :taskForm="taskForm" @goBack="$emit('goBack')"></budget-info> -->
139
+      <new-budget-info :taskName="taskName" :taskForm="taskForm"></new-budget-info>
102
     </el-dialog>
140
     </el-dialog>
103
   </div>
141
   </div>
104
 </template>
142
 </template>
111
 import { listBudgetStaff, addBudgetStaff, delBudgetStaff } from "@/api/oa/budget/budgetStaff.js";
149
 import { listBudgetStaff, addBudgetStaff, delBudgetStaff } from "@/api/oa/budget/budgetStaff.js";
112
 import { listBudgetDevice, addBudgetDevice, delBudgetDevice } from "@/api/oa/budget/budgetDevice.js";
150
 import { listBudgetDevice, addBudgetDevice, delBudgetDevice } from "@/api/oa/budget/budgetDevice.js";
113
 import { listBudgetSettle, addBudgetSettle, delBudgetSettle } from "@/api/oa/budget/budgetSettle.js";
151
 import { listBudgetSettle, addBudgetSettle, delBudgetSettle } from "@/api/oa/budget/budgetSettle.js";
152
+import { listSite, getSite, delSite, addSite, updateSite } from "@/api/oa/budget/budgetSite.js";
114
 import { getUsersDeptLeaderByDept, getUsersManageLeaderByDept } from "@/api/system/post";
153
 import { getUsersDeptLeaderByDept, getUsersManageLeaderByDept } from "@/api/system/post";
115
 import { complete, getNextFlowNode } from "@/api/flowable/todo";
154
 import { complete, getNextFlowNode } from "@/api/flowable/todo";
116
 import budgetInfo from "./budgetInfo.vue";
155
 import budgetInfo from "./budgetInfo.vue";
122
 import DeviceTable from "./deviceTable.vue";
161
 import DeviceTable from "./deviceTable.vue";
123
 import OtherTable from "./otherTable.vue";
162
 import OtherTable from "./otherTable.vue";
124
 import SiteExpenses from "./siteExpenses.vue";
163
 import SiteExpenses from "./siteExpenses.vue";
164
+import BudgetAdjust from "./adjust/budgetAdjust.vue";
165
+import NewBudgetInfo from './adjust/newBudgetInfo.vue';
125
 export default {
166
 export default {
126
   components: {
167
   components: {
127
     ReturnComment,
168
     ReturnComment,
132
     MoneyTable,
173
     MoneyTable,
133
     OtherTable,
174
     OtherTable,
134
     budgetInfo,
175
     budgetInfo,
135
-    SiteExpenses
176
+    SiteExpenses,
177
+    BudgetAdjust,
178
+    NewBudgetInfo
136
   },
179
   },
137
   data() {
180
   data() {
138
     return {
181
     return {
203
     // 保存
246
     // 保存
204
     preserve() {
247
     preserve() {
205
       console.log(this.budgetForm)
248
       console.log(this.budgetForm)
206
-      return
207
       if (!this.flag) {
249
       if (!this.flag) {
208
         this.addBudgetForm(this.budgetForm);
250
         this.addBudgetForm(this.budgetForm);
209
         this.flag = true;
251
         this.flag = true;
241
         });
283
         });
242
       });
284
       });
243
     },
285
     },
244
-    addBudgetForm(form) {
245
-      addBudget(form);
286
+    async addBudgetForm(form) {
287
+      await addBudget(form);
246
       for (let user of form.chooseUser) {
288
       for (let user of form.chooseUser) {
247
         user.budgetId = form.budgetId;
289
         user.budgetId = form.budgetId;
248
-        addBudgetStaff(user);
290
+        await addBudgetStaff(user);
249
       }
291
       }
250
       for (let car of form.chooseCar) {
292
       for (let car of form.chooseCar) {
251
         car.budgetId = form.budgetId;
293
         car.budgetId = form.budgetId;
252
-        addBudgetCar(car);
294
+        await addBudgetCar(car);
253
       }
295
       }
254
       for (let device of form.chooseDevice) {
296
       for (let device of form.chooseDevice) {
255
         device.budgetId = form.budgetId;
297
         device.budgetId = form.budgetId;
256
-        addBudgetDevice(device);
298
+        await addBudgetDevice(device);
257
       }
299
       }
258
       for (let work of form.contentList) {
300
       for (let work of form.contentList) {
259
         work.budgetId = form.budgetId;
301
         work.budgetId = form.budgetId;
260
-        addBudgetSettle(work).then(res => {
261
-          this.$message.success("预算添加成功");
262
-        });
302
+        await addBudgetSettle(work)
303
+      }
304
+      for (let site of form.expensesList) {
305
+        site.budgetId = form.budgetId;
306
+        await addSite(site)
263
       }
307
       }
308
+      this.$message.success("预算添加成功");
264
     },
309
     },
265
     updateBudgetForm(form) {
310
     updateBudgetForm(form) {
266
       updateBudget(form);
311
       updateBudget(form);
267
-      delBudgetStaff(form.budgetId).then(res => {
312
+      delBudgetStaff(form.budgetId).then(async res => {
268
         for (let user of form.chooseUser) {
313
         for (let user of form.chooseUser) {
269
           user.budgetId = form.budgetId;
314
           user.budgetId = form.budgetId;
270
-          addBudgetStaff(user);
315
+          await addBudgetStaff(user);
271
         }
316
         }
272
       });
317
       });
273
-      delBudgetCar(form.budgetId).then(res => {
318
+      delBudgetCar(form.budgetId).then(async res => {
274
         for (let car of form.chooseCar) {
319
         for (let car of form.chooseCar) {
275
           car.budgetId = form.budgetId;
320
           car.budgetId = form.budgetId;
276
-          addBudgetCar(car);
321
+          await addBudgetCar(car);
277
         }
322
         }
278
       });
323
       });
279
-      delBudgetDevice(form.budgetId).then(res => {
324
+      delBudgetDevice(form.budgetId).then(async res => {
280
         for (let device of form.chooseDevice) {
325
         for (let device of form.chooseDevice) {
281
           device.budgetId = form.budgetId;
326
           device.budgetId = form.budgetId;
282
-          addBudgetDevice(device);
327
+          await addBudgetDevice(device);
283
         }
328
         }
284
       });
329
       });
285
-      delBudgetSettle(form.budgetId).then(res => {
330
+      delBudgetSettle(form.budgetId).then(async res => {
286
         for (let work of form.contentList) {
331
         for (let work of form.contentList) {
287
           work.budgetId = form.budgetId;
332
           work.budgetId = form.budgetId;
288
-          addBudgetSettle(work);
333
+          await addBudgetSettle(work);
289
         }
334
         }
290
-        this.$message.success("预算添加成功");
291
       });
335
       });
336
+      delSite(form.budgetId).then(async res => {
337
+        for (let site of form.expensesList) {
338
+          site.budgetId = form.budgetId;
339
+          await addSite(site);
340
+        }
341
+        this.$message.success("预算添加成功");
342
+      })
292
     },
343
     },
293
     getChooseUser(val) {
344
     getChooseUser(val) {
294
       this.$set(this.budgetForm, "chooseUser", val);
345
       this.$set(this.budgetForm, "chooseUser", val);
310
     getExpensesList(val) {
361
     getExpensesList(val) {
311
       this.$set(this.budgetForm, "expensesList", val);
362
       this.$set(this.budgetForm, "expensesList", val);
312
     },
363
     },
364
+    getSiteSum(val) {
365
+      this.$set(this.budgetForm, "siteSum", val);
366
+    },
313
     getDeviceCost(val) {
367
     getDeviceCost(val) {
314
       this.$set(this.budgetForm, "deviceCost", val);
368
       this.$set(this.budgetForm, "deviceCost", val);
315
     },
369
     },
318
     },
372
     },
319
     getSettleExpense(val) {
373
     getSettleExpense(val) {
320
       this.innerSettleLimit = val;
374
       this.innerSettleLimit = val;
375
+      this.$set(this.budgetForm, "settleExpense", val);
321
     },
376
     },
322
     handleInnerSettleExceeded(data) {
377
     handleInnerSettleExceeded(data) {
323
       // this.$message.error(`内业预算绩效总额(${data.current.toFixed(2)})超出限制(${data.limit})`);
378
       // this.$message.error(`内业预算绩效总额(${data.current.toFixed(2)})超出限制(${data.limit})`);
359
     },
414
     },
360
     getTotalBudget() {
415
     getTotalBudget() {
361
       this.budgetForm.totalBudget = (
416
       this.budgetForm.totalBudget = (
362
-        Number(this.budgetForm.fixCost) + Number(this.budgetForm.directExpense)
417
+        Number(this.budgetForm.staffCost) + Number(this.budgetForm.carCost) + Number(this.budgetForm.deviceCost) + Number(this.budgetForm.siteSum)
418
+        + Number(this.budgetForm.outExpense) + Number(this.budgetForm.letterExpense) + Number(this.budgetForm.winExpense) + Number(this.budgetForm.taxExpense)
419
+        + Number(this.budgetForm.travelExpense)
363
       ).toFixed(2);
420
       ).toFixed(2);
364
     },
421
     },
365
     isReturn(val) {
422
     isReturn(val) {
384
 </script>
441
 </script>
385
 
442
 
386
 <style lang="scss" scoped>
443
 <style lang="scss" scoped>
444
+@import "@/assets/styles/element-reset.scss";
445
+
387
 .mylabel {
446
 .mylabel {
388
   font-weight: bold;
447
   font-weight: bold;
389
 }
448
 }
449
+
450
+table {
451
+  width: 100%;
452
+  /*居中*/
453
+  // margin: 0 auto;
454
+  /*边框*/
455
+  /* border: 1px solid black; */
456
+  text-align: center;
457
+  border-collapse: collapse;
458
+  border: 1px solid #c4c6ca;
459
+}
460
+
461
+.budget-summary {
462
+  border-collapse: collapse;
463
+  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
464
+  background: #fff;
465
+}
466
+
467
+.budget-summary td {
468
+  padding: 8px 12px;
469
+  border: 1px solid #EBEEF5;
470
+}
471
+
472
+.budget-summary .header {
473
+  background-color: #F5F7FA;
474
+  color: #606266;
475
+}
476
+
477
+.budget-summary .header td {
478
+  font-weight: 500;
479
+}
480
+
481
+.budget-summary .total {
482
+  background-color: #F5F7FA;
483
+  color: #303133;
484
+  font-weight: bold;
485
+}
486
+
487
+.budget-summary tr:hover {
488
+  background-color: #F5F7FA;
489
+}
390
 </style>
490
 </style>

oa-ui/src/views/flowable/form/budget/adjust/index.vue → oa-ui/src/views/flowable/form/budget/adjust/budgetAdjust.vue Datei anzeigen

1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2025-05-07 11:01:39
4
+ * @LastEditors: 
5
+ * @LastEditTime: 2025-05-12 17:18:35
6
+-->
1
 <template>
7
 <template>
2
   <div class="main">
8
   <div class="main">
3
     <h2 class="text-center">项目直接生产成本预算—核算表</h2>
9
     <h2 class="text-center">项目直接生产成本预算—核算表</h2>
101
           </tr>
107
           </tr>
102
         </table>
108
         </table>
103
       </el-descriptions-item>
109
       </el-descriptions-item>
104
-      <el-descriptions-item label="内业人员成本" :span="3">
110
+      <el-descriptions-item label="内业人员成本" :span="3" v-if="innerStaffList.length > 0">
105
         <inner-staff-cost :staffList.sync="innerStaffList"
111
         <inner-staff-cost :staffList.sync="innerStaffList"
106
           @update:staffList="handleInnerStaffChange"></inner-staff-cost>
112
           @update:staffList="handleInnerStaffChange"></inner-staff-cost>
107
       </el-descriptions-item>
113
       </el-descriptions-item>
108
-      <el-descriptions-item label="外业人员成本" :span="3">
114
+      <el-descriptions-item label="外业人员成本" :span="3" v-if="outerStaffList.length > 0">
109
         <outer-staff-cost :staffList.sync="outerStaffList"
115
         <outer-staff-cost :staffList.sync="outerStaffList"
110
           @update:staffList="handleOuterStaffChange"></outer-staff-cost>
116
           @update:staffList="handleOuterStaffChange"></outer-staff-cost>
111
       </el-descriptions-item>
117
       </el-descriptions-item>
112
-      <el-descriptions-item label="车辆成本" :span="3">
118
+      <el-descriptions-item label="车辆成本" :span="3" v-if="carList.length > 0">
113
         <car-cost :carList.sync="carList"></car-cost>
119
         <car-cost :carList.sync="carList"></car-cost>
114
       </el-descriptions-item>
120
       </el-descriptions-item>
115
-      <el-descriptions-item label="设备成本" :span="3">
121
+      <el-descriptions-item label="设备成本" :span="3" v-if="deviceList.length > 0">
116
         <device-cost :deviceList.sync="deviceList"></device-cost>
122
         <device-cost :deviceList.sync="deviceList"></device-cost>
117
       </el-descriptions-item>
123
       </el-descriptions-item>
118
       <el-descriptions-item label="现场开支" :span="3">
124
       <el-descriptions-item label="现场开支" :span="3">
157
     CarCost,
163
     CarCost,
158
     DeviceCost
164
     DeviceCost
159
   },
165
   },
166
+  props: {
167
+    taskForm: {
168
+      type: Object,
169
+      require: true
170
+    },
171
+    taskName: {
172
+      type: String,
173
+    }
174
+  },
160
   data() {
175
   data() {
161
     return {
176
     return {
162
       loading: true,
177
       loading: true,
177
   methods: {
192
   methods: {
178
     initBudgetForm() {
193
     initBudgetForm() {
179
       this.loading = true;
194
       this.loading = true;
180
-      listBudget({ pageNum: 1, pageSize: 20, projectId: '1897087448425566208' }).then(async res => {
195
+      listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(async res => {
181
         this.budgetForm = res.rows[0];
196
         this.budgetForm = res.rows[0];
182
         if (this.budgetForm) {
197
         if (this.budgetForm) {
183
           const budgetId = this.budgetForm.budgetId;
198
           const budgetId = this.budgetForm.budgetId;
218
       });
233
       });
219
     },
234
     },
220
     getProjectWorkList() {
235
     getProjectWorkList() {
221
-      getProject('1897087448425566208').then(res => {
236
+      getProject(this.taskForm.formId).then(res => {
222
         this.project = res.data;
237
         this.project = res.data;
223
       })
238
       })
224
-      listProjectWork({ pageSize: 999, projectId: '1897087448425566208' }).then(res => {
239
+      listProjectWork({ pageSize: 999, projectId: this.taskForm.formId }).then(res => {
225
         this.workContentList = res.rows;
240
         this.workContentList = res.rows;
226
       })
241
       })
227
     },
242
     },

+ 1
- 1
oa-ui/src/views/flowable/form/budget/adjust/components/InnerStaffCost.vue Datei anzeigen

22
         </td>
22
         </td>
23
         <td>{{ index + 1 }}</td>
23
         <td>{{ index + 1 }}</td>
24
         <td>{{ staff.user ? staff.user.nickName : '' }}</td>
24
         <td>{{ staff.user ? staff.user.nickName : '' }}</td>
25
-        <td>{{ staff.staffCost }}</td>
25
+        <td>{{ staff.dayCost }}</td>
26
         <td>{{ staff.days }}</td>
26
         <td>{{ staff.days }}</td>
27
         <td>{{ staff.performance }}</td>
27
         <td>{{ staff.performance }}</td>
28
         <td>{{ staff.amount }}</td>
28
         <td>{{ staff.amount }}</td>

+ 1
- 8
oa-ui/src/views/flowable/form/budget/adjust/components/OuterStaffCost.vue Datei anzeigen

8
         <td>人员成本(天)</td>
8
         <td>人员成本(天)</td>
9
         <td style="width:120px">预算天数</td>
9
         <td style="width:120px">预算天数</td>
10
         <td>预算系数</td>
10
         <td>预算系数</td>
11
-        <td>其他系数</td>
12
         <td style="width:120px">金额</td>
11
         <td style="width:120px">金额</td>
13
         <td class="adjust" style="width:120px">核算天数</td>
12
         <td class="adjust" style="width:120px">核算天数</td>
14
         <td class="adjust" style="width:120px">核算系数</td>
13
         <td class="adjust" style="width:120px">核算系数</td>
15
-        <td class="adjust" style="width:120px">核算其他系数</td>
16
         <td class="adjust" style="width:120px">核算金额</td>
14
         <td class="adjust" style="width:120px">核算金额</td>
17
       </tr>
15
       </tr>
18
       <tr v-for="staff, index in staffList" :key="'user' + staff.userId">
16
       <tr v-for="staff, index in staffList" :key="'user' + staff.userId">
23
         </td>
21
         </td>
24
         <td>{{ index + 1 }}</td>
22
         <td>{{ index + 1 }}</td>
25
         <td>{{ staff.user ? staff.user.nickName : '' }}</td>
23
         <td>{{ staff.user ? staff.user.nickName : '' }}</td>
26
-        <td>{{ staff.staffCost }}</td>
24
+        <td>{{ staff.dayCost }}</td>
27
         <td>{{ staff.days }}</td>
25
         <td>{{ staff.days }}</td>
28
         <td>{{ staff.coefficient }}</td>
26
         <td>{{ staff.coefficient }}</td>
29
-        <td>{{ staff.otherCoefficient }}</td>
30
         <td>{{ staff.amount }}</td>
27
         <td>{{ staff.amount }}</td>
31
         <td>
28
         <td>
32
           <el-input-number :controls="false" style="width:100%;" v-model="staff.daysAdjust"
29
           <el-input-number :controls="false" style="width:100%;" v-model="staff.daysAdjust"
36
           <el-input-number :controls="false" style="width:100%;" v-model="staff.coefficientAdjust"
33
           <el-input-number :controls="false" style="width:100%;" v-model="staff.coefficientAdjust"
37
             @change="handleChange(staff)"></el-input-number>
34
             @change="handleChange(staff)"></el-input-number>
38
         </td>
35
         </td>
39
-        <td>
40
-          <el-input-number :controls="false" style="width:100%;" v-model="staff.otherCoefficientAdjust"
41
-            @change="handleChange(staff)"></el-input-number>
42
-        </td>
43
         <td>
36
         <td>
44
           {{ staff.amountAdjust }}
37
           {{ staff.amountAdjust }}
45
         </td>
38
         </td>

+ 421
- 0
oa-ui/src/views/flowable/form/budget/adjust/newBudgetInfo.vue Datei anzeigen

1
+<!--
2
+ * @Author: ysh
3
+ * @Date: 2025-05-07 11:01:39
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2025-05-12 17:51:37
6
+-->
7
+<template>
8
+  <div class="main">
9
+    <h2 class="text-center">项目直接生产成本预算—核算表</h2>
10
+    <p style="text-align: center">编制人:{{ budgetForm.compilerUser ? budgetForm.compilerUser.nickName : '' }}</p>
11
+    <el-divider></el-divider>
12
+    <el-descriptions :column="3" border class="descriptions">
13
+      <el-descriptions-item label="项目编号">
14
+        {{ project.projectNumber }}
15
+      </el-descriptions-item>
16
+      <el-descriptions-item label="项目名称">
17
+        {{ project.projectName }}
18
+      </el-descriptions-item>
19
+      <el-descriptions-item label="项目负责人">
20
+        {{ getUserName(project.projectLeader) }}
21
+      </el-descriptions-item>
22
+      <el-descriptions-item label="承担部门">
23
+        {{ getDeptNames(project.undertakingDept) }}
24
+      </el-descriptions-item>
25
+      <el-descriptions-item label="项目备注" :span="3">
26
+        {{ project.remark }}
27
+      </el-descriptions-item>
28
+      <el-descriptions-item label="预算表单备注" :span="5">
29
+        {{ budgetForm.remark }}
30
+      </el-descriptions-item>
31
+      <el-descriptions-item label="项目计划工作量" :span="3">
32
+        <div>
33
+          <table border="1" style="width: 100%;">
34
+            <tr style="background-color:#f8f8f9">
35
+              <td style="width: 250px">工作内容</td>
36
+              <td style="width: 100px">比例尺/等级</td>
37
+              <td style="width: 100px">单位</td>
38
+              <td style="width: 100px">工作量</td>
39
+              <td style="width: 100px">要求完成时间</td>
40
+              <td style="width: 200px">备注</td>
41
+            </tr>
42
+            <tr v-for="(work, index) in workContentList" :key="index">
43
+              <td>
44
+                {{ work.content }}
45
+              </td>
46
+              <td>
47
+                {{ work.scale }}
48
+              </td>
49
+              <td>
50
+                {{ work.unit }}
51
+              </td>
52
+              <td>
53
+                {{ work.workload }}
54
+              </td>
55
+              <td>
56
+                {{ work.deadline }}
57
+              </td>
58
+              <td>
59
+                {{ work.remark }}
60
+              </td>
61
+            </tr>
62
+          </table>
63
+        </div>
64
+      </el-descriptions-item>
65
+      <el-descriptions-item label="内业绩效额" :span="3">
66
+        <table border="1" style="width:100%">
67
+          <tr style="background-color:#f8f8f9" v-if="workList.length != 0">
68
+            <td style="min-width:50px">工作简述</td>
69
+            <td style="min-width:50px">工作内容</td>
70
+            <td style="min-width:50px">比例尺/等级</td>
71
+            <td style="min-width:50px">数量</td>
72
+            <td style="min-width:50px">单价</td>
73
+            <td style="min-width:50px">单位</td>
74
+            <td style="min-width:50px">系数</td>
75
+            <td style="min-width:80px">金额</td>
76
+            <td style="min-width: 150px;">备注</td>
77
+          </tr>
78
+          <tr v-for="work in workList">
79
+            <td>{{ work.content }}</td>
80
+            <td>{{ work.cmcPrice ? work.cmcPrice.workItem : '' }}</td>
81
+            <td>
82
+              {{ work.scaleGrade }}
83
+            </td>
84
+            <td>
85
+              {{ work.workload }}
86
+            </td>
87
+            <td>{{ work.price }}</td>
88
+            <td>{{ work.unit }}</td>
89
+            <td>
90
+              {{ work.coefficient }}
91
+            </td>
92
+            <td style="text-align:right;">{{ work.settle ? work.settle.toFixed(2) : '0.00' }}</td>
93
+            <td>{{ work.remark ? work.remark : '' }}</td>
94
+          </tr>
95
+          <tr>
96
+            <td :colspan="7" class="head amount">内业绩效额合计</td>
97
+            <td :colspan="1" class="head amount" style="text-align:right;">
98
+              {{ budgetForm.settleExpense ? budgetForm.settleExpense.toFixed(2) : '0.00' }}
99
+            </td>
100
+            <td></td>
101
+          </tr>
102
+        </table>
103
+      </el-descriptions-item>
104
+      <el-descriptions-item label="内业人员成本" :span="3" v-if="innerStaffList.length > 0">
105
+        <table border="1" style="width:100%">
106
+          <tr style="background-color:#f8f8f9">
107
+            <td>序号</td>
108
+            <td>姓名</td>
109
+            <td>固定成本(天)</td>
110
+            <td style="width:120px">预算天数</td>
111
+            <td>固定成本合计</td>
112
+            <td>绩效成本合计</td>
113
+            <td style="width:120px">金额</td>
114
+          </tr>
115
+          <tr v-for="staff, index in innerStaffList" :key="'user' + staff.userId">
116
+            <td>{{ index + 1 }}</td>
117
+            <td>{{ staff.user ? staff.user.nickName : '' }}</td>
118
+            <td>{{ staff.dayCost }}</td>
119
+            <td>{{ staff.days }}</td>
120
+            <td>{{ (Number(staff.dayCost) * Number(staff.days)).toFixed(2) }}</td>
121
+            <td>{{ staff.performance }}</td>
122
+            <td>{{ staff.amount }}</td>
123
+          </tr>
124
+          <tr>
125
+            <td colspan="5" class="head amount">内业人员成本合计</td>
126
+            <td class="head amount">{{ innerStaffList.reduce((sum, staff) => sum + (Number(staff.performance) || 0), 0).toFixed(2) }}</td>
127
+            <td class="head amount">{{ innerStaffList.reduce((sum, staff) => sum + (Number(staff.amount) || 0), 0).toFixed(2) }}</td>
128
+          </tr>
129
+        </table>
130
+      </el-descriptions-item>
131
+      <el-descriptions-item label="外业人员成本" :span="3" v-if="outerStaffList.length > 0">
132
+        <table border="1" style="width:100%">
133
+          <tr style="background-color:#f8f8f9">
134
+            <td>序号</td>
135
+            <td>姓名</td>
136
+            <td>固定成本(天)</td>
137
+            <td>单价</td>
138
+            <td style="width:120px">预算天数</td>
139
+            <td>预算系数</td>
140
+            <td>固定成本合计</td>
141
+            <td>绩效成本合计</td>
142
+            <td style="width:120px">金额</td>
143
+          </tr>
144
+          <tr v-for="staff, index in outerStaffList" :key="'user' + staff.userId">
145
+            <td>{{ index + 1 }}</td>
146
+            <td>{{ staff.user ? staff.user.nickName : '' }}</td>
147
+            <td>{{ staff.dayCost }}</td>
148
+            <td>200</td>
149
+            <td>{{ staff.days }}</td>
150
+            <td>{{ staff.coefficient }}</td>
151
+            <td>{{ (Number(staff.dayCost) * Number(staff.days)).toFixed(2) }}</td>
152
+            <td>{{ staff.performance }}</td>
153
+            <td>{{ staff.amount }}</td>
154
+          </tr>
155
+          <tr>
156
+            <td colspan="8" class="head amount">外业人员成本合计</td>
157
+            <td class="head amount">{{ outerStaffList.reduce((sum, staff) => sum + (Number(staff.amount) || 0), 0).toFixed(2) }}</td>
158
+          </tr>
159
+        </table>
160
+      </el-descriptions-item>
161
+      <el-descriptions-item label="车辆成本" :span="3" v-if="carList.length > 0">
162
+        <table border="1" style="width:100%;">
163
+          <tr style="background-color:#f8f8f9">
164
+            <td>序号</td>
165
+            <td>车牌号</td>
166
+            <td>折旧成本(天)</td>
167
+            <td>预算天数</td>
168
+            <td>金额</td>
169
+          </tr>
170
+          <tr v-for="car, index in carList" :key="'car' + car.carId">
171
+            <td>{{ index + 1 }}</td>
172
+            <td>{{ car.car ? car.car.licensePlate : '' }}</td>
173
+            <td>{{ car.car ? car.car.dayCost : '' }}</td>
174
+            <td>{{ car.days }}</td>
175
+            <td>{{ car.amount }}</td>
176
+          </tr>
177
+          <tr>
178
+            <td colspan="4" class="head amount">车辆成本合计</td>
179
+            <td class="head amount">{{ carList.reduce((sum, car) => sum + (Number(car.amount) || 0), 0).toFixed(2) }}</td>
180
+          </tr>
181
+        </table>
182
+      </el-descriptions-item>
183
+      <el-descriptions-item label="设备成本" :span="3" v-if="deviceList.length > 0">
184
+        <table border="1" style="width:100%;">
185
+          <tr style="background-color:#f8f8f9">
186
+            <td>序号</td>
187
+            <td>设备名称</td>
188
+            <td>规格型号</td>
189
+            <td>品牌</td>
190
+            <td>折旧成本(天)</td>
191
+            <td>预算天数</td>
192
+            <td>金额</td>
193
+          </tr>
194
+          <tr v-for="device, index in deviceList" :key="'device' + device.deviceId">
195
+            <td>{{ index + 1 }}</td>
196
+            <td>{{ device.device ? device.device.name : '' }}</td>
197
+            <td>{{ device.device ? device.device.series : '' }}</td>
198
+            <td>{{ device.device ? device.device.brand : '' }}</td>
199
+            <td>{{ device.device ? device.device.dayCost : '' }}</td>
200
+            <td>{{ device.days }}</td>
201
+            <td>{{ device.amount }}</td>
202
+          </tr>
203
+          <tr>
204
+            <td colspan="6" class="head amount">设备成本合计</td>
205
+            <td class="head amount">{{ deviceList.reduce((sum, device) => sum + (Number(device.amount) || 0), 0).toFixed(2) }}</td>
206
+          </tr>
207
+        </table>
208
+      </el-descriptions-item>
209
+      <el-descriptions-item label="现场开支" :span="3">
210
+        <table border="1" style="width:100%;">
211
+          <tr style="background-color:#f8f8f9">
212
+            <td>序号</td>
213
+            <td>开支项</td>
214
+            <td>金额</td>
215
+            <td>备注</td>
216
+          </tr>
217
+          <tr v-for="site, index in siteList" :key="'site' + site.expenseId">
218
+            <td>{{ index + 1 }}</td>
219
+            <td>{{ site.name }}</td>
220
+            <td>{{ site.amount }}</td>
221
+            <td>{{ site.remark }}</td>
222
+          </tr>
223
+          <tr>
224
+            <td colspan="2" class="head amount">现场开支合计</td>
225
+            <td class="head amount">{{ siteList.reduce((sum, site) => sum + (Number(site.amount) || 0), 0).toFixed(2) }}</td>
226
+            <td></td>
227
+          </tr>
228
+        </table>
229
+      </el-descriptions-item>
230
+      <el-descriptions-item label="经营相关" :span="3">
231
+
232
+      </el-descriptions-item>
233
+    </el-descriptions>
234
+  </div>
235
+</template>
236
+
237
+<script>
238
+import { listBudget, updateBudget } from "@/api/oa/budget/budget";
239
+import { listBudgetCar, updateBudgetCar } from "@/api/oa/budget/budgetCar";
240
+import { listBudgetDevice, updateBudgetDevice } from "@/api/oa/budget/budgetDevice";
241
+import { listBudgetSettle, updateBudgetSettle } from "@/api/oa/budget/budgetSettle";
242
+import { listBudgetStaff } from "@/api/oa/budget/budgetStaff";
243
+import { listProjectWork } from "@/api/oa/project/projectWork";
244
+import { listSite } from "@/api/oa/budget/budgetSite.js";
245
+import { getProject } from "@/api/oa/project/project";
246
+import InnerStaffCost from './components/InnerStaffCost.vue';
247
+import OuterStaffCost from './components/OuterStaffCost.vue';
248
+import CarCost from './components/CarCost.vue';
249
+import DeviceCost from './components/DeviceCost.vue';
250
+
251
+export default {
252
+  components: {
253
+    InnerStaffCost,
254
+    OuterStaffCost,
255
+    CarCost,
256
+    DeviceCost
257
+  },
258
+  props: {
259
+    taskForm: {
260
+      type: Object,
261
+      require: true
262
+    },
263
+    taskName: {
264
+      type: String,
265
+    }
266
+  },
267
+  data() {
268
+    return {
269
+      loading: true,
270
+      budgetForm: {},
271
+      project: {},
272
+      workContentList: [],
273
+      workList: [],
274
+      innerStaffList: [],
275
+      outerStaffList: [],
276
+      carList: [],
277
+      deviceList: [],
278
+      siteList: [],
279
+    }
280
+  },
281
+  created() {
282
+    this.initBudgetForm();
283
+    this.getProjectWorkList();
284
+  },
285
+  methods: {
286
+    initBudgetForm() {
287
+      this.loading = true;
288
+      listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(async res => {
289
+        this.budgetForm = res.rows[0];
290
+        if (this.budgetForm) {
291
+          const budgetId = this.budgetForm.budgetId;
292
+          // 获取设备数据
293
+          let deviceRes = await listBudgetDevice({ pageSize: 100, budgetId });
294
+          this.deviceList = deviceRes.rows;
295
+
296
+          // 获取车辆数据
297
+          let carRes = await listBudgetCar({ pageSize: 100, budgetId });
298
+          this.carList = carRes.rows;
299
+
300
+          // 获取内业人员数据
301
+          let innerStaffRes = await listBudgetStaff({ pageSize: 100, budgetId, type: '内业' });
302
+          this.innerStaffList = innerStaffRes.rows;
303
+
304
+          // 获取外业人员数据
305
+          let outerStaffRes = await listBudgetStaff({ pageSize: 100, budgetId, type: '外业' });
306
+          this.outerStaffList = outerStaffRes.rows;
307
+
308
+          // 获取内业绩效额数据
309
+          let settleRes = await listBudgetSettle({ pageSize: 100, budgetId });
310
+          this.workList = settleRes.rows;
311
+          for (let work of this.workList) {
312
+            if (work.groundType == '0') {
313
+              work.price = work.cmcPrice.commonPrice
314
+              work.scaleGrade = work.cmcPrice.scaleGrade
315
+              work.unit = work.cmcPrice.unit
316
+            } else {
317
+              work.price = work.cmcPrice.complexPrice
318
+              work.scaleGrade = work.cmcPrice.scaleGrade
319
+              work.unit = work.cmcPrice.unit
320
+            }
321
+          }
322
+          // 获取现场开支
323
+          let siteRes = await listSite({ pageSize: 100, budgetId });
324
+          this.siteList = siteRes.rows;
325
+        }
326
+        this.loading = false;
327
+      }).catch(() => {
328
+        this.loading = false;
329
+      });
330
+    },
331
+    getProjectWorkList() {
332
+      getProject(this.taskForm.formId).then(res => {
333
+        this.project = res.data;
334
+      })
335
+      listProjectWork({ pageSize: 999, projectId: this.taskForm.formId }).then(res => {
336
+        this.workContentList = res.rows;
337
+      })
338
+    },
339
+    // 处理内业人员数据变化
340
+    handleInnerStaffChange(newList) {
341
+      this.innerStaffList = newList;
342
+      console.log(newList)
343
+      // 计算内业人员总成本
344
+      const totalAmount = this.innerStaffList.reduce((sum, staff) => {
345
+        return sum + (staff.amountAdjust || 0);
346
+      }, 0);
347
+
348
+      // 更新预算表单中的内业人员成本
349
+      if (this.budgetForm) {
350
+        this.budgetForm.innerStaffAmount = totalAmount;
351
+        // 可以在这里调用API保存数据
352
+        // updateBudget(this.budgetForm);
353
+      }
354
+    },
355
+
356
+    // 处理外业人员数据变化
357
+    handleOuterStaffChange(newList) {
358
+      this.outerStaffList = newList;
359
+      // 计算外业人员总成本
360
+      const totalAmount = this.outerStaffList.reduce((sum, staff) => {
361
+        return sum + (staff.amountAdjust || 0);
362
+      }, 0);
363
+
364
+      // 更新预算表单中的外业人员成本
365
+      if (this.budgetForm) {
366
+        this.budgetForm.outerStaffAmount = totalAmount;
367
+        // 可以在这里调用API保存数据
368
+        // updateBudget(this.budgetForm);
369
+      }
370
+    },
371
+  },
372
+}
373
+</script>
374
+
375
+<style lang="scss" scoped>
376
+.mylabel {
377
+  font-weight: bold;
378
+}
379
+
380
+.main {
381
+  width: 85%;
382
+  margin: 0 auto;
383
+  text-align: center;
384
+}
385
+
386
+.descriptions {
387
+  width: 100%;
388
+  margin: 0 auto;
389
+}
390
+
391
+.amount {
392
+  font-weight: bold;
393
+  font-family:Arial, Helvetica, sans-serif;
394
+}
395
+
396
+table {
397
+  text-align: center;
398
+  border-collapse: collapse;
399
+  margin: 0 auto;
400
+
401
+  /*设置背景颜色*/
402
+  /* background-color: #bfa; */
403
+  td {
404
+    padding: 5px;
405
+  }
406
+}
407
+
408
+.adjust {
409
+  color: #F56C6C;
410
+  width: 120px;
411
+}
412
+
413
+::v-deep .el-descriptions .is-bordered .el-descriptions-item__cell {
414
+  border: 1px solid #838894;
415
+}
416
+
417
+::v-deep .el-descriptions-item__label.is-bordered-label {
418
+  color: #434141;
419
+  background: #eaeaea;
420
+}
421
+</style>

+ 9
- 8
oa-ui/src/views/flowable/form/budget/carTable.vue Datei anzeigen

27
               {{ car.dayCost }}
27
               {{ car.dayCost }}
28
             </td>
28
             </td>
29
             <td>
29
             <td>
30
-              <el-input-number  :controls="false" v-model="car.days" placeholder="请输入天数" @blur="calculateCarTotal(car)"></el-input-number>
30
+              <el-input-number  :controls="false" v-model="car.days" placeholder="请输入天数"
31
+                @blur="calculateCarTotal(car)"></el-input-number>
31
             </td>
32
             </td>
32
-            <td class="carCost">{{ car.expense }}</td>
33
+            <td class="carCost">{{ car.amount }}</td>
33
           </tr>
34
           </tr>
34
           <tr>
35
           <tr>
35
-            <td colspan="3">车辆成本合计</td>
36
-            <td>{{ form.carCost }}</td>
36
+            <td colspan="3"><b>车辆成本合计</b></td>
37
+            <td><b>{{ form.carCost }}</b></td>
37
           </tr>
38
           </tr>
38
         </table>
39
         </table>
39
       </el-form-item>
40
       </el-form-item>
107
     initCarCost() {
108
     initCarCost() {
108
       let carCost = 0;
109
       let carCost = 0;
109
       for (let car of this.chooseCar) {
110
       for (let car of this.chooseCar) {
110
-        carCost = carCost + Number(car.expense);
111
+        carCost = carCost + Number(car.amount);
111
       }
112
       }
112
       this.form.carCost = carCost.toFixed(2)
113
       this.form.carCost = carCost.toFixed(2)
113
     },
114
     },
114
     getChooseCar(val) {
115
     getChooseCar(val) {
115
       this.chooseCar = val;
116
       this.chooseCar = val;
116
       this.openCar = false;
117
       this.openCar = false;
117
-      this.recalculateCost(val, 'expense', 'carCost');
118
+      this.recalculateCost(val, 'amount', 'carCost');
118
     },
119
     },
119
     calculateCarTotal(car) {
120
     calculateCarTotal(car) {
120
       let total = Number(car.dayCost) * Number(car.days);
121
       let total = Number(car.dayCost) * Number(car.days);
121
       let sum = total.toFixed(2);
122
       let sum = total.toFixed(2);
122
       this.$set(car, "depreciation", car.dayCost);
123
       this.$set(car, "depreciation", car.dayCost);
123
-      this.$set(car, "expense", sum);
124
-      this.getCost("expense", "carCost", this.chooseCar);
124
+      this.$set(car, "amount", sum);
125
+      this.getCost("amount", "carCost", this.chooseCar);
125
     },
126
     },
126
     recalculateCost(arr, name, formName) {
127
     recalculateCost(arr, name, formName) {
127
       let sum = arr.reduce((accumulator, item) => {
128
       let sum = arr.reduce((accumulator, item) => {

+ 12
- 11
oa-ui/src/views/flowable/form/budget/deviceTable.vue Datei anzeigen

28
             <td>{{ device.series }}</td>
28
             <td>{{ device.series }}</td>
29
             <td>{{ device.brand }}</td>
29
             <td>{{ device.brand }}</td>
30
             <td>
30
             <td>
31
-              {{ device.dayCost }}
31
+              {{ device.depreciation }}
32
             </td>
32
             </td>
33
             <td>
33
             <td>
34
-              <el-input v-model="device.days" placeholder="请输入天数" @blur="calculateDeviceTotal(device)"></el-input>
34
+              <el-input-number :controls="false" v-model="device.days" placeholder="请输入天数"
35
+                @blur="calculateDeviceTotal(device)"></el-input-number>
35
             </td>
36
             </td>
36
-            <td class="deviceCost">{{ device.depreciation }}</td>
37
+            <td class="deviceCost">{{ device.amount }}</td>
37
           </tr>
38
           </tr>
38
           <tr>
39
           <tr>
39
-            <td colspan="5">设备成本合计</td>
40
-            <td>{{ form.deviceCost }}</td>
40
+            <td colspan="5"><b>设备成本合计</b></td>
41
+            <td><b>{{ form.deviceCost }}</b></td>
41
           </tr>
42
           </tr>
42
         </table>
43
         </table>
43
       </el-form-item>
44
       </el-form-item>
98
           this.chooseDevice = res.rows;
99
           this.chooseDevice = res.rows;
99
           for (let device of this.chooseDevice) {
100
           for (let device of this.chooseDevice) {
100
             device.brand = device.device.brand
101
             device.brand = device.device.brand
101
-            device.dayCost = device.device.dayCost
102
+            device.depreciation = device.device.dayCost
102
             device.name = device.device.name
103
             device.name = device.device.name
103
             device.series = device.device.series
104
             device.series = device.device.series
104
           }
105
           }
109
     initDeviceCost() {
110
     initDeviceCost() {
110
       let deviceCost = 0;
111
       let deviceCost = 0;
111
       for (let device of this.chooseDevice) {
112
       for (let device of this.chooseDevice) {
112
-        deviceCost = deviceCost + Number(device.depreciation);
113
+        deviceCost = deviceCost + Number(device.amount);
113
       }
114
       }
114
       this.form.deviceCost = deviceCost.toFixed(2)
115
       this.form.deviceCost = deviceCost.toFixed(2)
115
     },
116
     },
116
     getChooseDevice(val) {
117
     getChooseDevice(val) {
117
       this.chooseDevice = val;
118
       this.chooseDevice = val;
118
       this.openDevice = false;
119
       this.openDevice = false;
119
-      this.recalculateCost(val, 'depreciation', 'deviceCost');
120
+      this.recalculateCost(val, 'amount', 'deviceCost');
120
     },
121
     },
121
     calculateDeviceTotal(device) {
122
     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);
123
+      let total = Number(device.depreciation) * Number(device.days);
124
+      this.$set(device, "amount", total.toFixed(2));
125
+      this.getCost("amount", "deviceCost", this.chooseDevice);
125
     },
126
     },
126
     recalculateCost(arr, name, formName) {
127
     recalculateCost(arr, name, formName) {
127
       let sum = arr.reduce((accumulator, item) => {
128
       let sum = arr.reduce((accumulator, item) => {

+ 1
- 1
oa-ui/src/views/flowable/form/budget/moneyTable.vue Datei anzeigen

135
             </td>
135
             </td>
136
           </tr>
136
           </tr>
137
           <tr>
137
           <tr>
138
-            <td colspan="10">内业预算绩效合计</td>
138
+            <td colspan="10">内业预算绩效总额</td>
139
             <td colspan="1">{{ Number(settle).toFixed(2) }}</td>
139
             <td colspan="1">{{ Number(settle).toFixed(2) }}</td>
140
           </tr>
140
           </tr>
141
         </table>
141
         </table>

+ 20
- 2
oa-ui/src/views/flowable/form/budget/otherTable.vue Datei anzeigen

2
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-12-11 17:21:00
3
  * @Date: 2024-12-11 17:21:00
4
  * @LastEditors: Please set LastEditors
4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2025-05-06 17:15:03
5
+ * @LastEditTime: 2025-05-12 16:16:45
6
 -->
6
 -->
7
 <template>
7
 <template>
8
   <div>
8
   <div>
9
-    <el-form :model="form" style="padding: 20px 100px 0">
9
+    <el-form :model="form" style="padding: 20px 100px 0" :disabled="disabled">
10
       <el-form-item label="经营相关:">
10
       <el-form-item label="经营相关:">
11
         <table border="1">
11
         <table border="1">
12
           <tr class="head">
12
           <tr class="head">
64
               <el-input type="textarea" v-model="form.businessRemark"></el-input>
64
               <el-input type="textarea" v-model="form.businessRemark"></el-input>
65
             </td>
65
             </td>
66
           </tr>
66
           </tr>
67
+          <tr>
68
+            <td><b>经营相关总计</b></td>
69
+            <td><b>{{ totalAmount }}</b></td>
70
+            <td></td>
71
+          </tr>
67
         </table>
72
         </table>
68
       </el-form-item>
73
       </el-form-item>
69
     </el-form>
74
     </el-form>
77
     budgetForm: {
82
     budgetForm: {
78
       type: Object,
83
       type: Object,
79
       default: ''
84
       default: ''
85
+    },
86
+    disabled: {
87
+      type: Boolean,
88
+      default: true
80
     }
89
     }
81
   },
90
   },
82
   data() {
91
   data() {
90
       }
99
       }
91
     }
100
     }
92
   },
101
   },
102
+  computed: {
103
+    totalAmount() {
104
+      return this.safeNumber(this.form.outExpense) +
105
+        this.safeNumber(this.form.letterExpense) +
106
+        this.safeNumber(this.form.winExpense) +
107
+        this.safeNumber(this.form.taxExpense) +
108
+        this.safeNumber(this.form.travelExpense);
109
+    }
110
+  },
93
   watch: {
111
   watch: {
94
     budgetForm: {
112
     budgetForm: {
95
       handler(newVal) {
113
       handler(newVal) {

+ 224
- 176
oa-ui/src/views/flowable/form/budget/siteExpenses.vue Datei anzeigen

1
-<template>
2
-  <div>
3
-    <el-form ref="form" :model="form" style="padding: 20px 100px 0">
4
-      <el-form-item label="现场开支:">
5
-        <div style="color:#F56C6C">现场开支与借款挂钩,请慎重填写</div>
6
-        <table border="1">
7
-          <tr>
8
-            <td colspan="5" class="head">现场开支表</td>
9
-          </tr>
10
-          <tr>
11
-            <td>序号</td>
12
-            <td>名称</td>
13
-            <td>金额</td>
14
-            <td>备注</td>
15
-            <td>操作</td>
16
-          </tr>
17
-          <tr v-for="item, index in expensesList">
18
-            <td>{{ index + 1 }}</td>
19
-            <td>
20
-              <el-select v-model="item.name" placeholder="请选择开支项" clearable @change="handleExpenseChange"
21
-                style="width: 100%;">
22
-                <el-option v-for="dict in dict.type.borrow_expenses" clearable :key="dict.value" :label="dict.label"
23
-                  :value="dict.value" />
24
-                <el-option label="+新增更多开支项..." value="new_expense" />
25
-              </el-select>
26
-            </td>
27
-            <td>
28
-              <el-input-number style="width: 100%;" :controls="false" v-model="item.amount"
29
-                placeholder="请输入金额"></el-input-number>
30
-            </td>
31
-            <td>
32
-              <el-input type="textarea" v-model="item.remark"></el-input>
33
-            </td>
34
-            <td>
35
-              <el-button icon="el-icon-delete" type="text" style="color:#F56C6C"
36
-                @click="deletExpensesList(index)">删除</el-button>
37
-            </td>
38
-          </tr>
39
-        </table>
40
-        <el-button type="primary" plain icon="el-icon-plus" @click="addExpensesList" size="mini"></el-button>
41
-      </el-form-item>
42
-    </el-form>
43
-    <el-dialog title="新增开支项" :visible.sync="open" width="400px" append-to-body>
44
-      <el-form ref="newExpenseForm" :model="newExpenseForm" :rules="newExpenseRules" label-width="120px">
45
-        <el-form-item label="开支项名称" prop="name">
46
-          <el-input v-model="newExpenseForm.name" placeholder="请输入开支项名称" />
47
-        </el-form-item>
48
-      </el-form>
49
-      <div slot="footer" class="dialog-footer">
50
-        <el-button type="primary" @click="submitNewExpense">确 定</el-button>
51
-        <el-button @click="open = false">取 消</el-button>
52
-      </div>
53
-    </el-dialog>
54
-  </div>
55
-</template>
56
-
57
-<script>
58
-import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
59
-export default {
60
-  dicts: ['borrow_expenses', 'cmc_unit'],
61
-  props: {
62
-    outerUsers: {
63
-      type: Array,
64
-      default: () => []
65
-    }
66
-  },
67
-  watch: {
68
-    expensesList: {
69
-      handler(newVal) {
70
-        this.$emit('expensesList', [...newVal])
71
-      },
72
-    }
73
-  },
74
-  data() {
75
-    return {
76
-      open: false,
77
-      form: {},
78
-      expensesList: [{
79
-        name: '',
80
-        amount: 0,
81
-      }],
82
-      newExpenseForm: {
83
-        name: ''
84
-      },
85
-      newExpenseRules: {
86
-        name: [
87
-          { required: true, message: "开支项不能为空", trigger: "blur" }
88
-        ],
89
-      }
90
-    }
91
-  },
92
-  created() {
93
-    console.log(this.dict);
94
-  },
95
-  methods: {
96
-    addExpensesList() {
97
-      this.expensesList.push({
98
-        name: '',
99
-        amount: 0,
100
-      });
101
-    },
102
-    deletExpensesList(index) {
103
-      let arr = this.expensesList;
104
-      if (arr.length == 1) {
105
-        return;
106
-      }
107
-      if (index >= 0 && index < arr.length) {
108
-        arr.splice(index, 1);
109
-      }
110
-    },
111
-    handleExpenseChange(value) {
112
-      if (value === 'new_expense') {
113
-        this.open = true;
114
-      } else if (value === '食宿') {
115
-        const currentIndex = this.expensesList.findIndex(item => item.name === value);
116
-        if (currentIndex !== -1) {
117
-          const totalDays = this.outerUsers.reduce((sum, user) => sum + (user.days || 0), 0);
118
-          this.expensesList[currentIndex].amount = 130 * totalDays;
119
-          this.expensesList[currentIndex].remark = '130元/人天,共计' + totalDays + '人天';
120
-        }
121
-      }
122
-    },
123
-    submitNewExpense() {
124
-      this.$refs["newExpenseForm"].validate(valid => {
125
-        if (valid) {
126
-          this.newExpenseForm.dictType = 'borrow_expenses';
127
-          this.newExpenseForm.dictLabel = this.newExpenseForm.name;
128
-          this.newExpenseForm.dictValue = this.newExpenseForm.name;
129
-          this.newExpenseForm.listClass = 'default'
130
-          addData(this.newExpenseForm).then(response => {
131
-            this.$modal.msgSuccess("新增成功");
132
-            this.open = false;
133
-            this.newExpenseForm.name = '';
134
-            // 刷新字典数据
135
-            this.getDicts("borrow_expenses").then(response => {
136
-              console.log(response.data);
137
-              // 更新字典数据
138
-              this.dict.type.borrow_expenses = response.data;
139
-              // 重新加载字典数据后,更新当前选中项
140
-              if (this.expensesList.length > 0) {
141
-                const lastItem = this.expensesList[this.expensesList.length - 1];
142
-                lastItem.name = this.newExpenseForm.dictValue;
143
-              }
144
-            });
145
-          });
146
-        }
147
-      })
148
-    }
149
-  }
150
-}
151
-</script>
152
-
153
-<style lang="scss" scoped>
154
-table {
155
-  width: 100%;
156
-  /*居中*/
157
-  // margin: 0 auto;
158
-  /*边框*/
159
-  /* border: 1px solid black; */
160
-  text-align: center;
161
-  border-collapse: collapse;
162
-  border: 1px solid #DCDFE6;
163
-
164
-  /*设置背景颜色*/
165
-  /* background-color: #bfa; */
166
-  td {
167
-    padding: 1px;
168
-  }
169
-
170
-  .head {
171
-    background-color: #e7f6f3;
172
-    font-family: '微软雅黑';
173
-    font-size: 18;
174
-    font-weight: bold;
175
-  }
176
-}
1
+<template>
2
+  <div>
3
+    <el-form ref="form" :model="form" style="padding: 20px 100px 0">
4
+      <el-form-item label="现场开支:">
5
+        <div style="color:#F56C6C">现场开支与借款挂钩,请慎重填写</div>
6
+        <table border="1">
7
+          <tr>
8
+            <td colspan="5" class="head">现场开支表</td>
9
+          </tr>
10
+          <tr>
11
+            <td>序号</td>
12
+            <td>名称</td>
13
+            <td>金额</td>
14
+            <td>备注</td>
15
+            <td>操作</td>
16
+          </tr>
17
+          <tr v-for="item, index in expensesList">
18
+            <td>{{ index + 1 }}</td>
19
+            <td>
20
+              <el-select v-model="item.name" placeholder="请选择开支项" clearable @change="handleExpenseChange"
21
+                style="width: 100%;">
22
+                <el-option v-for="dict in dict.type.cmc_borrow_expense" clearable :key="dict.value" :label="dict.label"
23
+                  :value="dict.value" />
24
+                <el-option label="+新增更多开支项..." value="new_expense" />
25
+              </el-select>
26
+            </td>
27
+            <td>
28
+              <el-input-number style="width: 100%;" :controls="false" v-model="item.amount"
29
+                placeholder="请输入金额"></el-input-number>
30
+            </td>
31
+            <td>
32
+              <el-input type="textarea" v-model="item.remark"></el-input>
33
+            </td>
34
+            <td>
35
+              <el-button icon="el-icon-delete" type="text" style="color:#F56C6C"
36
+                @click="deletExpensesList(index)">删除</el-button>
37
+            </td>
38
+          </tr>
39
+          <tr>
40
+            <td colspan="2" style="text-align: right; font-weight: bold;">现场开支总计:</td>
41
+            <td style="font-weight: bold;">{{ totalAmount }}</td>
42
+            <td colspan="2"></td>
43
+          </tr>
44
+        </table>
45
+        <el-button type="primary" plain icon="el-icon-plus" @click="addExpensesList" size="mini"></el-button>
46
+      </el-form-item>
47
+    </el-form>
48
+    <el-dialog title="新增开支项" :visible.sync="open" width="400px" append-to-body>
49
+      <el-form ref="newExpenseForm" :model="newExpenseForm" :rules="newExpenseRules" label-width="120px">
50
+        <el-form-item label="开支项名称" prop="name">
51
+          <el-input v-model="newExpenseForm.name" placeholder="请输入开支项名称" />
52
+        </el-form-item>
53
+      </el-form>
54
+      <div slot="footer" class="dialog-footer">
55
+        <el-button type="primary" @click="submitNewExpense">确 定</el-button>
56
+        <el-button @click="open = false">取 消</el-button>
57
+      </div>
58
+    </el-dialog>
59
+  </div>
60
+</template>
61
+
62
+<script>
63
+import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
64
+import { listSite, getSite, delSite, addSite, updateSite } from "@/api/oa/budget/budgetSite.js";
65
+export default {
66
+  dicts: ['cmc_borrow_expense', 'cmc_unit'],
67
+  props: {
68
+    outerUsers: {
69
+      type: Array,
70
+      default: () => []
71
+    },
72
+    budgetId: {
73
+      type: String,
74
+      default: ''
75
+    },
76
+  },
77
+  watch: {
78
+    expensesList: {
79
+      handler(newVal) {
80
+        this.$emit('expensesList', [...newVal])
81
+      },
82
+    },
83
+    budgetId() {
84
+      this.initTable()
85
+    },
86
+  },
87
+  data() {
88
+    return {
89
+      open: false,
90
+      form: {},
91
+      expensesList: [{
92
+        name: '',
93
+        amount: 0,
94
+        remark: '',
95
+      }],
96
+      newExpenseForm: {
97
+        name: ''
98
+      },
99
+      newExpenseRules: {
100
+        name: [
101
+          { required: true, message: "开支项不能为空", trigger: "blur" }
102
+        ],
103
+      }
104
+    }
105
+  },
106
+  computed: {
107
+    totalAmount() {
108
+      let sum = this.expensesList.reduce((sum, item) => sum + (Number(item.amount) || 0), 0);
109
+      this.$emit('siteSum', sum.toFixed(2))
110
+      return sum.toFixed(2);
111
+    }
112
+  },
113
+  created() {
114
+
115
+  },
116
+  methods: {
117
+    initTable() {
118
+      if (this.budgetId != '') {
119
+        listSite({ pageSize: 100, budgetId: this.budgetId }).then(res => {
120
+          if (res.rows.length > 0) {
121
+            this.expensesList = res.rows;
122
+          } else {
123
+            this.expensesList = [{
124
+              name: '',
125
+              amount: 0,
126
+              remark: '',
127
+            }];
128
+          }
129
+        })
130
+      }
131
+    },
132
+    addExpensesList() {
133
+      this.expensesList.push({
134
+        name: '',
135
+        amount: 0,
136
+      });
137
+    },
138
+    deletExpensesList(index) {
139
+      let arr = this.expensesList;
140
+      if (arr.length == 1) {
141
+        return;
142
+      }
143
+      if (index >= 0 && index < arr.length) {
144
+        const item = arr[index];
145
+        if (item.id) {
146
+          // If the item has an ID, it exists in the database, so delete it
147
+          delSite(item.id).then(response => {
148
+            this.$modal.msgSuccess("删除成功");
149
+            arr.splice(index, 1);
150
+          }).catch(() => {
151
+            this.$modal.msgError("删除失败");
152
+          });
153
+        } else {
154
+          // If the item doesn't have an ID, just remove it from the array
155
+          arr.splice(index, 1);
156
+        }
157
+      }
158
+    },
159
+    handleExpenseChange(value) {
160
+      if (value === 'new_expense') {
161
+        this.open = true;
162
+      } else if (value === '食宿') {
163
+        const currentIndex = this.expensesList.findIndex(item => item.name === value);
164
+        if (currentIndex !== -1) {
165
+          const totalDays = this.outerUsers.reduce((sum, user) => sum + (user.days || 0), 0);
166
+          this.expensesList[currentIndex].amount = 130 * totalDays;
167
+          this.expensesList[currentIndex].remark = '130元/人天,共计' + totalDays + '人天';
168
+        }
169
+      }
170
+    },
171
+    submitNewExpense() {
172
+      this.$refs["newExpenseForm"].validate(valid => {
173
+        if (valid) {
174
+          this.newExpenseForm.dictType = 'cmc_borrow_expense';
175
+          this.newExpenseForm.dictLabel = this.newExpenseForm.name;
176
+          this.newExpenseForm.dictValue = this.newExpenseForm.name;
177
+          this.newExpenseForm.listClass = 'default'
178
+          addData(this.newExpenseForm).then(response => {
179
+            this.$modal.msgSuccess("新增成功");
180
+            this.open = false;
181
+            this.newExpenseForm.name = '';
182
+            // 刷新字典数据
183
+            this.getDicts("cmc_borrow_expense").then(response => {
184
+              console.log(response.data);
185
+              // 更新字典数据
186
+              this.dict.type.cmc_borrow_expense = response.data;
187
+              // 重新加载字典数据后,更新当前选中项
188
+              if (this.expensesList.length > 0) {
189
+                const lastItem = this.expensesList[this.expensesList.length - 1];
190
+                lastItem.name = this.newExpenseForm.dictValue;
191
+              }
192
+            });
193
+          });
194
+        }
195
+      })
196
+    }
197
+  }
198
+}
199
+</script>
200
+
201
+<style lang="scss" scoped>
202
+table {
203
+  width: 100%;
204
+  /*居中*/
205
+  // margin: 0 auto;
206
+  /*边框*/
207
+  /* border: 1px solid black; */
208
+  text-align: center;
209
+  border-collapse: collapse;
210
+  border: 1px solid #DCDFE6;
211
+
212
+  /*设置背景颜色*/
213
+  /* background-color: #bfa; */
214
+  td {
215
+    padding: 1px;
216
+  }
217
+
218
+  .head {
219
+    background-color: #e7f6f3;
220
+    font-family: '微软雅黑';
221
+    font-size: 18;
222
+    font-weight: bold;
223
+  }
224
+}
177
 </style>
225
 </style>

+ 16
- 7
oa-ui/src/views/flowable/form/budget/staffTable.vue Datei anzeigen

37
             <td>{{ user.nickName }}</td>
37
             <td>{{ user.nickName }}</td>
38
             <td>{{ user.dept ? user.dept.deptName : user.deptName }}</td>
38
             <td>{{ user.dept ? user.dept.deptName : user.deptName }}</td>
39
             <td>
39
             <td>
40
-              {{ parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) }}
40
+              {{ user.dayCost }}
41
             </td>
41
             </td>
42
             <td>
42
             <td>
43
               <el-input-number :controls="false" v-model="user.days" placeholder="请输入天数"
43
               <el-input-number :controls="false" v-model="user.days" placeholder="请输入天数"
95
             <td>{{ user.nickName }}</td>
95
             <td>{{ user.nickName }}</td>
96
             <td>{{ user.dept ? user.dept.deptName : user.deptName }}</td>
96
             <td>{{ user.dept ? user.dept.deptName : user.deptName }}</td>
97
             <td>
97
             <td>
98
-              {{ parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) }}
98
+              {{ user.dayCost }}
99
             </td>
99
             </td>
100
             <td>
100
             <td>
101
               <el-input-number :controls="false" v-model="user.days" placeholder="请输入天数"
101
               <el-input-number :controls="false" v-model="user.days" placeholder="请输入天数"
212
       if (this.budgetId != '') {
212
       if (this.budgetId != '') {
213
         listBudgetStaff({ pageSize: 100, budgetId: this.budgetId }).then((res) => {
213
         listBudgetStaff({ pageSize: 100, budgetId: this.budgetId }).then((res) => {
214
           const allUsers = res.rows;
214
           const allUsers = res.rows;
215
-          this.innerUsers = allUsers.filter(user => user.type === 'inner');
216
-          this.outerUsers = allUsers.filter(user => user.type === 'outer');
215
+          this.innerUsers = allUsers.filter(user => user.type === '内业');
216
+          this.outerUsers = allUsers.filter(user => user.type === '外业');
217
           for (let user of [...this.innerUsers, ...this.outerUsers]) {
217
           for (let user of [...this.innerUsers, ...this.outerUsers]) {
218
             user.nickName = this.getUserName(user.userId);
218
             user.nickName = this.getUserName(user.userId);
219
             user.deptName = this.getDeptName(user.user.deptId);
219
             user.deptName = this.getDeptName(user.user.deptId);
285
         v.staffCost = 0; // 初始化成本为0
285
         v.staffCost = 0; // 初始化成本为0
286
         v.coefficient = 1; // 初始化系数为1
286
         v.coefficient = 1; // 初始化系数为1
287
         v.otherCoefficient = 1; // 初始化其他系数为1
287
         v.otherCoefficient = 1; // 初始化其他系数为1
288
+        v.userDays = parseFloat(((v.salary.salary + 1780) * 12) / 365).toFixed(2);
288
       }
289
       }
289
       if (this.currentType === 'inner') {
290
       if (this.currentType === 'inner') {
290
         this.innerUsers = val;
291
         this.innerUsers = val;
312
       let total = 0;
313
       let total = 0;
313
       if (user.type === '内业') {
314
       if (user.type === '内业') {
314
         // 内业人员计算方式不变
315
         // 内业人员计算方式不变
315
-        total = parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) * Number(user.days) + Number(user.performance);
316
+        // if (user.dayCost) {
317
+        // } else {
318
+        //   user.dayCost = parseFloat(((user.salary.salary + 1780) * 12) / 365).toFixed(2)
319
+        // }
320
+        // total = user.dayCost * Number(user.days) + Number(user.performance);
316
       } else {
321
       } else {
317
         // 外业人员计算方式
322
         // 外业人员计算方式
318
-        user.performance = 200 * Number(user.days) * Number(user.coefficient) * Number(user.otherCoefficient);
319
-        total = parseFloat((user.salary.salary + 1780) / 21.75).toFixed(2) * Number(user.days) + Number(user.performance);
323
+        user.performance = 200 * Number(user.days) * Number(user.coefficient);
320
       }
324
       }
325
+      if (user.dayCost) {
326
+      } else {
327
+        user.dayCost = parseFloat(((user.salary.salary + 1780) * 12) / 365).toFixed(2)
328
+      }
329
+      total = user.dayCost * Number(user.days) + Number(user.performance);
321
 
330
 
322
       if (isNaN(total)) {
331
       if (isNaN(total)) {
323
         total = 0
332
         total = 0

Laden…
Abbrechen
Speichern