fix(报销/拨款): 行项目金额改为价税合计,移除总金额手动输入框

- OCR解析:行项目金额改为 amount + tax_amount(价税合计)
- 总金额改为只读展示,由明细汇总自动计算,不再支持手动输入
- 去掉总金额字段的表单必填校验

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-08 18:22:04 +08:00
parent 1e128cecfe
commit 7f9ae18022
3 changed files with 43 additions and 7 deletions

View File

@@ -153,7 +153,15 @@ public class HrmInvoiceOcrServiceImpl implements IHrmInvoiceOcrService {
HrmInvoiceOcrResultVo.Item item = new HrmInvoiceOcrResultVo.Item(); HrmInvoiceOcrResultVo.Item item = new HrmInvoiceOcrResultVo.Item();
item.setItemName(name); item.setItemName(name);
item.setAmount(parseBigDecimal(getStringOrFieldValue(li, "amount"))); // 行项目金额取价税合计:税前金额 + 税额
BigDecimal preAmt = parseBigDecimal(getStringOrFieldValue(li, "amount"));
BigDecimal taxAmt = parseBigDecimal(getStringOrFieldValue(li, "tax_amount"));
BigDecimal withTax = null;
if (preAmt != null || taxAmt != null) {
withTax = (preAmt != null ? preAmt : BigDecimal.ZERO)
.add(taxAmt != null ? taxAmt : BigDecimal.ZERO);
}
item.setAmount(withTax != null ? withTax : preAmt);
item.setTaxRate(getStringOrFieldValue(li, "tax_rate")); item.setTaxRate(getStringOrFieldValue(li, "tax_rate"));
items.add(item); items.add(item);
} }

View File

@@ -36,8 +36,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="拨款总金额" prop="amount"> <el-form-item label="拨款总金额">
<el-input-number v-model="form.amount" :min="0" :step="100" style="width: 100%" /> <div class="amount-readonly">
{{ form.amount != null && form.amount > 0 ? '¥' + form.amount : '根据发票明细自动汇总' }}
</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -300,7 +302,7 @@ export default {
}, },
rules: { rules: {
appropriationType: [{ required: true, message: '请选择/输入拨款类型', trigger: 'change' }], appropriationType: [{ required: true, message: '请选择/输入拨款类型', trigger: 'change' }],
amount: [{ required: true, message: '请填写拨款总金额', trigger: 'blur' }] amount: []
} }
} }
}, },
@@ -675,6 +677,18 @@ export default {
b { color: #e6a23c; font-size: 14px; } b { color: #e6a23c; font-size: 14px; }
} }
.amount-readonly {
height: 32px;
line-height: 32px;
padding: 0 12px;
font-size: 14px;
font-weight: 600;
color: #e6a23c;
background: #fffbf2;
border: 1px solid #faecd8;
border-radius: 4px;
}
.flow-preview { .flow-preview {
margin-top: 10px; margin-top: 10px;
padding: 12px; padding: 12px;

View File

@@ -36,8 +36,10 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="报销总金额" prop="totalAmount"> <el-form-item label="报销总金额">
<el-input-number v-model="form.totalAmount" :min="0" :step="100" style="width: 100%" /> <div class="amount-readonly">
{{ form.totalAmount != null && form.totalAmount > 0 ? '¥' + form.totalAmount : '根据发票明细自动汇总' }}
</div>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -274,7 +276,7 @@ export default {
}, },
rules: { rules: {
reimburseType: [{ required: true, message: '请选择/输入报销类型', trigger: 'change' }], reimburseType: [{ required: true, message: '请选择/输入报销类型', trigger: 'change' }],
totalAmount: [{ required: true, message: '请填写报销总金额', trigger: 'blur' }], totalAmount: [],
accessoryApplyIds: [{ required: true, message: '请上传报销单据附件', trigger: 'change' }] accessoryApplyIds: [{ required: true, message: '请上传报销单据附件', trigger: 'change' }]
} }
} }
@@ -661,6 +663,18 @@ export default {
b { color: #e6a23c; font-size: 14px; } b { color: #e6a23c; font-size: 14px; }
} }
.amount-readonly {
height: 32px;
line-height: 32px;
padding: 0 12px;
font-size: 14px;
font-weight: 600;
color: #e6a23c;
background: #fffbf2;
border: 1px solid #faecd8;
border-radius: 4px;
}
.flow-preview { .flow-preview {
margin-top: 10px; margin-top: 10px;
padding: 12px; padding: 12px;