|
|
|
@ -6,7 +6,7 @@
|
|
|
|
|
<a-row>
|
|
|
|
|
<a-col :span="6">
|
|
|
|
|
<a-form-item label="费用类型">
|
|
|
|
|
<a-select v-model="form.defaultDebit" placeholder="请选择费用类型" style="width: 100%">
|
|
|
|
|
<a-select v-model="form.feeType" placeholder="请选择费用类型" style="width: 100%">
|
|
|
|
|
<a-select-option value="应收">应收</a-select-option>
|
|
|
|
|
<a-select-option value="应付">应付</a-select-option>
|
|
|
|
|
</a-select>
|
|
|
|
@ -49,8 +49,8 @@
|
|
|
|
|
:fixed="item.fixed"
|
|
|
|
|
:align="item.align">
|
|
|
|
|
<template #default="{ row }">
|
|
|
|
|
<div v-if="item.dataIndex == 'isSea'">
|
|
|
|
|
<span v-if="row.isSea">是</span>
|
|
|
|
|
<div v-if="item.dataIndex == 'isPublic'">
|
|
|
|
|
<span v-if="row.isPublic">是</span>
|
|
|
|
|
<span v-else>否</span>
|
|
|
|
|
</div>
|
|
|
|
|
<span v-else>{{ row[item.dataIndex] }}</span>
|
|
|
|
@ -486,9 +486,9 @@ export default {
|
|
|
|
|
{
|
|
|
|
|
field: 'unitPrice',
|
|
|
|
|
key: 'unitPrice',
|
|
|
|
|
title: '单价',
|
|
|
|
|
title: '不含税单价',
|
|
|
|
|
align: 'center',
|
|
|
|
|
width: '80px',
|
|
|
|
|
width: '110px',
|
|
|
|
|
edit: true
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
@ -669,25 +669,52 @@ export default {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
afterCellValueChange: ({ row, column, changeValue }) => {
|
|
|
|
|
if (column.key === 'unitPrice') {
|
|
|
|
|
if (column.key === 'amount') {
|
|
|
|
|
changeValue = changeValue.toString()
|
|
|
|
|
row['unitPrice'] = changeValue.replace(/[^\d.]/g, '').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
|
|
|
|
|
row['amount'] = changeValue.replace(/[^\d.]/g, '').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
|
|
|
|
|
row['unitPrice'] = (row['amount'] / row['quantity']).toFixed(4)
|
|
|
|
|
row['taxUnitPrice'] = (row['unitPrice'] / (1 + (row['taxRate'] / 100))).toFixed(4)
|
|
|
|
|
row['noTaxAmount'] = (row['taxUnitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
}
|
|
|
|
|
if (column.key === 'accTaxRate') {
|
|
|
|
|
if (column.key === 'noTaxAmount') {
|
|
|
|
|
changeValue = changeValue.toString()
|
|
|
|
|
row['accTaxRate'] = changeValue.replace(/[^\d.]/g, '').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
|
|
|
|
|
row['noTaxAmount'] = changeValue.replace(/[^\d.]/g, '').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
|
|
|
|
|
row['taxUnitPrice'] = (row['noTaxAmount'] / row['quantity']).toFixed(4)
|
|
|
|
|
row['unitPrice'] = ((1 + (row['taxRate'] / 100)) * row['taxUnitPrice']).toFixed(4)
|
|
|
|
|
row['amount'] = (row['unitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
}
|
|
|
|
|
if (column.key === 'taxRate') {
|
|
|
|
|
changeValue = changeValue.toString()
|
|
|
|
|
row['taxRate'] = changeValue.replace(/[^\d.]/g, '').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
|
|
|
|
|
row['unitPrice'] = ((1 + (row['taxRate'] / 100)) * row['taxUnitPrice']).toFixed(4)
|
|
|
|
|
|
|
|
|
|
row['amount'] = (row['unitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
row['noTaxAmount'] = (row['taxUnitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
}
|
|
|
|
|
if (column.key === 'exchangeRate') {
|
|
|
|
|
changeValue = changeValue.toString()
|
|
|
|
|
row['exchangeRate'] = changeValue.replace(/[^\d.]/g, '').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, '$1$2.$3')
|
|
|
|
|
}
|
|
|
|
|
if (column.key === 'unitPrice') {
|
|
|
|
|
changeValue = changeValue.toString()
|
|
|
|
|
row['unitPrice'] = changeValue.replace(/[^\d.]/g, '').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, '$1$2.$3')
|
|
|
|
|
row['amount'] = (row['unitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
row['taxUnitPrice'] = (row['unitPrice'] / (1 + (row['taxRate'] / 100))).toFixed(4)
|
|
|
|
|
row['noTaxAmount'] = (row['taxUnitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
}
|
|
|
|
|
if (column.key === 'quantity') {
|
|
|
|
|
changeValue = changeValue.toString()
|
|
|
|
|
row['quantity'] = changeValue.replace(/[^0-9]/g, '')
|
|
|
|
|
row['noTaxAmount'] = (row['taxUnitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
row['unitPrice'] = ((1 + (row['taxRate'] / 100)) * row['taxUnitPrice']).toFixed(4)
|
|
|
|
|
row['amount'] = (row['unitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
}
|
|
|
|
|
if (column.key === 'taxUnitPrice') {
|
|
|
|
|
changeValue = changeValue.toString()
|
|
|
|
|
row['taxUnitPrice'] = changeValue.replace(/[^\d.]/g, '').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3')
|
|
|
|
|
row['taxUnitPrice'] = changeValue.replace(/[^\d.]/g, '').replace(/^(\-)*(\d+)\.(\d\d\d\d).*$/, '$1$2.$3')
|
|
|
|
|
row['noTaxAmount'] = (row['taxUnitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
row['unitPrice'] = ((1 + (row['taxRate'] / 100)) * row['taxUnitPrice']).toFixed(4)
|
|
|
|
|
row['amount'] = (row['unitPrice'] * row['quantity']).toFixed(2)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -792,6 +819,7 @@ export default {
|
|
|
|
|
let startColKey = null
|
|
|
|
|
if (this.$refs['tableRef'].getRangeCellSelection()) {
|
|
|
|
|
index = this.$refs['tableRef'].getRangeCellSelection().selectionRangeKeys.startRowKey
|
|
|
|
|
console.log(this.$refs['tableRef'].getRangeCellSelection())
|
|
|
|
|
startColKey = this.$refs['tableRef'].getRangeCellSelection().selectionRangeKeys.startColKey
|
|
|
|
|
}
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|