| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.http.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link rel="stylesheet" href="../css/jquery-ui.css" />
- <link rel="stylesheet" href="../css/tpkerjqui.css" />
- <link rel="stylesheet" href="../css/timePicker.css" />
- <link rel="stylesheet" href="../css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css">
- <link rel="stylesheet" href="../css/stty.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <link rel="stylesheet" href="../js/select2/css/select2.min.css" />
- <title>添加任务</title>
- <style>
- .page-title {
- padding: 0px;
- font-size: 16px;
- font-weight: bold;
- letter-spacing: -1px;
- display: block;
- color: #1570A6;
- margin: 20px 0px 15px 0px;
- }
- hr {
- margin: 20px 0;
- border: 0;
- border-top: 1px solid #E0DFDF;
- border-bottom: 1px solid #FEFEFE;
- }
- .bj-title {
- color: #ffffff;
- background-color: #1ab394;
- padding: 8px 35px 8px 14px;
- text-shadow: 0 1px 0 rgba(179, 142, 142, 0.5);
- border: 1px solid #e5e5e5;
- }
- .bjCon table th {
- padding: 5px 8px 5px 0;
- text-align: right;
- width: 30%;
- }
- .bjCon table td {
- padding: 6px 0 5px 10px;
- text-align: left;
- color: #717171;
- line-height: 200%;
- position: relative;
- }
- .bjCon table td input {
- border: 1px solid #e5e5e5;
- width: 240px;
- outline: 0;
- margin-right: 5px;
- padding-left: 10px;
- }
- .bjCon table td select {
- width: 240px;
- background-color: #ffffff;
- background-image: none !important;
- filter: none !important;
- border: 1px solid #e5e5e5;
- outline: none;
- height: 34px !important;
- line-height: 30px;
- margin-right: 5px;
- padding-left: 10px;
- }
- .bjCon {
- padding-top: 20px;
- border: 1px solid #e5e5e5;
- border-top: 0;
- }
- .bjright table td input {
- padding-left: 30px;
- }
- .tub {
- position: absolute;
- left: 18px;
- top: 13px;
- font-size: 18px;
- color: #ccc;
- }
- .ui-datepicker.ui-widget-content {
- background: none !important;
- background-color: #eee !important;
- }
- .ui-widget-header .ui-icon {
- background-image: url(../img/ui-icons_444444_256x240.png) !important;
- }
- .box {
- width: 55%;
- margin: 0 auto;
- margin-top: 5%;
- }
- .box .btop {
- height: 35px;
- background: #1ab394;
- color: #fff;
- line-height: 35px;
- padding: 0 15px;
- /* margin-bottom: 15px; */
- }
- .btl {
- float: left;
- margin: 0;
- }
- .btr {
- float: right;
- margin: 0;
- cursor: pointer;
- }
- .boxCon {
- width: 100%;
- min-height: 400px;
- background: #fff;
- text-align: center;
- padding: 10px 15px;
- height: auto;
- overflow-y: scroll;
- }
- .model {
- position: fixed;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- height: 100%;
- width: 100%;
- background: rgba(0, 0, 0, 0.48);
- z-index: 100;
- display: none;
- }
- .tab-content {
- text-align: left;
- height: 260px;
- overflow-y: auto;
- }
- .checkbox label {
- padding-right: 15px;
- }
- .drfs {
- display: none;
- }
- #import_from_excel table {
- margin: 20px auto;
- width: 100%;
- text-align: center;
- }
- #import_from_excel table thead th,
- #import_from_excel table tbody td {
- text-align: center;
- }
- .select_ {
- width: 150px;
- background-color: #FFF;
- background-image: none;
- border: 1px solid #ccc;
- border-radius: 1px;
- color: inherit;
- padding: 6px 12px;
- outline: none;
- vertical-align: middle;
- margin-top: 20px;
- margin-right: 20px;
- }
- #import_from_excel table thead th {
- width: 10%;
- }
- </style>
- </head>
- <body>
- <form class="container-fluid" enctype="multipart/form-data">
- <div class="page-title">
- 添加任务
- </div>
- <hr />
- <div class="row-fluid clearfix">
- <div class="bjleft col-md-6">
- <div class="bj-title">
- <i class="fa fa-user"></i> 基本信息
- </div>
- <div class="bjCon">
- <table style="width: 100%;">
- <tr>
- <th>任务名称:</th>
- <td><input type="text" class="taskName" name="name" /><span>(必填)</span></td>
- </tr>
- <tr>
- <th>任务所属:</th>
- <td>
- <select name="deptid" id="department" class="x-color select usercode"></select><span>(必填)</span>
- </td>
- </tr>
- <tr>
- <th>问卷设置:</th>
- <td>
- <select name="pagerid" id="pager"></select><span>(必填)</span>
- </td>
- </tr>
- <tr>
- <th>计划页面设置:</th>
- <td>
- <a class="fa fa-pencil " id='Plan'>设置</a>
- </td>
- </tr>
- <tr>
- <th>被叫号码:</th>
- <td>
- <button class="btns set_called" style="padding: 3px 10px;" type="button"><i class="fa fa-wrench" style="margin-right: 5px;"></i>设置</button>
- <span class="drfs" style="background-color: #ed4e2a;font-size: 12px;padding: 0 3px;margin-left: 5px;color: #fff;"></span>
- <input type="hidden" name="importtype" value="" id="importtype" />
- <input type="hidden" name="type" value="1" id="type" />
- </td>
- </tr>
- </table>
- <br />
- <br />
- </div>
- </div>
- </div>
- <input type="hidden" name="tempid" value="" id="tempid" />
- <input type="hidden" name="token" value="" id="token" />
- <p style="text-align: center; padding: 20px 0;">
- <button class="btns sureCun" type="button">保存</button>
- <button class="btns return" type="button">取消</button>
- </p>
- <!--设置被叫号码-->
- <div class="model addCall">
- <div class="box">
- <div class="btop clearfix">
- <p class="btl">设置被叫号码</p>
- <p class="btr addcbtr"><i class="fa fa-remove"></i></p>
- </div>
- <div class="boxCon">
- <ul class="nav nav-tabs" role="tablist">
- <li class="active"><a href="#import_from_file" role="tab" data-toggle="tab"><i class="fa fa-file"></i>文件导入</a></li>
- <li><a href="#import_from_hmd" role="tab" data-toggle="tab"><i class="fa fa-table"></i>号段</a></li>
- <li><a href="#import_from_telnos" role="tab" data-toggle="tab"><i class="fa fa-reorder"></i>号码列表</a></li>
- <li><a href="#import_from_excel" role="tab" data-toggle="tab"><i class="fa fa-file"></i>EXCEL导入</a></li>
- <!--<li><a href="#import_from_excel" role="tab" data-toggle="tab"><i class="fa fa-sticky-note"></i>Excel导入</a></li>-->
- </ul>
- <div class="tab-content">
- <div class="tab-pane fade active in" id="import_from_file">
- <br />
- 支持的文本文件格式,每行一个号码,最多10万个号码:
- <br />
- <br />
- <input type="file" name="fileField" id="fileField" placeholder="号码列表" />
- </div>
- <div class="tab-pane fade" id="import_from_hmd">
- <br />
- 支持的文本文件格式,每行一个号码,最多10万个号码:
- <br />
- <br />
- <textarea class="haoDuan" name="phonestr" rows="7" style="width: 100%; resize: none;"></textarea>
- </div>
- <div class="tab-pane fade" id="import_from_telnos">
- <br />
- 每行一个号码,最多支持5万个号码:
- <br />
- <br />
- <textarea class="haomaList" name="phonelist" rows="7" style="width: 100%;resize: none;"></textarea>
- </div>
- <div class="tab-pane fade in" id="import_from_excel">
- <br />
- 支持的excel文件格式,每行一个号码,最多10万个号码:
- <br />
- <br />
- <input type="file" name="fileExcel" id="fileExcel" style="display: none;" accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel,application/x-xls,application/x-xlsx" />
- <input type="button" value="上传Excel文件" id="upFileExcel" />
- <span class="excelName"></span>
- <!--周一添加select-->
- <div id="select_in">
- </div>
- <input type="hidden" id="filepath" name="filepath" value="" />
- <input type="hidden" id="selectids" name="selectids" value="" />
- <table border="1" cellspacing="2" cellpadding="2" bordercolor="#ccc">
- <thead>
- <tr id="excelHead"></tr>
- </thead>
- <tbody id="excelBody">
- <tr>
- <td colspan="3">暂时没有数据,请选择文件加载数据。</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="check" style="text-align: left;padding-left: 25px;">
- <div class="checkbox checkbox-warning checkbox-inline">
- <input id="ag" type="checkbox" name="checkfilter1">
- <label for="ag">过滤Excel中重复号码</label>
- </div>
- <div class="checkbox checkbox-warning checkbox-inline">
- <input id="nag" type="checkbox" name="checkfilter2">
- <label for="nag">过滤三个月内外呼回访的号码</label>
- </div>
- </div>
- <div style="text-align: right;"><button class="btns queren" type="button">确认</button></div>
- </div>
- </div>
- </div>
- </form>
- <script src="../js/jquery-ui.js"></script>
- <script src="../js/timePicker.js"></script>
- <!--<script src="../js/ajaxfileupload.js"></script>-->
- <script src="../js/jquery.form.min.js"></script>
- <script src="../js/select2/js/select2.min.js"></script>
- <script>
- var token = $.cookie("token");
- $('#token').val(token);
- var ImportType;//号码导入方式
- var haoma;
- $(document).ready(function () {
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Questionnaire/GetAllPagerInfo",
- async: true,
- dataType: 'json',
- data: {
- token: token
- },
- success: function (data) {
- var con = data.data;
- $('#pager').append('<option value="0">请选择</option>');
- $(con).each(function (i, n) {
- $('#pager').append('<option value="' + n.id + '">' + n.name + '</option>');
- })
- }
- });
- //部门下拉数据
- $("#department").select2({
- width: 'resolve',
- minimumResultsForSearch: -1,
- ajax: {
- type: "get",
- url: huayi.config.callcenter_url + "Department/GetDeptListForReport",
- async: true,
- dataType: "json",
- data: function (params) {
- return {
- token: $.cookie("token"),
- pid: params.id,
- text: "当前用户所属部门"
- }
- },
- processResults: function (data) {
- return {
- results: data.data
- }
- },
- cache: true
- },
- placeholder: "请选择",
- });
- });
- $('.set_called').click(function () {
- $('.addCall').show()
- })
- $('.addcbtr').click(function () {
- $('.addCall').hide();
- })
- $('.sureCun').click(function () {
- if ($('.taskName').val() == '') {
- layer.confirm('请输入任务名称!', {
- btn: ['确定']
- });
- return;
- } else {
- $(".container-fluid")
- .attr("method", "post")
- .attr("action", huayi.config.callcenter_url + "CallPlan/CreateOrUpdate")
- .attr("enctype", "multipart/form-data");
- $(".container-fluid").ajaxSubmit({
- dataType: "json",
- success: function (res) {
- if (res.state == "success") {
- top.$("iframe:visible")[0].src = "clickcall/callplanlist.html?token=" + token;
- } else {
- layer.msg(res.message);
- }
- }
- });
- }
- })
- $('.return').click(function () {
- top.$("iframe:visible")[0].src = "clickcall/callplanlist.html";
- })
-
- $('.queren').click(function () {
- $('.drfs').show();
- if ($('#import_from_file').hasClass('active')) {
- ImportType = 1;//文件导入
- $('.drfs').html('选择从文件导入');
- } else if ($('#import_from_hmd').hasClass('active')) {
- ImportType = 3;//号段导入
- haoma = $('.haoDuan').val();
- $('.drfs').html('选择从号段导入');
- } else if ($('#import_from_telnos').hasClass('active')) {
- ImportType = 2;//号码列表导入
- haoma = $('.haomaList').val();
- $('.drfs').html('选择从号码列表导入');
- } else if ($('#import_from_excel').hasClass('active')) {
- ImportType = 4;//文件导入
- $('.drfs').html('选择从EXCEL文件导入');
- }
- console.log(ImportType);
- $("#importtype").val(ImportType);
- $('.addCall').hide();
- })
- //上传EXCEL文件
- $("#upFileExcel").click(function () {
- $("#fileExcel").trigger("click")
- .change(function () {
- upload();
- });
- });
- //上传文件
- function upload() {
- var Files = document.getElementById("fileExcel").files;
- if (Files.length > 0) {
- var formData = new FormData();
- for (var i = 0; i < Files.length; i++) {
- formData.append('file' + i, Files[i]);
- }
- formData.append("token", $.cookie("token"));
- $.ajax({
- url: huayi.config.callcenter_url + "/CallPlan/ImportData",
- type: "POST",
- data: formData,
- /**
- *必须false才会自动加上正确的Content-Type
- */
- contentType: false,
- /**
- * 必须false才会避开jQuery对 formdata 的默认处理
- * XMLHttpRequest会对 formdata 进行正确的处理
- */
- processData: false,
- success: function (result) {
- document.getElementById("fileExcel").outerHTML = document.getElementById("fileExcel").outerHTML;
- $("#fileExcel").change(function () {
- upload();
- });
- var r = $.parseJSON(result);
- if (r.state.toLowerCase() == "success") {
- var excelData = r.data;
- var excelfileName = excelData.filepath;
- var selectsLength = excelData.heads.length;
- $('#import_from_excel .excelName').html(Files[0].name);//文件名称
- $('#filepath').val(excelfileName);
- getFields(selectsLength);
- //加载表头
- $('#excelHead').html('');
- for (var x = 0; x < selectsLength; x++) {
- $('#excelHead').append('<th>' + excelData.heads[x] + '</th>');
- $('#noData').css('display', 'none');
- }
- //加载表格内容
- $('#excelBody').html('');
- for (var i = 0; i < excelData.items.length; i++) {
- var tr = $('<tr></tr>');
- $('#excelBody').append(tr);
- for (var l = 0; l < selectsLength; l++) {
- var excelHtml = '<td>' + excelData.items[i][l] + '</td>';
- tr.append(excelHtml);
- }
- }
- }
- }
- });
- } else {
- layer.confirm('请上传文件!', {
- btn: ['确定']
- });
- }
- }
- //获取字段
- function getFields(sLength) {
- $.getJSON(huayi.config.callcenter_url + "ExcelTmp/GetSelectedList", {
- taskid: -1,
- tempid: $('#tempid').val(),
- "token": token
- }, function (result) {
- if (result.state.toLowerCase() == "success") {
- selectlists = result.data;
- if ($(selectlists)) {
- //根据表头列数加载字段
- $('#select_in').html('');
- $('#selectids').val('');
- for (var j = 0; j < sLength; j++) {
- var jcount = j + 1;
- $('#select_in').append('<span><select name="select_' + j + '" id="select_' + j + '" class="select_"></select></span>');
- $('#select_in select:eq(' + j + ')').append('<option data-selectId="" value="0">请选择字段' + jcount + '</option>');
- }
- $(selectlists).each(function (k, selectCon) {
- $('#select_in select').append('<option data-selectId="' + selectCon.id + '" value="' + selectCon.name + '">' + selectCon.name + '</option>');
- });
- var oldVal = "";
- $('#select_in select').each(function () {
- if ($(this).find("option:selected")) {
- var _thisVal = $(this).find('option:selected').val();
- oldVal = $(this).attr("old", _thisVal)
- $('#select_in select').parent().siblings("span").find("option[value=" + _thisVal + "]").not("option[value=0]").hide()
- }
- })
- $("#select_in select").change(function () {
- oldVal = $(this).attr("old");
- var _thisVal = $(this).find('option:selected').val();
- var id = $(this).attr("id");
- $(this).parent().siblings("span").find("option[value=" + _thisVal + "]").not("option[value=0]").hide();
- $(this).parent().siblings("span").find("option[value=" + oldVal + "]").show();
- $(this).find("option[value=" + oldVal + "]").show();
- $(this).attr("old", _thisVal)
- var selectids = '';
- for (var m = 0; m < sLength; m++) {
- var selectid = $("#select_in select:eq(" + m + ")").find('option:selected').attr('data-selectId');
- selectids += selectid + ',';
- }
- $('#selectids').val(selectids.substring(0, selectids.length - 1));
- });
- }
- }
- });
- }
- //编辑页面跳转
- $("#Plan").click(function () {
- layer.open({
- type: 2,
- content: "../autoCall/Plan.html?wid=", //iframe的url,no代表不显示滚动条
- title: '页面设置',
- area: ['75%', '80%'], //宽高
- });
- })
- </script>
- </body>
- </html>
|