财务付款确认 资金预算

master
lion 1 month ago
parent fc6ae632e9
commit 9b9b7a0409

@ -32,9 +32,9 @@
v-for="item in shList"
:key="item.id"
:value="item.id"
:label="item.data.yiti+'-'+item.title"
:label="item.data?(item.data.yiti?item.data.yiti:''):''+'-'+item.title"
>
<span style="float: left">{{ item.data.yiti }}-{{ item.title }}</span>
<span style="float: left">{{ item.data?(item.data.yiti?item.data.yiti:''):''}}-{{ item.title }}</span>
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
@click.stop="viewOaFlow(item.id)"

@ -40,9 +40,9 @@
v-for="item in shList"
:key="item.id"
:value="item.id"
:label="item.data?item.data.yiti:'' +'-'+item.title"
:label="item.data?(item.data.yiti?item.data.yiti:''):'' +'-'+item.title"
>
<span style="float: left">{{ item.data?item.data.yiti:''}}-{{ item.title }}</span>
<span style="float: left">{{ item.data?(item.data.yiti?item.data.yiti:''):'' }}-{{ item.title }}</span>
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
@click.stop="viewOaFlow(item.id)"

@ -210,9 +210,9 @@
v-for="item in shList"
:key="item.id"
:value="item.id"
:label="item.data.yiti+'-'+item.title"
:label="item.data?(item.data.yiti?item.data.yiti:''):''+'-'+item.title"
>
<span style="float: left">{{ item.data.yiti }}-{{ item.title }}</span>
<span style="float: left">{{ item.data?(item.data.yiti?item.data.yiti:''):'' }}-{{ item.title }}</span>
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
@click.stop="viewOaFlow(item.id)"
@ -713,9 +713,9 @@
v-for="item in shList"
:key="item.id"
:value="item.id"
:label="item.data.yiti+'-'+item.title"
:label="item.data?(item.data.yiti?item.data.yiti:''):''+'-'+item.title"
>
<span style="float: left">{{ item.data.yiti }}-{{ item.title }}</span>
<span style="float: left">{{ item.data?(item.data.yiti?item.data.yiti:''):'' }}-{{ item.title }}</span>
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
@click.stop="viewOaFlow(item.id)"

@ -1,404 +1,428 @@
<template>
<div>
<Modal v-model="isShowModal" fullscreen class-name="oa-modal" footer-hide title="科室资金执行率明细" :mask-closable="false">
<div class="department-progress-detail">
<el-container>
<el-main>
<!-- 科室标题 -->
<div class="department-title">
<h3>{{ row?(row.plan_department?row.plan_department.name:''):'' }} - 资金执行率明细</h3>
</div>
<!-- 执行率统计卡片 -->
<el-row :gutter="20" class="mb-4">
<el-col :span="8">
<el-card class="summary-card" shadow="hover">
<div class="card-title">当前执行率</div>
<div class="execution-rate">{{ getCompletionRate(row.rate) }}%</div>
<div class="card-desc">已财务确认的资金比例</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="summary-card" shadow="hover">
<div class="card-title">预计执行率</div>
<div class="execution-rate">{{ getCompletionRate(row.rate_end) }}%</div>
<div class="card-desc">全部付款确认后预计的执行率</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="summary-card" shadow="hover">
<div class="card-title">预算金额</div>
<div class="execution-rate">{{ formatToWan(row.money_total) }}</div>
<div class="card-desc">科室预算金额</div>
</el-card>
</el-col>
</el-row>
<!-- 已执行项目表格 -->
<el-card class="table-container mb-4">
<div class="section-title" style="display:flex;align-items:center;justify-content:space-between;">
<span>资金执行明细</span>
<el-button type="primary" size="mini" @click="exportEnd"></el-button>
</div>
<xy-table ref="xyTable" :list="endList" :table-item="endTable" :height="300">
<template v-slot:status>
<el-table-column header-align="center" label="当前状态" width="120">
<template slot-scope="scope">
<el-tag type="success">已完成</el-tag>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column
:fixed="$store.getters.device === 'mobile'?false:'right'"
header-align="center"
label="操作"
width="120"
>
<template slot-scope="scope">
<el-button v-if="scope.row.contract_id" type="primary" size="small" @click="showContractDetail(scope.row)"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page :total="endTotal" show-elevator @on-change="endPageChange" />
</div>
</el-card>
<!-- 未执行完项目表格 -->
<el-card class="table-container">
<div class="section-title" style="display:flex;align-items:center;justify-content:space-between;">
<span>未执行完项目流程中/预算流转中</span>
<el-button type="primary" size="mini" @click="exportPart"></el-button>
</div>
<xy-table ref="xyTable" :list="partList" :table-item="table" :height="300">
<template v-slot:status>
<el-table-column header-align="center" label="当前状态" width="120" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.funds_count>0" type="warning"></el-tag>
<el-tag v-else type="warning">oa流程中</el-tag>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column
:fixed="$store.getters.device === 'mobile'?false:'right'"
header-align="center"
label="操作"
width="120"
align="center"
>
<template slot-scope="scope">
<el-button type="primary" size="small" @click="showContractDetail(scope.row)"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page :total="partTotal" show-elevator @on-change="partPageChange" />
</div>
</el-card>
</el-main>
</el-container>
</div>
</Modal>
<!-- <detail ref="detail" /> -->
<ContractDetailDrawer ref="contractDetailDrawer" :visible.sync="isShowContractDetail" />
</div>
</template>
<script>
import {
endIndex,
endIndex2,
partIndex
} from '@/api/departmentProgress'
// import detail from '../components/detail.vue'
import ContractDetailDrawer from '@/components/contractIntegration/index.vue'
import { getToken } from '@/utils/auth'
export default {
name: 'DepartmentProgressDetail',
components: {
// detail,
ContractDetailDrawer
},
data() {
return {
isShowModal: false,
isShowContractDetail: false,
row: {},
endTotal: 0,
partTotal: 0,
endSelect: {
page: 1,
page_size: 10
},
partSelect: {
page: 1,
page_size: 10
},
endList: [],
partList: [],
endTable:[{
prop: 'model_type_text',
label: '类型',
width: 120,
align: 'center'
},{
prop: 'name',
label: '关联名称',
width: 240,
align: 'center'
}, {
prop: 'use_money',
label: '使用金额',
width: 240
}, {
prop: 'admin_name',
label: '发起人',
width: 120,
align: 'center'
},{
prop: 'created_at',
label: '发起时间',
width: 180,
align: 'center'
},{
prop: 'status',
label: '状态',
width: 120,
align: 'center'
}],
table: [{
prop: 'name',
label: '项目名称',
// fixed: 'left',
// width: 240,
align: 'left'
}, {
prop: 'department.name',
label: '科室',
width: 240,
align: 'left'
}, {
prop: 'admin.name',
label: '经办人',
width: 100
}, {
prop: 'money',
label: '预算金额',
width: 100,
formatter(v1, v2, value) {
return value || '0.00'
}
}, {
prop: 'funds_count',
label: '发起支付笔数',
width: 100
}, {
prop: 'contract_plan_act_sum',
label: '已确认付款金额',
width: 120,
formatter(v1, v2, value) {
return value || '0.00'
}
}, {
prop: 'status',
label: '当前状态',
export:'funds_count_text',
width: 120
}]
}
},
watch: {
isShowModal(newval) {
if (newval) {
} else {
this.row = {}
}
},
row(newval) {
if (newval) {
this.getEndIndex(newval.plan_department_id)
this.getPartIndex(newval.plan_department_id)
}
}
},
methods: {
partPageChange(e) {
this.partSelect.page = e
this.getPartIndex(this.row.plan_department_id)
},
endPageChange(e) {
this.endSelect.page = e
this.getEndIndex(this.row.plan_department_id)
},
async getEndIndex(id) {
const res = await endIndex2({
department_id: id,
page: this.endSelect.page,
page_size: this.endSelect.page_size
})
this.endList = res.list.data
this.endTotal = res.list.total
},
async getPartIndex(id) {
const res = await partIndex({
department_id: id,
page: this.partSelect.page,
page_size: this.partSelect.page_size
})
this.partList = res.list.data
this.partTotal = res.list.total
},
getDetail(row, type) {
this.$refs.detail.type = type
this.$refs.detail.detailRow = row
this.$refs.detail.detailDrawerVisible = true
},
showContractDetail(row) {
this.isShowContractDetail = true
this.$nextTick(() => {
this.$refs.contractDetailDrawer.getDetail(row.contract_id)
})
},
getCompletionRate(dept) {
return dept ? Number(dept.toFixed(2)) : 0
},
formatToWan(num) {
if (num === null || num === undefined) return '0元'
num = Number(num)
if (isNaN(num)) return '0元'
if (Math.abs(num) < 10000) {
return num.toFixed(2).toString() + '元' // 1
} else {
return (num / 10000).toFixed(2) + '万元' // 1
}
},
exportEnd() {
const name = this.row?(this.row.plan_department?this.row.plan_department.name:''):''
const file_name = name+'资金执行明细'
// const export_fields = 'export_fields[name]=&export_fields[department.name]=&export_fields[admin.name]=&export_fields[money]=&export_fields[funds_count]=&export_fields[contract_plan_act_sum]=&export_fields[funds_count_text]='
const export_fields = 'export_fields[model_type_text]=类型&export_fields[name]=关联名称&export_fields[use_money]=使用金额&export_fields[created_at]=发起时间&export_fields[funds_count_text]=状态&export_fields[admin_name]=发起人'
window.open(`${process.env.VUE_APP_BASE_API}/api/ht/contract/end-index-v2?token=${getToken()}&is_export=1&page=1&page_size=999&department_id=${this.row.plan_department_id}&${export_fields}&file_name=${file_name}`, '_blank')
},
exportPart() {
const name = this.row?(this.row.plan_department?this.row.plan_department.name:''):''
const file_name = name+'未执行完项目'
const export_fields = 'export_fields[name]=项目名称&export_fields[department.name]=科室&export_fields[admin.name]=经办人&export_fields[money]=预算金额&export_fields[funds_count]=发起支付笔数&export_fields[contract_plan_act_sum]=已确认付款金额&export_fields[funds_count_text]=当前状态'
window.open(`${process.env.VUE_APP_BASE_API}/api/ht/contract/part-index?token=${getToken()}&is_export=1&page=1&page_size=999&department_id=${this.row.plan_department_id}&${export_fields}&file_name=${file_name}`, '_blank')
}
}
}
</script>
<style scoped lang="scss">
::v-deep .ivu-modal-body {
max-height: none !important;
overflow: scroll!important;
}
.department-progress-detail {
min-height: 100vh;
background: #f4f6fa;
}
.header-bg {
background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
color: white;
padding: 0;
height: 70px;
display: flex;
align-items: center;
}
.header-container {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding: 0 30px;
}
.header-title {
font-size: 20px;
font-weight: bold;
}
.header-user {
font-size: 14px;
}
.sidebar {
background-color: #f8f9fa;
min-height: calc(100vh - 70px);
border-right: 1px solid #dee2e6;
}
.department-title {
background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
color: white;
padding: 15px;
border-radius: 10px;
margin-bottom: 20px;
text-align: center;
}
.action-buttons {
margin-bottom: 20px;
text-align: right;
}
.summary-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
text-align: center;
}
.card-title {
font-size: 16px;
margin-bottom: 10px;
}
.execution-rate {
font-size: 32px;
font-weight: bold;
margin-bottom: 5px;
}
.card-desc {
font-size: 13px;
}
.section-title {
background-color: #f8f9fa;
padding: 15px;
margin: 20px 0 15px 0;
border-left: 4px solid #007bff;
border-radius: 5px;
font-size: 16px;
font-weight: bold;
}
.table-container {
background: white;
border-radius: 10px;
padding: 20px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}
.detail-table {
font-size: 14px;
}
</style>
<template>
<div>
<Modal v-model="isShowModal" fullscreen class-name="oa-modal" footer-hide title="科室资金执行率明细" :mask-closable="false">
<div class="department-progress-detail">
<el-container>
<el-main>
<!-- 科室标题 -->
<div class="department-title">
<h3>{{ row?(row.plan_department?row.plan_department.name:''):'' }} - 资金执行率明细</h3>
</div>
<!-- 执行率统计卡片 -->
<el-row :gutter="20" class="mb-4">
<el-col :span="8">
<el-card class="summary-card" shadow="hover">
<div class="card-title">当前执行率</div>
<div class="execution-rate">{{ getCompletionRate(row.rate) }}%</div>
<div class="card-desc">已财务确认的资金比例</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="summary-card" shadow="hover">
<div class="card-title">预计执行率</div>
<div class="execution-rate">{{ getCompletionRate(row.rate_end) }}%</div>
<div class="card-desc">全部付款确认后预计的执行率</div>
</el-card>
</el-col>
<el-col :span="8">
<el-card class="summary-card" shadow="hover">
<div class="card-title">预算金额</div>
<div class="execution-rate">{{ formatToWan(row.money_total) }}</div>
<div class="card-desc">科室预算金额</div>
</el-card>
</el-col>
</el-row>
<!-- 已执行项目表格 -->
<el-card class="table-container mb-4">
<div class="section-title" style="display:flex;align-items:center;justify-content:space-between;">
<span>资金执行明细</span>
<el-button type="primary" size="mini" @click="exportEnd"></el-button>
</div>
<xy-table ref="xyTable" :list="endList" :table-item="endTable" :height="300">
<template v-slot:status>
<el-table-column header-align="center" label="当前状态" width="120">
<template>
<el-tag type="success">已完成</el-tag>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column
:fixed="$store.getters.device === 'mobile'?false:'right'"
header-align="center"
label="操作"
width="120"
>
<template slot-scope="scope">
<el-button v-if="scope.row.contract_id" type="primary" size="small" @click="showContractDetail(scope.row)"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page :total="endTotal" show-elevator @on-change="endPageChange" />
</div>
</el-card>
<!-- 未执行完项目表格 -->
<el-card class="table-container">
<div class="section-title" style="display:flex;align-items:center;justify-content:space-between;">
<span>未执行完项目流程中/预算流转中</span>
<el-button type="primary" size="mini" @click="exportPart"></el-button>
</div>
<xy-table ref="xyTable" :list="partList" :table-item="table" :height="300">
<template v-slot:status>
<el-table-column header-align="center" label="当前状态" width="120" align="center">
<template slot-scope="scope">
<el-tag v-if="scope.row.funds_count>0" type="warning"></el-tag>
<el-tag v-else type="warning">oa流程中</el-tag>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column
:fixed="$store.getters.device === 'mobile'?false:'right'"
header-align="center"
label="操作"
width="120"
align="center"
>
<template slot-scope="scope">
<el-button type="primary" size="small" @click="showContractDetail(scope.row)"></el-button>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page :total="partTotal" show-elevator @on-change="partPageChange" />
</div>
</el-card>
</el-main>
</el-container>
</div>
</Modal>
<!-- <detail ref="detail" /> -->
<ContractDetailDrawer ref="contractDetailDrawer" :visible.sync="isShowContractDetail" />
</div>
</template>
<script>
import {
endIndex2,
partIndex
} from '@/api/departmentProgress'
// import detail from '../components/detail.vue'
import ContractDetailDrawer from '@/components/contractIntegration/index.vue'
import { getToken } from '@/utils/auth'
export default {
name: 'DepartmentProgressDetail',
components: {
// detail,
ContractDetailDrawer
},
data() {
return {
isShowModal: false,
isShowContractDetail: false,
row: {},
endTotal: 0,
partTotal: 0,
endSelect: {
page: 1,
page_size: 10
},
partSelect: {
page: 1,
page_size: 10
},
endList: [],
partList: [],
endTable: [{
prop: 'model_type_text',
label: '类型',
width: 120,
align: 'center'
}, {
prop: 'name',
label: '关联名称',
width: 240,
align: 'center'
}, {
prop: 'use_money',
label: '使用金额',
width: 240
}, {
prop: 'admin_name',
label: '发起人',
width: 120,
align: 'center'
}, {
prop: 'created_at',
label: '发起时间',
width: 180,
align: 'center',
formatter: (v1, v2, value) => {
return this.formatDateTime(value)
}
}, {
prop: 'status',
label: '状态',
width: 120,
align: 'center'
}],
table: [{
prop: 'name',
label: '项目名称',
// fixed: 'left',
// width: 240,
align: 'left'
}, {
prop: 'department.name',
label: '科室',
width: 240,
align: 'left'
}, {
prop: 'admin.name',
label: '经办人',
width: 100
}, {
prop: 'money',
label: '预算金额',
width: 100,
formatter(v1, v2, value) {
return value || '0.00'
}
}, {
prop: 'funds_count',
label: '发起支付笔数',
width: 100
}, {
prop: 'contract_plan_act_sum',
label: '已确认付款金额',
width: 120,
formatter(v1, v2, value) {
return value || '0.00'
}
}, {
prop: 'status',
label: '当前状态',
export: 'funds_count_text',
width: 120
}]
}
},
watch: {
isShowModal(newval) {
if (newval) {
// Modal opened
} else {
this.row = {}
}
},
row(newval) {
if (newval) {
this.getEndIndex(newval.plan_department_id)
this.getPartIndex(newval.plan_department_id)
}
}
},
methods: {
partPageChange(e) {
this.partSelect.page = e
this.getPartIndex(this.row.plan_department_id)
},
endPageChange(e) {
this.endSelect.page = e
this.getEndIndex(this.row.plan_department_id)
},
async getEndIndex(id) {
const res = await endIndex2({
department_id: id,
page: this.endSelect.page,
page_size: this.endSelect.page_size
})
this.endList = res.list.data
this.endTotal = res.list.total
},
async getPartIndex(id) {
const res = await partIndex({
department_id: id,
page: this.partSelect.page,
page_size: this.partSelect.page_size
})
this.partList = res.list.data
this.partTotal = res.list.total
},
getDetail(row, type) {
this.$refs.detail.type = type
this.$refs.detail.detailRow = row
this.$refs.detail.detailDrawerVisible = true
},
showContractDetail(row) {
this.isShowContractDetail = true
this.$nextTick(() => {
this.$refs.contractDetailDrawer.getDetail(row.contract_id)
})
},
getCompletionRate(dept) {
return dept ? Number(dept.toFixed(2)) : 0
},
formatToWan(num) {
if (num === null || num === undefined) return '0元'
num = Number(num)
if (isNaN(num)) return '0元'
if (Math.abs(num) < 10000) {
return num.toFixed(2).toString() + '元' // 1
} else {
return (num / 10000).toFixed(2) + '万元' // 1
}
},
formatDateTime(dateStr) {
if (!dateStr) return ''
const date = new Date(dateStr)
const today = new Date()
//
const isToday = date.getFullYear() === today.getFullYear() &&
date.getMonth() === today.getMonth() &&
date.getDate() === today.getDate()
if (isToday) {
//
return date.toLocaleTimeString('zh-CN', {
hour12: false,
hour: '2-digit',
minute: '2-digit',
second: '2-digit'
})
} else {
//
return date.toLocaleDateString('zh-CN')
}
},
exportEnd() {
const name = this.row ? (this.row.plan_department ? this.row.plan_department.name : '') : ''
const file_name = name + '资金执行明细'
// const export_fields = 'export_fields[name]=&export_fields[department.name]=&export_fields[admin.name]=&export_fields[money]=&export_fields[funds_count]=&export_fields[contract_plan_act_sum]=&export_fields[funds_count_text]='
const export_fields = 'export_fields[model_type_text]=类型&export_fields[name]=关联名称&export_fields[use_money]=使用金额&export_fields[created_at]=发起时间&export_fields[funds_count_text]=状态&export_fields[admin_name]=发起人'
window.open(`${process.env.VUE_APP_BASE_API}/api/ht/contract/end-index-v2?token=${getToken()}&is_export=1&page=1&page_size=999&department_id=${this.row.plan_department_id}&${export_fields}&file_name=${file_name}`, '_blank')
},
exportPart() {
const name = this.row ? (this.row.plan_department ? this.row.plan_department.name : '') : ''
const file_name = name + '未执行完项目'
const export_fields = 'export_fields[name]=项目名称&export_fields[department.name]=科室&export_fields[admin.name]=经办人&export_fields[money]=预算金额&export_fields[funds_count]=发起支付笔数&export_fields[contract_plan_act_sum]=已确认付款金额&export_fields[funds_count_text]=当前状态'
window.open(`${process.env.VUE_APP_BASE_API}/api/ht/contract/part-index?token=${getToken()}&is_export=1&page=1&page_size=999&department_id=${this.row.plan_department_id}&${export_fields}&file_name=${file_name}`, '_blank')
}
}
}
</script>
<style scoped lang="scss">
::v-deep .ivu-modal-body {
max-height: none !important;
overflow: scroll!important;
}
.department-progress-detail {
min-height: 100vh;
background: #f4f6fa;
}
.header-bg {
background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
color: white;
padding: 0;
height: 70px;
display: flex;
align-items: center;
}
.header-container {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding: 0 30px;
}
.header-title {
font-size: 20px;
font-weight: bold;
}
.header-user {
font-size: 14px;
}
.sidebar {
background-color: #f8f9fa;
min-height: calc(100vh - 70px);
border-right: 1px solid #dee2e6;
}
.department-title {
background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
color: white;
padding: 15px;
border-radius: 10px;
margin-bottom: 20px;
text-align: center;
}
.action-buttons {
margin-bottom: 20px;
text-align: right;
}
.summary-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
text-align: center;
}
.card-title {
font-size: 16px;
margin-bottom: 10px;
}
.execution-rate {
font-size: 32px;
font-weight: bold;
margin-bottom: 5px;
}
.card-desc {
font-size: 13px;
}
.section-title {
background-color: #f8f9fa;
padding: 15px;
margin: 20px 0 15px 0;
border-left: 4px solid #007bff;
border-radius: 5px;
font-size: 16px;
font-weight: bold;
}
.table-container {
background: white;
border-radius: 10px;
padding: 20px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}
.detail-table {
font-size: 14px;
}
</style>

@ -155,7 +155,7 @@
</template>
</xy-dialog>
<xy-table :list="list" :table-item="table" :row-key="'pid'" :treeProps="{ children: 'fund_logs', hasChildren: 'hasChildren' }">
<xy-table :list="list" :table-item="table" :row-key="'pid'" :tree-props="{ children: 'fund_logs', hasChildren: 'hasChildren' }">
<template v-slot:btns>
<el-table-column
label="操作"
@ -170,7 +170,7 @@
confirm
:transfer="true"
title="确认要审核吗?"
@on-ok="updateCollect(scope.row)"
@on-ok="showAuditDialog(scope.row)"
>
<Button
size="small"
@ -190,6 +190,17 @@
>
</template> -->
</template>
<!-- <template slot-scope="scope">
<Button
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="
($refs['examineRegistration'].isShow = true),
$refs['examineRegistration'].getRegistration(scope.row.id)
"
>审核确认123</Button>
</template> -->
</el-table-column>
</template>
</xy-table>
@ -208,18 +219,105 @@
ref="examineRegistration"
@refresh="getCollects"
/>
<!-- 审核确认弹窗 -->
<el-dialog
title="审核确认"
:visible.sync="auditDialogVisible"
width="80%"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<div v-if="currentAuditRow">
<!-- 基本信息表格 -->
<div style="margin-bottom: 20px;color:#000">
{{ currentAuditRow.contract_id ? (currentAuditRow.contract ? currentAuditRow.contract.name : '') : (currentAuditRow.away ? currentAuditRow.away.title : currentAuditRow.name) }}
</div>
<!-- 每个fund_logs及其plan_link的区块 -->
<div v-if="currentAuditRow.fund_logs && currentAuditRow.fund_logs.length > 0">
<div v-for="(fundLog, fundLogIndex) in currentAuditRow.fund_logs" :key="fundLog.id" style="margin-bottom: 30px;">
<h4 style="margin-bottom: 15px; color: #409EFF;">付款记录 #{{ fundLogIndex + 1 }}</h4>
<!-- fund_logs信息表格 -->
<el-table :data="[fundLog]" border style="margin-bottom: 15px;">
<el-table-column prop="contract.name" label="项目名称" min-width="200">
<template slot-scope="scope">
{{ scope.row.contract_id ? (scope.row.contract ? scope.row.contract.name : '') : (scope.row.away ? scope.row.away.title : scope.row.name) }}
</template>
</el-table-column>
<el-table-column prop="apply_money" label="付款申请金额(元)" width="150" align="right">
<template slot-scope="scope">
{{ scope.row.apply_money ? Number(scope.row.apply_money).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') : '' }}
</template>
</el-table-column>
<el-table-column prop="act_money" label="实际支付金额(元)" width="150" align="right">
<template slot-scope="scope">
{{ scope.row.act_money ? Number(scope.row.act_money).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') : '' }}
</template>
</el-table-column>
<el-table-column prop="type" label="款项类型" width="120" />
<el-table-column prop="admin.name" label="经办人" width="120" align="center" />
<el-table-column prop="department.name" label="业务科室" width="140" align="center" />
<el-table-column prop="remark" label="备注" min-width="200" />
<el-table-column prop="created_at" label="创建信息" width="160" />
</el-table>
<!-- 对应的plan_link表格 -->
<div v-if="fundLog.plan_link && fundLog.plan_link.length > 0">
<h5 style="margin-bottom: 10px; color: #67C23A;">预算计划使用情况</h5>
<el-table :data="getPlanLinkData(fundLog)" border>
<el-table-column label="" width="55" align="center">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.selected" @change="handleSelectionChange(scope.row, fundLog.id)" />
</template>
</el-table-column>
<el-table-column prop="year" label="年份" width="100" align="center" />
<el-table-column prop="name" label="名称" min-width="200" />
<el-table-column prop="content" label="内容" min-width="200" />
<el-table-column prop="money" label="计划金额" width="150" align="right">
<template slot-scope="scope">
{{ scope.row.money ? Number(scope.row.money).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,') : '' }}
</template>
</el-table-column>
<el-table-column label="使用金额" width="150" align="right">
<template slot-scope="scope">
<el-input-number
v-model="scope.row.use_money"
:precision="2"
:min="0"
:max="999999999"
:disabled="!scope.row.selected"
controls-position="right"
size="small"
style="width: 100%"
/>
</template>
</el-table-column>
</el-table>
</div>
<div v-else style="text-align: center; color: #909399; padding: 20px;">
暂无预算计划关联
</div>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="auditDialogVisible = false">取消</el-button>
<el-button type="primary" @click="confirmAudit"></el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
getFundLog,
delFundLog,
editorFundLog
} from '@/api/paymentRegistration/fundLog'
import { getCollect,addCollect} from '@/api/paymentRegistration/collect'
import { getCollect, addCollect } from '@/api/paymentRegistration/collect'
import { getToken } from '@/utils/auth'
import { parseTime } from '@/utils'
import { Message } from 'element-ui'
import { getBudget } from '@/api/budget/budget'
@ -286,6 +384,9 @@ export default {
selectDate: '',
list: [],
total: 0,
auditDialogVisible: false,
currentAuditRow: null,
planLinkDataMap: {},
flowStatus: new Map([
[2, '待申请'],
[-1, '已退回'],
@ -303,14 +404,14 @@ export default {
pageIndex: 1,
pageSize: 10,
table: [
{
{
label: '项目名称',
minWidth: 250,
prop: 'contract.name',
align: 'left',
// fixed: this.$store.getters.device === 'mobile' ? false : 'left',
customFn: row => {
return (<span>{ row.contract_id ? (row.contract ? row.contract.name : '') : (row.away?row.away.title:row.name) }</span>)
return (<span>{ row.contract_id ? (row.contract ? row.contract.name : '') : (row.away ? row.away.title : row.name) }</span>)
}
},
{
@ -319,9 +420,9 @@ export default {
align: 'right',
width: 180,
formatter: (v1, v2, value) => {
return value?Number(value)
return value ? Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,'):''
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,') : ''
}
},
{
@ -330,18 +431,17 @@ export default {
align: 'right',
width: 180,
formatter: (v1, v2, value) => {
return value?Number(value)
return value ? Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,'):''
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,') : ''
}
},{
}, {
label: '已纳入资金执行率金额',
width: 300,
align: 'left',
customFn: (row) => {
{
if (row.plan_act_links && row.plan_act_links.length > 0) {
return row.plan_act_links.map((item) => {
if (row.plan_link && row.plan_link.length > 0) {
return row.plan_link.map((item) => {
return (
<div>
{' '}
@ -350,7 +450,6 @@ export default {
</div>
)
})
}
}
}
},
@ -395,29 +494,28 @@ export default {
label: '财务确认状态',
width: 100,
customFn: row => {
if(row.fund_logs){
return (row.status === 0)
if (row.fund_logs) {
return (row.status === 0)
? (<span style='color:rgb(96, 109, 241)'>待审核</span>)
: (<span style='color: rgb(147, 201, 134)'>已审核</span>)
}
}
}
},
//{
// label: '',
// prop: 'pay_count',
// width: 95,
//customFn: row => {
// return (<span>{ row.contract_id ? row.pay_count : row.pay_count_away }</span>)
//}
//},
// {
// label: '',
// prop: 'pay_count',
// width: 95,
// customFn: row => {
// return (<span>{ row.contract_id ? row.pay_count : row.pay_count_away }</span>)
// }
// },
{
label: '最后一笔',
prop: 'is_end',
width: 125,
formatter: (cell, data, value) => {
return value===0?'否':(value === 1 ? '是' : '')
return value === 0 ? '否' : (value === 1 ? '是' : '')
}
},
{
@ -577,11 +675,11 @@ export default {
const res = await getCollect({
page_size: this.pageSize,
page: this.pageIndex,
//keyword: this.keyword,
// keyword: this.keyword,
start_date: this.selectDate,
status: this.status,
act_plan_link_id: this.select.plan_id,
//show_type: 1,
// show_type: 1,
'flow_link[0][custom_model_id]': 75,
'flow_link[0][flow_status]': this.select.flow_status,
department_id: this.select.department_id
@ -589,25 +687,24 @@ export default {
this.addParentReference(res.list.data)
this.list = []
this.list = res.list.data
console.log("this.list",this.list)
console.log('this.list', this.list)
this.total = res.list.total
this.$forceUpdate()
},
addParentReference(data, parent = null) {
if (!Array.isArray(data)) return;
if (!Array.isArray(data)) return
data.forEach(node => {
node.parent = parent;
if (node.fund_logs && node.fund_logs.length > 0) {
node.pid = 'p' + node.id;
this.addParentReference(node.fund_logs, node);
}else{
node.pid = node.id;
node.parent = parent
if (node.fund_logs && node.fund_logs.length > 0) {
node.pid = 'p' + node.id
this.addParentReference(node.fund_logs, node)
} else {
node.pid = node.id
}
});
})
},
deleteFundLog(row) {
delFundLog({
@ -620,6 +717,123 @@ export default {
this.getCollects()
})
},
getPlanLinkData(fundLog) {
// planLinkDataMap
if (this.planLinkDataMap[fundLog.id]) {
return this.planLinkDataMap[fundLog.id]
}
// fundLog
if (!fundLog.plan_link || fundLog.plan_link.length === 0) {
return []
}
return fundLog.plan_link.map(planItem => ({
year: planItem.plan?.year || '',
name: planItem.plan?.name || '',
content: planItem.plan?.content || '',
money: planItem.plan?.money || 0,
use_money: fundLog.act_money || 0, // fund_logsact_money
selected: true, //
fund_log_id: fundLog.id,
plan_id: planItem.plan?.id || '',
plan_link_id: planItem.id
}))
},
handleSelectionChange(row, fundLogId) {
//
console.log('Selection changed:', row, fundLogId)
},
showAuditDialog(row) {
this.currentAuditRow = row
this.planLinkDataMap = {}
// fund_logsplan_link
if (row.fund_logs && row.fund_logs.length > 0) {
row.fund_logs.forEach(fundLog => {
if (fundLog.plan_link && fundLog.plan_link.length > 0) {
this.planLinkDataMap[fundLog.id] = fundLog.plan_link.map(planItem => ({
year: planItem.plan?.year || '',
name: planItem.plan?.name || '',
content: planItem.plan?.content || '',
money: planItem.plan?.money || 0,
use_money: fundLog.act_money || 0, // fund_logsact_money
selected: true, //
fund_log_id: fundLog.id,
plan_id: planItem.plan?.id || '', // planid
plan_link_id: planItem.id
}))
}
})
}
this.auditDialogVisible = true
},
confirmAudit() {
// fund_logs
if (!this.currentAuditRow.fund_logs || this.currentAuditRow.fund_logs.length === 0) {
Message({
type: 'warning',
message: '没有付款记录'
})
return
}
//
const projectName = this.currentAuditRow.contract_id
? (this.currentAuditRow.contract ? this.currentAuditRow.contract.name : '')
: (this.currentAuditRow.away ? this.currentAuditRow.away.title : this.currentAuditRow.name)
// contract_plan_act_links
const contract_plan_act_links = []
for (const fundLog of this.currentAuditRow.fund_logs) {
const planLinkData = this.planLinkDataMap[fundLog.id] || []
const selectedItems = planLinkData.filter(item => item.selected)
if (selectedItems.length === 0) {
//
Message({
type: 'warning',
message: `项目"${projectName}"未选择预算计划`
})
return
}
//
selectedItems.forEach(item => {
contract_plan_act_links.push({
fund_log_id: fundLog.id,
contract_id: fundLog.contract_id,
plan_id: item.plan_id,
use_money: item.use_money
})
})
}
//
console.log('准备提交的数据:', {
id: this.currentAuditRow.id,
status: 1,
contract_plan_act_links
})
//
addCollect({
id: this.currentAuditRow.id,
status: 1,
contract_plan_act_links
}).then((res) => {
Message({
type: 'success',
message: '操作成功'
})
this.auditDialogVisible = false
this.getCollects()
})
},
updateCollect(row) {
console.log('123')
addCollect({

Loading…
Cancel
Save