商丘12345 前端

AddAppeal.html 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  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/layui/css/layui.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. input, select {
  25. vertical-align: middle;
  26. }
  27. .reflectCategory-wrapper {
  28. position: relative;
  29. }
  30. .reflectCategoryList-wrapper {
  31. display: none;
  32. position: absolute;
  33. top: 38px;
  34. z-index: 9999;
  35. line-height: 32px;
  36. background: #FFF;
  37. }
  38. #reflectCategoryList {
  39. height: 240px;
  40. background: #FFF;
  41. border: 1px solid #e5e6e7;
  42. overflow: auto;
  43. }
  44. #reflectCategoryList li {
  45. padding: 0 10px;
  46. width: 100%;
  47. line-height: 32px;
  48. }
  49. .layui-menu-body-title{
  50. font-size: 12px;
  51. }
  52. #reflectCategoryList li:hover {
  53. background: #00a1cb;
  54. }
  55. .layui-menu li {
  56. margin: 0 !important;
  57. padding: 2px 15px !important;
  58. height: 16px;
  59. line-height: 12px !important;
  60. font-size: 12px !important;
  61. }
  62. </style>
  63. </head>
  64. <body>
  65. <div class="wrapper wrapper-content animated fadeInRight">
  66. <div style="padding: 10px;" class="tj_content clearFix">
  67. <div class="Common">
  68. <table>
  69. <tr>
  70. <th class="Importent">姓名:</th>
  71. <td>
  72. <input type="text" id="cusname" />
  73. </td>
  74. <th>性别:</th>
  75. <td>
  76. <select class="select_" id="SEX">
  77. <option value="">请选择</option>
  78. <option value="0">男</option>
  79. <option value="1">女</option>
  80. </select>
  81. </td>
  82. <th>来源:</th>
  83. <td>
  84. <select class="select_" id="source"></select>
  85. </td>
  86. <th class="Importent">投诉电话:</th>
  87. <td>
  88. <input type="text" id="cusphone" />
  89. </td>
  90. </tr>
  91. <tr>
  92. <th>邮箱:</th>
  93. <td>
  94. <input type="text" id="email" />
  95. </td>
  96. <th>邮编:</th>
  97. <td>
  98. <input type="text" id="zipcode" />
  99. </td>
  100. <th>联系电话:</th>
  101. <td>
  102. <input type="text" id="conphone" />
  103. </td>
  104. </tr>
  105. <tr>
  106. <th class="Importent">标题:</th>
  107. <td colspan="7">
  108. <input id="title" type="text" style="width: 100%;" />
  109. </td>
  110. </tr>
  111. <tr>
  112. <th class="Importent">内容:</th>
  113. <td colspan="7">
  114. <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%;"></textarea>
  115. </td>
  116. </tr>
  117. <tr>
  118. <th class="Importent">反映类别: </th>
  119. <td class="reflectCategory-wrapper" colspan="4">
  120. <input type="text" id="reflectCategory" autocomplete="off" style="width: 100%;" />
  121. <div class="reflectCategoryList-wrapper">
  122. <ul id="reflectCategoryList">
  123. </ul>
  124. </div>
  125. </td>
  126. </tr>
  127. <tr>
  128. <th class="Importent">事件地址: </th>
  129. <td colspan="7">
  130. <select class="select_" id="sourcearea"></select>
  131. </td>
  132. </tr>
  133. <tr>
  134. <th class="Importent"></th>
  135. <td colspan="7">
  136. <input id="sourceaddress" type="text" placeholder="输入详细地址" style="width:50%; padding-left: 15px;" />
  137. </td>
  138. </tr>
  139. <tr>
  140. <th class="Importent"></th>
  141. <td colspan="7">
  142. <div style="width:710px">
  143. <div id="myMap" style="width:100%;height:400px;"></div>
  144. <input type="hidden" class="store_Lng" value="115.659773"/>
  145. <input type="hidden" class="store_Lat" value="34.395449"/>
  146. </div>
  147. </td>
  148. </tr>
  149. <tr>
  150. <th>附件上传:</th>
  151. <td colspan="7">
  152. <div class="fileBox">
  153. </div>
  154. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  155. <input class="input" type="button" value="上传" id="scwj" />
  156. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  157. <input type="hidden" id="file" />
  158. <span style="color:#FF0000; border: none;">
  159. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  160. </span>
  161. </td>
  162. </tr>
  163. <tr>
  164. <th>处理方式:</th>
  165. <td colspan="7">
  166. <input type="radio" value="1" name="banli" class="Nows" />当即办理
  167. <input checked="true" type="radio" value="0" name="banli" class="Nows_" />网络转办
  168. </td>
  169. </tr>
  170. <tr class="Nows_box Hidens">
  171. <th>办理内容:</th>
  172. <td colspan="7">
  173. <input type="text" style="width: 100%;" id="result" />
  174. </td>
  175. </tr>
  176. <tr>
  177. <th class="Importent">主题词:</th>
  178. <td>
  179. <select class="select_" id="keys">
  180. <option value=""></option>
  181. </select>
  182. </td>
  183. <th>类型:</th>
  184. <td>
  185. <select class="select_" id="type"></select>
  186. </td>
  187. <th>密级:</th>
  188. <td>
  189. <input type="radio" name="mj" id="" value="0" />普通
  190. <input type="radio" name="mj" id="" value="1" />保密
  191. </td>
  192. <th>紧急程度:</th>
  193. <td>
  194. <select class="select_" id="level">
  195. <option value="1">普通</option>
  196. <option value="2">紧急</option>
  197. </select>
  198. </td>
  199. </tr>
  200. </table>
  201. <div class="btn_box">
  202. <button class="btns BC">保存</button>
  203. </div>
  204. </div>
  205. </div>
  206. </div>
  207. <input type="hidden" id="keyvalue" />
  208. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  209. <script src="../js/layui/layui.js"></script>
  210. <script src="../css/laydate/laydate.js"></script>
  211. <script src="../js/adjustHeight.js"></script>
  212. <script src="../js/appeal/index.js"></script>
  213. <script src="../js/commonJS/index.js"></script>
  214. <script src="../Script/Common/huayi.common.js"></script>
  215. <script>
  216. var wid = helper.request.queryString("wid");
  217. var submit;
  218. $(document).ready(function () {
  219. QY($("#sourcearea"));
  220. LY($("#source"));
  221. LB($("#type"));
  222. ZT($("#keys"))
  223. //当即办理
  224. $(' input[name="banli"]').change(function () {
  225. var val = $(this).val();
  226. if (val == "1") {
  227. $(".Nows_box").show();
  228. } else {
  229. $(".Nows_box").hide();
  230. }
  231. })
  232. $(".BC").click(function () {
  233. submit = 0;
  234. Add()
  235. });
  236. //上传附件
  237. $("#scwj").click(function () {
  238. $("#upFile").trigger("click");
  239. })
  240. $("#upFile").change(function () {
  241. upload('upFile','.fileBox',['png','jpg','mp3','mp4','pdf','doc','docx','xls','xlsx'],'#file');
  242. })
  243. $(".SavedSubmit").click(function () {
  244. submit = 1;
  245. Add()
  246. })
  247. if (wid) {
  248. $.ajax({
  249. type: "get",
  250. url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrder",
  251. dataType: 'json',
  252. async: false,
  253. data: {
  254. workorderid: wid,
  255. token: $.cookie("token")
  256. },
  257. success: function (data) {
  258. if (data.state.toLowerCase() == "success") {
  259. var Data = data.data.data;
  260. $("#cusname").val(Data[0].F_CusName);
  261. $("#cusphone").val(Data[0].F_CusPhone);
  262. $("#conphone").val(Data[0].F_ConPhone);
  263. $("#title").val(Data[0].F_ComTitle);
  264. $('#content').val(Data[0].F_ComContent);
  265. $('#email').val(Data[0].F_Email);
  266. $("#zipcode").val(Data[0].F_ZipCode);
  267. $("#result").val(Data[0].F_Result);
  268. $("#reflectCategory").val(Data[0].KeyValueName)
  269. $("#keyvalue").val(Data[0].F_KeyValue)
  270. if (Data[0].F_Longitude) {
  271. $(".store_Lng").val(Data[0].F_Longitude);
  272. $(".store_Lat").val(Data[0].F_Latitude);
  273. }
  274. //x性别
  275. $("#SEX option:selected").val(Data[0].F_CusSex + '');
  276. if (Data[0].F_CusSex=="0") {
  277. $("#SEX option:selected").text("男");
  278. } else{
  279. $("#SEX option:selected").text("女");
  280. }
  281. //来源
  282. $("#source option:selected").val(Data[0].F_InfoSource + '');
  283. $("#source option:selected").text(Data[0].SourceName); //来源
  284. //事件地址
  285. $("#sourcearea option:selected").val(Data[0].F_SourceArea + '');
  286. $("#sourcearea option:selected").text(Data[0].AreaName); //事件地址
  287. //主题词
  288. $("#keys option:selected").val(Data[0].F_Key + '');
  289. $("#keys option:selected").text(Data[0].KeyName); //主题词
  290. //类型
  291. $("#type option:selected").val(Data[0].F_InfoType + '');
  292. $("#type option:selected").text(Data[0].TypeName1); //类型
  293. //紧急程度
  294. $("#level").val(Data[0].F_Level + '');
  295. if (Data[0].F_Level=="1") {
  296. $("#level option:selected").text("普通"); //乡镇
  297. } else{
  298. $("#level option:selected").text("紧急"); //乡镇
  299. }
  300. if (Data[0].F_IsResult == 1) {
  301. $(".Nows_box").toggle();
  302. }
  303. $(' input[name="mj"][value="' + Data[0].F_IsProtect + '"]').prop("checked", "checked");
  304. $(' input[name="banli"][value="' + Data[0].F_IsResult + '"]').prop("checked", "checked");
  305. $('#sourceaddress').val(Data[0].F_SourceAddress);
  306. $('.F_FinalOpinion').val(Data[0].F_FinalOpinion);
  307. $(Data[0].File).each(function (k, q) {
  308. var strs = '<span class="files" fiel-num="' + q.F_FileId + '">' + q.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  309. $(strs).appendTo($('.fileBox')).find('.del_file').click(function (event) {
  310. event.stopPropagation();
  311. $(this).parent().remove();
  312. file_num()
  313. })
  314. file_num()
  315. })
  316. }
  317. }
  318. });
  319. }
  320. });
  321. ///修改工单
  322. function Add() {
  323. var value = $(' input[name="banli"]:checked ').val();
  324. var content = $("#content").val();
  325. if (!$("#cusname").val()) {
  326. layer.msg("请输入姓名");
  327. } else if (!$("#cusphone").val()) {
  328. layer.msg("请输入投诉电话");
  329. } else if (!$("#title").val()) {
  330. layer.msg("请输入标题");
  331. } else if (!$("#content").val()) {
  332. layer.msg("请输入内容");
  333. } else if (!$("#keys").val()) {
  334. layer.msg("请选择主题词");
  335. } else if (!$("#sourcearea").val()) {
  336. layer.msg("请选择事发区域");
  337. } else if (value == 1 && !$('#result').val()) {
  338. layer.msg("请输入直办内容");
  339. } else {
  340. $.ajax({
  341. type: "post",
  342. url: huayi.config.callcenter_url + "WorkOrder/EditWorkOrder",
  343. dataType: 'json',
  344. async: true,
  345. data: {
  346. workorderid: wid,
  347. cusname: $("#cusname").val(), //=投诉人姓名
  348. cussex: $("#SEX").val(),
  349. cusphone: $("#cusphone").val(), //=投诉人电话
  350. email: $("#email").val(),
  351. zipcode: $("#zipcode").val(),
  352. conphone: $("#conphone").val(),
  353. title: $("#title").val(),
  354. content: $("#content").val(),
  355. files: $("#file").val(), //(多个用英文逗号,隔开)
  356. sourcearea: $("#sourcearea").val(), //=事发地域id
  357. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  358. source: $("#source").val(), //=来源
  359. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  360. result: $('#result').val(),
  361. keys: $("#keys").val(), //=关键词id(多个用英文逗号,隔开)
  362. type: $("#type").val(), //=类型
  363. bigtype: $("#bigtype").val(), //=大类别
  364. keyvalue:$("#keyvalue").val(), //反映类别
  365. smalltype: $("#smalltype").val(), //=小类别
  366. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  367. level: $('#level').val(), //=(1普通2紧急)
  368. issubmit: submit, //=(0保存1保存并提交)
  369. token: $.cookie("token")
  370. },
  371. success: function (data) {
  372. if (data.state.toLowerCase() == "success") {
  373. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  374. parent.layer.close(index); //再执行关闭
  375. parent.$('#orderlist').bootstrapTable('refresh');
  376. parent.layer.msg(data.message);
  377. $('.fileBox').html('');
  378. }
  379. }
  380. });
  381. }
  382. }
  383. //上传文件隐藏域值
  384. function file_num() {
  385. var str = '';
  386. var Str;
  387. $('.fileBox .files').each(function (j, m) {
  388. var aa = $(m).attr("fiel-num")
  389. console.log(aa);
  390. str += aa + ",";
  391. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  392. })
  393. $("#file").val(Str);
  394. }
  395. //来源
  396. function LY(obj) {
  397. obj.empty();
  398. obj.append('<option selected="selected" value="">请选择</option>');
  399. $.ajax({
  400. type:"get",
  401. url:huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  402. dataType:"json",
  403. async:false,
  404. data:{
  405. "token": $.cookie("token"),
  406. id: 1
  407. },
  408. success:function(data){
  409. if (data.state.toLowerCase() == "success") {
  410. var content = data.data;
  411. $(content).each(function (i, n) {
  412. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  413. })
  414. }
  415. }
  416. });
  417. }
  418. //类别
  419. function LB(obj) {
  420. obj.empty();
  421. obj.append('<option selected="selected" value="">请选择</option>');
  422. $.ajax({
  423. type:"get",
  424. url:huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  425. dataType:"json",
  426. async:false,
  427. data:{
  428. "token": $.cookie("token"),
  429. id: 2
  430. },
  431. success:function(data){
  432. if (data.state.toLowerCase() == "success") {
  433. var content = data.data;
  434. $(content).each(function (i, n) {
  435. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  436. })
  437. }
  438. }
  439. });
  440. }
  441. // 主题
  442. function ZT(obj) {
  443. obj.empty();
  444. obj.append('<option selected="selected" value="">请选择</option>');
  445. $.ajax({
  446. type:"get",
  447. url:huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  448. dataType:"json",
  449. async:false,
  450. data:{
  451. "token": $.cookie("token"),
  452. id: 3
  453. },
  454. success:function(data){
  455. if (data.state.toLowerCase() == "success") {
  456. var content = data.data;
  457. $(content).each(function (i, n) {
  458. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  459. })
  460. }
  461. }
  462. });
  463. }
  464. //区域
  465. function QY(obj) {
  466. obj.empty();
  467. obj.append('<option selected="selected" value="">请选择</option>');
  468. $.ajax({
  469. type:"get",
  470. url:huayi.config.callcenter_url + "Area/GetAreaListById",
  471. dataType:"json",
  472. async:false,
  473. data:{
  474. "token": $.cookie("token"),
  475. },
  476. success:function(data){
  477. if (data.state.toLowerCase() == "success") {
  478. var content = data.data;
  479. $(content).each(function (i, n) {
  480. if (n.F_AreaName != '商丘市') {
  481. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  482. }
  483. })
  484. }
  485. }
  486. });
  487. }
  488. // //上传文件
  489. // function upload() {
  490. // var Files = document.getElementById("upFile").files;
  491. // if (Files.length > 0) {
  492. // var formData = new FormData();
  493. // for (var i = 0; i < Files.length; i++) {
  494. // formData.append('file' + i, Files[i]);
  495. // }
  496. // formData.append("token", $.cookie("token"));
  497. // var typeName=Files[0].name.split('.')[1];
  498. // if (typeName=="png"||typeName=='jpg'||typeName=='mp4'||typeName=='mp3'||typeName=='pdf'||typeName=='doc'||typeName=='docx'||typeName=='xls'||typeName=='xlsx') {
  499. // $.ajax({
  500. // url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  501. // type: "POST",
  502. // data: formData,
  503. // /**
  504. // *必须false才会自动加上正确的Content-Type
  505. // */
  506. // contentType: false,
  507. // /**
  508. // * 必须false才会避开jQuery对 formdata 的默认处理
  509. // * XMLHttpRequest会对 formdata 进行正确的处理
  510. // */
  511. // processData: false,
  512. // success: function (result) {
  513. // document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  514. // $("#upFile").change(function () {
  515. // upload();
  516. // });
  517. // var r = $.parseJSON(result);
  518. // if (r.state.toLowerCase() == "success") {
  519. // var a = r.data;
  520. // $(a).each(function (i, n) {
  521. // var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  522. // $(strs).appendTo($('.fileBox')).find('.del_file').click(function (event) {
  523. // event.stopPropagation();
  524. // $(this).parent().remove();
  525. // file_num()
  526. // })
  527. // })
  528. // file_num();
  529. // }
  530. // }
  531. // });
  532. // }else{
  533. // layer.msg("格式不正确");
  534. // }
  535. // } else {
  536. // layer.confirm('请上传文件!', {
  537. // btn: ['确定']
  538. // });
  539. // }
  540. // }
  541. </script>
  542. </body>
  543. </html>