1、优化:客户领取、分配、转移操作后自动更新列表数据

2、新增:删除客户后,关联的客户联系人、销售机会同步删除
This commit is contained in:
HDM58\hdm58 2023-06-27 23:53:01 +08:00
parent 5e02500be0
commit dcf2cb811b
6 changed files with 17 additions and 36 deletions

View File

@ -579,6 +579,10 @@ class Index extends BaseController
'create_time' => time()
);
if (Db::name('Customer')->update($data) !== false) {
//删除客户联系人
Db::name('CustomerContact')->where(['cid' => $params['id']])->update(['delete_time'=>time()]);
//删除客户机会
Db::name('CustomerChance')->where(['cid' => $params['id']])->update(['delete_time'=>time()]);
add_log('delete', $params['id']);
Db::name('CustomerLog')->strict(false)->field(true)->insert($log_data);
return to_assign();

View File

@ -240,7 +240,7 @@
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
layui.pageTable.reload();
}
}
tool.post("/customer/index/to_sea", {id: data.id}, callback);
@ -367,23 +367,12 @@
}
});
}
$('[lay-filter="clear"]').on('click',function(){
//$('.layui-table-sort').attr('lay-sort','');
//console.log($('.layui-table-sort').attr('lay-sort'));
setTimeout(function(){
$('[lay-filter="webform"]').click();
},10)
})
//监听搜索提交
form.on('submit(webform)', function(data) {
layui.pageTable.reload({
where: data.field,
page: {
curr: 1
}
page: {curr: 1}
});
return false;
});

View File

@ -96,7 +96,7 @@
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
layui.pageTable.reload();
let count =$('#count').text();
$('#count').html(++count);
}

View File

@ -255,7 +255,7 @@
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
layui.pageTable.reload();
}
}
tool.post("/customer/api/distribute", {id: data.id,uid:ids,did:dids}, callback);
@ -272,7 +272,7 @@
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
layui.pageTable.reload();
}
}
tool.post("/customer/index/get", {id: data.id}, callback);
@ -287,7 +287,7 @@
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
layui.pageTable.reload();
}
}
tool.delete("/customer/index/to_trash", {id: data.id,type:1}, callback);
@ -300,14 +300,8 @@
//监听搜索提交
form.on('submit(webform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
industry_id: data.field.industry_id,
source_id: data.field.source_id
},
page: {
curr: 1
}
where: data.field,
page: {curr: 1}
});
return false;
});

View File

@ -129,7 +129,7 @@
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
layui.pageTable.reload();
}
}
tool.post("/customer/index/revert", {id: data.id}, callback);
@ -144,7 +144,7 @@
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
layui.pageTable.reload();
}
}
tool.delete("/customer/index/delete", {id: data.id}, callback);
@ -157,14 +157,8 @@
//监听搜索提交
form.on('submit(webform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords,
industry_id: data.field.industry_id,
source_id: data.field.source_id
},
page: {
curr: 1
}
where: data.field,
page: {curr: 1}
});
return false;
});

View File

@ -15,7 +15,7 @@ if (empty(file_exists(__DIR__ . '/../vendor/autoload.php'))) {
require __DIR__ . '/../vendor/autoload.php';
// 定义当前版本号
define('CMS_VERSION','4.50.31');
define('CMS_VERSION','4.60.28');
// 定义Layui版本号
define('LAYUI_VERSION','2.8.8');