def project_detail_modify_show(): request_data = get_value_dict() if not check_dict(request_data, ['id']): return json.dumps('PARAM ERROR') data = project.get_info(project_id=request_data['id'], detail=True, include_reject=True)[0] data_project_superior = user.get_project_superior() data_business = project.get_business_area() if has_error(data): return json.dumps('BACKEND ERROR') else: data['project_superior'] = data_project_superior data['business'] = data_business data['status'] = str(data['status']) return json.dumps(data)
def project_detail_info(): request_data = get_value_dict() if not check_dict(request_data, ['id']): return json.dumps('PARAM ERROR') data = project.get_info(project_id=request_data['id'], detail=True, include_reject=True) business = project.get_business_area() for line in business: if data[0]['business_area'] == line['business_id']: data[0]['business_area'] = line['business_name'] break if has_error(data): return json.dumps('BACKEND ERROR') else: return json.dumps(data)
def approval_project_show(): request_data = get_value_dict() if not check_dict(request_data, ['id']): return json.dumps('PARAM ERROR') data_project = project.get_info(project_id=request_data['id'], detail=True, include_reject=True)[0] data_project_superior = user.get_project_superior() data_business = project.get_business_area() data_project.pop('project_superior_name') if has_error(data_project) or has_error(data_project_superior): return json.dumps('BACKEND ERROR') else: data = data_project data['project_superior'] = data_project_superior data['business'] = data_business return json.dumps(data)
def project_create_show(): request_data = get_value_dict() if not check_dict(request_data, ['uid']): return json.dumps('PARAM ERROR') data_project_superior = user.get_project_superior() data_custom = user.get_custom() data_business = project.get_business_area() if has_error(data_project_superior) or has_error(data_custom): return json.dumps('BACKEND ERROR') else: data = {} data['project_superior'] = data_project_superior data['custom'] = data_custom data['business'] = data_business return json.dumps(data)