fix: 对齐field_to_perm与sys_element权限码 + 税率6% + 含税总价反算

- buy/semi/product: 数量字段映射对齐sys_element实际注册码(qty_inbound/qty_stock/qty_available)
- 数据库: 补全buy(9)+semi(10)+product(13)缺失权限码
- deploy_production.sql: 同步更新
- buy.vue: 税率新增6%选项, 价格联动以含税为主输入, 税率变化保持最后编辑价格不变
- buy.vue: 新增含税总价可输入反算功能
This commit is contained in:
yueli
2026-07-15 15:03:37 +08:00
parent 0651eb07fa
commit 4b1a86a870
5 changed files with 271 additions and 23 deletions

View File

@ -62,16 +62,16 @@ def filter_item_by_permissions(item_dict, user_permissions):
# 状态
'status': 'inbound_buy:status',
'inspection_status': 'inbound_buy:inspection_status',
# 数量(三组命名,覆盖 model to_dict 中所有 key)
'in_quantity': 'inbound_buy:in_quantity',
'qty_inbound': 'inbound_buy:in_quantity',
'stock_quantity': 'inbound_buy:stock_quantity',
'qty_stock': 'inbound_buy:stock_quantity',
'available_quantity': 'inbound_buy:available_quantity',
'qty_available': 'inbound_buy:available_quantity',
# 数量(对齐 sys_element 中实际存在的权限码)
'in_quantity': 'inbound_buy:qty_inbound',
'qty_inbound': 'inbound_buy:qty_inbound',
'stock_quantity': 'inbound_buy:qty_stock',
'qty_stock': 'inbound_buy:qty_stock',
'available_quantity': 'inbound_buy:qty_available',
'qty_available': 'inbound_buy:qty_available',
# 价格
'unit_price': 'inbound_buy:unit_price',
'post_tax_unit_price': 'inbound_buy:post_tax_unit_price',
'post_tax_unit_price': 'inbound_buy:unit_price',
'total_price': 'inbound_buy:total_price',
'tax_rate': 'inbound_buy:tax_rate',
'currency': 'inbound_buy:currency',

View File

@ -27,8 +27,8 @@ def filter_item_by_permissions(item_dict, user_permissions):
'unit': 'inbound_product:unit', 'sku': 'inbound_product:sku', 'inbound_date': 'inbound_product:inbound_date',
'barcode': 'inbound_product:barcode', 'serial_number': 'inbound_product:serial_number',
'status': 'inbound_product:status', 'quality_status': 'inbound_product:quality_status',
'in_quantity': 'inbound_product:in_quantity', 'stock_quantity': 'inbound_product:stock_quantity',
'available_quantity': 'inbound_product:available_quantity', 'warehouse_location': 'inbound_product:warehouse_location',
'in_quantity': 'inbound_product:qty_inbound', 'stock_quantity': 'inbound_product:qty_stock',
'available_quantity': 'inbound_product:qty_available', 'warehouse_location': 'inbound_product:warehouse_loc',
'bom_code': 'inbound_product:bom_code', 'bom_version': 'inbound_product:bom_version',
'work_order_code': 'inbound_product:work_order_code', 'order_id': 'inbound_product:order_id',
'production_manager': 'inbound_product:production_manager', 'production_start_time': 'inbound_product:production_start_time',

View File

@ -27,9 +27,9 @@ def filter_item_by_permissions(item_dict, user_permissions):
'unit': 'inbound_semi:unit', 'sku': 'inbound_semi:sku', 'inbound_date': 'inbound_semi:inbound_date',
'barcode': 'inbound_semi:barcode', 'serial_number': 'inbound_semi:serial_number',
'batch_number': 'inbound_semi:batch_number', 'status': 'inbound_semi:status',
'quality_status': 'inbound_semi:quality_status', 'in_quantity': 'inbound_semi:in_quantity',
'stock_quantity': 'inbound_semi:stock_quantity', 'available_quantity': 'inbound_semi:available_quantity',
'warehouse_location': 'inbound_semi:warehouse_location', 'bom_code': 'inbound_semi:bom_code',
'quality_status': 'inbound_semi:quality_status', 'in_quantity': 'inbound_semi:qty_inbound',
'stock_quantity': 'inbound_semi:qty_stock', 'available_quantity': 'inbound_semi:qty_available',
'warehouse_location': 'inbound_semi:warehouse_loc', 'bom_code': 'inbound_semi:bom_code',
'bom_version': 'inbound_semi:bom_version', 'work_order_code': 'inbound_semi:work_order_code',
'raw_material_cost': 'inbound_semi:raw_material_cost', 'manual_cost': 'inbound_semi:manual_cost',
'unit_total_cost': 'inbound_semi:unit_total_cost', 'production_manager': 'inbound_semi:production_manager',