睢县12345_前端

AddAppeal.html 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  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. </td>
  117. </tr>
  118. <tr>
  119. <th>处理方式:</th>
  120. <td colspan="7">
  121. <label class="radio-inline">
  122. <input type="radio" name="banli" value="1" class="Nows"> 当即办理
  123. </label>
  124. <label class="radio-inline">
  125. <input type="radio" name="banli" checked="true" value="0" class="Nows_"> 网络转办
  126. </label>
  127. </td>
  128. </tr>
  129. <tr class="Nows_box Hidens">
  130. <th>办理内容:</th>
  131. <td colspan="7">
  132. <input type="text" style="width: 100%;" id="result" />
  133. </td>
  134. </tr>
  135. <tr>
  136. <th class="Importent">主题词:</th>
  137. <td>
  138. <!--<input id="keys" type="text" placeholder="输入主题词" style="width:100%" />-->
  139. <select class="select_" id="keys">
  140. <option value=""></option>
  141. </select>
  142. </td>
  143. <th>类型:</th>
  144. <td>
  145. <select class="select_" id="type"></select>
  146. </td>
  147. <th>密级:</th>
  148. <td>
  149. <label class="radio-inline">
  150. <input type="radio" name="mj" checked="true" value="0"> 普通
  151. </label>
  152. <label class="radio-inline">
  153. <input type="radio" name="mj" checked="true" value="1"> 保密
  154. </label>
  155. </td>
  156. <th>紧急程度:</th>
  157. <td>
  158. <select class="select_" id="level">
  159. <option value="0">选择</option>
  160. <option value="1">普通</option>
  161. <option value="2">紧急</option>
  162. </select>
  163. </td>
  164. <!--<th class="">分管领导:</th>
  165. <td colspan="4">
  166. <input id="splituser" type="text" placeholder="" style="width:100%" readonly="readonly" />
  167. </td>-->
  168. </tr>
  169. </table>
  170. <div class="btn_box">
  171. <button class="btns BC">保存</button>
  172. <button class="btns SavedSubmit">保存并提交</button>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. <script src="../css/laydate/laydate.js"></script>
  178. <script src="../js/adjustHeight.js"></script>
  179. <script>
  180. var submit;
  181. $(document).ready(function () {
  182. QY($("#sourcearea"));
  183. LY($("#source"));
  184. LB($("#type"));
  185. ZT($("#keys"))
  186. //当即办理
  187. $(' input[name="banli"]').change(function () {
  188. var val = $(this).val();
  189. if (val == "1") {
  190. $(".Nows_box").show();
  191. } else {
  192. $(".Nows_box").hide();
  193. }
  194. })
  195. $(".BC").click(function () {
  196. submit = 0;
  197. Add();
  198. })
  199. $('.SavedSubmit').click(function () {
  200. submit = 1;
  201. Add();
  202. })
  203. //上传附件
  204. $("#scwj").click(function () {
  205. $("#upFile").trigger("click");
  206. })
  207. $("#upFile").change(function () {
  208. upload();
  209. })
  210. $("#scfj").click(function () {
  211. // $(".fjnr").text("");
  212. // $("#scfj").hide();
  213. })
  214. });
  215. //添加工单
  216. function Add() {
  217. var value = $(' input[name="banli"]:checked ').val();
  218. var content = $("#content").val();
  219. if (!$("#cusname").val()) {
  220. layer.msg("请输入姓名");
  221. } else if (!$("#cusphone").val()) {
  222. layer.msg("请输入投诉电话");
  223. } else if (!$("#title").val()) {
  224. layer.msg("请输入标题");
  225. } else if (!$("#content").val()) {
  226. layer.msg("请输入内容");
  227. } else if (!$("#keys").val()) {
  228. layer.msg("请选择主题词");
  229. } else if (!$("#sourcearea").val()) {
  230. layer.msg("请选择事发区域");
  231. } else if (value == 1 && !$('#result').val()) {
  232. layer.msg("请输入直办内容");
  233. } else {
  234. $.ajax({
  235. type: "post",
  236. url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
  237. dataType: 'json',
  238. async: true,
  239. data: {
  240. cusname: $("#cusname").val(), //=投诉人姓名
  241. cussex: $("#cussex").val(),
  242. cusphone: $("#cusphone").val(), //=投诉人电话
  243. email: $("#email").val(),
  244. zipcode: $("#zipcode").val(),
  245. conphone: $("#conphone").val(),
  246. title: $("#title").val(),
  247. content: $("#content").val(),
  248. files: $("#file").val(), //(多个用英文逗号,隔开)
  249. sourcearea: $("#sourcearea").val(), //=事发地域id
  250. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  251. source: $("#source").val(), //=来源
  252. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  253. result: $('#result').val(),
  254. keys: $("#keys").val(), //=关键词id(多个用英文逗号,隔开)
  255. type: $("#type").val(), //=类型
  256. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  257. level: $('#level').val(), //=(1普通2紧急)
  258. issubmit: submit, //=(0保存1保存并提交)
  259. token: $.cookie("token")
  260. },
  261. success: function (data) {
  262. Clean();
  263. $('.fileBox').html('');
  264. layer.msg("创建工单成功");
  265. }
  266. });
  267. }
  268. }
  269. //上传文件
  270. function upload() {
  271. var Files = document.getElementById("upFile").files;
  272. if (Files.length > 0) {
  273. var formData = new FormData();
  274. for (var i = 0; i < Files.length; i++) {
  275. formData.append('file' + i, Files[i]);
  276. }
  277. formData.append("token", $.cookie("token"));
  278. $.ajax({
  279. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  280. type: "POST",
  281. data: formData,
  282. /**
  283. *必须false才会自动加上正确的Content-Type
  284. */
  285. contentType: false,
  286. /**
  287. * 必须false才会避开jQuery对 formdata 的默认处理
  288. * XMLHttpRequest会对 formdata 进行正确的处理
  289. */
  290. processData: false,
  291. success: function (result) {
  292. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  293. $("#upFile").change(function () {
  294. upload();
  295. });
  296. var r = $.parseJSON(result);
  297. if (r.state.toLowerCase() == "success") {
  298. // $(".fjnr").text(r.data[0].F_FileName.substring(19));
  299. var a = r.data;
  300. $(a).each(function (i, n) {
  301. var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  302. $(strs).appendTo($('.fileBox')).find('.del_file').click(function (event) {
  303. event.stopPropagation();
  304. $(this).parent().remove();
  305. file_num()
  306. })
  307. })
  308. file_num()
  309. }
  310. }
  311. });
  312. } else {
  313. layer.confirm('请上传文件!', {
  314. btn: ['确定']
  315. });
  316. }
  317. }
  318. //上传文件隐藏域值
  319. function file_num() {
  320. var str = '';
  321. var Str;
  322. $('.fileBox .files').each(function (j, m) {
  323. var aa = $(m).attr("fiel-num")
  324. console.log(aa);
  325. str += aa + ",";
  326. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  327. })
  328. $("#file").val(Str);
  329. }
  330. //来源
  331. function LY(obj) {
  332. obj.empty();
  333. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  334. "token": $.cookie("token"),
  335. id: 1
  336. }, function (data) {
  337. if (data.state.toLowerCase() == "success") {
  338. var content = data.data;
  339. $(content).each(function (i, n) {
  340. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  341. })
  342. }
  343. })
  344. }
  345. //类别
  346. function LB(obj) {
  347. obj.empty();
  348. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  349. "token": $.cookie("token"),
  350. id: 2
  351. }, function (data) {
  352. if (data.state.toLowerCase() == "success") {
  353. var content = data.data;
  354. $(content).each(function (i, n) {
  355. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  356. })
  357. }
  358. })
  359. }
  360. // 主题
  361. function ZT(obj) {
  362. obj.empty();
  363. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  364. "token": $.cookie("token"),
  365. id: 3
  366. }, function (data) {
  367. if (data.state.toLowerCase() == "success") {
  368. var content = data.data;
  369. $(content).each(function (i, n) {
  370. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  371. })
  372. }
  373. })
  374. }
  375. //区域
  376. function QY(obj) {
  377. obj.empty();
  378. obj.append('<option selected="selected" value="">请选择</option>');
  379. $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
  380. "token": $.cookie("token"),
  381. }, function (data) {
  382. if (data.state.toLowerCase() == "success") {
  383. var content = data.data;
  384. $(content).each(function (i, n) {
  385. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  386. })
  387. }
  388. })
  389. }
  390. function Clean() {
  391. $("#cusname").val(''); //=投诉人姓名
  392. $("#cussex").val('');
  393. $("#cusphone").val(''); //=投诉人电话
  394. $("#email").val('');
  395. $("#zipcode").val('');
  396. $("#conphone").val('');
  397. $("#title").val('');
  398. $("#content").val('');
  399. $("#sourcearea").val(); //=事发地域id
  400. $('#sourceaddress').val(''); //=事发详细地址
  401. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  402. $("#type option:first").prop("selected", 'selected');
  403. $("#level option:first").prop("selected", 'selected');
  404. $("#keys option:first").prop("selected", 'selected');
  405. $("#sourcearea option:first").prop("selected", 'selected');
  406. $('#result').val('');
  407. }
  408. </script>
  409. </body>
  410. </html>