| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401 |
- <!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 href="../css/layer/need/layer.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <title>新增诉求工单</title>
- <style type="text/css">
- .input {
- background-color: #FFF;
- background-image: none;
- border: 1px solid #ccc;
- border-radius: 1px;
- color: inherit;
- padding: 6px 12px
- }
-
- .fjnr {
- padding: 0!important;
- border: none!important;
- }
- </style>
- </head>
- <body>
- <div class="wrapper wrapper-content animated fadeInRight">
- <div style="padding: 10px;" class="tj_content clearFix">
- <div class="Common">
- <table>
- <tr>
- <th class="Importent">姓名:</th>
- <td>
- <input type="text" id="cusname" />
- </td>
- <th>性别:</th>
- <td>
- <select class="select_">
- <option value="">请选择</option>
- <option value="0">男</option>
- <option value="1">女</option>
- </select>
- </td>
- <th>来源:</th>
- <td>
- <select class="select_" id="source">
- </select>
- </td>
- <th class="Importent">投诉电话:</th>
- <td>
- <input type="text" id="cusphone" />
- </td>
- </tr>
- <tr>
- <th>邮箱:</th>
- <td>
- <input type="text" id="email" />
- </td>
- <th>邮编:</th>
- <td>
- <input type="text" id="zipcode" />
- </td>
- <th>联系电话:</th>
- <td>
- <input type="text" id="conphone" />
- </td>
- </tr>
- <tr>
- <th class="Importent">标题:</th>
- <td colspan="7">
- <input id="title" type="text" style="width: 100%;" />
- </td>
- </tr>
- <tr>
- <th class="Importent">内容:</th>
- <td colspan="7">
- <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%;"></textarea>
- </td>
- </tr>
- <tr>
- <th>事件地址:</th>
- <td colspan="7">
- <select class="select_" id="sourcearea">
- </select>
- <input id="sourceaddress" type="text" placeholder="输入详细地址" style="width:66%" />
- </td>
- </tr>
- <tr>
- <th>附件上传:</th>
- <td colspan="7">
- <!--<input type="text" placeholder="输入附件详情" style="width:66%" />-->
- <span class="fjnr"></span>
- <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" />
- <span style="color:#FF0000; border: none;">
- (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
- </span>
- </td>
- </tr>
- <tr>
- <th>处理方式:</th>
- <td colspan="7">
- <input type="radio" value="1" name="banli" class="Nows" />当即办理
- <input checked="true" type="radio" value="0" name="banli" class="Nows_" />网络转办
- </td>
- </tr>
- <tr class="Nows_box Hidens">
- <th>办理内容:</th>
- <td colspan="7">
- <input type="text" style="width: 100%;" id="result" />
- </td>
- </tr>
- <tr>
- <th class="Importent">主题词:</th>
- <td>
- <!--<input id="keys" type="text" placeholder="输入主题词" style="width:100%" />-->
- <select class="select_" id="keys">
- <option value=""></option>
- </select>
- </td>
- <th>类型:</th>
- <td>
- <select class="select_" id="type">
- </select>
- </td>
- <th>密级:</th>
- <td>
- <input checked="true" type="radio" name="mj" id="" value="0" />普通
- <input type="radio" name="mj" id="" value="1" />保密
- </td>
- <th>紧急程度:</th>
- <td>
- <select class="select_" id="level">
- <option value="">选择</option>
- <option value="0">普通</option>
- <option value="1">紧急</option>
- </select>
- </td>
- <!--<th class="">分管领导:</th>
- <td colspan="4">
- <input id="splituser" type="text" placeholder="" style="width:100%" readonly="readonly" />
- </td>-->
- </tr>
- </table>
- <div class="btn_box">
- <button class="btns BC">保存</button>
- </div>
- </div>
- </div>
- </div>
- <script src="../css/laydate/laydate.js"></script>
- <script src="../js/adjustHeight.js"></script>
- <script>
- var wid = helper.request.queryString("wid");
- var submit;
- $(document).ready(function() {
- QY($("#sourcearea"));
- LY($("#source"));
- LB($("#type"));
- ZT($("#keys"))
- //当即办理
- $(".Nows").click(function() {
- $(".Nows_box").toggle();
- })
- $(".Nows_").click(function() {
- $(".Nows_box").toggle();
- })
- $(".BC").click(function() {
- submit = 0;
- Add()
- });
- //上传附件
- $("#scwj").click(function() {
- $("#upFile").trigger("click");
- })
- $("#upFile").change(function() {
- upload();
- })
- $("#scfj").click(function() {
- $(".fjnr").text("");
- $("#scfj").hide();
- })
- if(wid) {
- $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrder', {
- workorderid: wid,
- "token": $.cookie("token")
- }, function(result) {
- if(result.state.toLowerCase() == "success") {
- var Data = result.data.data;
- $("#cusname").val(Data[0].F_CusName);
- $("#cusphone").val(Data[0].F_CusPhone);
- $("#conphone").val(Data[0].F_ConPhone);
- $("#title").val(Data[0].F_ComTitle);
- $('#content').val(Data[0].F_ComContent);
- $('#email').val(Data[0].F_Email);
- $("#zipcode").val(Data[0].F_ZipCode);
- $("#result").val(Data[0].F_Result);
- if(Data[0].F_IsResult == 1) {
- $(".Nows_box").toggle();
- }
- $(' input[name="banli"][value="' + Data[0].F_IsResult + '"]').prop("checked", "checked");
- $('#sourceaddress').val(Data[0].F_SourceAddress);
- console.log(Data);
- }
- })
- }
- });
- ///修改工单
- function Add() {
- var value = $(' input[name="banli"]:checked ').val();
- var content = $("#content").val();
- if(!$("#cusname").val()) {
- layer.msg("诉求人不能为空");
- } else if(!$("#cusphone").val()) {
- layer.msg("投诉电话不能为空");
- } else if(!$("#title").val()) {
- layer.msg("标题不能为空");
- } else if(!$("#content").val()) {
- layer.msg("内容不能为空");
- } else if(value == 1 && !$('#result').val()) {
- layer.msg("输入直办内容");
- } else {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "WorkOrder/EditWorkOrder",
- dataType: 'json',
- async: true,
- data: {
- workorderid: wid,
- cusname: $("#cusname").val(), //=投诉人姓名
- cussex: $("#cussex").val(),
- cusphone: $("#cusphone").val(), //=投诉人电话
- email: $("#email").val(),
- zipcode: $("#zipcode").val(),
- conphone: $("#conphone").val(),
- title: $("#title").val(),
- content: $("#content").val(),
- files: $("#file").val(), //(多个用英文逗号,隔开)
- sourcearea: $("#sourcearea").val(), //=事发地域id
- sourceaddress: $('#sourceaddress').val(), //=事发详细地址
- source: $("#source").val(), //=来源
- isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
- result: $('#result').val(),
- keys: $("#keys").val(), //=关键词id(多个用英文逗号,隔开)
- type: $("#type").val(), //=类型
- bigtype: $("#bigtype").val(), //=大类别
- smalltype: $("#smalltype").val(), //=小类别
- isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
- level: $('#level').val(), //=(1普通2紧急3特急)
- issubmit: submit, //=(0保存1保存并提交)
- token: $.cookie("token")
- },
- success: function(data) {
- if(data.state.toLowerCase() == "success") {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.load();
- parent.layer.msg(data.message);
- }
- }
- });
- }
- }
- //来源
- function LY(obj) {
- obj.empty();
- //obj.append('<option selected="selected" value="1">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
- "token": $.cookie("token"),
- id: 1
- }, 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 LB(obj) {
- obj.empty();
- obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
- "token": $.cookie("token"),
- id: 2
- }, 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();
- //obj.append('<option selected="selected" value="">请选择</option>');
- $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
- "token": $.cookie("token"),
- id: 3
- }, 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>');
- $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
- "token": $.cookie("token"),
- }, 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);
- })
- }
- })
- }
- //上传文件
- function upload() {
- var Files = document.getElementById("upFile").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=='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") {
- $(".fjnr").text(r.data[0].F_FileName.substring(19));
- var a = r.data;
- var str = '';
- var Str;
-
- $(a).each(function(i, n) {
- console.log(n.F_FileId);
- str += n.F_FileId + ",";
- Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
- console.log(Str);
- })
- $("#file").val(Str);
- $("#scfj").show();
- }
- }
- });
- }else{
- layer.msg("格式不正确");
- }
- } else {
- layer.confirm('请上传文件!', {
- btn: ['确定']
- });
- }
- }
- </script>
- </body>
- </html>
|