Нет описания

AddAppeal.html 21KB

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