Compare commits
3 Commits
fb56359f41
...
29fd397e4f
| Author | SHA1 | Date | |
|---|---|---|---|
| 29fd397e4f | |||
| 54d83803c4 | |||
| 05fbb4e3b3 |
@ -80,7 +80,7 @@ def get_bom_list():
|
|||||||
return jsonify({'code': 500, 'msg': '内部服务器错误'}), 500
|
return jsonify({'code': 500, 'msg': '内部服务器错误'}), 500
|
||||||
|
|
||||||
|
|
||||||
@bom_bp.route('/detail/<bom_no>', methods=['GET'])
|
@bom_bp.route('/detail/<path:bom_no>', methods=['GET'])
|
||||||
@jwt_required()
|
@jwt_required()
|
||||||
@permission_required('bom_manage')
|
@permission_required('bom_manage')
|
||||||
def get_bom_detail(bom_no):
|
def get_bom_detail(bom_no):
|
||||||
@ -164,7 +164,7 @@ def save_bom():
|
|||||||
return jsonify({'code': 500, 'msg': '内部服务器错误'}), 500
|
return jsonify({'code': 500, 'msg': '内部服务器错误'}), 500
|
||||||
|
|
||||||
|
|
||||||
@bom_bp.route('/stock/<bom_no>', methods=['GET'])
|
@bom_bp.route('/stock/<path:bom_no>', methods=['GET'])
|
||||||
@jwt_required()
|
@jwt_required()
|
||||||
@permission_required('bom_manage')
|
@permission_required('bom_manage')
|
||||||
def get_bom_with_stock_by_no(bom_no):
|
def get_bom_with_stock_by_no(bom_no):
|
||||||
@ -188,7 +188,7 @@ def get_bom_with_stock_by_no(bom_no):
|
|||||||
|
|
||||||
# ==================== 删除BOM接口 ====================
|
# ==================== 删除BOM接口 ====================
|
||||||
|
|
||||||
@bom_bp.route('/<bom_no>', methods=['DELETE'])
|
@bom_bp.route('/<path:bom_no>', methods=['DELETE'])
|
||||||
@jwt_required()
|
@jwt_required()
|
||||||
@permission_required('bom_manage:operation')
|
@permission_required('bom_manage:operation')
|
||||||
def delete_bom(bom_no):
|
def delete_bom(bom_no):
|
||||||
|
|||||||
@ -11,8 +11,11 @@ export function getBomList(params?: any) {
|
|||||||
|
|
||||||
// 获取BOM详情
|
// 获取BOM详情
|
||||||
export function getBomDetail(bomNo: string) {
|
export function getBomDetail(bomNo: string) {
|
||||||
|
// 去除首尾斜杠,保留中间斜杠并进行 URL 编码
|
||||||
|
const trimmed = bomNo.replace(/^\/+|\/+$/g, '');
|
||||||
|
const encoded = encodeURIComponent(trimmed);
|
||||||
return request({
|
return request({
|
||||||
url: `/v1/bom/detail/${bomNo}`,
|
url: `/v1/bom/detail/${encoded}`,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -28,8 +31,11 @@ export function saveBom(data: any) {
|
|||||||
|
|
||||||
// 删除BOM(暂未实现,预留)
|
// 删除BOM(暂未实现,预留)
|
||||||
export function deleteBom(bomNo: string) {
|
export function deleteBom(bomNo: string) {
|
||||||
|
// 去除首尾斜杠,保留中间斜杠并进行 URL 编码
|
||||||
|
const trimmed = bomNo.replace(/^\/+|\/+$/g, '');
|
||||||
|
const encoded = encodeURIComponent(trimmed);
|
||||||
return request({
|
return request({
|
||||||
url: `/v1/bom/${bomNo}`,
|
url: `/v1/bom/${encoded}`,
|
||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user