作者 曹东东

1

@@ -75,9 +75,11 @@ class SxBasement extends Frontend @@ -75,9 +75,11 @@ class SxBasement extends Frontend
75 if(!isset($params['station_id']) || empty($params['station_id'])){ 75 if(!isset($params['station_id']) || empty($params['station_id'])){
76 $this->error('请选择工位'); 76 $this->error('请选择工位');
77 } 77 }
78 - if(!isset($params['enter_id']) || empty($params['enter_id'])){ 78 + if($params['station_type'] == 2 ) {
  79 + if(empty($params['enter_id'])) {
79 $this->error('请选择公司'); 80 $this->error('请选择公司');
80 } 81 }
  82 + }
81 83
82 $startTime = strtotime($params['station_date'].$params['station_start_time']); 84 $startTime = strtotime($params['station_date'].$params['station_start_time']);
83 $endTime = strtotime($params['station_date'].$params['station_end_time']); 85 $endTime = strtotime($params['station_date'].$params['station_end_time']);
@@ -713,7 +713,7 @@ @@ -713,7 +713,7 @@
713 <span><span class="required_s">*</span>参与人数</span> 713 <span><span class="required_s">*</span>参与人数</span>
714 <input name="station_user_count" type="text" class="form_input" placeholder="参与人数" /> 714 <input name="station_user_count" type="text" class="form_input" placeholder="参与人数" />
715 </div> 715 </div>
716 - <div class="input_control"> 716 + <div class="input_control" id="company">
717 <span><span class="required_s">*</span>选择公司</span> 717 <span><span class="required_s">*</span>选择公司</span>
718 <select class="apply_type enter_id" name="enter_id" lay-verify="" style="width: 70%;"> 718 <select class="apply_type enter_id" name="enter_id" lay-verify="" style="width: 70%;">
719 {foreach name='buildingEnter' item='vo'} 719 {foreach name='buildingEnter' item='vo'}
@@ -121,6 +121,15 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template', 'swiper', 'layer' @@ -121,6 +121,15 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template', 'swiper', 'layer'
121 }); 121 });
122 122
123 //工位 123 //工位
  124 + $(document).on('change',".station_type",function () {
  125 + var val = $(".station_type").find("option:selected").val();
  126 + if(val == 2) {
  127 + $("#company").show();
  128 + }else {
  129 + $("#company").hide();
  130 + }
  131 + });
  132 + $("#company").hide();
124 $(document).on('click','#stations li:first-child, #stations li:not(:first-child),#stations li:not(:first-child),#stations li:not(:first-child)',function(){ 133 $(document).on('click','#stations li:first-child, #stations li:not(:first-child),#stations li:not(:first-child),#stations li:not(:first-child)',function(){
125 // $(this).children('a').children('div').children('div').addClass("conditions_select"); 134 // $(this).children('a').children('div').children('div').addClass("conditions_select");
126 // $(this).siblings('li').children('a').removeClass("conditions_select"); 135 // $(this).siblings('li').children('a').removeClass("conditions_select");
@@ -215,10 +224,11 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template', 'swiper', 'layer' @@ -215,10 +224,11 @@ define(['jquery', 'bootstrap', 'frontend', 'form', 'template', 'swiper', 'layer'
215 layer.msg('参与人数不能为空'); 224 layer.msg('参与人数不能为空');
216 return false; 225 return false;
217 } 226 }
218 - if (enter_id == ''){ 227 + if(apply_type == 2 && enter_id == '') {
219 layer.msg('公司不能为空'); 228 layer.msg('公司不能为空');
220 return false; 229 return false;
221 } 230 }
  231 +
222 // setTimeout(function () { 232 // setTimeout(function () {
223 // layer.msg('提交成功'); 233 // layer.msg('提交成功');
224 // }, 1000); 234 // }, 1000);