商丘12345 前端

LeaderAdd.html 12KB

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