|
@@ -89,16 +89,8 @@ def sub_project_list(project_id:int):
|
|
|
status = request.args.get('s',-1, type=int)
|
|
|
data_list, total_count = ProjectService.get_all_sub_project_paginated(project_id, page, per_page, keyword, None if status == -1 else status) # 传递 status 参数
|
|
|
return render_template('sub_project_list.html', project=project_data ,sub_project_list=data_list, keyword=keyword, page=page, per_page=per_page, total_count=total_count, status=status) # 传递 status 参数到模板
|
|
|
-@project.route('/project_item_list/<sub_project_id>')
|
|
|
-def project_item_list(sub_project_id:int):
|
|
|
- process_status = request.args.get('p_s', -1, type=int)
|
|
|
- send_status = request.args.get('s_s', -1, type=int)
|
|
|
- keyword = request.args.get('k', '', type=str)
|
|
|
- page = request.args.get('p', 1, type=int)
|
|
|
- per_page = request.args.get('pp', 10, type=int)
|
|
|
- sub_project_data= ProjectService.get_sub_project_by_id(sub_project_id)
|
|
|
- sub_items, total_count = ProjectService.get_sub_project_item_list_by_sub_project_paginated(sub_project_id, page, per_page, keyword)
|
|
|
- return render_template('sub_project_item_list.html', sub_project=sub_project_data,items=sub_items, process_status=process_status, send_status=send_status, keyword=keyword, page=page, per_page=per_page, total_count=total_count)
|
|
|
+
|
|
|
+
|
|
|
@project.route('/save_sub_project', methods=['POST'])
|
|
|
def save_sub_project():
|
|
|
"""处理子项目保存请求,包含文件上传和数据处理"""
|
|
@@ -180,6 +172,18 @@ def delete_sub_project(project_id:int):
|
|
|
except Exception as e:
|
|
|
return jsonify({'success': False, 'error': str(e)})
|
|
|
|
|
|
+
|
|
|
+@project.route('/project_item_list/<sub_project_id>')
|
|
|
+def project_item_list(sub_project_id:int):
|
|
|
+ process_status = request.args.get('p_s', -1, type=int)
|
|
|
+ send_status = request.args.get('s_s', -1, type=int)
|
|
|
+ keyword = request.args.get('k', '', type=str)
|
|
|
+ page = request.args.get('p', 1, type=int)
|
|
|
+ per_page = request.args.get('pp', 10, type=int)
|
|
|
+ sub_project_data= ProjectService.get_sub_project_by_id(sub_project_id)
|
|
|
+ sub_items, total_count = ProjectService.get_sub_project_item_list_by_sub_project_paginated(sub_project_id, page, per_page, keyword, process_status if process_status != -1 else None, send_status if send_status != -1 else None)
|
|
|
+ return render_template('sub_project_item_list.html', sub_project=sub_project_data,items=sub_items, process_status=process_status, send_status=send_status, keyword=keyword, page=page, per_page=per_page, total_count=total_count)
|
|
|
+
|
|
|
@project.route('/save_sub_project_item', methods=['POST'])
|
|
|
def save_sub_project_item():
|
|
|
try:
|
|
@@ -213,7 +217,6 @@ def save_sub_project_item():
|
|
|
return jsonify({'success': True})
|
|
|
except Exception as e:
|
|
|
return jsonify({'success': False, 'error': str(e)}), 400
|
|
|
-
|
|
|
@project.route('/delete_sub_project_item/<item_id>', methods=['POST'])
|
|
|
def delete_sub_project_item(item_id):
|
|
|
try:
|
|
@@ -221,7 +224,6 @@ def delete_sub_project_item(item_id):
|
|
|
return jsonify({'success': True})
|
|
|
except Exception as e:
|
|
|
return jsonify({'success': False, 'error': str(e)}), 400
|
|
|
-
|
|
|
@project.route('/start_process_item/<item_id>', methods=['POST'])
|
|
|
def start_process_item(item_id:int):
|
|
|
try:
|
|
@@ -229,7 +231,6 @@ def start_process_item(item_id:int):
|
|
|
return jsonify({'success': result, 'error': err_msg})
|
|
|
except Exception as e:
|
|
|
return jsonify({'success': False, 'error': str(e)})
|
|
|
-
|
|
|
@project.route('/start_send_item/<item_id>', methods=['POST'])
|
|
|
def start_send_item(item_id:int):
|
|
|
try:
|