如何解决如何为员工进行数字统计
我想对公司现有员工的通话次数进行统计。我尝试了很多方法,但都失败了。
我编写了这段代码,但是没有用
<table id="employeeTable" class="table table-striped table-bordered" style="width:100%"> <thead> <tr> <th>ID</th> <th>Customer Name</th> <th>Customer Phone</th> <th>Employee Name</th> <th>Call Type</th> <th>Name</th> <th>Count Of Employee Calls</th> </tr> </thead> </table> <link href="https://cdn.datatables.net/1.10.15/css/dataTables.bootstrap.min.css" rel="stylesheet" /> <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" /> @section scripts{ <script src="//cdn.datatables.net/1.10.15/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/1.10.15/js/dataTables.bootstrap.min.js"></script> <script type="text/javascript"> var Popup,dataTable; $(document).ready(function () { dataTable = $("#employeeTable").DataTable({ "ajax": { "url": "/Employee/GetData","type": "GET","datatype": "json",success: function (data) { let employeeArray = data; const uniqueEmployees = [...new Set(employeeArray.map(obj => obj.EmployeeName))].map((EmployeeName) => { return { "EmployeeName": Name } }); uniqueEmployees.forEach((value,index) => { let count = employeeArray.filter((obj) => { return obj.EmployeeName == value.EmployeeName }).length; Object.assign(uniqueEmployees[index],{ "countOfEmployeeCalls": count,"EmployeeName": index + 1 }); }) } },"columns": [ { "data": "IDcall","name": "IDcall","autoWidth": true },{ "data": "CustomerName","name": "CustomerName",{ "data": "CustomerPhone","name": "CustomerPhone",{ "data": "EmployeeName","name": "EmployeeName",{ "data": "CallType","name": "CallType",{ "data": "Name","name": "Name",{ "data": "countOfEmployeeCalls","name": "Count Of Employee Calls",],"orderable": false,"searchable": false,"width": "150px","language": { "emptyTable": "No data found,Please click on <b>Add New</b> Button" } }); }); </script> }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。