新野县12345_前端

AddAppeal.html 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790
  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 rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  8. <link href="../css/layer/need/layer.css" />
  9. <link rel="stylesheet" href="../css/init.css" />
  10. <title>新增诉求工单</title>
  11. <style type="text/css">
  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. .radio-inline input[type=radio]{
  25. margin-top: 5px;
  26. }
  27. .Common{
  28. background: #f3f3f4;
  29. }
  30. .inpBox {
  31. border: 1px solid #e5e6e7;
  32. height: 34px;
  33. width: 220px;
  34. display: inline-block;
  35. position: relative;
  36. vertical-align: middle;
  37. }
  38. .addTree {
  39. background: #fff;
  40. position: absolute;
  41. width: 100%;
  42. border: 1px solid #e5e6e7;
  43. right: 0;
  44. top: 33px;
  45. display: none;
  46. z-index: 222;
  47. }
  48. .xl5 {
  49. display: inline-block;
  50. background: url(../../img/dropDown.png) no-repeat;
  51. height: 100%;
  52. background-position: center center;
  53. width: 20px;
  54. position: absolute;
  55. right: 0;
  56. top: 0px;
  57. /* background-color: #f7bc8b; */
  58. cursor: pointer;
  59. }
  60. .ztree li span {
  61. border: none;
  62. padding: 0;
  63. }
  64. .inps5 {
  65. width: 217px;
  66. height: 32px;
  67. outline: none;
  68. border: 0;
  69. border-image-width: 0;
  70. padding: 0;
  71. padding-left: 3px;
  72. }
  73. .xl5 {
  74. display: inline-block;
  75. background: url(../img/dropDown.png) no-repeat;
  76. height: 100%;
  77. background-position: center center;
  78. width: 20px;
  79. position: absolute;
  80. right: 0;
  81. top: 0px;
  82. /* background-color: #f7bc8b; */
  83. cursor: pointer;
  84. }
  85. .Cleans5{
  86. display: inline-block;
  87. width: 20px;
  88. position: absolute;
  89. right: 21px;
  90. top: 9px;
  91. display: none;
  92. }
  93. .wrapper{
  94. height: 100%;
  95. }
  96. .tj_content{
  97. height: 100%;
  98. }
  99. .Common{
  100. height: 100%;
  101. }
  102. </style>
  103. </head>
  104. <body>
  105. <div class="wrapper wrapper-content animated fadeInRight">
  106. <div style="padding: 10px;" class="tj_content clearFix">
  107. <div class="Common">
  108. <table>
  109. <tr>
  110. <th>姓名:</th>
  111. <td>
  112. <input type="text" id="cusname" />
  113. </td>
  114. <th>性别:</th>
  115. <td>
  116. <select class="select_" id="SEX">
  117. <option value="">请选择</option>
  118. <option value="0">男</option>
  119. <option value="1">女</option>
  120. </select>
  121. </td>
  122. <th>来源:</th>
  123. <td>
  124. <div class="inpBox" style="width: 172px;">
  125. <input type="text" style="width: 170px;" class="inps3" placeholder="请选择来源" />
  126. <i class="Cleans3 fa fa-close"></i>
  127. <i class="xl3 xl_one"></i>
  128. <div class="addTree xlAdd3">
  129. <ul id="addTreeDemo3" class="ztree">
  130. </ul>
  131. </div>
  132. </div>
  133. <!--<select class="select_" id="source">
  134. </select>-->
  135. </td>
  136. <th>投诉电话:</th>
  137. <td>
  138. <input type="text" id="cusphone" />
  139. </td>
  140. </tr>
  141. <tr>
  142. <th>邮箱:</th>
  143. <td>
  144. <input type="text" id="email" />
  145. </td>
  146. <th>邮编:</th>
  147. <td>
  148. <input type="text" id="zipcode" />
  149. </td>
  150. <th>联系电话:</th>
  151. <td>
  152. <input type="text" id="conphone" />
  153. </td>
  154. <th class="Importent">主题词:</th>
  155. <td>
  156. <div class="inpBox" style="width: 132px;">
  157. <input type="text" style="width: 130px;" class="inps4" placeholder="请选择主题词" />
  158. <i class="Cleans4 fa fa-close"></i>
  159. <i class="xl4 xl_one"></i>
  160. <div class="addTree xlAdd4">
  161. <ul id="addTreeDemo4" class="ztree">
  162. </ul>
  163. </div>
  164. </div>
  165. <!--<input id="keys" type="text" placeholder="输入主题词" style="width:100%" />-->
  166. <!--<select class="select_" id="keys">
  167. <option value=""></option>
  168. </select>-->
  169. </td>
  170. </tr>
  171. <tr>
  172. <th>来源地址&nbsp;&nbsp;省:</th>
  173. <td style="position: relative;">
  174. <div class="form-group">
  175. <select class="form-control" id="province">
  176. <option value ="">请选择</option>
  177. </select>
  178. </div>
  179. </td>
  180. <th>市:</th>
  181. <td style="position: relative;">
  182. <div class="form-group">
  183. <select class="form-control" id="city">
  184. <option value ="" selected>请选择</option>
  185. </select>
  186. </div>
  187. </td>
  188. <th>区/县:</th>
  189. <td style="position: relative;">
  190. <div class="form-group">
  191. <select class="form-control" id="county">
  192. <option value ="">请选择</option>
  193. </select>
  194. </div>
  195. </td>
  196. <th>乡:</th>
  197. <td style="position: relative;">
  198. <div class="form-group">
  199. <select class="form-control" id="village">
  200. <option value ="">请选择</option>
  201. </select>
  202. </div>
  203. </td>
  204. </tr>
  205. <tr>
  206. <th class="Importent">标题:</th>
  207. <td colspan="7">
  208. <input id="title" type="text" style="width: 100%;" />
  209. </td>
  210. </tr>
  211. <tr>
  212. <th class="Importent">内容:</th>
  213. <td colspan="7">
  214. <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%;"></textarea>
  215. </td>
  216. </tr>
  217. <tr>
  218. <th class="Importent">事件地址:</th>
  219. <td colspan="7">
  220. <select class="select_" id="sourcearea">
  221. </select>
  222. <input id="sourceaddress" type="text" placeholder="输入详细地址" style="width:66%" />
  223. </td>
  224. </tr>
  225. <tr>
  226. <th>附件上传:</th>
  227. <td colspan="7">
  228. <div class="fileBox">
  229. </div>
  230. <!--<span class="fjnr"></span>-->
  231. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple" style="display: none;">
  232. <input class="input" type="button" value="上传" id="scwj" />
  233. <input class="input" type="button" value="删除附件" id="scfj" style="display:none;" />
  234. <input type="hidden" id="file" />
  235. </td>
  236. </tr>
  237. <tr>
  238. <th>处理方式:</th>
  239. <td colspan="7">
  240. <input type="radio" value="1" name="banli" class="Nows" />当即办理
  241. <input checked="true" type="radio" value="0" name="banli" class="Nows_" />网络转办
  242. </td>
  243. </tr>
  244. <tr class="Nows_box Hidens">
  245. <th>办理内容:</th>
  246. <td colspan="7">
  247. <input type="text" style="width: 100%;" id="result" />
  248. </td>
  249. </tr>
  250. <tr>
  251. <th>被投诉单位:</th>
  252. <td>
  253. <div class="inpBox">
  254. <input type="text" class="inps5" placeholder="请选择被投诉单位" />
  255. <i class="Cleans5 fa fa-close"></i>
  256. <i class="xl5 xl_one"></i>
  257. <div class="addTree xlAdd5">
  258. <ul id="addTreeDemo5" class="ztree">
  259. </ul>
  260. </div>
  261. </div>
  262. </td>
  263. <th>类型:</th>
  264. <td>
  265. <div class="inpBox" style="width: 132px;">
  266. <input type="text" style="width: 130px;" class="inps2" placeholder="请选择类型" />
  267. <i class="Cleans2 fa fa-close"></i>
  268. <i class="xl2 xl_one"></i>
  269. <div class="addTree xlAdd2">
  270. <ul id="addTreeDemo2" class="ztree">
  271. </ul>
  272. </div>
  273. </div>
  274. <!--<select class="select_" id="type">
  275. </select>-->
  276. </td>
  277. <th>密级:</th>
  278. <td>
  279. <input type="radio" name="mj" id="" value="0" />普通
  280. <input type="radio" name="mj" id="" value="1" />保密
  281. </td>
  282. <th>紧急程度:</th>
  283. <td>
  284. <select class="select_" id="level">
  285. <option value="0">选择</option>
  286. <option value="1">普通</option>
  287. <option value="2">紧急</option>
  288. </select>
  289. </td>
  290. <!--<th class="">分管领导:</th>
  291. <td colspan="4">
  292. <input id="splituser" type="text" placeholder="" style="width:100%" readonly="readonly" />
  293. </td>-->
  294. </tr>
  295. </table>
  296. <div class="btn_box">
  297. <button class="btns BC">保存</button>
  298. <button class="btns SavedSubmit">保存并提交</button>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. <input type="hidden" id="complaint_unit" />
  304. <input type="hidden" id="type_id" />
  305. <input type="hidden" id="source_id" />
  306. <input type="hidden" id="source_address_id" />
  307. <input type="hidden" id="theme_word_id" />
  308. <script src="../css/laydate/laydate.js"></script>
  309. <script src="../js/adjustHeight.js"></script>
  310. <script src="../My97DatePicker/WdatePicker.js"></script>
  311. <script src="../js/zTree/jquery.ztree.core.js"></script>
  312. <script src="../js/pull_down.js"></script>
  313. <script>
  314. var wid = helper.request.queryString("wid");
  315. var submit;
  316. $(document).ready(function() {
  317. QY($("#sourcearea"));
  318. LY($("#source"));
  319. LB($("#type"));
  320. ZT($("#keys"));
  321. LAISHENG($("#province"));//省
  322. //省
  323. function LAISHENG(obj) {
  324. obj.empty();
  325. obj.append('<option selected="selected" value="">请选择</option>');
  326. $.getJSON(huayi.config.callcenter_url + "AddressManage/GetAddressList", {
  327. "token": $.cookie("token"),
  328. }, function (data) {
  329. if (data.state.toLowerCase() == "success") {
  330. var content = data.data;
  331. $(content).each(function (i, n) {
  332. $("<option value='" + n.Code + "'>" + n.Name + "</option>").appendTo(obj);
  333. })
  334. }
  335. })
  336. }
  337. //市
  338. function LAISHI(obj) {
  339. obj.empty();
  340. obj.append('<option selected="selected" value="">请选择</option>');
  341. $.getJSON(huayi.config.callcenter_url + "AddressManage/GetAddressList", {
  342. "token": $.cookie("token"),
  343. parentcode: $('#province').val(),
  344. }, function (data) {
  345. if (data.state.toLowerCase() == "success") {
  346. var content = data.data;
  347. $(content).each(function (i, n) {
  348. $("<option value='" + n.Code + "'>" + n.Name + "</option>").appendTo(obj);
  349. })
  350. }
  351. })
  352. }
  353. //区/县
  354. function LAIQU(obj) {
  355. obj.empty();
  356. obj.append('<option selected="selected" value="">请选择</option>');
  357. $.getJSON(huayi.config.callcenter_url + "AddressManage/GetAddressList", {
  358. "token": $.cookie("token"),
  359. parentcode: $('#city').val(),
  360. }, function (data) {
  361. if (data.state.toLowerCase() == "success") {
  362. var content = data.data;
  363. $(content).each(function (i, n) {
  364. $("<option value='" + n.Code + "'>" + n.Name + "</option>").appendTo(obj);
  365. })
  366. }
  367. })
  368. }
  369. //乡镇
  370. function VILLAGE(obj) {
  371. obj.empty();
  372. obj.append('<option selected="selected" value="">请选择</option>');
  373. $.getJSON(huayi.config.callcenter_url + "AddressManage/GetAddressList", {
  374. "token": $.cookie("token"),
  375. parentcode: $('#county').val(),
  376. }, function (data) {
  377. if (data.state.toLowerCase() == "success") {
  378. var content = data.data;
  379. $(content).each(function (i, n) {
  380. $("<option value='" + n.Code + "'>" + n.Name + "</option>").appendTo(obj);
  381. })
  382. }
  383. })
  384. }
  385. $('#province').on('change',function(){
  386. LAISHI($("#city"));
  387. });
  388. $('#city').on('change',function(){
  389. LAIQU($("#county"));
  390. });
  391. $('#county').on('change',function(){
  392. VILLAGE($("#village"));
  393. });
  394. // 被投诉单位
  395. tree();
  396. //当即办理
  397. $(' input[name="banli"]').change(function(){
  398. var val=$(this).val();
  399. if(val=="1"){
  400. $(".Nows_box").show();
  401. }else{
  402. $(".Nows_box").hide();
  403. }
  404. })
  405. $(".BC").click(function() {
  406. submit = 0;
  407. Add()
  408. });
  409. //被投诉单位下拉
  410. $('.inps5').click(function() {
  411. $('.xlAdd5').css('display', 'block')
  412. })
  413. $('.xl5').click(function() {
  414. if($('.xlAdd5').css('display') == 'block') {
  415. $('.xlAdd5').css('display', 'none')
  416. } else {
  417. $('.xlAdd5').css('display', 'block')
  418. }
  419. })
  420. $('.addTree').mouseleave(function() {
  421. $(this).css('display', 'none')
  422. })
  423. //清除
  424. $(".Cleans5 ").click(function(){
  425. $('.inps5').val("");
  426. $("#complaint_unit").val("");
  427. })
  428. //上传附件
  429. $("#scwj").click(function() {
  430. $("#upFile").trigger("click");
  431. })
  432. $("#upFile").change(function() {
  433. upload();
  434. })
  435. // $("#scfj").click(function() {
  436. // $(".fjnr").text("");
  437. // $("#scfj").hide();
  438. // })
  439. $(".SavedSubmit").click(function() {
  440. submit = 1;
  441. Add()
  442. })
  443. if(wid) {
  444. $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetWorkOrder', {
  445. workorderid: wid,
  446. "token": $.cookie("token")
  447. }, function(result) {
  448. if(result.state.toLowerCase() == "success") {
  449. var Data = result.data.data;
  450. var address_str=Data[0].F_AddressCodes.split('|');
  451. var address_str_name=Data[0].AddressName.split(' ');
  452. if(address_str[0]){
  453. $('#province option:selected').val(address_str[0])
  454. $('#province option:selected').text(address_str_name[0])
  455. }else{
  456. $('#province option:selected').val('')
  457. }
  458. if(address_str[1]){
  459. $('#city option:selected').val(address_str[1])
  460. $('#city option:selected').text(address_str_name[1])
  461. }else{
  462. $('#city option:selected').val('')
  463. }
  464. if(address_str[2]){
  465. $('#county option:selected').val(address_str[2])
  466. $('#county option:selected').text(address_str_name[2])
  467. }else{
  468. $('#county option:selected').val('')
  469. }
  470. if(address_str[3]){
  471. $('#village option:selected').val(address_str[3])
  472. $('#village option:selected').text(address_str_name[3])
  473. }else{
  474. $('#village option:selected').val('')
  475. }
  476. $("#cusname").val(Data[0].F_CusName);
  477. $("#cusphone").val(Data[0].F_CusPhone);
  478. $("#conphone").val(Data[0].F_ConPhone);
  479. $("#title").val(Data[0].F_ComTitle);
  480. $('#content').val(Data[0].F_ComContent);
  481. $('#email').val(Data[0].F_Email);
  482. $("#zipcode").val(Data[0].F_ZipCode);
  483. $("#result").val(Data[0].F_Result);
  484. //x性别
  485. $("#SEX").val(Data[0].F_CusSex+'');
  486. //来源
  487. // $("#source").val(Data[0].F_InfoSource+'');
  488. $(".inps3").val(Data[0].SourceName);
  489. $("#source_id").val(Data[0].F_InfoSource+'');
  490. //事件地址
  491. $("#sourcearea").val(Data[0].F_SourceArea+'');
  492. //主题词
  493. // $("#keys").val(Data[0].F_Key+'');
  494. $(".inps4").val(Data[0].KeyName);
  495. $("#theme_word_id").val(Data[0].F_Key+'');
  496. //类型
  497. // $("#type").val(Data[0].F_InfoType+'');
  498. $(".inps2").val(Data[0].TypeName1);
  499. $("#type_id").val(Data[0].F_InfoType+'');
  500. //被投诉单位
  501. $('.inps5').val(Data[0].ComplainedUnit)
  502. $("#complaint_unit").val(Data[0].F_ComplainedUnitID+'');
  503. //紧急程度
  504. $("#level").val(Data[0].F_Level+'');
  505. if(Data[0].F_IsResult == 1) {
  506. $(".Nows_box").toggle();
  507. }
  508. $(' input[name="mj"][value="' + Data[0].F_IsProtect + '"]').prop("checked", "checked");
  509. $(' input[name="banli"][value="' + Data[0].F_IsResult + '"]').prop("checked", "checked");
  510. $('#sourceaddress').val(Data[0].F_SourceAddress);
  511. $('.F_FinalOpinion').val(Data[0].F_FinalOpinion);
  512. $(Data[0].File).each(function(k,q){
  513. var strs='<span class="files" fiel-num="'+ q.F_FileId +'">'+ q.F_FileName.substring(19) +'<i class="fa fa-remove del_file"></i></span>'
  514. $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event){
  515. event.stopPropagation();
  516. $(this).parent().remove();
  517. file_num()
  518. })
  519. file_num()
  520. })
  521. }
  522. })
  523. }
  524. });
  525. //被投诉单位
  526. function tree() {
  527. $.get(huayi.config.callcenter_url + 'Department/GetSecondDeptList', {
  528. "token": $.cookie("token"),
  529. "iscbdw": 1
  530. }, function(result) {
  531. result = $.parseJSON(result);
  532. $.fn.zTree.init($("#addTreeDemo5"), setting1, result.data); //实例化树形图
  533. });
  534. }
  535. var setting1 = {
  536. data: {
  537. key: {
  538. name: "F_DeptName"
  539. },
  540. simpleData: {
  541. enable: true,
  542. idKey: "F_DeptId",
  543. pIdKey: "F_PartentId",
  544. rootPId: 0
  545. }
  546. },
  547. callback: {
  548. onClick: zTreeOnClick
  549. }
  550. };
  551. function zTreeOnClick(event, treeId, treeNode) {
  552. if(treeNode.level == 2) {
  553. $('.inps5').val(treeNode.F_DeptName);
  554. $("#complaint_unit").val(treeNode.F_DeptId);
  555. $(".Cleans5").show();
  556. }
  557. };
  558. ///修改工单
  559. function Add() {
  560. var value = $(' input[name="banli"]:checked ').val();
  561. var content = $("#content").val();
  562. if (!$("#title").val()) {
  563. layer.msg("请输入标题");
  564. } else if (!$("#content").val()) {
  565. layer.msg("请输入内容");
  566. } else if (!$("#theme_word_id").val()) {
  567. layer.msg("请选择主题词");
  568. } else if (!$("#sourcearea").val()) {
  569. layer.msg("请选择事发区域");
  570. } else if (value == 1 && !$('#result').val()) {
  571. layer.msg("请输入直办内容");
  572. } else {
  573. $.ajax({
  574. type: "post",
  575. url: huayi.config.callcenter_url + "WorkOrder/EditWorkOrder",
  576. dataType: 'json',
  577. async: true,
  578. data: {
  579. workorderid: wid,
  580. cusname: $("#cusname").val(), //=投诉人姓名
  581. cussex: $("#SEX").val(),
  582. cusphone: $("#cusphone").val(), //=投诉人电话
  583. email: $("#email").val(),
  584. zipcode: $("#zipcode").val(),
  585. conphone: $("#conphone").val(),
  586. title: $("#title").val(),
  587. content: $("#content").val(),
  588. files: $("#file").val(), //(多个用英文逗号,隔开)
  589. sourcearea: $("#sourcearea").val(), //=事发地域id
  590. sourceaddress: $('#sourceaddress').val(), //=事发详细地址
  591. source: $("#source_id").val(), //=来源
  592. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  593. result: $('#result').val(),
  594. keys: $("#theme_word_id").val(), //=关键词id(多个用英文逗号,隔开)
  595. type: $("#type_id").val(), //=类型
  596. bigtype: $("#bigtype").val(), //=大类别
  597. smalltype: $("#smalltype").val(), //=小类别
  598. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  599. level: $('#level').val(), //=(1普通2紧急)
  600. complainedunitid:$('#complaint_unit').val(),//被投诉单位id
  601. addresscodes:detailedAddress(),//地址
  602. issubmit: submit, //=(0保存1保存并提交)
  603. token: $.cookie("token")
  604. },
  605. success: function(data) {
  606. if(data.state.toLowerCase() == "success") {
  607. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  608. parent.layer.close(index); //再执行关闭
  609. parent.load();
  610. parent.layer.msg(data.message);
  611. $('.fileBox').html('');
  612. }
  613. }
  614. });
  615. }
  616. }
  617. //上传文件隐藏域值
  618. function file_num(){
  619. var str = '';
  620. var Str;
  621. $('.fileBox .files').each(function(j,m){
  622. var aa=$(m).attr("fiel-num")
  623. console.log(aa);
  624. str += aa + ",";
  625. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  626. })
  627. $("#file").val(Str);
  628. }
  629. //来源
  630. function LY(obj) {
  631. obj.empty();
  632. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  633. "token": $.cookie("token"),
  634. id: 1
  635. }, function(data) {
  636. if(data.state.toLowerCase() == "success") {
  637. var content = data.data;
  638. $(content).each(function(i, n) {
  639. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  640. })
  641. }
  642. })
  643. }
  644. //类别
  645. function LB(obj) {
  646. obj.empty();
  647. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  648. "token": $.cookie("token"),
  649. id: 2
  650. }, function(data) {
  651. if(data.state.toLowerCase() == "success") {
  652. var content = data.data;
  653. $(content).each(function(i, n) {
  654. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  655. })
  656. }
  657. })
  658. }
  659. // 主题
  660. function ZT(obj) {
  661. obj.empty();
  662. $.getJSON(huayi.config.callcenter_url + "Dictionary/GetDicValueListById", {
  663. "token": $.cookie("token"),
  664. id: 3
  665. }, function(data) {
  666. if(data.state.toLowerCase() == "success") {
  667. var content = data.data;
  668. $(content).each(function(i, n) {
  669. $("<option value='" + n.F_ValueId + "'>" + n.F_Value + "</option>").appendTo(obj);
  670. })
  671. }
  672. })
  673. }
  674. //区域
  675. function QY(obj) {
  676. obj.empty();
  677. obj.append('<option selected="selected" value="">请选择</option>');
  678. $.getJSON(huayi.config.callcenter_url + "Area/GetAreaListById", {
  679. "token": $.cookie("token"),
  680. }, function(data) {
  681. if(data.state.toLowerCase() == "success") {
  682. var content = data.data;
  683. $(content).each(function(i, n) {
  684. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(obj);
  685. })
  686. }
  687. })
  688. }
  689. //上传文件
  690. function upload() {
  691. var Files = document.getElementById("upFile").files;
  692. if(Files.length > 0) {
  693. var formData = new FormData();
  694. for(var i = 0; i < Files.length; i++) {
  695. formData.append('file' + i, Files[i]);
  696. }
  697. formData.append("token", $.cookie("token"));
  698. $.ajax({
  699. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  700. type: "POST",
  701. data: formData,
  702. /**
  703. *必须false才会自动加上正确的Content-Type
  704. */
  705. contentType: false,
  706. /**
  707. * 必须false才会避开jQuery对 formdata 的默认处理
  708. * XMLHttpRequest会对 formdata 进行正确的处理
  709. */
  710. processData: false,
  711. success: function(result) {
  712. document.getElementById("upFile").outerHTML = document.getElementById("upFile").outerHTML;
  713. $("#upFile").change(function() {
  714. upload();
  715. });
  716. var r = $.parseJSON(result);
  717. if(r.state.toLowerCase() == "success") {
  718. var a = r.data;
  719. $(a).each(function(i, n) {
  720. var strs='<span class="files" fiel-num="'+ n.F_FileId +'">'+ n.F_FileName.substring(19) +'<i class="fa fa-remove del_file"></i></span>'
  721. $(strs).appendTo($('.fileBox')).find('.del_file').click(function(event){
  722. event.stopPropagation();
  723. $(this).parent().remove();
  724. file_num()
  725. })
  726. })
  727. // $("#file").val(Str);
  728. // $("#scfj").show();
  729. file_num()
  730. }
  731. }
  732. });
  733. } else {
  734. layer.confirm('请上传文件!', {
  735. btn: ['确定']
  736. });
  737. }
  738. }
  739. // 地址(省+市+区/县)
  740. function detailedAddress() {
  741. if($('#province').val() === ""){
  742. var province = '';
  743. } else {
  744. var province = $('#province').val()
  745. }
  746. if($('#city').val() === ""){
  747. var city = '';
  748. } else {
  749. var city = $('#city').val()
  750. }
  751. if($('#county').val() === ""){
  752. var county = '';
  753. } else {
  754. var county = $('#county').val()
  755. }
  756. if($('#village').val() === ""){
  757. var village = '';
  758. } else {
  759. var village = $('#village').val()
  760. }
  761. var address = province + '|' + city + '|' + county+ '|' + village;
  762. return address;
  763. }
  764. </script>
  765. </body>
  766. </html>