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