半成品成品价格于BOM表关联

This commit is contained in:
dxc
2026-03-02 13:39:52 +08:00
parent 16350842f8
commit cf75b80e13
4 changed files with 55 additions and 3 deletions

View File

@ -165,6 +165,23 @@ def get_manager_history():
try: try:
data = ProductInboundService.get_history_managers(keyword) data = ProductInboundService.get_history_managers(keyword)
return jsonify({"code": 200, "msg": "success", "data": data}) return jsonify({"code": 200, "msg": "success", "data": data})
except Exception as e:
traceback.print_exc()
return jsonify({"code": 500, "msg": str(e)}), 500
# ------------------------------------------------------------------
# 9. BOM 原材料成本自动核算 (新增)
# ------------------------------------------------------------------
@inbound_product_bp.route('/calculate-bom-cost', methods=['GET'])
@permission_required('inbound_product')
def calculate_bom_cost():
try:
bom_code = request.args.get('bom_code')
bom_version = request.args.get('bom_version')
if not bom_code or not bom_version:
return jsonify({"code": 400, "msg": "bom_code和bom_version不能为空"}), 400
cost = ProductInboundService.calculate_bom_cost(bom_code, bom_version)
return jsonify({"code": 200, "msg": "success", "data": cost})
except Exception as e: except Exception as e:
traceback.print_exc() traceback.print_exc()
return jsonify({"code": 500, "msg": str(e)}), 500 return jsonify({"code": 500, "msg": str(e)}), 500

View File

@ -162,6 +162,23 @@ def get_manager_history():
try: try:
data = SemiInboundService.get_history_managers(keyword) data = SemiInboundService.get_history_managers(keyword)
return jsonify({"code": 200, "msg": "success", "data": data}) return jsonify({"code": 200, "msg": "success", "data": data})
except Exception as e:
traceback.print_exc()
return jsonify({"code": 500, "msg": str(e)}), 500
# ------------------------------------------------------------------
# 9. BOM 原材料成本自动核算 (新增)
# ------------------------------------------------------------------
@inbound_semi_bp.route('/calculate-bom-cost', methods=['GET'])
@permission_required('inbound_semi')
def calculate_bom_cost():
try:
bom_code = request.args.get('bom_code')
bom_version = request.args.get('bom_version')
if not bom_code or not bom_version:
return jsonify({"code": 400, "msg": "bom_code和bom_version不能为空"}), 400
cost = SemiInboundService.calculate_bom_cost(bom_code, bom_version)
return jsonify({"code": 200, "msg": "success", "data": cost})
except Exception as e: except Exception as e:
traceback.print_exc() traceback.print_exc()
return jsonify({"code": 500, "msg": str(e)}), 500 return jsonify({"code": 500, "msg": str(e)}), 500

View File

@ -42,7 +42,7 @@ export function searchMaterialBase(keyword: string, page: number = 1) {
}) })
} }
// 搜索BOM (新增) // 搜索BOM
export function searchBom(keyword: string) { export function searchBom(keyword: string) {
return request({ return request({
url: '/inbound/product/search-bom', url: '/inbound/product/search-bom',
@ -68,11 +68,20 @@ export function getFilterOptions() {
}) })
} }
// [新增] 负责人历史记录 // [新增] 负责人历史记录全局查询
export function getManagerHistory(params: any) { export function getManagerHistory(params: any) {
return request({ return request({
url: '/inbound/product/suggestions/managers', url: '/inbound/product/suggestions/managers',
method: 'get', method: 'get',
params params
}) })
}
// [新增] BOM 成本自动计算
export function calculateBomCost(params: {bom_code: string, bom_version: string}) {
return request({
url: '/inbound/product/calculate-bom-cost',
method: 'get',
params
})
} }

View File

@ -70,11 +70,20 @@ export function getFilterOptions() {
}) })
} }
// [新增] 生产负责人历史记录 // [新增] 生产负责人历史记录全局查询
export function getManagerHistory(params: any) { export function getManagerHistory(params: any) {
return request({ return request({
url: '/inbound/semi/suggestions/managers', url: '/inbound/semi/suggestions/managers',
method: 'get', method: 'get',
params params
}) })
}
// [新增] BOM 成本自动计算
export function calculateBomCost(params: {bom_code: string, bom_version: string}) {
return request({
url: '/inbound/semi/calculate-bom-cost',
method: 'get',
params
})
} }