app/views/educode_sales/ideas/new.html.erb in educode_sales-0.9.73 vs app/views/educode_sales/ideas/new.html.erb in educode_sales-0.9.74
- old
+ new
@@ -3,29 +3,29 @@
<div class="layui-form layuimini-form">
<div class="layui-form-item" style="padding: 25px">
<div class="layui-row">
<h2 style="padding-left: 25px">方案信息</h2>
</div>
- <div class="layui-row" style="padding-top: 15px">
+ <div class="layui-row" style="padding-top: 15px;display: none">
<div class="layui-col-md6">
- <labeL class="layui-form-label required">学校/单位:</labeL>
+ <labeL class="layui-form-label required">单位:</labeL>
<div class="layui-input-block">
<div id="school_id" style="width: 600px;"></div>
</div>
</div>
<div class="layui-col-md6">
- <labeL class="layui-form-label">院系/部门:</labeL>
+ <labeL class="layui-form-label">部门:</labeL>
<div class="layui-input-block">
<div id="department_id" style="width: 600px;"></div>
</div>
</div>
</div>
<div class="layui-row" style="padding-top: 15px">
<div class="layui-col-md6">
- <labeL class="layui-form-label">学校负责人:</labeL>
+ <labeL class="layui-form-label">单位联系人:</labeL>
<div class="layui-input-block">
- <input type="text" name="manager_name" autocomplete="off" placeholder="请输入学校负责人" value="<%= @idea&.manager_name %>" class="layui-input">
+ <input type="text" name="manager_name" autocomplete="off" placeholder="请输入单位联系人" value="<%= @idea&.manager_name %>" class="layui-input">
</div>
</div>
<div class="layui-col-md6">
<labeL class="layui-form-label">负责人电话:</labeL>
<div class="layui-input-block">
@@ -33,11 +33,11 @@
</div>
</div>
</div>
<div class="layui-row" style="padding-top: 15px">
<div class="layui-col-md6">
- <labeL class="layui-form-label required">销售负责人:</labeL>
+ <labeL class="layui-form-label required">销售经理:</labeL>
<div class="layui-input-block">
<div id="sale_staff_id"></div>
</div>
</div>
<div class="layui-col-md6">
@@ -49,15 +49,15 @@
</div>
<div class="layui-row" style="padding-top: 15px">
<div class="layui-col-md6">
<labeL class="layui-form-label required">项目名称:</labeL>
<div class="layui-input-block">
- <input type="text" name="name" autocomplete="off" lay-verify="required" lay-reqtext="项目名称不能为空" placeholder="请输入项目名称" value="<%= @idea&.name %>" class="layui-input">
+ <div id="business_id" style="width: 600px;"></div>
</div>
</div>
<div class="layui-col-md6">
- <labeL class="layui-form-label">方案指派人:</labeL>
+ <labeL class="layui-form-label">方案经理:</labeL>
<div class="layui-input-block">
<div id="new_staff_id"></div>
</div>
</div>
</div>
@@ -75,11 +75,11 @@
</div>
</div>
</div>
<div class="layui-row" style="padding-top: 15px">
<div class="layui-col-md6">
- <labeL class="layui-form-label">类型:</labeL>
+ <labeL class="layui-form-label">定制类型:</labeL>
<div class="layui-input-block">
<%= select_tag "types", options_for_select(EducodeSales::Idea.types.keys, @idea&.types), { 'lay-filter': 'types', include_blank: false } %>
</div>
</div>
<div class="layui-col-md6">
@@ -89,13 +89,27 @@
</div>
</div>
</div>
<div class="layui-row" style="padding-top: 15px">
<div class="layui-col-md6">
+ <labeL class="layui-form-label">方案类型:</labeL>
+ <div class="layui-input-block">
+ <%= select_tag "idea_type", options_for_select(EducodeSales::Idea.idea_types.keys, @idea&.idea_type), { 'lay-filter': 'idea_type', include_blank: false } %>
+ </div>
+ </div>
+ <div class="layui-col-md6">
+ <labeL class="layui-form-label">指派人:</labeL>
+ <div class="layui-input-block">
+ <div id="other_staff_ids"></div>
+ </div>
+ </div>
+ </div>
+ <div class="layui-row" style="padding-top: 15px">
+ <div class="layui-col-md6">
<labeL class="layui-form-label">硬件规模(万):</labeL>
<div class="layui-input-block">
- <input type="number" name="hardware" autocomplete="off" placeholder="请输入硬件规模" value="<%= @idea&.hardware %>" class="layui-input">
+ <input type="number" name="hardware" autocomplete="off" placeholder="请输入硬件规模" value="<%= @idea&.hardware %>" class="layui-input">
</div>
</div>
<div class="layui-col-md6">
<labeL class="layui-form-label required">项目预算(万):</labeL>
<div class="layui-input-block">
@@ -124,13 +138,13 @@
<input type="text" name="attachment_id" id="attachment_id" autocomplete="off" value="" class="layui-input">
</div>
</div>
</div>
<div class="layui-row" style="padding-top: 15px">
- <labeL class="layui-form-label">反馈情况:</labeL>
+ <labeL class="layui-form-label">需求说明:</labeL>
<div class="layui-input-block">
- <textarea name="content" placeholder="反馈情况" class="layui-textarea"><%= @idea&.content.to_s %></textarea>
+ <textarea name="content" placeholder="需求说明" class="layui-textarea"><%= @idea&.content.to_s %></textarea>
</div>
</div>
<div class="layui-row" style="padding-top: 15px">
<div class="layui-col-md6">
<labeL class="layui-form-label">方案材料:</labeL>
@@ -180,28 +194,62 @@
xhr.send(formData);
}
layui.use(['form', 'upload', 'table', 'upload', 'layer', 'laytpl', 'request', 'selectInput', 'xmSelect'], function () {
var form = layui.form,
- layer = layui.layer,
- request = layui.request,
- laydate = layui.laydate,
- table = layui.table,
- laytpl = layui.laytpl,
- request = layui.request,
- xmSelect = layui.xmSelect,
- upload = layui.upload,
- $ = layui.$;
+ layer = layui.layer,
+ request = layui.request,
+ laydate = layui.laydate,
+ table = layui.table,
+ laytpl = layui.laytpl,
+ request = layui.request,
+ xmSelect = layui.xmSelect,
+ upload = layui.upload,
+ $ = layui.$;
selectInput = layui.selectInput;
form.render();
//时间常规用法
laydate.render({
elem: '#new_time'
});
form.render();
+ var business_list = xmSelect.render({
+ el: '#business_id',
+ remoteSearch: true,
+ autoRow: true,
+ radio: true,
+ delay: 1000,
+ tips: '支持名称搜索,请至少输入一个字符',
+ searchTips: '支持名称搜索,请至少输入一个字符',
+ paging: true,
+ pageRemote: true,
+ filterable: true,
+ remoteMethod: function (val, cb, show, pageIndex) {
+ if (!val) {
+ return cb([]);
+ }
+ $.ajax('/missions/staff_business', {
+ method: 'get',
+ data: {
+ q: val,
+ page: pageIndex
+ },
+ dataType: 'json',
+ success: function (res) {
+ var data = res.data;
+ if (res.code == 0) {
+ cb(res.data, res.count);
+ } else {
+ layer.msg(res.msg, {time: 2000, icon: 2, shade: 0.01});
+ }
+ }
+ })
+ }
+ })
+
var school_list = xmSelect.render({
el: '#school_id',
remoteSearch: true,
autoRow: true,
radio: true,
@@ -328,10 +376,16 @@
el: '#assist_staff_ids',
data: gon.staffs,
filterable: true,
multiple: true
})
+ var other_staff_list = xmSelect.render({
+ el: '#other_staff_ids',
+ data: gon.staffs,
+ filterable: true,
+ multiple: true
+ })
var attachment_list = xmSelect.render({
el: '#attachment_ids',
data: gon.attachments,
filterable: true,
@@ -365,23 +419,25 @@
var schools = [];
school_list.getValue().forEach(function (d) {
schools.push(d.value);
})
- if (schools.length == 0) {
- layer.alert("请选择学校");
- return false;
- }
data.field.school_id = schools[0];
var departments = [];
department_list.getValue().forEach(function (d) {
departments.push(d.value);
})
data.field.department_id = departments[0];
+ var business = [];
+ business_list.getValue().forEach(function (d) {
+ business.push(d.value);
+ })
+ data.field.business_id = business[0];
data.field.staff_id = staff_list.getValue('valueStr');
data.field.sale_staff_id = sale_staff_list.getValue('valueStr');
data.field.assist_staff_ids = assist_staff_list.getValue('valueStr');
+ data.field.other_staff_ids = other_staff_list.getValue('valueStr');
data.field.attachment_ids = attachment_list.getValue('valueStr');
request.authPost("missions/ideas/", data.field, function (res) {
if (res.success == false) {
layer.alert(res.msg)
} else {
\ No newline at end of file