説明なし

AddAppeal备份.html 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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 rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  8. <link href="../css/layer/need/layer.css" />
  9. <link rel="stylesheet" href="../css/init.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. .xg i {
  29. font-size: 16px;
  30. }
  31. .hidens {
  32. display: none;
  33. }
  34. .inpBox {
  35. border: 1px solid #cccccc;
  36. height: 31px;
  37. width: 220px;
  38. display: inline-block;
  39. position: relative;
  40. vertical-align: middle;
  41. position: absolute;
  42. left: 0px;
  43. top: 0px;
  44. z-index: 111;
  45. }
  46. .selDpart1 {
  47. position: absolute;
  48. left: 0px;
  49. top: 30px;
  50. z-index: 11111;
  51. width: 220px;
  52. line-height: 30px;
  53. background: #ffffff;
  54. display: none;
  55. }
  56. #sponsor {
  57. width: 218px;
  58. border: 1px solid #00a1cb;
  59. margin: 0;
  60. padding: 0;
  61. list-style: none;
  62. max-height: 212px;
  63. overflow-x: hidden;
  64. overflow-y: scroll;
  65. }
  66. #sponsor li {
  67. margin: 0;
  68. padding-left: 10px;
  69. width: 220px;
  70. height: 30px;
  71. line-height: 30px;
  72. list-style: none;
  73. }
  74. #sponsor li:hover {
  75. background: #00a1cb;
  76. }
  77. .addTree {
  78. background: #fff;
  79. position: absolute;
  80. width: 100%;
  81. border: 1px solid darkgrey;
  82. right: 0;
  83. top: 29px;
  84. display: none;
  85. z-index: 222;
  86. }
  87. .xl {
  88. display: inline-block;
  89. background: url(../../img/dropDown.png) no-repeat;
  90. height: 100%;
  91. background-position: center center;
  92. width: 20px;
  93. position: absolute;
  94. right: 0;
  95. top: 0px;
  96. /* background-color: #f7bc8b; */
  97. cursor: pointer;
  98. }
  99. .ztree li span {
  100. border: none;
  101. padding: 0;
  102. }
  103. .inps {
  104. width: 217px;
  105. height: 29px;
  106. outline: none;
  107. border: 0;
  108. border-image-width: 0;
  109. padding: 0;
  110. padding-left: 3px;
  111. }
  112. .xl {
  113. display: inline-block;
  114. background: url(../img/dropDown.png) no-repeat;
  115. height: 100%;
  116. background-position: center center;
  117. width: 20px;
  118. position: absolute;
  119. right: 0;
  120. top: 0px;
  121. /* background-color: #f7bc8b; */
  122. cursor: pointer;
  123. }
  124. .Cleans {
  125. display: inline-block;
  126. width: 20px;
  127. position: absolute;
  128. right: 21px;
  129. top: 8px;
  130. display: none;
  131. }
  132. </style>
  133. </head>
  134. <body>
  135. <div class="wrapper wrapper-content animated fadeInRight">
  136. <div class="daoHang clearfix">
  137. <div class="dhLeft">
  138. <sapn>
  139. <i class="syIcon"></i>位置:
  140. <a href="javaScript:;" id="ReIndex">首页</a>&gt;
  141. <a href="javaScript:;">工单处理</a>&gt;
  142. <a href="" class="nowPosition">添加工单</a>
  143. </sapn>
  144. </div>
  145. <div class="dhRight">
  146. <a href="" title="刷新"><i class="fa fa-refresh"></i></a>
  147. </div>
  148. </div>
  149. <div style="padding: 10px;" class="tj_content clearFix">
  150. <div class="Common">
  151. <table>
  152. <tr>
  153. <th class="Importent">标题:</th>
  154. <td colspan="7">
  155. <input id="title" type="text" style="width: 100%;" />
  156. </td>
  157. </tr>
  158. <tr>
  159. <th class="Importent">内容:</th>
  160. <td colspan="7">
  161. <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%;"></textarea>
  162. </td>
  163. </tr>
  164. <tr>
  165. <th>附件上传:</th>
  166. <td colspan="7">
  167. <div class="fileBox"></div>
  168. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  169. <input class="input" type="button" value="上传" id="scwj" />
  170. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  171. <input type="hidden" id="file" />
  172. <!--</br>-->
  173. <span style="color:#FF0000; border: none;">
  174. (文件格式为png,jpg,mp4,avi,wmv,mp3,pdf,doc,docx,xls,xlsx)
  175. </span>
  176. </td>
  177. </tr>
  178. <tr>
  179. <th>处理方式:</th>
  180. <td colspan="7">
  181. <input type="radio" value="1" name="banli" class="Nows" />当即办理
  182. <input checked="true" type="radio" value="0" name="banli" class="Nows_" />网络转办
  183. </td>
  184. </tr>
  185. <tr class="Nows_box Hidens">
  186. <th>办理内容:</th>
  187. <td colspan="7">
  188. <input type="text" style="width: 100%;" id="result" />
  189. </td>
  190. </tr>
  191. <tr>
  192. <th class="">来电人:</th>
  193. <td>
  194. <input type="text" id="cusname" />
  195. </td>
  196. <th>性别:</th>
  197. <td>
  198. <select class="select_" id="cussex">
  199. <option value="">请选择</option>
  200. <option value="0">男</option>
  201. <option value="1">女</option>
  202. </select>
  203. </td>
  204. <th>来源:</th>
  205. <td>
  206. <select class="select_" id="source"></select>
  207. </td>
  208. <th class="Importent">来电号码:</th>
  209. <td>
  210. <input type="text" id="cusphone" />
  211. </td>
  212. </tr>
  213. <tr>
  214. <th>类型:</th>
  215. <td>
  216. <select class="select_" id="type"></select>
  217. </td>
  218. <th class="Importent">反映类别:</th>
  219. <td style="position: relative">
  220. <div class="inpBox">
  221. <input type="text" class="inps" onkeyup="darptSearch()" />
  222. <i class="Cleans fa fa-close"></i>
  223. <i class="xl xl_one"></i>
  224. <div class="addTree xlAdd">
  225. <ul id="addTreeDemo" class="ztree"></ul>
  226. </div>
  227. </div>
  228. <div class="selDpart1">
  229. <ul id="sponsor"></ul>
  230. </div>
  231. </td>
  232. <th>来电号码密级:</th>
  233. <td>
  234. <input type="radio" name="mj" id="" value="0" />普通
  235. <input type="radio" name="mj" id="" value="1" checked="checked" />保密
  236. </td>
  237. <th class="Importent">紧急程度:</th>
  238. <td>
  239. <select class="select_" id="level">
  240. <!--<option value="0">选择</option>-->
  241. <option value="1">普通</option>
  242. <option value="2">紧急</option>
  243. </select>
  244. </td>
  245. </tr>
  246. <tr>
  247. <td colspan="8" style="text-align: center;">
  248. <div class="btn_box">
  249. <button class="btns BC">保存</button>
  250. <button class="btns SavedSubmit">保存并提交</button>
  251. </div>
  252. </td>
  253. </tr>
  254. <tr>
  255. <th>事件地址:</th>
  256. <td colspan="7">
  257. <select class="select_" id="sourcearea"></select>
  258. </td>
  259. </tr>
  260. <tr>
  261. <th class="Importent"></th>
  262. <td colspan="7">
  263. <input id="sourceaddress" type="text" placeholder="输入详细地址" style="width:50%; padding-left: 15px;" />
  264. </td>
  265. </tr>
  266. <tr>
  267. <th class="Importent"></th>
  268. <td colspan="7">
  269. <div style="width:710px">
  270. <div id="myMap" style="width:100%;height:400px;"></div>
  271. <input type="hidden" class="store_Lng" value="114.352482" />
  272. <input type="hidden" class="store_Lat" value="36.103442" />
  273. </div>
  274. </td>
  275. </tr>
  276. </table>
  277. </div>
  278. </div>
  279. </div>
  280. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  281. <script src="../css/laydate/laydate.js"></script>
  282. <script src="../js/adjustHeight.js"></script>
  283. <script src="../js/zTree/jquery.ztree.core.js"></script>
  284. <script src="../js/appeal/index1.js"></script>
  285. <script>
  286. var submit;
  287. $(document).ready(function() {
  288. QY($("#sourcearea"));
  289. LY($("#source"));
  290. LB($("#type"));
  291. ZT($("#keys"));
  292. tree();
  293. //所属分类下拉
  294. $('.inps').focus(function () {
  295. $('.xlAdd').css('display', 'block')
  296. })
  297. $('.xl').click(function () {
  298. if ($('.xlAdd').css('display') == 'block') {
  299. $('.xlAdd').css('display', 'none')
  300. } else {
  301. $('.xlAdd').css('display', 'block')
  302. }
  303. })
  304. $('.Cleans').click(function () {
  305. $(".inps").val(treeNode.text);
  306. $("#PID").val(treeNode.id);
  307. $("#Dpment").val(treeNode.id);
  308. $(".Cleans").show();
  309. })
  310. $('.addTree').mouseleave(function () {
  311. $(this).css('display', 'none')
  312. })
  313. //当即办理
  314. $(' input[name="banli"]').change(function() {
  315. var val = $(this).val();
  316. if(val == "1") {
  317. $(".Nows_box").show();
  318. } else {
  319. $(".Nows_box").hide();
  320. }
  321. })
  322. $(".BC").click(function() {
  323. submit = 0;
  324. Add();
  325. })
  326. $('.SavedSubmit').click(function() {
  327. submit = 1;
  328. Add();
  329. })
  330. //上传附件
  331. $("#scwj").click(function() {
  332. $("#upFile").trigger("click");
  333. })
  334. $("#upFile").change(function() {
  335. upload();
  336. })
  337. $("#scfj").click(function() {
  338. // $(".fjnr").text("");
  339. // $("#scfj").hide();
  340. })
  341. });
  342. //添加工单
  343. function Add() {
  344. var value = $(' input[name="banli"]:checked ').val();
  345. var content = $("#content").val();
  346. // if (!$("#cusname").val()) {
  347. // layer.msg("请输入姓名");
  348. // } else
  349. if(!$("#cusphone").val()) {
  350. layer.msg("请输入来电号码");
  351. // } else if (!$("#conphone").val()) {
  352. // layer.msg("请输入联系电话");
  353. } else if(!$("#title").val()) {
  354. layer.msg("请输入标题");
  355. } else if(!$("#content").val()) {
  356. layer.msg("请输入内容");
  357. } else if(!$("#keys").val()) {
  358. layer.msg("请选择主题词");
  359. // } else if (!$("#sourcearea").val()) {
  360. // layer.msg("请选择事发区域");
  361. } else if(value == 1 && !$('#result').val()) {
  362. layer.msg("请输入直办内容");
  363. } else {
  364. $.ajax({
  365. type: "post",
  366. url: huayi.config.callcenter_url + "/WorkOrder/AddWorkOrder",
  367. dataType: 'json',
  368. async: true,
  369. beforeSend: function() { //触发ajax请求开始时执行
  370. $('.BC').attr("disabled", true);
  371. $('.SavedSubmit').attr("disabled", true);
  372. $('.BC').text('提交中...');
  373. $('.SavedSubmit').text('提交中...');
  374. $(document).off('click', '.BC', Add);
  375. $(document).off('click', '.SavedSubmit', Add);
  376. },
  377. data: {
  378. cusname: $("#cusname").val(), //=来电人姓名
  379. cussex: $("#cussex").val(),
  380. cusphone: $("#cusphone").val(), //=来电人电话
  381. email: $("#email").val(),
  382. zipcode: $("#zipcode").val(),
  383. conphone: $("#conphone").val(),
  384. title: $("#title").val(),
  385. content: $("#content").val(),
  386. files: $("#file").val(), //(多个用英文逗号,隔开)
  387. sourcearea: $("#sourcearea").val(), //=事发地域id
  388. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  389. longitude: $('.store_Lng').val(),
  390. latitude: $('.store_Lat').val(),
  391. source: $("#source").val(), //=来源
  392. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  393. result: $('#result').val(),
  394. keys: $("#keys").val(), //=关键词id(多个用英文逗号,隔开)
  395. type: $("#type").val(), //=类型
  396. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  397. level: $('#level').val(), //=(1普通2紧急)
  398. issubmit: submit, //=(0保存1保存并提交)
  399. token: $.cookie("token")
  400. },
  401. success: function(data) {
  402. debugger
  403. $('.BC').attr("disabled", false);
  404. $('.SavedSubmit').attr("disabled", false);
  405. $('.BC').text('保存');
  406. $('.SavedSubmit').text('保存并提交');
  407. $(document).on('click', '.BC', Add);
  408. $(document).on('click', '.SavedSubmit', Add);
  409. Clean();
  410. $('.fileBox').html('');
  411. layer.msg("创建工单成功");
  412. }
  413. });
  414. }
  415. }
  416. //上传文件
  417. function upload() {
  418. var Files = document.getElementById("upFile").files;
  419. console.log(Files);
  420. if(Files.length > 0) {
  421. debugger
  422. var formData = new FormData();
  423. for(var i = 0; i < Files.length; i++) {
  424. formData.append('file' + i, Files[i]);
  425. }
  426. formData.append("token", $.cookie("token"));
  427. var typeName = Files[0].name.split('.')[1];
  428. if(typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName == 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' || typeName == 'xls' || typeName == 'xlsx') {
  429. $.ajax({
  430. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  431. type: "POST",
  432. data: formData,
  433. /**
  434. *必须false才会自动加上正确的Content-Type
  435. */
  436. contentType: false,
  437. /**
  438. * 必须false才会避开jQuery对 formdata 的默认处理
  439. * XMLHttpRequest会对 formdata 进行正确的处理
  440. */
  441. processData: false,
  442. success: function(result) {
  443. debugger
  444. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  445. $("#upFile").change(function() {
  446. upload();
  447. });
  448. var r = $.parseJSON(result);
  449. if(r.state.toLowerCase() == "success") {
  450. var a = r.data;
  451. $(a).each(function(i, n) {
  452. var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  453. $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event) {
  454. event.stopPropagation();
  455. $(this).parent().remove();
  456. file_num()
  457. })
  458. })
  459. file_num();
  460. }
  461. }
  462. });
  463. } else {
  464. layer.msg("格式不正确");
  465. }
  466. } else {
  467. layer.confirm('请上传文件!', {
  468. btn: ['确定']
  469. });
  470. }
  471. }
  472. //上传文件隐藏域值
  473. function file_num() {
  474. var str = '';
  475. var Str;
  476. $('.fileBox .files').each(function(j, m) {
  477. var aa = $(m).attr("fiel-num")
  478. console.log(aa);
  479. str += aa + ",";
  480. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  481. })
  482. $("#file").val(Str);
  483. }
  484. //来源
  485. function LY(obj) {
  486. obj.empty();
  487. $.ajax({
  488. type: "get",
  489. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  490. dataType: "json",
  491. async: true,
  492. data: {
  493. "token": $.cookie("token"),
  494. id: 1
  495. },
  496. success: function(data) {
  497. if(data.state.toLowerCase() == "success") {
  498. var content = data.data;
  499. $(content).each(function(i, n) {
  500. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  501. })
  502. }
  503. }
  504. });
  505. }
  506. //类别
  507. function LB(obj) {
  508. obj.empty();
  509. $.ajax({
  510. type: "get",
  511. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  512. dataType: "json",
  513. async: true,
  514. data: {
  515. "token": $.cookie("token"),
  516. id: 2
  517. },
  518. success: function(data) {
  519. if(data.state.toLowerCase() == "success") {
  520. var content = data.data;
  521. $(content).each(function(i, n) {
  522. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  523. })
  524. }
  525. }
  526. });
  527. }
  528. // 主题
  529. function ZT(obj) {
  530. obj.empty();
  531. $.ajax({
  532. type: "get",
  533. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  534. dataType: "json",
  535. async: true,
  536. data: {
  537. "token": $.cookie("token"),
  538. type: 1,
  539. id: 3
  540. },
  541. success: function(data) {
  542. if(data.state.toLowerCase() == "success") {
  543. var content = data.data;
  544. $(content).each(function(i, n) {
  545. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  546. })
  547. }
  548. }
  549. });
  550. }
  551. //区域
  552. function QY(obj) {
  553. obj.empty();
  554. obj.append('<option selected="selected" value="">请选择</option>');
  555. $.ajax({
  556. type: "get",
  557. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  558. dataType: "json",
  559. async: true,
  560. data: {
  561. "token": $.cookie("token"),
  562. },
  563. success: function(data) {
  564. if(data.state.toLowerCase() == "success") {
  565. var content = data.data;
  566. $(content).each(function(i, n) {
  567. if(n.F_AreaName == "安阳市") {
  568. $("<option selected='selected' value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  569. } else {
  570. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  571. }
  572. })
  573. }
  574. }
  575. });
  576. }
  577. function Clean() {
  578. $("#cusname").val(''); //=来电人姓名
  579. $("#cussex").val('');
  580. $("#cusphone").val(''); //=来电人电话
  581. $("#email").val('');
  582. $("#zipcode").val('');
  583. $("#conphone").val('');
  584. $("#title").val('');
  585. $("#content").val('');
  586. $("#sourcearea").val(); //=事发地域id
  587. $('#sourceaddress').val(''); //=事发详细地址
  588. $("input[name='baomi'][value='1']").prop("checked", true) //=(0转办1直办)
  589. $("#type option:first").prop("selected", 'selected');
  590. $("#level option:first").prop("selected", 'selected');
  591. $("#keys option:first").prop("selected", 'selected');
  592. $("#sourcearea option:first").prop("selected", 'selected');
  593. $('#result').val('');
  594. }
  595. function tree() {
  596. $.get(
  597. huayi.config.callcenter_url + "Dictionary/GetZTreeList", {
  598. token: $.cookie("token"),
  599. pid:38
  600. },
  601. function(result) {
  602. result = $.parseJSON(result);
  603. $.fn.zTree.init(
  604. $("#addTreeDemo"),
  605. setting1,
  606. result.data
  607. ); //实例化树形图
  608. }
  609. );
  610. }
  611. var setting1 = {
  612. data: {
  613. key: {
  614. name: "text"
  615. },
  616. simpleData: {
  617. enable: true,
  618. idKey: "id",
  619. rootPId: 0
  620. }
  621. },
  622. callback: {
  623. onClick: zTreeOnClick,
  624. },
  625. };
  626. function zTreeOnClick(event, treeId, treeNode) {
  627. //if(treeNode.level >= 2) {
  628. $(".inps").val(treeNode.text);
  629. $("#PID").val(treeNode.id);
  630. $("#Dpment").val(treeNode.id);
  631. $(".Cleans").show();
  632. //}
  633. }
  634. function Close() {
  635. $(".lyxz").removeClass("cx");
  636. if($("audio").length > 0) {
  637. $("audio")[0].pause();
  638. }
  639. }
  640. </script>
  641. </body>
  642. </html>