提交 4e897904 编写于 作者: doc_wei's avatar doc_wei

CRM客户跟单整改

上级 62c9a54a
......@@ -281,9 +281,9 @@ layui.config({
function documentaryDetails(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/documentarymanage/documentarydetails.html",
url: "../../tpl/documentarymanage/documentaryDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "documentarydetails",
pageId: "documentaryDetails",
area: ['70vw', '70vh'],
callBack: function(refreshCode){
}});
......
......@@ -25,22 +25,14 @@ layui.config({
maxlength: 200,
tools: ['count', 'copy', 'reset']
});
//分类
showGrid({
id: "typeId",
url: flowableBasePath + "crmdocumentarytype008",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(j){
form.render('select');
opportunityFrom();
}
// 获取已上线的跟单分类列表
sysCustomerUtil.queryCrmDocumentaryTypeIsUpList(function (data){
$("#typeId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), data));
form.render('select');
opportunityFrom();
});
//商机
function opportunityFrom(){
showGrid({
......
......@@ -34,23 +34,15 @@ layui.config({
type : 'datetime',
trigger : 'click'
});
//分类
showGrid({
id: "typeId",
url: flowableBasePath + "crmdocumentarytype008",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(j){
$("#typeId").val(json.bean.typeId);
form.render('select');
opportunityFrom();
}
// 获取已上线的跟单分类列表
sysCustomerUtil.queryCrmDocumentaryTypeIsUpList(function (data){
$("#typeId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), data));
$("#typeId").val(json.bean.typeId);
form.render('select');
opportunityFrom();
});
//商机
function opportunityFrom(){
showGrid({
......
......@@ -7,26 +7,17 @@ layui.config({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'laydate'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
laydate = layui.laydate,
table = layui.table;
// 分类
showGrid({
id: "typeId",
url: flowableBasePath + "crmdocumentarytype008",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(j){
form.render('select');
}
// 获取已上线的跟单分类列表
sysCustomerUtil.queryCrmDocumentaryTypeIsUpList(function (data){
$("#typeId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), data));
form.render('select');
});
// 跟单时间
laydate.render({
elem: '#documentaryTime',
......@@ -67,35 +58,33 @@ layui.config({
}
});
form.render();
$("body").on("click", "#formSearch", function(){
refreshTable();
});
$("body").on("click", "#reloadTable", function(){
loadTable();
});
function loadTable(){
table.reload("messageTable", {where: getTableParams()});
}
function refreshTable(){
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
}
// 详情
function details(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/documentarymanage/documentarydetails.html",
url: "../../tpl/documentarymanage/documentaryDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "documentarydetails",
area: ['70vw', '70vh'],
pageId: "documentaryDetails",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
}});
}
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
}
return false;
});
$("body").on("click", "#reloadTable", function(){
loadTable();
});
function loadTable(){
table.reload("messageTable", {where: getTableParams()});
}
function getTableParams(){
var startTime = "";
......
var rowId = "";
var startTime = "";
var endTime = "";
layui.config({
base: basePath,
......@@ -9,28 +7,19 @@ layui.config({
window: 'js/winui.window'
}).define(['window', 'table', 'jquery', 'winui', 'form', 'laydate'], function (exports) {
winui.renderColor();
var $ = layui.$,
form = layui.form,
laydate = layui.laydate,
table = layui.table;
authBtn('1572595572098');
//分类
showGrid({
id: "typeId",
url: flowableBasePath + "crmdocumentarytype008",
params: {},
pagination: false,
template: getFileContent('tpl/template/select-option.tpl'),
ajaxSendLoadBefore: function(hdb){
},
ajaxSendAfter:function(j){
form.render('select');
}
// 获取已上线的跟单分类列表
sysCustomerUtil.queryCrmDocumentaryTypeIsUpList(function (data){
$("#typeId").html(getDataUseHandlebars(getFileContent('tpl/template/select-option.tpl'), data));
form.render('select');
});
//跟单时间
laydate.render({
elem: '#documentaryTime',
......@@ -42,7 +31,7 @@ layui.config({
elem: '#messageTable',
method: 'post',
url: flowableBasePath + 'documentary001',
where: {opportunityName: $("#opportunityName").val(), typeId: $("#typeId").val(), startTime: startTime, endTime: endTime},
where: getTableParams(),
even: true,
page: true,
limits: [8, 16, 24, 32, 40, 48, 56],
......@@ -66,55 +55,22 @@ layui.config({
table.on('tool(messageTable)', function (obj) {
var data = obj.data;
var layEvent = obj.event;
if (layEvent === 'edit') { //编辑
if (layEvent === 'edit') { // 编辑
edit(data);
}else if (layEvent === 'delete'){ //删除
}else if (layEvent === 'delete'){ // 删除
del(data);
}else if (layEvent === 'details'){ //详情
}else if (layEvent === 'details'){ // 详情
details(data);
}
});
form.render();
$("body").on("click", "#formSearch", function(){
refreshTable();
});
$("body").on("click", "#reloadTable", function(){
loadTable();
});
function loadTable(){
if(isNull($("#documentaryTime").val())){
startTime = "";
endTime = "";
}else{
startTime = $("#documentaryTime").val().split('~')[0].trim();
endTime = $("#documentaryTime").val().split('~')[1].trim();
}
table.reload("messageTable", {where: {opportunityName: $("#opportunityName").val(), typeId: $("#typeId").val(), startTime:startTime, endTime:endTime}});
}
function refreshTable(){
if(isNull($("#documentaryTime").val())){
startTime = "";
endTime = "";
}else{
startTime = $("#documentaryTime").val().split('~')[0].trim();
endTime = $("#documentaryTime").val().split('~')[1].trim();
}
table.reload("messageTable", {page: {curr: 1}, where: {opportunityName: $("#opportunityName").val(), typeId: $("#typeId").val(), startTime:startTime, endTime:endTime}});
}
//新增
// 新增
$("body").on("click", "#addBean", function(){
_openNewWindows({
url: "../../tpl/documentarymanage/documentaryadd.html",
url: "../../tpl/documentarymanage/documentaryAdd.html",
title: "新增跟单",
pageId: "documentaryadd",
area: ['70vw', '70vh'],
pageId: "documentaryAdd",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1,time: 2000});
......@@ -125,14 +81,14 @@ layui.config({
}});
});
//编辑
// 编辑
function edit(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/documentarymanage/documentaryedit.html",
title: "编辑跟单",
pageId: "documentaryedit",
area: ['70vw', '70vh'],
area: ['90vw', '90vh'],
callBack: function(refreshCode){
if (refreshCode == '0') {
winui.window.msg(systemLanguage["com.skyeye.successfulOperation"][languageType], {icon: 1,time: 2000});
......@@ -143,19 +99,19 @@ layui.config({
}});
}
//详情
// 详情
function details(data){
rowId = data.id;
_openNewWindows({
url: "../../tpl/documentarymanage/documentarydetails.html",
url: "../../tpl/documentarymanage/documentaryDetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
pageId: "documentarydetails",
area: ['70vw', '70vh'],
pageId: "documentaryDetails",
area: ['90vw', '90vh'],
callBack: function(refreshCode){
}});
}
//删除
// 删除
function del(data, obj){
layer.confirm(systemLanguage["com.skyeye.deleteOperationMsg"][languageType], {icon: 3, title: systemLanguage["com.skyeye.deleteOperation"][languageType]}, function(index){
layer.close(index);
......@@ -169,6 +125,37 @@ layui.config({
}});
});
}
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
table.reload("messageTable", {page: {curr: 1}, where: getTableParams()});
}
return false;
});
$("body").on("click", "#reloadTable", function(){
loadTable();
});
function loadTable(){
table.reload("messageTable", {where: getTableParams()});
}
function getTableParams(){
var startTime = "";
var endTime = "";
if(!isNull($("#documentaryTime").val())){
startTime = $("#documentaryTime").val().split('~')[0].trim();
endTime = $("#documentaryTime").val().split('~')[1].trim();
}
return {
opportunityName: $("#opportunityName").val(),
typeId: $("#typeId").val(),
startTime: startTime,
endTime: endTime
};
}
exports('mydocumentarylist', {});
});
\ No newline at end of file
......@@ -111,11 +111,11 @@ layui.config({
}});
}
//删除
// 删除
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 + "crmdocumentarytype005", params: {rowId: data.id}, type: 'json', callback: function(json){
AjaxPostUtil.request({url: flowableBasePath + "crmdocumentarytype005", params: {rowId: data.id}, type: 'json', method: "DELETE", callback: function(json){
if(json.returnCode == 0){
winui.window.msg(systemLanguage["com.skyeye.deleteOperationSuccessMsg"][languageType], {icon: 1,time: 2000});
loadTable();
......@@ -126,7 +126,7 @@ layui.config({
});
}
//上线
// 上线
function up(data, obj){
var msg = obj ? '确认将【' + obj.data.typeName + '】上线吗?' : '确认将选中数据上线吗?';
layer.confirm(msg, {icon: 3, title: '类型上线'}, function (index) {
......
......@@ -53,7 +53,7 @@
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/documentarymanage/'}).use('documentaryadd');
layui.config({base: '../../js/documentarymanage/'}).use('documentaryAdd');
</script>
</body>
</html>
\ No newline at end of file
......@@ -15,7 +15,7 @@
<script src="../../assets/lib/layui/layui.js"></script>
<script src="../../assets/lib/layui/custom.js"></script>
<script type="text/javascript">
layui.config({base: '../../js/documentarymanage/'}).use('documentarydetails');
layui.config({base: '../../js/documentarymanage/'}).use('documentaryDetails');
</script>
</body>
</html>
\ No newline at end of file
......@@ -25,7 +25,7 @@
<input type="text" id="documentaryTime" name="documentaryTime" placeholder="请输入跟单时间" class="layui-input" />
</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>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
......
......@@ -25,7 +25,7 @@
<input type="text" id="documentaryTime" name="documentaryTime" placeholder="请输入跟单时间" class="layui-input" />
</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>
<button class="layui-btn list-form-search" lay-submit lay-filter="formSearch"><language showName="com.skyeye.search2"></language></button>
</div>
</div>
</form>
......
......@@ -49,9 +49,7 @@ layui.config({
});
form.render();
form.on('submit(formSearch)', function (data) {
if (winui.verifyForm(data.elem)) {
refreshTable();
}
......
......@@ -63,4 +63,21 @@ var sysCustomerUtil = {
}, async: false});
},
/**
* 获取已上线的跟单分类列表
*
* @param callback 回执函数
*/
queryCrmDocumentaryTypeIsUpList: function (callback){
AjaxPostUtil.request({url: flowableBasePath + "crmdocumentarytype008", params: {}, type: 'json', method: "GET", callback: function(json) {
if(json.returnCode == 0) {
if(typeof(callback) == "function") {
callback(json);
}
} else {
winui.window.msg(json.returnMessage, {icon: 2, time: 2000});
}
}, async: false});
},
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册