|
|
@ -258,7 +258,6 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge
|
|
|
|
},
|
|
|
|
},
|
|
|
|
useSearchForm: true,
|
|
|
|
useSearchForm: true,
|
|
|
|
showIndexColumn: false,
|
|
|
|
showIndexColumn: false,
|
|
|
|
maxHeight: '600',
|
|
|
|
|
|
|
|
pagination: true,
|
|
|
|
pagination: true,
|
|
|
|
rowKey: 'cindex',
|
|
|
|
rowKey: 'cindex',
|
|
|
|
id: '11',
|
|
|
|
id: '11',
|
|
|
@ -276,7 +275,6 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee,
|
|
|
|
columns: applyColumsDetail,
|
|
|
|
columns: applyColumsDetail,
|
|
|
|
useSearchForm: false,
|
|
|
|
useSearchForm: false,
|
|
|
|
showIndexColumn: false,
|
|
|
|
showIndexColumn: false,
|
|
|
|
maxHeight: '600',
|
|
|
|
|
|
|
|
pagination: false,
|
|
|
|
pagination: false,
|
|
|
|
dataSource: dataSource.value,
|
|
|
|
dataSource: dataSource.value,
|
|
|
|
striped: true,
|
|
|
|
striped: true,
|
|
|
@ -316,7 +314,6 @@ const [registerTableFree, { getForm: getFormFree, setSelectedRowKeys: setSelecte
|
|
|
|
},
|
|
|
|
},
|
|
|
|
useSearchForm: true,
|
|
|
|
useSearchForm: true,
|
|
|
|
showIndexColumn: false,
|
|
|
|
showIndexColumn: false,
|
|
|
|
maxHeight: '600',
|
|
|
|
|
|
|
|
rowKey: 'cindex',
|
|
|
|
rowKey: 'cindex',
|
|
|
|
id: '33',
|
|
|
|
id: '33',
|
|
|
|
showTableSetting: true,
|
|
|
|
showTableSetting: true,
|
|
|
@ -336,7 +333,6 @@ const [registerTableFreeDetail, { getSelectRows: getSelectRowsFeeDetail, setProp
|
|
|
|
columns: columnsFreeDetail,
|
|
|
|
columns: columnsFreeDetail,
|
|
|
|
useSearchForm: false,
|
|
|
|
useSearchForm: false,
|
|
|
|
showIndexColumn: false,
|
|
|
|
showIndexColumn: false,
|
|
|
|
maxHeight: '600',
|
|
|
|
|
|
|
|
pagination: false,
|
|
|
|
pagination: false,
|
|
|
|
dataSource: freeDetailList.value,
|
|
|
|
dataSource: freeDetailList.value,
|
|
|
|
striped: true,
|
|
|
|
striped: true,
|
|
|
@ -654,6 +650,7 @@ function handleClickFree(record, index) {
|
|
|
|
loading.value = false
|
|
|
|
loading.value = false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const customerIdPName = ref('')
|
|
|
|
function init(data) {
|
|
|
|
function init(data) {
|
|
|
|
if (route.query.type == 'apply') {
|
|
|
|
if (route.query.type == 'apply') {
|
|
|
|
open.value = true
|
|
|
|
open.value = true
|
|
|
@ -665,12 +662,16 @@ function init(data) {
|
|
|
|
if (customerIdP.value) {
|
|
|
|
if (customerIdP.value) {
|
|
|
|
if (route.query.type == 'free') {
|
|
|
|
if (route.query.type == 'free') {
|
|
|
|
getFormFree().setFieldsValue({
|
|
|
|
getFormFree().setFieldsValue({
|
|
|
|
customerId: customerIdP.value
|
|
|
|
customerId: customerIdP.value,
|
|
|
|
|
|
|
|
customerName: customerIdPName.value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
console.log(customerIdP.value, customerIdPName.value)
|
|
|
|
getForm().setFieldsValue({
|
|
|
|
getForm().setFieldsValue({
|
|
|
|
customerId: customerIdP.value
|
|
|
|
customerId: customerIdP.value,
|
|
|
|
|
|
|
|
customerName: customerIdPName.value
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
watch(
|
|
|
|
watch(
|
|
|
@ -752,18 +753,20 @@ function addDetailed(type) {
|
|
|
|
amountUSD: item.amountUSD,
|
|
|
|
amountUSD: item.amountUSD,
|
|
|
|
applicationId: item.id,
|
|
|
|
applicationId: item.id,
|
|
|
|
currency: ite,
|
|
|
|
currency: ite,
|
|
|
|
exchangeRate: 0
|
|
|
|
exchangeRate: 1
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (type == 'rmb') {
|
|
|
|
if (type == 'rmb') {
|
|
|
|
arr.forEach(ite => {
|
|
|
|
arr.forEach(ite => {
|
|
|
|
applications.value.push({
|
|
|
|
if (ite == 'RMB') {
|
|
|
|
amountRMB: item.amountRMB,
|
|
|
|
applications.value.push({
|
|
|
|
applicationId: item.id,
|
|
|
|
amountRMB: item.amountRMB,
|
|
|
|
currency: ite,
|
|
|
|
applicationId: item.id,
|
|
|
|
exchangeRate: 0
|
|
|
|
currency: ite,
|
|
|
|
})
|
|
|
|
exchangeRate: 1
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (type == 'usd') {
|
|
|
|
if (type == 'usd') {
|
|
|
@ -772,61 +775,68 @@ function addDetailed(type) {
|
|
|
|
amountUSD: item.amountUSD,
|
|
|
|
amountUSD: item.amountUSD,
|
|
|
|
applicationId: item.id,
|
|
|
|
applicationId: item.id,
|
|
|
|
currency: ite,
|
|
|
|
currency: ite,
|
|
|
|
exchangeRate: 0
|
|
|
|
exchangeRate: 1
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const currencySet = new Set();
|
|
|
|
if (type != 'rmb') {
|
|
|
|
const arr = [] as any
|
|
|
|
const currencySet = new Set();
|
|
|
|
applications.value.forEach(item => {
|
|
|
|
const arr = [] as any
|
|
|
|
if (item.currency != 'RMB') {
|
|
|
|
applications.value.forEach(item => {
|
|
|
|
arr.push(item)
|
|
|
|
if (item.currency != 'RMB') {
|
|
|
|
}
|
|
|
|
arr.push(item)
|
|
|
|
})
|
|
|
|
|
|
|
|
if (arr.length > 0) {
|
|
|
|
|
|
|
|
const uniqueData = arr.filter(item => {
|
|
|
|
|
|
|
|
if (!currencySet.has(item.currency)) {
|
|
|
|
|
|
|
|
currencySet.add(item.currency);
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
})
|
|
|
|
});
|
|
|
|
if (arr.length > 0) {
|
|
|
|
const promises = uniqueData.map(item => {
|
|
|
|
const uniqueData = arr.filter(item => {
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
if (!currencySet.has(item.currency)) {
|
|
|
|
const data = {
|
|
|
|
currencySet.add(item.currency);
|
|
|
|
currencyFrom: 'RMB',
|
|
|
|
return true;
|
|
|
|
currencyTo: item.currency,
|
|
|
|
|
|
|
|
feeType: 1
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
GetExchangeRate(data).then(res => {
|
|
|
|
return false;
|
|
|
|
exchangarr.value.push(res.data)
|
|
|
|
|
|
|
|
resolve(true);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
const promises = uniqueData.map(item => {
|
|
|
|
return Promise.all(promises).then(() => {
|
|
|
|
return new Promise((resolve) => {
|
|
|
|
applications.value.forEach(item => {
|
|
|
|
const data = {
|
|
|
|
exchangarr.value.forEach(ite => {
|
|
|
|
currencyFrom: 'RMB',
|
|
|
|
if (item.currency == ite.currencyTo) {
|
|
|
|
currencyTo: item.currency,
|
|
|
|
item.exchangeRate = ite.reverseRate
|
|
|
|
feeType: 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GetExchangeRate(data).then(res => {
|
|
|
|
|
|
|
|
exchangarr.value.push(res.data)
|
|
|
|
|
|
|
|
resolve(true);
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
return Promise.all(promises).then(() => {
|
|
|
|
|
|
|
|
applications.value.forEach(item => {
|
|
|
|
|
|
|
|
exchangarr.value.forEach(ite => {
|
|
|
|
|
|
|
|
if (item.currency == ite.currencyTo) {
|
|
|
|
|
|
|
|
item.exchangeRate = ite.reverseRate
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
exchangeFlag.value = true
|
|
|
|
exchangeFlag.value = true
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
|
|
|
|
emits('updateList', applications.value)
|
|
|
|
|
|
|
|
open.value = false
|
|
|
|
|
|
|
|
exchangeFlag.value = false
|
|
|
|
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
emits('updateList', applications.value)
|
|
|
|
emits('updateList', applications.value)
|
|
|
|
open.value = false
|
|
|
|
open.value = false
|
|
|
|
exchangeFlag.value = false
|
|
|
|
exchangeFlag.value = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const customerIdP = ref('')
|
|
|
|
const customerIdP = ref('')
|
|
|
|
|
|
|
|
|
|
|
|
defineExpose({ init, customerIdP })
|
|
|
|
defineExpose({ init, customerIdP, customerIdPName })
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style lang="less" scoped>
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.total {
|
|
|
|
.total {
|
|
|
|