Нет описания

AddAppeals.html 20KB

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