app/views/educode_sales/shixuns/edit.html.erb in educode_sales-1.10.49 vs app/views/educode_sales/shixuns/edit.html.erb in educode_sales-1.10.58
- old
+ new
@@ -9,12 +9,12 @@
<div class="layui-form-item inner_div">
<div>
<label class="layui-form-label">任务类型:<span style="color: red"> *</span></label>
<div class="layui-input-block">
<%= select_tag "category", options_for_select(
- [["全部", 0], ["管培", 1], ["全职", 2], ["专职", 3]],selected:@item.category
- ), { include_blank: true } %>
+ [ ["管培", 1], ["全职", 2], ["专职", 3]],selected:@item.category
+ ), {"lay-filter":"Add_company", include_blank: true } %>
</div>
</div>
<div>
<label class="layui-form-label">项目类型:<span style="color: red"> *</span></label>
<div class="layui-input-block">
@@ -35,34 +35,44 @@
</div>
</div>
<div>
<label class="layui-form-label">项目状态:<span style="color: red"> *</span></label>
<div class="layui-input-block">
- <%= select_tag "status", options_for_select(
- [["全部", 0], ["待建设", 1], ["已签协议", 2], ["建设中", 3],
- ["审核中", 4], ["返修中", 5], ["已内部发布", 6], ["已公开发布", 7]], @item.shixun_status
- ), { include_blank: true } %>
+ <% if @item.shixun_status == 4 || @item.shixun_status == 5%>
+ <%= select_tag "status", options_for_select(
+ [["审核中", 4], ["返修中", 5]], @item.shixun_status
+ ), { include_blank: true ,disabled: true} %>
+ <% elsif @last_dectect == 'refused' %>
+ <%= select_tag "status", options_for_select(
+ [["已内部发布", 6], ["已公开发布", 7],["已付费用",8]], @item.shixun_status
+ ), { include_blank: true} %>
+ <% else @last_dectect == ''%>
+ <%= select_tag "status", options_for_select(
+ [ ["待建设", 1], ["建设中", 3]], @item.shixun_status
+ ), { include_blank: true } %>
+ <% end%>
+
</div>
</div>
</div>
<div class="layui-form-item">
- <label class="layui-form-label" style="width: 90px">项目制作人:<span style="color: red"> *</span></label>
+ <label class="layui-form-label" style="width: 96px">项目制作人:<span style="color: red"> *</span></label>
<div class="layui-input-block">
- <div id="producer_id" style="width: 50%;"></div>
+ <div id="producer_id" style="width: 49%;margin-left: 10px"></div>
</div>
</div>
<div class="layui-form-item">
- <label class="layui-form-label" style="width: 100px">制作完成时间:<span style="color: red"> *</span></label>
- <div class="layui-input-block">
+ <label class="layui-form-label" style="width: 120px">制作完成时间:<span style="color: red"> *</span></label>
+ <div class="layui-input-block" style="width: 89%">
<input type="text" class="layui-input" name="time"
id="ID-laydate-demo" placeholder="yyyy-MM-dd"
- value="<%=@item.deliver_date %>"
+ value="<%=@item.deliver_date.blank? ? "" : @item.deliver_date.strftime("%Y-%m-%d") %>"
style="width: 49%;">
</div>
</div>
- <div class="layui-form-item">
+ <div class="layui-form-item" id="money">
<label class="layui-form-label">交付金额:<span style="color: red"> *</span></label>
<div class="layui-input-block">
<input type="number" class="layui-input" value="<%=@item.deliver_money %>" name="money" style="width: 50%;" >
</div>
</div>
@@ -120,10 +130,22 @@
})
<% if @producer_list.present? %>
producer_id.setValue(<%=@producer_list %>)
<% end %>
+ <% if @item.category != 3 %>
+ $("#money").hide()
+ <% end %>
+ form.on('select(Add_company)', function (data) {
+ {
+ if(data.value === '3'){
+ $("#money").show()
+ }else{
+ $("#money").hide()
+ }
+ }
+ });
function isNull(str){
return str === "" || str === null
}
form.on('submit(saveBtn)', function (data) {
let new_data = data.field
@@ -138,10 +160,10 @@
}
if(isNull(new_data.manage_id)){
layer.msg('课程组长未选择');
return false
}
- if(isNull(new_data.money)){
+ if(new_data.category === '3' && isNull(new_data.money)){
layer.msg('交付金额未选择');
return false
}
if(isNull(new_data.producer_id)){
\ No newline at end of file