商丘12345 前端

AddAppeals.html 13KB

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