发票开出

szh-new
sunzehua 2 months ago
parent f5dfc8016e
commit 8ea67e526b

@ -115,4 +115,29 @@ export function PaymentFreeSettlementGetBizList(parameter) {
method: 'post',
data: parameter,
})
}
export function PaymentFreeSettlementGetFees(parameter) {
return request({
url: '/feeApi/PaymentFreeSettlement/GetFees',
method: 'post',
data: parameter,
})
}
export function PaymentFreeSettlementSave(parameter) {
return request({
url: '/feeApi/PaymentFreeSettlement/Save',
method: 'post',
data: parameter,
})
}
export function PaymentFreeSettlementGet(parameter) {
return request({
url: '/feeApi/PaymentFreeSettlement/Get',
method: 'get',
params: parameter,
})
}

@ -267,6 +267,12 @@ export const detailForm: FormSchema[] = [
colProps: { span: 4 },
show: false
},
{
field: 'mode',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'customerId',
label: '',
@ -469,6 +475,12 @@ export const detailForm: FormSchema[] = [
]
export const markForm: FormSchema[] = [
{
field: 'mode',
label: '',
colProps: { span: 4 },
show: false
},
{
field: 'line3',
component: 'Divider',
@ -480,7 +492,15 @@ export const markForm: FormSchema[] = [
field: 'voucherRemark',
label: '凭证备注',
colProps: { span: 8 },
component: 'InputTextArea'
component: 'InputTextArea',
ifShow: ({ values }) => {
console.log(values)
if(values.mode == '4'){
return true
} else {
return false
}
},
},
{
field: 'note',
@ -628,7 +648,7 @@ export const invoiceDetailColum: BasicColumn[] = [
},
{
title: '录入方式',
dataIndex: 'applicationNO',
dataIndex: 'inputMethod',
width: 100,
},
{
@ -641,9 +661,6 @@ export const invoiceDetailColum: BasicColumn[] = [
dataIndex: 'changeOrder',
width: 100,
},
]
export const invoiceTableColums: BasicColumn[] = [
@ -902,10 +919,35 @@ export const freeTableColums: BasicColumn[] = [
width: 100,
},
{
title: '其他未',
title: '其他未',
dataIndex: 'unchargedOther',
width: 100,
},
{
title: 'RMB收未开票',
dataIndex: 'unpaidInvoiceRMB',
width: 100,
},
{
title: 'USD收未开票',
dataIndex: 'unpaidInvoiceUSD',
width: 100,
},
{
title: 'RMB未付',
dataIndex: 'unpaidRMB',
width: 100,
},
{
title: 'USD未付',
dataIndex: 'unpaidUSD',
width: 100,
},
{
title: '其他未付',
dataIndex: 'unpaidOther',
width: 100,
},
{
title: '业务类别',
dataIndex: 'businessType',
@ -1012,7 +1054,7 @@ export const freeSearchFormSchema: FormSchema[] = [
}
},
{
field: 'billNO',
field: 'mblno:hblno:bookingNO:customerNo',
label: '编号检索',
colProps: { span: 4 },
component: 'Input'
@ -1152,7 +1194,7 @@ export const freeSearchFormSchema: FormSchema[] = [
},
{
label: '核算单位',
field: 'customerId1',
field: 'enterprise',
component: 'ApiSelect',
dynamicDisabled: false,
colProps: { span: 4 },
@ -1170,6 +1212,69 @@ export const freeSearchFormSchema: FormSchema[] = [
]
export const freeTableDetailColums: BasicColumn[] = [
{
title: '客户名称',
dataIndex: 'customerName',
width: 100,
},
{
title: '收付',
dataIndex: 'feeType',
width: 100,
},
{
title: '费用名称',
dataIndex: 'feeName',
width: 100,
},
{
title: '金额',
dataIndex: 'totalAmount',
width: 100,
},
{
title: '币别',
dataIndex: 'currency',
width: 100,
},
{
title: '未结金额',
dataIndex: 'restAmount',
width: 100,
},
{
title: '本次结算金额',
dataIndex: 'amount',
width: 100,
},
{
title: '原始汇率',
dataIndex: 'originalRate',
width: 100,
},
{
title: '开票金额',
dataIndex: 'invoiceAmount',
width: 100,
},
{
title: '发票号',
dataIndex: 'invoiceNO',
width: 100,
},
{
title: '备注',
dataIndex: 'remark',
width: 100,
},
{
title: '录入方式',
dataIndex: 'inputMethod',
width: 100,
},
]
export const freeColum: BasicColumn[] = [
{
title: '委托编号',
dataIndex: 'customerNo',
@ -1180,6 +1285,11 @@ export const freeTableDetailColums: BasicColumn[] = [
dataIndex: 'mblno',
width: 100,
},
{
title: '分提单号',
dataIndex: 'hblno',
width: 100,
},
{
title: '委托单位',
dataIndex: 'clientName',
@ -1206,13 +1316,13 @@ export const freeTableDetailColums: BasicColumn[] = [
width: 100,
},
{
title: '申请金额',
dataIndex: 'applyAmount',
title: '费用对象',
dataIndex: 'customerName',
width: 100,
},
{
title: '结算金额',
dataIndex: 'orderSettlementAmount',
dataIndex: 'settlementAmount',
width: 100,
},
{
@ -1220,6 +1330,16 @@ export const freeTableDetailColums: BasicColumn[] = [
dataIndex: 'originalCurrency',
width: 100,
},
{
title: '原始汇率',
dataIndex: 'originalRate',
width: 100,
},
{
title: '折算汇率',
dataIndex: 'exchangeRate',
width: 100,
},
{
title: '原始金额',
dataIndex: 'originalAmount',
@ -1230,4 +1350,72 @@ export const freeTableDetailColums: BasicColumn[] = [
dataIndex: 'saleName',
width: 100,
},
{
title: '经营单位',
dataIndex: 'enterprise',
width: 100,
},
{
title: '报关单号',
dataIndex: 'customNo',
width: 100,
},
{
title: '会计期间',
dataIndex: 'accountDate',
width: 100,
},
{
title: '更改单',
dataIndex: 'changeOrder',
width: 100,
},
{
title: '备注',
dataIndex: 'note',
width: 100,
},
{
title: '录入方式',
dataIndex: 'inputMethod',
width: 100,
},
{
title: '所属分部',
dataIndex: 'saleDeptName',
width: 100,
},
{
title: '船名',
dataIndex: 'changeOrder',
width: 100,
},
{
title: '航次',
dataIndex: 'vesselName',
width: 100,
},
{
title: '船公司',
dataIndex: 'carrierName',
width: 100,
},
]
export const freeDetailColum: BasicColumn[] = [
{
title: '收付',
dataIndex: 'feeType',
width: 100,
},
{
title: '币别',
dataIndex: 'currency',
width: 100,
},
{
title: '金额',
dataIndex: 'amount',
width: 100,
},
]

@ -60,7 +60,7 @@
<BasicForm @register="registerFormMark">
</BasicForm>
<BasicTable class="ds-table" @row-click="handleClick" @register="registerTable">
<BasicTable v-if="route.query.type=='invoice'" class="ds-table" @row-click="handleClick" @register="registerTable">
<template #right>
<div style="width: 40%;margin-left: 10px;">
<div>
@ -101,6 +101,54 @@
</div>
</template>
<template v-slot:bodyCell="{ column, record }">
<template v-if="column.dataIndex == 'businessType'">
<span v-if="record.businessType == 1"></span>
</template>
</template>
</BasicTable>
<BasicTable v-if="route.query.type=='free'" class="ds-table" @row-click="handleClick" @register="registerTableFree">
<template #right>
<div style="width: 40%;margin-left: 10px;">
<div>
<BasicTable class="ds-table" @register="registerTableFree1">
<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'">
@ -110,21 +158,24 @@
</BasicTable>
</div>
</a-spin>
<invoiceTable ref="invoiceTableRef" @updateList="updateList"></invoiceTable>
<invoiceTable ref="invoiceTableRef" @updateList="updateList" @updateListFree="updateListFree"></invoiceTable>
<invoiceFile ref="invoiceFileRef"></invoiceFile>
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, defineComponent, nextTick, watchEffect, watch } from 'vue'
import { InvoiceSettlementSave, InvoiceSettlementGet,
PaymentSettlementGetList, PaymentSettlementDeleteDetail, GeneralInvoiceGet } from '../api'
import {
InvoiceSettlementSave, InvoiceSettlementGet,
PaymentSettlementGetList, PaymentSettlementDeleteDetail, PaymentFreeSettlementGet,
GeneralInvoiceGet, PaymentFreeSettlementSave
} 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 { detailForm, markForm, invoiceColum, invoiceDetailColum,freeColum,freeDetailColum } from '../columns'
import { BasicForm, useForm } from '/@/components/Form/index'
import { useUserStore } from '/@/store/modules/user'
import { useMultipleTabStore } from '/@/store/modules/multipleTab'
@ -146,7 +197,7 @@ const [registerFormMark, { getFieldsValue: getFieldsValueMark, setFieldsValue: s
showActionButtonGroup: false,
})
const [registerTable, { setTableData, setSelectedRowKeys, getSelectRows }] = useTable({
columns: invoiceColum,
columns: getColums(),
useSearchForm: false,
showIndexColumn: false,
pagination: true,
@ -162,7 +213,7 @@ const [registerTable, { setTableData, setSelectedRowKeys, getSelectRows }] = use
immediate: false,
})
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData: setTableData1 }] = useTable({
columns: invoiceDetailColum,
columns: getColumsDetail(),
useSearchForm: false,
showIndexColumn: false,
pagination: false,
@ -177,6 +228,57 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
canResize: true,
immediate: false,
})
const [registerTableFree, { setTableData:setTableDataFree, setSelectedRowKeys:setSelectedRowKeysFree, getSelectRows:getSelectRowsFree }] = useTable({
columns: getColums(),
useSearchForm: false,
showIndexColumn: false,
pagination: true,
rowSelection: {},
striped: true,
bordered: true,
indexColumnProps: {
width: 60,
},
canResize: true,
showTableSetting: true,
id: '5',
immediate: false,
})
const [registerTableFree1, { setTableData: setTableDataFree1 }] = useTable({
columns: getColumsDetail(),
useSearchForm: false,
showIndexColumn: false,
pagination: false,
striped: true,
rowKey: 'recordId',
bordered: true,
indexColumnProps: {
width: 60,
},
showTableSetting: true,
id: '6',
canResize: true,
immediate: false,
})
function getColums() {
if (route.query.type == 'invoice') {
return freeDetailColum
}
if (route.query.type == 'free') {
return freeColum
}
}
function getColumsDetail() {
if (route.query.type == 'invoice') {
return invoiceDetailColum
}
if (route.query.type == 'free') {
return freeDetailColum
}
}
function ClickLast(type) {
const data = {
"queryCondition": "[]",
@ -213,17 +315,15 @@ function ClickLast(type) {
})
}
function addDetailed() {
if (route.query.type == 'invoice') {
invoiceTableRef.value.customerIdP = form.value.customerId
invoiceTableRef.value.init()
}
invoiceTableRef.value.customerIdP = form.value.customerId
invoiceTableRef.value.init()
}
const deleteRow = async () => {
let ids = []
ids = getSelectRows().map((item) => {
return item.id
})
if(ids.length==0){
if (ids.length == 0) {
createMessage.error('请选择数据')
return false
}
@ -237,7 +337,7 @@ const deleteRow = async () => {
getDetail()
}
loading.value = false
}).catch(()=>{
}).catch(() => {
loading.value = false
})
}
@ -295,6 +395,35 @@ function updateList(arr, currency) {
loading.value = false
})
}
//
function updateListFree(arr, currency) {
const data = {
settlement: {
...getFieldsValue(),
...getFieldsValueMark(),
},
details: arr
}
data.settlement.billType = 1
data.settlement.mode = 3
data.settlement.currency = currency
loading.value = true
PaymentFreeSettlementSave(data).then(res => {
if (!route.query.id) {
const { fullPath } = route //
tabStore.closeTabByKey(fullPath, router)
let type = route.query.type
setTimeout(() => {
go(`/feeSettlementDetail?id=${res.data.id}&type=${type}`)
}, 50)
} else {
getDetail()
}
loading.value = false
}).catch(() => {
loading.value = false
})
}
const router = useRouter()
function handleSave() {
const data = {
@ -327,17 +456,33 @@ function handleSave() {
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.settlementDetails)
}
loading.value = false
})
if (route.query.type == 'free') {
PaymentFreeSettlementGet({ 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.settlementDetails)
}
loading.value = false
})
}
if (route.query.type == 'invoice') {
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.settlementDetails)
}
loading.value = false
})
}
}
</script>

@ -11,10 +11,10 @@
<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>
<div style="font-size: 12px;font-weight: bold;margin-right: 5px">结算明细</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"
@ -30,7 +30,11 @@
<BasicTable class="ds-table" @register="registerTable1">
<template #tableTitle>
<div>
<span class="bold">费用明细</span>
<span class="bold">结算费用明细</span>
<a-button v-if="route.query.type == 'free'" class="ml15" type="link" @click="addInfosFee">
<span class="iconfont icon-zengjiatianjiajiajian" :style="{ fontSize: '12px' }"></span>
添加结算费用明细
</a-button>
</div>
</template>
<template v-slot:bodyCell="{ column, record }">
@ -38,18 +42,58 @@
<span v-if="record.feeType == 1"></span>
<span v-if="record.feeType == 2"></span>
</template>
<template v-if="column.dataIndex == 'amount'">
<a-input-number @change="onSelectChangeDetail" :precision="2" size="small" :controls="false"
:max="record.restAmount" v-model:value="record.amount" />
</template>
</template>
<template #footer>
<div class="main-statistic" v-if="route.query.type == 'free'">
<span>选中合计</span>
<span class="box">
<span class="title">金额:</span>
<span class="count">{{ totalAmount }}</span>
</span>
</div>
</template>
</BasicTable>
</div>
</template>
<template #footer>
<div class="main-statistic">
<div class="main-statistic" v-if="route.query.type == 'invoice'">
<span>选中合计</span>
<span class="box">
<span class="title">发票金额:</span>
<span class="count">{{ rrmb }}</span>
</span>
</div>
<div class="main-statistic" v-if="route.query.type == 'free'">
<span>选中合计</span>
<span class="box">
<span class="title">未收RMB:</span>
<span class="count">{{ srmb }}</span>
</span>
<span class="box">
<span class="title">未付RMB:</span>
<span class="count">{{ frmb }}</span>
</span>
<span class="box">
<span class="title">未收USD:</span>
<span class="count">{{ susd }}</span>
</span>
<span class="box">
<span class="title">未付USD:</span>
<span class="count">{{ fusd }}</span>
</span>
<span class="box">
<span class="title">未收其他:</span>
<span class="count">{{ sqt }}</span>
</span>
<span class="box">
<span class="title">未付其他:</span>
<span class="count">{{ ftq }}</span>
</span>
</div>
</template>
<template v-slot:bodyCell="{ column, record }">
<template v-if="column.key === 'isLocked'">
@ -72,7 +116,7 @@
<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"
<a-input-number :addon-after="item.currencyFrom" :precision="4" size="small" :controls="false"
v-model:value="item.reverseRate" />
</div>
</div>
@ -84,10 +128,10 @@
import { onMounted, ref, reactive, watch, defineExpose, defineProps, defineEmits, h } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import {
InvoiceSettlementGetInvoiceList, InvoiceSettlementGetInvoiceDetails,
InvoiceSettlementGetInvoiceList, InvoiceSettlementGetInvoiceDetails, PaymentFreeSettlementGetFees,
InvoiceSettlementGetExchanges, GetExchangeRate, PaymentFreeSettlementGetBizList
} from '../api'
import { invoiceTableColums, invoiceSearchFormSchema, invoiceTableDetailColums, freeTableColums, freeSearchFormSchema } from '../columns'
import { invoiceTableColums, invoiceSearchFormSchema, invoiceTableDetailColums, freeTableColums, freeSearchFormSchema, freeTableDetailColums } from '../columns'
import { GetFeeCurrencySelectList } from '/@/api/common'
import feeTable from '/@/components/CostEntry/components/feeTable.vue'
import { BasicForm, useForm } from '/@/components/Form'
@ -96,14 +140,15 @@ 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 emits = defineEmits(['updateList', 'refresh','updateListFree'])
import { useRoute, useRouter } from 'vue-router'
import { get } from 'lodash'
const route = useRoute()
const { createMessage } = useMessage()
// rmb
const rrmb = ref(0)
const loading = ref(false)
const [registerTable, { reload, getForm, getSelectRows, setSelectedRowKeys, getDataSource }] = useTable({
const [registerTable, { getForm, getSelectRows, setSelectedRowKeys }] = useTable({
api: async (p) => {
let res = {} as any
if (route.query.type == 'free') {
@ -124,7 +169,7 @@ const [registerTable, { reload, getForm, getSelectRows, setSelectedRowKeys, getD
},
columns: getColums(),
maxHeight: '900',
rowKey: 'id',
rowKey: getId(),
formConfig: {
labelWidth: 120,
schemas: getSearch(),
@ -137,28 +182,47 @@ const [registerTable, { reload, getForm, getSelectRows, setSelectedRowKeys, getD
bordered: true,
showIndexColumn: false,
canResize: false,
showTableSetting: false,
id: '4',
showTableSetting: true,
id: getTableId(),
immediate: false
})
const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, setTableData }] = useTable({
columns: invoiceTableDetailColums,
const [registerTable1, { getSelectRows: getSelectRowsDetail, setTableData }] = useTable({
columns: getColumsDetail(),
useSearchForm: false,
showIndexColumn: false,
pagination: false,
striped: false,
rowSelection: {
onChange: onSelectChangeDetail
},
maxHeight: '900',
rowKey: 'recordId',
bordered: true,
indexColumnProps: {
width: 60,
},
showTableSetting: true,
id: '3',
id: getTableDetailId(),
canResize: false,
immediate: false,
})
function getTableId() {
if (route.query.type == 'invoice') {
return 3
}
if (route.query.type == 'free') {
return 7
}
}
function getTableDetailId() {
if (route.query.type == 'invoice') {
return 4
}
if (route.query.type == 'free') {
return 8
}
}
function getColums() {
if (route.query.type == 'invoice') {
return invoiceTableColums
@ -167,6 +231,22 @@ function getColums() {
return freeTableColums
}
}
function getId() {
if (route.query.type == 'invoice') {
return 'id'
}
if (route.query.type == 'free') {
return 'businessId'
}
}
function getColumsDetail() {
if (route.query.type == 'invoice') {
return invoiceTableDetailColums
}
if (route.query.type == 'free') {
return freeTableDetailColums
}
}
function getSearch() {
if (route.query.type == 'invoice') {
@ -181,20 +261,41 @@ 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
})
if (route.query.type == 'invoice') {
setSelectedRowKeys([record.id])
const data = {
ids: [record.id],
businessType: record.businessType,
customerId: record.customerId
} as any
InvoiceSettlementGetInvoiceDetails(data).then(res => {
if (res.succeeded) {
setTableData(res.data)
}
loading.value = false
})
}
if (route.query.type == 'free') {
setSelectedRowKeys([record.businessId])
const data = [{
id: record.businessId,
businessType: record.businessType,
customerId: record.customerId
}] as any
PaymentFreeSettlementGetFees(data).then(res => {
if (res.succeeded) {
setTableData(res.data.items)
}
loading.value = false
})
}
}
// 1. rmb
// 2.
//
// 3.
function addInfos() {
let arr = getSelectRows() ? getSelectRows() : []
if (arr.length == 0) {
@ -271,30 +372,115 @@ function addInfos() {
}
})
}
const addFreetype = ref('')
function addInfosFee() {
let arr = getSelectRowsDetail() ? getSelectRowsDetail() : []
if (arr.length == 0) {
createMessage.error('请选择费用明细')
return false
}
if (!currency.value) {
createMessage.error('请选择结算币别')
return false
}
const cuArr = [] as any
exchangarr.value = []
arr.forEach(item => {
if (item.currency !== currency.value) {
cuArr.push(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: currency.value,
currencyTo: item.currency,
}
GetExchangeRate(data).then(res => {
exchangarr.value.push(res.data)
resolve(true);
})
});
});
return Promise.all(promises).then(() => {
addFreetype.value = 'right'
exchangeFlag.value = true
});
}
}
// 1. exchangeRates
//
function handleSureExhange() {
currenciesData.value.forEach(item => {
item.exchangeRates.forEach(itemC => {
if (route.query.type == 'invoice') {
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)
}
if (route.query.type == 'free') {
const list = JSON.parse(JSON.stringify(getSelectRowsDetail()))
list.forEach(item => {
exchangarr.value.forEach(ite => {
if (itemC.currency == ite.currencyTo) {
itemC.exchangeRate = ite.reverseRate
}
if (itemC.currency == 'RMB') {
itemC.exchangeRate = 1
if (item.currency == ite.currencyTo) {
item.exchangeRate = ite.reverseRate
}
})
})
})
openFlag.value = false
exchangeFlag.value = false
emits('updateList', currenciesData.value, currency.value)
list.forEach(item => {
item.originalCurrency = item.currency
item.currency = currency.value
item.originalAmount = item.amount
item.amount = Number((Number(item.amount) * Number(item.exchangeRate)).toFixed(2))
})
emits('updateListFree', list, currency.value)
}
}
const srmb = ref(0)
const frmb = ref(0)
const susd = ref(0)
const fusd = ref(0)
const sqt = ref(0)
const ftq = ref(0)
function onSelectChange(selectedRowKeys) {
const list = getSelectRows()
console.log(list)
rrmb.value = 0
list.forEach(item => {
rrmb.value += Number(item.applyAmount)
})
srmb.value = 0
frmb.value = 0
susd.value = 0
fusd.value = 0
sqt.value = 0
ftq.value = 0
if (route.query.type == 'free') {
list.forEach(item => {
srmb.value += Number(item.unchargedRMB)
frmb.value += Number(item.unpaidRMB)
susd.value += Number(item.unchargedUSD)
fusd.value += Number(item.unpaidUSD)
sqt.value += Number(item.unchargedOther)
ftq.value += Number(item.unpaidOther)
})
}
if (route.query.type == 'invoice') {
list.forEach(item => {
rrmb.value += Number(item.applyAmount)
})
}
}
const openFlag = ref(false)
const opneType = ref('')
@ -308,6 +494,16 @@ function init() {
}
}, 200)
}
const totalAmount = ref(0)
function onSelectChangeDetail() {
const list = getSelectRowsDetail()
if (route.query.type == 'free') {
totalAmount.value = 0
list.forEach(item => {
totalAmount.value += Number(item.amount)
})
}
}
const currency = ref('')
const currencyList = ref([]) as any
onMounted(() => {

@ -188,6 +188,9 @@ function GoDetailed(row) {
if (row.modeText == '发票结算') {
go("/feeSettlementDetail?id=" + row.id + '&type=invoice')
}
if (row.modeText == '自由结算') {
go("/feeSettlementDetail?id=" + row.id + '&type=free')
}
}

@ -555,7 +555,7 @@ export const applySearch: FormSchema[] = [
})
})
},
immediate: false,
immediate: true,
labelField: 'shortName',
valueField: 'id',
resultField: 'data',
@ -894,6 +894,7 @@ export const freeSearch: FormSchema[] = [
})
},
labelField: 'name',
immediate: true,
valueField: 'id',
showName: 'shortName',
resultField: 'data',

@ -490,8 +490,8 @@ function handleSureExhange() {
}
})
})
arr.forEach(item=>{
if(item.originalCurrency == 'RMB'){
arr.forEach(item => {
if (item.originalCurrency == 'RMB') {
item.originalAmount = item.applyAmount
}
})
@ -547,6 +547,20 @@ function init(data) {
if (route.query.type == 'free') {
freeFlag.value = true
}
console.log(customerIdP.value)
setTimeout(() => {
if (customerIdP.value) {
if (route.query.type == 'free') {
getFormFree().setFieldsValue({
customerId: customerIdP.value
})
} else {
getForm().setFieldsValue({
customerId: customerIdP.value
})
}
}
}, 200)
}
@ -648,11 +662,10 @@ function addDetailed() {
}
const customerIdP = ref('')
function changeCustIn(id) {
customerIdP.value = id
}
defineExpose({ init, changeCustIn })
defineExpose({ init, customerIdP })
</script>
<style lang="less" scoped>
.total {

@ -48,7 +48,7 @@
<div style="color: #3081fa" class="right-b" v-if="route.query.type == 'free'">
<span class="iconfont icon-touzijilu"></span>自由开票
</div>
<div style="color: rgba(122, 135, 152, 1)" class="right-b" >
<div style="color: rgba(122, 135, 152, 1)" class="right-b">
<span class="iconfont icon-a-xiaopiaofapiao-01"></span>普票
</div>
<!-- <div style="color: rgba(37, 122, 250, 1)" class="right-b" v-if="route.query.id">
@ -693,9 +693,8 @@ onMounted(() => {
}
})
function handleInto() {
if (route.query.type = 'apply') {
applyInvoiceRef.value.init()
}
applyInvoiceRef.value.init()
applyInvoiceRef.value.customerIdP = form.value.customerId
}
function handleSave() {
const data = {
@ -785,7 +784,7 @@ function updateListFreeLeft(val) {
invoice: {
...form.value,
...getFieldsValue(),
invoiceDetails:list.value
invoiceDetails: list.value
},
bizList: val,
}
@ -814,7 +813,7 @@ function handleUpdate(val) {
invoice: {
...form.value,
...getFieldsValue(),
invoiceDetails:list.value
invoiceDetails: list.value
},
applications: val,
}
@ -849,7 +848,7 @@ function updateListFree(val) {
invoice: {
...form.value,
...getFieldsValue(),
invoiceDetails:list.value
invoiceDetails: list.value
},
details: val,
}
@ -1474,6 +1473,7 @@ watchEffect(() => {
width: 39%;
margin-left: 1%;
}
.line {
font-size: 12px;
border-bottom: 1px solid rgba(158, 83, 9, 1);

Loading…
Cancel
Save