12345市长热线标准版-前端

AddAppeals.html 12KB

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