资金执行详情

master
lion 7 months ago
parent bf2a4ba573
commit 42f65c3f1e

@ -9,6 +9,15 @@ export function getFundLog(params,noloading = false){
}) })
} }
export function getPlanActLinks(params,noloading = false){
return request({
method:'get',
url:'/api/ht/plan/plan-act-links',
params,
noloading
})
}
export function addFundLog(data){ export function addFundLog(data){
return request({ return request({
method:'post', method:'post',

@ -51,6 +51,9 @@
<div style="display: flex;justify-content: flex-end;"> <div style="display: flex;justify-content: flex-end;">
<Page :total="total" show-elevator @on-change="pageChange" /> <Page :total="total" show-elevator @on-change="pageChange" />
</div> </div>
<!-- 查看-->
<detail ref="detailContract"></detail>
</div> </div>
</template> </template>
@ -70,8 +73,12 @@
import { import {
mergeTableRow mergeTableRow
} from "@/utils/mergeTableRow" } from "@/utils/mergeTableRow"
import { getFundLog } from "@/api/paymentRegistration/fundLog" import { getFundLog,getPlanActLinks } from "@/api/paymentRegistration/fundLog"
import detail from "@/views/contract/components/detailContract";
export default { export default {
components:{
detail
},
data() { data() {
return { return {
types: [], // types: [], //
@ -179,12 +186,12 @@ import { getFundLog } from "@/api/paymentRegistration/fundLog"
['show']:async _ => { ['show']:async _ => {
try { try {
this.isLoadingFundLogTable = true this.isLoadingFundLogTable = true
const res = await getFundLog({ const res = await getPlanActLinks({
page: 1, page: 1,
page_size: 999, page_size: 999,
act_plan_link_id: row.id, plan_id: row.id,
},true) },true)
this.fundLogs = res.data this.fundLogs = res.list.data
this.isLoadingFundLogTable = false this.isLoadingFundLogTable = false
} catch (e) { } catch (e) {
this.isLoadingFundLogTable = false this.isLoadingFundLogTable = false
@ -194,106 +201,160 @@ import { getFundLog } from "@/api/paymentRegistration/fundLog"
<Table loading={this.isLoadingFundLogTable} <Table loading={this.isLoadingFundLogTable}
size="small" size="small"
data={this.fundLogs} data={this.fundLogs}
show-summary
summary-method={this.handleSummary}
columns={[ columns={[
{ {
title: "项目名称", title: "支出类型",
minWidth: 300, minWidth: 200,
key: "contract.name", key: "model_type_text",
fixed: "left", fixed: "left",
align: "left", align: "left",
render:(h,{ row }) => h('span',row.contract?.name)
},
{
title: "付款申请金额(元)",
prop: "apply_money",
align: "right",
width: 170,
render:(h, { row }) => h('span',Number(row.apply_money)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,"))
}, },
{ {
title: "实际付款金额(元)", title: "支出金额(元)",
key: "act_money", prop: "use_money",
align: "right", align: "right",
width: 170, width: 170,
render:(h, { row }) => h('span',Number(row.act_money) render:(h, { row }) => h('span',Number(row.use_money)
.toFixed(2) .toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, "$1,")) .replace(/(\d)(?=(\d{3})+\.)/g, "$1,"))
}, },
{ {
title: "预算计划", title: "事由/备注",
width: 320, width: 200,
key: "model.reason",
align: "left", align: "left",
render:(h, { row }) => { render:(h, { row }) => {
if (row.act_plan_link.length > 0) { if (row.model.reason) {
return h('div',row.act_plan_link.map(item => ( return h('div',row.model.reason)
<div> {" "} }
[{item.plan.year}] {(item.plan && item.plan.pid_info) ? item.plan.pid_info.name: ''} - {item.plan.name} <br /> [使用金额]{" "} if (row.model.remark) {
{item.use_money}{" "}</div> return h('div',row.model.remark)
)))
} }
} }
}, },
{ {
title: "款项类型", title: "关联合同",
key: "type",
width: 120, width: 120,
}, key: "model.contract_id",
{ align: "center",
key: "status",
title: "状态",
width: 100,
render:(h, { row }) => h('span',row.status ? "已审核" : "待审核")
},
{
key: 'flow_status',
title: '流程状态',
width: 100,
render:(h, { row }) => { render:(h, { row }) => {
let map = new Map([ if(row.model.contract_id){
[1,'待申请'], return h('div',{
[2,'流转中'], style: {
[3,'已完成'] color: '#409EFF', //
]) cursor: 'pointer', //
return h('span',map.get(row.flow_status)) textDecoration: 'underline', // 线
} fontWeight: 'bold', //
}, padding: '4px 8px', //
{ borderRadius: '4px', //
title: "次数", },
key: "pay_count", on: {
width: 95, click: () => {
render:(h , { row }) => { console.log('查看点击事件触发', row.model.contract_id);
let val = row.pay_count + 1 this.$refs['detailContract'].getDetail(row.model.contract_id),
return h('span',val) this.$refs['detailContract'].isShowDetail = true
}
}
},'查看')
}
} }
}, },
{ // <Button
title: "最后一笔", // class="slot-btns-item"
key: "is_end", // size="small"
width: 125, // type="primary"
render: (h, { row }) => h('span',row.is_end ? "是" : "否") // @click="
}, // $refs['detailContract'].getDetail(scope.row.id),
{ // ($refs['detailContract'].isShowDetail = true)
title: "经办人", // "
minWidth: 120, // >
key: "admin.name", //
align: "center", // </Button>
render: (h, { row }) => h('span',row.admin?.name) // {
}, // title: "()",
{ // key: "act_money",
title: "业务科室", // align: "right",
minWidth: 140, // width: 170,
key: "department.name", // render:(h, { row }) => h('span',Number(row.act_money)
align: "center", // .toFixed(2)
render: (h, { row }) => h('span',row.department?.name) // .replace(/(\d)(?=(\d{3})+\.)/g, "$1,"))
}, // },
{ // {
title: "备注", // title: "",
minWidth: 360, // width: 320,
key: "remark", // align: "left",
align: "left", // render:(h, { row }) => {
}, // if (row.act_plan_link.length > 0) {
// return h('div',row.act_plan_link.map(item => (
// <div> {" "}
// [{item.plan.year}] {(item.plan && item.plan.pid_info) ? item.plan.pid_info.name: ''} - {item.plan.name} <br /> [使]{" "}
// {item.use_money}{" "}</div>
// )))
// }
// }
// },
// {
// title: "",
// key: "type",
// width: 120,
// },
// {
// key: "status",
// title: "",
// width: 100,
// render:(h, { row }) => h('span',row.status ? "" : "")
// },
// {
// key: 'flow_status',
// title: '',
// width: 100,
// render:(h, { row }) => {
// let map = new Map([
// [1,''],
// [2,''],
// [3,'']
// ])
// return h('span',map.get(row.flow_status))
// }
// },
// {
// title: "",
// key: "pay_count",
// width: 95,
// render:(h , { row }) => {
// let val = row.pay_count + 1
// return h('span',val)
// }
// },
// {
// title: "",
// key: "is_end",
// width: 125,
// render: (h, { row }) => h('span',row.is_end ? "" : "")
// },
// {
// title: "",
// minWidth: 120,
// key: "admin.name",
// align: "center",
// render: (h, { row }) => h('span',row.admin?.name)
// },
// {
// title: "",
// minWidth: 140,
// key: "department.name",
// align: "center",
// render: (h, { row }) => h('span',row.department?.name)
// },
// {
// title: "",
// minWidth: 360,
// key: "remark",
// align: "left",
// },
{ {
title: "创建信息", title: "创建信息",
key: "created_at", key: "created_at",
@ -331,6 +392,50 @@ import { getFundLog } from "@/api/paymentRegistration/fundLog"
} }
return per; return per;
}, },
handleSummary({ columns, data }){
console.log("data",data)
const sums = {};
columns.forEach((column, index) => {
const key = column.key;
if (index === 0) {
sums[key] = {
key,
value: '合计'
};
return;
}
const values = data.map(item => Number(item['use_money']));
if (!values.every(value => isNaN(value))) {
const v = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
if(index===1){
sums[key] = {
key,
value: v + ' 元'
};
}else{
sums[key] = {
key,
value: ''
};
}
} else {
sums[key] = {
key,
value: ''
};
}
});
return sums
},
// //
summary(param) { summary(param) {
this.$nextTick(() => { this.$nextTick(() => {

Loading…
Cancel
Save