説明なし

AddAppeal.html 27KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  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="../js/zTree/zTreeStyle.css" />
  9. <link rel="stylesheet" href="../css/addappeal.css" />
  10. <link rel="stylesheet" href="../css/init.css" />
  11. <link rel="stylesheet" href="../css/addappeal.css" />
  12. <title>新增诉求工单</title>
  13. </head>
  14. <body>
  15. <input type="hidden" id="PID" value="" />
  16. <div class="wrapper wrapper-content animated fadeInRight">
  17. <div style="padding: 10px;" class="tj_content clearFix">
  18. <div class="Common">
  19. <table>
  20. <!-- <tr>
  21. <th>邮箱:</th>
  22. <td>
  23. <input type="text" id="email" />
  24. </td>
  25. <th>邮编:</th>
  26. <td>
  27. <input type="text" id="zipcode" />
  28. </td>
  29. <th>联系电话:</th>
  30. <td>
  31. <input type="text" id="conphone" />
  32. </td>
  33. </tr> -->
  34. <tr>
  35. <th class="Importent">标题:</th>
  36. <td colspan="7">
  37. <input id="title" type="text" class="form-control" style="width: 100%;" />
  38. </td>
  39. </tr>
  40. <tr class="content-wrapper">
  41. <th class="Importent">来电内容:</th>
  42. <td colspan="7">
  43. <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%;"
  44. readonly="readonly" class="form-control"></textarea>
  45. </td>
  46. </tr>
  47. <tr class="workcontent-wrapper">
  48. <th class="Importent">工单内容:</th>
  49. <td colspan="7">
  50. <textarea data-adaptheight id="workcontent" name="" rows="" cols=""
  51. style="width: 100%;" class="form-control"></textarea>
  52. </td>
  53. </tr>
  54. <tr>
  55. <th>附件上传:</th>
  56. <td colspan="7">
  57. <div class="fileBox">
  58. </div>
  59. <!--<span class="fjnr"></span>-->
  60. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
  61. style="display: none;">
  62. <input class="input" type="button" value="上传" id="scwj" />
  63. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  64. <input type="hidden" id="file" />
  65. <span style="color:#FF0000; border: none;">
  66. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  67. </span>
  68. </td>
  69. </tr>
  70. <tr>
  71. <th>处理方式:</th>
  72. <td colspan="7">
  73. <input type="radio" value="1" name="banli" class="Nows" />当即办理
  74. <input checked="true" type="radio" value="0" name="banli" class="Nows_" />网络转办
  75. <input id="threeWayCall" type="checkbox" value="1" name="" class="Nows_" />三方通话
  76. </td>
  77. </tr>
  78. <tr class="Nows_box Hidens">
  79. <th>办理内容:</th>
  80. <td colspan="7">
  81. <input type="text" style="width: 100%;" id="result" class="form-control" />
  82. </td>
  83. </tr>
  84. <tr>
  85. <th class="">来电人:</th>
  86. <td>
  87. <input type="text" id="cusname" class="form-control" />
  88. </td>
  89. <th>性别:</th>
  90. <td>
  91. <select class="select_" id="SEX" class="form-control">
  92. <option value="">请选择</option>
  93. <option value="0">男</option>
  94. <option value="1">女</option>
  95. </select>
  96. </td>
  97. <th>来源:</th>
  98. <td>
  99. <select class="select_" id="source" class="form-control"></select>
  100. </td>
  101. <th class="Importent">来电号码:</th>
  102. <td>
  103. <input type="text" id="cusphone" class="form-control" />
  104. </td>
  105. </tr>
  106. <tr>
  107. <th>类型:</th>
  108. <td>
  109. <select class="select_" id="type" class="form-control"></select>
  110. </td>
  111. <th class="Importent">反映类别:</th>
  112. <!--<td>
  113. <select class="select_" id="keys">
  114. <option value=""></option>
  115. </select>
  116. </td>-->
  117. <td style="position: relative">
  118. <div class="inpBox">
  119. <input type="text" class="inps" />
  120. <i class="Cleans fa fa-close"></i>
  121. <i class="xl xl_one"></i>
  122. <div class="addTree xlAdd">
  123. <ul id="addTreeDemo" class="ztree"></ul>
  124. </div>
  125. </div>
  126. <div class="selDpart1">
  127. <ul id="sponsor"></ul>
  128. </div>
  129. </td>
  130. <th>来电号码密级:</th>
  131. <td>
  132. <input type="radio" name="mj" id="" value="0" />普通
  133. <input type="radio" name="mj" id="" value="1" />保密
  134. </td>
  135. <th class="Importent">紧急程度:</th>
  136. <td>
  137. <select class="select_" id="level">
  138. <!--<option value="0">选择</option>-->
  139. <option value="1">普通</option>
  140. <option value="2">紧急</option>
  141. </select>
  142. </td>
  143. </tr>
  144. <tr class="leaderCharge-wrapper" style="display: none;">
  145. <th class="">分管领导:</th>
  146. <td>
  147. <select class="select_" id="leaderCharge">
  148. <option value="">请选择</option>
  149. <option value="省长">省长</option>
  150. <option value="市长">市长</option>
  151. </select>
  152. </td>
  153. </tr>
  154. <tr>
  155. <td colspan="8" style="text-align: center;">
  156. <div class="btn_box">
  157. <button class="btns BC">保存</button>
  158. <!--<button class="btns SavedSubmit">保存并提交</button>-->
  159. </div>
  160. </td>
  161. </tr>
  162. <tr>
  163. <th>事发区域:</th>
  164. <td colspan="7">
  165. <select class="select_" id="sourcearea"></select>
  166. </td>
  167. </tr>
  168. <tr>
  169. <th class="Importent"></th>
  170. <td colspan="7">
  171. <input id="sourceaddress" type="text" placeholder="输入详细地址"
  172. style="width:50%; padding-left: 15px;" />
  173. </td>
  174. </tr>
  175. <tr>
  176. <th class="Importent"></th>
  177. <td colspan="7">
  178. <div style="width:710px">
  179. <div id="myMap" style="width:100%;height:400px;"></div>
  180. <input type="hidden" class="store_Lng" value="115.659773" />
  181. <input type="hidden" class="store_Lat" value="34.395449" />
  182. </div>
  183. </td>
  184. </tr>
  185. </table>
  186. </div>
  187. </div>
  188. </div>
  189. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  190. <script src="../css/laydate/laydate.js"></script>
  191. <script src="../js/bootstrap-select.js"></script>
  192. <script src="../js/adjustHeight.js"></script>
  193. <script src="../js/appeal/index.js"></script>
  194. <script src="../js/zTree/jquery.ztree.core.js"></script>
  195. <script src="../js/ztreeSelect.js"></script>
  196. <script>
  197. var wid = helper.request.queryString("wid");
  198. var roleCode = $.cookie("code");
  199. var submit;
  200. $(document).ready(function () {
  201. QY($("#sourcearea"));
  202. LY($("#source"));
  203. LB($("#type"));
  204. ZT($("#keys"))
  205. // 管理员、中心话务员可编辑工单内容
  206. if (roleCode === "GLY") {
  207. $("#content").removeAttr("readonly")
  208. } else if (roleCode === "ZXHWY") {
  209. $(".workcontent-wrapper").hide()
  210. $("#content").removeAttr("readonly")
  211. }
  212. //当即办理
  213. $(' input[name="banli"]').change(function () {
  214. var val = $(this).val();
  215. if (val == "1") {
  216. $(".Nows_box").show();
  217. } else {
  218. $(".Nows_box").hide();
  219. }
  220. })
  221. $(".BC").click(function () {
  222. submit = 0;
  223. Add()
  224. });
  225. //上传附件
  226. $("#scwj").click(function () {
  227. $("#upFile").trigger("click");
  228. })
  229. $("#upFile").change(function () {
  230. upload();
  231. })
  232. // $("#scfj").click(function() {
  233. // $(".fjnr").text("");
  234. // $("#scfj").hide();
  235. // })
  236. $(".SavedSubmit").click(function () {
  237. submit = 1;
  238. Add()
  239. })
  240. if (wid) {
  241. $.ajax({
  242. type: "get",
  243. url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrderNew",
  244. dataType: 'json',
  245. async: false,
  246. data: {
  247. workorderid: wid,
  248. type: 0, // 工单信息
  249. token: $.cookie("token")
  250. },
  251. success: function (data) {
  252. if (data.state.toLowerCase() == "success") {
  253. var Data = data.data.data;
  254. $("#cusname").val(Data[0].F_CusName);
  255. $("#cusphone").val(Data[0].F_CusPhone);
  256. $("#conphone").val(Data[0].F_ConPhone);
  257. $("#title").val(Data[0].F_ComTitle);
  258. $('#content').val(Data[0].F_ComContent);
  259. if (Data[0].F_Content === "" || Data[0].F_Content === null) {
  260. $('#workcontent').val(Data[0].F_ComContent);
  261. } else {
  262. $('#workcontent').val(Data[0].F_Content);
  263. }
  264. $('#email').val(Data[0].F_Email);
  265. $("#zipcode").val(Data[0].F_ZipCode);
  266. $("#result").val(Data[0].F_Result);
  267. if (Data[0].F_Longitude) {
  268. $(".store_Lng").val(Data[0].F_Longitude);
  269. $(".store_Lat").val(Data[0].F_Latitude);
  270. }
  271. //x性别
  272. $("#SEX option:selected").val(Data[0].F_CusSex + '');
  273. if (Data[0].F_CusSex == "0") {
  274. $("#SEX option:selected").text("男"); //乡镇
  275. } else {
  276. $("#SEX option:selected").text("女"); //乡镇
  277. }
  278. //来源
  279. $("#source option:selected").val(Data[0].F_InfoSource + '');
  280. $("#source option:selected").text(Data[0].SourceName); //来源
  281. if(Data[0].F_InfoSource + "" === "4") {
  282. $(".leaderCharge-wrapper").show()
  283. $("#leaderCharge").val(Data[0].splituser)
  284. }
  285. //事发区域
  286. $("#sourcearea option:selected").val(Data[0].F_SourceArea + '');
  287. $("#sourcearea option:selected").text(Data[0].AreaName); //事发区域
  288. //主题词
  289. $("#keys option:selected").val(Data[0].F_Key + '');
  290. $("#keys option:selected").text(Data[0].KeyName); //主题词
  291. $(".inps").val(Data[0].KeyName)
  292. $("#PID").val(Data[0].F_Key)
  293. //类型
  294. $("#type option:selected").val(Data[0].F_InfoType + '');
  295. $("#type option:selected").text(Data[0].TypeName1); //类型
  296. //紧急程度
  297. $("#level").val(Data[0].F_Level + '');
  298. if (Data[0].F_Level == "1") {
  299. $("#level option:selected").text("普通"); //乡镇
  300. } else {
  301. $("#level option:selected").text("紧急"); //乡镇
  302. }
  303. if (Data[0].F_IsResult == 1) {
  304. $(".Nows_box").toggle();
  305. }
  306. $(' input[name="mj"][value="' + Data[0].F_IsProtect + '"]').prop(
  307. "checked", "checked");
  308. $(' input[name="banli"][value="' + Data[0].F_IsResult + '"]').prop(
  309. "checked", "checked");
  310. if(String(Data[0].F_Business) === "1") {
  311. $('#threeWayCall').attr("checked", true);
  312. } else {
  313. $('#threeWayCall').attr("checked", false);
  314. }
  315. $('#sourceaddress').val(Data[0].F_SourceAddress);
  316. $('.F_FinalOpinion').val(Data[0].F_FinalOpinion);
  317. $(Data[0].File).each(function (k, q) {
  318. var strs = '<span class="files" fiel-num="' + q.F_FileId +
  319. '">' + q.F_FileName.substring(19) +
  320. '<i class="fa fa-remove del_file"></i></span>'
  321. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  322. function (event) {
  323. event.stopPropagation();
  324. $(this).parent().remove();
  325. file_num()
  326. })
  327. file_num()
  328. })
  329. }
  330. }
  331. });
  332. }
  333. });
  334. ///修改工单
  335. function Add() {
  336. var value = $(' input[name="banli"]:checked ').val();
  337. var content = $("#content").val();
  338. var threeWayCall;
  339. if($('#threeWayCall').is(':checked')) {
  340. threeWayCall = 1;
  341. } else {
  342. threeWayCall = 0;
  343. }
  344. // if (!$("#cusname").val()) {
  345. // layer.msg("请输入姓名");
  346. // } else
  347. // if (!$("#cusphone").val()) {
  348. // layer.msg("请输入来电号码");
  349. // } else if (!$("#title").val()) {
  350. // layer.msg("请输入标题");
  351. // } else if (!$("#content").val()) {
  352. // layer.msg("请输入内容");
  353. // } else if (!$("#keys").val()) {
  354. // layer.msg("请选择反映类别");
  355. // } else if (!$("#sourcearea").val()) {
  356. // layer.msg("请选择事发区域");
  357. // } else if (value == 1 && !$('#result').val()) {
  358. // layer.msg("请输入直办内容");
  359. // } else {
  360. if (!$(".inps").val()) {
  361. layer.msg("请选择反映类别");
  362. return
  363. }
  364. $.ajax({
  365. type: "post",
  366. url: huayi.config.callcenter_url + "WorkOrder/EditWorkOrder",
  367. dataType: 'json',
  368. async: true,
  369. data: {
  370. workorderid: wid,
  371. cusname: $("#cusname").val(), //=来电人姓名
  372. cussex: $("#SEX").val(),
  373. cusphone: $("#cusphone").val(), //=来电人电话
  374. email: $("#email").val(),
  375. zipcode: $("#zipcode").val(),
  376. conphone: $("#conphone").val(),
  377. title: $("#title").val(),
  378. content: $("#content").val(),
  379. workcontent: $("#workcontent").val(),
  380. files: $("#file").val(), //(多个用英文逗号,隔开)
  381. sourcearea: $("#sourcearea").val(), //=事发地域id
  382. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  383. source: $("#source").val(), //=来源
  384. splituser: $("#leaderCharge").val(), // 分管领导
  385. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  386. business: threeWayCall,
  387. result: $('#result').val(),
  388. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开)
  389. type: $("#type").val(), //=类型
  390. bigtype: $("#bigtype").val(), //=大类别
  391. smalltype: $("#smalltype").val(), //=小类别
  392. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  393. level: $('#level').val(), //=(1普通2紧急)
  394. issubmit: submit, //=(0保存1保存并提交)
  395. token: $.cookie("token")
  396. },
  397. success: function (data) {
  398. if (data.state.toLowerCase() == "success") {
  399. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  400. parent.layer.close(index); //再执行关闭
  401. parent.$('#orderlist').bootstrapTable('refresh');
  402. parent.layer.msg(data.message);
  403. $('.fileBox').html('');
  404. }
  405. }
  406. });
  407. // }
  408. }
  409. //上传文件隐藏域值
  410. function file_num() {
  411. var str = '';
  412. var Str;
  413. $('.fileBox .files').each(function (j, m) {
  414. var aa = $(m).attr("fiel-num")
  415. console.log(aa);
  416. str += aa + ",";
  417. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  418. })
  419. $("#file").val(Str);
  420. }
  421. //来源
  422. function LY(obj) {
  423. obj.empty();
  424. obj.append('<option selected="selected" value="">请选择</option>');
  425. $.ajax({
  426. type: "get",
  427. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  428. dataType: "json",
  429. async: false,
  430. data: {
  431. "token": $.cookie("token"),
  432. id: 1
  433. },
  434. success: function (data) {
  435. if (data.state.toLowerCase() == "success") {
  436. var content = data.data;
  437. $(content).each(function (i, n) {
  438. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  439. .appendTo(obj);
  440. })
  441. }
  442. }
  443. });
  444. }
  445. //类别
  446. function LB(obj) {
  447. obj.empty();
  448. obj.append('<option selected="selected" value="">请选择</option>');
  449. $.ajax({
  450. type: "get",
  451. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  452. dataType: "json",
  453. async: false,
  454. data: {
  455. "token": $.cookie("token"),
  456. id: 2
  457. },
  458. success: function (data) {
  459. if (data.state.toLowerCase() == "success") {
  460. var content = data.data;
  461. $(content).each(function (i, n) {
  462. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  463. .appendTo(obj);
  464. })
  465. }
  466. }
  467. });
  468. }
  469. // 主题
  470. function ZT(obj) {
  471. obj.empty();
  472. obj.append('<option selected="selected" value="">请选择</option>');
  473. $.ajax({
  474. type: "get",
  475. url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  476. dataType: "json",
  477. async: false,
  478. data: {
  479. "token": $.cookie("token"),
  480. id: 3
  481. },
  482. success: function (data) {
  483. if (data.state.toLowerCase() == "success") {
  484. var content = data.data;
  485. $(content).each(function (i, n) {
  486. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>")
  487. .appendTo(obj);
  488. })
  489. }
  490. }
  491. });
  492. }
  493. //区域
  494. function QY(obj) {
  495. obj.empty();
  496. obj.append('<option selected="selected" value="">请选择</option>');
  497. $.ajax({
  498. type: "get",
  499. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  500. dataType: "json",
  501. async: false,
  502. data: {
  503. "token": $.cookie("token"),
  504. },
  505. success: function (data) {
  506. if (data.state.toLowerCase() == "success") {
  507. var content = data.data;
  508. $(content).each(function (i, n) {
  509. if (n.F_AreaName != '市区') {
  510. // $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  511. // "</option>").appendTo(obj);
  512. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  513. "</option>").appendTo(obj);
  514. }
  515. })
  516. }
  517. }
  518. });
  519. }
  520. $("#source").click(function() {
  521. if ($("#source").val() === "4") {
  522. $(".leaderCharge-wrapper").show()
  523. } else {
  524. $(".leaderCharge-wrapper").hide()
  525. }
  526. })
  527. //上传文件
  528. function upload() {
  529. var Files = document.getElementById("upFile").files;
  530. if (Files.length > 0) {
  531. var formData = new FormData();
  532. for (var i = 0; i < Files.length; i++) {
  533. formData.append('file' + i, Files[i]);
  534. }
  535. formData.append("token", $.cookie("token"));
  536. var typeName = Files[0].name.split('.')[1];
  537. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'mp3' || typeName ==
  538. 'pdf' || typeName == 'doc' || typeName == 'docx' || typeName == 'xls' || typeName == 'xlsx') {
  539. $.ajax({
  540. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  541. type: "POST",
  542. data: formData,
  543. /**
  544. *必须false才会自动加上正确的Content-Type
  545. */
  546. contentType: false,
  547. /**
  548. * 必须false才会避开jQuery对 formdata 的默认处理
  549. * XMLHttpRequest会对 formdata 进行正确的处理
  550. */
  551. processData: false,
  552. success: function (result) {
  553. document.getElementById("upFile").outerHTML = document.getElementById("upFile")
  554. .outerHTML;
  555. $("#upFile").change(function () {
  556. upload();
  557. });
  558. var r = $.parseJSON(result);
  559. if (r.state.toLowerCase() == "success") {
  560. var a = r.data;
  561. $(a).each(function (i, n) {
  562. var strs = '<span class="files" fiel-num="' + n.F_FileId +
  563. '">' + n.F_FileName.substring(19) +
  564. '<i class="fa fa-remove del_file"></i></span>'
  565. $(strs).appendTo($('.fileBox')).find('.del_file').click(
  566. function (event) {
  567. event.stopPropagation();
  568. $(this).parent().remove();
  569. file_num()
  570. })
  571. })
  572. file_num();
  573. }
  574. }
  575. });
  576. } else {
  577. layer.msg("格式不正确");
  578. }
  579. } else {
  580. layer.confirm('请上传文件!', {
  581. btn: ['确定']
  582. });
  583. }
  584. }
  585. </script>
  586. </body>
  587. </html>