Нет описания

AddAppeal.html 21KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  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="1">普通</option>
  150. <option value="2">紧急</option>
  151. </select>
  152. </td>-->
  153. </tr>
  154. </table>
  155. <div class="btn_box">
  156. <button class="btns SavedSubmit">提交</button>
  157. </div>
  158. </div>
  159. </div>
  160. </div>
  161. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  162. <script src="../css/laydate/laydate.js"></script>
  163. <script src="../js/zTree/jquery.ztree.core.js"></script>
  164. <script src="../js/adjustHeight.js"></script>
  165. <!--<script src="../js/appeal/index1.js"></script>-->
  166. <script>
  167. var submit;
  168. $(document).ready(function () {
  169. QY($("#sourcearea"));
  170. LY($("#source"));
  171. LB($("#type"));
  172. ZT($("#keys"))
  173. //当即办理
  174. $(' input[name="banli"]').change(function () {
  175. var val = $(this).val();
  176. if (val == "1") {
  177. $(".Nows_box").show();
  178. } else {
  179. $(".Nows_box").hide();
  180. }
  181. })
  182. $(".BC").click(function () {
  183. submit = 0;
  184. Add();
  185. })
  186. $('.SavedSubmit').click(function () {
  187. submit = 1;
  188. Add();
  189. })
  190. //上传附件
  191. $("#scwj").click(function () {
  192. $("#upFile").trigger("click");
  193. })
  194. $("#upFile").change(function () {
  195. upload();
  196. })
  197. $("#scfj").click(function () {
  198. // $(".fjnr").text("");
  199. // $("#scfj").hide();
  200. })
  201. });
  202. //添加工单
  203. function Add() {
  204. var value = $(' input[name="banli"]:checked ').val();
  205. var content = $("#content").val();
  206. if (!$("#cusname").val()) {
  207. layer.msg("请输入姓名");
  208. // } else if (!$("#cusphone").val()) {
  209. // layer.msg("请输入投诉电话");
  210. } else if (!$("#conphone").val()) {
  211. layer.msg("请输入联系电话");
  212. } else if (!$("#title").val()) {
  213. layer.msg("请输入标题");
  214. } else if (!$("#content").val()) {
  215. layer.msg("请输入内容");
  216. }
  217. // else if (!$("#keys").val()) {
  218. // layer.msg("请选择主题词");
  219. // }
  220. else if (!$("#sourcearea").val()) {
  221. layer.msg("请选择事发区域");
  222. } else if (value == 1 && !$('#result').val()) {
  223. layer.msg("请输入直办内容");
  224. } else {
  225. $.ajax({
  226. type: "post",
  227. url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
  228. dataType: 'json',
  229. async: true,
  230. beforeSend: function () { //触发ajax请求开始时执行
  231. $('.BC').attr("disabled", true);
  232. $('.SavedSubmit').attr("disabled", true);
  233. $('.BC').text('提交中...');
  234. $('.SavedSubmit').text('提交中...');
  235. $(document).off('click', '.BC', Add);
  236. $(document).off('click', '.SavedSubmit', Add);
  237. },
  238. data: {
  239. cusname: $("#cusname").val(), //=投诉人姓名
  240. cussex: $("#cussex").val(),
  241. // cusphone: $("#cusphone").val(), //=投诉人电话
  242. email: $("#email").val(),
  243. zipcode: $("#zipcode").val(),
  244. conphone: $("#conphone").val(),
  245. title: $("#title").val(),
  246. content: $("#content").val(),
  247. files: $("#file").val(), //(多个用英文逗号,隔开)
  248. sourcearea: $("#sourcearea").val(), //=事发地域id
  249. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  250. source: $("#source").val(), //=来源
  251. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  252. result: $('#result').val(),
  253. keys: $("#keys").val(), //=关键词id(多个用英文逗号,隔开)
  254. type: $("#type").val(), //=类型
  255. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  256. level: $('#level').val(), //=(1普通2紧急)
  257. issubmit: submit, //=(0保存1保存并提交)
  258. token: $.cookie("token")
  259. },
  260. success: function (data) {
  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. var formData = new FormData();
  280. for (var i = 0; i < Files.length; i++) {
  281. formData.append('file' + i, Files[i]);
  282. }
  283. formData.append("token", $.cookie("token"));
  284. var typeName = Files[0].name.split('.')[1];
  285. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName ==
  286. 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' ||
  287. typeName == 'xls' || typeName == 'xlsx') {
  288. $.ajax({
  289. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  290. type: "POST",
  291. data: formData,
  292. /**
  293. *必须false才会自动加上正确的Content-Type
  294. */
  295. contentType: false,
  296. /**
  297. * 必须false才会避开jQuery对 formdata 的默认处理
  298. * XMLHttpRequest会对 formdata 进行正确的处理
  299. */
  300. processData: false,
  301. success: function (result) {
  302. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  303. .outerHTML;
  304. $("#upFile").change(function () {
  305. upload();
  306. });
  307. var r = $.parseJSON(result);
  308. if (r.state.toLowerCase() == "success") {
  309. var a = r.data;
  310. $(a).each(function (i, n) {
  311. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  312. '">' + n.F_FileName.substring(19) +
  313. '<i class="fa fa-remove del_file"></i></span>'
  314. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  315. function (event) {
  316. event.stopPropagation();
  317. $(this).parent().remove();
  318. file_num()
  319. })
  320. })
  321. file_num();
  322. }
  323. }
  324. });
  325. } else {
  326. layer.msg("格式不正确");
  327. }
  328. } else {
  329. layer.confirm('请上传文件!', {
  330. btn: ['确定']
  331. });
  332. }
  333. }
  334. //上传文件隐藏域值
  335. function file_num() {
  336. var str = '';
  337. var Str;
  338. $('.fileBox .files').each(function (j, m) {
  339. var aa = $(m).attr("fiel-num")
  340. console.log(aa);
  341. str += aa + ",";
  342. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  343. })
  344. $("#file").val(Str);
  345. }
  346. //来源
  347. function LY(obj) {
  348. obj.empty();
  349. $.ajax({
  350. type: "get",
  351. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  352. dataType: "json",
  353. async: true,
  354. data: {
  355. "token": $.cookie("token"),
  356. id: 1
  357. },
  358. success: function (data) {
  359. if (data.state.toLowerCase() == "success") {
  360. var content = data.data;
  361. $(content).each(function (i, n) {
  362. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  363. .appendTo(obj);
  364. })
  365. }
  366. }
  367. });
  368. }
  369. //类别
  370. function LB(obj) {
  371. obj.empty();
  372. $.ajax({
  373. type: "get",
  374. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  375. dataType: "json",
  376. async: true,
  377. data: {
  378. "token": $.cookie("token"),
  379. id: 2
  380. },
  381. success: function (data) {
  382. if (data.state.toLowerCase() == "success") {
  383. var content = data.data;
  384. $(content).each(function (i, n) {
  385. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  386. .appendTo(obj);
  387. })
  388. }
  389. }
  390. });
  391. }
  392. // 主题
  393. function ZT(obj) {
  394. obj.empty();
  395. $.ajax({
  396. type: "get",
  397. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  398. dataType: "json",
  399. async: true,
  400. data: {
  401. "token": $.cookie("token"),
  402. type: 1,
  403. id: 3
  404. },
  405. success: function (data) {
  406. if (data.state.toLowerCase() == "success") {
  407. var content = data.data;
  408. $(content).each(function (i, n) {
  409. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  410. .appendTo(obj);
  411. })
  412. }
  413. }
  414. });
  415. }
  416. //区域
  417. function QY(obj) {
  418. obj.empty();
  419. obj.append('<option selected="selected" value="">请选择</option>');
  420. $.ajax({
  421. type: "get",
  422. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  423. dataType: "json",
  424. async: true,
  425. data: {
  426. "token": $.cookie("token"),
  427. },
  428. success: function (data) {
  429. if (data.state.toLowerCase() == "success") {
  430. var content = data.data;
  431. $(content).each(function (i, n) {
  432. if (n.F_AreaName != '巩义市') {
  433. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  434. "</option>").appendTo(obj);
  435. }
  436. })
  437. }
  438. }
  439. });
  440. }
  441. function Clean() {
  442. $("#cusname").val(''); //=投诉人姓名
  443. $("#source").val('');
  444. $("#cussex").val('');
  445. // $("#cusphone").val(''); //=投诉人电话
  446. $("#email").val('');
  447. $("#zipcode").val('');
  448. $("#conphone").val('');
  449. $("#title").val('');
  450. $("#content").val('');
  451. $("#sourcearea").val(); //=事发地域id
  452. $('#sourceaddress').val(''); //=事发详细地址
  453. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  454. $("#type option:first").prop("selected", 'selected');
  455. $("#level option:first").prop("selected", 'selected');
  456. $("#keys option:first").prop("selected", 'selected');
  457. $("#sourcearea option:first").prop("selected", 'selected');
  458. $('#result').val('');
  459. }
  460. tree()
  461. function tree() {
  462. $.get(
  463. huayi.config.callcenter_url + "Department/GetDeptList", {
  464. token: $.cookie("token"),
  465. // "pid": pid
  466. },
  467. function (result) {
  468. result = $.parseJSON(result);
  469. $.fn.zTree.init(
  470. $("#addTreeDemo"),
  471. setting1,
  472. result.data
  473. ); //实例化树形图
  474. }
  475. );
  476. }
  477. var setting1 = {
  478. data: {
  479. key: {
  480. name: "F_DeptName",
  481. },
  482. simpleData: {
  483. enable: true,
  484. idKey: "F_DeptId",
  485. pIdKey: "F_PartentId",
  486. rootPId: 0,
  487. },
  488. },
  489. callback: {
  490. onClick: zTreeOnClick,
  491. },
  492. };
  493. function zTreeOnClick(event, treeId, treeNode) {
  494. if (treeNode.level >= 2) {
  495. $(".inps").val(treeNode.F_DeptName);
  496. $("#PID").val(treeNode.F_DeptId);
  497. $("#Dpment").val(treeNode.F_DeptId);
  498. $(".Cleans").show();
  499. }
  500. }
  501. function Close() {
  502. $(".lyxz").removeClass("cx");
  503. if ($("audio").length > 0) {
  504. $("audio")[0].pause();
  505. }
  506. }
  507. </script>
  508. </body>
  509. </html>