Преглед изворни кода

导出核算数据,同一项目多个预算和核算的新增和查询

qyx пре 5 месеци
родитељ
комит
549f09500d

+ 1
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBudgetOtherController.java Прегледај датотеку

33
  * @date 2025-05-09
33
  * @date 2025-05-09
34
  */
34
  */
35
 @RestController
35
 @RestController
36
-@RequestMapping("/oa/other")
36
+@RequestMapping("/oa/budgetOther")
37
 public class CmcBudgetOtherController extends BaseController
37
 public class CmcBudgetOtherController extends BaseController
38
 {
38
 {
39
     @Autowired
39
     @Autowired

+ 1
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcBudgetSiteController.java Прегледај датотеку

27
  * @date 2025-05-09
27
  * @date 2025-05-09
28
  */
28
  */
29
 @RestController
29
 @RestController
30
-@RequestMapping("/oa/site")
30
+@RequestMapping("/oa/budgetSite")
31
 public class CmcBudgetSiteController extends BaseController
31
 public class CmcBudgetSiteController extends BaseController
32
 {
32
 {
33
     @Autowired
33
     @Autowired

+ 1
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcBudgetMapper.xml Прегледај датотеку

99
     <select id="selectCmcBudgetList" parameterType="CmcBudget" resultMap="CmcBudgetResult">
99
     <select id="selectCmcBudgetList" parameterType="CmcBudget" resultMap="CmcBudgetResult">
100
         <include refid="selectCmcBudgetVo"/>
100
         <include refid="selectCmcBudgetVo"/>
101
         <where>
101
         <where>
102
+            <if test="budgetId != null  and budgetId != ''"> and b.budget_id = #{budgetId}</if>
102
             <if test="projectId != null  and projectId != ''"> and b.project_id = #{projectId}</if>
103
             <if test="projectId != null  and projectId != ''"> and b.project_id = #{projectId}</if>
103
             <if test="staffCost != null "> and b.staff_cost = #{staffCost}</if>
104
             <if test="staffCost != null "> and b.staff_cost = #{staffCost}</if>
104
             <if test="carCost != null "> and b.car_cost = #{carCost}</if>
105
             <if test="carCost != null "> and b.car_cost = #{carCost}</if>

+ 5
- 5
oa-ui/src/api/oa/budget/budgetOther.js Прегледај датотеку

9
 // 查询cmc预算外开支列表
9
 // 查询cmc预算外开支列表
10
 export function listOther(query) {
10
 export function listOther(query) {
11
   return request({
11
   return request({
12
-    url: '/oa/other/list',
12
+    url: '/oa/budgetOther/list',
13
     method: 'get',
13
     method: 'get',
14
     params: query
14
     params: query
15
   })
15
   })
18
 // 查询cmc预算外开支详细
18
 // 查询cmc预算外开支详细
19
 export function getOther(expenseId) {
19
 export function getOther(expenseId) {
20
   return request({
20
   return request({
21
-    url: '/oa/other/' + expenseId,
21
+    url: '/oa/budgetOther/' + expenseId,
22
     method: 'get'
22
     method: 'get'
23
   })
23
   })
24
 }
24
 }
26
 // 新增cmc预算外开支
26
 // 新增cmc预算外开支
27
 export function addOther(data) {
27
 export function addOther(data) {
28
   return request({
28
   return request({
29
-    url: '/oa/other',
29
+    url: '/oa/budgetOther',
30
     method: 'post',
30
     method: 'post',
31
     data: data
31
     data: data
32
   })
32
   })
35
 // 修改cmc预算外开支
35
 // 修改cmc预算外开支
36
 export function updateOther(data) {
36
 export function updateOther(data) {
37
   return request({
37
   return request({
38
-    url: '/oa/other',
38
+    url: '/oa/budgetOther',
39
     method: 'put',
39
     method: 'put',
40
     data: data
40
     data: data
41
   })
41
   })
44
 // 删除cmc预算外开支
44
 // 删除cmc预算外开支
45
 export function delOther(expenseId) {
45
 export function delOther(expenseId) {
46
   return request({
46
   return request({
47
-    url: '/oa/other/' + expenseId,
47
+    url: '/oa/budgetOther/' + expenseId,
48
     method: 'delete'
48
     method: 'delete'
49
   })
49
   })
50
 }
50
 }

+ 5
- 5
oa-ui/src/api/oa/budget/budgetSite.js Прегледај датотеку

9
 // 查询cmc现场开支列表
9
 // 查询cmc现场开支列表
10
 export function listSite(query) {
10
 export function listSite(query) {
11
   return request({
11
   return request({
12
-    url: '/oa/site/list',
12
+    url: '/oa/budgetSite/list',
13
     method: 'get',
13
     method: 'get',
14
     params: query
14
     params: query
15
   })
15
   })
18
 // 查询cmc现场开支详细
18
 // 查询cmc现场开支详细
19
 export function getSite(expenseId) {
19
 export function getSite(expenseId) {
20
   return request({
20
   return request({
21
-    url: '/oa/site/' + expenseId,
21
+    url: '/oa/budgetSite/' + expenseId,
22
     method: 'get'
22
     method: 'get'
23
   })
23
   })
24
 }
24
 }
26
 // 新增cmc现场开支
26
 // 新增cmc现场开支
27
 export function addSite(data) {
27
 export function addSite(data) {
28
   return request({
28
   return request({
29
-    url: '/oa/site',
29
+    url: '/oa/budgetSite',
30
     method: 'post',
30
     method: 'post',
31
     data: data
31
     data: data
32
   })
32
   })
35
 // 修改cmc现场开支
35
 // 修改cmc现场开支
36
 export function updateSite(data) {
36
 export function updateSite(data) {
37
   return request({
37
   return request({
38
-    url: '/oa/site',
38
+    url: '/oa/budgetSite',
39
     method: 'put',
39
     method: 'put',
40
     data: data
40
     data: data
41
   })
41
   })
44
 // 删除cmc现场开支
44
 // 删除cmc现场开支
45
 export function delSite(expenseId) {
45
 export function delSite(expenseId) {
46
   return request({
46
   return request({
47
-    url: '/oa/site/' + expenseId,
47
+    url: '/oa/budgetSite/' + expenseId,
48
     method: 'delete'
48
     method: 'delete'
49
   })
49
   })
50
 }
50
 }

+ 63
- 12
oa-ui/src/views/flowable/form/budget/addBudget.vue Прегледај датотеку

141
       <return-btn :taskForm="taskForm" :comment="commentByRole()" @goBack="$emit('goBack')" @saves=""
141
       <return-btn :taskForm="taskForm" :comment="commentByRole()" @goBack="$emit('goBack')" @saves=""
142
         @cancel="returnOpen = false"></return-btn>
142
         @cancel="returnOpen = false"></return-btn>
143
     </el-dialog>
143
     </el-dialog>
144
+    <!-- 选择修改有多个预算的项目中的预算 -->
145
+    <el-dialog title="选择要修改的预算" :visible.sync="updateData" :close-on-click-modal="false"
146
+      :close-on-press-escape="false" :show-close="false"  width="30%" append-to-body>
147
+        <el-select v-model="selectedBudget" placeholder="请选择" style="width:100%">
148
+          <el-option
149
+            v-for="item in budgets"
150
+            :key="item.budgetId"
151
+            :label="item.project.projectName +'_'+ item.createTime"
152
+            :value="item.budgetId">
153
+          </el-option>
154
+        </el-select>
155
+        <div style="text-align: center">
156
+          <el-button type="success" style=" margin-top: 10px;"  @click="getBudgeNeesUpdate()">确定</el-button>
157
+        </div>
158
+    </el-dialog>
144
   </div>
159
   </div>
145
 </template>
160
 </template>
146
 
161
 
165
 import SiteExpenses from "./siteExpenses.vue";
180
 import SiteExpenses from "./siteExpenses.vue";
166
 import BudgetAdjust from "./adjust/budgetAdjust.vue";
181
 import BudgetAdjust from "./adjust/budgetAdjust.vue";
167
 import NewBudgetInfo from './adjust/newBudgetInfo.vue';
182
 import NewBudgetInfo from './adjust/newBudgetInfo.vue';
183
+import { toStringHDMS } from 'ol/coordinate';
168
 
184
 
169
 export default {
185
 export default {
170
   components: {
186
   components: {
189
         fixCost: 0,
205
         fixCost: 0,
190
         directExpense: 0,
206
         directExpense: 0,
191
         totalBudget: 0,
207
         totalBudget: 0,
208
+        procInstId: "",
192
       },
209
       },
193
       flag: false,
210
       flag: false,
194
       project: {},
211
       project: {},
197
       viewOpen: false,
214
       viewOpen: false,
198
       innerSettleLimit: 0, // 内业预算绩效合计限制
215
       innerSettleLimit: 0, // 内业预算绩效合计限制
199
       outerUsers: [], // 存储外业人员
216
       outerUsers: [], // 存储外业人员
217
+      updateData:false,
218
+      selectedBudget:"",
219
+      budgets:{},
200
     };
220
     };
201
   },
221
   },
202
   props: {
222
   props: {
227
     this.initBudgetForm();
247
     this.initBudgetForm();
228
   },
248
   },
229
   methods: {
249
   methods: {
230
-    initBudgetForm() {
231
-      listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(
232
-        res => {
233
-          if (res.rows[0] && res.rows[0].budgetId) {
250
+    async initBudgetForm() {
251
+      const params = { pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }
252
+      let res = await listBudget(params)
253
+      if (res.rows[0] && res.rows[0].budgetId){
254
+        // 如项目下已有预算,询问是新建预算还是修改原有预算
255
+        try{
256
+          await this.$confirm('该项目下已有预算,请选择修改已有预算还是创建新预算','系统提示',{
257
+                              distinguishCancelAndClose: true,confirmButtonText: '创建新预算',
258
+                              cancelButtonText: '修改已有预算',showClose: false, 
259
+                              closeOnClickModal: false, closeOnPressEscape: false});
260
+          this.flag = false;
261
+          this.budgetForm.projectId = this.taskForm.formId;
262
+          this.budgetForm.budgetId = new Snowflake(1n, 1n, 0n).nextId().toString();
263
+          this.budgetForm.procInstId = this.taskForm.procInsId;
264
+        }catch(action){
265
+          if (action === 'cancel') {
234
             this.flag = true;
266
             this.flag = true;
235
-            this.budgetForm = res.rows[0];
236
-            this.budgetId = res.rows[0].budgetId;
237
-          } else {
238
-            this.flag = false;
239
-            this.budgetForm.projectId = this.taskForm.formId;
240
-          }
267
+            this.budgets = res.rows;
268
+            this.updateData = true;
269
+            // this.budgetForm = res.rows[0];
270
+            // this.budgetId = res.rows[0].budgetId;
241
         }
271
         }
242
-      );
272
+      }}else {
273
+          this.flag = false;
274
+          this.budgetForm.projectId = this.taskForm.formId;
275
+          this.budgetForm.procInstId = this.taskForm.procInsId;
276
+      }
277
+      // listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(
278
+      //   res => {
279
+      //     if (res.rows[0] && res.rows[0].budgetId) {
280
+      //       this.flag = true;
281
+      //       this.budgetForm = res.rows[0];
282
+      //       this.budgetId = res.rows[0].budgetId;
283
+      //     } else {
284
+      //       this.flag = false;
285
+      //       this.budgetForm.projectId = this.taskForm.formId;
286
+      //     }
287
+      //   }
288
+      // );
243
     },
289
     },
244
     getProjectInfo() {
290
     getProjectInfo() {
245
       getProject(this.taskForm.formId).then(response => {
291
       getProject(this.taskForm.formId).then(response => {
436
       if (val == "") {
482
       if (val == "") {
437
         this.budgetForm.document = ""
483
         this.budgetForm.document = ""
438
       }
484
       }
439
-    }
485
+    },
486
+    getBudgeNeesUpdate(){
487
+      this.budgetForm = this.budgets.find(item => item.budgetId === this.selectedBudget);
488
+      this.budgetId = this.selectedBudget;
489
+      this.updateData =false;
490
+   }
440
   },
491
   },
441
 };
492
 };
442
 </script>
493
 </script>

+ 1
- 0
oa-ui/src/views/flowable/form/budget/adjust/adjustIndex.vue Прегледај датотеку

50
           </el-table-column>
50
           </el-table-column>
51
           <el-table-column label="项目编号" align="center" prop="project.projectNumber" />
51
           <el-table-column label="项目编号" align="center" prop="project.projectNumber" />
52
           <el-table-column label="项目名称" align="center" prop="project.projectName" />
52
           <el-table-column label="项目名称" align="center" prop="project.projectName" />
53
+          <el-table-column label="提交时间" align="center" prop="createTime" />
53
           <el-table-column label="预算总额" align="center" prop="totalBudget" />
54
           <el-table-column label="预算总额" align="center" prop="totalBudget" />
54
           <el-table-column label="编制人" align="center" prop="compiler">
55
           <el-table-column label="编制人" align="center" prop="compiler">
55
             <template slot-scope="scope">
56
             <template slot-scope="scope">

+ 2
- 1
oa-ui/src/views/flowable/form/budget/adjust/budgetAdjust.vue Прегледај датотеку

460
     if (!this.row.projectId) {
460
     if (!this.row.projectId) {
461
       let res = await getCheck(this.taskForm.formId);
461
       let res = await getCheck(this.taskForm.formId);
462
       this.row.projectId = res.data.projectId;
462
       this.row.projectId = res.data.projectId;
463
+      this.row.budgetId = res.data.budgetId;
463
     }
464
     }
464
     this.initBudgetForm();
465
     this.initBudgetForm();
465
     this.initCheckForm();
466
     this.initCheckForm();
469
   methods: {
470
   methods: {
470
     initBudgetForm() {
471
     initBudgetForm() {
471
       this.loading = true;
472
       this.loading = true;
472
-      listBudget({ pageNum: 1, pageSize: 20, projectId: this.row.projectId }).then(async res => {
473
+      listBudget({ pageNum: 1, pageSize: 20, projectId: this.row.projectId, budgetId:this.row.budgetId }).then(async res => {
473
         this.budgetForm = res.rows[0];
474
         this.budgetForm = res.rows[0];
474
         if (this.budgetForm) {
475
         if (this.budgetForm) {
475
           const budgetId = this.budgetForm.budgetId;
476
           const budgetId = this.budgetForm.budgetId;

+ 1
- 1
oa-ui/src/views/flowable/form/budget/adjust/newBudgetInfo.vue Прегледај датотеку

564
   methods: {
564
   methods: {
565
     initBudgetForm() {
565
     initBudgetForm() {
566
       this.loading = true;
566
       this.loading = true;
567
-      listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId }).then(async res => {
567
+      listBudget({ pageNum: 1, pageSize: 20, projectId: this.taskForm.formId, procInstId:this.taskForm.procInsId }).then(async res => {
568
         this.budgetForm = res.rows[0];
568
         this.budgetForm = res.rows[0];
569
         if (this.budgetForm) {
569
         if (this.budgetForm) {
570
           this.budgetForm.outExpense = Number(this.budgetForm.outExpense).toFixed(2);
570
           this.budgetForm.outExpense = Number(this.budgetForm.outExpense).toFixed(2);

+ 53
- 1
oa-ui/src/views/oa/check/index.vue Прегледај датотеку

47
         <template slot-scope="scope">
47
         <template slot-scope="scope">
48
           <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
48
           <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)"
49
             v-hasPermi="['oa:check:query']">查看</el-button>
49
             v-hasPermi="['oa:check:query']">查看</el-button>
50
+          <el-button size="mini" type="text" icon="el-icon-download" @click="downloadInfo(scope.row)"
51
+          v-hasPermi="['oa:check:query']">下载</el-button>
50
         </template>
52
         </template>
51
       </el-table-column>
53
       </el-table-column>
52
     </el-table>
54
     </el-table>
249
         this.$modal.msgSuccess("删除成功");
251
         this.$modal.msgSuccess("删除成功");
250
       }).catch(() => { });
252
       }).catch(() => { });
251
     },
253
     },
254
+    downloadInfo(row){
255
+      this.download('oa/budget/export', {
256
+        'budgetId': row.budgetId
257
+      }, `budget_${new Date().getTime()}.xlsx`);
258
+      this.download('oa/budgetCar/export', {
259
+        'budgetId': row.budgetId
260
+      }, `budget_Car_${new Date().getTime()}.xlsx`);
261
+      this.download('oa/budgetDevice/export', {
262
+        'budgetId': row.budgetId
263
+      }, `budget_Device_${new Date().getTime()}.xlsx`);
264
+      this.download('oa/budgetSettle/export', {
265
+        'budgetId': row.budgetId
266
+      }, `budget_Settle_${new Date().getTime()}.xlsx`);
267
+      this.download('oa/budgetStaff/export', {
268
+        'budgetId': row.budgetId
269
+      }, `budget_Staff${new Date().getTime()}.xlsx`);
270
+      this.download('oa/budgetOther/export', {
271
+        'budgetId': row.budgetId
272
+      }, `budget_Other${new Date().getTime()}.xlsx`);
273
+      this.download('oa/budgetSite/export', {
274
+        'budgetId': row.budgetId
275
+      }, `budget_Site${new Date().getTime()}.xlsx`);
276
+      this.download('oa/projectWork/export', {
277
+        'projectId': row.projectId
278
+      }, `project_Work${new Date().getTime()}.xlsx`)
279
+    },
252
     /** 导出按钮操作 */
280
     /** 导出按钮操作 */
253
     handleExport() {
281
     handleExport() {
254
       this.download('oa/check/export', {
282
       this.download('oa/check/export', {
255
         ...this.queryParams
283
         ...this.queryParams
256
-      }, `check_${new Date().getTime()}.xlsx`)
284
+      }, `check_${new Date().getTime()}.xlsx`);
285
+      this.download('oa/budget/export', {
286
+        ...this.queryParams
287
+      }, `budget_${new Date().getTime()}.xlsx`);
288
+      this.download('oa/budgetCar/export', {
289
+        ...this.queryParams
290
+      }, `budget_Car_${new Date().getTime()}.xlsx`);
291
+      this.download('oa/budgetDevice/export', {
292
+        ...this.queryParams
293
+      }, `budget_Device_${new Date().getTime()}.xlsx`);
294
+      this.download('oa/budgetSettle/export', {
295
+        ...this.queryParams
296
+      }, `budget_Settle_${new Date().getTime()}.xlsx`);
297
+      this.download('oa/budgetStaff/export', {
298
+        ...this.queryParams
299
+      }, `budget_Staff${new Date().getTime()}.xlsx`);
300
+      this.download('oa/budgetOther/export', {
301
+        ...this.queryParams
302
+      }, `budget_Other${new Date().getTime()}.xlsx`);
303
+      this.download('oa/budgetSite/export', {
304
+        ...this.queryParams
305
+      }, `budget_Site${new Date().getTime()}.xlsx`);
306
+      this.download('oa/projectWork/export', {
307
+        ...this.queryParams
308
+      }, `project_Work${new Date().getTime()}.xlsx`)
257
     }
309
     }
258
   }
310
   }
259
 };
311
 };

Loading…
Откажи
Сачувај