| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432 |
- <!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>
- .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;
- }
- .radio-inline input[type=radio] {
- margin-top: 5px;
- }
- .Common {
- background: #f3f3f4;
- }
- </style>
- </head>
- <body class="gray-bg">
- <div class="daoHang clearfix">
- <div class="dhLeft">
- <sapn>
- <i class="syIcon"></i>位置:
- <a href="javaScript:;" id="ReIndex">首页</a>>
- <a href="javaScript:;">工单处理</a>>
- <a class="nowPosition">添加工单</a>
- </sapn>
- </div>
- <div class="dhRight">
- <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
- </div>
- </div>
- <div class="wrapper wrapper-content">
- <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_" id="cussex">
- <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 class="Importent">事件地址:</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">
- <div class="fileBox">
- <!--<span class="files">文件1<i class="fa fa-remove"></i></span>-->
- </div>
- <!--<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">
- <label class="radio-inline">
- <input type="radio" name="banli" value="1" class="Nows"> 当即办理
- </label>
- <label class="radio-inline">
- <input type="radio" name="banli" checked="true" value="0" class="Nows_"> 网络转办
- </label>
- </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>
- <label class="radio-inline">
- <input type="radio" name="mj" checked="true" value="0"> 普通
- </label>
- <label class="radio-inline">
- <input type="radio" name="mj" checked="true" value="1"> 保密
- </label>
- </td>
- <th>紧急程度:</th>
- <td>
- <select class="select_" id="level">
- <option value="0">选择</option>
- <option value="1">普通</option>
- <option value="2">紧急</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>
- <button class="btns SavedSubmit">保存并提交</button>
- </div>
- </div>
- </div>
- </div>
- <script src="../css/laydate/laydate.js"></script>
- <script src="../js/adjustHeight.js"></script>
- <script>
- var submit;
- $(document).ready(function () {
- QY($("#sourcearea"));
- LY($("#source"));
- LB($("#type"));
- ZT($("#keys"))
- //当即办理
- $(' 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();
- })
- });
- //添加工单
- 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 (!$("#keys").val()) {
- layer.msg("请选择主题词");
- } else if (!$("#sourcearea").val()) {
- layer.msg("请选择事发区域");
- } else if (value == 1 && !$('#result').val()) {
- layer.msg("请输入直办内容");
- } else {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
- dataType: 'json',
- async: true,
- data: {
- 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(), //=类型
- isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
- level: $('#level').val(), //=(1普通2紧急)
- issubmit: submit, //=(0保存1保存并提交)
- token: $.cookie("token")
- },
- success: function (data) {
- Clean();
- $('.fileBox').html('');
- layer.msg("创建工单成功");
- }
- });
- }
- }
- //上传文件
- 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;
- $(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();
- $.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();
- $.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();
- $.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 Clean() {
- $("#file").val('');
- $("#cusname").val(''); //=投诉人姓名
- $("#cussex").val('');
- $("#cusphone").val(''); //=投诉人电话
- $("#email").val('');
- $("#zipcode").val('');
- $("#conphone").val('');
- $("#title").val('');
- $("#content").val('');
- $("#sourcearea").val(); //=事发地域id
- $('#sourceaddress').val(''); //=事发详细地址
- $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
- $("#type option:first").prop("selected", 'selected');
- $("#level option:first").prop("selected", 'selected');
- $("#keys option:first").prop("selected", 'selected');
- $("#sourcearea option:first").prop("selected", 'selected');
- $('#result').val('');
- }
- </script>
- </body>
- </html>
|