parent
f6280c8a9d
commit
4c032c1f2f
@ -1,163 +1,166 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="padding: 0 20px">
|
<div style="padding: 0 20px">
|
||||||
<lx-header
|
<lx-header icon="md-apps" style="margin-bottom: 10px; border: 0px; margin-top: 15px" text="实际使用金额">
|
||||||
icon="md-apps"
|
<div slot="content"></div>
|
||||||
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
|
<slot>
|
||||||
text="实际使用金额"
|
<div class="selects">
|
||||||
>
|
<!-- <div>
|
||||||
<div slot="content"></div>
|
<span style="padding: 0 6px; word-break: keep-all"> 关键字 </span>
|
||||||
<slot>
|
<Input
|
||||||
<div class="selects">
|
v-model="select.keyword"
|
||||||
<!-- <div>
|
placeholder="请输入关键字"
|
||||||
<span style="padding: 0 6px; word-break: keep-all"> 关键字 </span>
|
style="width: 180px"
|
||||||
<Input
|
></Input>
|
||||||
v-model="select.keyword"
|
</div>
|
||||||
placeholder="请输入关键字"
|
|
||||||
style="width: 180px"
|
<Button style="margin-left: 10px" type="primary" @click=""
|
||||||
></Input>
|
>重置
|
||||||
</div>
|
</Button>
|
||||||
|
<Button style="margin-left: 10px" type="primary" @click="getList"
|
||||||
<Button style="margin-left: 10px" type="primary" @click=""
|
>查询</Button
|
||||||
>重置
|
> -->
|
||||||
</Button>
|
<Button style="margin-left: 10px" type="primary" @click="
|
||||||
<Button style="margin-left: 10px" type="primary" @click="getList"
|
($refs['addActual'].type = 'add'), $refs['addActual'].show()
|
||||||
>查询</Button
|
">新增</Button>
|
||||||
> -->
|
</div>
|
||||||
<Button
|
</slot>
|
||||||
style="margin-left: 10px"
|
</lx-header>
|
||||||
type="primary"
|
|
||||||
@click="
|
<xy-table :list="list" :table-item="table">
|
||||||
($refs['addActual'].type = 'add'), $refs['addActual'].show()
|
<template #btns>
|
||||||
"
|
<el-table-column :fixed="$store.getters.device === 'mobile'?false:'right'" label="操作" align="left" width="200">
|
||||||
>新增</Button
|
<template #default="{ row }">
|
||||||
>
|
<div style="display: flex;align-items: flex-start;">
|
||||||
</div>
|
<Button style="margin-right: 4px;" v-if="calculateTotalUseMoney(row.plan_act_links)<parseFloat(row.money)" ghost size="small" type="primary" @click="execute(row)">确认执行</Button>
|
||||||
</slot>
|
<Button style="margin-right: 4px;" ghost size="small" type="primary" @click="
|
||||||
</lx-header>
|
($refs['addActual'].id = row.id),
|
||||||
|
($refs['addActual'].type = 'editor'),
|
||||||
<xy-table
|
$refs['addActual'].show()
|
||||||
:list="list"
|
">编辑</Button>
|
||||||
:table-item="table"
|
<Poptip :transfer="true" confirm placement="bottom"
|
||||||
>
|
:title="row.plan_act_links.length>0?'已有执行记录,确认要连同执行记录一同删除?':'确认要删除吗?'" @on-ok="destroy(row)">
|
||||||
<template #btns>
|
<Button size="small" type="error" ghost>删除</Button>
|
||||||
<el-table-column :fixed="$store.getters.device === 'mobile'?false:'right'" label="操作" align="left" width="200">
|
</Poptip>
|
||||||
<template #default="{ row }">
|
</div>
|
||||||
<div style="display: flex;align-items: flex-start;">
|
</template>
|
||||||
<Button
|
</el-table-column>
|
||||||
ghost
|
</template>
|
||||||
size="small"
|
</xy-table>
|
||||||
type="primary"
|
|
||||||
@click="
|
<div style="display: flex; justify-content: flex-end">
|
||||||
($refs['addActual'].id = row.id),
|
<Page :total="total" @on-change="e => {
|
||||||
($refs['addActual'].type = 'editor'),
|
select.page = e;
|
||||||
$refs['addActual'].show()
|
getList()
|
||||||
"
|
}" show-elevator show-sizer @on-page-size-change="e => {
|
||||||
>编辑</Button
|
select.page = 1;
|
||||||
>
|
select.page_size = e;
|
||||||
<Poptip
|
getList();
|
||||||
:transfer="true"
|
}" />
|
||||||
confirm
|
</div>
|
||||||
placement="bottom"
|
|
||||||
title="确认要删除吗"
|
<addActual :plan_department_ids="depts" ref="addActual" @refresh="getList"></addActual>
|
||||||
@on-ok="destroy(row)"
|
<exeActual ref="exeActual" @refresh="getList"></exeActual>
|
||||||
>
|
</div>
|
||||||
<Button style="margin-left: 4px;" size="small" type="error" ghost>删除</Button>
|
</template>
|
||||||
</Poptip>
|
|
||||||
</div>
|
<script>
|
||||||
</template>
|
import {
|
||||||
</el-table-column>
|
getActual,
|
||||||
</template>
|
delActual,
|
||||||
</xy-table>
|
} from "@/api/budget/actual";
|
||||||
|
import addActual from "./components/addActual.vue";
|
||||||
<div style="display: flex; justify-content: flex-end">
|
import exeActual from "./components/exeActual.vue";
|
||||||
<Page
|
export default {
|
||||||
:total="total"
|
components: {
|
||||||
@on-change="e => {
|
addActual,
|
||||||
select.page = e;
|
exeActual
|
||||||
getList()
|
},
|
||||||
}"
|
data() {
|
||||||
show-elevator
|
return {
|
||||||
show-sizer
|
depts: [],
|
||||||
@on-page-size-change="e => {
|
select: {
|
||||||
select.page = 1;
|
page: 1,
|
||||||
select.page_size = e;
|
page_size: 10,
|
||||||
getList();
|
},
|
||||||
}"
|
visible: false,
|
||||||
/>
|
total: 0,
|
||||||
</div>
|
table: [{
|
||||||
|
label: "资金来源所属年份",
|
||||||
<addActual
|
prop: "plan.year",
|
||||||
:plan_department_ids="depts"
|
width: 120,
|
||||||
ref="addActual"
|
},
|
||||||
@refresh="getList"
|
{
|
||||||
></addActual>
|
label: "事由",
|
||||||
</div>
|
prop: "reason",
|
||||||
</template>
|
width: 180,
|
||||||
|
align: 'left'
|
||||||
<script>
|
},
|
||||||
import { getActual, delActual } from "@/api/budget/actual";
|
{
|
||||||
import addActual from "./components/addActual.vue";
|
label: "资金来源",
|
||||||
export default {
|
prop: "plan.name",
|
||||||
components: {
|
align: 'left'
|
||||||
addActual,
|
// width: 180,
|
||||||
},
|
},
|
||||||
data() {
|
{
|
||||||
return {
|
label: "金额",
|
||||||
depts: [],
|
prop: "money",
|
||||||
select: {
|
width: 180,
|
||||||
page: 1,
|
},
|
||||||
page_size: 10,
|
{
|
||||||
},
|
label: "已使用金额",
|
||||||
total: 0,
|
prop: "use_money",
|
||||||
table: [
|
width: 180,
|
||||||
{
|
formatter: (row, v2, value) => {
|
||||||
label: "资金来源所属年份",
|
return this.calculateTotalUseMoney(row.plan_act_links)
|
||||||
prop: "plan.year",
|
}
|
||||||
width: 180,
|
}
|
||||||
},
|
],
|
||||||
{
|
list: [],
|
||||||
label: "资金来源",
|
};
|
||||||
prop: "plan.name",
|
},
|
||||||
// width: 180,
|
methods: {
|
||||||
},
|
async getList() {
|
||||||
{
|
const res = await getActual(this.select);
|
||||||
label: "使用金额",
|
this.list = res.data;
|
||||||
prop: "use_money",
|
this.total = res.total || 0;
|
||||||
width: 200,
|
},
|
||||||
}
|
calculateTotalUseMoney(plan_act_links) {
|
||||||
],
|
let total = 0;
|
||||||
list: [],
|
for (let i = 0; i < plan_act_links.length; i++) {
|
||||||
};
|
const useMoney = parseFloat(plan_act_links[i].use_money);
|
||||||
},
|
if (!isNaN(useMoney)) {
|
||||||
methods: {
|
total += useMoney;
|
||||||
async getList() {
|
}
|
||||||
const res = await getActual(this.select);
|
}
|
||||||
this.list = res.data;
|
return parseFloat(total).toFixed(2);
|
||||||
this.total = res.total || 0;
|
},
|
||||||
},
|
destroy(row) {
|
||||||
destroy (row) {
|
delActual({
|
||||||
delActual({
|
id: row.id
|
||||||
id: row.id
|
}).then(res => {
|
||||||
}).then(res => {
|
this.$message({
|
||||||
this.$message({
|
type: 'success',
|
||||||
type: 'success',
|
message: '删除成功'
|
||||||
message: '删除成功'
|
})
|
||||||
})
|
this.getList()
|
||||||
this.getList()
|
})
|
||||||
})
|
},
|
||||||
}
|
execute(row) {
|
||||||
},
|
this.$refs.exeActual.setForm(row.id,row.plan_act_links)
|
||||||
computed: {},
|
this.$refs.exeActual.isShow = true
|
||||||
created() {
|
}
|
||||||
this.getList();
|
},
|
||||||
},
|
computed: {},
|
||||||
};
|
created() {
|
||||||
</script>
|
this.getList();
|
||||||
|
},
|
||||||
<style scoped lang="scss">
|
};
|
||||||
.selects {
|
</script>
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
<style scoped lang="scss">
|
||||||
flex-wrap: wrap;
|
.selects {
|
||||||
}
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Loading…
Reference in new issue