提交 688c185b 编写于 作者: Skyeye云's avatar Skyeye云

【CRM】删除客户所属行业功能

上级 7419a12d
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
matchingLanguage();
form.render();
form.on('submit(formAddBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
typeName: $("#typeName").val()
};
AjaxPostUtil.request({url: flowableBasePath + "crmcustomerindustry002", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'jquery', 'winui'], function (exports) {
winui.renderColor();
layui.use(['form'], function (form) {
var index = parent.layer.getFrameIndex(window.name);
var $ = layui.$;
showGrid({
id: "showForm",
url: flowableBasePath + "crmcustomerindustry003",
params: {rowId: parent.rowId},
pagination: false,
template: getFileContent('tpl/crmcustomerindustry/crmcustomerindustryeditTemplate.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter: function (json) {
matchingLanguage();
form.render();
form.on('submit(formEditBean)', function (data) {
if (winui.verifyForm(data.elem)) {
var params = {
rowId: parent.rowId,
typeName: $("#typeName").val()
};
AjaxPostUtil.request({url: flowableBasePath + "crmcustomerindustry004", params: params, type: 'json', callback: function (json) {
parent.layer.close(index);
parent.refreshCode = '0';
}});
}
return false;
});
}
});
$("body").on("click", "#cancle", function() {
parent.layer.close(index);
});
});
});
\ No newline at end of file
var rowId = "";
layui.config({
base: basePath,
version: skyeyeVersion
}).extend({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
table = layui.table;
authBtn('1569477891227');
table.render({
id: 'messageTable',
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'crmcustomerindustry001',
where: {typeName: $("#typeName").val(), state: $("#state").val()},
even: true,
page: true,
limits: getLimits(),
limit: getLimit(),
cols: [[
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers'},
{ field: 'typeName', title: '所属行业', align: 'left', width: 250 },
{ field: 'state', title: '状态', width: 100, align: 'center', templet: function (d) {
if(d.state == '1'){
return "<span class='state-new'>新建</span>";
}else if(d.state == '2'){
return "<span class='state-up'>上线</span>";
}else if(d.state == '3'){
return "<span class='state-down'>下线</span>";
} else {
return "参数错误";
}
}},
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 200},
{ title: systemLanguage["com.skyeye.operation"][languageType], fixed: 'right', align: 'center', width: 250, toolbar: '#tableBar'}
]],
done: function(){
matchingLanguage();
}
});
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
edit(data);
}else if (layEvent === 'delete'){ //删除
del(data);
}else if (layEvent === 'up') { //上线
up(data);
}else if (layEvent === 'down') { //下线
down(data);
}
});
form.render();
$("body").on("click", "#formSearch", function() {
refreshTable();
});
$("body").on("click", "#reloadTable", function() {
loadTable();
});
function loadTable(){
table.reload("messageTable", {where: {typeName: $("#typeName").val(), state: $("#state").val()}});
}
function refreshTable(){
table.reload("messageTable", {page: {curr: 1}, where: {typeName: $("#typeName").val(), state: $("#state").val()}});
}
//新增
$("body").on("click", "#addBean", function() {
_openNewWindows({
url: "../../tpl/crmcustomerindustry/crmcustomerindustryadd.html",
title: systemLanguage["com.skyeye.addPageTitle"][languageType],
pageId: "crmcustomerindustryadd",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
//编辑
function edit(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/crmcustomerindustry/crmcustomerindustryedit.html",
title: systemLanguage["com.skyeye.editPageTitle"][languageType],
pageId: "crmcustomerindustryedit",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1, time: 2000});
loadTable();
}});
}
//删除
function del(data, obj){
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){
layer.close(index);
AjaxPostUtil.request({url: flowableBasePath + "crmcustomerindustry005", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1, time: 2000});
loadTable();
}});
});
}
//上线
function up(data, obj){
var msg = obj ? '确认将【' + obj.data.typeName + '】上线吗?' : '确认将选中数据上线吗?';
layer.confirm(msg, {icon: 3, title: '所属行业上线'}, function (index) {
layer.close(index);
AjaxPostUtil.request({url: flowableBasePath + "crmcustomerindustry006", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg("上线成功", {icon: 1, time: 2000});
loadTable();
}});
});
}
//下线
function down(data, obj){
var msg = obj ? '确认将【' + obj.data.typeName + '】下线吗?' : '确认将选中数据下线吗?';
layer.confirm(msg, {icon: 3, title: '所属行业下线'}, function (index) {
layer.close(index);
AjaxPostUtil.request({url: flowableBasePath + "crmcustomerindustry007", params: {rowId: data.id}, type: 'json', callback: function (json) {
winui.window.msg("下线成功", {icon: 1, time: 2000});
loadTable();
}});
});
}
exports('crmcustomerindustrylist', {});
});
\ No newline at end of file
...@@ -12,7 +12,6 @@ layui.config({ ...@@ -12,7 +12,6 @@ layui.config({
var $ = layui.$, var $ = layui.$,
form = layui.form, form = layui.form,
table = layui.table; table = layui.table;
var selOption = getFileContent('tpl/template/select-option.tpl');
// 客户分类 // 客户分类
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerType"]["key"], 'select', "typeId", '', form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerType"]["key"], 'select', "typeId", '', form);
...@@ -20,11 +19,8 @@ layui.config({ ...@@ -20,11 +19,8 @@ layui.config({
// 客户来源 // 客户来源
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form);
// 获取已上线的客户所属行业列表 // 客户所属行业
sysCustomerUtil.queryCrmCustomerIndustryIsUpList(function (data){ sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerIndustry"]["key"], 'select', "industryId", '', form);
$("#industryId").html(getDataUseHandlebars(selOption, data));
form.render('select');
});
table.render({ table.render({
id: 'messageTable', id: 'messageTable',
......
...@@ -10,7 +10,6 @@ layui.config({ ...@@ -10,7 +10,6 @@ layui.config({
var $ = layui.$, var $ = layui.$,
form = layui.form, form = layui.form,
table = layui.table; table = layui.table;
var selectOption = getFileContent('tpl/template/select-option.tpl');
// 客户分类 // 客户分类
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerType"]["key"], 'select', "typeId", '', form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerType"]["key"], 'select', "typeId", '', form);
...@@ -18,11 +17,8 @@ layui.config({ ...@@ -18,11 +17,8 @@ layui.config({
// 客户来源 // 客户来源
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form);
// 获取已上线的客户所属行业列表 // 客户所属行业
sysCustomerUtil.queryCrmCustomerIndustryIsUpList(function (data){ sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerIndustry"]["key"], 'select', "industryId", '', form);
$("#industryId").html(getDataUseHandlebars(selectOption, data));
form.render('select');
});
// 公海客户群 // 公海客户群
table.render({ table.render({
......
...@@ -21,13 +21,10 @@ layui.config({ ...@@ -21,13 +21,10 @@ layui.config({
// 客户来源 // 客户来源
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form);
// 获取已上线的客户所属行业列表 // 客户所属行业
sysCustomerUtil.queryCrmCustomerIndustryIsUpList(function (data){ sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerIndustry"]["key"], 'select', "industryId", '', form);
$("#industryId").html(getDataUseHandlebars(selectMust, data));
form.render('select');
customerGroup();
});
customerGroup();
// 客户分组 // 客户分组
function customerGroup(){ function customerGroup(){
showGrid({ showGrid({
......
...@@ -29,14 +29,10 @@ layui.config({ ...@@ -29,14 +29,10 @@ layui.config({
// 客户来源 // 客户来源
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", json.bean.fromId, form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", json.bean.fromId, form);
// 获取已上线的客户所属行业列表 // 客户所属行业
sysCustomerUtil.queryCrmCustomerIndustryIsUpList(function (data){ sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerIndustry"]["key"], 'select', "industryId", json.bean.industryId, form);
$("#industryId").html(getDataUseHandlebars(selectMust, data));
$("#industryId").val(json.bean.industryId);
form.render('select');
customerGroup();
});
customerGroup();
// 客户分组 // 客户分组
function customerGroup(){ function customerGroup(){
showGrid({ showGrid({
......
...@@ -21,11 +21,8 @@ layui.config({ ...@@ -21,11 +21,8 @@ layui.config({
// 客户来源 // 客户来源
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form);
// 获取已上线的客户所属行业列表 // 客户所属行业
sysCustomerUtil.queryCrmCustomerIndustryIsUpList(function (data){ sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerIndustry"]["key"], 'select', "industryId", '', form);
$("#industryId").html(getDataUseHandlebars(selectOption, data));
form.render('select');
});
// 表格渲染 // 表格渲染
table.render({ table.render({
......
...@@ -11,7 +11,6 @@ layui.config({ ...@@ -11,7 +11,6 @@ layui.config({
var $ = layui.$, var $ = layui.$,
form = layui.form, form = layui.form,
table = layui.table; table = layui.table;
var selectOption = getFileContent('tpl/template/select-option.tpl');
// 客户分类 // 客户分类
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerType"]["key"], 'select', "typeId", '', form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerType"]["key"], 'select', "typeId", '', form);
...@@ -19,11 +18,8 @@ layui.config({ ...@@ -19,11 +18,8 @@ layui.config({
// 客户来源 // 客户来源
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form);
// 获取已上线的客户所属行业列表 // 客户所属行业
sysCustomerUtil.queryCrmCustomerIndustryIsUpList(function (data){ sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerIndustry"]["key"], 'select', "industryId", '', form);
$("#industryId").html(getDataUseHandlebars(selectOption, data));
form.render('select');
});
// 获取我负责的客户管理列表 // 获取我负责的客户管理列表
table.render({ table.render({
......
...@@ -11,8 +11,7 @@ layui.config({ ...@@ -11,8 +11,7 @@ layui.config({
var $ = layui.$, var $ = layui.$,
form = layui.form, form = layui.form,
table = layui.table; table = layui.table;
var selectOption = getFileContent('tpl/template/select-option.tpl');
authBtn('1586179447152'); authBtn('1586179447152');
// 客户分类 // 客户分类
...@@ -21,11 +20,8 @@ layui.config({ ...@@ -21,11 +20,8 @@ layui.config({
// 客户来源 // 客户来源
sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form); sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerFrom"]["key"], 'select', "fromId", '', form);
// 获取已上线的客户所属行业列表 // 客户所属行业
sysCustomerUtil.queryCrmCustomerIndustryIsUpList(function (data){ sysDictDataUtil.showDictDataListByDictTypeCode(sysDictData["crmCustomerIndustry"]["key"], 'select', "industryId", '', form);
$("#industryId").html(getDataUseHandlebars(selectOption, data));
form.render('select');
});
// 获取我创建的客户管理列表 // 获取我创建的客户管理列表
table.render({ table.render({
......
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm">
<div class="layui-form-item layui-col-xs12">
<label class="layui-form-label">所属行业<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="typeName" name="typeName" win-verify="required" placeholder="请输入所属行业" class="layui-input" maxlength="20"/>
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formAddBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/crmcustomerindustry/'}).use('crmcustomerindustryadd');
</script>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div style="padding:20px; margin:0 auto;">
<form class="layui-form" action="" id="showForm">
</form>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/crmcustomerindustry/'}).use('crmcustomerindustryedit');
</script>
</body>
</html>
\ No newline at end of file
{{#bean}}
<div class="layui-form-item">
<label class="layui-form-label">所属行业<i class="red">*</i></label>
<div class="layui-input-block">
<input type="text" id="typeName" name="typeName" win-verify="required" placeholder="请输入所属行业" class="layui-input" maxlength="20" value="{{typeName}}" />
</div>
</div>
<div class="layui-form-item layui-col-xs12">
<div class="layui-input-block">
<button class="winui-btn" id="cancle"><language showName="com.skyeye.cancel"></language></button>
<button class="winui-btn" lay-submit lay-filter="formEditBean"><language showName="com.skyeye.save"></language></button>
</div>
</div>
{{/bean}}
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="../../assets/lib/layui/css/layui.css" rel="stylesheet" />
<link href="../../assets/lib/winui/css/winui.css" rel="stylesheet" />
</head>
<body>
<div class="txtcenter" style="margin:0 auto;padding-top:10px;">
<form class="layui-form layui-form-pane" action="" autocomplete="off">
<div class="layui-form-item">
<div class="layui-inline">
<label class="layui-form-label">所属行业</label>
<div class="layui-input-inline">
<input type="text" id="typeName" name="typeName" placeholder="请输入所属行业" class="layui-input" />
</div>
<label class="layui-form-label">状态</label>
<div class="layui-input-inline">
<select id="state" name="state">
<option value="">全部</option>
<option value="1">新建</option>
<option value="2">上线</option>
<option value="3">下线</option>
</select>
</div>
<button type="reset" class="layui-btn layui-btn-primary list-form-search"><language showName="com.skyeye.reset"></language></button>
<button class="layui-btn list-form-search" type="button" id="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
</div>
<div class="winui-toolbar">
<div class="winui-tool">
<button id="reloadTable" class="winui-toolbtn"><i class="fa fa-refresh" aria-hidden="true"></i><language showName="com.skyeye.refreshDataBtn"></language></button>
<button id="addBean" class="winui-toolbtn" auth="1569477891227"><i class="fa fa-plus" aria-hidden="true"></i><language showName="com.skyeye.addBtn"></language></button>
</div>
</div>
<div style="margin:auto 10px;">
<table id="messageTable" lay-filter="messageTable"></table>
<script type="text/html" id="tableBar">
{{# if(d.state == 1 || d.state == 3){ }}
{{# if(auth('1569477900266')){ }}
<a class="layui-btn layui-btn-xs" lay-event="edit"><language showName="com.skyeye.editBtn"></language></a>
{{# } }}
{{# } }}
{{# if((d.state == 1 || d.state == 3) && (d.useNum == 0)){ }}
{{# if(auth('1569477908652')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="delete"><language showName="com.skyeye.deleteBtn"></language></a>
{{# } }}
{{# } }}
{{# if(d.state == 1 || d.state == 3){ }}
{{# if(auth('1569477917770')){ }}
<a class="layui-btn layui-btn-xs" lay-event="up">上线</a>
{{# } }}
{{# } }}
{{# if(d.state == 2){ }}
{{# if(auth('1569477924815')){ }}
<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="down">下线</a>
{{# } }}
{{# } }}
</script>
</div>
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/crmcustomerindustry/'}).use('crmcustomerindustrylist');
</script>
</body>
</html>
\ No newline at end of file
...@@ -25,17 +25,4 @@ var sysCustomerUtil = { ...@@ -25,17 +25,4 @@ var sysCustomerUtil = {
}}); }});
}, },
/**
* 获取已上线的客户所属行业列表
*
* @param callback 回执函数
*/
queryCrmCustomerIndustryIsUpList: function (callback){
AjaxPostUtil.request({url: flowableBasePath + "crmcustomerindustry008", params: {}, type: 'json', method: "GET", callback: function(json) {
if(typeof(callback) == "function") {
callback(json);
}
}, async: false});
},
} }
\ No newline at end of file
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
"crmCustomerType": {"name": "CRM-客户分类", "key": "CRM_CUSTOMER_TYPE"}, "crmCustomerType": {"name": "CRM-客户分类", "key": "CRM_CUSTOMER_TYPE"},
"crmCustomerFrom": {"name": "CRM-客户来源", "key": "CRM_CUSTOMER_FROM"}, "crmCustomerFrom": {"name": "CRM-客户来源", "key": "CRM_CUSTOMER_FROM"},
"crmCustomerIndustry": {"name": "CRM-客户所属行业", "key": "CRM_CUSTOMER_INDUSTRY"},
"crmDocumentaryType": {"name": "CRM-跟单分类", "key": "CRM_DOCUMENTARY_TYPE"}, "crmDocumentaryType": {"name": "CRM-跟单分类", "key": "CRM_DOCUMENTARY_TYPE"},
"crmOpportunityFrom": {"name": "CRM-商机来源", "key": "CRM_OPPORTUNITY_FROM"} "crmOpportunityFrom": {"name": "CRM-商机来源", "key": "CRM_OPPORTUNITY_FROM"}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册