1、车船模块fix bug
2、运力模块fix bug 3、新增设备台账 4、其他bug 修复 5、调整组织、人员模块
This commit is contained in:
@@ -70,6 +70,48 @@
|
||||
class="oil-electric-record-page__input"
|
||||
/>
|
||||
</template>
|
||||
<template #quantityForm>
|
||||
<el-input
|
||||
v-model="form.quantity"
|
||||
:disabled="boxType === 'view'"
|
||||
inputmode="decimal"
|
||||
placeholder="请输入"
|
||||
@input="value => normalizeDecimalInput('quantity', value)"
|
||||
/>
|
||||
</template>
|
||||
<template #unitPriceForm>
|
||||
<el-input
|
||||
v-model="form.unitPrice"
|
||||
:disabled="boxType === 'view'"
|
||||
inputmode="decimal"
|
||||
placeholder="请输入"
|
||||
@input="value => normalizeDecimalInput('unitPrice', value)"
|
||||
>
|
||||
<template #suffix>元</template>
|
||||
</el-input>
|
||||
</template>
|
||||
<template #transactionAmountForm>
|
||||
<el-input
|
||||
v-model="form.transactionAmount"
|
||||
:disabled="boxType === 'view'"
|
||||
inputmode="decimal"
|
||||
placeholder="请输入"
|
||||
@input="value => normalizeDecimalInput('transactionAmount', value)"
|
||||
>
|
||||
<template #suffix>元</template>
|
||||
</el-input>
|
||||
</template>
|
||||
<template #balanceForm>
|
||||
<el-input
|
||||
v-model="form.balance"
|
||||
:disabled="boxType === 'view'"
|
||||
inputmode="decimal"
|
||||
placeholder="请输入"
|
||||
@input="value => normalizeDecimalInput('balance', value)"
|
||||
>
|
||||
<template #suffix>元</template>
|
||||
</el-input>
|
||||
</template>
|
||||
<template #attachments="{ row }">
|
||||
<span>{{ formatAttachments(row.attachments) }}</span>
|
||||
</template>
|
||||
@@ -190,9 +232,7 @@ export default {
|
||||
},
|
||||
updateFeeType(feeType) {
|
||||
const oilProductColumn = this.findColumn(this.option.column, 'oilProduct');
|
||||
const unitPriceColumn = this.findColumn(this.option.column, 'unitPrice');
|
||||
oilProductColumn.display = feeType !== '充电';
|
||||
unitPriceColumn.append = feeType === '充电' ? '元/度' : '元/升';
|
||||
if (feeType === '充电') {
|
||||
this.form.oilProduct = undefined;
|
||||
}
|
||||
@@ -249,6 +289,13 @@ export default {
|
||||
isEmpty(value) {
|
||||
return value === undefined || value === null || value === '';
|
||||
},
|
||||
normalizeDecimalInput(prop, value) {
|
||||
const sanitized = String(value ?? '').replace(/[^\d.]/g, '');
|
||||
const [integerPart, ...decimalParts] = sanitized.split('.');
|
||||
this.form[prop] = decimalParts.length
|
||||
? `${integerPart || '0'}.${decimalParts.join('').slice(0, 2)}`
|
||||
: integerPart;
|
||||
},
|
||||
normalizeRow(row) {
|
||||
const values = { ...row };
|
||||
values.vehicleType = values.vehicleType || '车辆';
|
||||
|
||||
Reference in New Issue
Block a user