更新命名问题
This commit is contained in:
@@ -3,7 +3,9 @@
|
||||
{block name="breadcrumb"}
|
||||
<span class="layui-breadcrumb">
|
||||
<a href="http://www.meteteme.com/" target="_blank">江苏美天科技</a>
|
||||
<a href="/business/index/nav"><cite>CRM</cite></a>
|
||||
<a href="/application/nav/index">
|
||||
<cite>应用</cite>
|
||||
</a>
|
||||
<a><cite>商机管理</cite></a>
|
||||
</span>
|
||||
{/block} {block name="body"}
|
||||
@@ -20,82 +22,22 @@
|
||||
<!-- 脚本 -->
|
||||
{block name="script"}
|
||||
<script>
|
||||
const moduleInit = ["tool", "gouguEdit", "gouguComment"];
|
||||
const moduleInit = ['tool', 'gouguEdit', 'gouguComment'];
|
||||
|
||||
function gouguInit() {
|
||||
var table = layui.table;
|
||||
var tool = layui.tool;
|
||||
|
||||
//新增商机按钮
|
||||
$(".add-new").on("click", function () {
|
||||
tool.open("/information/index/add");
|
||||
});
|
||||
|
||||
// 删除单条数据
|
||||
table.on("tool(information)", function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === "delete") {
|
||||
layui.layer.confirm(
|
||||
"确定删除该商机吗?",
|
||||
{ icon: 3, title: "提示" },
|
||||
function (index) {
|
||||
$.post(
|
||||
"/information/index/delete",
|
||||
{ id: data.id },
|
||||
function (res) {
|
||||
if (res.code === 0) {
|
||||
// layui.layer.msg("删除成功");
|
||||
layui.layer.msg(res.msg);
|
||||
obj.del();
|
||||
} else {
|
||||
// layui.layer.msg("删除失败");
|
||||
layui.layer.msg(res.msg);
|
||||
}
|
||||
}
|
||||
);
|
||||
layui.layer.close(index);
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// 批量删除数据
|
||||
$("#delete-btn").on("click", function () {
|
||||
var checkStatus = table.checkStatus("information");
|
||||
var data = checkStatus.data;
|
||||
if (data.length === 0) {
|
||||
layui.layer.msg("请勾选要删除的商机");
|
||||
return;
|
||||
}
|
||||
layui.layer.confirm(
|
||||
"确定删除选中的商机吗?",
|
||||
{ icon: 3, title: "提示" },
|
||||
function (index) {
|
||||
var ids = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
ids.push(data[i].id);
|
||||
}
|
||||
$.post(
|
||||
"/information/index/batchDelete",
|
||||
{ ids: ids },
|
||||
function (res) {
|
||||
if (res.code === 0) {
|
||||
layui.layer.msg(res.msg);
|
||||
loadTableData();
|
||||
} else {
|
||||
layui.layer.msg(res.msg);
|
||||
}
|
||||
}
|
||||
);
|
||||
layui.layer.close(index);
|
||||
}
|
||||
);
|
||||
});
|
||||
var table = layui.table,
|
||||
form = layui.form,
|
||||
tool = layui.tool;
|
||||
|
||||
function loadTableData() {
|
||||
layui.pageTable.reload();
|
||||
}
|
||||
|
||||
// 刷新按钮
|
||||
$("#refresh-btn").on("click", function () {
|
||||
location.reload();
|
||||
});
|
||||
|
||||
layui.pageTable = table.render({
|
||||
elem: "#information",
|
||||
title: "商机列表",
|
||||
@@ -109,7 +51,7 @@
|
||||
{ field: "checkbox", type: "checkbox" }, // 添加复选框列
|
||||
{
|
||||
field: "id",
|
||||
title: "商机编号",
|
||||
title: "编号",
|
||||
width: 80,
|
||||
align: "center",
|
||||
rowspan: 2,
|
||||
@@ -117,6 +59,25 @@
|
||||
return "BI - " + d.id;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "status",
|
||||
title: "状态",
|
||||
align: "center",
|
||||
width: 80,
|
||||
rowspan: 2,
|
||||
},
|
||||
{
|
||||
field: "company",
|
||||
title: "企业名称",
|
||||
align: "center",
|
||||
// width: 180,
|
||||
rowspan: 2,
|
||||
templet: function (d) {
|
||||
var html =
|
||||
'<span class="a1-' + d.company + '">' + d.company + "</span>";
|
||||
return html;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "name",
|
||||
title: "商机联系人",
|
||||
@@ -129,18 +90,6 @@
|
||||
return html;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "email",
|
||||
title: "电子邮箱",
|
||||
align: "center",
|
||||
width: 170,
|
||||
rowspan: 2,
|
||||
templet: function (d) {
|
||||
var html =
|
||||
'<span class="a1-' + d.email + '">' + d.email + "</span>";
|
||||
return html;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "phone",
|
||||
title: "联系电话",
|
||||
@@ -154,19 +103,31 @@
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "message",
|
||||
title: "商机留言",
|
||||
field: "email",
|
||||
title: "电子邮箱",
|
||||
align: "center",
|
||||
width: 170,
|
||||
rowspan: 2,
|
||||
templet: function (d) {
|
||||
var html =
|
||||
'<span class="a1-' + d.message + '">' + d.message + "</span>";
|
||||
'<span class="a1-' + d.email + '">' + d.email + "</span>";
|
||||
return html;
|
||||
},
|
||||
},
|
||||
// {
|
||||
// field: "message",
|
||||
// title: "商机留言",
|
||||
// align: "center",
|
||||
// rowspan: 2,
|
||||
// templet: function (d) {
|
||||
// var html =
|
||||
// '<span>' + d.message + "</span>";
|
||||
// return html;
|
||||
// },
|
||||
// },
|
||||
{
|
||||
field: "product",
|
||||
title: "所属项目",
|
||||
title: "咨询产品",
|
||||
width: 200,
|
||||
align: "center",
|
||||
rowspan: 2,
|
||||
@@ -177,16 +138,11 @@
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "company",
|
||||
title: "企业名称",
|
||||
field: "ip",
|
||||
title: "IP地址",
|
||||
align: "center",
|
||||
width: 180,
|
||||
// width: 180,
|
||||
rowspan: 2,
|
||||
templet: function (d) {
|
||||
var html =
|
||||
'<span class="a1-' + d.company + '">' + d.company + "</span>";
|
||||
return html;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: "create_time",
|
||||
@@ -198,7 +154,7 @@
|
||||
{
|
||||
title: "操作",
|
||||
align: "center",
|
||||
width: 180,
|
||||
width: 280,
|
||||
minWidth: 125,
|
||||
toolbar: "#barDemo",
|
||||
},
|
||||
@@ -243,12 +199,132 @@
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
//新增商机按钮
|
||||
$(".add-new").on("click", function () {
|
||||
tool.open("/information/index/add");
|
||||
});
|
||||
|
||||
// // 删除单条数据
|
||||
// table.on("tool(information)", function (obj) {
|
||||
// var data = obj.data;
|
||||
// if (obj.event === "delete") {
|
||||
// layui.layer.confirm(
|
||||
// "确定删除该商机吗?",
|
||||
// { icon: 3, title: "提示" },
|
||||
// function (index) {
|
||||
// $.post(
|
||||
// "/information/index/delete",
|
||||
// { id: data.id },
|
||||
// function (res) {
|
||||
// if (res.code === 0) {
|
||||
// // layui.layer.msg("删除成功");
|
||||
// layui.layer.msg(res.msg);
|
||||
// obj.del();
|
||||
// } else {
|
||||
// // layui.layer.msg("删除失败");
|
||||
// layui.layer.msg(res.msg);
|
||||
// }
|
||||
// }
|
||||
// );
|
||||
// layui.layer.close(index);
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
|
||||
table.on('tool(information)', function (obj) {
|
||||
var data = obj.data;
|
||||
var id = data.id;
|
||||
// console.log(data);
|
||||
if (obj.event === 'edit') {
|
||||
var url = '/information/index/edit?id=' + id;
|
||||
tool.open(url);
|
||||
} else if (obj.event === 'delete') {
|
||||
layui.layer.confirm(
|
||||
"确定删除该数据吗?",
|
||||
{ icon: 3, title: "提示" },
|
||||
function (index) {
|
||||
$.post(
|
||||
"/information/index/delete",
|
||||
{ id: data.id },
|
||||
function (res) {
|
||||
if (res.code === 0) {
|
||||
layui.layer.msg(res.msg);
|
||||
obj.del(); // 删除表格中的对应行数据
|
||||
} else {
|
||||
layui.layer.msg(res.msg);
|
||||
}
|
||||
}
|
||||
);
|
||||
layui.layer.close(index);
|
||||
}
|
||||
);
|
||||
} else if (obj.event === 'conversion') {
|
||||
var url = '/information/index/conversion?id=' + id;
|
||||
tool.open(url);
|
||||
} else if (obj.event === 'follow') {
|
||||
var url = '/information/index/follow?id=' + id;
|
||||
tool.open(url);
|
||||
} else if (obj.event === 'view') {
|
||||
console.log('查看详情', id);
|
||||
// 查看详情
|
||||
layui.layer.open({
|
||||
type: 2, // iframe层
|
||||
title: '商机详情',
|
||||
shadeClose: true,
|
||||
shade: 0.8,
|
||||
area: ['70%', '90%'], // 宽高
|
||||
content: '/information/index/view?id=' + id,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 批量删除数据
|
||||
$("#delete-btn").on("click", function () {
|
||||
var checkStatus = table.checkStatus("information");
|
||||
var data = checkStatus.data;
|
||||
if (data.length === 0) {
|
||||
layui.layer.msg("请勾选要删除的商机");
|
||||
return;
|
||||
}
|
||||
layui.layer.confirm(
|
||||
"确定删除选中的数据吗?",
|
||||
{ icon: 3, title: "提示" },
|
||||
function (index) {
|
||||
var ids = [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
ids.push(data[i].id);
|
||||
}
|
||||
$.post(
|
||||
"/information/index/batchDelete",
|
||||
{ ids: ids },
|
||||
function (res) {
|
||||
if (res.code === 0) {
|
||||
layui.layer.msg(res.msg);
|
||||
loadTableData();
|
||||
} else {
|
||||
layui.layer.msg(res.msg);
|
||||
}
|
||||
}
|
||||
);
|
||||
layui.layer.close(index);
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="barDemo">
|
||||
<a class="layui-btn layui-btn-sm " lay-event="detail">查看详情</a>
|
||||
{{# if(d.is_conversion == 0){ }}
|
||||
<a class="layui-btn layui-btn-sm" lay-event="conversion" style="width: 58px;">转化</a>
|
||||
{{# } else { }}
|
||||
<a class="layui-btn layui-btn-sm layui-btn-disabled">已转化</a>
|
||||
{{# } }}
|
||||
<a class="layui-btn layui-btn-sm" lay-event="follow">跟进</a>
|
||||
<a class="layui-btn layui-btn-sm" lay-event="view">详情</a>
|
||||
<a class="layui-btn layui-btn-sm layui-btn-normal" lay-event="delete">删除</a>
|
||||
</script>
|
||||
{/block}
|
||||
Reference in New Issue
Block a user