合同 集合付款登记

master
lion 7 months ago
parent 2a233c2839
commit 4bbd9f2f6f

@ -1,7 +1,7 @@
<template>
<div id="app">
<router-view />
<ThemePicker style="display: none;" />
<!-- <ThemePicker style="display: none;" /> -->
</div>
</template>

@ -0,0 +1,34 @@
import request from '@/utils/request'
export function getCollect(params, noloading = false) {
return request({
method: 'get',
url: '/api/ht/fund_log_collect/index',
params,
noloading
})
}
export function addCollect(data) {
return request({
method: 'post',
url: '/api/ht/fund_log_collect/save',
data
})
}
export function delCollect(params) {
return request({
method: 'get',
url: '/api/ht/fund_log_collect/destroy',
params
})
}
export function detailCollect(params) {
return request({
method: 'get',
url: '/api/ht/fund_log_collect/show',
params
})
}

@ -167,7 +167,7 @@
<div class="info-item">
<span class="info-label">工作名称</span>
<span class="info-value">{{ shOaView.title? shOaView.title : '-' }}<span class="action-link" @click.stop="viewFlow(shOaView.id)">查看</span></span>
</div>
<div class="info-item">
<span class="info-label">申请人</span>
@ -660,7 +660,7 @@ export default {
flowLinksOfRound(roundIndex) {
const list = Array.isArray(this.fundLogs) ? this.fundLogs : []
const item = list[roundIndex]
const links = item && Array.isArray(item.fund_log_flow_links) ? item.fund_log_flow_links : []
const links = item && Array.isArray(item.fund_log_collect.flow_links) ? item.fund_log_collect.flow_links : []
return links
},
//
@ -677,7 +677,7 @@ export default {
//
this.resetComponent()
},
//
resetComponent() {
this.id = ''
@ -692,13 +692,13 @@ export default {
this.contractApprovalFlows = []
this.paymentApprovalFlows = []
},
// URL
resetAndLoadFromUrl() {
this.resetComponent()
this.checkUrlAndLoadData()
},
//
retryLoad() {
if (this.id) {
@ -707,7 +707,7 @@ export default {
this.detail = this.contractData
}
},
// URL
checkUrlAndLoadData() {
const outContractId = this.$route.query.out_contract_id
@ -947,7 +947,7 @@ export default {
console.log('合同详情抽屉组件加载完成')
// immediate
},
beforeDestroy() {
//
this.resetComponent()
@ -1479,43 +1479,43 @@ export default {
.step-content {
grid-template-columns: 1fr;
}
.expense-info-content {
grid-template-columns: 1fr;
}
.expense-info-item {
flex-direction: column;
align-items: flex-start;
gap: 5px;
}
.expense-info-value {
text-align: left;
}
.overview-step {
width: 80px;
height: 50px;
font-size: 0.7rem;
}
.overview-step.payment {
width: 60px;
height: 40px;
font-size: 0.6rem;
}
.payment-group-container {
padding: 5px;
gap: 5px;
}
.round-step-detail {
width: 120px;
height: 70px;
}
.round-step-title-detail {
font-size: 0.7rem;
}

@ -16,12 +16,12 @@
style="width: 100%"
/>
</el-form-item>
<el-form-item
prop="meeting_flow_id"
<el-form-item
prop="meeting_flow_id"
label="资金上会流程"
>
<el-select
v-model="form.meeting_flow_id"
<el-select
v-model="form.meeting_flow_id"
style="width: 100%"
:disabled="isMeetingFlowDisabled"
placeholder="请选择资金上会流程"
@ -35,8 +35,8 @@
:label="item.data.yiti+'-'+item.title"
>
<span style="float: left">{{ item.data.yiti }}-{{ item.title }}</span>
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
@click.stop="viewOaFlow(item.id)"
>查看</span>
</el-option>
@ -1056,12 +1056,12 @@ export default {
}
}
},
//
isMeetingFlowRequired() {
return !this.form.is_common_purchase && this.form.total_money && Number(this.form.total_money) >= 100000
},
//
isMeetingFlowDisabled() {
//
@ -1082,7 +1082,7 @@ export default {
// toOaDetail
// toOaDetail
let url = `${process.env.VUE_APP_OUT_URL}/#/flow/detail?auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=${flowId}`
this.oaUrl = url
this.isShowOaModal = true
},
@ -1093,7 +1093,8 @@ export default {
page_size:999,
custom_model_id:103,
sort_name:'created_at',
sort_type:'DESC'
sort_type:'DESC',
is_simple: 1
})
this.shList = res.data.data
},

@ -40,11 +40,11 @@
v-for="item in shList"
:key="item.id"
:value="item.id"
:label="item.data.yiti+'-'+item.title"
:label="item.data?item.data.yiti:'' +'-'+item.title"
>
<span style="float: left">{{ item.data.yiti }}-{{ item.title }}</span>
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
<span style="float: left">{{ item.data?item.data.yiti:''}}-{{ item.title }}</span>
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
@click.stop="viewOaFlow(item.id)"
>查看</span>
</el-option>
@ -189,7 +189,7 @@
<!-- </div>-->
</template>
</xy-dialog>
<!-- OA流程Modal -->
<Modal
v-model="isShowOaModal"
@ -336,12 +336,12 @@ export default {
return moneyFormatter(money)
}
},
//
isMeetingFlowRequired() {
return this.form.apply_money && Number(this.form.apply_money) >= 50000
},
//
isMeetingFlowDisabled() {
return this.form.apply_money && Number(this.form.apply_money) < 50000
@ -355,7 +355,7 @@ export default {
// OA
viewOaFlow(flowId) {
const url = `${process.env.VUE_APP_OUT_URL}/#/flow/detail?auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=${flowId}`
this.oaUrl = url
this.isShowOaModal = true
},
@ -368,7 +368,8 @@ export default {
page_size: 999,
custom_model_id: 103,
sort_name: 'created_at',
sort_type: 'DESC'
sort_type: 'DESC',
is_simple: 1
})
this.shList = res?.data?.data || []
} catch (e) {

File diff suppressed because it is too large Load Diff

@ -192,14 +192,14 @@
style="width: 100%"
/>
</el-form-item>
<el-form-item
prop="meeting_flow_id"
<el-form-item
prop="meeting_flow_id"
label="资金上会流程"
>
<!-- 调试信息 -->
<el-select
v-model="form.meeting_flow_id"
<el-select
v-model="form.meeting_flow_id"
style="width: 100%"
:disabled="isMeetingFlowDisabled"
placeholder="请选择资金上会流程"
@ -213,8 +213,8 @@
:label="item.data.yiti+'-'+item.title"
>
<span style="float: left">{{ item.data.yiti }}-{{ item.title }}</span>
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
@click.stop="viewOaFlow(item.id)"
>查看</span>
</el-option>
@ -695,14 +695,14 @@
style="width: 100%"
/>
</el-form-item>
<el-form-item
prop="meeting_flow_id"
<el-form-item
prop="meeting_flow_id"
label="资金上会流程"
>
<!-- 调试信息 -->
<el-select
v-model="form.meeting_flow_id"
<el-select
v-model="form.meeting_flow_id"
style="width: 100%"
:disabled="isMeetingFlowDisabled"
placeholder="请选择资金上会流程"
@ -716,8 +716,8 @@
:label="item.data.yiti+'-'+item.title"
>
<span style="float: left">{{ item.data.yiti }}-{{ item.title }}</span>
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
<span
style="float: right; color: #8492a6; font-size: 13px; cursor: pointer;"
@click.stop="viewOaFlow(item.id)"
>查看</span>
</el-option>
@ -1260,7 +1260,7 @@
</div>
</div>
<otherPlan ref="otherPlan" @getPlan="getSelectionPlan"></otherPlan>
<!-- OA流程Modal -->
<Modal
v-model="isShowOaModal"
@ -1276,7 +1276,7 @@
<iframe style="width: 100%;height: 100%;border-radius: 0 0 6px 6px;" :src="oaUrl" frameborder="0" />
</div>
</Modal>
<!-- <span>请选择类型</span>
<span slot="footer" class="dialog-footer" style="display: flex;justify-content: flex-end;">
<el-button @click="step = 2,myPurchaseType = 2,isWeixiu=false,form.is_common_purchase = 1,form.flow_mod_id = 99,showTypes = false,showEdit=true">一般采购</el-button>
@ -1731,7 +1731,7 @@ export default {
viewOaFlow(flowId) {
// toOaDetail
let url = `${process.env.VUE_APP_OUT_URL}/#/flow/detail?auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=${flowId}`
this.oaUrl = url
this.isShowOaModal = true
},
@ -1743,7 +1743,8 @@ export default {
page_size:999,
custom_model_id:103,
sort_name:'created_at',
sort_type:'DESC'
sort_type:'DESC',
is_simple: 1
})
this.shList = res.data.data
},
@ -2288,8 +2289,8 @@ export default {
this.step = 3;
})
.catch((_) => (this.btnLoading = false));
}
},
}
},
computed: {
flowIdsFormat() {
let temp = this.form.is_trade;
@ -2355,7 +2356,7 @@ export default {
let temp = this.form.contract_to_contracts;
return this.$refs["contractToContractsTable"]?.getSelection() || [];
},
//
isMeetingFlowRequired() {
console.log("isMeetingFlowRequired triggered:", {
@ -2365,7 +2366,7 @@ export default {
})
return !this.form.is_common_purchase && this.form.total_money && Number(this.form.total_money) >= 100000
},
//
isMeetingFlowDisabled() {
console.log("isMeetingFlowDisabled triggered:", {
@ -2374,13 +2375,13 @@ export default {
is_common_purchase_result: this.form.is_common_purchase,
amount_check: this.form.total_money && Number(this.form.total_money) < 100000
})
//
if (this.form.is_common_purchase) {
console.log("is_common_purchase is true, returning false")
return false
}
// 10
const result = this.form.total_money && Number(this.form.total_money) < 100000
console.log("Final result:", result)

@ -615,11 +615,10 @@
>
流程附件
</Button>
<!--
($refs['editor'].isShowEditor = true,
$refs['editor'].getDetail(scope.row.id))
-->
// <!--
// ($refs['editor'].isShowEditor = true,
// $refs['editor'].getDetail(scope.row.id))
// -->
<template v-if="scope.row.status != 2 || hasEdit">
<Button
class="slot-btns-item"

@ -0,0 +1,518 @@
<template>
<div style="padding: 0 20px">
<lx-header
icon="md-apps"
text="付款登记"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
>
<div slot="content" />
<slot>
<span style="padding: 0 6px; word-break: keep-all">创建日期</span>
<span>
<DatePicker
:value="selectDate"
placeholder="请选择日期"
type="date"
placement="bottom-start"
style="width: 180px"
@on-change="(e) => (selectDate = e)"
/>
</span>
<span style="padding: 0 6px; word-break: keep-all">关键字</span>
<span>
<Input
v-model="keywords"
placeholder="请输入关键字"
style="width: 180px"
/>
</span>
<span style="padding: 0 6px; word-break: keep-all"> 状态 </span>
<Select
v-model="status"
clearable
placeholder="请选择"
style="width: 100px"
>
<Option
v-for="item in [
{ label: '待审核', value: 0 },
{ label: '已审核', value: 1 },
]"
:key="item.value"
:value="item.value"
>
{{ item.label }}
</Option>
</Select>
<Button
type="primary"
style="margin-left: 10px"
ghost
@click="
(contractId = ''),
(pageIndex = 1),
(keywords = ''),
(selectDate = '')
"
>重置</Button>
<Button
type="primary"
style="margin-left: 10px"
@click="getFundLogs(false)"
>查询</Button>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table">
<template v-slot:btns>
<el-table-column
label="操作"
:fixed="$store.getters.device === 'mobile'?false:'right'"
width="300"
header-align="center"
>
<template slot-scope="scope">
<template v-if="scope.row.status === 0 && type === 1 && scope.row.fund_log_collect && scope.row.fund_log_collect.flow_links && scope.row.fund_log_collect.flow_links.length === 0">
<Poptip
placement="bottom"
confirm
:transfer="true"
title="确认要删除吗"
@on-ok="deleteFundLog(scope.row)"
>
<Button
size="small"
type="error"
style="margin-left: 10px; margin-bottom: 4px"
ghost
>删除</Button>
</Poptip>
<Button
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="
$refs['detailPaymentRegistration'].getFundLog(scope.row.id),
($refs['detailPaymentRegistration'].isShow = true)
"
>编辑</Button>
</template>
<!-- <Button
v-if="false"
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="
$refs['printRegistration'].getDetailFundLog(scope.row.id),
($refs['printRegistration'].isShow = true)
"
>打印</Button> -->
<!-- 申请金额是否为0 -->
<template v-if="authOa(scope.row) && scope.row.status===0">
<Poptip
v-if="parseFloat(scope.row.apply_money) === 0"
placement="bottom"
confirm
:transfer="true"
title="该申请付款金额为0,是否直接审核?"
@on-ok="saveFundLog(scope.row)"
>
<Button
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
>
支付审批
</Button>
</Poptip>
<Button
v-else
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="toOutPay(scope.row)"
>
支付审批
</Button>
</template>
<Button
v-if="scope.row.property && scope.row.property_type_id"
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="toOutAsset(scope.row)"
>
资产申请
</Button>
<Button
v-if="
scope.row.fund_log_collect &&
scope.row.fund_log_collect.flow_links &&
scope.row.fund_log_collect.flow_links.find(i => i.tag === 'pay') &&
scope.row.fund_log_collect.flow_links.find(i => i.tag === 'pay').flow_status === 1
"
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="toOaDetail(scope.row)"
>查看</Button>
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page
:total="total"
show-elevator
show-sizer
@on-change="pageChange"
@on-page-size-change="pageSizeChange"
/>
</div>
<printRegistration ref="printRegistration" />
<detailPaymentRegistration
ref="detailPaymentRegistration"
@success="getFundLogs"
/>
<!-- oa办理-->
<Modal
v-model="isShowOaModal"
:width="86"
class-name="oa-modal"
title="流程办理"
fullscreen
:mask-closable="false"
footer-hide
>
<div style="width: 100%;height: 100%;">
<iframe style="width: 100%;height: 100%;border-radius: 0 0 6px 6px;" :src="oaUrl" frameborder="0" />
</div>
</Modal>
</div>
</template>
<script>
import { detailContract } from '@/api/contract/contract'
// import { fundlogFlow, httpCurl } from '@/api/out'
import { getFundLog, delFundLog, editorFundLog } from '@/api/paymentRegistration/fundLog'
import { getCollect} from '@/api/paymentRegistration/collect'
import { parseTime } from '@/utils'
import { Message } from 'element-ui'
import { show } from '@/api/away'
import printRegistration from './components/printRegistration'
import detailPaymentRegistration from './components/detailPaymentRegistration'
import { getToken } from '@/utils/auth'
export default {
components: {
printRegistration,
detailPaymentRegistration
},
data() {
return {
isShowOaModal: false,
oaUrl: '',
selectDate: '',
keywords: '',
list: [],
contractId: '',
total: 0,
pageIndex: 1,
pageSize: 10,
is_auth: 1,
status: '',
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.title }</span>)
}
},
{
label: '付款申请金额(元)',
prop: 'apply_money',
align: 'right',
width: 180,
formatter: (v1, v2, value) => {
return Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label: '实际支付金额(元)',
prop: 'act_money',
align: 'right',
width: 180,
formatter: (v1, v2, value) => {
return Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label: '款项类型',
prop: 'type',
width: 120
},
{
label: '预算计划',
width: 330,
align: 'left',
customFn: (row) => {
if (row.plan_link && row.plan_link.length > 0) {
return row.plan_link.map((item) => {
return (
<div>
[{item.plan?.year}] {(item.plan && item.plan.pid_info) ? item.plan.pid_info.name : ''} - {item.plan?.name}
<br/>
[使用金额] {item.use_money}{' '}
</div>
)
})
}
}
},
{
prop: 'status',
label: '审核状态',
width: 120,
formatter: (cell, data, value) => {
if (value === 0) return '待审核'
else return '已审核'
}
},
{
prop: 'fund_log_collect.flow_links',
label: '流程状态',
formatter: (cell, data, value) => {
const map = new Map([
[-1, '已退回'],
[0, '办理中'],
[1, '已完成']
])
return map.get(value?.find(i => i.tag === 'pay')?.flow_status)
}
},
{
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: 145,
formatter: (cell, data, value) => {
return value === 1 ? '是' : '否'
}
},
{
label: '经办人',
minWidth: 160,
prop: 'admin.name',
align: 'center'
},
{
label: '业务科室',
minWidth: 160,
prop: 'department.name',
align: 'center'
},
{
label: '备注',
minWidth: 460,
prop: 'remark',
align: 'left'
},
{
label: '创建信息',
prop: 'created_at',
width: 160,
formatter: (cell, data, value) => {
return parseTime(new Date(value), '{y}-{m}-{d}')
}
}
]
}
},
computed: {
authOa() {
return function(row) {
return !row.fund_log_collect?.flow_links?.find(i => i.tag === 'pay')?.flow_id
}
}
},
watch: {
isShowOaModal(newVal) {
if (newVal) {
// Modal opened
} else {
this.oaUrl = ''
}
}
},
mounted() {
this.getFdCollect()
this.getFundLogs()
window.onfocus = () => {
this.getFundLogs(true)
}
},
destroyed() {
window.onfocus = null
},
created() {
const type = parseInt(this.$route.path.split('_')[1])
this.type = this.is_auth = type
},
methods: {
async toOaDetail(row) {
let url = `${process.env.VUE_APP_OUT_URL}/#/flow/detail?auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=`
const pay = row.fund_log_collect?.flow_links?.find(i => i.tag === 'pay')
// url += `&to=/flow/detail?flow_id=${caigou.id}`
url += pay?.flow_id
this.oaUrl = url
this.isShowOaModal = true
},
async toOutAsset(row) {
try {
const flow_id = JSON.parse(row.property_type_detail.remark).flow_id
const url = `${process.env.VUE_APP_OUT_OLD}/flow/create/${flow_id}?auth_token=${this.$store.getters.oa_token}`
window.open(
url,
'signProcess',
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
)
} catch (e) {
// ignore
}
},
saveFundLog(row) {
editorFundLog({
...row,
status: 1
}).then(res => {
this.getFundLogs()
})
},
async toOutPay(row) {
let payments = []
const actNumsTotal = () => {
return payments.reduce((pre, cur) => {
return pre + (Number(cur.act_money) ? Number(cur.act_money) : 0)
}, 0)
}
let contract
if (row.contract_id) {
contract = await detailContract({ id: row.contract_id })
} else {
contract = await show({ id: row.away_id })
}
payments =
(
await getFundLog({
contract_id: row.contract_id,
show_type: 1
})
)?.data || []
const baseInfo = {
'oaUrl': row?.contract?.number,
'zhifutitle': contract?.name,
out_pay_id: row?.id,
'xiangxishuoming': row?.remark,
'yifujine': actNumsTotal(),
'xiangmuzonge': contract.money,
'zhifucishu': contract?.sign_plan?.length,
'cishu': payments.length,
'amt': row?.apply_money,
'liezhiqudao': contract?.plans.map(i => i.name)?.toString(),
'contractno': contract?.number,
'guanlianliucheng': contract?.contract_flow_links?.map(i => i.flow_id)?.toString()
}
console.log(baseInfo)
const url = `${process.env.VUE_APP_OUT_OLD}/#/flow/create?auth_token=${window.encodeURIComponent(getToken())}&module_name=oa&isSinglePage=1&module_id=75&out_pay_id=${row.id}&default_json=${window.encodeURIComponent(JSON.stringify(baseInfo))}`
this.oaUrl = url
this.isShowOaModal = true
},
pageSizeChange(e) {
this.pageSize = e
this.pageIndex = 1
this.getFundLogs()
},
pageChange(e) {
this.pageIndex = e
this.getFundLogs()
},
async getFdCollect(){
const res = await getCollect({
})
},
async getFundLogs(noloading = false) {
// await fundlogFlow();
const res = await getFundLog({
page_size: this.pageSize,
page: this.pageIndex,
contract_id: this.contractId,
keyword: this.keywords,
date: this.selectDate,
is_auth: this.is_auth,
status: this.status,
show_type: 1
}, noloading)
this.list = res.data
this.total = res.total
},
deleteFundLog(row) {
delFundLog({
id: row.id
}).then((res) => {
Message({
type: 'success',
message: '操作成功'
})
this.getFundLogs()
})
}
}
}
</script>
<style scoped lang="scss"></style>
<style lang="scss">
.oa-modal {
.ivu-modal-body {
max-height: calc(100vh - 51px)!important;
padding: 0 !important;
overflow: hidden;
}
}
</style>

@ -19,14 +19,14 @@
/>
</span>
<span style="padding: 0 6px; word-break: keep-all">关键字</span>
<!-- <span style="padding: 0 6px; word-break: keep-all">关键字</span>
<span>
<Input
v-model="keywords"
placeholder="请输入关键字"
style="width: 180px"
/>
</span>
</span> -->
<span style="padding: 0 6px; word-break: keep-all"> 状态 </span>
<Select
v-model="status"
@ -59,12 +59,12 @@
<Button
type="primary"
style="margin-left: 10px"
@click="getFundLogs(false)"
@click="getFdCollect(false)"
>查询</Button>
</slot>
</lx-header>
<xy-table :list="list" :table-item="table">
<xy-table :list="list" :table-item="table" :row-key="'pid'" :treeProps="{ children: 'fund_logs', hasChildren: 'hasChildren' }">
<template v-slot:btns>
<el-table-column
label="操作"
@ -73,7 +73,9 @@
header-align="center"
>
<template slot-scope="scope">
<template v-if="scope.row.status === 0 && type == 1 && scope.row.fund_log_flow_links.length === 0">
<!-- 编辑删除 只针对 fund_log ,父级的 flow_link 为空 -->
<template v-if="scope.row.parent&&authOa(scope.row.parent)&&scope.row.status === 0 && type === 1 ">
<Poptip
placement="bottom"
confirm
@ -99,7 +101,8 @@
"
>编辑</Button>
</template>
<Button
<!-- <Button
v-if="false"
size="small"
type="primary"
@ -108,16 +111,16 @@
$refs['printRegistration'].getDetailFundLog(scope.row.id),
($refs['printRegistration'].isShow = true)
"
>打印</Button>
>打印</Button> -->
<!-- 申请金额是否为0 -->
<template v-if="authOa(scope.row) && scope.row.status===0">
<Poptip
v-if="parseFloat(scope.row.apply_money)==0"
v-if="parseFloat(scope.row.apply_money) === 0"
placement="bottom"
confirm
:transfer="true"
title="该申请付款金额为0,是否直接审核?"
@on-ok="saveFundLog(scope.row)"
@on-ok="updateCollect(scope.row)"
>
<Button
size="small"
@ -150,7 +153,11 @@
资产申请
</Button>
<Button
v-if="scope.row.fund_log_flow_links.find(i => i.tag === 'pay') ? scope.row.fund_log_flow_links.find(i => i.tag === 'pay').flow_status === 1 : false"
v-if="
scope.row.flow_links &&
scope.row.flow_links.find(i => i.tag === 'pay') &&
scope.row.flow_links.find(i => i.tag === 'pay').flow_status === 1
"
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@ -175,7 +182,7 @@
<detailPaymentRegistration
ref="detailPaymentRegistration"
@success="getFundLogs"
@success="getFdCollect"
/>
<!-- oa办理-->
@ -197,8 +204,11 @@
<script>
import { detailContract } from '@/api/contract/contract'
import { fundlogFlow, httpCurl } from '@/api/out'
// import { fundlogFlow, httpCurl } from '@/api/out'
import { getFundLog, delFundLog, editorFundLog } from '@/api/paymentRegistration/fundLog'
import { getCollect,addCollect} from '@/api/paymentRegistration/collect'
import { parseTime } from '@/utils'
import { Message } from 'element-ui'
import { show } from '@/api/away'
@ -230,9 +240,9 @@ export default {
minWidth: 250,
prop: 'contract.name',
align: 'left',
fixed: this.$store.getters.device === 'mobile' ? false : 'left',
// fixed: this.$store.getters.device === 'mobile' ? false : 'left',
customFn: row => {
return (<span>{ row.contract_id ? (row.contract ? row.contract.name : '') : row.away.title }</span>)
return (<span>{ row.contract_id ? (row.contract ? row.contract.name : '') : (row.away?row.away.title:row.name) }</span>)
}
},
{
@ -241,9 +251,9 @@ export default {
align: 'right',
width: 180,
formatter: (v1, v2, value) => {
return Number(value)
return value?Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,'):''
}
},
{
@ -252,9 +262,9 @@ export default {
align: 'right',
width: 180,
formatter: (v1, v2, value) => {
return Number(value)
return value?Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,'):''
}
},
{
@ -272,7 +282,7 @@ export default {
return (
<div>
[{item.plan?.year}] {(item.plan && item.plan.pid_info) ? item.plan.pid_info.name : ''} - {item.plan?.name}
<br />
<br/>
[使用金额] {item.use_money}{' '}
</div>
)
@ -284,13 +294,18 @@ export default {
prop: 'status',
label: '审核状态',
width: 120,
formatter: (cell, data, value) => {
if (value === 0) return '待审核'
else return '已审核'
customFn: (row) => {
if (row.fund_logs) {
return (
<div>
{ row.status===0? '待审核':'已审核'}
</div>
)
}
}
},
{
prop: 'fund_log_flow_links',
prop: 'flow_links',
label: '流程状态',
formatter: (cell, data, value) => {
const map = new Map([
@ -298,23 +313,24 @@ export default {
[0, '办理中'],
[1, '已完成']
])
return map.get(value.find(i => i.tag === 'pay')?.flow_status)
}
},
{
label: '次数',
prop: 'pay_count',
width: 95,
customFn: row => {
return (<span>{ row.contract_id ? row.pay_count : row.pay_count_away }</span>)
return map.get(value?.find(i => i.tag === 'pay')?.flow_status)
}
},
//{
// 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: 145,
formatter: (cell, data, value) => {
return value == 1 ? '是' : '否'
return value===0?'否':(value === 1 ? '是' : '')
}
},
{
@ -349,25 +365,26 @@ export default {
computed: {
authOa() {
return function(row) {
return !row.fund_log_flow_links.find(i => i.tag === 'pay')?.flow_id
return row.flow_links && !row.flow_links?.find(i => i.tag === 'pay')?.flow_id
}
}
},
watch: {
isShowOaModal(newVal) {
if (newVal) {
// Modal opened
} else {
this.oaUrl = ''
}
}
},
mounted() {
this.getFundLogs()
this.getFdCollect()
//this.getFundLogs()
window.onfocus = () => {
this.getFundLogs(true)
}
// window.onfocus = () => {
// this.getFundLogs(true)
//}
},
destroyed() {
window.onfocus = null
@ -379,7 +396,7 @@ export default {
methods: {
async toOaDetail(row) {
let url = `${process.env.VUE_APP_OUT_URL}/#/flow/detail?auth_token=${window.encodeURIComponent(getToken())}&isSinglePage=1&flow_id=`
const pay = row.fund_log_flow_links.find(i => i.tag === 'pay')
const pay = row.flow_links?.find(i => i.tag === 'pay')
// url += `&to=/flow/detail?flow_id=${caigou.id}`
url += pay?.flow_id
this.oaUrl = url
@ -396,18 +413,24 @@ export default {
`top=${this.window.top},left=${this.window.left},width=${this.window.width},height=${this.window.height},location=0`
)
} catch (e) {
// ignore
}
},
saveFundLog(row) {
editorFundLog({
...row,
updateCollect(row) {
addCollect({
id:row.id,
status: 1
}).then(res => {
this.getFundLogs()
this.getFdCollect()
})
},
async toOutPay(row) {
async toOutPay(par) {
let row = []
if(par.fund_logs && par.fund_logs.length>0){
row = par.fund_logs[0]
}else{
return
}
let payments = []
const actNumsTotal = () => {
return payments.reduce((pre, cur) => {
@ -452,13 +475,40 @@ export default {
pageSizeChange(e) {
this.pageSize = e
this.pageIndex = 1
this.getFundLogs()
this.getFdCollect()
},
pageChange(e) {
this.pageIndex = e
this.getFundLogs()
this.getFdCollect()
},
async getFdCollect(){
const res = await getCollect({
start_date: this.selectDate,
is_auth: this.is_auth,
status: this.status,
page_size: this.pageSize,
page: this.pageIndex,
})
this.addParentReference(res.list.data)
this.list = res.list.data
console.log("this.list",this.list)
this.total = res.list.total
},
addParentReference(data, parent = null) {
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;
}
});
},
async getFundLogs(noloading = false) {
// await fundlogFlow();
const res = await getFundLog({
@ -471,8 +521,8 @@ export default {
status: this.status,
show_type: 1
}, noloading)
this.list = res.data
this.total = res.total
// this.list = res.data
// this.total = res.total
},
deleteFundLog(row) {
@ -483,7 +533,7 @@ export default {
type: 'success',
message: '操作成功'
})
this.getFundLogs()
this.getFdCollect()
})
}
}

@ -0,0 +1,624 @@
<template>
<div style="padding: 0 20px">
<lx-header
icon="md-apps"
text="付款登记"
style="margin-bottom: 10px; border: 0px; margin-top: 15px"
>
<div slot="content" />
<slot>
<div class="selects">
<div>
<span style="padding: 0 6px; word-break: keep-all">关键字</span>
<span>
<Input
v-model="keyword"
placeholder="请输入关键字"
style="width: 180px"
/>
</span>
</div>
<div>
<span style="padding: 0 6px; word-break: keep-all">部门</span>
<el-select v-model="select.department_id" style="width: 140px" size="small" clearable placeholder="部门选择">
<el-option v-for="dept in departments" :key="dept.id" :value="dept.id" :label="dept.name" />
</el-select>
</div>
<div>
<span style="padding: 0 6px; word-break: keep-all">预算计划</span>
<span>
<Input
v-model="select.plan_name"
clearable
placeholder="请选择预算计划"
style="width: 200px"
@on-focus="showPlanForSearch"
@on-clear="clearSelectForSearch"
/>
</span>
</div>
<div>
<span style="padding: 0 6px; word-break: keep-all"> 财务确认状态 </span>
<Select
v-model="status"
clearable
placeholder="请选择"
style="width: 100px"
>
<Option
v-for="item in [
{ label: '待审核', value: 0 },
{ label: '已审核', value: 1 },
]"
:key="item.value"
:value="item.value"
>
{{ item.label }}
</Option>
</Select>
</div>
<div>
<span style="padding: 0 6px; word-break: keep-all">流转状态</span>
<el-select v-model="select.flow_status" style="width: 100px" size="small" clearable placeholder="状态选择">
<el-option value="" label="待申请" />
<el-option :value="0" label="流转中" />
<el-option :value="1" label="已办结" />
</el-select>
</div>
<div>
<span style="padding: 0 6px; word-break: keep-all">创建日期</span>
<span>
<DatePicker
:value="selectDate"
placeholder="请选择日期"
type="date"
placement="bottom-start"
style="width: 180px"
@on-change="(e) => (selectDate = e)"
/>
</span>
</div>
<div>
<Button
type="primary"
@click="doSearch()"
>查询</Button>
</div>
<div>
<Button type="primary" ghost>重置</Button>
</div>
<div>
<Button
type="primary"
@click="toExport()"
>导出</Button>
</div>
</div>
</slot>
</lx-header>
<!-- 搜索使用 预算计划 -->
<xy-dialog
:is-show.sync="isShowPlanForSearch"
title="预算计划"
:width="720"
@on-ok="planSelectForSearch"
>
<template>
<Input
v-model="planSearch.name"
search
enter-button="搜 索"
placeholder="搜索预算计划.."
@on-search="searchBudgets"
/>
<div
style="
margin: 10px 0;
display: flex;
justify-content: space-between;
align-items: center;
"
>
<div>
已选择<span style="margin-right: 10px">{{
select.plan_name
}}</span>
</div>
<el-link
type="success"
@click="clearSelectForSearch"
>清空选择</el-link>
</div>
<xy-table
ref="singlePlanTable"
highlight-current-row
:list="plans"
:show-index="false"
:table-item="planTableSearch"
:height="310"
style="margin-top: 10px"
@rowClick="selectPlanForSearch"
>
<template v-slot:btns />
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page :total="planTotal" show-elevator @on-change="planPageChange" />
</div>
<el-tag type="warning">点击行进行选择</el-tag>
</template>
<template v-slot:footerContent>
<Button type="primary" @click="confirmPlanForSearch"></Button>
</template>
</xy-dialog>
<xy-table :list="list" :table-item="table">
<template v-slot:btns>
<el-table-column
label="操作"
:fixed="$store.getters.device === 'mobile'?false:'right'"
width="160"
header-align="center"
>
<template v-if="authOa(scope.row)" slot-scope="scope">
<template v-if="scope.row.status === 0">
<Button
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="
($refs['examineRegistration'].isShow = true),
$refs['examineRegistration'].getRegistration(scope.row.id)
"
>审核确认</Button>
</template>
<!-- <template v-else>
<Button
size="small"
type="error"
ghost
style="margin-left: 10px; margin-bottom: 4px"
@click="cancelExamine(scope.row)"
>审核撤销</Button
>
</template> -->
</template>
</el-table-column>
</template>
</xy-table>
<div style="display: flex; justify-content: flex-end">
<Page
:total="total"
show-elevator
show-sizer
@on-change="pageChange"
@on-page-size-change="pageSizeChange"
/>
</div>
<examineRegistration
ref="examineRegistration"
@refresh="getFundLogs"
/>
</div>
</template>
<script>
import {
getFundLog,
delFundLog,
editorFundLog
} from '@/api/paymentRegistration/fundLog'
import { getToken } from '@/utils/auth'
import { parseTime } from '@/utils'
import { Message } from 'element-ui'
import { getBudget } from '@/api/budget/budget'
import { getparameter } from '@/api/system/dictionary'
import examineRegistration from './components/examineRegistration'
import { listdeptNoAuth } from '@/api/system/department'
export default {
components: {
examineRegistration
},
data() {
return {
departments: [],
moneyWay: [],
plan: [],
planTableSearch: [
{
label: '分类',
prop: 'type',
formatter: (cell, data, value) => {
const res = this.moneyWay.filter((item) => {
return item.id === value
})
return res[0]?.value || '未知'
},
width: 120
},
{
label: '年份',
prop: 'year',
align: 'center',
width: 90
},
{
label: '名称',
prop: 'name',
width: 200,
align: 'left'
},
{
label: '计划金额',
prop: 'money',
align: 'right',
width: 160
}
],
plans: [], //
planSearch: {
name: '',
plan_department_id: ''
},
planTotal: 0,
plansPageIndex: 1,
isShowPlanForSearch: false,
status: 0,
keyword: '',
select: {
plan_id: '',
plan_name: '',
flow_status: 1,
department_id: ''
},
selectDate: '',
list: [],
total: 0,
flowStatus: new Map([
[2, '待申请'],
[-1, '已退回'],
[-2, '-'],
[0, '流转中'],
[1, '已办结']
]),
flowStatusColor: new Map([
[-2, 'rgb(140, 140, 140)'],
[-1, '#dca550'],
[2, 'rgb(96, 109, 241)'],
[0, 'rgb(219, 122, 122)'],
[1, 'rgb(147, 201, 134)']
]),
pageIndex: 1,
pageSize: 10,
table: [
{
label: '项目名称',
minWidth: 300,
prop: 'contract.name',
fixed: this.$store.getters.device === 'mobile' ? false : 'left',
align: 'left',
customFn: row => {
return (<span>{ row.contract_id ? (row.contract ? row.contract.name : '') : (row.away ? row.away.title : '') }</span>)
}
},
{
label: '付款申请金额(元)',
prop: 'apply_money',
align: 'right',
width: 170,
formatter: (v1, v2, value) => {
return Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label: '实际付款金额(元)',
prop: 'act_money',
align: 'right',
width: 170,
formatter: (v1, v2, value) => {
return Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
},
{
label: '预算计划',
width: 320,
align: 'left',
customFn: (row) => {
if (row.plan_link && row.plan_link.length > 0) {
return row.plan_link.map((item) => {
return (
<div>
{' '}
[{item.plan.year}] {(item.plan && item.plan.pid_info) ? item.plan.pid_info.name : ''} - {item.plan.name} <br /> [使用金额]{' '}
{item.use_money}{' '}
</div>
)
})
}
}
},
{
label: '款项类型',
prop: 'type',
width: 120
},
{
prop: 'fund_log_collect.flow_links',
label: '流程状态',
customFn: row => {
return (
<span style={'color:' + this.flowStatusColor.get(row.fund_log_collect?.flow_links?.find(i => i.tag === 'pay')?.flow_status)
}>{this.flowStatus.get(row.fund_log_collect?.flow_links?.find(i => i.tag === 'pay')?.flow_status)}</span>)
}
// formatter: (cell, data, value) => {
// return this.flowStatus.get(value.find(i => i.tag === 'pay')?.flow_status)
// }
},
{
prop: 'status',
label: '财务确认状态',
width: 100,
customFn: row => {
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: 'is_end',
width: 125,
formatter: (cell, data, value) => {
return value === 1 ? '是' : '否'
}
},
{
label: '经办人',
minWidth: 120,
prop: 'admin.name',
align: 'center'
},
{
label: '业务科室',
minWidth: 140,
prop: 'department.name',
align: 'center'
},
{
label: '备注',
minWidth: 360,
prop: 'remark',
align: 'left'
},
{
label: '创建信息',
prop: 'created_at',
width: 160,
formatter: (cell, data, value) => {
return parseTime(new Date(value), '{y}-{m}-{d}')
}
}
]
}
},
computed: {
authOa() {
return function(row) {
return row.fund_log_collect?.flow_links?.find(i => i.tag === 'pay')?.flow_status === 1
}
}
},
mounted() {
this.getDepartment()
this.getMoneyWay()
this.getFundLogs()
},
methods: {
planPageChange(e) {
this.plansPageIndex = e
this.getBudgets()
},
//
async getDepartment() {
this.departments = (await listdeptNoAuth())?.data
},
//
async getMoneyWay() {
this.moneyWay = (
await getparameter({
number: 'money_way'
})
).detail
},
clearSelectForSearch() {
this.select.plan_id = ''
this.select.plan_name = '请选择预算计划'
},
//
searchBudgets() {
this.plansPageIndex = 1
this.getBudgets()
},
doSearch() {
this.pageIndex = 1
this.getFundLogs()
},
confirmPlanForSearch() {
this.isShowPlanForSearch = false
this.getFundLogs()
},
//
toggleSelection(plans, type) {
if (plans) {
this.plans
.filter((plan) => {
if (plans.includes(plan.id)) {
plan.useMoney = this.plan[plans.indexOf(plan.id)].value.use_money
return true
}
})
.map((row) => {
this.$refs.planTable.toggleRowSelection(row)
})
} else {
this.$refs.planTable.clearSelection()
}
},
//
async getBudgets() {
await getBudget({
name: this.planSearch.name,
page_size: 10,
page: this.plansPageIndex,
plan_department_id: this.planSearch.plan_department_id,
top_pid: 1
}).then((res) => {
this.plans = res.list.data
this.planTotal = res.list.total
this.toggleSelection(
this.plan.map((item) => {
return item.value.plan_id
}),
1
)
})
},
async showPlanForSearch() {
this.isShowPlanForSearch = true
await this.getBudgets()
},
//
selectPlanForSearch(sel) {
console.log(sel)
if (sel) {
this.select.plan_id = sel.id
this.select.plan_name = '[' + sel.year + ']-' + sel.name
} else {
this.select.plan_id = ''
this.select.plan_name = ''
}
},
//
planSelectForSearch() {
if (this.select.plan_id === '') {
Message({
type: 'warning',
message: '选择计划不能为空'
})
return
}
this.isShowPlanForSearch = false
},
pageSizeChange(e) {
this.pageSize = e
this.pageIndex = 1
this.getFundLogs()
},
pageChange(e) {
this.pageIndex = e
this.getFundLogs()
},
toExport() {
this.is_export = 1
this.getFundLogs(true)
},
async getFundLogs(is_export) {
await getFundLog({
page_size: this.pageSize,
page: this.pageIndex,
keyword: this.keyword,
date: this.selectDate,
status: this.status,
act_plan_link_id: this.select.plan_id,
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
}).then((res) => {
const tokens = getToken()
if (is_export) {
var url = '/api/ht/fund_log/index?token=' + tokens
if (this.selectDate) url += '&date=' + this.selectDate
if (this.keyword) url += '&keyword=' + this.keyword
if (typeof this.status !== 'undefined') { url += '&status=' + this.status }
if (this.select.plan_id) { url += '&act_plan_link_id=' + this.select.plan_id }
url += '&is_export=' + this.is_export
url = location.host + url
console.log(url)
window.open('http://' + url, '_blank')
this.select.is_export = 0
return
}
this.list = res.data
this.total = res.total
})
},
deleteFundLog(row) {
delFundLog({
id: row.id
}).then((res) => {
Message({
type: 'success',
message: '操作成功'
})
this.getFundLogs()
})
},
cancelExamine(row) {
editorFundLog({
id: row.id,
contract_id: row.contract_id,
status: 0
}).then((res) => {
this.getFundLogs()
Message({
type: 'success',
message: '操作成功'
})
})
}
}
}
</script>
<style scoped lang="scss">
.selects {
display: flex;
flex-wrap: wrap;
& > div {
margin-bottom: 6px;
margin-right: 4px;
& > span {
word-break: keep-all;
padding: 0 4px ;
}
}
}
</style>

@ -8,7 +8,7 @@
<div slot="content" />
<slot>
<div class="selects">
<div>
<!-- <div>
<span style="padding: 0 6px; word-break: keep-all">关键字</span>
<span>
<Input
@ -17,14 +17,14 @@
style="width: 180px"
/>
</span>
</div>
</div> -->
<div>
<span style="padding: 0 6px; word-break: keep-all">部门</span>
<el-select v-model="select.department_id" style="width: 140px" size="small" clearable placeholder="部门选择">
<el-option v-for="dept in departments" :value="dept.id" :label="dept.name" />
<el-option v-for="dept in departments" :key="dept.id" :value="dept.id" :label="dept.name" />
</el-select>
</div>
<div>
<!-- <div>
<span style="padding: 0 6px; word-break: keep-all">预算计划</span>
<span>
<Input
@ -36,7 +36,7 @@
@on-clear="clearSelectForSearch"
/>
</span>
</div>
</div> -->
<div>
<span style="padding: 0 6px; word-break: keep-all"> 财务确认状态 </span>
<Select
@ -60,7 +60,7 @@
<div>
<span style="padding: 0 6px; word-break: keep-all">流转状态</span>
<el-select v-model="select.flow_status" style="width: 100px" size="small" clearable placeholder="状态选择">
<el-option value="" label="待申请" />
<!-- <el-option value="" label="待申请" /> -->
<el-option :value="0" label="流转中" />
<el-option :value="1" label="已办结" />
</el-select>
@ -87,12 +87,12 @@
<div>
<Button type="primary" ghost>重置</Button>
</div>
<div>
<!-- <div>
<Button
type="primary"
@click="toExport()"
>导出</Button>
</div>
</div> -->
</div>
</slot>
@ -132,8 +132,8 @@
>清空选择</el-link>
</div>
<xy-table
highlight-current-row
ref="singlePlanTable"
highlight-current-row
:list="plans"
:show-index="false"
:table-item="planTableSearch"
@ -155,7 +155,7 @@
</template>
</xy-dialog>
<xy-table :list="list" :table-item="table">
<xy-table :list="list" :table-item="table" :row-key="'pid'" :treeProps="{ children: 'fund_logs', hasChildren: 'hasChildren' }">
<template v-slot:btns>
<el-table-column
label="操作"
@ -165,15 +165,19 @@
>
<template v-if="authOa(scope.row)" slot-scope="scope">
<template v-if="scope.row.status === 0">
<Poptip
placement="bottom"
confirm
:transfer="true"
title="确认要审核吗?"
@on-ok="updateCollect(scope.row)"
>
<Button
size="small"
type="primary"
style="margin-left: 10px; margin-bottom: 4px"
@click="
($refs['examineRegistration'].isShow = true),
$refs['examineRegistration'].getRegistration(scope.row.id)
"
>审核确认</Button>
</Poptip>
</template>
<!-- <template v-else>
<Button
@ -202,7 +206,7 @@
<examineRegistration
ref="examineRegistration"
@refresh="getFundLogs"
@refresh="getCollects"
/>
</div>
</template>
@ -213,6 +217,8 @@ import {
delFundLog,
editorFundLog
} from '@/api/paymentRegistration/fundLog'
import { getCollect,addCollect} from '@/api/paymentRegistration/collect'
import { getToken } from '@/utils/auth'
import { parseTime } from '@/utils'
import { Message } from 'element-ui'
@ -297,71 +303,68 @@ export default {
pageIndex: 1,
pageSize: 10,
table: [
{
{
label: '项目名称',
minWidth: 300,
minWidth: 250,
prop: 'contract.name',
fixed: this.$store.getters.device === 'mobile' ? false : 'left',
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 : '') }</span>)
return (<span>{ row.contract_id ? (row.contract ? row.contract.name : '') : (row.away?row.away.title:row.name) }</span>)
}
},
{
label: '付款申请金额(元)',
prop: 'apply_money',
align: 'right',
width: 170,
width: 180,
formatter: (v1, v2, value) => {
return Number(value)
return value?Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,'):''
}
},
{
label: '实际金额(元)',
label: '实际付金额(元)',
prop: 'act_money',
align: 'right',
width: 170,
width: 180,
formatter: (v1, v2, value) => {
return Number(value)
return value?Number(value)
.toFixed(2)
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
.replace(/(\d)(?=(\d{3})+\.)/g, '$1,'):''
}
},
{
label: '款项类型',
prop: 'type',
width: 120
},
{
label: '预算计划',
width: 320,
width: 330,
align: 'left',
customFn: (row) => {
{
if (row.plan_link && row.plan_link.length > 0) {
return row.plan_link.map((item) => {
return (
<div>
{' '}
[{item.plan.year}] {(item.plan && item.plan.pid_info) ? item.plan.pid_info.name : ''} - {item.plan.name} <br /> [使用金额]{' '}
{item.use_money}{' '}
</div>
)
})
}
if (row.plan_link && row.plan_link.length > 0) {
return row.plan_link.map((item) => {
return (
<div>
[{item.plan?.year}] {(item.plan && item.plan.pid_info) ? item.plan.pid_info.name : ''} - {item.plan?.name}
<br/>
[使用金额] {item.use_money}{' '}
</div>
)
})
}
}
},
{
label: '款项类型',
prop: 'type',
width: 120
},
{
prop: 'fund_log_flow_links',
prop: 'flow_links',
label: '流程状态',
customFn: row => {
return (
<span style={'color:' + this.flowStatusColor.get(row.fund_log_flow_links.find(i => i.tag === 'pay')?.flow_status)
}>{this.flowStatus.get(row.fund_log_flow_links.find(i => i.tag === 'pay')?.flow_status)}</span>)
<span style={'color:' + this.flowStatusColor.get(row.flow_links?.find(i => i.tag === 'pay')?.flow_status)
}>{this.flowStatus.get(row.flow_links?.find(i => i.tag === 'pay')?.flow_status)}</span>)
}
// formatter: (cell, data, value) => {
@ -373,26 +376,29 @@ export default {
label: '财务确认状态',
width: 100,
customFn: row => {
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 == 1 ? '是' : ''
return value===0?'否':(value === 1 ? '是' : '')
}
},
{
@ -427,14 +433,14 @@ export default {
computed: {
authOa() {
return function(row) {
return row.fund_log_flow_links.find(i => i.tag === 'pay')?.flow_status === 1
return row.flow_links?.find(i => i.tag === 'pay')?.flow_status === 1
}
}
},
mounted() {
this.getDepartment()
this.getMoneyWay()
this.getFundLogs()
this.getCollects()
},
methods: {
planPageChange(e) {
@ -464,11 +470,11 @@ export default {
},
doSearch() {
this.pageIndex = 1
this.getFundLogs()
this.getCollects()
},
confirmPlanForSearch() {
this.isShowPlanForSearch = false
this.getFundLogs()
this.getCollects()
},
//
@ -526,7 +532,7 @@ export default {
},
//
planSelectForSearch() {
if (this.select.plan_id == '') {
if (this.select.plan_id === '') {
Message({
type: 'warning',
message: '选择计划不能为空'
@ -538,48 +544,52 @@ export default {
pageSizeChange(e) {
this.pageSize = e
this.pageIndex = 1
this.getFundLogs()
this.getCollects()
},
pageChange(e) {
this.pageIndex = e
this.getFundLogs()
this.getCollects()
},
toExport() {
this.is_export = 1
this.getFundLogs(true)
this.getCollects(true)
},
async getFundLogs(is_export) {
await getFundLog({
async getCollects(is_export) {
const res = await getCollect({
page_size: this.pageSize,
page: this.pageIndex,
keyword: this.keyword,
date: this.selectDate,
//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
}).then((res) => {
const tokens = getToken()
if (is_export) {
var url = '/api/ht/fund_log/index?token=' + tokens
if (this.selectDate) url += '&date=' + this.selectDate
if (this.keyword) url += '&keyword=' + this.keyword
if (typeof this.status !== 'undefined') { url += '&status=' + this.status }
if (this.select.plan_id) { url += '&act_plan_link_id=' + this.select.plan_id }
url += '&is_export=' + this.is_export
url = location.host + url
console.log(url)
window.open('http://' + url, '_blank')
this.select.is_export = 0
return
}
this.list = res.data
this.total = res.total
})
this.addParentReference(res.list.data)
this.list = []
this.list = res.list.data
console.log("this.list",this.list)
this.total = res.list.total
this.$forceUpdate()
},
addParentReference(data, parent = null) {
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;
}
});
},
deleteFundLog(row) {
delFundLog({
id: row.id
@ -588,17 +598,29 @@ export default {
type: 'success',
message: '操作成功'
})
this.getFundLogs()
this.getCollects()
})
},
updateCollect(row) {
console.log('123')
addCollect({
id: row.id,
status: 1
}).then((res) => {
Message({
type: 'success',
message: '操作成功'
})
this.getCollects()
})
},
cancelExamine(row) {
editorFundLog({
id: row.id,
contract_id: row.contract_id,
status: 0
}).then((res) => {
this.getFundLogs()
this.getCollects()
Message({
type: 'success',
message: '操作成功'

Loading…
Cancel
Save