信阳市12345演示系统-前端代码

XGwordel.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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. <title>新增诉求工单</title>
  10. <style type="text/css">
  11. .input {
  12. background-color: #FFF;
  13. background-image: none;
  14. border: 1px solid #ccc;
  15. border-radius: 1px;
  16. color: inherit;
  17. padding: 6px 12px
  18. }
  19. .fjnr {
  20. padding: 0!important;
  21. border: none!important;
  22. }
  23. </style>
  24. </head>
  25. <body>
  26. <div class="wrapper wrapper-content animated fadeInRight">
  27. <div style="padding: 10px;" class="tj_content clearFix">
  28. <div class="Common">
  29. <table>
  30. <tr>
  31. <th class="Importent">姓名:</th>
  32. <td>
  33. <input type="text" id="cusname" />
  34. </td>
  35. <th>性别:</th>
  36. <td>
  37. <select class="select_" id="SEX">
  38. <option value="">请选择</option>
  39. <option value="0">男</option>
  40. <option value="1">女</option>
  41. </select>
  42. </td>
  43. <th>来源:</th>
  44. <td>
  45. <select class="select_" id="source">
  46. </select>
  47. </td>
  48. <th class="Importent">投诉电话:</th>
  49. <td>
  50. <input type="text" id="cusphone" />
  51. </td>
  52. </tr>
  53. <tr>
  54. <th>邮箱:</th>
  55. <td>
  56. <input type="text" id="email" />
  57. </td>
  58. <th>邮编:</th>
  59. <td>
  60. <input type="text" id="zipcode" />
  61. </td>
  62. <th>联系电话:</th>
  63. <td>
  64. <input type="text" id="conphone" />
  65. </td>
  66. </tr>
  67. <tr>
  68. <th class="Importent">标题:</th>
  69. <td colspan="7">
  70. <input id="title" type="text" style="width: 100%;" />
  71. </td>
  72. </tr>
  73. <tr>
  74. <th class="Importent">内容:</th>
  75. <td colspan="7">
  76. <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%;"></textarea>
  77. </td>
  78. </tr>
  79. <tr>
  80. <th class="Importent">事件地址:</th>
  81. <td colspan="7">
  82. <select class="select_" id="sourcearea">
  83. </select>
  84. <input id="sourceaddress" type="text" placeholder="输入详细地址" style="width:66%" />
  85. </td>
  86. </tr>
  87. <tr>
  88. <th>附件上传:</th>
  89. <td colspan="7">
  90. <div class="fileBox">
  91. </div>
  92. <!--<input type="text" placeholder="输入附件详情" style="width:66%" />-->
  93. <!--<span class="fjnr"></span>-->
  94. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  95. <input class="input" type="button" value="上传" id="scwj" />
  96. <!--<input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />-->
  97. <input type="hidden" id="file" />
  98. <span style="color:#FF0000; border: none;">
  99. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  100. </span>
  101. </td>
  102. </tr>
  103. <tr class="Nows_box Hidens">
  104. <th>办理内容:</th>
  105. <td colspan="7">
  106. <input type="text" style="width: 100%;" id="result" />
  107. </td>
  108. </tr>
  109. <tr>
  110. <th class="Importent">主题词:</th>
  111. <td>
  112. <!--<input id="keys" type="text" placeholder="输入主题词" style="width:100%" />-->
  113. <select class="select_" id="keys">
  114. <option value=""></option>
  115. </select>
  116. </td>
  117. <th>类型:</th>
  118. <td>
  119. <select class="select_" id="type">
  120. </select>
  121. </td>
  122. <th>密级:</th>
  123. <td>
  124. <input type="radio" name="mj" id="" value="0" />普通
  125. <input type="radio" name="mj" id="" value="1" />保密
  126. </td>
  127. <th>紧急程度:</th>
  128. <td>
  129. <select class="select_" id="level">
  130. <!--<option value="0">选择</option>-->
  131. <option value="1">普通</option>
  132. <option value="2">紧急</option>
  133. </select>
  134. </td>
  135. <!--<th class="">分管领导:</th>
  136. <td colspan="4">
  137. <input id="splituser" type="text" placeholder="" style="width:100%" readonly="readonly" />
  138. </td>-->
  139. </tr>
  140. </table>
  141. <div class="btn_box">
  142. <button class="btns BC">保存</button>
  143. </div>
  144. </div>
  145. </div>
  146. </div>
  147. <script src="../css/laydate/laydate.js"></script>
  148. <script src="../js/adjustHeight.js"></script>
  149. <script>
  150. var wid = helper.request.queryString("wid");
  151. var submit;
  152. $(document).ready(function() {
  153. QY($("#sourcearea"));
  154. LY($("#source"));
  155. LB($("#type"));
  156. ZT($("#keys"))
  157. //当即办理
  158. $(".Nows").click(function() {
  159. $(".Nows_box").toggle();
  160. })
  161. $(".Nows_").click(function() {
  162. $(".Nows_box").toggle();
  163. })
  164. $(".BC").click(function() {
  165. Add()
  166. });
  167. //上传附件
  168. $("#scwj").click(function() {
  169. $("#upFile").trigger("click");
  170. })
  171. $("#upFile").change(function() {
  172. upload();
  173. })
  174. // $("#scfj").click(function() {
  175. // $(".fjnr").text("");
  176. // $("#scfj").hide();
  177. // })
  178. $(".SavedSubmit").click(function() {
  179. submit = 1;
  180. Add()
  181. })
  182. if(wid) {
  183. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrder', {
  184. workorderid: wid,
  185. "token": $.cookie("token")
  186. }, function(result) {
  187. if(result.state.toLowerCase() == "success") {
  188. var Data = result.data.data;
  189. $("#cusname").val(Data[0].F_CusName);
  190. $("#cusphone").val(Data[0].F_CusPhone);
  191. $("#conphone").val(Data[0].F_ConPhone);
  192. $("#title").val(Data[0].F_ComTitle);
  193. $('#content').val(Data[0].F_ComContent);
  194. $('#email').val(Data[0].F_Email);
  195. $("#zipcode").val(Data[0].F_ZipCode);
  196. $("#result").val(Data[0].F_Result);
  197. //x性别
  198. $("#SEX").val(Data[0].F_CusSex+'');
  199. //来源
  200. $("#source").val(Data[0].F_InfoSource+'');
  201. //事件地址
  202. $("#sourcearea").val(Data[0].F_SourceArea+'');
  203. //主题词
  204. $("#keys").val(Data[0].F_Key+'');
  205. //类型
  206. $("#type").val(Data[0].F_InfoType+'');
  207. //紧急程度
  208. $("#level").val(Data[0].F_Level+'');
  209. if(Data[0].F_IsResult == 1) {
  210. $(".Nows_box").toggle();
  211. }
  212. $(' input[name="mj"][value="' + Data[0].F_IsProtect + '"]').prop("checked", "checked");
  213. $('#sourceaddress').val(Data[0].F_SourceAddress);
  214. $('.F_FinalOpinion').val(Data[0].F_FinalOpinion);
  215. $(Data[0].File).each(function(k,q){
  216. var strs='<span class="files" fiel-num="'+ q.F_FileId +'">'+ q.F_FileName.substring(19) +'<i class="fa fa-remove del_file"></i></span>'
  217. $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event){
  218. event.stopPropagation();
  219. $(this).parent().remove();
  220. file_num()
  221. })
  222. file_num()
  223. })
  224. }
  225. })
  226. }
  227. });
  228. ///修改工单
  229. function Add() {
  230. var value = $(' input[name="banli"]:checked ').val();
  231. var content = $("#content").val();
  232. if (!$("#cusname").val()) {
  233. layer.msg("请输入姓名");
  234. } else if (!$("#cusphone").val()) {
  235. layer.msg("请输入投诉电话");
  236. } else if (!$("#title").val()) {
  237. layer.msg("请输入标题");
  238. } else if (!$("#content").val()) {
  239. layer.msg("请输入内容");
  240. } else if (!$("#keys").val()) {
  241. layer.msg("请选择主题词");
  242. } else if (!$("#sourcearea").val()) {
  243. layer.msg("请选择事发区域");
  244. } else {
  245. $.ajax({
  246. type: "post",
  247. url: huayi.config.callcenter_url + "WorkOrder/EditWorkOrderByAdmin",
  248. dataType: 'json',
  249. async: true,
  250. data: {
  251. workorderid: wid,
  252. cusname: $("#cusname").val(), //=投诉人姓名
  253. cussex: $("#SEX").val(),
  254. cusphone: $("#cusphone").val(), //=投诉人电话
  255. email: $("#email").val(),
  256. zipcode: $("#zipcode").val(),
  257. conphone: $("#conphone").val(),
  258. title: $("#title").val(),
  259. content: $("#content").val(),
  260. files: $("#file").val(), //(多个用英文逗号,隔开)
  261. sourcearea: $("#sourcearea").val(), //=事发地域id
  262. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  263. source: $("#source").val(), //=来源
  264. result: $('#result').val(),
  265. keys: $("#keys").val(), //=关键词id(多个用英文逗号,隔开)
  266. type: $("#type").val(), //=类型
  267. bigtype: $("#bigtype").val(), //=大类别
  268. smalltype: $("#smalltype").val(), //=小类别
  269. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  270. level: $('#level').val(), //=(1普通2紧急)
  271. token: $.cookie("token")
  272. },
  273. success: function(data) {
  274. if(data.state.toLowerCase() == "success") {
  275. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  276. parent.layer.close(index); //再执行关闭
  277. parent.load();
  278. parent.layer.msg(data.message);
  279. $('.fileBox').html('');
  280. }
  281. }
  282. });
  283. }
  284. }
  285. //来源
  286. function LY(obj) {
  287. obj.empty();
  288. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  289. "token": $.cookie("token"),
  290. id: 1
  291. }, function(data) {
  292. if(data.state.toLowerCase() == "success") {
  293. var content = data.data;
  294. $(content).each(function(i, n) {
  295. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  296. })
  297. }
  298. })
  299. }
  300. //类别
  301. function LB(obj) {
  302. obj.empty();
  303. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  304. "token": $.cookie("token"),
  305. id: 2
  306. }, function(data) {
  307. if(data.state.toLowerCase() == "success") {
  308. var content = data.data;
  309. $(content).each(function(i, n) {
  310. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  311. })
  312. }
  313. })
  314. }
  315. // 主题
  316. function ZT(obj) {
  317. obj.empty();
  318. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  319. "token": $.cookie("token"),
  320. id: 3
  321. }, function(data) {
  322. if(data.state.toLowerCase() == "success") {
  323. var content = data.data;
  324. $(content).each(function(i, n) {
  325. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  326. })
  327. }
  328. })
  329. }
  330. //区域
  331. function QY(obj) {
  332. obj.empty();
  333. obj.append('<option selected="selected" value="">请选择</option>');
  334. $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
  335. "token": $.cookie("token"),
  336. }, function(data) {
  337. if(data.state.toLowerCase() == "success") {
  338. var content = data.data;
  339. $(content).each(function(i, n) {
  340. if (n.F_AreaName != '商丘市') {
  341. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  342. }
  343. })
  344. }
  345. })
  346. }
  347. //上传文件
  348. function upload() {
  349. var Files = document.getElementById("upFile").files;
  350. if(Files.length > 0) {
  351. var formData = new FormData();
  352. for(var i = 0; i < Files.length; i++) {
  353. formData.append('file' + i, Files[i]);
  354. }
  355. formData.append("token", $.cookie("token"));
  356. var typeName=Files[0].name.split('.')[1];
  357. if (typeName=="png"||typeName=='jpg'||typeName=='mp4'||typeName=='mp3'||typeName=='pdf'||typeName=='doc'||typeName=='docx'||typeName=='xls'||typeName=='xlsx') {
  358. $.ajax({
  359. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  360. type: "POST",
  361. data: formData,
  362. /**
  363. *必须false才会自动加上正确的Content-Type
  364. */
  365. contentType: false,
  366. /**
  367. * 必须false才会避开jQuery对 formdata 的默认处理
  368. * XMLHttpRequest会对 formdata 进行正确的处理
  369. */
  370. processData: false,
  371. success: function(result) {
  372. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  373. $("#upFile").change(function() {
  374. upload();
  375. });
  376. var r = $.parseJSON(result);
  377. if(r.state.toLowerCase() == "success") {
  378. var a = r.data;
  379. $(a).each(function(i, n) {
  380. var strs='<span class="files" fiel-num="'+ n.F_FileId +'">'+ n.F_FileName.substring(19) +'<i class="fa fa-remove del_file"></i></span>'
  381. $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event){
  382. event.stopPropagation();
  383. $(this).parent().remove();
  384. file_num();
  385. })
  386. })
  387. file_num();
  388. }
  389. }
  390. });
  391. }else{
  392. layer.msg("格式不正确");
  393. }
  394. } else {
  395. layer.confirm('请上传文件!', {
  396. btn: ['确定']
  397. });
  398. }
  399. }
  400. //上传文件隐藏域值
  401. function file_num(){
  402. var str = '';
  403. var Str;
  404. $('.fileBox .files').each(function(j,m){
  405. var aa=$(m).attr("fiel-num")
  406. console.log(aa);
  407. str += aa + ",";
  408. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  409. })
  410. $("#file").val(Str);
  411. }
  412. </script>
  413. </body>
  414. </html>