123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842 |
- {extend name="public/layout" /}
- {block name="title"}详情{/block}
- {block name="body"}
- <link rel="stylesheet" href="__STATIC__/css/csspc.css">
- <link rel="stylesheet" href="__STATIC__/css/font.css">
- <link rel="stylesheet" " href=" __STATIC__/css/common.css">
- <style type="text/css">
- html,body{
- background: #f5f5f5;
- font-size: 12px;
- padding-bottom: 20px;
- min-width: 900px;
- overflow: auto;
- }
- .toptitbox{
- display: block;
- width: 900px;
- padding: 15px 10px;
- border: 1px solid #F0F0F0;
- background: #FCFCFC;
- margin-bottom: 10px;
- position: relative;
- line-height: 28px;
- }
- .golastbtn{
- display: block;
- margin-right: 21px;
- color: #000;
- background: url(__STATIC__/img/btn_bg.gif) repeat-x;
- border: 1px solid #C0C0C0;
- padding: 0 12px;
- *padding: 0 6px;
- height: 28px;
- cursor: pointer;
- }
- .mainbox{
- display: block;
- width: 900px;
- height:100%;
- padding-top: 20px;
- margin: 0 auto;
- }
- .bodys{
- padding: 10px ;
- background-color: #fff;
- }
- .layui-card {
- box-shadow: unset;
- }
- .layui-fluid{
- padding: 0;
- }
- .layui-card-header {
- border-width: 0px;
- height: auto;
- line-height: auto;
- }
- .titletext {
- display: block;
- font-size: 14px;
- color: #210605;
- font-weight: bold;
- margin-bottom: 20px;
- line-height: 20px;
- }
- .clearfix:after {
- clear: both;
- content: ' ';
- display: table;
- }
- .clearfix:before {
- content: ' ';
- display: table;
- }
- .fleft {
- float: left;
- }
- .fright {
- float: right;
- }
- .contentext {
- font-size: 14px;
- color: #210605;
- line-height: 20px;
- margin-bottom: 12px;
- margin-right: 55px;
- }
- .layui-tab {
- padding-top: 14px;
- }
- .layui-card .layui-tab-brief .layui-tab-title li.layui-this {
- color: #249EFB;
- }
- .layui-tab-brief>.layui-tab-more li.layui-this:after,
- .layui-tab-brief>.layui-tab-title .layui-this:after {
- border-bottom: 4px solid #249EFB;
- }
- .layui-tab-title li {
- margin: 0px 5px;
- font-weight: bold;
- font-size: 14px;
- }
- .allocatenumbox {
- display: block;
- text-align: center;
- background-color: #fff;
- margin: 20px 0;
- box-shadow: 0 0 4px 0 #979797;
- border-radius: 5px;
- font-size: 12px;
- color: #000000;
- }
- .width12_5 {
- width: 10%;
- }
- .bold {
- font-weight: bold;
- }
- .allocatenum {
- line-height: 20px;
- margin-top: 14px;
- }
- .allocatetext {
- margin-top: 2px;
- line-height: 17px;
- margin-bottom: 12px;
- }
- .linebox {
- display: block;
- border-bottom: 1px solid rgba(151, 151, 151, 1);
- margin-bottom: 16px;
- }
- select {
- width: auto;
- padding:0 5px;
- height: 38px;
- background: #f2f2f2;
- text-align: center;
- border: unset;
- /* //1px solid rgba(151,151,151,1) */
- }
- .searchtext {
- display: block;
- border-radius: 0px;
- width:150px;
- border: unset;
- height: 36px;
- padding-left: 14px;
- }
- input.searchtextx {
- display: block;
- width: 150px;
- border-radius: 0px;
- border: unset;
- height: 36px;
- padding-left: 14px;
- }
- .searchbox {
- /* border: 1px solid rgba(151, 151, 151, 1); */
- }
- .searchbox input,.searchbox select{border: 1px solid rgba(151, 151, 151, 0.7);margin-right: 10px;}
-
- .searchBtn {
- border-radius: unset;
- }
- .allocatedbox {
- margin-left: 50px;
- font-size: 14px;
- color: #210605;
- line-height: 40px;
- }
- .unallocatedbox {
- margin-left: 50px;
- font-size: 14px;
- color: #878787;
- line-height: 40px;
- }
- #demo1{width:130px;}
- #demo1 xm-select{border:1px solid #979797;}
- .layui-table-body{
- height: auto !important;
- }
- input{
- width: auto;
- }
- .oneRecyle {
- width: 90px !important;
- height: 30px !important;
- line-height: 30px !important;
- margin-top: 15px;
- margin-right: 19px;
- }
- ::-webkit-scrollbar {
- width: auto;
- height: auto;
- }
-
- ::-webkit-scrollbar-thumb {
- border-radius: 10px;
- -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
- background: #DFDFDF;
- }
-
- ::-webkit-scrollbar-track {
- -webkit-box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2);
- border-radius: 10px;
- background: #f5f5f5;
- }
- </style>
- <body>
- <div class="mainbox">
- <div class="clearfix toptitbox">
- <div class="left">您当前的操作 · <b>资源库分配</b></div>
- <div class="right">
- <div class="left">点击这里返回列表:</div>
- <button class="left golastbtn" type="button">返回列表</button>
- </div>
- </div>
- <div class="bodys wpsr">
- <div class="layui-fluid">
- <div class="layui-card">
- <div class="layui-card-header " id="zyxx">
- <label class="titletext">基本信息</label>
- <div class="clearfix">
- <div class="fleft contentext">资源名称:{$data.name}</div>
- <div class="fleft contentext">渠道来源:{$data.source_name}</div>
- <div class="fleft contentext">导入人员:{$data.employee_name}</div>
- <div class="fleft contentext">资源数:{$data.count}</div>
- <div class="fleft contentext">可分资源:{$data.avaliable_count}</div>
- <div class="fleft contentext">问题客资:{$data.bad_phone_num}</div>
- <!-- <div class="fleft contentext">重复:{$data.repeat_phone_number}</div> -->
- <div class="fleft contentext">分配情况:{$data.state}</div>
- <div class="fleft contentext">已分配:{$data.y_count}</div>
- <div class="fleft contentext">未分配:{$data.new_left_num}</div>
- <div class="fleft contentext">导入时间:{$data.addtime}</div>
- </div>
- </div>
- <div class="layui-tab layui-tab-brief" lay-filter="maintenanceOrder">
- <ul class="layui-tab-title" id="fpxx">
- <!-- handdistribution -->
- <li class="{if condition='$type eq 0'} layui-this {/if}">已分配({$data.y_count})</li>
- <li class="{if condition='$type eq 1'} layui-this {/if}">未分配({$data.new_left_num})</li>
- <li class="{if condition='$type eq 2'} layui-this {/if}">问题客资({$data.bad_phone_num})</li>
- </ul>
- <div class="layui-tab-content">
- <div class="layui-tab-item {if condition='$type eq 0'} layui-show {/if}">
- <div class="clearfix allocatenumbox" id="yxxx">
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.valid}</div>
- <div class="allocatetext">有效线索</div>
- </div>
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.invalid}</div>
- <div class="allocatetext">无效线索</div>
- </div>
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.confirmed}</div>
- <div class="allocatetext">待确认</div>
- </div>
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.arrived_at_the_store}</div>
- <div class="allocatetext">已到店</div>
- </div>
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.measured_room}</div>
- <div class="allocatetext">已量房</div>
- </div>
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.already_present}</div>
- <div class="allocatetext">已到场</div>
- </div>
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.settled}</div>
- <div class="allocatetext">
- 定金
- </div>
- </div>
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.sign_the_bill}</div>
- <div class="allocatetext">
- 合同
- </div>
- </div>
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.unvisit}</div>
- <div class="allocatetext">未联系</div>
- </div>
- <div class="fleft width12_5">
- <div class="bold allocatenum">{$counts.no_connect}</div>
- <div class="allocatetext">未接通</div>
- </div>
- </div>
- <p class="linebox"></p>
- <div class="clearfix" style="margin-bottom: 20px;">
- <div class="fleft clearfix searchbox" style="display:inline-block;">
- <select class="fleft selectbox" name="order" id="order" lay-verify="">
- <option value="1" selected>按部门</option>
- <option value="2">按员工</option>
- </select>
- <input class="fleft searchtext" type="text" id="keyword1" name="title"
- placeholder="请输入部门名称" autocomplete="off">
- <input class="fleft searchtextx" type="text" name="phone" id="keyword3"
- placeholder="小区/手机号" autocomplete="off">
- <div id="demo1" class="xm-select-demo fleft" style="margin-right: 10px;"></div>
-
- <select class="fleft" name="call_state" id="call_state" lay-verify="">
- <option value="" selected>电话联系状态</option>
- <option value="已联系">已联系</option>
- <option value="未联系">未联系</option>
- <option value="未接通">未接通</option>
- </select>
- <button class="fleft layui-btn layuiadmin-btn-useradmin searchBtn" id="search1"
- lay-submit lay-filter="search">搜索</button>
- <button class="fleft layui-btn layuiadmin-btn-useradmin searchBtn" id="search3"
- lay-submit lay-filter="search">回收客户</button>
- </div>
- <br style="clear: both;">
- <div class="fleft allocatedbox" style="margin-left: 0 !important;margin-top:10px;">已分配{$data.y_count}组客户</div>
- <div class="fleft unallocatedbox" style="margin-top:10px;">有{$counts.unvisit}组客户未联系</div>
- <button class="oneRecyle fright layui-btn layuiadmin-btn-useradmin searchBtn" id="search4"
- lay-submit lay-filter="search">一键回收</button>
- </div>
- <table id="table1" lay-filter="table1"></table>
- </div>
- <div class="layui-tab-item {if condition='$type eq 1'} layui-show {/if}">
- <div class="clearfix" style="padding-top: 6px; padding-bottom: 20px;">
- <div class="fleft clearfix searchbox" style="display:inline-block;">
- <input class="fleft searchtextx" type="text" name="phone" id="keyword2"
- placeholder="小区/手机号" autocomplete="off">
- <button class="fleft layui-btn layuiadmin-btn-useradmin searchBtn" id='search2'
- lay-submit lay-filter="search">搜索</button>
- </div>
- <div class="fleft unallocatedbox">{$data.left_num}组客户未分配</div>
- <button class="fright layui-btn layuiadmin-btn-useradmin" id="distribution">分配客户</button>
- </div>
- <table id="table2" lay-filter="table2"></table>
- </div>
- <div class="layui-tab-item {if condition='$type eq 2'} layui-show {/if}">
- <table id="table3" lay-filter="table3"></table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- {/block} {block name="js"}
- <script type="text/html" id="status">
- {{# if(d.state == '无效' || d.state == '待确认'){ }}
- <span style="color: #cccccc;">{{d.state}}</span>
- {{# }else{ }}
- {{# if(d.stateNum.shop > 0){ }}
- <button class="fright layui-btn-min layuiadmin-btn-useradmin" style="color: #FFFFFF; background-color: #CDB8F6 ;border-color: #CDB8F6;">店{{d.stateNum.shop}}</button>
- {{# } }}
- {{# if(d.stateNum.measure > 0){ }}
- <button class="fright layui-btn-min layuiadmin-btn-useradmin" style="color: #FFFFFF; background-color: #FF8383;border-color: #FF8383;">量{{d.stateNum.measure}}</button>
- {{# } }}
- {{# if(d.stateNum.activity > 0){ }}
- <button class="fright layui-btn-min layuiadmin-btn-useradmin" style="color: #FFFFFF; background-color: #FFD483;border-color: #FFD483;">活{{d.stateNum.activity}}</button>
- {{# } }}
- {{# if(d.stateNum.deposit > 0){ }}
- <button class="fright layui-btn-min layuiadmin-btn-useradmin" style="color: #FFFFFF ; background-color: #FFBC83 ;border-color: #FFBC83;">签
- <!-- {{d.stateNum.deposit}} -->
- </button>
- {{# } }}
- {{# if(d.stateNum.signed > 0){ }}
- <button class="fright layui-btn-min layuiadmin-btn-useradmin" style="color: #FFFFFF ; background-color: #FD431B ;border-color: #FFBC83;">转
- <!-- {{d.stateNum.deposit}} -->
- </button>
- {{# } }}
- {{# if(!d.stateNum.shop && !d.stateNum.measure && !d.stateNum.activity && !d.stateNum.deposit && !d.stateNum.signed){ }}
- 已联系
- {{# } }}
- {{# } }}
- </script>
- <script type="text/html" id="employee_name">
- {{# if(d.employee){ }}
- <span>{{d.employee.opt_name}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="designer_name">
- {{# if(d.designer_name){ }}
- <span>{{d.designer_name}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="org_name">
- {{# if(d.org_name){ }}
- <span>{{d.org_name}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="sale_name">
- {{# if(d.sale_name){ }}
- <span>{{d.sale_name}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="name">
- {{# if(d.name){ }}
- <span>{{d.name}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="community_name">
- {{# if(d.community_name){ }}
- <span>{{d.community_name}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="call_num">
- {{# if(d.outcall_count){ }}
- <span style="display: inline-block; width: 100%; height: 100%;cursor: pointer;" data-id="{{d.id}}" lay-event="cuslist_li">{{d.outcall_count}}</span>
- {{# }else{ }}
- <span class='cuslist_li' data-id="{{d.id}}" lay-event="cuslist_li" style="color: #cccccc;display: inline-block; width: 100%;height: 100%;cursor: pointer;">0</span>
- {{# } }}
- </script>
- <script type="text/html" id="allocate_time">
- {{# if(d.employee_time){ }}
- <span>{{d.employee_time}}</span>
- {{# }else{ }}
- <span>{{d.allocate_time}}</span>
- {{# } }}
- </script>
- <script type="text/html" id="op">
- <a class="layui-btn layui-btn-xs " lay-event="recovery">回收</a>
- </script>
- <script type="text/html" id="errortype">
- {{# if(d.type==1){ }}
- <span>手机号格式错误</span>
- {{# }else{ }}
- <span>手机号重复</span>
- {{# } }}
- </script>
- <script type="text/html" id="allocate_time">
- {{# if(d.employee_time){ }}
- <span>{{d.employee_time}}</span>
- {{# }else{ }}
- <span>{{d.allocate_time}}</span>
- {{# } }}
- </script>
- <script src="/static/js/jquery.min.js"></script>
- <script src="__STATIC__/layui/layui/lay/modules/xm-select.js" type="text/javascript" charset="utf-8"></script>
- <script>
- var opoo=null;
- layui.config({
- base: '__LAYUI__/',
- urlbase: '/sys'
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'jquery', 'table', 'tree', 'layer', 'element', 'form', 'laydate'], function () {
- var table = layui.table,
- tree = layui.tree,
- layer = layui.layer,
- $ = layui.jquery,
- element = layui.element,
- laydate = layui.laydate,
- allIds = "",
- form = layui.form;
- var where1 = [];
- var where2 = [];
- var select = [];
- var dtype = "{$type}";
- $('.selectbox').change(function () {
- var val = $('.selectbox').val();
- if (val == 1) {
- $('.searchtext').attr('placeholder', '请输入部门名称');
- } else {
- $('.searchtext').attr('placeholder', '请输入员工姓名');
- }
- });
-
- $('.golastbtn').click(function () {
- window.parent.backresourcefun(window.location.search.split('?')[1], '{:url("manager_emp/read_new")}', 'handdistribution');
- })
- var root_id = '{$root_id}';
- var datas = [
- {name: '待确认', value: '待确认'},
- {name: '有效线索', value: '有效'},
- {name: '已量房', value: '已量房'},
- {name: '已到店', value: '已到店'},
- {name: '已到场', value: '已到场'},
- ];
-
- datas.push({name: '定金', value: '已交定'},{name: '合同', value: '已签单'})
- datas.push({name: '无效', value: '无效'})
- var demo1 = xmSelect.render({
- el: '#demo1',
- data:datas
- })
-
-
- //初始化页面
- var type = 0;
- element.on('tab(maintenanceOrder)', function (data) {
- type = data.index;
- if (type == 0) {
- operate.table1(where1);
- } else if (type == 1) {
- operate.table2(where2);
- } else {
- operate.table3();
- }
- });
- //已分配人员列表
- var operate = {
- table1: function (where) {
- var tableheader = [ //表头
- { type: 'checkbox', fixed: 'left', width: 80},
- { field: 'org_name', title: '部门', minWidth: 150, templet: '#org_name' },
- { field: 'sale_name', title: '销售', minWidth: 150, templet: '#sale_name' },
- { field: 'designer_name', title: '设计师', minWidth: 150, templet: '#designer_name' },
- { field: 'name', title: '客户名称', minWidth: 150, templet: '#name' },
- { field: 'community_name', title: '小区', minWidth: 150, templet: '#community_name' },
- { field: 'allocate_time', title: '分配时间', minWidth: 150,templet: '#allocate_time' },
- { title: '状态', minWidth: 150, templet: '#status' },
- { title: '联系次数', field: 'call_num', minWidth: 150, templet: '#call_num'},
- { templet: '#op', title: '操作', Width: 50, fixed: 'right' }
- ];
- table.render({
- elem: '#table1'
- , url: '{:url("manager_emp/get_customers")}?id=' + "{$id}" + '&pid=' + "{$data.pid}" //数据接口
- , id: 'table1'
- , page: true
- , limit: 10
- , autoSort: false
- , cols: [tableheader]
- , height: 'full-120'
- ,done: function(res) {
- allIds = res.allids;
- console.log(allIds);
- }
- });
- }
- , table2: function (where) {
- var tableheader = [ //表头
- { field: 'name', title: '客户名称', minWidth: 150, templet: '#name' },
- { field: 'community_name', title: '小区', minWidth: 150, templet: '#community_name' },
- { field: 'phone', title: '手机号', minWidth: 100 },
- { type: 'checkbox', fixed: 'right', width: 150 }
- ];
- table.render({
- elem: '#table2'
- , url: '{:url("manager_emp/get_uncustomers")}?id=' + "{$id}" + '&pid=' + "{$data.pid}" //数据接口
- , id: 'table2'
- , page: true
- , limit: 10
- , autoSort: false
- , cols: [tableheader]
- , height: 'full-120'
- });
- }
- , table3:function(where){
- var tableheader = [ //表头
- { field: 'rows', title: '问题行数', minWidth: 150 },
- { field: 'type', title: '失败原因', minWidth: 150, templet: '#errortype' },
- ];
- table.render({
- elem: '#table3'
- , url: '{:url("manager_emp/get_error_customers")}?id=' + "{$id}" //数据接口
- , id: 'table3'
- , page: true
- , limit: 10
- , autoSort: false
- , cols: [tableheader]
- , height: 'full-120'
- });
- }
- };
- if (dtype == 0) {
- operate.table1(where1);
- } else if(dtype == 1) {
- operate.table2(where2);
- } else{
- operate.table3();
- }
- $("#search4").click(function() {
- if (!allIds) {
- layer.msg('没有要回收的数据', { anim: 0, time: 1000 }, function () {});
- return;
- }
- layer.confirm('确定回收所有数据吗?',{title:['信息', 'color:#333333;background-color:#D8E6F1;'],}, function(index){
- layer.close(index);
- var loadingIndex = layer.load('Loading...', {
- shade: [0.6,'#000'] //0.1透明度的白色背景
- });
- var type = $('#order').val();
- var keyword = $('#keyword1').val();
- var keyword3 = $('#keyword3').val();
- var state = $('#state').val();
- var datastr = allIds;
- $.ajax({
- url: '{:url("manager_emp/get_customers")}?id=' + "{$id}",
- type: 'post',
- data: { type: type, keyword: keyword , keyword3: keyword3,state:state ,recovery:1,ids:datastr},
- success: (ress) => {
- $("#fpxx").load(location.href + " #fpxx>*","");
- $("#zyxx").load(location.href + " #zyxx>*","");
- $("#yxxx").load(location.href + " #yxxx>*","");
- layer.close(loadingIndex);
- if (ress.code == 0) {
- operate.table1(where1);
- layer.msg(ress.msg, { anim: 0, time: 1000 });
- resolve(ress.data.src);
- }else if(ress.code == 403){
- $(".exitbtn").trigger("click");
- }else {
- operate.table1(where1);
- layer.msg(ress.msg, { anim: 0, time: 1000 }, function () {});
- }
- },
- });
- });
- })
- //监听table 选中
- table.on('checkbox(table2)', function (obj) {
- select = [];
- //选中的数据
- var selectData = layui.table.checkStatus('table2').data;
- if (selectData.length > 0) {
- for (let i = 0; i < selectData.length; i++) {
- const element = selectData[i];
- select.push(element.id);
- }
- }
- });
- //点击手动分配
- $('#distribution').click(function () {
- var wf = "{$data.left_num}";
- if (wf == 0) {
- layer.msg('没有未分配的客户', { anim: 0, time: 1000 }, function () {
- });
- return false;
- } else if (select.length == 0) {
- layer.msg('请选择要分配的客户', { anim: 0, time: 1000 }, function () {
- });
- return false;
- }
- var id = "{$id}";
- var count = select.length;
- var str = select.join(',');
- window.parent.distributionfun(id, count, str,'{:url("manager_emp/resource")}');
-
-
- //assignCustomerFunc(id, count, str);
- });
-
- //已分配搜索
- $('#search1').click(function () {
- var type = $('#order').val();
- var keyword = $('#keyword1').val();
- var keyword3 = $('#keyword3').val();
- var selectArr = demo1.getValue();
- var strs = [];
- var call_state = $('#call_state').val();
- selectArr.forEach(function(val,index){
- strs.push(selectArr[index].value)
- })
- var state = strs.toString();
- table.reload('table1', {
- where: { type: type, keyword: keyword , keyword3: keyword3,state:state,call_state:call_state}
- });
- });
- //回收客户
- $('#search3').click(function () {
- var checkStatus = table.checkStatus('table1')
- ,data = checkStatus.data; //获得选中的数据
- if(data.length === 0) return layer.msg('请选择要回收的客户', {time: 2000});
- var datastr = '';
- data.forEach(element => {
- datastr += element.id+','
- });
- var type = $('#order').val();
- var keyword = $('#keyword1').val();
- var keyword3 = $('#keyword3').val();
- var state = $('#state').val();
- layer.confirm('确定回收所选客户吗?',{title:['信息', 'color:#333333;background-color:#D8E6F1;'],}, function(index){
- var loadingIndex = layer.load('Loading...', {
- shade: [0.6,'#000'] //0.1透明度的白色背景
- });
- layer.close(index);
- $.ajax({
- url:'{:url("manager_emp/get_customers")}?id=' + "{$id}",
- type: 'post',
- data: { type: type, keyword: keyword , keyword3: keyword3,state:state ,recovery:1,ids:datastr},
- // dataType: 'json',
- success: function (res) {
- if (res.code === 0) {
- layer.msg(res.msg, {anim: 0, time: 1000}, function () {
- //更新列表
- table.reload('table1', {
- where: { type: type, keyword: keyword , keyword3: keyword3,state:state }
- });
- // parent.layui.table.reload('customer_table'); //重载表格
- // parent.layer.close(index); //再执行关闭
- });
- $("#fpxx").load(location.href + " #fpxx>*","");
- $("#zyxx").load(location.href + " #zyxx>*","");
- $("#yxxx").load(location.href + " #yxxx>*","");
- layer.close(loadingIndex);
- } else {
- layer.msg(res.msg, {anim: 6, time: 2000}, function () {
- //更新列表
- table.reload('table1', {
- where: { type: type, keyword: keyword , keyword3: keyword3,state:state }
- });
- // parent.layui.table.reload('customer_table'); //重载表格
- // parent.layer.close(index); //再执行关闭
- });
- layer.close(loadingIndex);
- }
- }
- });
- });
- });
- //未分配搜索
- $('#search2').click(function () {
- var keyword = $('#keyword2').val();
- table.reload('table2', {
- where: { keyword: keyword }
- });
- });
-
- opoo=function(){
- $("#fpxx").load(location.href + " #fpxx>*","");
- $("#zyxx").load(location.href + " #zyxx>*","");
- $("#yxxx").load(location.href + " #yxxx>*","");
- $('.layui-tab-content .layui-tab-item').eq(0).addClass('layui-show');
- $('.layui-tab-content .layui-tab-item').eq(1).removeClass('layui-show');
- operate.table1(where1);
- }
-
-
- table.on('tool(table1)', function (obj) {
- var type = $('#order').val();
- var keyword = $('#keyword1').val();
- var keyword3 = $('#keyword3').val();
- var state = $('#state').val();
- var id = obj.data.id;
- var layEvent = obj.event;
- if(layEvent == 'cuslist_li'){
- window.parent.call_cuslist(id);
- }
- if (layEvent == 'recovery') {
- //回收单个客户
- $.ajax({
- url:'{:url("manager_emp/recovery_customers")}?customer_id=' + id + '&crm_res_id='+"{$id}",
- type: 'post',
- // dataType: 'json',
- success: function (res) {
- if (res.code === 0) {
- layer.msg(res.msg, {anim: 0, time: 1000}, function () {
- //更新列表
- table.reload('table1', {
- where: { type: type, keyword: keyword , keyword3: keyword3,state:state }
- });
- // parent.layui.table.reload('customer_table'); //重载表格
- // parent.layer.close(index); //再执行关闭
- });
- $("#fpxx").load(location.href + " #fpxx>*","");
- $("#zyxx").load(location.href + " #zyxx>*","");
- $("#yxxx").load(location.href + " #yxxx>*","");
- } else {
- layer.msg(res.msg, {anim: 6, time: 2000});
- }
- }
- });
-
-
- }
- });
- });
- </script>
- {/block}
|