Няма описание

AddAppeals.html 20KB

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