新野县12345_前端

AddAppeal.html 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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="../js/zTree/zTreeStyle.css" />
  9. <link rel="stylesheet" href="../css/init.css" />
  10. <title>新增诉求工单</title>
  11. <style type="text/css">
  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. /*tree下拉菜单*/
  25. .inpBox {
  26. border: 1px solid #A9A9A9;
  27. height: 34px;
  28. width: 220px;
  29. display: inline-block;
  30. position: relative;
  31. vertical-align: middle;
  32. }
  33. .addTree {
  34. background: #fff;
  35. position: absolute;
  36. width: 100%;
  37. border: 1px solid #e5e6e7;
  38. right: 0;
  39. top: 33px;
  40. display: none;
  41. z-index: 222;
  42. }
  43. .xl {
  44. display: inline-block;
  45. background: url(../../img/dropDown.png) no-repeat;
  46. height: 100%;
  47. background-position: center center;
  48. width: 20px;
  49. position: absolute;
  50. right: 0;
  51. top: 0px;
  52. /* background-color: #f7bc8b; */
  53. cursor: pointer;
  54. z-index: 33;
  55. }
  56. .ztree li span {
  57. border: none;
  58. padding: 0;
  59. }
  60. .inps {
  61. width: 217px;
  62. height: 32px;
  63. outline: none;
  64. border: 0;
  65. border-image-width: 0;
  66. padding: 0;
  67. padding-left: 3px;
  68. }
  69. .xl {
  70. display: inline-block;
  71. background: url(../img/dropDown.png) no-repeat;
  72. height: 100%;
  73. background-position: center center;
  74. width: 20px;
  75. position: absolute;
  76. right: 0;
  77. top: 0px;
  78. /* background-color: #f7bc8b; */
  79. cursor: pointer;
  80. }
  81. .Cleans {
  82. display: inline-block;
  83. width: 20px;
  84. position: absolute;
  85. right: 21px;
  86. top: 9px;
  87. display: none;
  88. }
  89. </style>
  90. </head>
  91. <body>
  92. <div class="wrapper wrapper-content animated fadeInRight">
  93. <div style="padding: 10px;" class="tj_content clearFix">
  94. <div class="Common">
  95. <table>
  96. <tr>
  97. <th class="Importent">姓名:</th>
  98. <td>
  99. <input type="text" id="cusname" />
  100. </td>
  101. <th>性别:</th>
  102. <td>
  103. <select class="select_" id="SEX">
  104. <option value="">请选择</option>
  105. <option value="0">男</option>
  106. <option value="1">女</option>
  107. </select>
  108. </td>
  109. <th>来源:</th>
  110. <td>
  111. <div class="inpBox" style="width: 172px;">
  112. <input type="text" style="width: 170px;" class="inps3" placeholder="请选择来源" />
  113. <i class="Cleans3 fa fa-close"></i>
  114. <i class="xl3 xl_one"></i>
  115. <div class="addTree xlAdd3">
  116. <ul id="addTreeDemo3" class="ztree">
  117. </ul>
  118. </div>
  119. </div>
  120. <!--<select class="select_" id="source">
  121. </select>-->
  122. </td>
  123. <th class="Importent">投诉电话:</th>
  124. <td>
  125. <input type="text" id="cusphone" />
  126. </td>
  127. </tr>
  128. <tr>
  129. <th>邮箱:</th>
  130. <td>
  131. <input type="text" id="email" />
  132. </td>
  133. <th>邮编:</th>
  134. <td>
  135. <input type="text" id="zipcode" />
  136. </td>
  137. <th>联系电话:</th>
  138. <td>
  139. <input type="text" id="conphone" />
  140. </td>
  141. <th class="Importent">主题词:</th>
  142. <td>
  143. <div class="inpBox" style="width: 132px;">
  144. <input type="text" style="width: 130px;" class="inps4" placeholder="请选择主题词" />
  145. <i class="Cleans4 fa fa-close"></i>
  146. <i class="xl4 xl_one"></i>
  147. <div class="addTree xlAdd4">
  148. <ul id="addTreeDemo4" class="ztree">
  149. </ul>
  150. </div>
  151. </div>
  152. <!--<input id="keys" type="text" placeholder="输入主题词" style="width:100%" />-->
  153. <!--<select class="select_" id="keys">
  154. <option value=""></option>
  155. </select>-->
  156. </td>
  157. </tr>
  158. <tr>
  159. <th>诉求分类:</th>
  160. <td>
  161. <div class="inpBox" style="width: 400px;">
  162. <input type="text" style="width: 398px;" class="inps" placeholder="请选择五级归口" />
  163. <i class="Cleans fa fa-close"></i>
  164. <i class="xl xl_one"></i>
  165. <div class="addTree xlAdd">
  166. <ul id="addTreeDemo" class="ztree">
  167. </ul>
  168. </div>
  169. </div>
  170. </td>
  171. </tr>
  172. <tr>
  173. <th class="Importent">标题:</th>
  174. <td colspan="7">
  175. <input id="title" type="text" style="width: 100%;" />
  176. </td>
  177. </tr>
  178. <tr>
  179. <th class="Importent">内容:</th>
  180. <td colspan="7">
  181. <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%;"></textarea>
  182. </td>
  183. </tr>
  184. <tr>
  185. <th class="Importent">事件地址:</th>
  186. <td colspan="7">
  187. <select class="select_" id="sourcearea">
  188. </select>
  189. <input id="sourceaddress" type="text" placeholder="输入详细地址" style="width:66%" />
  190. </td>
  191. </tr>
  192. <tr>
  193. <th>附件上传:</th>
  194. <td colspan="7">
  195. <div class="fileBox">
  196. </div>
  197. <!--<span class="fjnr"></span>-->
  198. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  199. <input class="input" type="button" value="上传" id="scwj" />
  200. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  201. <input type="hidden" id="file" />
  202. </td>
  203. </tr>
  204. <tr>
  205. <th>处理方式:</th>
  206. <td colspan="7">
  207. <input type="radio" value="1" name="banli" class="Nows" />当即办理
  208. <input checked="true" type="radio" value="0" name="banli" class="Nows_" />网络转办
  209. </td>
  210. </tr>
  211. <tr class="Nows_box Hidens">
  212. <th>办理内容:</th>
  213. <td colspan="7">
  214. <input type="text" style="width: 100%;" id="result" />
  215. </td>
  216. </tr>
  217. <tr>
  218. <th>类型:</th>
  219. <td>
  220. <div class="inpBox" style="width: 132px;">
  221. <input type="text" style="width: 130px;" class="inps2" placeholder="请选择类型" />
  222. <i class="Cleans2 fa fa-close"></i>
  223. <i class="xl2 xl_one"></i>
  224. <div class="addTree xlAdd2">
  225. <ul id="addTreeDemo2" class="ztree">
  226. </ul>
  227. </div>
  228. </div>
  229. <!--<select class="select_" id="type">
  230. </select>-->
  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" />保密
  236. </td>
  237. <th>紧急程度:</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. </table>
  247. <div class="btn_box" style="margin-top: 80px;">
  248. <button class="btns BC">保存</button>
  249. <button class="btns SavedSubmit">保存并提交</button>
  250. </div>
  251. <input type="hidden" id="PID" />
  252. <input type="hidden" id="type_id" />
  253. <input type="hidden" id="source_id" />
  254. <input type="hidden" id="theme_word_id" />
  255. </div>
  256. </div>
  257. </div>
  258. <script src="../css/laydate/laydate.js"></script>
  259. <script src="../js/adjustHeight.js"></script>
  260. <script src="../js/zTree/jquery.ztree.core.js"></script>
  261. <script src="../js/pull_down.js"></script>
  262. <script>
  263. var wid = helper.request.queryString("wid");
  264. var submit;
  265. $(document).ready(function() {
  266. QY($("#sourcearea"));
  267. LY($("#source"));
  268. LB($("#type"));
  269. ZT($("#keys"));
  270. tree();
  271. //所属分类下拉
  272. $('.inps').click(function() {
  273. $('.xlAdd').css('display', 'block')
  274. })
  275. $('.xl').click(function() {
  276. if($('.xlAdd').css('display') == 'block') {
  277. $('.xlAdd').css('display', 'none')
  278. } else {
  279. $('.xlAdd').css('display', 'block')
  280. }
  281. })
  282. $('.addTree').mouseleave(function() {
  283. $(this).css('display', 'none')
  284. })
  285. //清除
  286. $(".Cleans ").click(function() {
  287. $('.inps').val("");
  288. $("#PID").val("");
  289. $("#Dpment").val("");
  290. })
  291. //当即办理
  292. $(' input[name="banli"]').change(function() {
  293. var val = $(this).val();
  294. if(val == "1") {
  295. $(".Nows_box").show();
  296. } else {
  297. $(".Nows_box").hide();
  298. }
  299. })
  300. $(".BC").click(function() {
  301. submit = 0;
  302. Add()
  303. });
  304. //上传附件
  305. $("#scwj").click(function() {
  306. $("#upFile").trigger("click");
  307. })
  308. $("#upFile").change(function() {
  309. upload();
  310. })
  311. $(".SavedSubmit").click(function() {
  312. submit = 1;
  313. Add()
  314. })
  315. if(wid) {
  316. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrder', {
  317. workorderid: wid,
  318. "token": $.cookie("token")
  319. }, function(result) {
  320. if(result.state.toLowerCase() == "success") {
  321. var Data = result.data.data;
  322. $("#cusname").val(Data[0].F_CusName);
  323. $("#cusphone").val(Data[0].F_CusPhone);
  324. $("#conphone").val(Data[0].F_ConPhone);
  325. $("#title").val(Data[0].F_ComTitle);
  326. $('#content').val(Data[0].F_ComContent);
  327. $('#email').val(Data[0].F_Email);
  328. $("#zipcode").val(Data[0].F_ZipCode);
  329. $("#result").val(Data[0].F_Result);
  330. //x性别
  331. $("#SEX").val(Data[0].F_CusSex + '');
  332. //来源
  333. // $("#source").val(Data[0].F_InfoSource + '');
  334. $(".inps3").val(Data[0].SourceName);
  335. $("#source_id").val(Data[0].F_InfoSource+'');
  336. //事件地址
  337. $("#sourcearea").val(Data[0].F_SourceArea + '');
  338. //主题词
  339. // $("#keys").val(Data[0].F_Key + '');
  340. $(".inps4").val(Data[0].KeyName);
  341. $("#theme_word_id").val(Data[0].F_Key+'');
  342. //类型
  343. // $("#type").val(Data[0].F_InfoType + '');
  344. $(".inps2").val(Data[0].TypeName1);
  345. $("#type_id").val(Data[0].F_InfoType+'');
  346. //紧急程度
  347. $("#level").val(Data[0].F_Level + '');
  348. $(".inps").val(Data[0].DemandsTypeName);
  349. $("#PID").val(Data[0].F_DemandsTypeID);
  350. if(Data[0].F_IsResult == 1) {
  351. $(".Nows_box").toggle();
  352. }
  353. $(' input[name="mj"][value="' + Data[0].F_IsProtect + '"]').prop("checked", "checked");
  354. $(' input[name="banli"][value="' + Data[0].F_IsResult + '"]').prop("checked", "checked");
  355. $('#sourceaddress').val(Data[0].F_SourceAddress);
  356. $('.F_FinalOpinion').val(Data[0].F_FinalOpinion);
  357. $(Data[0].File).each(function(k, q) {
  358. var strs = '<span class="files" fiel-num="' + q.F_FileId + '">' + q.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  359. $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event) {
  360. event.stopPropagation();
  361. $(this).parent().remove();
  362. file_num()
  363. })
  364. file_num()
  365. })
  366. }
  367. })
  368. }
  369. });
  370. ///修改工单
  371. function Add() {
  372. var value = $(' input[name="banli"]:checked ').val();
  373. var content = $("#content").val();
  374. if(!$("#cusname").val()) {
  375. layer.msg("请输入姓名");
  376. } else if(!$("#cusphone").val()) {
  377. layer.msg("请输入投诉电话");
  378. } else if(!$("#title").val()) {
  379. layer.msg("请输入标题");
  380. } else if(!$("#content").val()) {
  381. layer.msg("请输入内容");
  382. } else if(!$("#theme_word_id").val()) {
  383. layer.msg("请选择主题词");
  384. } else if(!$("#sourcearea").val()) {
  385. layer.msg("请选择事发区域");
  386. } else if(value == 1 && !$('#result').val()) {
  387. layer.msg("请输入直办内容");
  388. } else {
  389. $.ajax({
  390. type: "post",
  391. url: huayi.config.callcenter_url + "WorkOrder/EditWorkOrder",
  392. dataType: 'json',
  393. async: true,
  394. data: {
  395. workorderid: wid,
  396. cusname: $("#cusname").val(), //=投诉人姓名
  397. cussex: $("#SEX").val(),
  398. cusphone: $("#cusphone").val(), //=投诉人电话
  399. email: $("#email").val(),
  400. zipcode: $("#zipcode").val(),
  401. conphone: $("#conphone").val(),
  402. title: $("#title").val(),
  403. content: $("#content").val(),
  404. files: $("#file").val(), //(多个用英文逗号,隔开)
  405. sourcearea: $("#sourcearea").val(), //=事发地域id
  406. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  407. source: $("#source_id").val(), //=来源
  408. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  409. result: $('#result').val(),
  410. keys: $("#theme_word_id").val(), //=关键词id(多个用英文逗号,隔开)
  411. type: $("#type_id").val(), //=类型
  412. bigtype: $("#bigtype").val(), //=大类别
  413. smalltype: $("#smalltype").val(), //=小类别
  414. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  415. level: $('#level').val(), //=(1普通2紧急)
  416. issubmit: submit, //=(0保存1保存并提交)
  417. demandstype:$("#PID").val(),
  418. token: $.cookie("token")
  419. },
  420. success: function(data) {
  421. if(data.state.toLowerCase() == "success") {
  422. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  423. parent.layer.close(index); //再执行关闭
  424. parent.load();
  425. parent.layer.msg(data.message);
  426. $('.fileBox').html('');
  427. }
  428. }
  429. });
  430. }
  431. }
  432. //上传文件隐藏域值
  433. function file_num() {
  434. var str = '';
  435. var Str;
  436. $('.fileBox .files').each(function(j, m) {
  437. var aa = $(m).attr("fiel-num")
  438. console.log(aa);
  439. str += aa + ",";
  440. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  441. })
  442. $("#file").val(Str);
  443. }
  444. //来源
  445. function LY(obj) {
  446. obj.empty();
  447. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  448. "token": $.cookie("token"),
  449. id: 1
  450. }, function(data) {
  451. if(data.state.toLowerCase() == "success") {
  452. var content = data.data;
  453. $(content).each(function(i, n) {
  454. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  455. })
  456. }
  457. })
  458. }
  459. //类别
  460. function LB(obj) {
  461. obj.empty();
  462. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  463. "token": $.cookie("token"),
  464. id: 2
  465. }, function(data) {
  466. if(data.state.toLowerCase() == "success") {
  467. var content = data.data;
  468. $(content).each(function(i, n) {
  469. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  470. })
  471. }
  472. })
  473. }
  474. // 主题
  475. function ZT(obj) {
  476. obj.empty();
  477. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  478. "token": $.cookie("token"),
  479. id: 3
  480. }, function(data) {
  481. if(data.state.toLowerCase() == "success") {
  482. var content = data.data;
  483. $(content).each(function(i, n) {
  484. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  485. })
  486. }
  487. })
  488. }
  489. //区域
  490. function QY(obj) {
  491. obj.empty();
  492. obj.append('<option selected="selected" value="">请选择</option>');
  493. $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
  494. "token": $.cookie("token"),
  495. }, function(data) {
  496. if(data.state.toLowerCase() == "success") {
  497. var content = data.data;
  498. $(content).each(function(i, n) {
  499. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  500. })
  501. }
  502. })
  503. }
  504. function tree() {
  505. $.get(huayi.config.callcenter_url + 'DemandsType/GetDeptListtree', {
  506. "token": $.cookie("token"),
  507. "iscbdw": 1
  508. }, function(result) {
  509. result = $.parseJSON(result);
  510. $.fn.zTree.init($("#addTreeDemo"), setting1, result.data); //实例化树形图
  511. });
  512. }
  513. var setting1 = {
  514. data: {
  515. key: {
  516. name: "text"
  517. },
  518. simpleData: {
  519. enable: true,
  520. idKey: "id",
  521. pIdKey: "F_PartentId",
  522. rootPId: 0
  523. }
  524. },
  525. callback: {
  526. onClick: zTreeOnClick
  527. }
  528. };
  529. function zTreeOnClick(event, treeId, treeNode) {
  530. $('.inps').val(treeNode.text);
  531. $("#PID").val(treeNode.id);
  532. $(".Cleans").show();
  533. };
  534. //上传文件
  535. function upload() {
  536. var Files = document.getElementById("upFile").files;
  537. if(Files.length > 0) {
  538. var formData = new FormData();
  539. for(var i = 0; i < Files.length; i++) {
  540. formData.append('file' + i, Files[i]);
  541. }
  542. formData.append("token", $.cookie("token"));
  543. $.ajax({
  544. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  545. type: "POST",
  546. data: formData,
  547. /**
  548. *必须false才会自动加上正确的Content-Type
  549. */
  550. contentType: false,
  551. /**
  552. * 必须false才会避开jQuery对 formdata 的默认处理
  553. * XMLHttpRequest会对 formdata 进行正确的处理
  554. */
  555. processData: false,
  556. success: function(result) {
  557. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  558. $("#upFile").change(function() {
  559. upload();
  560. });
  561. var r = $.parseJSON(result);
  562. if(r.state.toLowerCase() == "success") {
  563. var a = r.data;
  564. $(a).each(function(i, n) {
  565. var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  566. $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event) {
  567. event.stopPropagation();
  568. $(this).parent().remove();
  569. file_num()
  570. })
  571. })
  572. // $("#file").val(Str);
  573. // $("#scfj").show();
  574. file_num()
  575. }
  576. }
  577. });
  578. } else {
  579. layer.confirm('请上传文件!', {
  580. btn: ['确定']
  581. });
  582. }
  583. }
  584. </script>
  585. </body>
  586. </html>