商丘12345 前端

XGwordel.html 13KB

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