|
|
@ -11,7 +11,7 @@
|
|
|
|
:canRowSelect="true"
|
|
|
|
:canRowSelect="true"
|
|
|
|
:scroll="{ x: '100%', y: 400 }"
|
|
|
|
:scroll="{ x: '100%', y: 400 }"
|
|
|
|
:row-selection="{ selectedRowKeys: state.historyRowKeys, onChange: historyChange }"
|
|
|
|
:row-selection="{ selectedRowKeys: state.historyRowKeys, onChange: historyChange }"
|
|
|
|
rowKey="idIndex"
|
|
|
|
rowKey="id"
|
|
|
|
@register="registerTable"
|
|
|
|
@register="registerTable"
|
|
|
|
@row-click="onRowClick"
|
|
|
|
@row-click="onRowClick"
|
|
|
|
>
|
|
|
|
>
|
|
|
@ -30,6 +30,16 @@
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<template v-slot:bodyCell="{ column, record }">
|
|
|
|
|
|
|
|
<!-- RMB本次结算 -->
|
|
|
|
|
|
|
|
<template v-if="column.dataIndex == 'settlementRMB'">
|
|
|
|
|
|
|
|
<a-input-number v-model:value="record.settlementRMB" size="small" :min="0.01" :max="record.unSettledRMB" />
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<!-- USD本次结算 -->
|
|
|
|
|
|
|
|
<template v-if="column.dataIndex == 'settlementUSD'">
|
|
|
|
|
|
|
|
<a-input-number v-model:value="record.settlementUSD" size="small" :min="0.01" :max="record.unSettledUSD" />
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
<template #right>
|
|
|
|
<template #right>
|
|
|
|
<Divider
|
|
|
|
<Divider
|
|
|
|
type="vertical"
|
|
|
|
type="vertical"
|
|
|
@ -58,7 +68,7 @@
|
|
|
|
<script lang="ts" setup>
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { onMounted, ref, reactive, watch, defineExpose, defineProps, defineEmits, h } from 'vue'
|
|
|
|
import { onMounted, ref, reactive, watch, defineExpose, defineProps, defineEmits, h } from 'vue'
|
|
|
|
import { BasicTable, useTable } from '/@/components/Table'
|
|
|
|
import { BasicTable, useTable } from '/@/components/Table'
|
|
|
|
import { GetApplicationList } from '../../api'
|
|
|
|
import { GetApplicationList, Save } from '../../api'
|
|
|
|
import { businessColumns, searchFormSchema, currencyFormSchema } from '../columns'
|
|
|
|
import { businessColumns, searchFormSchema, currencyFormSchema } from '../columns'
|
|
|
|
import feeTable from './feeTable.vue'
|
|
|
|
import feeTable from './feeTable.vue'
|
|
|
|
import { BasicForm, useForm } from '/@/components/Form'
|
|
|
|
import { BasicForm, useForm } from '/@/components/Form'
|
|
|
@ -80,26 +90,11 @@
|
|
|
|
type: Function
|
|
|
|
type: Function
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
// 未收rmb
|
|
|
|
|
|
|
|
const rrmb = ref(0)
|
|
|
|
|
|
|
|
// 未付rmb
|
|
|
|
|
|
|
|
const prmb = ref(0)
|
|
|
|
|
|
|
|
// 未收usd
|
|
|
|
|
|
|
|
const rusd = ref(0)
|
|
|
|
|
|
|
|
// 未付usd
|
|
|
|
|
|
|
|
const pusd = ref(0)
|
|
|
|
|
|
|
|
// 未收其他
|
|
|
|
|
|
|
|
const rother = ref(0)
|
|
|
|
|
|
|
|
// 未付其他
|
|
|
|
|
|
|
|
const pother = ref(0)
|
|
|
|
|
|
|
|
const loading = ref(false)
|
|
|
|
const loading = ref(false)
|
|
|
|
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)
|
|
|
|
res.data.forEach((item, index) => {
|
|
|
|
if (res?.data?.length) state.historyRowKeys = [res.data[0].id]
|
|
|
|
item['idIndex'] = item.id + index
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
if (res?.data?.length) state.historyRowKeys = [res.data[0].id + 0]
|
|
|
|
|
|
|
|
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 })
|
|
|
@ -147,6 +142,7 @@
|
|
|
|
const historyChange = async (v) => {
|
|
|
|
const historyChange = async (v) => {
|
|
|
|
console.log(v)
|
|
|
|
console.log(v)
|
|
|
|
if (v.length > 1) {
|
|
|
|
if (v.length > 1) {
|
|
|
|
|
|
|
|
console.log(getDataSource())
|
|
|
|
const a = getDataSource().filter(item => {
|
|
|
|
const a = getDataSource().filter(item => {
|
|
|
|
return item.id == v[0]
|
|
|
|
return item.id == v[0]
|
|
|
|
})[0]
|
|
|
|
})[0]
|
|
|
@ -161,8 +157,10 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 行点击事件
|
|
|
|
// 行点击事件
|
|
|
|
const onRowClick = (record) => {
|
|
|
|
const onRowClick = (record) => {
|
|
|
|
state.historyRowKeys = [record?.idIndex]
|
|
|
|
state.historyRowKeys = [record?.id]
|
|
|
|
setSelectedRows([record])
|
|
|
|
setSelectedRows([record])
|
|
|
|
|
|
|
|
// 初始化费用表格数据
|
|
|
|
|
|
|
|
feeTabel.value.init(record.id)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const feeData = () => {
|
|
|
|
const feeData = () => {
|
|
|
|
return feeTabel.value.selectfeeData
|
|
|
|
return feeTabel.value.selectfeeData
|
|
|
@ -255,25 +253,25 @@
|
|
|
|
if (!props.formData.currency) {
|
|
|
|
if (!props.formData.currency) {
|
|
|
|
// 原币申请
|
|
|
|
// 原币申请
|
|
|
|
const postData = {
|
|
|
|
const postData = {
|
|
|
|
description: '按业务增加添加费用明细',
|
|
|
|
description: '按申请单增加添加费用明细',
|
|
|
|
application: {
|
|
|
|
settlement: props.formData,
|
|
|
|
id: 0,
|
|
|
|
documents: getSelectRows()
|
|
|
|
customerId: selectRows[0]?.customerId
|
|
|
|
}
|
|
|
|
},
|
|
|
|
loading.value = true
|
|
|
|
items: [{
|
|
|
|
Save(postData).then(res => {
|
|
|
|
id: selectRows[0]?.id,
|
|
|
|
loading.value = false
|
|
|
|
businessType: selectRows[0]?.businessType,
|
|
|
|
if (res.succeeded) {
|
|
|
|
customerId: selectRows[0]?.customerId
|
|
|
|
createMessage.success('添加成功!')
|
|
|
|
}]
|
|
|
|
if (res?.data?.id) {
|
|
|
|
}
|
|
|
|
props.setFieldsValue({
|
|
|
|
// loading.value = true
|
|
|
|
...res.data
|
|
|
|
// BizSave(postData).then(res => {
|
|
|
|
})
|
|
|
|
// loading.value = false
|
|
|
|
}
|
|
|
|
// if (res.succeeded) {
|
|
|
|
emit('refresh')
|
|
|
|
// createMessage.success('增加成功!')
|
|
|
|
}
|
|
|
|
// emit('refresh')
|
|
|
|
}).catch(() => {
|
|
|
|
// }
|
|
|
|
loading.value = false
|
|
|
|
// })
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// 转换汇率申请
|
|
|
|
// 转换汇率申请
|
|
|
|
// 合并所有选择过的费用明细
|
|
|
|
// 合并所有选择过的费用明细
|
|
|
@ -304,11 +302,6 @@
|
|
|
|
exchangeRate.value.init(props.formData.currency, currencyList)
|
|
|
|
exchangeRate.value.init(props.formData.currency, currencyList)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
watch(
|
|
|
|
|
|
|
|
() => state.historyRowKeys, (v, old) => {
|
|
|
|
|
|
|
|
// 勾选前后同的id
|
|
|
|
|
|
|
|
const diffIds = findDifferentElements(v, old)
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(async () => {
|
|
|
|
onMounted(async () => {
|
|
|
|
// 如果存在结算对象,则业务数据根据结算对象进行过滤
|
|
|
|
// 如果存在结算对象,则业务数据根据结算对象进行过滤
|
|
|
@ -353,6 +346,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.vben-basic-table-header__toolbar {
|
|
|
|
.vben-basic-table-header__toolbar {
|
|
|
|
padding: 4px;
|
|
|
|
padding: 4px;
|
|
|
|
|
|
|
|
height: 48px;
|
|
|
|
justify-content: space-between;
|
|
|
|
justify-content: space-between;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.vben-basic-table {
|
|
|
|
.vben-basic-table {
|
|
|
|