县级12345前端

AddAppeals.html 20KB

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