商丘12345 前端

AddAppeals.html 21KB

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