Aucune description

LeaderAdd.html 13KB

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