|
|
@@ -122,12 +122,14 @@
|
|
122
|
122
|
<span class="low-money">{{ siteExpenses.toFixed(2) }}</span>
|
|
123
|
123
|
<span class="up-money">(大写:{{ formatNumberWithWan(siteExpenses) }})</span>
|
|
124
|
124
|
</el-tag>
|
|
|
125
|
+ <el-button type="primary" size="mini" @click="openBudget = true" v-hasPermi="['cmc:budget:list']">查看预算</el-button>
|
|
125
|
126
|
</el-form-item>
|
|
126
|
127
|
<el-form-item label="已申请借款" v-if="isSelect">
|
|
127
|
128
|
<el-tag type="danger">
|
|
128
|
129
|
<span class="low-money">{{ hasBorrow.toFixed(2) }}</span>
|
|
129
|
130
|
<span class="up-money">(大写:{{ formatNumberWithWan(hasBorrow) }})</span>
|
|
130
|
131
|
</el-tag>
|
|
|
132
|
+ <el-button type="primary" size="mini" @click="openBorrow = true">查看历史借款</el-button>
|
|
131
|
133
|
</el-form-item>
|
|
132
|
134
|
<el-form-item label="可用借款" v-if="isSelect">
|
|
133
|
135
|
<el-tag type="success">
|
|
|
@@ -333,6 +335,12 @@
|
|
333
|
335
|
<el-button @click="openNewExpense = false">取 消</el-button>
|
|
334
|
336
|
</div>
|
|
335
|
337
|
</el-dialog>
|
|
|
338
|
+ <el-dialog title="查看预算" :visible.sync="openBudget" width="65%" append-to-body>
|
|
|
339
|
+ <new-budget-info :taskForm="budgetTaskForm" :taskName="''"></new-budget-info>
|
|
|
340
|
+ </el-dialog>
|
|
|
341
|
+ <el-drawer title="查看历史借款" :visible.sync="openBorrow" direction="rtl" size="35%" append-to-body>
|
|
|
342
|
+ <history-borrow :historyBorrowList="historyBorrowList"></history-borrow>
|
|
|
343
|
+ </el-drawer>
|
|
336
|
344
|
<el-button type="success" @click="printOpen = true">打印</el-button>
|
|
337
|
345
|
</div>
|
|
338
|
346
|
</template>
|
|
|
@@ -356,6 +364,8 @@ import FileItem from '../business/fileItem.vue';
|
|
356
|
364
|
import BorrowPrint from '../components/print/borrowPrint.vue';
|
|
357
|
365
|
import ReturnComment from '@/views/flowable/form/components/flowBtn/returnComment.vue';
|
|
358
|
366
|
import ReturnBtn from '@/views/flowable/form/components/flowBtn/returnBtn.vue';
|
|
|
367
|
+import newBudgetInfo from '@/views/flowable/form/budget/adjust/newBudgetInfo.vue';
|
|
|
368
|
+import HistoryBorrow from './historyBorrow.vue';
|
|
359
|
369
|
|
|
360
|
370
|
export default {
|
|
361
|
371
|
dicts: ['cmc_borrow_expense', 'cmc_unit'],
|
|
|
@@ -365,7 +375,9 @@ export default {
|
|
365
|
375
|
FileItem,
|
|
366
|
376
|
BorrowPrint,
|
|
367
|
377
|
ReturnComment,
|
|
368
|
|
- ReturnBtn
|
|
|
378
|
+ ReturnBtn,
|
|
|
379
|
+ newBudgetInfo,
|
|
|
380
|
+ HistoryBorrow
|
|
369
|
381
|
},
|
|
370
|
382
|
name: "Borrow",
|
|
371
|
383
|
props: {
|
|
|
@@ -455,7 +467,13 @@ export default {
|
|
455
|
467
|
name: [
|
|
456
|
468
|
{ required: true, message: '请输入开支项名称', trigger: 'blur' }
|
|
457
|
469
|
]
|
|
458
|
|
- }
|
|
|
470
|
+ },
|
|
|
471
|
+ openBudget: false,
|
|
|
472
|
+ budgetTaskForm: {
|
|
|
473
|
+ formId: '',
|
|
|
474
|
+ },
|
|
|
475
|
+ openBorrow: false,
|
|
|
476
|
+ historyBorrowList: [],
|
|
459
|
477
|
};
|
|
460
|
478
|
},
|
|
461
|
479
|
created() {
|
|
|
@@ -591,6 +609,7 @@ export default {
|
|
591
|
609
|
let budgetData = await listBudget({ projectId: this.form.projectId })
|
|
592
|
610
|
if (budgetData.total == 1) {
|
|
593
|
611
|
let budget = budgetData.rows[0];
|
|
|
612
|
+ this.budgetTaskForm.formId = this.form.projectId;
|
|
594
|
613
|
let siteRes = await listSite({ budgetId: budget.budgetId });
|
|
595
|
614
|
let maxExpense = siteRes.rows.reduce((sum, site) => sum + (Number(site.amount) || 0), 0);
|
|
596
|
615
|
this.siteExpenses = maxExpense
|
|
|
@@ -602,7 +621,8 @@ export default {
|
|
602
|
621
|
if (borrow.total != 0) {
|
|
603
|
622
|
let borrowList = borrow.rows;
|
|
604
|
623
|
let hasBorrow = 0;
|
|
605
|
|
- borrowList = borrowList.filter(item => item.borrowId != this.taskForm.formId)
|
|
|
624
|
+ borrowList = borrowList.filter(item => item.borrowId != this.taskForm.formId);
|
|
|
625
|
+ this.historyBorrowList = borrowList; //获取历史借款的列表
|
|
606
|
626
|
borrowList.forEach(element => {
|
|
607
|
627
|
if (element.managerAmount) {
|
|
608
|
628
|
hasBorrow = hasBorrow + element.managerAmount
|