| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
- <link href="../css/layer/need/layer.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <link rel="stylesheet" href="../css/addappeal.css" />
- <link rel="stylesheet" href="../js/layui/css/layui.css">
- <title>新增诉求工单</title>
- <style>
- .reflectCategory-wrapper {
- position: relative;
- }
- .reflectCategoryList-wrapper {
- display: none;
- position: absolute;
- top: 38px;
- z-index: 9999;
- line-height: 32px;
- background: #FFF;
- }
- #reflectCategoryList {
- height: 240px;
- background: #FFF;
- border: 1px solid #e5e6e7;
- overflow: auto;
- }
- #reflectCategoryList li {
- padding: 0 10px;
- width: 100%;
- line-height: 32px;
- }
- #reflectCategoryList li:hover {
- background: #00a1cb;
- }
- </style>
- </head>
- <body>
- <div class="wrapper wrapper-content animated fadeInRight">
- <div class="daoHang clearfix">
- <div class="dhLeft">
- <sapn>
- <i class="syIcon"></i>位置:
- <a href="javaScript:;" id="ReIndex">首页</a>>
- <a href="javaScript:;">工单处理</a>>
- <a href="" class="nowPosition">添加工单</a>
- </sapn>
- </div>
- <div class="dhRight">
- <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
- </div>
- </div>
- <div style="padding: 10px;" class="tj_content clearFix">
- <div class="Common">
- <table>
- <tr>
- <th class="Importent">标题:</th>
- <td colspan="7">
- <input id="title" class="form-control" type="text" style="width: 50%;" />
- </td>
- </tr>
- <tr>
- <th class="Importent">内容:</th>
- <td colspan="7">
- <textarea id="content" class="form-control" name="" rows="4" cols=""
- style="width: 100%;"></textarea>
- </td>
- </tr>
- <tr>
- <th>附件上传:</th>
- <td colspan="7">
- <div class="fileBox"></div>
- <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
- style="display: none;">
- <input class="input" type="button" value="上传" id="scwj" />
- <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
- <input type="hidden" id="file" />
- <!--</br>-->
- <span style="color:#FF0000; border: none;">
- (文件格式为png,jpg,mp4,avi,wmv,mp3,pdf,doc,docx,xls,xlsx)
- </span>
- </td>
- </tr>
- <tr>
- <th>处理方式:</th>
- <td colspan="">
- <input type="radio" value="1" name="banli" class="Nows_ radioStyle" />当即办理
- <input checked="true" type="radio" value="0" name="banli" class="Nows_ radioStyle" />网络转办
- <input id="threeWayCall" type="checkbox" value="1" name="" class="Nows_ radioStyle" />三方通话
- </td>
- <th>来电号码密级:</th>
- <td>
- <input class="radioStyle" type="radio" name="mj" id="" value="0" />普通
- <input class="radioStyle" type="radio" name="mj" id="" value="1" checked="checked" />保密
- </td>
- </tr>
- <tr>
- </tr>
- <tr>
- <th class="">来电人:</th>
- <td>
- <input type="text" id="cusname" class="form-control" />
- </td>
- <th>性别:</th>
- <td>
- <select class="form-control" id="cussex">
- <option value="">请选择</option>
- <option value="0">男</option>
- <option value="1">女</option>
- </select>
- </td>
- <th class="Importent">来电号码:</th>
- <td>
- <input type="text" id="cusphone" class="form-control" />
- </td>
- </tr>
- <tr>
- <th>类型:</th>
- <td>
- <select class="form-control" id="type"></select>
- </td>
- <th class="Importent">反映类别:</th>
- <td class="reflectCategory-wrapper">
- <input type="text" id="reflectCategory" class="form-control" autocomplete="off" />
- <div class="reflectCategoryList-wrapper">
- <ul id="reflectCategoryList">
- </ul>
- </div>
- </td>
- <!-- <th class="Importent">反映类别:</th>
- <td style="position: relative">
- <div class="inpBox">
- <input type="text" class="inps" />
- <i class="Cleans fa fa-close"></i>
- <i class="xl xl_one"></i>
- <div class="addTree xlAdd">
- <ul id="addTreeDemo" class="ztree"></ul>
- </div>
- </div>
- <div class="selDpart1">
- <ul id="sponsor"></ul>
- </div>
- </td> -->
- <th class="Importent">紧急程度:</th>
- <td>
- <select class="form-control" id="level">
- <!--<option value="0">选择</option>-->
- <option value="1">普通</option>
- <option value="2">紧急</option>
- </select>
- </td>
- </tr>
- <tr>
- <th>来源:</th>
- <td>
- <select class="form-control" id="source"></select>
- </td>
- <th>自动派单:</th>
- <td>
- <select class="form-control" id="automaticDispatch">
- <option value="">请选择</option>
- <option value="1">是</option>
- <option value="">否</option>
- </select>
- </td>
- <th>回访方式:</th>
- <td>
- <select class="form-control" id="visittype">
- <option value="0">正常回访</option>
- <option value="1">无需回访</option>
- </select>
- </td>
- </tr>
- <!-- <tr>
- <th class="">工单平台:</th>
- <td>
- <select class="form-control" id="pingtai">
- <option value="">请选择</option>
- <option value="0">市工单</option>
- <option value="1">省工单</option>
- </select>
- </td>
- </tr> -->
- <tr class="leaderCharge-wrapper" style="display: none;">
- <th class="">分管领导:</th>
- <td>
- <select class="form-control" id="leaderCharge">
- <option value="">请选择</option>
- <option value="省长">省长</option>
- <option value="市长">市长</option>
- </select>
- </td>
- </tr>
- <tr class="phonetype-wrapper">
- <th class="">电话类别:</th>
- <td>
- <select class="form-control" id="phonetype">
- <option value="">请选择</option>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan="8" style="text-align: center;">
- <div class="btn_box">
- <button class="btns BC">保存</button>
- <button class="btns SavedSubmit">保存并提交</button>
- </div>
- </td>
- </tr>
- <tr class="Nows_box Hidens">
- <th>直办内容:</th>
- <td colspan="7">
- <textarea id="result" class="form-control" name="" rows="3" cols=""
- style="width: 100%;"></textarea>
- <!-- <input type="text" style="width: 100%;" id="result" class="form-control" /> -->
- </td>
- </tr>
- <tr>
- <th>事发区域:</th>
- <td>
- <select class="form-control" id="sourcearea"></select>
- </td>
- <th>乡镇:</th>
- <td>
- <select class="form-control" id="township"></select>
- </td>
- <th>村:</th>
- <td>
- <select class="form-control" id="village"></select>
- </td>
- </tr>
- <tr>
- <th>详细地址:</th>
- <td colspan="3">
- <input id="sourceaddress" class="form-control" type="text" placeholder="输入详细地址"
- style="padding-left: 15px;" />
- </td>
- </tr>
- <tr>
- <th class="Importent"></th>
- <td colspan="7">
- <div style="width:710px">
- <div id="myMap" style="width:100%;height:400px;"></div>
- <input type="hidden" class="store_Lng" value="114.352482" />
- <input type="hidden" class="store_Lat" value="36.103442" />
- </div>
- </td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- <input type="hidden" id="PID" value="" />
- <script src="../js/layui/layui.js"></script>
- <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
- <script src="../css/laydate/laydate.js"></script>
- <script src="../js/adjustHeight.js"></script>
- <script src="../js/zTree/jquery.ztree.core.js"></script>
- <script src="../js/appeal/index1.js"></script>
- <script src="../js/ztreeSelect.js"></script>
- <script>
- var submit;
- $(document).ready(function () {
- QY($("#sourcearea"));
- // 获取乡镇,默认文峰区
- getTownshipVillage($("#township"), 4965);
- LY($("#source"));
- LB($("#type"));
- ZT($("#keys"));
- getPhoneType($("#phonetype"));
- getReactionCategory();
- //当即办理
- $(' input[name="banli"]').change(function () {
- var val = $(this).val();
- if (val == "1") {
- $(".Nows_box").show();
- } else {
- $(".Nows_box").hide();
- }
- })
- $(".BC").click(function () {
- submit = 0;
- Add();
- })
- $('.SavedSubmit').click(function () {
- submit = 1;
- Add();
- })
- //上传附件
- $("#scwj").click(function () {
- $("#upFile").trigger("click");
- })
- $("#upFile").change(function () {
- upload();
- })
- $("#scfj").click(function () {
- // $(".fjnr").text("");
- // $("#scfj").hide();
- })
- $("#reflectCategory").bind("input propertychange", function () {
- $(".layui-dropdown").hide();
- if ($("#reflectCategory").val() == "") {
- $(".reflectCategoryList-wrapper").hide();
- return;
- }
- var debounceGetSearchReactionCategory = debounce(getSearchReactionCategory, 500)
- $(".reflectCategoryList-wrapper").show();
- debounceGetSearchReactionCategory($("#reflectCategory").val())
- })
- $("#reflectCategoryList").on("click", "li", function () {
- $(".reflectCategoryList-wrapper").hide();
- $("#reflectCategory").val($(this).attr("indexName"));
- $("#PID").val($(this).attr("index"));
- });
- });
- //添加工单
- function Add() {
- var threeWayCall;
- var value = $(' input[name="banli"]:checked ').val();
- var content = $("#content").val();
- if ($('#threeWayCall').is(':checked')) {
- threeWayCall = 1;
- } else {
- threeWayCall = 0;
- }
- if (!$("#cusphone").val()) {
- layer.msg("请输入来电号码");
- } else if (!$("#title").val()) {
- layer.msg("请输入标题");
- } else if (!$("#content").val()) {
- layer.msg("请输入内容");
- } else if (!$("#PID").val()) {
- layer.msg("请选择反映类别");
- // } else if (!$("#sourcearea").val()) {
- // layer.msg("请选择事发区域");
- } else if (value == 1 && !$('#result').val()) {
- layer.msg("请输入直办内容");
- // } else if (!$("#township").val()) {
- // layer.msg("请选择乡镇");
- // } else if (!$("#village").val()) {
- // layer.msg("请选择村");
- } else {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
- dataType: 'json',
- async: true,
- beforeSend: function () { //触发ajax请求开始时执行
- $('.BC').attr("disabled", true);
- $('.SavedSubmit').attr("disabled", true);
- $('.BC').text('提交中...');
- $('.SavedSubmit').text('提交中...');
- $(document).off('click', '.BC', Add);
- $(document).off('click', '.SavedSubmit', Add);
- },
- data: {
- cusname: $("#cusname").val(), //=来电人姓名
- cussex: $("#cussex").val(),
- cusphone: $("#cusphone").val().replace(/\s+/g, ""), //=来电人电话
- email: $("#email").val(),
- zipcode: $("#zipcode").val(),
- conphone: $("#conphone").val(),
- title: $("#title").val(),
- content: $("#content").val(),
- files: $("#file").val(), //(多个用英文逗号,隔开)
- sourcearea: $("#sourcearea").val(), //=事发地域id
- township: $("#township").val(), // 乡镇
- village: $("#village").val(), // 村
- sourceaddress: $('#sourceaddress').val(), //=事发详细地址
- longitude: $('.store_Lng').val(),
- latitude: $('.store_Lat').val(),
- source: $("#source").val(), //=来源
- splituser: $("#leaderCharge").val(), // 分管领导
- isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
- business: threeWayCall,
- result: $('#result').val(),
- keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开)
- type: $("#type").val(), //=类型
- isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
- level: $('#level').val(), //=(1普通2紧急)
- visittype: $("#visittype").val(), // 回访方式
- issubmit: submit, //=(0保存1保存并提交)
- phonetype: $("#source").val() === "1" ? $("#phonetype").val() : "", // 电话类别
- ispd: $("#automaticDispatch").val() === "1" ? "1" : "", // 自动派单
- // pingtai: $("#pingtai").val(), // 工单平台
- token: $.cookie("token")
- },
- success: function (data) {
- $('.BC').attr("disabled", false);
- $('.SavedSubmit').attr("disabled", false);
- $('.BC').text('保存');
- $('.SavedSubmit').text('保存并提交');
- $(document).on('click', '.BC', Add);
- $(document).on('click', '.SavedSubmit', Add);
- Clean();
- $('.fileBox').html('');
- layer.msg("创建工单成功");
- }
- });
- }
- }
- //上传文件
- function upload() {
- var Files = document.getElementById("upFile").files;
- console.log(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"));
- var typeName = Files[0].name.split('.')[1];
- if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName ==
- 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' ||
- typeName == 'xls' || typeName == 'xlsx') {
- $.ajax({
- url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
- type: "POST",
- data: formData,
- /**
- *必须false才会自动加上正确的Content-Type
- */
- contentType: false,
- /**
- * 必须false才会避开jQuery对 formdata 的默认处理
- * XMLHttpRequest会对 formdata 进行正确的处理
- */
- processData: false,
- success: function (result) {
- document.getElementById("upFile").outerHTML = document.getElementById("upFile")
- .outerHTML;
- $("#upFile").change(function () {
- upload();
- });
- var r = $.parseJSON(result);
- if (r.state.toLowerCase() == "success") {
- var a = r.data;
- $(a).each(function (i, n) {
- var strs = '<span class="files" fiel-num="' + n.F_FileId +
- '">' + n.F_FileName.substring(19) +
- '<i class="fa fa-remove del_file"></i></span>'
- $(strs).appendTo($('.fileBox')).find('.del_file').click(
- function (event) {
- event.stopPropagation();
- $(this).parent().remove();
- file_num()
- })
- })
- file_num();
- }
- }
- });
- } else {
- layer.msg("格式不正确");
- }
- } else {
- layer.confirm('请上传文件!', {
- btn: ['确定']
- });
- }
- }
- //上传文件隐藏域值
- function file_num() {
- var str = '';
- var Str;
- $('.fileBox .files').each(function (j, m) {
- var aa = $(m).attr("fiel-num")
- console.log(aa);
- str += aa + ",";
- Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
- })
- $("#file").val(Str);
- }
- //来源
- function LY(obj) {
- obj.empty();
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
- dataType: "json",
- async: true,
- data: {
- "token": $.cookie("token"),
- id: 1
- },
- success: function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
- .appendTo(obj);
- })
- }
- obj.val("1")
- }
- });
- }
- //类别
- function LB(obj) {
- obj.empty();
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
- dataType: "json",
- async: true,
- data: {
- "token": $.cookie("token"),
- id: 2
- },
- success: function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
- .appendTo(obj);
- })
- }
- }
- });
- }
- // 主题
- function ZT(obj) {
- obj.empty();
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
- dataType: "json",
- async: true,
- data: {
- "token": $.cookie("token"),
- type: 1,
- id: 3
- },
- success: function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
- .appendTo(obj);
- })
- }
- }
- });
- }
- //区域
- function QY(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Area/GetAreaListById",
- dataType: "json",
- async: true,
- data: {
- "token": $.cookie("token"),
- },
- success: function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- if (n.F_AreaName !== "市区") {
- if (n.F_AreaName === "文峰区") {
- $("<option value='" + n.F_AreaId + "' selected='selected'>" + n
- .F_AreaName + "</option>").appendTo(obj);
- } else {
- $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
- "</option>").appendTo(obj);
- }
- }
- })
- }
- }
- });
- }
- //获取乡镇、村
- function getTownshipVillage(obj, parentid) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(
- huayi.config.callcenter_url + "Area/GetAreaChildren", {
- token: $.cookie("token"),
- parentid: parentid
- },
- function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(
- obj);
- });
- }
- }
- );
- }
- // 获取乡镇
- $("#sourcearea").change(function () {
- getTownshipVillage($("#township"), $("#sourcearea").val())
- })
- // 获取村
- $("#township").change(function () {
- getTownshipVillage($("#village"), $("#township").val())
- })
- //电话类别
- function getPhoneType(obj) {
- obj.empty();
- $.ajax({
- type: "get",
- url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
- dataType: "json",
- async: true,
- data: {
- "token": $.cookie("token"),
- id: 2498,
- },
- success: function (data) {
- if (data.state.toLowerCase() == "success") {
- var content = data.data;
- $(content).each(function (i, n) {
- $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
- .appendTo(obj);
- })
- }
- }
- });
- }
- $("#source").change(function () {
- if ($("#source").val() === "4") {
- $(".leaderCharge-wrapper").show()
- $(".phonetype-wrapper").hide()
- } else if ($("#source").val() === "1") {
- $(".leaderCharge-wrapper").hide()
- $(".phonetype-wrapper").show()
- } else {
- $(".leaderCharge-wrapper").hide()
- $(".phonetype-wrapper").hide()
- }
- })
- function Clean() {
- $("#cusname").val(''); //=来电人姓名
- $("#cussex").val('');
- $("#cusphone").val(''); //=来电人电话
- $("#email").val('');
- $("#zipcode").val('');
- $("#conphone").val('');
- $("#title").val('');
- $("#content").val('');
- $("#sourcearea").val(); //=事发地域id
- $("#township").val(); // 乡镇
- $("#village").val(); // 村
- $('#sourceaddress').val(''); //=事发详细地址
- $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
- $("#type option:first").prop("selected", 'selected');
- $("#level option:first").prop("selected", 'selected');
- $("#visittype option:first").prop("selected", "selected");
- $("#keys option:first").prop("selected", 'selected');
- $('#result').val('');
- $(".inps").val('');
- $("#PID").val('');
- $("#reflectCategory").val("");
- $(".Cleans").hide();
- $('#threeWayCall').attr('checked', false);
- $("#file").val('');
- }
- function getReactionCategory(pid = 38) {
- $.get(
- huayi.config.callcenter_url + "Dictionary/GetZTreeNew", {
- token: $.cookie("token"),
- pid: pid,
- // pid: 2460,
- },
- function (result) {
- result = $.parseJSON(result);
- var content = JSON.parse(result.data);
- var content = result
- layui.use("dropdown", function () {
- var dropdown = layui.dropdown;
- dropdown.render({
- elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
- data: content,
- id: "reflectCategory",
- //菜单被点击的事件
- click: function (obj) {
- $("#reflectCategory").val(obj.title)
- $("#PID").val(obj.id)
- },
- });
- });
- }
- );
- }
- function getSearchReactionCategory(key) {
- $.get(
- huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
- token: $.cookie("token"),
- key: key,
- },
- function (result) {
- result = $.parseJSON(result);
- if (result.state.toLowerCase() === "success") {
- $("#reflectCategoryList").empty();
- var content = result.data;
- if (content.length > 0) {
- content.forEach(function (e, i) {
- $("<li index='" + e.id + "' indexName='" + e.name + "'>" + e.names +
- "</li>")
- .appendTo("#reflectCategoryList");
- });
- } else {
- $("<li index='' indexName=''>没有相关数据</li>").appendTo("#reflectCategoryList");
- }
- }
- }
- );
- }
- function debounce(fun, delay) {
- return function (args) {
- var that = this;
- var _args = args
- clearTimeout(fun.id)
- fun.id = setTimeout(function () {
- fun.call(that, _args)
- }, delay)
- }
- }
- </script>
- </body>
- </html>
|