diff --git a/package.json b/package.json index 35a1ac3d..7134e97e 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,6 @@ "dependencies": { "@ant-design/colors": "^6.0.0", "@ant-design/icons-vue": "^6.1.0", - "@element-plus/icons-vue": "^2.3.1", "@handsontable/vue3": "^14.5.0", "@iconify/iconify": "^2.2.1", "@logicflow/core": "^1.1.13", diff --git a/src/views/operation/invoiceApply/detail/InvoiceDetails.vue b/src/views/operation/invoiceApply/detail/InvoiceDetails.vue index 0279b98e..060d4441 100644 --- a/src/views/operation/invoiceApply/detail/InvoiceDetails.vue +++ b/src/views/operation/invoiceApply/detail/InvoiceDetails.vue @@ -429,6 +429,9 @@ function onSelectAmount() { applyAmount: item.applyAmount ? Number(item.applyAmount).toFixed(2) : 0 }) }) + amountArr.value.forEach(item=>{ + item.applyAmount = Number(item.applyAmount) + }) amountArr.value = mergeByCurrency(amountArr.value) } // 合并币别 @@ -436,9 +439,10 @@ function mergeByCurrency(arr) { const result = {}; arr.forEach(item => { if (result[item.currency]) { - result[item.currency].applyAmount += item.applyAmount; + result[item.currency].applyAmount += item.applyAmount ; + result[item.currency].applyAmount = Number(result[item.currency].applyAmount.toFixed(2)) } else { - result[item.currency] = { currency: item.currency, applyAmount: item.applyAmount }; + result[item.currency] = { currency: item.currency, applyAmount: Number(item.applyAmount.toFixed(2)) }; } }); return Object.values(result); diff --git a/src/views/operation/invoiceApply/detail/feeTable.vue b/src/views/operation/invoiceApply/detail/feeTable.vue index 6fe682eb..18904e64 100644 --- a/src/views/operation/invoiceApply/detail/feeTable.vue +++ b/src/views/operation/invoiceApply/detail/feeTable.vue @@ -4,6 +4,10 @@
发票明细 + + 引用发票明细 + + 添加发票明细 diff --git a/src/views/operation/invoiceApply/detail/index.vue b/src/views/operation/invoiceApply/detail/index.vue index 2162a67b..feec5ab0 100644 --- a/src/views/operation/invoiceApply/detail/index.vue +++ b/src/views/operation/invoiceApply/detail/index.vue @@ -19,14 +19,14 @@ - + -
+
{{ form.statusText }}
@@ -275,7 +275,7 @@ const bankForm = [ }, { field: 'customerBankName', - label: 'RMB开户行及账号', + label: 'RMB开户行/账号', colProps: { span: 24 }, component: 'Select', componentProps: ({ formModel }) => { @@ -310,7 +310,7 @@ const bankForm = [ component: 'Select', componentProps: ({ formModel }) => { return { - options: bankList.value, + options: bankListUsd.value, fieldNames: { label: 'name', value: 'name', @@ -489,11 +489,18 @@ const bottomForm = [ }, queryCondition: JSON.stringify(queryStr), } + bankList.value = [] + bankListUsd.value = [] GetClientBankList(data).then((res) => { res.data.forEach((item) => { item.name = item.bankName + ' ' + item.account + if (item.currency == 'RMB') { + bankList.value.push(item) + } + if (item.currency == 'USD') { + bankListUsd.value.push(item) + } }) - bankList.value = res.data if (res.data.length > 0) { setFieldsValue({ customerBankId: res.data[0].id, @@ -530,6 +537,7 @@ const bottomForm = [ } if (!obj && !e) { bankList.value = [] + bankListUsd.value = [] formModel.customer = {} formModel.customerId = '' } @@ -899,6 +907,7 @@ function getDetail() { applyAmount: item.amount }) }) + amountArr.value = mergeByCurrency(amountArr.value) } feeTableRef.value.init(res.data) } @@ -913,7 +922,10 @@ function openTempName() { }) }) } +const bankListUsd = ref([]) function getBankInfo(customerId) { + bankList.value = [] + bankListUsd.value = [] const queryStr = [ { FieldName: 'ClientId', @@ -932,8 +944,13 @@ function getBankInfo(customerId) { GetClientBankList(data).then((res) => { res.data.forEach((item) => { item.name = item.bankName + ' ' + item.account + if (item.currency == 'RMB') { + bankList.value.push(item) + } + if (item.currency == 'USD') { + bankListUsd.value.push(item) + } }) - bankList.value = res.data }) } @@ -962,42 +979,55 @@ function changeCust(id, name) { queryCondition: JSON.stringify(queryStr), } GetClientInfo({ id: id }).then(ress => { - setFieldsValue({ - taxID: ress.data.organizationCode - }) - GetClientBankList(data).then((res) => { - res.data.forEach((item) => { - item.name = item.bankName + ' ' + item.account + if (!route.query.id) { + setFieldsValue({ + taxID: ress.data.organizationCode }) - bankList.value = res.data - if (res.data.length > 0) { - setFieldsValue({ - customerBankId: res.data[0].id, - customerBankName: res.data[0].name, + bankList.value = [] + bankListUsd.value = [] + GetClientBankList(data).then((res) => { + res.data.forEach((item) => { + item.name = item.bankName + ' ' + item.account + if (item.currency == 'RMB') { + bankList.value.push(item) + } + if (item.currency == 'USD') { + bankListUsd.value.push(item) + } }) - if (res.data[0].invoiceHeaders.length > 0) { + if (res.data.length > 0) { setFieldsValue({ - invoiceHeader: res.data[0].invoiceHeaders[0].header, - customerAddTel: res.data[0].invoiceHeaders[0].addressTel + customerBankId: res.data[0].id, + customerBankName: res.data[0].name, }) + if (res.data[0].invoiceHeaders.length > 0) { + setFieldsValue({ + invoiceHeader: res.data[0].invoiceHeaders[0].header, + customerAddTel: res.data[0].invoiceHeaders[0].addressTel + }) + } else { + setFieldsValue({ + invoiceHeaders: '', + customerAddTel: '' + }) + } } else { setFieldsValue({ + customerBankId: '', + customerBankName: '', invoiceHeaders: '', customerAddTel: '' }) } - } else { - setFieldsValue({ - customerBankId: '', - customerBankName: '', - invoiceHeaders: '', - customerAddTel: '' - }) - } - setTimeout(() => { - resolve(true); - }, 300) - }) + setTimeout(() => { + resolve(true); + }, 300) + }) + } else { + resolve(true); + } + + }) }); } @@ -1036,8 +1066,6 @@ function updateListSave(arr, type) { loading.value = false }) }) - - } // 左侧的添加过来 整个业务 function addLeftSave(arr, query, exchang, type) { @@ -1109,6 +1137,18 @@ function handleRender() { } }) } +function mergeByCurrency(arr) { + const result = {}; + arr.forEach(item => { + if (result[item.currency]) { + result[item.currency].applyAmount += item.applyAmount ; + result[item.currency].applyAmount = Number(result[item.currency].applyAmount.toFixed(2)) + } else { + result[item.currency] = { currency: item.currency, applyAmount: Number(item.applyAmount.toFixed(2)) }; + } + }); + return Object.values(result); +} const tempName = ref('') const tempId = ref('') const querySearch = (queryString: string, cb: any) => { @@ -1177,6 +1217,15 @@ function handleSelect(value) { margin-left: 15px; } +.status1 { + color: #d6d30c; + font-size: 12px; + padding-right: 15px; + border-right: 1px solid #ccc; + margin-left: 15px; +} + + .invoiceNo { color: #297cfa; margin-left: 15px;