12345市长热线标准版-前端

AddAppeals.html 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  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. } else if (!$("#title").val()) {
  242. layer.msg("请输入标题");
  243. } else if (!$("#content").val()) {
  244. layer.msg("请输入内容");
  245. } else if (!$("#keys").val()) {
  246. layer.msg("请选择主题词");
  247. } else if (!$("#sourcearea").val()) {
  248. layer.msg("请选择事发区域");
  249. } else if (value == 1 && !$('#result').val()) {
  250. layer.msg("请输入直办内容");
  251. }
  252. else {
  253. $.ajax({
  254. type: "post",
  255. url: huayi.config.callcenter_url + "WorkOrder/EditWorkOrderBySource",
  256. dataType: 'json',
  257. async: true,
  258. data: {
  259. workorderid: wid,
  260. cusname: $("#cusname").val(), //=投诉人姓名
  261. cussex: $("#SEX").val(),
  262. cusphone: $("#cusphone").val(), //=投诉人电话
  263. email: $("#email").val(),
  264. zipcode: $("#zipcode").val(),
  265. conphone: $("#conphone").val(),
  266. title: $("#title").val(),
  267. content: $("#content").val(),
  268. files: $("#file").val(), //(多个用英文逗号,隔开)
  269. sourcearea: $("#sourcearea").val(), //=事发地域id
  270. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  271. source: $("#source").val(), //=来源
  272. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  273. result: $('#result').val(),
  274. keys: $("#keys").val(), //=关键词id(多个用英文逗号,隔开)
  275. // splituser: 5, //分管领导id(多个用英文逗号,隔开)
  276. type: $("#type").val(), //=类型
  277. bigtype: $("#bigtype").val(), //=大类别
  278. smalltype: $("#smalltype").val(), //=小类别
  279. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  280. level: $('#level').val(), //=(1普通2紧急3特急)
  281. issubmit: submit, //=(0保存1保存并提交)
  282. token: $.cookie("token")
  283. },
  284. success: function(data) {
  285. if(data.state.toLowerCase() == "success") {
  286. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  287. parent.layer.close(index); //再执行关闭
  288. parent.load();
  289. parent.layer.msg(data.message);
  290. }
  291. }
  292. });
  293. }
  294. }
  295. //来源
  296. function LY(obj) {
  297. obj.empty();
  298. //obj.append('<option selected="selected" value="1">请选择</option>');
  299. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById?", {
  300. "token": $.cookie("token"),
  301. id: 1
  302. }, function(data) {
  303. if(data.state.toLowerCase() == "success") {
  304. var content = data.data;
  305. $(content).each(function(i, n) {
  306. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  307. })
  308. }
  309. })
  310. }
  311. //类别
  312. function LB(obj) {
  313. obj.empty();
  314. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById?", {
  315. "token": $.cookie("token"),
  316. id: 2
  317. }, function(data) {
  318. if(data.state.toLowerCase() == "success") {
  319. var content = data.data;
  320. $(content).each(function(i, n) {
  321. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  322. })
  323. }
  324. })
  325. }
  326. // 主题
  327. function ZT(obj) {
  328. obj.empty();
  329. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById?", {
  330. "token": $.cookie("token"),
  331. id: 3
  332. }, function(data) {
  333. if(data.state.toLowerCase() == "success") {
  334. var content = data.data;
  335. $(content).each(function(i, n) {
  336. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  337. })
  338. }
  339. })
  340. }
  341. //区域
  342. function QY(obj) {
  343. obj.empty();
  344. obj.append('<option selected="selected" value="">请选择</option>');
  345. $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById?", {
  346. "token": $.cookie("token"),
  347. }, function(data) {
  348. if(data.state.toLowerCase() == "success") {
  349. var content = data.data;
  350. $(content).each(function(i, n) {
  351. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  352. })
  353. }
  354. })
  355. }
  356. function upload() {
  357. var Files = document.getElementById("upFile").files;
  358. if(Files.length > 0) {
  359. var formData = new FormData();
  360. for(var i = 0; i < Files.length; i++) {
  361. formData.append('file' + i, Files[i]);
  362. }
  363. formData.append("token", $.cookie("token"));
  364. $.ajax({
  365. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  366. type: "POST",
  367. data: formData,
  368. /**
  369. *必须false才会自动加上正确的Content-Type
  370. */
  371. contentType: false,
  372. /**
  373. * 必须false才会避开jQuery对 formdata 的默认处理
  374. * XMLHttpRequest会对 formdata 进行正确的处理
  375. */
  376. processData: false,
  377. success: function(result) {
  378. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  379. $("#upFile").change(function() {
  380. upload();
  381. });
  382. var r = $.parseJSON(result);
  383. if(r.state.toLowerCase() == "success") {
  384. $(".fjnr").text(r.data[0].F_FileName);
  385. var a = r.data;
  386. var str = '';
  387. var Str;
  388. $(a).each(function(i, n) {
  389. console.log(n.F_FileId);
  390. str += n.F_FileId + ",";
  391. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  392. console.log(Str);
  393. })
  394. $("#file").val(Str);
  395. $("#scfj").show();
  396. }
  397. }
  398. });
  399. } else {
  400. layer.confirm('请上传文件!', {
  401. btn: ['确定']
  402. });
  403. }
  404. }
  405. </script>
  406. </body>
  407. </html>