付费结算

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

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

@ -89,6 +89,12 @@ export const formSchema: FormSchema[] = [
defaultValue: '', defaultValue: '',
show: false, show: false,
}, },
{
label: '',
field: 'currencyId',
component: 'Input',
show: false,
},
{ {
field: 'currencyCode', field: 'currencyCode',
label: '币别', label: '币别',
@ -101,8 +107,15 @@ export const formSchema: FormSchema[] = [
labelField: 'name', labelField: 'name',
valueField: 'codeName', valueField: 'codeName',
resultField: 'data', resultField: 'data',
onChange: (v) => { onChange: (v, obj) => {
formModel.currencyCode = v 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', DeleteDetail = '/feeApi/PaymentSettlement/DeleteDetail',
GetApplicationList = '/feeApi/PaymentSettlement/GetApplicationList', GetApplicationList = '/feeApi/PaymentSettlement/GetApplicationList',
GetApplicationDetailsById = '/feeApi/PaymentSettlement/GetApplicationDetailsById', GetApplicationDetailsById = '/feeApi/PaymentSettlement/GetApplicationDetailsById',
GetExchanges = '/feeApi/PaymentSettlement/GetExchanges' GetExchanges = '/feeApi/PaymentSettlement/GetExchanges',
GetApplicationDetailsByDetail = '/feeApi/PaymentSettlement/GetApplicationDetailsByDetail'
} }
// 列表 (Auth) // 列表 (Auth)
export function GetList(data: PageRequest) { export function GetList(data: PageRequest) {
@ -75,6 +76,7 @@ export function GetApplicationDetailsById(params) {
}) })
} }
// 根据申请单获取费用币别 // 根据申请单获取费用币别
export function GetExchanges(data: PageRequest) { export function GetExchanges(data: PageRequest) {
return request<DataResult>({ return request<DataResult>({
@ -83,3 +85,12 @@ export function GetExchanges(data: PageRequest) {
data 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[] = [ export const searchFormSchema: FormSchema[] = [
{ {
label: '费用对象', label: '费用对象',
field: 'customerId', field: 'customerName',
component: 'ApiSelect', component: 'ApiSelect',
dynamicDisabled: false, dynamicDisabled: false,
colProps: { span: 4 }, colProps: { span: 4 },
componentProps: () => { componentProps: ({ formModel }) => {
return { return {
api: GetClientListByCode, api: GetClientListByCode,
labelField: 'pinYinCode', labelField: 'pinYinCode',
showName: 'shortName', showName: 'shortName',
valueField: 'id', valueField: 'shortName',
resultField: 'data', resultField: 'data',
immediate: false immediate: false,
onChange: (v, obj) => {
if (v && obj) formModel.customerId = obj.id
}
} }
} }
}, },
{
label: '',
field: 'customerId',
component: 'Input',
show: false
},
{ {
label: '编号检索', label: '编号检索',
field: 'mblno:hblno:debitNo:hblno:bookingNO:customerNo', field: 'mblno:hblno:debitNo:hblno:bookingNO:customerNo',

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

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

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

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

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

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

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

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

Loading…
Cancel
Save