12345市长热线标准版-前端

AddAppeals.html 12KB

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