商丘宁陵县12345_前端

AddAppeal.html 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432
  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"></select>
  65. </td>
  66. <th class="Importent">投诉电话:</th>
  67. <td>
  68. <input type="text" id="cusphone" />
  69. </td>
  70. </tr>
  71. <tr>
  72. <th>邮箱:</th>
  73. <td>
  74. <input type="text" id="email" />
  75. </td>
  76. <th>邮编:</th>
  77. <td>
  78. <input type="text" id="zipcode" />
  79. </td>
  80. <th>联系电话:</th>
  81. <td>
  82. <input type="text" id="conphone" />
  83. </td>
  84. </tr>
  85. <tr>
  86. <th class="Importent">标题:</th>
  87. <td colspan="7">
  88. <input id="title" type="text" style="width: 100%;" />
  89. </td>
  90. </tr>
  91. <tr>
  92. <th class="Importent">内容:</th>
  93. <td colspan="7">
  94. <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%;"></textarea>
  95. </td>
  96. </tr>
  97. <tr>
  98. <th class="Importent">事件地址:</th>
  99. <td colspan="7">
  100. <select class="select_" id="sourcearea"></select>
  101. <input id="sourceaddress" type="text" placeholder="输入详细地址" style="width:66%" />
  102. </td>
  103. </tr>
  104. <tr>
  105. <th>附件上传:</th>
  106. <td colspan="7">
  107. <div class="fileBox">
  108. <!--<span class="files">文件1<i class="fa fa-remove"></i></span>-->
  109. </div>
  110. <!--<input type="text" placeholder="输入附件详情" style="width:66%" />-->
  111. <!--<span class="fjnr"></span>-->
  112. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  113. <input class="input" type="button" value="上传" id="scwj" />
  114. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  115. <input type="hidden" id="file" />
  116. <span style="color:#FF0000; border: none;">
  117. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  118. </span>
  119. </td>
  120. </tr>
  121. <tr>
  122. <th>处理方式:</th>
  123. <td colspan="7">
  124. <label class="radio-inline">
  125. <input type="radio" name="banli" value="1" class="Nows"> 当即办理
  126. </label>
  127. <label class="radio-inline">
  128. <input type="radio" name="banli" checked="true" value="0" class="Nows_"> 网络转办
  129. </label>
  130. </td>
  131. </tr>
  132. <tr class="Nows_box Hidens">
  133. <th>办理内容:</th>
  134. <td colspan="7">
  135. <input type="text" style="width: 100%;" id="result" />
  136. </td>
  137. </tr>
  138. <tr>
  139. <th class="Importent">主题词:</th>
  140. <td>
  141. <!--<input id="keys" type="text" placeholder="输入主题词" style="width:100%" />-->
  142. <select class="select_" id="keys">
  143. <option value=""></option>
  144. </select>
  145. </td>
  146. <th>类型:</th>
  147. <td>
  148. <select class="select_" id="type"></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. var typeName=Files[0].name.split('.')[1];
  282. if (typeName=="png"||typeName=='jpg'||typeName=='mp4'||typeName=='mp3'||typeName=='pdf'||typeName=='doc'||typeName=='docx'||typeName=='xls'||typeName=='xlsx') {
  283. $.ajax({
  284. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  285. type: "POST",
  286. data: formData,
  287. /**
  288. *必须false才会自动加上正确的Content-Type
  289. */
  290. contentType: false,
  291. /**
  292. * 必须false才会避开jQuery对 formdata 的默认处理
  293. * XMLHttpRequest会对 formdata 进行正确的处理
  294. */
  295. processData: false,
  296. success: function (result) {
  297. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  298. $("#upFile").change(function () {
  299. upload();
  300. });
  301. var r = $.parseJSON(result);
  302. if (r.state.toLowerCase() == "success") {
  303. // $(".fjnr").text(r.data[0].F_FileName.substring(19));
  304. var a = r.data;
  305. $(a).each(function (i, n) {
  306. var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  307. $(strs).appendTo($('.fileBox')).find('.del_file').click(function (event) {
  308. event.stopPropagation();
  309. $(this).parent().remove();
  310. file_num()
  311. })
  312. })
  313. file_num()
  314. }
  315. }
  316. });
  317. }else{
  318. layer.msg("格式不正确");
  319. }
  320. } else {
  321. layer.confirm('请上传文件!', {
  322. btn: ['确定']
  323. });
  324. }
  325. }
  326. //上传文件隐藏域值
  327. function file_num() {
  328. var str = '';
  329. var Str;
  330. $('.fileBox .files').each(function (j, m) {
  331. var aa = $(m).attr("fiel-num")
  332. console.log(aa);
  333. str += aa + ",";
  334. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  335. })
  336. $("#file").val(Str);
  337. }
  338. //来源
  339. function LY(obj) {
  340. obj.empty();
  341. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  342. "token": $.cookie("token"),
  343. id: 1
  344. }, function (data) {
  345. if (data.state.toLowerCase() == "success") {
  346. var content = data.data;
  347. $(content).each(function (i, n) {
  348. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  349. })
  350. }
  351. })
  352. }
  353. //类别
  354. function LB(obj) {
  355. obj.empty();
  356. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  357. "token": $.cookie("token"),
  358. id: 2
  359. }, function (data) {
  360. if (data.state.toLowerCase() == "success") {
  361. var content = data.data;
  362. $(content).each(function (i, n) {
  363. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  364. })
  365. }
  366. })
  367. }
  368. // 主题
  369. function ZT(obj) {
  370. obj.empty();
  371. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  372. "token": $.cookie("token"),
  373. id: 3
  374. }, function (data) {
  375. if (data.state.toLowerCase() == "success") {
  376. var content = data.data;
  377. $(content).each(function (i, n) {
  378. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  379. })
  380. }
  381. })
  382. }
  383. //区域
  384. function QY(obj) {
  385. obj.empty();
  386. obj.append('<option selected="selected" value="">请选择</option>');
  387. $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
  388. "token": $.cookie("token"),
  389. }, function (data) {
  390. if (data.state.toLowerCase() == "success") {
  391. var content = data.data;
  392. $(content).each(function (i, n) {
  393. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  394. })
  395. }
  396. })
  397. }
  398. function Clean() {
  399. $("#file").val('');
  400. $("#cusname").val(''); //=投诉人姓名
  401. $("#cussex").val('');
  402. $("#cusphone").val(''); //=投诉人电话
  403. $("#email").val('');
  404. $("#zipcode").val('');
  405. $("#conphone").val('');
  406. $("#title").val('');
  407. $("#content").val('');
  408. $("#sourcearea").val(); //=事发地域id
  409. $('#sourceaddress').val(''); //=事发详细地址
  410. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  411. $("#type option:first").prop("selected", 'selected');
  412. $("#level option:first").prop("selected", 'selected');
  413. $("#keys option:first").prop("selected", 'selected');
  414. $("#sourcearea option:first").prop("selected", 'selected');
  415. $('#result').val('');
  416. }
  417. </script>
  418. </body>
  419. </html>