费用录入问题修复

zth
lijingjia 2 weeks ago
parent eaafd5e3f0
commit 886f1185a1

@ -354,6 +354,7 @@ import { Item } from 'ant-design-vue/lib/menu'
data: 'settlementAmount',
readOnly: true,
visible: true,
type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
@ -364,6 +365,7 @@ import { Item } from 'ant-design-vue/lib/menu'
data: 'invoiceAmount',
readOnly: true,
visible: true,
type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
@ -374,6 +376,7 @@ import { Item } from 'ant-design-vue/lib/menu'
data: 'orderInvoiceAmount',
readOnly: true,
visible: true,
type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
@ -384,6 +387,7 @@ import { Item } from 'ant-design-vue/lib/menu'
data: 'invoiceAmountRest',
readOnly: true,
visible: true,
type: 'numeric',
numericFormat: {
pattern: '0,0.00'
}
@ -921,69 +925,61 @@ import { Item } from 'ant-design-vue/lib/menu'
//
const selectInsert = async (v) => {
const selectData = JSON.parse(JSON.stringify(list.value))
//
if (v === 1) {
let flag = false
selectData.forEach((item) => {
item = clearCopyRow(item)
if (props.tbType == 'receive') {
item.feeType = 2
} else {
item.feeType = 1
}
if (item.selected) flag = true
})
if (!flag) return createMessage.warning('请勾选要复制的数据!')
const res = selectData.filter((item) => {
let flag = false
selectData.forEach((item) => {
item = clearCopyRow(item)
if (props.tbType == 'receive') {
item.feeType = 2
} else {
item.feeType = 1
}
if (item.selected) flag = true
})
if (!flag && v == 1) return createMessage.warning('请勾选要复制的数据!')
let res = []
if (v == 1) {
//
res = selectData.filter((item) => {
return item.selected
})
//
const feeList = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
res.forEach(data => {
const item = feeList.filter((item) => {
return item.name == data.feeName
})
//
if (item && item.length) {
//
if (data.customerTypeText == item[0].defaultCreditName) {
data.customerTypeText = item[0].defaultDebitName
data.customerType = item[0].defaultDebit
} else if (data.customerTypeText == item[0].defaultDebitName) {
//
data.customerTypeText = item[0].defaultCreditName
data.customerType = item[0].defaultCredit
}
//
if (data && data.customerType) {
GetClientSelectInfoByCode({ code: data.customerType, businessId: props.id, businessType: props.type }).then(res => {
data.customerId = res.data.clientId
data.customerName = res.data.clientName
})
} else {
data.customerId = ''
data.customerName = ''
}
}
})
loading.value = true
setTimeout(() => {
emits('broInsert', res)
loading.value = false
}, 1200)
} else {
//
selectData.forEach((item) => {
item = clearCopyRow(Item)
item.selected = false
if (props.tbType == 'receive') {
item.feeType = 2
//
res = selectData
}
//
const feeList = feeDict.value.length ? feeDict.value : (await GetFeeCodeSelectList())?.data
res.forEach(data => {
const item = feeList.filter((item) => {
return item.name == data.feeName
})
//
if (item && item.length) {
//
if (data.customerTypeText == item[0].defaultCreditName) {
data.customerTypeText = item[0].defaultDebitName
data.customerType = item[0].defaultDebit
} else if (data.customerTypeText == item[0].defaultDebitName) {
//
data.customerTypeText = item[0].defaultCreditName
data.customerType = item[0].defaultCredit
}
//
if (data && data.customerType) {
GetClientSelectInfoByCode({ code: data.customerType, businessId: props.id, businessType: props.type }).then(res => {
data.customerId = res.data.clientId
data.customerName = res.data.clientName
})
} else {
item.feeType = 1
data.customerId = ''
data.customerName = ''
}
})
emits('broInsert', selectData)
}
}
})
loading.value = true
setTimeout(() => {
emits('broInsert', res)
loading.value = false
}, 1200)
}
//
const deleteRow = async () => {
@ -1035,7 +1031,7 @@ import { Item } from 'ant-design-vue/lib/menu'
if (data.length != 0) {
hotTb.value.hotInstance.updateSettings({
cells: function (row, col) {
//
//
const props = { readOnly: true }
// STATUS=0
// STATUS=1
@ -1047,7 +1043,7 @@ import { Item } from 'ant-design-vue/lib/menu'
// STATUS=7
// STATUS=8
// STATUS=9
if (data[row]?.feeStatus != 1 && col != 0) {
if (!(data[row]?.feeStatus == 6 || data[row]?.feeStatus == 1) && col != 0) {
//
if (data[row]?.feeStatus == 0 && col == 3) {
props['className'] = 'hot-green'

@ -53,7 +53,6 @@
}
let dataSource = toRaw(unref(table.getDataSource()))
dataSource = summaryFunc(dataSource)
console.log(props.rowKey)
if (dataSource && dataSource.length) {
dataSource.forEach((item, i) => {
item[props.rowKey] = `${i}`
@ -76,7 +75,6 @@
})
}
}
console.log(columns)
const index = columns.findIndex((item) => item.flag === INDEX_COLUMN_FLAG)
const hasRowSummary = dataSource.some((item) => Reflect.has(item, SUMMARY_ROW_KEY))
const hasIndexSummary = dataSource.some((item) => Reflect.has(item, SUMMARY_INDEX_KEY))

@ -133,7 +133,7 @@
letter-spacing: 0px;
line-height: 15.84px;
color: rgba(51, 56, 61, 1) !important;
text-align: left !important;
text-align: left;
vertical-align: bottom;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial,
sans-serif !important;

@ -182,14 +182,14 @@
{
dataIndex: 'RMB',
title: 'RMB',
align: 'left',
width: 80
align: 'right',
width: 85
},
{
dataIndex: 'USD',
title: 'USD',
align: 'left',
width: 80
align: 'right',
width: 85
},
{
dataIndex: 'customerFullName',
@ -206,8 +206,8 @@
{
dataIndex: 'unitPrice',
title: '单价',
align: 'left',
width: 70
align: 'right',
width: 80
},
{
dataIndex: 'quantity',
@ -246,17 +246,22 @@
const columns = feeColumns(1)
columns[0].children.forEach(column => {
if (['RMB', 'USD'].includes(column.dataIndex)) {
console.log(column)
// 0
sums[column.dataIndex] = 0
const cParam = JSON.parse(JSON.stringify(param))
//
param.forEach(row => {
cParam.forEach(row => {
if (row[column.dataIndex]) {
row[column.dataIndex] = Number(row[column.dataIndex].replace(/,/g, ''))
}
if (!isNaN(row[column.dataIndex])) {
sums[column.dataIndex] += Number(row[column.dataIndex])
}
})
}
})
sums.RMB = numberThousandFormat(sums.RMB, 2, true)
sums.USD = numberThousandFormat(sums.USD, 2, true)
//
return [sums]
}
@ -277,17 +282,22 @@
const columns = feeColumns(2)
columns[0].children.forEach(column => {
if (['RMB', 'USD'].includes(column.dataIndex)) {
console.log(column)
// 0
sums[column.dataIndex] = 0
const cParam = JSON.parse(JSON.stringify(param))
//
param.forEach(row => {
cParam.forEach(row => {
if (row[column.dataIndex]) {
row[column.dataIndex] = Number(row[column.dataIndex].replace(/,/g, ''))
}
if (!isNaN(row[column.dataIndex])) {
sums[column.dataIndex] += Number(row[column.dataIndex])
}
})
}
})
sums.RMB = numberThousandFormat(sums.RMB, 2, true)
sums.USD = numberThousandFormat(sums.USD, 2, true)
//
return [sums]
}
@ -347,9 +357,9 @@
}
item.items.forEach(row => {
if (row.currency == 'RMB') {
row['RMB'] = numberThousandFormat(row.amount, 2, false)
row['RMB'] = numberThousandFormat(row.amount, 2, true)
} else if (row.currency == 'USD') {
row['USD'] = numberThousandFormat(row.amount, 2, false)
row['USD'] = numberThousandFormat(row.amount, 2, true)
}
row.exchangeRate = numberThousandFormat(row.exchangeRate, 6, false)
//
@ -360,6 +370,7 @@
if (row.feeType === 2) {
PData.value.push(row)
}
if (row.unitPrice) row.unitPrice = numberThousandFormat(row.unitPrice, 2, true)
})
})
}

@ -257,6 +257,7 @@
<style lang="less">
.ds-approve-fee {
padding-bottom: 35px;
.vben-basic-table-header__toolbar {
justify-content: space-between;
}
@ -316,6 +317,7 @@
}
.fee-statistic {
position: fixed;
background: #ffffff;
bottom: 0;
text-align: right;
padding: 5px 20px;

@ -53,37 +53,39 @@ export const columns: BasicColumn[] = [
dataIndex: 'amountRMB',
width: 100,
sorter: true,
align: 'left'
align: 'right'
},
{
title: 'USD',
dataIndex: 'amountUSD',
width: 100,
sorter: true,
align: 'left'
},
{
title: '其他币别',
dataIndex: 'amountOther',
width: 100,
sorter: true,
align: 'left'
align: 'right'
},
// {
// title: '其他币别',
// dataIndex: 'amountOther',
// width: 100,
// sorter: true,
// align: 'left'
// },
{
title: '结算RMB',
dataIndex: 'settlementRMB',
align: 'right',
width: 100
},
{
title: '结算USD',
dataIndex: 'settlementUSD',
align: 'right',
width: 100
},
{
title: '结算其他币别',
dataIndex: 'settlementOther',
width: 120
},
// {
// title: '结算其他币别',
// dataIndex: 'settlementOther',
// width: 120
// },
{
title: '申请日期',
dataIndex: 'createTime',
@ -233,6 +235,7 @@ export const columns: BasicColumn[] = [
title: '发票金额',
dataIndex: 'invoiceAmount',
sorter: true,
align: 'right',
width: 120
},
{

@ -50,10 +50,10 @@
<span class="title">USD:</span>
<span class="count">{{ statisData.usd }}</span>
</span>
<span class="box">
<!-- <span class="box">
<span class="title">其他外币:</span>
<span class="count">{{ statisData.other }}</span>
</span>
</span> -->
<span class="box">
<span class="title">结算RMB:</span>
<span class="count">{{ statisData.srmb }}</span>
@ -62,10 +62,10 @@
<span class="title">结算USD:</span>
<span class="count">{{ statisData.susd }}</span>
</span>
<span class="box">
<!-- <span class="box">
<span class="title">结算其他外币:</span>
<span class="count">{{ statisData.other }}</span>
</span>
</span> -->
</div>
</div>
</template>
@ -80,6 +80,7 @@
import { columns, searchFormSchema, FeeStatus } from './columns'
import { useGo } from '/@/hooks/web/usePage'
import { exportExcel } from '/@/hooks/web/common'
import { numberThousandFormat } from '/@/utils/commonUtil'
const go = useGo()
const params = ref([])
const statisData = reactive({
@ -97,19 +98,20 @@
const res: API.DataResult = await GetList(p)
const data = res.data.list
data.forEach(item => {
if (item.amountRMB) item.amountRMB = item.amountRMB.toLocaleString()
if (item.amountUSD) item.amountUSD = item.amountUSD.toLocaleString()
if (item.amountOther) item.amountOther = item.amountOther.toLocaleString()
if (item.settlementRMB) item.settlementRMB = item.settlementRMB.toLocaleString()
if (item.settlementUSD) item.settlementUSD = item.settlementUSD.toLocaleString()
if (item.settlementOther) item.settlementOther = item.settlementOther.toLocaleString()
if (item.amountRMB) item.amountRMB = numberThousandFormat(item.amountRMB, 2, true)
if (item.amountUSD) item.amountUSD = numberThousandFormat(item.amountUSD, 2, true)
// if (item.amountOther) item.amountOther = item.amountOther.toLocaleString()
if (item.settlementRMB) item.settlementRMB = numberThousandFormat(item.settlementRMB, 2, true)
if (item.settlementUSD) item.settlementUSD = numberThousandFormat(item.settlementUSD, 2, true)
if (item.invoiceAmount) item.invoiceAmount = numberThousandFormat(item.invoiceAmount, 2, true)
// if (item.settlementOther) item.settlementOther = item.settlementOther.toLocaleString()
})
statisData.rmb = res.data.totalCNY.toLocaleString()
statisData.usd = res.data.totalUSD.toLocaleString()
statisData.other = res.data.totalOther.toLocaleString()
statisData.srmb = res.data.settlementCNY.toLocaleString()
statisData.susd = res.data.settlementUSD.toLocaleString()
statisData.sother = res.data.settlementOther.toLocaleString()
statisData.rmb = numberThousandFormat(res.data.totalCNY, 2, true)
statisData.usd = numberThousandFormat(res.data.totalUSD, 2, true)
// statisData.other = res.data.totalOther.toLocaleString()
statisData.srmb = numberThousandFormat(res.data.settlementCNY, 2, true)
statisData.susd = numberThousandFormat(res.data.settlementUSD, 2, true)
// statisData.sother = numberThousandFormat(res.data.settlementOther, 2, true)
return new Promise((resolve) => {
resolve({ data: [...data], total: res.count })
})

Loading…
Cancel
Save