From a045a6c1ec040aa6baaa303bd638a938e0b94a29 Mon Sep 17 00:00:00 2001 From: sunzehua Date: Thu, 7 Nov 2024 13:03:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operation/invoiceApply/detail/index.vue | 4 +- .../invoiceIssue/detail/applyInvoice.vue | 106 ++++++++++-------- .../operation/invoiceIssue/detail/index.vue | 14 ++- 3 files changed, 69 insertions(+), 55 deletions(-) diff --git a/src/views/operation/invoiceApply/detail/index.vue b/src/views/operation/invoiceApply/detail/index.vue index d57c9ab8..9bca5e1b 100644 --- a/src/views/operation/invoiceApply/detail/index.vue +++ b/src/views/operation/invoiceApply/detail/index.vue @@ -464,7 +464,7 @@ const bottomForm = [ colProps: { span: 4 }, }, { - field: 'applyDate', + field: 'createTime', label: '申请日期', component: 'DatePicker', colProps: { span: 4 }, @@ -637,7 +637,7 @@ const bottomFormEdit = [ colProps: { span: 4 }, }, { - field: 'applyDate', + field: 'createTime', label: '申请日期', component: 'DEdit', colProps: { span: 4 }, diff --git a/src/views/operation/invoiceIssue/detail/applyInvoice.vue b/src/views/operation/invoiceIssue/detail/applyInvoice.vue index a23f411b..fd3ea9d1 100644 --- a/src/views/operation/invoiceIssue/detail/applyInvoice.vue +++ b/src/views/operation/invoiceIssue/detail/applyInvoice.vue @@ -258,7 +258,6 @@ const [registerTable, { getForm, setSelectedRowKeys, getSelectRows, setProps, ge }, useSearchForm: true, showIndexColumn: false, - maxHeight: '600', pagination: true, rowKey: 'cindex', id: '11', @@ -276,7 +275,6 @@ const [registerTable1, { getSelectRows: getSelectRowsFee, setProps: setPropsFee, columns: applyColumsDetail, useSearchForm: false, showIndexColumn: false, - maxHeight: '600', pagination: false, dataSource: dataSource.value, striped: true, @@ -316,7 +314,6 @@ const [registerTableFree, { getForm: getFormFree, setSelectedRowKeys: setSelecte }, useSearchForm: true, showIndexColumn: false, - maxHeight: '600', rowKey: 'cindex', id: '33', showTableSetting: true, @@ -336,7 +333,6 @@ const [registerTableFreeDetail, { getSelectRows: getSelectRowsFeeDetail, setProp columns: columnsFreeDetail, useSearchForm: false, showIndexColumn: false, - maxHeight: '600', pagination: false, dataSource: freeDetailList.value, striped: true, @@ -654,6 +650,7 @@ function handleClickFree(record, index) { loading.value = false }) } +const customerIdPName = ref('') function init(data) { if (route.query.type == 'apply') { open.value = true @@ -665,12 +662,16 @@ function init(data) { if (customerIdP.value) { if (route.query.type == 'free') { getFormFree().setFieldsValue({ - customerId: customerIdP.value + customerId: customerIdP.value, + customerName: customerIdPName.value }) } else { + console.log(customerIdP.value, customerIdPName.value) getForm().setFieldsValue({ - customerId: customerIdP.value + customerId: customerIdP.value, + customerName: customerIdPName.value }) + } } watch( @@ -752,18 +753,20 @@ function addDetailed(type) { amountUSD: item.amountUSD, applicationId: item.id, currency: ite, - exchangeRate: 0 + exchangeRate: 1 }) }) } if (type == 'rmb') { arr.forEach(ite => { - applications.value.push({ - amountRMB: item.amountRMB, - applicationId: item.id, - currency: ite, - exchangeRate: 0 - }) + if (ite == 'RMB') { + applications.value.push({ + amountRMB: item.amountRMB, + applicationId: item.id, + currency: ite, + exchangeRate: 1 + }) + } }) } if (type == 'usd') { @@ -772,61 +775,68 @@ function addDetailed(type) { amountUSD: item.amountUSD, applicationId: item.id, currency: ite, - exchangeRate: 0 + exchangeRate: 1 }) }) } } }) - const currencySet = new Set(); - const arr = [] as any - applications.value.forEach(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; + if (type != 'rmb') { + const currencySet = new Set(); + const arr = [] as any + applications.value.forEach(item => { + if (item.currency != 'RMB') { + arr.push(item) } - return false; - }); - const promises = uniqueData.map(item => { - return new Promise((resolve) => { - const data = { - currencyFrom: 'RMB', - currencyTo: item.currency, - feeType: 1 + }) + if (arr.length > 0) { + const uniqueData = arr.filter(item => { + if (!currencySet.has(item.currency)) { + currencySet.add(item.currency); + return true; } - GetExchangeRate(data).then(res => { - exchangarr.value.push(res.data) - resolve(true); - }) + return false; }); - }); - return Promise.all(promises).then(() => { - applications.value.forEach(item => { - exchangarr.value.forEach(ite => { - if (item.currency == ite.currencyTo) { - item.exchangeRate = ite.reverseRate + const promises = uniqueData.map(item => { + return new Promise((resolve) => { + const data = { + currencyFrom: 'RMB', + currencyTo: item.currency, + 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 { emits('updateList', applications.value) open.value = false exchangeFlag.value = false } + } const customerIdP = ref('') -defineExpose({ init, customerIdP }) +defineExpose({ init, customerIdP, customerIdPName })