新余市12345政府服务热线_Web

AddAppeal.html 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <script src="../Script/Common/huayi.load.js"></script>
  6. <script src="../Script/Common/huayi.config.js"></script>
  7. <link href="../css/layer/need/layer.css" />
  8. <link rel="stylesheet" href="../css/init.css" />
  9. <title>新增诉求工单</title>
  10. <style>
  11. .input {
  12. background-color: #FFF;
  13. background-image: none;
  14. border: 1px solid #ccc;
  15. border-radius: 1px;
  16. color: inherit;
  17. padding: 6px 12px
  18. }
  19. .fjnr {
  20. padding: 0!important;
  21. border: none!important;
  22. }
  23. .radio-inline input[type=radio]{
  24. margin-top: 5px;
  25. }
  26. .Common{
  27. background: #f3f3f4;
  28. }
  29. </style>
  30. </head>
  31. <body class="gray-bg">
  32. <div class="daoHang clearfix">
  33. <div class="dhLeft">
  34. <sapn>
  35. <i class="syIcon"></i>位置:
  36. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  37. <a href="javaScript:;">工单处理</a>&gt;
  38. <a class="nowPosition">添加工单</a>
  39. </sapn>
  40. </div>
  41. <div class="dhRight">
  42. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  43. </div>
  44. </div>
  45. <div class="wrapper wrapper-content">
  46. <div style="padding: 10px;" class="tj_content clearFix">
  47. <div class="Common">
  48. <table>
  49. <tr>
  50. <th class="Importent">姓名:</th>
  51. <td>
  52. <input type="text" id="cusname" />
  53. </td>
  54. <th>性别:</th>
  55. <td>
  56. <select class="select_" id="cussex">
  57. <option value="">请选择</option>
  58. <option value="0">男</option>
  59. <option value="1">女</option>
  60. </select>
  61. </td>
  62. <th>来源:</th>
  63. <td>
  64. <select class="select_" id="source">
  65. </select>
  66. </td>
  67. <th class="Importent">投诉电话:</th>
  68. <td>
  69. <input type="text" id="cusphone" />
  70. </td>
  71. </tr>
  72. <tr>
  73. <th>邮箱:</th>
  74. <td>
  75. <input type="text" id="email" />
  76. </td>
  77. <th>邮编:</th>
  78. <td>
  79. <input type="text" id="zipcode" />
  80. </td>
  81. <th>联系电话:</th>
  82. <td>
  83. <input type="text" id="conphone" />
  84. </td>
  85. </tr>
  86. <tr>
  87. <th class="Importent">标题:</th>
  88. <td colspan="7">
  89. <input id="title" type="text" style="width: 100%;" />
  90. </td>
  91. </tr>
  92. <tr>
  93. <th class="Importent">内容:</th>
  94. <td colspan="7">
  95. <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%;"></textarea>
  96. </td>
  97. </tr>
  98. <tr>
  99. <th class="Importent">事件地址:</th>
  100. <td colspan="7">
  101. <select class="select_" id="sourcearea">
  102. </select>
  103. <input id="sourceaddress" type="text" placeholder="输入详细地址" style="width:66%" />
  104. </td>
  105. </tr>
  106. <tr>
  107. <th>附件上传:</th>
  108. <td colspan="7">
  109. <div class="fileBox">
  110. <!--<span class="files">文件1<i class="fa fa-remove"></i></span>-->
  111. </div>
  112. <!--<input type="text" placeholder="输入附件详情" style="width:66%" />-->
  113. <!--<span class="fjnr"></span>-->
  114. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  115. <input class="input" type="button" value="上传" id="scwj" />
  116. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  117. <input type="hidden" id="file" />
  118. </td>
  119. </tr>
  120. <tr>
  121. <th>处理方式:</th>
  122. <td colspan="7">
  123. <label class="radio-inline">
  124. <input type="radio" name="banli" value="1" class="Nows"> 当即办理
  125. </label>
  126. <label class="radio-inline">
  127. <input type="radio" name="banli" checked="true" value="0" class="Nows_"> 网络转办
  128. </label>
  129. </td>
  130. </tr>
  131. <tr class="Nows_box Hidens">
  132. <th>办理内容:</th>
  133. <td colspan="7">
  134. <input type="text" style="width: 100%;" id="result" />
  135. </td>
  136. </tr>
  137. <tr>
  138. <th class="Importent">主题词:</th>
  139. <td>
  140. <!--<input id="keys" type="text" placeholder="输入主题词" style="width:100%" />-->
  141. <select class="select_" id="keys">
  142. <option value=""></option>
  143. </select>
  144. </td>
  145. <th>类型:</th>
  146. <td>
  147. <select class="select_" id="type">
  148. </select>
  149. </td>
  150. <th>密级:</th>
  151. <td>
  152. <label class="radio-inline">
  153. <input type="radio" name="mj" checked="true" value="0"> 普通
  154. </label>
  155. <label class="radio-inline">
  156. <input type="radio" name="mj" checked="true" value="1"> 保密
  157. </label>
  158. </td>
  159. <th>紧急程度:</th>
  160. <td>
  161. <select class="select_" id="level">
  162. <option value="0">选择</option>
  163. <option value="1">普通</option>
  164. <option value="2">紧急</option>
  165. </select>
  166. </td>
  167. <!--<th class="">分管领导:</th>
  168. <td colspan="4">
  169. <input id="splituser" type="text" placeholder="" style="width:100%" readonly="readonly" />
  170. </td>-->
  171. </tr>
  172. </table>
  173. <div class="btn_box">
  174. <button class="btns BC">保存</button>
  175. <button class="btns SavedSubmit">保存并提交</button>
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. <script src="../css/laydate/laydate.js"></script>
  181. <script src="../js/adjustHeight.js"></script>
  182. <script>
  183. var submit;
  184. $(document).ready(function() {
  185. QY($("#sourcearea"));
  186. LY($("#source"));
  187. LB($("#type"));
  188. ZT($("#keys"))
  189. //当即办理
  190. $(' input[name="banli"]').change(function(){
  191. var val=$(this).val();
  192. if(val=="1"){
  193. $(".Nows_box").show();
  194. }else{
  195. $(".Nows_box").hide();
  196. }
  197. })
  198. $(".BC").click(function() {
  199. submit = 0;
  200. Add();
  201. })
  202. $('.SavedSubmit').click(function() {
  203. submit = 1;
  204. Add();
  205. })
  206. //上传附件
  207. $("#scwj").click(function() {
  208. $("#upFile").trigger("click");
  209. })
  210. $("#upFile").change(function() {
  211. upload();
  212. })
  213. $("#scfj").click(function() {
  214. // $(".fjnr").text("");
  215. // $("#scfj").hide();
  216. })
  217. });
  218. //添加工单
  219. function Add() {
  220. var value = $(' input[name="banli"]:checked ').val();
  221. var content = $("#content").val();
  222. if (!$("#cusname").val()) {
  223. layer.msg("请输入姓名");
  224. } else if (!$("#cusphone").val()) {
  225. layer.msg("请输入投诉电话");
  226. } else if (!$("#title").val()) {
  227. layer.msg("请输入标题");
  228. } else if (!$("#content").val()) {
  229. layer.msg("请输入内容");
  230. } else if (!$("#keys").val()) {
  231. layer.msg("请选择主题词");
  232. } else if (!$("#sourcearea").val()) {
  233. layer.msg("请选择事发区域");
  234. } else if (value == 1 && !$('#result').val()) {
  235. layer.msg("请输入直办内容");
  236. } else {
  237. $.ajax({
  238. type: "post",
  239. url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
  240. dataType: 'json',
  241. async: true,
  242. data: {
  243. cusname: $("#cusname").val(), //=投诉人姓名
  244. cussex: $("#cussex").val(),
  245. cusphone: $("#cusphone").val(), //=投诉人电话
  246. email: $("#email").val(),
  247. zipcode: $("#zipcode").val(),
  248. conphone: $("#conphone").val(),
  249. title: $("#title").val(),
  250. content: $("#content").val(),
  251. files: $("#file").val(), //(多个用英文逗号,隔开)
  252. sourcearea: $("#sourcearea").val(), //=事发地域id
  253. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  254. source: $("#source").val(), //=来源
  255. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  256. result: $('#result').val(),
  257. keys: $("#keys").val(), //=关键词id(多个用英文逗号,隔开)
  258. type: $("#type").val(), //=类型
  259. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  260. level: $('#level').val(), //=(1普通2紧急)
  261. issubmit: submit, //=(0保存1保存并提交)
  262. token: $.cookie("token")
  263. },
  264. success: function(data) {
  265. Clean();
  266. $('.fileBox').html('');
  267. layer.msg("创建工单成功");
  268. }
  269. });
  270. }
  271. }
  272. //上传文件
  273. function upload() {
  274. var Files = document.getElementById("upFile").files;
  275. if(Files.length > 0) {
  276. var formData = new FormData();
  277. for(var i = 0; i < Files.length; i++) {
  278. formData.append('file' + i, Files[i]);
  279. }
  280. formData.append("token", $.cookie("token"));
  281. $.ajax({
  282. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  283. type: "POST",
  284. data: formData,
  285. /**
  286. *必须false才会自动加上正确的Content-Type
  287. */
  288. contentType: false,
  289. /**
  290. * 必须false才会避开jQuery对 formdata 的默认处理
  291. * XMLHttpRequest会对 formdata 进行正确的处理
  292. */
  293. processData: false,
  294. success: function(result) {
  295. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  296. $("#upFile").change(function() {
  297. upload();
  298. });
  299. var r = $.parseJSON(result);
  300. if(r.state.toLowerCase() == "success") {
  301. // $(".fjnr").text(r.data[0].F_FileName);
  302. var a = r.data;
  303. $(a).each(function(i, n) {
  304. var strs='<span class="files" fiel-num="'+ n.F_FileId +'">'+ n.F_FileName +'<i class="fa fa-remove del_file"></i></span>'
  305. $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event){
  306. event.stopPropagation();
  307. $(this).parent().remove();
  308. file_num()
  309. })
  310. })
  311. file_num()
  312. }
  313. }
  314. });
  315. } else {
  316. layer.confirm('请上传文件!', {
  317. btn: ['确定']
  318. });
  319. }
  320. }
  321. //上传文件隐藏域值
  322. function file_num(){
  323. var str = '';
  324. var Str;
  325. $('.fileBox .files').each(function(j,m){
  326. var aa=$(m).attr("fiel-num")
  327. console.log(aa);
  328. str += aa + ",";
  329. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  330. })
  331. $("#file").val(Str);
  332. }
  333. //来源
  334. function LY(obj) {
  335. obj.empty();
  336. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  337. "token": $.cookie("token"),
  338. id: 1
  339. }, function(data) {
  340. if(data.state.toLowerCase() == "success") {
  341. var content = data.data;
  342. $(content).each(function(i, n) {
  343. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  344. })
  345. }
  346. })
  347. }
  348. //类别
  349. function LB(obj) {
  350. obj.empty();
  351. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  352. "token": $.cookie("token"),
  353. id: 2
  354. }, function(data) {
  355. if(data.state.toLowerCase() == "success") {
  356. var content = data.data;
  357. $(content).each(function(i, n) {
  358. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  359. })
  360. }
  361. })
  362. }
  363. // 主题
  364. function ZT(obj) {
  365. obj.empty();
  366. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  367. "token": $.cookie("token"),
  368. id: 3
  369. }, function(data) {
  370. if(data.state.toLowerCase() == "success") {
  371. var content = data.data;
  372. $(content).each(function(i, n) {
  373. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  374. })
  375. }
  376. })
  377. }
  378. //区域
  379. function QY(obj) {
  380. obj.empty();
  381. obj.append('<option selected="selected" value="">请选择</option>');
  382. $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
  383. "token": $.cookie("token"),
  384. }, function(data) {
  385. if(data.state.toLowerCase() == "success") {
  386. var content = data.data;
  387. $(content).each(function(i, n) {
  388. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  389. })
  390. }
  391. })
  392. }
  393. function Clean() {
  394. $("#cusname").val(''); //=投诉人姓名
  395. $("#cussex").val('');
  396. $("#cusphone").val(''); //=投诉人电话
  397. $("#email").val('');
  398. $("#zipcode").val('');
  399. $("#conphone").val('');
  400. $("#title").val('');
  401. $("#content").val('');
  402. $("#sourcearea").val(); //=事发地域id
  403. $('#sourceaddress').val(''); //=事发详细地址
  404. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  405. $("#type option:first").prop("selected", 'selected');
  406. $("#level option:first").prop("selected", 'selected');
  407. $("#keys option:first").prop("selected", 'selected');
  408. $("#sourcearea option:first").prop("selected", 'selected');
  409. $('#result').val('');
  410. }
  411. </script>
  412. </body>
  413. </html>