fix(inbound/buy): 从采购申请导入时价格不受“是否可显示价格”权限拦截
- 价格填充不再包在 hasFormFieldPermission(unit_price) 里,库管(前端不显示价格)也能把采购单价格带入隐藏字段用于成本 - 前端价格列/输入框仍按字段权限对库管隐藏
This commit is contained in:
@ -1933,25 +1933,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')) {
|
// 库管在前端看不到价格输入/列,由字段权限控制展示;这里只做数据带入,不因“不能看价格”而跳过。
|
||||||
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 (po.tax_rate != null) {
|
if (po.tax_rate != null) {
|
||||||
form.tax_rate = Number(po.tax_rate)
|
form.tax_rate = Number(po.tax_rate)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasTotalPrice) {
|
if (hasTotalPrice) {
|
||||||
// 优先: 含税总价 → 调用 post_total 逻辑反算单价
|
// 优先: 含税总价 → 调用 post_total 逻辑反算单价
|
||||||
postTaxTotalInput.value = Number(po.total_price)
|
postTaxTotalInput.value = Number(po.total_price)
|
||||||
onPostTaxTotalChange(postTaxTotalInput.value)
|
onPostTaxTotalChange(postTaxTotalInput.value)
|
||||||
} else if (hasUnitPrice) {
|
} else if (hasUnitPrice) {
|
||||||
// 备选: 含税单价 → 反算不含税
|
// 备选: 含税单价 → 反算不含税
|
||||||
form.post_tax_unit_price = Number(po.unit_price)
|
form.post_tax_unit_price = Number(po.unit_price)
|
||||||
updatePrices('post')
|
updatePrices('post')
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (po.supplier_link) {
|
if (po.supplier_link) {
|
||||||
form.detail_link = po.supplier_link
|
form.detail_link = po.supplier_link
|
||||||
|
|||||||
Reference in New Issue
Block a user