123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702 |
- {extend name="public/layout"}
- {block name="body"}
- <link rel="stylesheet" href="__LAYUI__/layui/css/layui.css" media="all">
- <link rel="stylesheet" " href=" /static/css/common.css">
- <script src="/static/js/jquery.min.js"></script>
- <style>
- html,body{
- width: 100%;
- height: 100%;
- }
- body {
- padding-bottom: 40px;
- overflow: auto;
- }
- .searchtitlebox {
- display: block;
- padding: 15px 10px;
- border: 1px solid #F0F0F0;
- background: #FCFCFC;
- margin-top: 5px;
- margin-bottom: 10px;
- position: relative;
- min-width: 800px;
- }
- .searchbox {
- display: block;
- margin-top: 8px;
- text-align: center;
- }
- .searchbox input {
- display: inline-block;
- height: 26px;
- line-height: 26px;
- padding-left: 3px;
- vertical-align: middle;
- border: 2px solid #4479ba;
- }
- body {
- font-size: 12px;
- font-family: "宋体";
- }
- .searchbox .searchbtn {
- display: inline-block;
- float: right;
- border: none;
- width: 98px;
- height: 30px;
- color: #fff;
- font-size: 14px;
- font-weight: bold;
- text-align: center;
- background: url(__STATIC__/img/icon-sub.png) no-repeat;
- cursor: pointer;
- vertical-align: middle;
- }
- .selectbox {
- float: left;
- }
- .leftselect {
- float: left;
- height: 26px;
- line-height: 26px;
- }
- .selectbox select {
- float: left;
- height: 26px;
- }
- .searchtext {
- border: 1px solid #ccc;
- background: #fff url(__STATIC__/img/icon071402.png) no-repeat;
- padding: 1px 2px;
- height: 24px;
- line-height: 24px;
- vertical-align: middle;
- text-indent: 3px;
- margin-left: 4px;
- }
- .searchbtn1 {
- margin-left: 4px;
- cursor: pointer;
- color: #000;
- background: url(__STATIC__/img/btn_bg.gif) repeat-x;
- border: 1px solid #C0C0C0;
- padding: 0 12px;
- *padding: 0 6px;
- height: 26px;
- }
- .layui-table td,
- .layui-table th {
- font-size: 12px;
- }
- .layui-table th {
- font-weight: bold;
- }
- .dingjingorder {
- height: 25px;
- width: 40px;
- background-color: #65c001;
- color: #FFF;
- text-align: center;
- line-height: 25px;
- z-index: 100;
- display: block;
- position: absolute;
- top: 1px;
- right: 3px;
- border-radius: 11px;
- font-size: 12px;
- }
- .addvx {
- position: absolute;
- top: -5px;
- right: 1px;
- height: 14px;
- line-height: 14px;
- font-size: 16px;
- color: #666;
- font-family: "宋体";
- }
- .statebox {
- width: 40px;
- text-align: center;
- z-index: 100;
- display: block;
- position: absolute;
- font-size: 12px;
- top: -5px;
- right: 0px;
- border-radius: 0px;
- background: #4285f4;
- color: #efefef;
- height: 20px;
- line-height: 20px;
- }
- .layui-table-cell {
- overflow: initial;
- }
- #customer_detail {
- display: block;
- width: 435px;
- height: 100%;
- position: absolute;
- top: 0;
- left: 0;
- }
- .rightbox {
- display: block;
- width: calc(100% - 435px);
- margin-left: 435px;
- }
- .unstatusbox {
- display: block;
- position: absolute;
- top: -5px;
- left: 0;
- width: 100%;
- height: 37px;
- background-color: #FF6600;
- text-align: center;
- color: #FFF;
- }
- .statusbox {
- position: absolute;
- top: 0px;
- right: 0px;
- color: #666;
- text-align: right;
- z-index: 100;
- display: block;
- font-size: 12px;
- }
- .layui-table-view .layui-form-checkbox {
- width: 16px;
- height: 16px;
- line-height: 16px;
- padding-right: 0;
- }
- .layui-table-view .layui-form-checkbox i {
- height: 16px;
- width: 16px;
- font-size: 14px;
- }
- .novisitlog {
- background-color: #9139db !important;
- color: #FFF;
- }
- .novisitlog a {
- color: #FFF;
- }
- .crmsearchlist {
- max-height: 760px;
- cursor: pointer;
- height: auto !important;
- }
- .tablebox .layui-form.layui-border-box.layui-table-view {
- max-height: 760px !important;
- height: auto !important;
- }
- .layui-table-body {
- max-height: 670px !important;
- height: auto !important;
- }
- .layui-table-view .layui-table td {
- cursor: pointer;
- overflow: hidden;
- }
- .link {
- width: 74px;
- height: 24px;
- line-height: 24px;
- background: url(__STATIC__/img/linkBG.gif);
- color: #FFF;
- border-top: 1px solid #A5DFFF;
- border-left: 1px solid A5DFFF;
- border-bottom: 1px solid #63A2DE;
- border-right: 1px solid #63A2DE;
- margin-right: 8px;
- cursor: pointer;
- color: #fff;
- }
- .link a{
- color: #fff;
- }
- .assignbox{
- position: relative;
- top: -44px;
- line-height: 28px;
- width: 50%;
- float: left;
- margin-left: 10px;
- }
- .layui-form-select{
- float: left;
- }
- .layui-form-select .layui-input{
- height: 28px;
- }
- .assignbtn{
- margin-left: 8px;
- cursor: pointer;
- color: #000;
- background: url(__STATIC__/img/btn_bg.gif) repeat-x;
- border: 1px solid #C0C0C0;
- padding: 0 12px;
- *padding: 0 6px;
- height: 28px;
- }
- .searchbox .layui-form-select{float:left;width:130px;}
- .searchbox input{border:1px solid #e6e6e6 !important;}
- .layui-table {
- width: 100% !important;
- }
- </style>
- <body class="clearfix">
- <iframe id="customer_detail" style="display: none;" src=""></iframe>
- <div class="crmbox">
- <form class="layui-form">
- <div class="searchtitlebox">
- <div style="margin-bottom:8px;">您当前的操作 · <b>所有客户</b> · <span class="firstit">分派给我的线索管理</span> </div>
- <div class="searchbox clearfix">
- <div class="selectbox">
- <div class="leftselect">检索:</div>
- <select name="source_id" lay-search>
- <option value="">==客户来源==</option>
- {volist name="soudata" id="vo"}
- <option value="{$vo.id}">{$vo.name}</option>
- {/volist}
- </select>
- <select name="employee_id" lay-search>
- <option value="">==业务员==</option>
- {volist name="employee_list" id="vo"}
- <option value="{$vo.id}">{$vo.name}</option>
- {/volist}
- </select>
- <input class="left searchtext" type="text" autocomplete="off" name="keyname" placeholder="输入关键字....." title="客户名、小区名其中任意一部分" />
- <button class="left searchbtn1" type="button" lay-submit lay-filter="search">搜索</button>
- </div>
- {if $is_manager eq 1}
- <div class="right link">
- <a href="javascript:void(0)">转移客户</a>
- </div>
- {/if}
- </div>
- </div>
- <div class="crmsearchlist">
- <table lay-filter="crmsearchlist" id="crmsearchlist"></table>
- <div class="clearfix assignbox" style="display: none;">
- <div class="left">将选中的线索批量转移至:</div>
- <select class="left" id="employeeid" name="employeeid" lay-search>
- <option value="">==业务员==</option>
- {volist name="assignemp_list" id="vo"}
- {if $vo.id neq $empid}
- <option value="{$vo.id}">{$vo.name}</option>
- {/if}
- {/volist}
- </select>
- <button class="left assignbtn" type="button">执行分派</button>
- </div>
- </div>
- </form>
- </div>
- </body>
- <script src="__LAYUI__/layui/layui.js"></script>
- {/block}{block name="js"}
- <script type="text/html" id="crmname">
- <span data-cid="{{=d.id}}" class="namecid">{{d.name?d.name:'未知'}}</span>
- {{# if(d.jiaoding_time){ }}
- <span class="dingjingorder">定金</span>
- {{# }else{ }}
- {{# } }}
- </script>
- <script type="text/html" id="empname">
- {{# if(d.employee){ }}
- {{d.employee.name}}
- {{# if(d.add_wechat=='是'){ }}
- <span class="addvx">v</span>
- {{# }else{ }}
- {{# } }}
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# if(d.add_wechat=='是'){ }}
- <span class="addvx">v</span>
- {{# }else{ }}
- {{# } }}
- {{# } }}
- </script>
- <script type="text/html" id="square">
- {{# if(d.square>200){ }}
- <span style="font-weight: bold;color: #ff6600;">{{d.square}}</span>
- {{# }else if(d.square){ }}
- <span >{{d.square}}</span>
- {{# }else{ }}
- {{# } }}
- </script>
- <script type="text/html" id="labeltpl">
- {{# if(d.label){ }}
- <span>{{d.label}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="source">
- {{# if(d.source){ }}
- <span>{{d.source.source}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="designer_name">
- {{# if(d.designer){ }}
- <span>{{d.designer.name}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="editbox">
- {{# if(d.state=="待确认"){ }}
- <a style="display:inline-block;" lay-event="edit" href="javascript:void(0);">编辑</a>
- {{# }else { }}
- <a style="display:inline-block;" lay-event="editstate" href="javascript:void(0);">状态</a><span style="padding:0 4px;">/</span><a lay-event="edit" style="display:inline-block;" href="javascript:void(0);">编辑</a>
- {{# } }}
- </script>
- <script type="text/javascript">
- var reload = null, resizefun = null;
- layui.config({
- base: '__LAYUI__/',
- urlbase: '/sys'
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['table', 'laydate'], function () {
- var table = layui.table, laydate = layui.laydate,
- $ = layui.$;
- form = layui.form,
- assignVal = null;
- var field = {};
- form.on('submit(search)', function (data) {
- var source_id = $('[name=source_id]').val();
- var designer_id = $('[name=designer_id]').val();
- var employee_id = $('[name=employee_id]').val();
- var level = $('[name=level]').val();
- var keyname = $('[name=keyname]').val();
- field['level'] = level;
- if (assignVal == 1) {
- field['name'] = keyname;
- field['source_name'] = source_id;
- field['designer_name'] = designer_id;
- field['employee_name'] = employee_id;
- table.reload("crmsearchlist", {
- url: '{:url("community/list")}',
- where: field,
- cols: [[
- { type: 'checkbox', hide: false, event: 'checkdiv',width: 50 },
- ]]
- }, true);
- } else {
- field['keyname'] = keyname;
- field['source_id'] = source_id;
- field['designer_id'] = designer_id;
- field['employee_id'] = employee_id;
- //执行重载
- table.reload('crmsearchlist', {
- where: field
- , page: { curr: 1}
- });
- }
- });
- resizefun = function () {
- table.resize('crmsearchlist');
- };
- reload = function () {
- table.reload('crmsearchlist', { where: field }, true);
- };
- table.render({
- elem: '#crmsearchlist',
- url: '{:url("community/assignment_list")}',
- //even: true,
- cols: [
- [
- { type: 'checkbox', hide:true, event:'checkdiv',width:50 },
- {
- title: '客户姓名',
- field: 'name',
- align: 'center',
- minWidth:170,
- templet: '#crmname',
- },
- {
- title: '小区名称',
- field: 'community_name',
- minWidth:100,
- align: 'center',
- },
- {
- title: '重要级别',
- field: 'level',
- minWidth:100,
- align: 'center',
- },
- {
- title: '面积',
- field: 'square',
- align: 'center',
- minWidth:100,
- templet: '#square'
- },
- {
- title: '所属员工',
- field: 'empname',
- align: 'center',
- minWidth:100,
- templet: '#empname'
- },
- {
- title: '设计师',
- field: 'designer_name',
- align: 'center',
- minWidth:100,
- templet: '#designer_name'
- },
- {
- title: '客户来源',
- field: 'source',
- align: 'center',
- minWidth:100,
- templet: '#source'
- },
- {
- title: '首次见面',
- field: 'fisttime',
- align: 'center',
- minWidth:160,
- },
- {
- title: '报名时间',
- field: 'sign_time',
- align: 'center',
- minWidth: 160,
- },
- {
- title: '交房',
- field: 'jiaofang',
- align: 'center',
- minWidth:100,
- },
- {
- title: '状态',
- field: 'state',
- align: 'center',
- minWidth:100,
- }
- ]
- ],
- page: true,
- limits: [17],
- limit: 17, //每页默认显示的数量,
- height: 'full-120',
- text: '对不起,加载出现异常!',
- done: function (res, curr, count) {
- // res.data.forEach(function (item, index) {
- // // if(item.visit_log_count==0){
- // // $('.layui-table').find('tr[data-index="' + index + '"]').addClass('novisitlog');
- // // }
- // });
- }
- });
- $('.link').on('click',function () {
- $('.firstit').html('可以分派的线索管理');
- table.reload("crmsearchlist", {
- url: '{:url("community/list")}',
- cols: [[
- { type: 'checkbox', hide: false, event: 'checkdiv',width: 50 },
- ]]
- }, true);
- $('.link').hide();
- $('.assignbox').show();
- assignVal = 1;
- })
- var flag = true;
- table.on('tool(crmsearchlist)', function (result) {
- let event = result.event;
- let row = result.data;
- flag = true;
- if(event =='checkdiv'){
- flag = false;
- return false;
- }else if(event === "edit"){
- $.ajax({
- url: '{:url("community/checkCustomer")}'
- , data: {
- id: result.data.id,
- }
- , type: 'post'
- , success: function (rs) {
- if(rs.code==0){
- flag = false;
- window.parent.editcrmsg(result.data.id,'assignment_list.html')
- }else{
- alert(rs.msg)
- }
- }
- })
- return false;
- }else if (event === "editstate") {
- $.ajax({
- url: '{:url("community/checkCustomer")}'
- , data: {
- id: result.data.id,
- }
- , type: 'post'
- , success: function (rs) {
- if(rs.code==0){
- flag = false;
- window.parent.statemsg(result.data.id, 'assignment_list.html');
- }else{
- alert(rs.msg)
- }
- }
- })
- return false;
- }
- })
- $('.crmsearchlist').on('click', 'td', function (e) {
- var _event = $(this).find('[lay-event]').attr('lay-event');
- _event= _event? _event: $(this).attr('lay-event');
- var _obj = table.cache.crmsearchlist[parseInt($(this).parent('tr').attr('data-index'))];
- switch (_event) {
- case 'edit':
- break;
- case 'checkdiv':
- break;
- default:
- $.ajax({
- url: '{:url("community/checkCustomer")}'
- , data: {
- id: _obj.id,
- }
- , type: 'post'
- , success: function (rs) {
- if(rs.code==0){
- flag = true;
- $('#customer_detail')[0].src = "/empcrm/community/addlog.html?cid=" + _obj.id;
- $('.crmbox').addClass('rightbox');
- $('#customer_detail').show();
- resizefun();
- }else{
- alert(rs.msg)
- }
- }
- })
- }
- return false; //阻止事件冒泡
- })
- table.on('row(crmsearchlist)', function (obj) {
- var data = obj.data;
- if (flag) {
- $.ajax({
- url: '{:url("community/checkCustomer")}'
- , data: {
- id: data.id,
- }
- , type: 'post'
- , success: function (rs) {
- if(rs.code==0){
- $('#customer_detail')[0].src="/empcrm/community/addlog.html?cid="+ data.id;
- $('.crmbox').addClass('rightbox');
- $('#customer_detail').show();
- for (let i = 0; i < $('.crmsearchlist .layui-table-view .layui-table-box .layui-table tr').length; i++) {
- $($('.crmsearchlist .layui-table-view .layui-table-box .layui-table tr')[i]).removeClass('onclickbg');
- }
- $(obj.tr).addClass('onclickbg');
- resizefun();
- }else{
- alert(rs.msg)
- }
- }
- })
-
- }
- });
- $('.searchbtn').click(function () {
- window.parent.addcrmmsg('jiaoding_list.html')
- })
- $('.assignbtn').on('click',function(){
- let arr=[];
- for(let i=0;i< $('td div.laytable-cell-checkbox input[type="checkbox"]').length;i++){
- if($('td div.laytable-cell-checkbox input[type="checkbox"]')[i].checked){
- arr.push($($('.namecid')[i]).data("cid"));
- }
- }
- if(arr.length==0){
- alert('亲,别忘了选择要分派的客户')
- return false;
- }
- if(!$('#employeeid').val()){
- alert('亲,别忘了选择客户要转移业务员')
- return false;
- }
- //
- if(confirm("重要提示:确定要分派信息吗?")){
- $.ajax({
- url: '{:url("community/customerTransfer")}'
- , data: {
- customer_ids: arr.join(','),//要分派的客户id, 如果多个以逗号隔开
- employeeid: $('#employeeid').val(),//要分派给谁的员工id
- }
- , type: 'post'
- , success: function (res) {
- if(res.code == 403){
- $(".exitbtn").trigger("click");
- } else {
- alert(res.msg)
- }
- table.reload("crmsearchlist", {
- url: '{:url("community/list")}',
- cols: [[
- { type: 'checkbox', hide: false, event: 'checkdiv', width: 50 },
- ]]
- }, true);
- }
- });
- }
-
- })
- })
- function removealog(params) {
- $('#customer_detail').hide();
- $('.crmbox').removeClass('rightbox');
- }
- </script>
- {/block}
|