付费结算

feature-JimuReport-1106-yjl
lijingjia 1 month ago
parent c47a8a7f0f
commit 3bdd383e80

@ -96,13 +96,14 @@
row.amount = Number(e * row.originalRate).toFixed(6)
}
// (Auth)
const getFees = async (id, businessType, customerId) => {
const getFees = async (id, businessType, customerId, queryCondition) => {
const postData = {
items: [{
id,
businessType,
customerId
}]
}],
queryCondition
}
loading.value = true
await GetFees(postData).then(res => {
@ -173,7 +174,7 @@
})
}
const page = ref()
const init = async (ids, source, businessType, customerId) => {
const init = async (ids, source, businessType, customerId, queryCondition) => {
page.value = source
if (ids.length) {
if (ids[0] == undefined) {
@ -191,9 +192,10 @@
await getFeeListByTem(ids[0])
return feeData.value
}
//
if (source == 'apply') {
nowFeeColumns.value = feeApplyColumns
await getFees(ids[0].slice(0, -1), businessType, customerId)
await getFees(ids[0].slice(0, -1), businessType, customerId, queryCondition)
return feeData.value
}
}

@ -89,6 +89,12 @@ export const formSchema: FormSchema[] = [
defaultValue: '',
show: false,
},
{
label: '',
field: 'currencyId',
component: 'Input',
show: false,
},
{
field: 'currencyCode',
label: '币别',
@ -101,8 +107,15 @@ export const formSchema: FormSchema[] = [
labelField: 'name',
valueField: 'codeName',
resultField: 'data',
onChange: (v) => {
formModel.currencyCode = v
onChange: (v, obj) => {
if (v && obj) {
formModel.currencyId = obj.id
formModel.currencyCode = v
}
if (!v && !obj) {
formModel.currencyId = null
formModel.currencyCode = null
}
},
}
},

@ -14,7 +14,8 @@ enum Api {
DeleteDetail = '/feeApi/PaymentSettlement/DeleteDetail',
GetApplicationList = '/feeApi/PaymentSettlement/GetApplicationList',
GetApplicationDetailsById = '/feeApi/PaymentSettlement/GetApplicationDetailsById',
GetExchanges = '/feeApi/PaymentSettlement/GetExchanges'
GetExchanges = '/feeApi/PaymentSettlement/GetExchanges',
GetApplicationDetailsByDetail = '/feeApi/PaymentSettlement/GetApplicationDetailsByDetail'
}
// 列表 (Auth)
export function GetList(data: PageRequest) {
@ -75,6 +76,7 @@ export function GetApplicationDetailsById(params) {
})
}
// 根据申请单获取费用币别
export function GetExchanges(data: PageRequest) {
return request<DataResult>({
@ -83,3 +85,12 @@ export function GetExchanges(data: PageRequest) {
data
})
}
// 根据结算明细查询费用明细
export function GetApplicationDetailsByDetail(data: PageRequest) {
return request<DataResult>({
url: Api.GetApplicationDetailsByDetail,
method: 'post',
data
})
}

@ -632,21 +632,30 @@ export const formSchema: FormSchema[] = [
export const searchFormSchema: FormSchema[] = [
{
label: '费用对象',
field: 'customerId',
field: 'customerName',
component: 'ApiSelect',
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: GetClientListByCode,
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'id',
valueField: 'shortName',
resultField: 'data',
immediate: false
immediate: false,
onChange: (v, obj) => {
if (v && obj) formModel.customerId = obj.id
}
}
}
},
{
label: '',
field: 'customerId',
component: 'Input',
show: false
},
{
label: '编号检索',
field: 'mblno:hblno:debitNo:hblno:bookingNO:customerNo',

@ -5,7 +5,7 @@
-->
<template>
<div class="ds-settle-apply-detail-fee-info">
<BasicTable @register="registerTable">
<BasicTable @register="registerTable" @row-click="handleClickRow">
<template #tableTitle>
<div class="flex">
<h4>结算明细</h4>
@ -38,6 +38,7 @@
<template #right>
<Divider
type="vertical"
style="height: auto; background: rgba(0,0,0,0.06);"
/>
<div class="info">
<feeTable
@ -52,7 +53,7 @@
<script lang="ts" setup>
import { onMounted, ref, defineEmits, defineProps, watch, defineExpose } from 'vue'
import { BasicTable, useTable } from '/@/components/Table'
import { columns } from './applyInfoColumns'
import { businessColumns } from '../columns'
import { Divider } from 'ant-design-vue'
import invoiceFile from '/@/views/operation/invoiceIssue/detail/invoiceFile.vue'
import { DeleteDetail } from '../../api'
@ -84,7 +85,7 @@
})
const [registerTable, { reload, setTableData, getSelectRows, getColumns }] = useTable({
title: '',
columns,
columns: businessColumns,
isTreeTable: false,
pagination: false,
striped: false,
@ -120,6 +121,12 @@
}
})
}
//
const feeTabel = ref(null)
const handleClickRow = (record) => {
console.log(record)
feeTabel.value.init(record.id)
}
//
const exportExcel = () => {
exportExcelByData(props.feeData, getColumns(), '费用明细')

@ -97,7 +97,10 @@
const [registerTable, { reload, getForm, getSelectRowKeys, getPaginationRef, getSelectRows, setSelectedRows, getDataSource }] = useTable({
api: async (p) => {
const res = await GetApplicationList(p)
if (res?.data?.length) state.historyRowKeys = [res.data[0].id]
if (res?.data?.length) {
state.historyRowKeys = [res.data[0].id]
feeTabel.value.init(res.data[0].id)
}
setSelectedRows([res.data[0]])
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
@ -230,12 +233,14 @@
currencyConf[item.currency] = item.value
})
bPostData.value.documents.forEach(item => {
item['currency'] = getFieldsValue().currency
item.exchangeRates.forEach(row => {
row.exchangeRate = currencyConf[row.currency]
})
})
loading.value = true
Save(bPostData.value).then(res => {
console.log(bPostData.value)
loading.value = false
if (res.succeeded) {
createMessage.success('添加成功!')
@ -257,85 +262,71 @@
if (selectRows.length == 0) {
return createMessage.warning('没有选择要添加的业务!')
}
console.log(props.formData)
//
const postData = {
description: '按申请单增加添加费用明细',
settlement: props.formData,
documents: getSelectRows()
}
if (!currency) {
console.log(postData)
return
loading.value = true
Save(postData).then(async (res) => {
loading.value = false
if (res.succeeded) {
createMessage.success('添加成功!')
if (res?.data?.id) {
emit('refresh', res.data.id)
//
if (!postData.settlement?.currency) postData.settlement.currency = currency
//
let currencyList = []
//
const postCurrency = selectRows.map(item => {
return {
id: item.id,
customerId: item.customerId
}
})
const items = await GetExchanges(postCurrency).then(res => {
return res.data
})
items.forEach(item => {
if (item.exchangeRates) {
item.exchangeRates.forEach(c => {
if(c.currency != currency) {
currencyList.push({
currency: c.currency,
feeType: 2
})
}
})
}
selectRows.forEach(row => {
if (item.id == row.id) {
item.settlementOther = row.settlementOther
item.settlementRMB = row.settlementRMB
item.settlementUSD = row.settlementUSD
item.businessType = 1
item.customerName = row.customerName
}
}).catch(() => {
loading.value = false
})
} else {
//
// props.setFieldsValue({
// currency
// })
//
let currencyList = []
//
const postCurrency = selectRows.map(item => {
return {
id: item.id,
customerId: item.customerId
if (type == 'rmb') {
item.settlementUSD = 0
item.settlementOther = 0
}
})
const items = await GetExchanges(postCurrency).then(res => {
return res.data
})
console.log(items)
items.forEach(item => {
if (item.exchangeRates) {
item.exchangeRates.forEach(c => {
if(c.currency != currency) {
currencyList.push({
currency: c.currency
})
}
})
if (type == 'usd') {
item.settlementRMB = 0
item.settlementOther = 0
}
selectRows.forEach(row => {
if (item.id == row.id) {
item.settlementOther = row.settlementOther
item.settlementRMB = row.settlementRMB
item.settlementUSD = row.settlementUSD
}
if (type == 'rmb') {
item.settlementUSD = 0
item.settlementOther = 0
}
if (type == 'usd') {
item.settlementRMB = 0
item.settlementOther = 0
}
})
})
//
currencyList = Array.from(new Set(currencyList.map(item => item.currency))).map(currency => {
return currencyList.find(item => item.currency === currency)
})
postData.documents = items
bPostData.value = postData
exchangeRate.value.init(currency, currencyList)
}
})
//
currencyList = Array.from(new Set(currencyList.map(item => item.currency))).map(currency => {
return currencyList.find(item => item.currency === currency)
})
postData.documents = items
console.log(postData)
bPostData.value = postData
exchangeRate.value.init(currency, currencyList)
}
onMounted(async () => {
//
if (props.formData?.customerId) {
await getForm().setFieldsValue({ 'customerId': props.formData.customerId })
await getForm().setFieldsValue({ 'customerId': props.formData.customerId, customerName: props.formData.customerName })
setFieldsValue({
currency: props.formData.currency
})

@ -19,13 +19,13 @@
//
import { feeColumns } from '../columns'
// id
import { GetApplicationDetailsById } from '../../api'
import { GetApplicationDetailsByDetail } from '../../api'
import { BasicTable, useTable } from '/@/components/Table'
// id, id
const aid = ref('')
const [registerTable, { reload }] = useTable({
api: async (p) => {
const res = await GetApplicationDetailsById(p)
const res = await GetApplicationDetailsByDetail(p)
return new Promise((resolve) => {
resolve({ data: [...res.data], total: res.count })
})

@ -48,7 +48,7 @@
<div class="form-area mt15">
<BasicForm @register="registerForm" />
</div>
<!-- 申请明细 -->
<!-- 结算明细 -->
<div>
<ApplyInfo
ref="applyInfo"

@ -8,7 +8,7 @@ import { useOptionsStore } from '/@/store/modules/options'
const optionsStore = useOptionsStore()
import { useRoute } from 'vue-router'
const route = useRoute()
import { GetClientListByCode, getOrgList, GetClientBank } from '/@/api/common'
import { GetClientListByCode, getOrgList, GetClientBank, GetFeeCodeSelectList } from '/@/api/common'
// 业务表格列
export const businessColumns: BasicColumn[] = [
{
@ -551,31 +551,33 @@ export const formSchema: FormSchema[] = [
export const searchFormSchema: FormSchema[] = [
{
label: '费用对象',
field: 'customerId',
field: 'customerName',
component: 'ApiSelect',
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: () => {
componentProps: ({ formModel }) => {
return {
api: GetClientListByCode,
labelField: 'pinYinCode',
showName: 'shortName',
valueField: 'id',
valueField: 'shortName',
resultField: 'data',
immediate: true
immediate: true,
onChange: (v, obj) => {
if (v && obj) formModel.customerId = obj.id
}
}
}
},
{
label: '编号查询',
field: 'mblno:hblno:debitNo:hblno:bookingNO:customerNo',
label: '',
field: 'customerId',
component: 'Input',
dynamicDisabled: false,
colProps: { span: 4 }
show: false
},
{
label: '编号查询',
field: 'mblno:hblno:debitNo',
field: 'mblno:hblno:debitNo:hblno:bookingNO:customerNo',
component: 'Input',
dynamicDisabled: false,
colProps: { span: 4 }
@ -591,45 +593,85 @@ export const searchFormSchema: FormSchema[] = [
}
},
{
field: 'isInvoice',
label: '是否开票',
component: 'Select',
field: 'etd',
label: '开船日期',
component: 'DatePicker',
required: false,
dynamicDisabled: false,
colProps: { span: 4 },
componentProps: {
options: [
{ label: '是', value: true },
{ label: '否', value: false }
]
allowClear: true,
}
},
{
field: 'isAdvancedPay',
label: '是否垫付',
label: '所属分部',
field: 'saleOrgId',
component: 'ApiSelect',
required: false,
colProps: { span: 4 },
componentProps: () => {
return {
api: getOrgList,
labelField: 'label',
valueField: 'id',
resultField: 'data',
immediate: false
}
}
},
{
field: 'feeType',
label: '收付',
component: 'Select',
colProps: { span: 4 },
defaultValue: '2',
componentProps: {
options: [
{ label: '是', value: true },
{ label: '否', value: false }
{
label: '收',
value: '1',
},
{
label: '付',
value: '2',
}
]
}
},
{
label: '所属分部',
field: 'saleOrgId',
field: 'currency',
label: '币别',
component: 'ApiSelect',
required: false,
defaultValue: null,
colProps: { span: 4 },
componentProps: () => {
return {
api: getOrgList,
labelField: 'label',
valueField: 'id',
option: optionsStore.getOptionsByCode('GetFeeCurrencySelectList'),
labelField: 'name',
valueField: 'codeName',
resultField: 'data',
immediate: false
immediate: false,
filterOption: (input: string, option: any) => {
return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
}
}
}
},
{
field: 'feeName',
label: '费用名称',
component: 'ApiSelect',
colProps: { span: 4 },
componentProps: () => {
return {
api: GetFeeCodeSelectList,
labelField: 'name',
valueField: 'id',
resultField: 'data',
}
},
},
]
export const currencyFormSchema: FormSchema[] = [

@ -131,6 +131,8 @@
const rother = ref(0)
//
const pother = ref(0)
//
const feeParams = ref()
const loading = ref(false)
const [registerTable, { reload, getForm, getSelectRows, setSelectedRows, getDataSource }] = useTable({
api: async (p) => {
@ -145,6 +147,7 @@
})
},
beforeFetch: (p) => {
feeParams.value = p
return formatParams(p)
},
columns: businessColumns,
@ -447,7 +450,12 @@
})
let customerId = btype[0]?.customerId
btype = btype[0]?.businessType
feeTabel.value.init([item], 'apply', btype, customerId).then(res => {
const params = {}
if (feeParams.value.currency) params['currency'] = feeParams.value.currency
if (feeParams.value.currency) params['feeType'] = feeParams.value.feeType
if (feeParams.value.currency) params['feeName'] = feeParams.value.feeName
if (feeParams.value.currency) params['customerId'] = feeParams.value.customerId
feeTabel.value.init([item], 'apply', btype, customerId, JSON.stringify(params)).then(res => {
allFeeData[item] = res
})
})
@ -488,7 +496,7 @@
onMounted(async () => {
//
if (props.formData?.customerId) {
await getForm().setFieldsValue({ 'customerId': props.formData.customerId })
await getForm().setFieldsValue({ 'customerId': props.formData.customerId, customerName: props.formData.customerName })
setFieldsValue({
currency: props.formData.currency
})

@ -9,30 +9,30 @@
<div class="mt15">
<div v-for="(item, index) in c2" :key="'cur' + index">
<p class="flex">
<span class="unit">1{{ c1 }} =</span>
<span class="unit">1{{ item.currency }} =</span>
<a-input-number
v-model:value="item.value"
v-model:value="item.value1"
:min="0.000001"
:max="99999999"
:step="0.000001"
string-mode
:precision="6"
@change="calc1($event, item)"
string-mode
@change="calc2($event, item)"
/>
{{ item.currency }}
{{ c1 }}
</p>
<p class="flex">
<span class="unit">1{{ item.currency }} =</span>
<span class="unit">1{{ c1 }} =</span>
<a-input-number
v-model:value="item.value1"
v-model:value="item.value"
:min="0.000001"
:max="99999999"
:step="0.000001"
:precision="6"
string-mode
@change="calc2($event, item)"
:precision="6"
@change="calc1($event, item)"
/>
{{ c1 }}
{{ item.currency }}
</p>
</div>
</div>
@ -56,6 +56,10 @@
//
const c2 = ref([])
const init = (currency, list, type) => {
if (list.length == 0) {
handleOk()
return
}
visible.value = true
c1.value = currency
c2.value = list

@ -90,7 +90,6 @@
const visible = ref(false)
import { formSchema } from './columns'
import { Save, Get, Delete, ApplyAudit } from '../api'
console.log(route.path)
const [registerForm, { validate, getFieldsValue, setFieldsValue }] = useForm({
labelWidth: 150,
schemas: formSchema,
@ -126,7 +125,6 @@
//
const save = async (feeInfo) => {
const postData = await validate()
console.log(postData)
if (feeInfo && feeInfo.length) {
postData['details'] = [...feeData.value, ...feeInfo]
} else {

Loading…
Cancel
Save