app/views/educode_sales/shixuns/index.html.erb in educode_sales-1.10.59 vs app/views/educode_sales/shixuns/index.html.erb in educode_sales-1.10.70
- old
+ new
@@ -1,14 +1,16 @@
<style>
.inner_div {
margin-bottom: 10px;
margin-right: 10px;
}
- .markdown_list img{
+
+ .markdown_list img {
max-width: 500px;
}
- .layui-table-cell{
+
+ .layui-table-cell {
height: auto !important;
width: auto;
white-space: normal;
/*line-height: 28px;*/
}
@@ -21,64 +23,74 @@
</ul>
<div class="layui-tab-content">
<div>
<form class="layui-form layui-form-pane" lay-filter="search_form">
- <div>
- <div class="layui-inline show_item_contract inner_div">
- <label class="layui-form-label">项目级别</label>
- <div class="layui-input-inline">
- <%= select_tag "level", options_for_select(
- [["全部", 0], ["不明确", 1], ["重要紧急", 2], ["重要不紧急", 3],
- ["不重要紧急", 4], ["不重要不紧急", 5]], selected: 0
- ), { include_blank: true } %>
- </div>
+ <div class="layui-inline show_item_contract inner_div">
+ <label class="layui-form-label">项目级别</label>
+ <div class="layui-input-inline">
+ <%= select_tag "level", options_for_select(
+ [["全部", 0], ["不明确", 1], ["重要紧急", 2], ["重要不紧急", 3],
+ ["不重要紧急", 4], ["不重要不紧急", 5]], selected: 0
+ ), { include_blank: true } %>
</div>
- <div class="layui-inline show_item_contract borders inner_div">
- <label class="layui-form-label">项目状态</label>
- <div class="layui-input-inline">
- <%= select_tag "status", options_for_select(
- [["全部", 0], ["待建设", 1], ["建设中", 3],
- ["审核中", 4], ["返修中", 5], ["已内部发布", 6], ["已公开发布", 7],
- ["已付费用",8],["审核通过",9]], selected: 0
- ), { include_blank: true } %>
- </div>
+ </div>
+ <div class="layui-inline show_item_contract borders inner_div">
+ <label class="layui-form-label">项目状态</label>
+ <div class="layui-input-inline">
+ <%= select_tag "status", options_for_select(
+ [["全部", 0], ["待建设", 1], ["建设中", 3],
+ ["审核中", 4], ["返修中", 5], ["已内部发布", 6], ["已公开发布", 7],
+ ["已付费用", 8], ["审核通过", 9]], selected: 0
+ ), { include_blank: true } %>
</div>
- <div class="layui-inline inner_div">
- <label class="layui-form-label">交付时间</label>
- <div class="layui-inline" id="ID-laydate-range">
- <input type="text" class="layui-input" name="time" id="ID-laydate-demo" placeholder="yyyy-MM-dd">
- </div>
+ </div>
+ <div class="layui-inline inner_div">
+ <label class="layui-form-label" style="width: 130px">项目类型</label>
+ <div class="layui-input-inline">
+ <%= select_tag "shixun_type", options_for_select(
+ [["全部", 0], ["实践项目", 1], ["非实践项目", 2]], selected: 0
+ ), { include_blank: true } %>
</div>
+ </div>
-<!-- <div class="layui-inline inner_div">-->
-<!-- <label class="layui-form-label">商机名称</label>-->
-<!-- <div class="layui-inline" id="ID-laydate-range">-->
-<!-- <input type="text" class="layui-input" name="business_name" id="business_name">-->
-<!-- </div>-->
-<!-- </div>-->
+ <!-- <div class="layui-inline inner_div">-->
+ <!-- <label class="layui-form-label">商机名称</label>-->
+ <!-- <div class="layui-inline" id="ID-laydate-range">-->
+ <!-- <input type="text" class="layui-input" name="business_name" id="business_name">-->
+ <!-- </div>-->
+ <!-- </div>-->
+ <div class="layui-inline borders inner_div">
+ <label class="layui-form-label" style="width: 120px">项目名称</label>
+ <div class="layui-input-inline">
+ <input type="text" class="layui-input" name="shixun_name">
+ </div>
</div>
- <div>
- <div class="layui-inline borders inner_div">
- <label class="layui-form-label" style="width: 120px">项目名称</label>
- <div class="layui-input-inline">
- <input type="text" class="layui-input" name="shixun_name">
- </div>
+ <div class="layui-inline borders inner_div">
+ <label class="layui-form-label" style="width: 130px">实践课程名称</label>
+ <div class="layui-input-inline">
+ <input type="text" class="layui-input" name="subject_name">
</div>
- <div class="layui-inline borders inner_div">
- <label class="layui-form-label" style="width: 130px">实践课程名称</label>
- <div class="layui-input-inline">
- <input type="text" class="layui-input" name="subject_name">
- </div>
+ </div>
+ <div class="layui-inline borders inner_div">
+ <label class="layui-form-label">交付时间</label>
+ <div class="layui-inline" id="ID-laydate-range">
+ <input type="text" class="layui-input" name="time" id="ID-laydate-demo" placeholder="yyyy-MM-dd">
</div>
- <div class="layui-inline borders inner_div">
- <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
- </button>
- <button type="submit" id="search_bt" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_contract">搜索
- </button>
+ </div>
+ <div class="layui-inline borders inner_div">
+ <label class="layui-form-label" style="width: 130px">制作完成时间</label>
+ <div class="layui-inline" id="ID-laydate-range">
+ <input type="text" class="layui-input" name="deliver_date" id="ID-laydate-demo_2" placeholder="yyyy-MM-dd">
</div>
</div>
+ <div class="layui-inline borders inner_div">
+ <button type="reset" class="layui-btn layui-btn-primary" lay-submit lay-filter="reset_business_search">重置
+ </button>
+ <button type="submit" id="search_bt" class="layui-btn layui-btn-primary" lay-submit lay-filter="search_contract">搜索
+ </button>
+ </div>
</form>
</div>
<div id="contact_table_wraper">
<table class="layui-hide" id="shixuns_table" lay-filter="shixuns_table"></table>
@@ -148,20 +160,20 @@
<!-- {{# } }}-->
<!--</script>-->
<script type="text/html" id="shixun_name_t">
{{# if(d.s_identifier !== null && d.s_identifier !== ''){ }}
- <a target='_blank' style='color: #1E9FFF' href='<%=@url %>/shixuns/{{=d.s_identifier}}/challenges'>{{=d.shixun_name}}</a>
+ <a target='_blank' style='color: #1E9FFF' href='<%= @url %>/shixuns/{{=d.s_identifier}}/challenges'>{{=d.shixun_name}}</a>
{{# } else { }}
<a target='_blank' style='color: #1E9FFF' href='{{=d.link}}'>{{=d.shixun_name}}</a>
{{# } }}
</script>
<script type="text/html" id="subject_name_t">
{{# if(d.subject_name !== '--'){ }}
- <a target='_blank' style='color: #1E9FFF' href='<%=@url %>/paths/{{=d.subjects_identifier}}'>{{=d.subject_name}}</a>
+ <a target='_blank' style='color: #1E9FFF' href='<%= @url %>/paths/{{=d.subjects_identifier}}'>{{=d.subject_name}}</a>
{{# } else { }}
- <a style='color: #1E9FFF' >{{=d.subject_name}}</a>
+ <a style='color: #1E9FFF'>{{=d.subject_name}}</a>
{{# } }}
</script>
<script src="/markdown/marked.min.js" type="text/javascript" charset="utf-8"></script>
<script>
function extractFirstTenCharsAndImage(markdownText) {
@@ -180,13 +192,14 @@
// 获取前十个字符
firstTenChars = pureText.substring(0, 10);
// 输出结果
return `<div lay-event="show_markdown"><p>${firstTenChars}</p> ${imageTag}</div>`
}
+
layui.config({
base: '/markdown/mods/' //存放layui拓展模块的目录位置
- }).use(['form', 'table', 'miniPage', 'element', 'laydate', 'dropdown', 'jquery','easyeditor'], function () {
+ }).use(['form', 'table', 'miniPage', 'element', 'laydate', 'dropdown', 'jquery', 'easyeditor'], function () {
var laydate = layui.laydate,
easyeditor = layui.easyeditor,
element = layui.element,
form = layui.form,
table = layui.table,
@@ -196,10 +209,14 @@
laydate.render({
elem: '#ID-laydate-demo',
range: true
});
+ laydate.render({
+ elem: '#ID-laydate-demo_2',
+ range: true
+ });
var cols_table = [
[
{
@@ -233,12 +250,12 @@
{
field: 'type',
title: '项目类型',
width: 150,
align: 'center',
- templet: (d)=>{
- return d.type === 1? "实践项目":"非实践项目"
+ templet: (d) => {
+ return d.type === 1 ? "实践项目" : "非实践项目"
},
hide: gon.filter.type
},
{
field: 'shixun_name',
@@ -281,12 +298,12 @@
{
field: 'dectect_feedback',
title: '审核反馈',
width: 150,
align: 'center',
- templet: (d)=>{
- if(d.dectect_feedback){
+ templet: (d) => {
+ if (d.dectect_feedback) {
return extractFirstTenCharsAndImage(d.dectect_feedback)
}
return ''
},
hide: gon.filter.dectect_feedback
@@ -298,23 +315,16 @@
align: 'center',
hide: gon.filter.shixun_producer
},
{
field: 'shixun_manages',
- title: '课程组长',
+ title: '项目负责人',
width: 150,
align: 'center',
hide: gon.filter.shixun_manages
},
{
- field: 'max_manage',
- title: '课程组主管',
- width: 150,
- align: 'center',
- hide: gon.filter.max_manage
- },
- {
field: 'shixun_staff',
title: '销售',
width: 150,
align: 'center',
hide: gon.filter.shixun_staff
@@ -361,12 +371,12 @@
{
field: 'type',
title: '项目类型',
width: 150,
align: 'center',
- templet: (d)=>{
- return d.type === 1? "实践项目":"非实践项目"
+ templet: (d) => {
+ return d.type === 1 ? "实践项目" : "非实践项目"
},
hide: gon.filter.type
},
{
field: 'shixun_name',
@@ -409,12 +419,12 @@
{
field: 'dectect_feedback',
title: '审核反馈',
width: 150,
align: 'center',
- templet: (d)=>{
- if(d.dectect_feedback){
+ templet: (d) => {
+ if (d.dectect_feedback) {
return extractFirstTenCharsAndImage(d.dectect_feedback)
}
return ''
},
hide: gon.filter.dectect_feedback
@@ -426,23 +436,16 @@
align: 'center',
hide: gon.filter.shixun_producer
},
{
field: 'shixun_manages',
- title: '课程组长',
+ title: '项目负责人',
width: 150,
align: 'center',
hide: gon.filter.shixun_manages
},
{
- field: 'max_manage',
- title: '课程组主管',
- width: 150,
- align: 'center',
- hide: gon.filter.max_manage
- },
- {
field: 'shixun_staff',
title: '销售',
width: 150,
align: 'center',
hide: gon.filter.shixun_staff
@@ -456,17 +459,23 @@
]
]
var data = form.val("search_form");
// 默认管培
data.category = gon.category
- localStorage.setItem("is_admin-<%=session[:admin_id] %>",gon.is_admin)
+ localStorage.setItem("is_admin-<%=session[:admin_id] %>", gon.is_admin)
element.tabChange("shixun_nav", gon.category);
console.log("is_admin-<%=session[:admin_id] %>")
console.log(gon.is_admin)
- if (gon.is_admin && data.category == 3 ){
+ if (gon.is_admin && data.category == 3) {
console.log("admin")
- money_cols_table[0].splice(8, 0, {field: 'money',title: '金额',width: 150, align: 'center',hide: gon.filter.money })
+ money_cols_table[0].splice(8, 0, {
+ field: 'money',
+ title: '金额',
+ width: 150,
+ align: 'center',
+ hide: gon.filter.money
+ })
// console.log(demo)
}
var tableDataCount = 0
var id = localStorage.getItem("subjects_id")
@@ -482,11 +491,11 @@
cols: money_cols_table,
limit: 10,
limits: [10, 15, 20, 30, 40, 50, 60, 70, 80, 90],
page: true,
skin: 'line',
- done:function (res, curr, count){
+ done: function (res, curr, count) {
tableDataCount = count;
}
});
// 重置
form.on('submit(reset_business_search)', function (data) {
@@ -495,11 +504,11 @@
console.log(category)
table.reload('shixuns_table', {
page: {
curr: 1
},
- where: {q: {category:category}}
+ where: {q: {category: category}}
}, 'data');
form.render()
return false;
});
var sort = {}, search = {};
@@ -570,12 +579,12 @@
error: (res) => {
layer.msg("已经提交过了")
}
})
return false
- }else if(obj.event === 'show_markdown'){
- if(data.dectect_feedback !== '--'){
+ } else if (obj.event === 'show_markdown') {
+ if (data.dectect_feedback !== '--') {
var text = `<div class="markdown_list" style="margin: 50px" >` + data.dectect_feedback + `</div>`
layer.open({
type: 1,
title: '审核反馈',
area: ['900px', '700px'], // 宽高
@@ -641,22 +650,22 @@
layer.msg("操作失败")
},
dataType: 'Json'
})
});
- }else if(obj.event === 'list'){
- table.reload('shixuns_table',{
+ } else if (obj.event === 'list') {
+ table.reload('shixuns_table', {
page: 1,
- limit:tableDataCount, //加载所有数据
- done:function (){
+ limit: tableDataCount, //加载所有数据
+ done: function () {
//导出所有数据
- table.exportFile("shixuns_table",false,"xls");
+ table.exportFile("shixuns_table", false, "xls");
//恢复数据分页显示
- table.reload('shixuns_table',{
+ table.reload('shixuns_table', {
page: 1,
- limit:20,
- done:function (res, curr, count){
+ limit: 20,
+ done: function (res, curr, count) {
tableDataCount = count;
}
})
}
@@ -669,11 +678,11 @@
if (i !== 3) {
console.log("tabchange是否跳转")
$("#category_" + i).click(function () {
$(".layui-form")[0].reset();
data.category = i
- localStorage.setItem("category",i)
+ localStorage.setItem("category", i)
table.reload('shixuns_table', {
page: {
curr: 1
},
cols: cols_table,
@@ -684,31 +693,31 @@
});
} else if (i === 3) {
$("#category_" + i).click(function () {
$(".layui-form")[0].reset();
data.category = i
- localStorage.setItem("category",i)
+ localStorage.setItem("category", i)
var flag = true
- for(let i = 0; i < money_cols_table[0].length; i ++){
- if(money_cols_table[0][i].field === "money"){
+ for (let i = 0; i < money_cols_table[0].length; i++) {
+ if (money_cols_table[0][i].field === "money") {
flag = false
break
}
}
var is_admin = localStorage.getItem("is_admin-<%=session[:admin_id] %>")
- if (flag && is_admin !== 'false' && data.category == 3 ){
- hash = {field: 'money',title: '金额',width: 150, align: 'center',hide: gon.filter.money }
+ if (flag && is_admin !== 'false' && data.category == 3) {
+ hash = {field: 'money', title: '金额', width: 150, align: 'center', hide: gon.filter.money}
money_cols_table[0].splice(8, 0, hash)
}
table.reload('shixuns_table', {
page: {
curr: 1
},
cols: money_cols_table,
where: {q: data},
- done:function (res, curr, count){
+ done: function (res, curr, count) {
tableDataCount = count;
}
})
\ No newline at end of file