县级12345前端

XGwordel.html 18KB

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