it can be summited project with same name.
This commit is contained in:
parent
2db1067158
commit
3f82203735
|
@ -454,7 +454,7 @@ class BidsController < ApplicationController
|
|||
|
||||
###添加应标项目
|
||||
def add
|
||||
project = Project.where('name = ?', params[:bid]).first
|
||||
project = Project.find(params[:bid])
|
||||
bid_message = params[:bid_for_save][:bid_message]
|
||||
if BidingProject.where("project_id = ? and bid_id = ?", project.id, @bid.id).size == 0
|
||||
if BidingProject.cerate_bidding(@bid.id, project.id, bid_message)
|
||||
|
|
|
@ -135,4 +135,12 @@ module BidsHelper
|
|||
people.include?(User.current)
|
||||
end
|
||||
|
||||
def select_option_helper option
|
||||
tmp = Hash.new
|
||||
option.each do |project|
|
||||
tmp[project.name] = project.identifier
|
||||
end
|
||||
tmp
|
||||
end
|
||||
|
||||
end
|
|
@ -70,7 +70,7 @@
|
|||
:complete => '$("#put-bid-form").hide();' do |f| %>
|
||||
<table id="bidding_table" border="0" width="100%" style="margin-left: 40px;">
|
||||
<tr>
|
||||
<td><%= select_tag 'bid', options_for_select(@option), :name => 'bid', :class => 'grayline' %></td>
|
||||
<td><%= select_tag 'bid', options_for_select(select_option_helper(@option)), :name => 'bid', :class => 'grayline' %></td>
|
||||
<div id="prompt_create_pro"><!-- nyan -->
|
||||
<td>
|
||||
<p>
|
||||
|
|
Loading…
Reference in New Issue