半成品成品价格于BOM表关联
This commit is contained in:
@ -168,3 +168,20 @@ def get_manager_history():
|
|||||||
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
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# 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:
|
||||||
|
traceback.print_exc()
|
||||||
|
return jsonify({"code": 500, "msg": str(e)}), 500
|
||||||
@ -165,3 +165,20 @@ def get_manager_history():
|
|||||||
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
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------
|
||||||
|
# 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:
|
||||||
|
traceback.print_exc()
|
||||||
|
return jsonify({"code": 500, "msg": str(e)}), 500
|
||||||
@ -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,7 +68,7 @@ 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',
|
||||||
@ -76,3 +76,12 @@ export function getManagerHistory(params: any) {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [新增] BOM 成本自动计算
|
||||||
|
export function calculateBomCost(params: {bom_code: string, bom_version: string}) {
|
||||||
|
return request({
|
||||||
|
url: '/inbound/product/calculate-bom-cost',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -70,7 +70,7 @@ 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',
|
||||||
@ -78,3 +78,12 @@ export function getManagerHistory(params: any) {
|
|||||||
params
|
params
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// [新增] BOM 成本自动计算
|
||||||
|
export function calculateBomCost(params: {bom_code: string, bom_version: string}) {
|
||||||
|
return request({
|
||||||
|
url: '/inbound/semi/calculate-bom-cost',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user