This commit is contained in:
yueli
2026-07-16 14:28:37 +08:00
parent 23fc10a25f
commit 6e064064d5
2 changed files with 14 additions and 10 deletions

View File

@ -239,7 +239,7 @@ const handleLogout = () => {
<footer v-if="!isLoginPage" class="app-footer"> <footer v-if="!isLoginPage" class="app-footer">
<span class="version-tag"> <span class="version-tag">
<el-icon style="vertical-align: middle; margin-right: 4px"><InfoFilled /></el-icon> <el-icon style="vertical-align: middle; margin-right: 4px"><InfoFilled /></el-icon>
当前版本:V3.57 当前版本:V3.58
</span> </span>
</footer> </footer>

View File

@ -1929,20 +1929,24 @@ const confirmPurchaseImport = () => {
const qty = Number(po.quantity) || 1 const qty = Number(po.quantity) || 1
form.in_quantity = qty form.in_quantity = qty
// 价格字段:仅具有单价查看权限的用户才自动填充 // 价格字段:优先用含税总价反算,否则用含税单价
if (hasFormFieldPermission('unit_price')) { if (hasFormFieldPermission('unit_price')) {
const hasUnitPrice = po.unit_price !== null && po.unit_price !== undefined && Number(po.unit_price) > 0 const hasUnitPrice = po.unit_price !== null && po.unit_price !== undefined && Number(po.unit_price) > 0
const hasTotalPrice = po.total_price !== null && po.total_price !== undefined && Number(po.total_price) > 0 const hasTotalPrice = po.total_price !== null && po.total_price !== undefined && Number(po.total_price) > 0
if (hasUnitPrice && hasTotalPrice) { // 税率带过来
form.unit_price = Number(po.unit_price) if (po.tax_rate != null) {
form.total_price = Number(po.total_price) form.tax_rate = Number(po.tax_rate)
}
if (hasTotalPrice) {
// 优先: 含税总价 → 调用 post_total 逻辑反算单价
postTaxTotalInput.value = Number(po.total_price)
onPostTaxTotalChange(postTaxTotalInput.value)
} else if (hasUnitPrice) { } else if (hasUnitPrice) {
form.unit_price = Number(po.unit_price) // 备选: 含税单价 → 反算不含税
form.total_price = Number((qty * form.unit_price).toFixed(2)) form.post_tax_unit_price = Number(po.unit_price)
} else if (hasTotalPrice) { updatePrices('post')
form.total_price = Number(po.total_price)
form.unit_price = Number((form.total_price / qty).toFixed(4))
} }
} }
if (po.supplier_link) { if (po.supplier_link) {