szh-new
sunzehua 2 months ago
parent f3efa5077e
commit f074bde479

@ -35,7 +35,6 @@
"dependencies": { "dependencies": {
"@ant-design/colors": "^6.0.0", "@ant-design/colors": "^6.0.0",
"@ant-design/icons-vue": "^6.1.0", "@ant-design/icons-vue": "^6.1.0",
"@element-plus/icons-vue": "^2.3.1",
"@handsontable/vue3": "^14.5.0", "@handsontable/vue3": "^14.5.0",
"@iconify/iconify": "^2.2.1", "@iconify/iconify": "^2.2.1",
"@logicflow/core": "^1.1.13", "@logicflow/core": "^1.1.13",

@ -429,6 +429,9 @@ function onSelectAmount() {
applyAmount: item.applyAmount ? Number(item.applyAmount).toFixed(2) : 0 applyAmount: item.applyAmount ? Number(item.applyAmount).toFixed(2) : 0
}) })
}) })
amountArr.value.forEach(item=>{
item.applyAmount = Number(item.applyAmount)
})
amountArr.value = mergeByCurrency(amountArr.value) amountArr.value = mergeByCurrency(amountArr.value)
} }
// //
@ -436,9 +439,10 @@ function mergeByCurrency(arr) {
const result = {}; const result = {};
arr.forEach(item => { arr.forEach(item => {
if (result[item.currency]) { 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 { } 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); return Object.values(result);

@ -4,6 +4,10 @@
<div> <div>
<span style="font-size: 12px;font-weight: bold;margin-right:20px ">发票明细</span> <span style="font-size: 12px;font-weight: bold;margin-right:20px ">发票明细</span>
<a-button type="link" @click="open"> <a-button type="link" @click="open">
<span class="iconfont icon-jia"></span>
引用发票明细
</a-button>
<a-button type="link" @click="add">
<span class="iconfont icon-jia"></span> <span class="iconfont icon-jia"></span>
添加发票明细 添加发票明细
</a-button> </a-button>

@ -19,14 +19,14 @@
<img src="../../../../assets/svg/infoclient/baocun.svg" class="SvgImg" /> <img src="../../../../assets/svg/infoclient/baocun.svg" class="SvgImg" />
</span> </span>
</a-tooltip> </a-tooltip>
<a-tooltip placement="top" :mouseEnterDelay="0.5"> <!-- <a-tooltip placement="top" :mouseEnterDelay="0.5">
<template #title> <template #title>
<span>打印</span> <span>打印</span>
</template> </template>
<span class="ds-action-svg-btn" @click="handleSave"> <span class="ds-action-svg-btn" @click="handleSave">
<img src="../../../../assets/svg/infoclient/dayin.svg" class="SvgImg" /> <img src="../../../../assets/svg/infoclient/dayin.svg" class="SvgImg" />
</span> </span>
</a-tooltip> </a-tooltip> -->
<a-tooltip placement="top" :mouseEnterDelay="0.5"> <a-tooltip placement="top" :mouseEnterDelay="0.5">
<template #title> <template #title>
<span>提交审核</span> <span>提交审核</span>
@ -63,7 +63,7 @@
</a-menu> </a-menu>
</template> </template>
</a-dropdown> </a-dropdown>
<div class="status"> <div class="status" >
<i class="icon-chenggong iconfont" style="font-size: 14px"></i> <i class="icon-chenggong iconfont" style="font-size: 14px"></i>
{{ form.statusText }} {{ form.statusText }}
</div> </div>
@ -275,7 +275,7 @@ const bankForm = [
}, },
{ {
field: 'customerBankName', field: 'customerBankName',
label: 'RMB开户行账号', label: 'RMB开户行/账号',
colProps: { span: 24 }, colProps: { span: 24 },
component: 'Select', component: 'Select',
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
@ -310,7 +310,7 @@ const bankForm = [
component: 'Select', component: 'Select',
componentProps: ({ formModel }) => { componentProps: ({ formModel }) => {
return { return {
options: bankList.value, options: bankListUsd.value,
fieldNames: { fieldNames: {
label: 'name', label: 'name',
value: 'name', value: 'name',
@ -489,11 +489,18 @@ const bottomForm = [
}, },
queryCondition: JSON.stringify(queryStr), queryCondition: JSON.stringify(queryStr),
} }
bankList.value = []
bankListUsd.value = []
GetClientBankList(data).then((res) => { GetClientBankList(data).then((res) => {
res.data.forEach((item) => { res.data.forEach((item) => {
item.name = item.bankName + ' ' + item.account 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) { if (res.data.length > 0) {
setFieldsValue({ setFieldsValue({
customerBankId: res.data[0].id, customerBankId: res.data[0].id,
@ -530,6 +537,7 @@ const bottomForm = [
} }
if (!obj && !e) { if (!obj && !e) {
bankList.value = [] bankList.value = []
bankListUsd.value = []
formModel.customer = {} formModel.customer = {}
formModel.customerId = '' formModel.customerId = ''
} }
@ -899,6 +907,7 @@ function getDetail() {
applyAmount: item.amount applyAmount: item.amount
}) })
}) })
amountArr.value = mergeByCurrency(amountArr.value)
} }
feeTableRef.value.init(res.data) feeTableRef.value.init(res.data)
} }
@ -913,7 +922,10 @@ function openTempName() {
}) })
}) })
} }
const bankListUsd = ref([])
function getBankInfo(customerId) { function getBankInfo(customerId) {
bankList.value = []
bankListUsd.value = []
const queryStr = [ const queryStr = [
{ {
FieldName: 'ClientId', FieldName: 'ClientId',
@ -932,8 +944,13 @@ function getBankInfo(customerId) {
GetClientBankList(data).then((res) => { GetClientBankList(data).then((res) => {
res.data.forEach((item) => { res.data.forEach((item) => {
item.name = item.bankName + ' ' + item.account 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), queryCondition: JSON.stringify(queryStr),
} }
GetClientInfo({ id: id }).then(ress => { GetClientInfo({ id: id }).then(ress => {
setFieldsValue({ if (!route.query.id) {
taxID: ress.data.organizationCode setFieldsValue({
}) taxID: ress.data.organizationCode
GetClientBankList(data).then((res) => {
res.data.forEach((item) => {
item.name = item.bankName + ' ' + item.account
}) })
bankList.value = res.data bankList.value = []
if (res.data.length > 0) { bankListUsd.value = []
setFieldsValue({ GetClientBankList(data).then((res) => {
customerBankId: res.data[0].id, res.data.forEach((item) => {
customerBankName: res.data[0].name, 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({ setFieldsValue({
invoiceHeader: res.data[0].invoiceHeaders[0].header, customerBankId: res.data[0].id,
customerAddTel: res.data[0].invoiceHeaders[0].addressTel 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 { } else {
setFieldsValue({ setFieldsValue({
customerBankId: '',
customerBankName: '',
invoiceHeaders: '', invoiceHeaders: '',
customerAddTel: '' customerAddTel: ''
}) })
} }
} else { setTimeout(() => {
setFieldsValue({ resolve(true);
customerBankId: '', }, 300)
customerBankName: '', })
invoiceHeaders: '', } else {
customerAddTel: '' resolve(true);
}) }
}
setTimeout(() => {
resolve(true);
}, 300)
})
}) })
}); });
} }
@ -1036,8 +1066,6 @@ function updateListSave(arr, type) {
loading.value = false loading.value = false
}) })
}) })
} }
// //
function addLeftSave(arr, query, exchang, type) { 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 tempName = ref('')
const tempId = ref('') const tempId = ref('')
const querySearch = (queryString: string, cb: any) => { const querySearch = (queryString: string, cb: any) => {
@ -1177,6 +1217,15 @@ function handleSelect(value) {
margin-left: 15px; margin-left: 15px;
} }
.status1 {
color: #d6d30c;
font-size: 12px;
padding-right: 15px;
border-right: 1px solid #ccc;
margin-left: 15px;
}
.invoiceNo { .invoiceNo {
color: #297cfa; color: #297cfa;
margin-left: 15px; margin-left: 15px;

Loading…
Cancel
Save