説明なし

AddAppeal.html 19KB

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