lijingjia 2 months ago
commit b76c02990d

@ -8,4 +8,79 @@ export function PaymentSettlementGetList(parameter) {
data: parameter,
})
}
export function GetOrgList() {
return request({
url: '/mainApi/Common/GetOrgList',
method: 'get',
})
}
export function InvoiceSettlementGetInvoiceList(parameter) {
return request({
url: '/feeApi/InvoiceSettlement/GetInvoiceList',
method: 'post',
data: parameter,
})
}
export function InvoiceSettlementGetInvoiceDetails(parameter) {
return request({
url: '/feeApi/InvoiceSettlement/GetInvoiceDetails',
method: 'post',
data: parameter,
})
}
export function InvoiceSettlementGetExchanges(parameter) {
return request({
url: '/feeApi/InvoiceSettlement/GetExchanges',
method: 'post',
data: parameter,
})
}
export function GetExchangeRate(params) {
return request({
url: '/feeApi/FeeCurrencyExchange/GetExchangeRate',
method: 'get',
params
})
}
export function InvoiceSettlementSave(parameter) {
return request({
url: '/feeApi/InvoiceSettlement/Save',
method: 'post',
data: parameter,
})
}
export function InvoiceSettlementGet(params) {
return request({
url: '/feeApi/InvoiceSettlement/Get',
method: 'get',
params
})
}
export function ClientCommonGetStlMode(params) {
return request({
url: '/mainApi/ClientCommon/GetStlMode',
method: 'get',
params
})
}
export function GetClientBankList(parameter) {
return request({
url: '/mainApi/ClientBank/GetClientBankList',
method: 'post',
data: parameter,
})
}
export function PaymentSettlementDelete(parameter) {
return request({
url: '/feeApi/PaymentSettlement/Delete',
method: 'post',
data: parameter,
})
}

@ -1,5 +1,7 @@
import { def } from '@vue/shared'
import { BasicColumn, FormSchema } from '/@/components/Table'
import { GetClientListByCode, GetFeeCurrencySelectList } from '/@/api/common'
import { GetOrgList, ClientCommonGetStlMode, GetClientBankList } from './api'
import { Tag } from 'ant-design-vue'
export const columns: BasicColumn[] = [
{
@ -19,12 +21,21 @@ export const columns: BasicColumn[] = [
},
{
title: '结算类别',
dataIndex: 'modeText',
width: 100,
dataIndex: 'billType',
sorter: true,
width: 80,
customRender: ({ text }) => {
if (text === 1) {
return '收费'
} else if (text === 2) {
return '付费'
}
return text
}
},
{
title: '结算方式',
dataIndex: 'settlementTypeName',
dataIndex: 'modeText',
width: 100,
},
{
@ -186,16 +197,686 @@ export const columns: BasicColumn[] = [
export const searchFormSchema: FormSchema[] = [
{
field: 'mode',
field: 'billType',
label: '',
colProps: { span: 4 },
component: 'Input',
defaultValue: '2',
show: false,
defaultValue: 1
},
{
field: 'settlementNO',
label: '结算单号',
colProps: { span: 4 },
component: 'Input'
},
{
field: 'customerId',
label: '结算单位',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: GetClientListByCode,
labelField: 'pinYinCode',
valueField: 'shortName',
showName: 'shortName',
resultField: 'data',
immediate: false
}
}
},
{
field: 'applicationNO',
label: '申请单号',
colProps: { span: 4 },
component: 'Input'
},
{
field: 'ledgerVoucherNO',
label: '总账凭证号',
colProps: { span: 4 },
component: 'Input'
},
{
field: 'settlementDate',
label: '结算日期',
component: 'DatePicker',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: {
allowClear: true
}
},
]
export const detailForm: FormSchema[] = [
{
field: 'id',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'customerId',
label: '',
colProps: { span: 4 },
show: false,
component: 'Input'
},
{
field: 'customerName',
label: '结算单位',
colProps: { span: 4 },
dynamicDisabled: true,
component: 'Input'
},
{
field: 'settlementDate',
label: '结算日期',
colProps: { span: 4 },
component: 'DatePicker',
componentProps: {
showTime: true,
allowClear: true,
valueFormat: 'YYYY-MM-DD HH:00',
format: 'YYYY-MM-DD HH:00',
},
},
{
field: 'createByName',
label: '结算人',
colProps: { span: 4 },
dynamicDisabled: true,
component: 'Input'
},
{
field: 'currencyAmount',
label: '币别/金额',
colProps: { span: 4 },
dynamicDisabled: true,
component: 'Input'
},
{
field: 'settlementTypeId',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'settlementTypeName',
label: '结算方式',
colProps: { span: 4 },
component: 'ApiSelect',
componentProps: ({ formModel }) => {
return {
api: ClientCommonGetStlMode,
resultField: 'data',
labelField: 'stlName',
valueField: 'stlName',
onChange: (e, obj) => {
if (obj) {
formModel.settlementTypeId = obj.id
}
if (!obj && !e) {
formModel.settlementTypeId = ''
}
},
}
},
},
{
field: 'exchangeRate',
label: '汇率',
colProps: { span: 4 },
component: 'Input'
},
{
field: 'line2',
component: 'Divider',
colProps: {
span: 24
}
},
{
field: 'customerBankId',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'customerBankName',
label: '银行账号',
colProps: { span: 4 },
component: 'ApiSelect',
componentProps: ({ formModel }) => {
return {
api: () => {
return new Promise((resolve) => {
const queryStr = [
{
FieldName: 'ClientId',
FieldValue: formModel.customerId,
ConditionalType: '0',
},
]
const data = {
pageCondition: {
pageIndex: 1,
pageSize: 20,
sortConditions: [],
},
queryCondition: JSON.stringify(queryStr),
}
GetClientBankList(data).then((res) => {
resolve(res)
})
})
},
immediate: false,
labelField: 'account',
valueField: 'account',
resultField: 'data',
onChange: (e, obj) => {
if (obj) {
formModel.customerBankId = obj.id
}
if (!obj && !e) {
formModel.customerBankId = ''
}
},
}
},
},
{
field: 'relativeNO',
label: '相关号码',
colProps: { span: 4 },
component: 'Input'
},
{
field: 'saleDeptId',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'saleDeptName',
label: '所属分部',
colProps: { span: 4 },
component: 'ApiSelect',
componentProps: ({ formModel }) => {
return {
api: GetOrgList,
resultField: 'data',
labelField: 'label',
valueField: 'label',
onChange: (e, obj) => {
if (obj) {
formModel.saleDeptId = obj.id
}
if (!obj && !e) {
formModel.saleDeptId = ''
}
},
}
},
},
{
field: 'category',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'categoryText',
label: '业务类别',
colProps: { span: 4 },
component: 'Select',
componentProps: ({ formModel }) => {
return {
options: [
{
label: '货运收入',
value: '1'
},
{
label: '利息收入',
value: '2'
},
],
onChange: (e, obj) => {
if (obj) {
formModel.category = obj.value
}
if (!obj && !e) {
formModel.category = ''
}
},
}
},
},
]
export const markForm: FormSchema[] = [
{
field: 'line3',
component: 'Divider',
colProps: {
span: 24
}
},
{
field: 'voucherRemark',
label: '凭证备注',
colProps: { span: 8 },
component: 'InputTextArea'
},
{
field: 'note',
label: '备注',
colProps: { span: 8 },
component: 'InputTextArea'
},
{
field: 'line2',
component: 'Divider',
colProps: {
span: 24
}
},
]
export const invoiceColum: BasicColumn[] = [
{
title: '发票业务编号',
dataIndex: 'billNO',
width: 100,
},
{
title: '发票号',
dataIndex: 'invoiceNO',
width: 100,
},
{
title: '发票申请单号',
dataIndex: 'applicationNO',
width: 100,
},
{
title: '开票单位',
dataIndex: 'customerName',
width: 100,
},
{
title: '币别',
dataIndex: 'originalCurrency',
width: 100,
},
{
title: '结算金额',
dataIndex: 'settlementAmount',
width: 100,
},
{
title: '开票金额',
dataIndex: 'invoiceAmount',
width: 100,
},
{
title: 'RMB申请金额',
dataIndex: 'rmbApplyAmount',
width: 100,
},
{
title: 'USD申请金额',
dataIndex: 'usdApplyAmount',
width: 100,
},
{
title: '发票抬头',
dataIndex: 'invoiceHeader',
width: 100,
},
{
title: '开票日期',
dataIndex: 'invoiceDate',
width: 100,
},
]
export const invoiceDetailColum: BasicColumn[] = [
{
title: '委托编号',
dataIndex: 'customerNo',
width: 100,
},
{
title: '主提单号',
dataIndex: 'mblno',
width: 100,
},
{
title: '委托单位',
dataIndex: 'clientName',
width: 100,
},
{
title: '开船日期',
dataIndex: 'etd',
width: 100,
},
{
title: '业务来源',
dataIndex: 'sourceName',
width: 100,
},
{
title: '费用名称',
dataIndex: 'feeName',
width: 100,
},
{
title: '收付',
dataIndex: 'feeType',
width: 100,
},
{
title: '结算金额',
dataIndex: 'settlementAmount',
width: 100,
},
{
title: '原始币别',
dataIndex: 'originalCurrency',
width: 100,
},
{
title: '原始汇率',
dataIndex: 'originalRate',
width: 100,
},
{
title: '折算汇率',
dataIndex: 'exchangeRate',
width: 100,
},
{
title: '发票折算汇率',
dataIndex: 'applicationNO',
width: 100,
},
{
title: '原始金额',
dataIndex: 'originalAmount',
width: 100,
},
{
title: '揽货人',
dataIndex: 'saleName',
width: 100,
},
{
title: '录入方式',
dataIndex: 'applicationNO',
width: 100,
},
{
title: '会计期间',
dataIndex: 'accountDate',
width: 100,
},
{
title: '更改单',
dataIndex: 'changeOrder',
width: 100,
},
]
export const invoiceTableColums: BasicColumn[] = [
{
title: '发票类别',
dataIndex: 'category',
width: 100,
},
{
title: '发票锁定',
dataIndex: 'isLocked',
width: 80,
},
{
title: '发票业务编号',
dataIndex: 'billNO',
width: 100,
},
{
title: '开票单位',
dataIndex: 'customerName',
width: 100,
},
{
title: '币别',
dataIndex: 'currency',
width: 60,
},
{
title: '开票金额',
dataIndex: 'invoiceAmount',
width: 80,
},
{
title: '申请金额',
dataIndex: 'applyAmount',
width: 80,
},
{
title: '未结金额',
dataIndex: 'unsettledAmountText',
width: 100,
},
{
title: '本次结算金额',
dataIndex: 'originalCurrency',
width: 100,
},
{
title: '原币金额',
dataIndex: 'originalAmountText',
width: 100,
},
{
title: '发票抬头',
dataIndex: 'invoiceHeader',
width: 100,
},
{
title: '开票日期',
dataIndex: 'invoiceDate',
width: 100,
},
{
title: '开票人',
dataIndex: 'operatorName',
width: 100,
},
{
title: '所属分部',
dataIndex: 'saleDeptName',
width: 100,
},
{
title: '备注',
dataIndex: 'note',
width: 100,
},
{
title: '发票类型',
dataIndex: 'modeText',
width: 100,
},
{
title: '发票税率',
dataIndex: 'taxRate',
width: 100,
},
]
export const invoiceSearchFormSchema: FormSchema[] = [
{
field: 'customerId',
label: '开票单位',
component: 'ApiSelect',
colProps: { span: 6 },
componentProps: () => {
return {
api: GetClientListByCode,
labelField: 'pinYinCode',
valueField: 'shortName',
showName: 'shortName',
resultField: 'data',
immediate: false
}
}
},
{
field: 'billNO',
label: '编号检索',
colProps: { span: 6 },
component: 'Input'
},
{
field: 'mblno',
label: '主提单号',
component: 'Input',
field: 'invoiceHeader',
label: '发票抬头',
colProps: { span: 6 },
component: 'Input'
},
{
field: 'currency',
label: '币别',
colProps: { span: 6 },
component: 'ApiSelect',
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'codeName',
valueField: 'codeName',
resultField: 'data'
}
}
},
{
field: 'invoiceDate',
label: '开票日期',
component: 'DatePicker',
required: false,
dynamicDisabled: false,
colProps: { span: 6 },
componentProps: {
allowClear: true
}
},
{
field: 'saleDeptId',
label: '所属分部',
component: 'ApiSelect',
colProps: { span: 6 },
componentProps: () => {
return {
api: GetOrgList,
resultField: 'data',
labelField: 'label',
valueField: 'label',
}
}
},
]
export const invoiceTableDetailColums: BasicColumn[] = [
{
title: '委托编号',
dataIndex: 'customerNo',
width: 100,
},
{
title: '主提单号',
dataIndex: 'mblno',
width: 100,
},
{
title: '委托单位',
dataIndex: 'clientName',
width: 100,
},
{
title: '开船日期',
dataIndex: 'etd',
width: 100,
},
{
title: '费用名称',
dataIndex: 'feeName',
width: 100,
},
{
title: '收付',
dataIndex: 'feeType',
width: 100,
},
{
title: '结算名称',
dataIndex: 'feeName',
width: 100,
},
{
title: '原始币别',
dataIndex: 'originalCurrency',
width: 100,
},
{
title: '原始汇率',
dataIndex: 'originalRate',
width: 100,
},
{
title: '折算汇率',
dataIndex: 'exchangeRate',
width: 100,
},
{
title: '发票折算汇率',
dataIndex: 'feeName',
width: 100,
},
{
title: '原始金额',
dataIndex: 'originalAmount',
width: 100,
},
{
title: '揽货人',
dataIndex: 'saleName',
width: 100,
},
{
title: '录入方式',
dataIndex: 'feeName',
width: 100,
},
{
title: '会计期间',
dataIndex: 'accountDate',
width: 100,
},
{
title: '更改单',
dataIndex: 'feeName',
width: 100,
},
]

@ -0,0 +1,351 @@
<template>
<div class="main">
<a-spin :spinning="loading">
<div class="infoclientBox">
<div style="display: flex;align-items: center;">
<div class="btn-left">
<a-tooltip placement="top" :mouseEnterDelay="0.5" v-if="route.query.id">
<template #title>
<span>新建</span>
</template>
<span class="ds-action-svg-btn">
<img src="../../../../assets/svg/infoclient//xinjian.svg" class="SvgImg" />
</span>
</a-tooltip>
<a-tooltip placement="top" :mouseEnterDelay="0.5">
<template #title>
<span>保存</span>
</template>
<span class="ds-action-svg-btn" @click="handleSave">
<img src="../../../../assets/svg/infoclient/baocun.svg" class="SvgImg" />
</span>
</a-tooltip>
<a-tooltip placement="top" :mouseEnterDelay="0.5" v-if="route.query.id">
<template #title>
<span>上一条</span>
</template>
<span class="ds-action-svg-btn" @click="ClickLast('next')">
<img src="../../../../assets/svg/infoclient/shangxia.svg" class="SvgImg rotate" />
</span>
</a-tooltip>
<a-tooltip placement="top" :mouseEnterDelay="0.5" v-if="route.query.id">
<template #title>
<span>下一条</span>
</template>
<span class="ds-action-svg-btn" @click="ClickLast('last')">
<img src="../../../../assets/svg/infoclient/shangxia.svg" class="SvgImg" />
</span>
</a-tooltip>
</div>
<div style="color: #17a6a3" class="right-b lock" v-if="route.query.id">
<span class="iconfont icon-locksuo"></span>锁定
</div>
<div style="color: #7a8798" class="right-b lock" v-if="!route.query.id">
<span class="iconfont icon-a-jiesuo1_jiesuo"></span>未锁定
</div>
<div class="type">
<span v-if="route.query.type == 'free'"></span>
<span v-if="route.query.type == 'apply'"></span>
<span v-if="route.query.type == 'invoice'"></span>
</div>
</div>
<div style="color: #8995a4">
<span>结算单号:{{ form.settlementNO }}</span>
</div>
</div>
<div class="content">
<BasicForm @register="registerForm">
</BasicForm>
<BasicForm @register="registerFormMark">
</BasicForm>
<BasicTable class="ds-table" @row-click="handleClick" @register="registerTable">
<template #right>
<div style="width: 40%;margin-left: 10px;">
<div>
<BasicTable class="ds-table" @register="registerTable1">
<template #tableTitle>
<div>
<span class="bold">费用明细</span>
</div>
</template>
<template v-slot:bodyCell="{ column, record }">
<template v-if="column.dataIndex == 'feeType'">
<span v-if="record.feeType == 1"></span>
<span v-if="record.feeType == 2"></span>
</template>
</template>
</BasicTable>
</div>
</div>
</template>
<template #tableTitle>
<div>
<div>
<span class="bold">结算明细</span>
<a-button v-repeat type="link" @click="addDetailed()">
<span class="iconfont icon-jia"></span>
添加
</a-button>
<a-popconfirm title="确定要删除勾选的数据?" ok-text="" cancel-text="" @confirm="deleteRow">
<a-button v-repeat type="link">
<span class="iconfont icon-shanchu1"></span>删除
</a-button>
</a-popconfirm>
<a-button v-repeat type="link" @click="openFile">
<span class="iconfont icon-fujian1"></span>附件
</a-button>
</div>
</div>
</template>
<template v-slot:bodyCell="{ column, record }">
<template v-if="column.dataIndex == 'businessType'">
<span v-if="record.businessType == 1"></span>
</template>
</template>
</BasicTable>
</div>
</a-spin>
<invoiceTable ref="invoiceTableRef" @updateList="updateList"></invoiceTable>
<invoiceFile ref="invoiceFileRef"></invoiceFile>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, defineComponent, nextTick, watchEffect, watch } from 'vue'
import { InvoiceSettlementSave, InvoiceSettlementGet, GetClientBankList } from '../api'
import { useMessage } from '/@/hooks/web/useMessage'
import invoiceTable from './invoiceTable.vue'
import invoiceFile from '../../../operation/invoiceIssue/detail/invoiceFile.vue'
import { useRoute, useRouter } from 'vue-router'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { useGo } from '/@/hooks/web/usePage'
import { detailForm, markForm, invoiceColum, invoiceDetailColum } from '../columns'
import { BasicForm, useForm } from '/@/components/Form/index'
import { useUserStore } from '/@/store/modules/user'
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
const tabStore = useMultipleTabStore()
const userStore = useUserStore()
const go = useGo()
const route = useRoute()
const { createMessage } = useMessage()
const loading = ref(false)
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue, }] = useForm({
labelWidth: 100,
schemas: detailForm,
showActionButtonGroup: false,
readonly: true,
})
const [registerFormMark, { getFieldsValue: getFieldsValueMark, setFieldsValue: setFieldsValueMark }] = useForm({
labelWidth: 100,
schemas: markForm,
showActionButtonGroup: false,
})
const [registerTable, { setTableData }] = useTable({
columns: invoiceColum,
useSearchForm: false,
showIndexColumn: false,
pagination: true,
rowSelection: {},
striped: true,
bordered: true,
indexColumnProps: {
width: 60,
},
canResize: true,
showTableSetting: true,
id:'1',
immediate: false,
})
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData: setTableData1 }] = useTable({
columns: invoiceDetailColum,
useSearchForm: false,
showIndexColumn: false,
pagination: false,
striped: true,
rowKey: 'recordId',
bordered: true,
indexColumnProps: {
width: 60,
},
showTableSetting: true,
id:'2',
canResize: true,
immediate: false,
})
const invoiceTableRef = ref('')
onMounted(() => {
if (route.query.type == 'invoice' && !route.query.id) {
invoiceTableRef.value.init()
}
if (route.query.type == 'invoice' && route.query.id) {
getDetail()
}
})
const invoiceFileRef = ref('')
function openFile() {
invoiceFileRef.value.init()
}
//
function updateList(arr, currency) {
const data = {
settlement: {
...getFieldsValue(),
...getFieldsValueMark(),
},
documents: arr
}
data.settlement.billType = 1
data.settlement.mode = 4
data.settlement.currency = currency
loading.value = true
InvoiceSettlementSave(data).then(res => {
if (!route.query.id) {
const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
setTimeout(() => {
go(`/feeSettlementDetail?id=${res.data.id}`)
}, 50)
} else {
getDetail()
}
loading.value = false
}).catch(() => {
loading.value = false
})
}
const router = useRouter()
function handleSave() {
const data = {
settlement: {
...form.value,
...getFieldsValue(),
...getFieldsValueMark(),
}
}
data.settlement.billType = 1
data.settlement.mode = 4
loading.value = true
InvoiceSettlementSave(data).then(res => {
loading.value = false
createMessage.success('保存成功')
if (!route.query.id) {
const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
setTimeout(() => {
go(`/feeSettlementDetail?id=${res.data.id}`)
}, 50)
} else {
getDetail()
}
}).catch(() => {
loading.value = false
})
}
const form = ref({ settlementNO: '' }) as any
function getDetail() {
loading.value = true
InvoiceSettlementGet({ id: route.query.id }).then(res => {
if (res.succeeded) {
form.value = JSON.parse(JSON.stringify(res.data))
delete form.value.details
res.data.currencyAmount = res.data.currency + '/' + res.data.amount
setFieldsValueMark(res.data)
setFieldsValue(res.data)
setTableData(res.data.details)
}
loading.value = false
})
}
const bankList = ref([])
function getBankInfo(id) {
const queryStr = [
{
FieldName: 'ClientId',
FieldValue: id,
ConditionalType: '0',
},
]
const data = {
pageCondition: {
pageIndex: 1,
pageSize: 20,
sortConditions: [],
},
queryCondition: JSON.stringify(queryStr),
}
bankList.value = []
GetClientBankList(data).then((res) => { })
}
</script>
<style lang="less" scoped>
.infoclientBox {
display: flex;
background: rgba(245, 249, 252, 1);
padding: 13px 20px;
align-items: center;
font-size: 12px;
margin-bottom: 10px;
justify-content: space-between;
.ds-action-svg-btn {
margin-right: 20px;
}
}
.SvgImg {
width: 16px;
cursor: pointer;
&.rotate {
transform: rotate(180deg);
}
}
.btn-left {
display: flex;
align-items: center;
border-right: 1px solid #cccccc;
margin-right: 15px;
height: 24px;
}
.lock {
border-right: 1px solid #cccccc;
height: 24px;
padding-right: 15px;
line-height: 24px;
margin-right: 15px;
}
.type {
color: #72a9fa;
border-right: 1px solid #cccccc;
height: 24px;
padding-right: 15px;
line-height: 24px;
}
.content {
padding-left: 20px;
}
:deep(.ant-divider) {
margin: 5px 0 !important;
}
:deep(.ant-table-footer) {
padding: 0px !important;
background: white;
}
:deep(.ant-table-container) {
padding: 0px;
}
</style>

@ -0,0 +1,320 @@
<!--
* @Author: lijingjia lijj_xl@163.com
* @Date: 2024-06-24 10:08:36
* @Description:
-->
<template>
<div>
<a-modal width="1500px" @cancel="openFlag = false" :visible="openFlag" title="添加收费结算明细" :footer="null">
<div style="padding-bottom: 25px;">
<a-spin :spinning="loading">
<BasicTable class="ds-table" @register="registerTable" @row-click="onRowClick">
<template #tableTitle>
<div class="flex" style="align-items: center;">
<div style="font-size: 12px;font-weight: bold;margin-right: 15px">结算明细</div>
<a-button class="ml15" type="link" @click="addInfos">
<span class="iconfont icon-zengjiatianjiajiajian" :style="{ fontSize: '12px' }"></span>
添加发票明细
</a-button>
<span style="font-size: 12px;">结算币别</span>
<a-select size="small" v-model:value="currency" style="width: 150px;margin-left: 15px"
placeholder="请选择结算币别">
<a-select-option v-for="item in currencyList" :key="item.codeName" :value="item.codeName">
{{ item.description }}
</a-select-option>
</a-select>
</div>
</template>
<template #right>
<div class="right-table">
<BasicTable class="ds-table" @register="registerTable1">
<template #tableTitle>
<div>
<span class="bold">费用明细</span>
</div>
</template>
<template v-slot:bodyCell="{ column, record }">
<template v-if="column.dataIndex == 'feeType'">
<span v-if="record.feeType == 1"></span>
<span v-if="record.feeType == 2"></span>
</template>
</template>
</BasicTable>
</div>
</template>
<template #footer>
<div class="main-statistic">
<span>选中合计</span>
<span class="box">
<span class="title">发票金额:</span>
<span class="count">{{ rrmb }}</span>
</span>
</div>
</template>
<template v-slot:bodyCell="{ column, record }">
<template v-if="column.key === 'isLocked'">
<span v-if="record.isLocked"></span>
<span v-else></span>
</template>
</template>
</BasicTable>
</a-spin>
</div>
</a-modal>
<a-modal width="400px" @cancel="exchangeFlag = false" @ok="handleSureExhange" :visible="exchangeFlag"
title="币别汇率折算">
<div>
<div v-for="(item, index) in exchangarr" :key="index">
<div style="margin-bottom: 15px;margin-top: 10px">
<span class="bold" style="margin-right: 10px;width:46px;display: inline-block">1{{ item.currencyTo
}}
=</span>
<a-input-number addon-after="RMB" :precision="4" size="small" :controls="false"
v-model:value="item.reverseRate" />
</div>
</div>
</div>
</a-modal>
</div>
</template>
<script lang="ts" setup>
import { onMounted, ref, reactive, watch, defineExpose, defineProps, defineEmits, h } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import { InvoiceSettlementGetInvoiceList, InvoiceSettlementGetInvoiceDetails, InvoiceSettlementGetExchanges, GetExchangeRate } from '../api'
import { invoiceTableColums, invoiceSearchFormSchema, invoiceTableDetailColums } from '../columns'
import { GetFeeCurrencySelectList } from '/@/api/common'
import feeTable from '/@/components/CostEntry/components/feeTable.vue'
import { BasicForm, useForm } from '/@/components/Form'
import ExchangeRate from './exchangeRate.vue'
//
import { useMessage } from '/@/hooks/web/useMessage'
import { Divider } from 'ant-design-vue'
import { formatParams } from '/@/hooks/web/common'
const emits = defineEmits(['updateList', 'refresh'])
const { createMessage } = useMessage()
// rmb
const rrmb = ref(0)
const loading = ref(false)
const [registerTable, { reload, getForm, getSelectRows, setSelectedRowKeys, getDataSource }] = useTable({
api: async (p) => {
const res = await InvoiceSettlementGetInvoiceList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})
},
rowSelection: {
onChange: onSelectChange
},
beforeFetch: (p) => {
return formatParams(p)
},
columns: invoiceTableColums,
maxHeight: '900',
rowKey: 'id',
formConfig: {
labelWidth: 120,
schemas: invoiceSearchFormSchema,
useAdvancedSearch: true
},
isTreeTable: false,
pagination: true,
striped: false,
useSearchForm: true,
bordered: true,
showIndexColumn: false,
canResize: false,
showTableSetting: false,
id:'4',
immediate: false
})
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData }] = useTable({
columns: invoiceTableDetailColums,
useSearchForm: false,
showIndexColumn: false,
pagination: false,
striped: false,
maxHeight: '900',
rowKey: 'recordId',
bordered: true,
indexColumnProps: {
width: 60,
},
showTableSetting: true,
id:'3',
canResize: false,
immediate: false,
})
const exchangarr = ref([]) as any
const currenciesData = ref([]) as any
const exchangeFlag = ref(false)
//
const onRowClick = (record, index) => {
setSelectedRowKeys([record.id])
onSelectChange()
const data = {
ids: [record.id],
businessType: record.businessType,
}
loading.value = true
InvoiceSettlementGetInvoiceDetails(data).then(res => {
if (res.succeeded) {
setTableData(res.data)
}
loading.value = false
})
}
function addInfos() {
let arr = getSelectRows() ? getSelectRows() : []
if (arr.length == 0) {
createMessage.error('请选择发票')
return false
}
if (!currency.value) {
createMessage.error('请选择结算币别')
return false
}
const firstCustomerId = arr[0].customerId;
for (let i = 1; i < arr.length; i++) {
if (arr[i].customerId !== firstCustomerId) {
createMessage.error('请选择同一开票单位')
throw new Error('customerId值不一致');
}
}
let freeList = [] as any
arr.forEach(item => {
freeList.push({
id: item.id,
businessType: item.businessType,
customerId: item.customerId,
customerName:item.customerName
})
})
currenciesData.value = []
exchangarr.value = []
InvoiceSettlementGetExchanges(freeList).then(res => {
const cuArr = [] as any
currenciesData.value = res.data
res.data.forEach(item => {
item.exchangeRates.forEach(ite => {
if (ite.currency != 'RMB') {
cuArr.push({
currency: ite.currency,
id: item.id
})
}
if (ite.currency == 'RMB') {
ite.exchangeRate = 1
}
})
})
if (cuArr.length > 0) {
const filteredItems = cuArr.filter((item, index, self) =>
index === self.findIndex((t) => t.currency === item.currency)
);
const promises = filteredItems.map(item => {
return new Promise((resolve) => {
const data = {
currencyFrom: 'RMB',
currencyTo: item.currency,
}
GetExchangeRate(data).then(res => {
exchangarr.value.push(res.data)
resolve(true);
})
});
});
return Promise.all(promises).then(() => {
exchangeFlag.value = true
});
}
if (cuArr.length == 0) {
openFlag.value = false
emits('updateList', res.data, currency.value)
}
})
}
function handleSureExhange() {
currenciesData.value.forEach(item => {
item.exchangeRates.forEach(itemC => {
exchangarr.value.forEach(ite => {
if (itemC.currency == ite.currencyTo) {
itemC.exchangeRate = ite.reverseRate
}
if (itemC.currency == 'RMB') {
itemC.exchangeRate = 1
}
})
})
})
openFlag.value = false
exchangeFlag.value = false
emits('updateList', currenciesData.value, currency.value)
}
function onSelectChange(selectedRowKeys) {
const list = getSelectRows()
console.log(list)
rrmb.value = 0
list.forEach(item => {
rrmb.value += Number(item.applyAmount)
})
}
const openFlag = ref(false)
function init() {
openFlag.value = true
}
const currency = ref('')
const currencyList = ref([]) as any
onMounted(() => {
GetFeeCurrencySelectList().then(res => {
currencyList.value = res.data
})
})
defineExpose({ init })
</script>
<style lang="less" scoped>
.bold {
font-size: 12px;
font-weight: bold;
}
.right-table {
width: 40%;
margin-left: 10px;
}
:deep(.ant-table-footer) {
padding: 0px !important;
background: white;
}
:deep(.ant-table-container) {
padding: 0px;
}
.main-statistic {
background: #ffffff;
font-size: 12px;
height: 34px;
display: flex;
align-items: center;
.title {
font-size: 14px;
font-weight: 600;
}
.count {
font-size: 14px;
font-weight: 600;
color: #257AFA;
}
.box {
background: #F5F9FC;
margin-left: 10px;
padding: 0 5px;
}
}
</style>

@ -1,7 +1,7 @@
<template>
<BasicTable @row-dbClick="(e) => { GoDetailed(e) }" class="ds-table" @register="registerTable">
<template #tableTitle>
<div class="ds-h-aciton-btns">
<div class="ds-h-aciton-btns-fee">
<a-tooltip placement="top" :mouseEnterDelay="0.5">
<template #title>
<span>复制</span>
@ -53,11 +53,11 @@
<span class="iconfont icon-dingdan"></span>
新建申请结算
</a-button>
<a-button v-repeat type="link" @click="goDetail('apply')">
<a-button v-repeat type="link" @click="goDetail('invoice')">
<span class="iconfont icon-dingdan"></span>
新建发票结算
</a-button>
<a-button v-repeat type="link" @click="goDetail('apply')">
<a-button v-repeat type="link" >
<span class="iconfont icon-dingdan"></span>
生成凭证
</a-button>
@ -91,7 +91,7 @@
</template>
<script setup lang="ts">
import { ref, reactive, onMounted, defineExpose, computed } from 'vue'
import { PaymentSettlementGetList } from './api.js'
import { PaymentSettlementGetList,PaymentSettlementDelete } from './api.js'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { formatParams } from '/@/hooks/web/common'
import { columns, searchFormSchema, detailColumns, feeColumns, feeColumnsSum } from './columns'
@ -104,7 +104,7 @@ const [registerTable, { reload, setLoading, getSelectRows, getRawDataSource }] =
api: async (p) => {
const res: API.DataResult = await PaymentSettlementGetList(p)
return new Promise((resolve) => {
resolve({ data: [...res.data.list], total: res.count })
resolve({ data: [...res.data], total: res.count })
})
},
beforeFetch: (p) => {
@ -148,7 +148,7 @@ function FnDel() {
ids: [...ids]
}
setLoading(true)
GeneralInvoiceDelete(data).then(res => {
PaymentSettlementDelete(data).then(res => {
if (res.succeeded) {
createMessage.success('删除成功')
reload()
@ -159,7 +159,7 @@ function FnDel() {
})
}
function goDetail(type) {
go(`/invoiceIssueDetail?type=` + type)
go(`/feeSettlementDetail?type=` + type)
}
function handleLock() {
let ids = []
@ -185,10 +185,8 @@ function handleLock() {
})
}
function GoDetailed(row) {
if (row.modeText == '申请发票') {
go("/invoiceIssueDetail?id=" + row.id + '&type=apply')
} else {
go("/invoiceIssueDetail?id=" + row.id + '&type=free')
if (row.modeText == '发票结算') {
go("/feeSettlementDetail?id=" + row.id + '&type=invoice')
}
}
@ -198,8 +196,6 @@ function GoDetailed(row) {
<style lang="less" scoped>
.tableTitleBox {
.ant-btn-link {
// border-radius: 2px;
// background: rgba(245, 249, 252, 1);
margin-left: 13px;
color: #000;
font-size: 16px;
@ -212,11 +208,12 @@ function GoDetailed(row) {
margin: 6.8px;
}
.ds-h-aciton-btns {
.ds-h-aciton-btns-fee {
display: flex;
align-items: center;
height: 48px;
padding: 8px 0;
height: 38px;
padding-right: 10px;
border-right: 1px solid rgb(194, 188, 188);
.ds-action-svg-btn {
display: inline-block;

@ -197,3 +197,12 @@ export function GetExchangeRate(params) {
params
})
}
export function GetCurrencies(data) {
return request({
url: '/feeApi/InvoiceApplication/GetCurrencies',
method: 'post',
data
})
}

@ -278,6 +278,12 @@ export const detailColumns: BasicColumn[] = [
width: 100,
align: 'left',
},
{
title: '结费单位',
dataIndex: 'customerName',
width: 100,
align: 'left',
},
{
title: 'RMB未开',
dataIndex: 'unBilledRMB',
@ -466,7 +472,7 @@ export const detailSearchFormSchema: FormSchema[] = [
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'name',
labelField: 'codeName',
valueField: 'codeName',
resultField: 'data',
}

@ -112,6 +112,7 @@
</div>
</a-modal>
</div>
</template>
@ -120,7 +121,7 @@ import { formatParams } from '/@/hooks/web/common'
import { ref, defineExpose, watch } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { detailColumns, detailSearchFormSchema, businessTypeList } from '../columns'
import { GetBizList, InvoiceApplicationGetFees, GetExchangeRate } from '../api.js'
import { GetBizList, InvoiceApplicationGetFees, GetExchangeRate, GetCurrencies } from '../api.js'
import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage()
import { useRoute } from 'vue-router'
@ -250,6 +251,7 @@ const exchangeData = ref({}) as any
function handleChangeApply1(e) {
form.value.isYB = !e.target.checked
}
const feeType = ref('')
function changeApply() {
const arr = getSelectRowsFee()
const exchangeArr = [] as any
@ -278,6 +280,7 @@ function changeApply() {
});
});
return Promise.all(promises).then(() => {
feeType.value = 'right'
exchangeFlag.value = true
});
}
@ -296,6 +299,7 @@ function changeApply() {
const totalRmb = ref(0)
// RMB
function handleSureExhange() {
if (feeType.value == 'right') {
const arr = getSelectRowsFee()
let total = 0
arr.forEach(item => {
@ -323,14 +327,44 @@ function handleSureExhange() {
open.value = false
exchangeFlag.value = false
}, 100)
}
if (feeType.value == 'left') {
currenciesData.value.forEach(item => {
item.exchangeRates.forEach(itemC => {
exchangeData.value.forEach(ite => {
if (itemC.currency == ite.currencyTo) {
itemC.exchangeRate = ite.reverseRate
}
if (itemC.currency == 'RMB') {
itemC.exchangeRate = 1
}
})
})
})
const queryDataStr = {} as any
if (queryData.value.feeType) {
queryDataStr.feeType = queryData.value.feeType
}
if (queryData.value.currency) {
queryDataStr.currency = queryData.value.currency
}
if (queryData.value.feeName) {
queryDataStr.feeName = queryData.value.feeName
}
if (queryData.value.FeeRange) {
queryDataStr.FeeRange = queryData.value.FeeRange
}
emits('addLeft', currenciesData.value, queryDataStr, [], 'isRMB')
open.value = false
setLoading(false)
}
}
function handleClick(record, index) {
setSelectedRowKeys([record.id])
const data = {
id: record.id,
businessType: record.businessType,
customerId:record.customerId
customerId: record.customerId
}
loading.value = true
InvoiceApplicationGetFees([data]).then(res => {
@ -429,7 +463,7 @@ function onSelectAmount() {
applyAmount: item.applyAmount ? Number(item.applyAmount).toFixed(2) : 0
})
})
amountArr.value.forEach(item=>{
amountArr.value.forEach(item => {
item.applyAmount = Number(item.applyAmount)
})
amountArr.value = mergeByCurrency(amountArr.value)
@ -439,7 +473,7 @@ function mergeByCurrency(arr) {
const result = {};
arr.forEach(item => {
if (result[item.currency]) {
result[item.currency].applyAmount += item.applyAmount ;
result[item.currency].applyAmount += item.applyAmount;
result[item.currency].applyAmount = Number(result[item.currency].applyAmount.toFixed(2))
} else {
result[item.currency] = { currency: item.currency, applyAmount: Number(item.applyAmount.toFixed(2)) };
@ -447,13 +481,13 @@ function mergeByCurrency(arr) {
});
return Object.values(result);
}
const currenciesData = ref([])
//
function addDetailed() {
const arrRight = getSelectRows() ? getSelectRows() : []
const arr1 = []
const firstCustomerId = arrRight[0].customerId;
const exchangarr = [] as any
setLoading(true)
for (let i = 1; i < arrRight.length; i++) {
if (arrRight[i].customerId !== firstCustomerId) {
createMessage.error('请选择同一客户')
@ -486,49 +520,62 @@ function addDetailed() {
createMessage.error('请选择一条数据')
return false
}
setLoading(true)
if (arrRight.length > 0 && form.value.isRMB) {
const data = [] as any
arrRight.forEach(item => {
data.push({
id: item.id,
businessType: item.businessType
businessType: item.businessType,
customerId: item.customerId
})
})
InvoiceApplicationGetFees(data).then(res => {
if (res.succeeded) {
const arrByex = [] as any
res.data.items.forEach(item => {
if (item.currency != 'RMB' && item.currency != 'CNY') {
arrByex.push(item)
GetCurrencies(data).then(res => {
const cuArr = [] as any
currenciesData.value = res.data
exchangeData.value = []
res.data.forEach(item => {
item.exchangeRates.forEach(ite => {
if (ite.currency != 'RMB') {
cuArr.push({
currency: ite.currency,
id: item.id
})
}
if (ite.currency == 'RMB') {
ite.exchangeRate = 1
}
})
})
if (arrByex.length > 0) {
const promises = arrByex.map(item => {
if (cuArr.length > 0) {
const filteredItems = cuArr.filter((item, index, self) =>
index === self.findIndex((t) => t.currency === item.currency)
);
const promises = filteredItems.map(item => {
return new Promise((resolve) => {
const data = {
currencyFrom: 'RMB',
currencyTo: item.currency,
feeType: item.feeType
}
GetExchangeRate(data).then(res => {
exchangarr.push(res.data)
exchangeData.value.push(res.data)
resolve(true);
})
});
});
return Promise.all(promises).then(() => {
emits('addLeft', arrRight, queryDataStr, exchangarr, 'isRMB')
open.value = false
feeType.value = 'left'
exchangeFlag.value = true
setLoading(false)
});
} else {
emits('addLeft', arrRight, queryDataStr, [], 'isRMB')
}
if (cuArr.length == 0) {
emits('addLeft', res.data, queryDataStr, [], 'isRMB')
open.value = false
setLoading(false)
}
}
})
}
if (arrRight.length > 0 && form.value.isYB) {

@ -19,7 +19,7 @@
</a-popconfirm>
<a-button type="link" @click="openFee">
<span class="iconfont icon-peizhitubiaosvg-"></span>
费用名称
费用明细
</a-button>
<a-button type="link" @click="openFile">
<span class="iconfont icon-fujian1"></span>

@ -1071,14 +1071,6 @@ function updateListSave(arr, type) {
function addLeftSave(arr, query, exchang, type) {
loading.value = true
changeCust(arr[0].customerId, arr[0].customerName).then(res => {
const itemList = [] as any
arr.forEach(item => {
itemList.push({
id: item.id,
businessType: item.businessType,
customerId: item.customerId
})
})
const data = {
application: {
...getFieldsValue(),
@ -1088,7 +1080,7 @@ function addLeftSave(arr, query, exchang, type) {
invoiceDetails: feeTableRef.value.list,
},
exchanges: exchang,
items: itemList,
items: arr,
queryString: Object.keys(query).length != 0 ? JSON.stringify(query) : ''
}
if (type == 'isRMB') {

@ -959,7 +959,7 @@ export const freeSearch: FormSchema[] = [
componentProps: () => {
return {
api: GetFeeCurrencySelectList,
labelField: 'name',
labelField: 'codeName',
valueField: 'codeName',
resultField: 'data',
}

@ -424,7 +424,7 @@ function addDetailFree() {
}
const emits = defineEmits(['updateList', 'addLeft', 'updateListFree', 'updateListFreeLeft'])
// RMB
// RMB
function handleSureExhange() {
if (route.query.type == 'apply') {
applications.value.forEach(item => {
@ -460,7 +460,6 @@ function handleSureExhange() {
}
if (route.query.type == 'free') {
if (freeType.value == 'left') {
let arr = [] as any
currenciesData.value.forEach(item => {
item.exchangeRates.forEach(itemC => {
exchangarr.value.forEach(ite => {
@ -484,9 +483,18 @@ function handleSureExhange() {
exchangarr.value.forEach(ite => {
if (item.currency == ite.currencyTo) {
item.exchangeRate = ite.reverseRate
item.originalCurrency = item.currency
item.currency = 'RMB'
item.originalAmount = item.applyAmount
item.applyAmount = Number((Number(item.applyAmount) * Number(item.exchangeRate)).toFixed(2))
}
})
})
arr.forEach(item=>{
if(item.originalCurrency == 'RMB'){
item.originalAmount = item.applyAmount
}
})
freeFlag.value = false
exchangeFlag.value = false
emits('updateListFree', arr)

@ -779,6 +779,7 @@ function openFile() {
}
const router = useRouter()
const go = useGo()
// (rmb)
function updateListFreeLeft(val) {
const data = {
invoice: {
@ -807,6 +808,7 @@ function updateListFreeLeft(val) {
loading.value = false
})
}
//
function handleUpdate(val) {
const data = {
invoice: {
@ -835,6 +837,7 @@ function handleUpdate(val) {
loading.value = false
})
}
//
function updateListFree(val) {
val.forEach(item => {
item.originalCurrency = item.currency

Loading…
Cancel
Save