商丘12345 前端

AddAppeals.html 21KB

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