修复客户详情跟进记录、联 系 人、销售机会新增和编辑时,列表不更新问题

This commit is contained in:
HDM58\hdm58 2024-02-29 15:25:16 +08:00
parent 4fc796cfdd
commit 7ad84dbc77
3 changed files with 15 additions and 15 deletions

View File

@ -12,7 +12,7 @@ function chance(){
$('#customerTab').find('li').eq(2).data('load','true');
let tool = layui.tool, table = layui.table;
//项目任务
parent.layui.chanceTable = table.render({
layui.chanceTable = table.render({
elem: '#chance',
title: '销售机会列表',
cellMinWidth:80,
@ -38,7 +38,7 @@ function chance(){
]]
});
$('.add-chance').on('click',function(){
parent.layui.tool.side('/customer/api/add_chance?cid='+customer_id);
tool.side('/customer/api/add_chance?cid='+customer_id);
});
table.on('tool(chance)', function(obj){
@ -46,18 +46,18 @@ function chance(){
var layEvent = obj.event;
if(layEvent === 'edit'){ //编辑
let url = '/customer/api/add_chance/id/'+data.id;
parent.layui.tool.side(url);
tool.side(url);
}
if(layEvent === 'view'){ //查看
let url = '/customer/api/view_chance/id/'+data.id;
parent.layui.tool.side(url);
tool.side(url);
}
if(layEvent === 'del'){ //删除
layer.confirm('确定要删除该销售机会吗?', {icon: 3, title:'提示'}, function(index){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
parent.layui.chanceTable.reload();
layui.chanceTable.reload();
}
}
tool.delete("/customer/api/delete_chance",{"id":data.id},callback);

View File

@ -12,7 +12,7 @@ function contact(){
$('#customerTab').find('li').eq(1).data('load','true');
let tool = layui.tool, table = layui.table;
//项目任务
parent.layui.contactTable = table.render({
layui.contactTable = table.render({
elem: '#contact',
title: '联系人列表',
cellMinWidth:80,
@ -58,7 +58,7 @@ function contact(){
]]
});
$('.add-contact').on('click',function(){
parent.layui.tool.side('/customer/contact/contact_add?cid='+customer_id);
tool.side('/customer/contact/contact_add?cid='+customer_id);
});
table.on('tool(contact)', function(obj){
@ -66,14 +66,14 @@ function contact(){
var layEvent = obj.event;
if(layEvent === 'edit'){ //编辑
let url = '/customer/contact/contact_add/id/'+data.id;
parent.layui.tool.side(url);
tool.side(url);
}
if(layEvent === 'set'){ //查看
layer.confirm('确定要设置该联系人为首要联系人吗?', {icon: 3, title:'提示'}, function(index){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
parent.layui.contactTable.reload();
layui.contactTable.reload();
}
}
tool.delete("/customer/api/set_contact",{"id":data.id},callback);
@ -85,7 +85,7 @@ function contact(){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
parent.layui.contactTable.reload();
layui.contactTable.reload();
}
}
tool.delete("/customer/contact/contact_del",{"id":data.id},callback);

View File

@ -12,7 +12,7 @@ function trace(){
$('#customerTab').find('li').eq(0).data('load','true');
let tool = layui.tool, table = layui.table;
//项目任务
parent.layui.traceTable = table.render({
layui.traceTable = table.render({
elem: '#trace',
title: '跟进记录列表',
cellMinWidth:80,
@ -41,7 +41,7 @@ function trace(){
]]
});
$('.add-trace').on('click',function(){
parent.layui.tool.side('/customer/api/add_trace?cid='+customer_id);
tool.side('/customer/api/add_trace?cid='+customer_id);
});
table.on('tool(trace)', function(obj){
@ -49,18 +49,18 @@ function trace(){
var layEvent = obj.event;
if(layEvent === 'edit'){ //编辑
let url = '/customer/api/add_trace/id/'+data.id;
parent.layui.tool.side(url);
tool.side(url);
}
if(layEvent === 'view'){ //查看
let url = '/customer/api/view_trace/id/'+data.id;
parent.layui.tool.side(url);
tool.side(url);
}
if(layEvent === 'del'){ //删除
layer.confirm('确定要删除该跟进记录吗?', {icon: 3, title:'提示'}, function(index){
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
parent.layui.traceTable.reload();
layui.traceTable.reload();
}
}
tool.delete("/customer/api/delete_trace",{"id":data.id},callback);