商丘12345 前端

AddAppeal.html 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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>
  215. var wid = helper.request.queryString("wid");
  216. var submit;
  217. $(document).ready(function () {
  218. QY($("#sourcearea"));
  219. LY($("#source"));
  220. LB($("#type"));
  221. ZT($("#keys"))
  222. //当即办理
  223. $(' input[name="banli"]').change(function () {
  224. var val = $(this).val();
  225. if (val == "1") {
  226. $(".Nows_box").show();
  227. } else {
  228. $(".Nows_box").hide();
  229. }
  230. })
  231. $(".BC").click(function () {
  232. submit = 0;
  233. Add()
  234. });
  235. //上传附件
  236. $("#scwj").click(function () {
  237. $("#upFile").trigger("click");
  238. })
  239. $("#upFile").change(function () {
  240. upload();
  241. })
  242. $(".SavedSubmit").click(function () {
  243. submit = 1;
  244. Add()
  245. })
  246. if (wid) {
  247. $.ajax({
  248. type: "get",
  249. url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrder",
  250. dataType: 'json',
  251. async: false,
  252. data: {
  253. workorderid: wid,
  254. token: $.cookie("token")
  255. },
  256. success: function (data) {
  257. if (data.state.toLowerCase() == "success") {
  258. var Data = data.data.data;
  259. $("#cusname").val(Data[0].F_CusName);
  260. $("#cusphone").val(Data[0].F_CusPhone);
  261. $("#conphone").val(Data[0].F_ConPhone);
  262. $("#title").val(Data[0].F_ComTitle);
  263. $('#content').val(Data[0].F_ComContent);
  264. $('#email').val(Data[0].F_Email);
  265. $("#zipcode").val(Data[0].F_ZipCode);
  266. $("#result").val(Data[0].F_Result);
  267. $("#reflectCategory").val(Data[0].KeyValueName)
  268. $("#keyvalue").val(Data[0].F_KeyValue)
  269. if (Data[0].F_Longitude) {
  270. $(".store_Lng").val(Data[0].F_Longitude);
  271. $(".store_Lat").val(Data[0].F_Latitude);
  272. }
  273. //x性别
  274. $("#SEX option:selected").val(Data[0].F_CusSex + '');
  275. if (Data[0].F_CusSex=="0") {
  276. $("#SEX option:selected").text("男");
  277. } else{
  278. $("#SEX option:selected").text("女");
  279. }
  280. //来源
  281. $("#source option:selected").val(Data[0].F_InfoSource + '');
  282. $("#source option:selected").text(Data[0].SourceName); //来源
  283. //事件地址
  284. $("#sourcearea option:selected").val(Data[0].F_SourceArea + '');
  285. $("#sourcearea option:selected").text(Data[0].AreaName); //事件地址
  286. //主题词
  287. $("#keys option:selected").val(Data[0].F_Key + '');
  288. $("#keys option:selected").text(Data[0].KeyName); //主题词
  289. //类型
  290. $("#type option:selected").val(Data[0].F_InfoType + '');
  291. $("#type option:selected").text(Data[0].TypeName1); //类型
  292. //紧急程度
  293. $("#level").val(Data[0].F_Level + '');
  294. if (Data[0].F_Level=="1") {
  295. $("#level option:selected").text("普通"); //乡镇
  296. } else{
  297. $("#level option:selected").text("紧急"); //乡镇
  298. }
  299. if (Data[0].F_IsResult == 1) {
  300. $(".Nows_box").toggle();
  301. }
  302. $(' input[name="mj"][value="' + Data[0].F_IsProtect + '"]').prop("checked", "checked");
  303. $(' input[name="banli"][value="' + Data[0].F_IsResult + '"]').prop("checked", "checked");
  304. $('#sourceaddress').val(Data[0].F_SourceAddress);
  305. $('.F_FinalOpinion').val(Data[0].F_FinalOpinion);
  306. $(Data[0].File).each(function (k, q) {
  307. var strs = '<span class="files" fiel-num="' + q.F_FileId + '">' + q.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  308. $(strs).appendTo($('.fileBox')).find('.del_file').click(function (event) {
  309. event.stopPropagation();
  310. $(this).parent().remove();
  311. file_num()
  312. })
  313. file_num()
  314. })
  315. }
  316. }
  317. });
  318. }
  319. });
  320. ///修改工单
  321. function Add() {
  322. var value = $(' input[name="banli"]:checked ').val();
  323. var content = $("#content").val();
  324. if (!$("#cusname").val()) {
  325. layer.msg("请输入姓名");
  326. } else if (!$("#cusphone").val()) {
  327. layer.msg("请输入投诉电话");
  328. } else if (!$("#title").val()) {
  329. layer.msg("请输入标题");
  330. } else if (!$("#content").val()) {
  331. layer.msg("请输入内容");
  332. } else if (!$("#keys").val()) {
  333. layer.msg("请选择主题词");
  334. } else if (!$("#sourcearea").val()) {
  335. layer.msg("请选择事发区域");
  336. } else if (value == 1 && !$('#result').val()) {
  337. layer.msg("请输入直办内容");
  338. } else {
  339. $.ajax({
  340. type: "post",
  341. url: huayi.config.callcenter_url + "WorkOrder/EditWorkOrder",
  342. dataType: 'json',
  343. async: true,
  344. data: {
  345. workorderid: wid,
  346. cusname: $("#cusname").val(), //=投诉人姓名
  347. cussex: $("#SEX").val(),
  348. cusphone: $("#cusphone").val(), //=投诉人电话
  349. email: $("#email").val(),
  350. zipcode: $("#zipcode").val(),
  351. conphone: $("#conphone").val(),
  352. title: $("#title").val(),
  353. content: $("#content").val(),
  354. files: $("#file").val(), //(多个用英文逗号,隔开)
  355. sourcearea: $("#sourcearea").val(), //=事发地域id
  356. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  357. source: $("#source").val(), //=来源
  358. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  359. result: $('#result').val(),
  360. keys: $("#keys").val(), //=关键词id(多个用英文逗号,隔开)
  361. type: $("#type").val(), //=类型
  362. bigtype: $("#bigtype").val(), //=大类别
  363. keyvalue:$("#keyvalue").val(), //反映类别
  364. smalltype: $("#smalltype").val(), //=小类别
  365. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  366. level: $('#level').val(), //=(1普通2紧急)
  367. issubmit: submit, //=(0保存1保存并提交)
  368. token: $.cookie("token")
  369. },
  370. success: function (data) {
  371. if (data.state.toLowerCase() == "success") {
  372. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  373. parent.layer.close(index); //再执行关闭
  374. parent.$('#orderlist').bootstrapTable('refresh');
  375. parent.layer.msg(data.message);
  376. $('.fileBox').html('');
  377. }
  378. }
  379. });
  380. }
  381. }
  382. //上传文件隐藏域值
  383. function file_num() {
  384. var str = '';
  385. var Str;
  386. $('.fileBox .files').each(function (j, m) {
  387. var aa = $(m).attr("fiel-num")
  388. console.log(aa);
  389. str += aa + ",";
  390. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  391. })
  392. $("#file").val(Str);
  393. }
  394. //来源
  395. function LY(obj) {
  396. obj.empty();
  397. obj.append('<option selected="selected" value="">请选择</option>');
  398. $.ajax({
  399. type:"get",
  400. url:huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  401. dataType:"json",
  402. async:false,
  403. data:{
  404. "token": $.cookie("token"),
  405. id: 1
  406. },
  407. success:function(data){
  408. if (data.state.toLowerCase() == "success") {
  409. var content = data.data;
  410. $(content).each(function (i, n) {
  411. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  412. })
  413. }
  414. }
  415. });
  416. }
  417. //类别
  418. function LB(obj) {
  419. obj.empty();
  420. obj.append('<option selected="selected" value="">请选择</option>');
  421. $.ajax({
  422. type:"get",
  423. url:huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  424. dataType:"json",
  425. async:false,
  426. data:{
  427. "token": $.cookie("token"),
  428. id: 2
  429. },
  430. success:function(data){
  431. if (data.state.toLowerCase() == "success") {
  432. var content = data.data;
  433. $(content).each(function (i, n) {
  434. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  435. })
  436. }
  437. }
  438. });
  439. }
  440. // 主题
  441. function ZT(obj) {
  442. obj.empty();
  443. obj.append('<option selected="selected" value="">请选择</option>');
  444. $.ajax({
  445. type:"get",
  446. url:huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  447. dataType:"json",
  448. async:false,
  449. data:{
  450. "token": $.cookie("token"),
  451. id: 3
  452. },
  453. success:function(data){
  454. if (data.state.toLowerCase() == "success") {
  455. var content = data.data;
  456. $(content).each(function (i, n) {
  457. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  458. })
  459. }
  460. }
  461. });
  462. }
  463. //区域
  464. function QY(obj) {
  465. obj.empty();
  466. obj.append('<option selected="selected" value="">请选择</option>');
  467. $.ajax({
  468. type:"get",
  469. url:huayi.config.callcenter_url + "Area/GetAreaListById",
  470. dataType:"json",
  471. async:false,
  472. data:{
  473. "token": $.cookie("token"),
  474. },
  475. success:function(data){
  476. if (data.state.toLowerCase() == "success") {
  477. var content = data.data;
  478. $(content).each(function (i, n) {
  479. if (n.F_AreaName != '商丘市') {
  480. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  481. }
  482. })
  483. }
  484. }
  485. });
  486. }
  487. //上传文件
  488. function upload() {
  489. var Files = document.getElementById("upFile").files;
  490. if (Files.length > 0) {
  491. var formData = new FormData();
  492. for (var i = 0; i < Files.length; i++) {
  493. formData.append('file' + i, Files[i]);
  494. }
  495. formData.append("token", $.cookie("token"));
  496. var typeName=Files[0].name.split('.')[1];
  497. if (typeName=="png"||typeName=='jpg'||typeName=='mp4'||typeName=='mp3'||typeName=='pdf'||typeName=='doc'||typeName=='docx'||typeName=='xls'||typeName=='xlsx') {
  498. $.ajax({
  499. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  500. type: "POST",
  501. data: formData,
  502. /**
  503. *必须false才会自动加上正确的Content-Type
  504. */
  505. contentType: false,
  506. /**
  507. * 必须false才会避开jQuery对 formdata 的默认处理
  508. * XMLHttpRequest会对 formdata 进行正确的处理
  509. */
  510. processData: false,
  511. success: function (result) {
  512. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  513. $("#upFile").change(function () {
  514. upload();
  515. });
  516. var r = $.parseJSON(result);
  517. if (r.state.toLowerCase() == "success") {
  518. var a = r.data;
  519. $(a).each(function (i, n) {
  520. var strs = '<span class="files" fiel-num="' + n.F_FileId + '">' + n.F_FileName.substring(19) + '<i class="fa fa-remove del_file"></i></span>'
  521. $(strs).appendTo($('.fileBox')).find('.del_file').click(function (event) {
  522. event.stopPropagation();
  523. $(this).parent().remove();
  524. file_num()
  525. })
  526. })
  527. file_num();
  528. }
  529. }
  530. });
  531. }else{
  532. layer.msg("格式不正确");
  533. }
  534. } else {
  535. layer.confirm('请上传文件!', {
  536. btn: ['确定']
  537. });
  538. }
  539. }
  540. </script>
  541. </body>
  542. </html>