商丘12345 前端

AddAppeal.html 23KB

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