Açıklama Yok

AddAppealDCL.html 36KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831
  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="../css/bootstrap-select.css" />
  8. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  9. <link rel="stylesheet" href="../css/addappeal.css" />
  10. <link href="../css/layer/need/layer.css" />
  11. <link rel="stylesheet" href="../css/init.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 class="Importent">标题:</th>
  22. <td colspan="7">
  23. <input id="title" type="text" style="width: 100%" />
  24. </td>
  25. </tr>
  26. <tr class="content-wrapper">
  27. <th class="Importent">来电内容:</th>
  28. <td colspan="7">
  29. <textarea data-adaptheight id="content" name="" rows="" cols="" style="width: 100%"
  30. readonly="readonly"></textarea>
  31. </td>
  32. </tr>
  33. <tr class="workcontent-wrapper">
  34. <th class="Importent">工单内容:</th>
  35. <td colspan="7">
  36. <textarea data-adaptheight id="workcontent" name="" rows="" cols=""
  37. style="width: 100%;"></textarea>
  38. </td>
  39. </tr>
  40. <tr>
  41. <th>附件上传:</th>
  42. <td colspan="7">
  43. <div class="fileBox"></div>
  44. <!--<span class="fjnr"></span>-->
  45. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
  46. style="display: none" />
  47. <input class="input" type="button" value="上传" id="scwj" />
  48. <input class="input" type="button" value="删除附件" id="scfj" style="display: none" />
  49. <input type="hidden" id="file" />
  50. <span style="color: #ff0000; border: none">
  51. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  52. </span>
  53. </td>
  54. </tr>
  55. <tr>
  56. <th>处理方式:</th>
  57. <td colspan="7">
  58. <input type="radio" value="1" name="banli" class="Nows" />当即办理
  59. <input checked="true" type="radio" value="0" name="banli" class="Nows_" />网络转办
  60. </td>
  61. </tr>
  62. <tr class="Nows_box Hidens">
  63. <th>办理内容:</th>
  64. <td colspan="7">
  65. <textarea id="result" name="" rows="" cols="" style="width: 100%; height: 80px;"></textarea>
  66. </td>
  67. </tr>
  68. <tr>
  69. <th class="Importent">姓名:</th>
  70. <td>
  71. <input type="text" id="cusname" />
  72. </td>
  73. <th>性别:</th>
  74. <td>
  75. <select class="select_" id="SEX">
  76. <option value="">请选择</option>
  77. <option value="0">男</option>
  78. <option value="1">女</option>
  79. </select>
  80. </td>
  81. <th>来源:</th>
  82. <td>
  83. <select class="select_" id="source"></select>
  84. </td>
  85. <th class="Importent">来电号码:</th>
  86. <td>
  87. <input type="text" id="cusphone" />
  88. </td>
  89. </tr>
  90. <tr>
  91. <th>类型:</th>
  92. <td>
  93. <select class="select_" id="type"></select>
  94. </td>
  95. <th class="Importent">反映类别:</th>
  96. <td style="position: relative">
  97. <div class="inpBox">
  98. <input type="text" class="inps" onkeyup="darptSearch()" />
  99. <i class="Cleans fa fa-close"></i>
  100. <i class="xl xl_one"></i>
  101. <div class="addTree xlAdd">
  102. <ul id="addTreeDemo" class="ztree"></ul>
  103. </div>
  104. </div>
  105. <div class="selDpart1">
  106. <ul id="sponsor"></ul>
  107. </div>
  108. </td>
  109. <th>来电号码密级:</th>
  110. <td>
  111. <input type="radio" name="mj" id="" value="0" />普通
  112. <input type="radio" name="mj" id="" value="1" />保密
  113. </td>
  114. <th>紧急程度:</th>
  115. <td>
  116. <select class="select_" id="level">
  117. <!--<option value="0">选择</option>-->
  118. <option value="1">普通</option>
  119. <option value="2">紧急</option>
  120. </select>
  121. </td>
  122. </tr>
  123. <tr>
  124. <th>承办单位:</th>
  125. <td colspan="3">
  126. <select id="jbSelect" name="select" class="selectpicker show-tick form-control" multiple
  127. data-live-search="true">
  128. </select>
  129. </td>
  130. </tr>
  131. <tr class="leaderCharge-wrapper" style="display: none;">
  132. <th class="">分管领导:</th>
  133. <td>
  134. <select class="select_" id="leaderCharge">
  135. <option value="">请选择</option>
  136. <option value="省长">省长</option>
  137. <option value="市长">市长</option>
  138. </select>
  139. </td>
  140. </tr>
  141. <tr class="limittimeWrapper">
  142. <th>办理时限:</th>
  143. <td colspan="3">
  144. <select class="startTime" id="startTime"
  145. style="width: 200px; height: 30px; line-height: 30px;">
  146. <!--<option value="0">选择</option>-->
  147. <option value="1">一天</option>
  148. <option value="3">三天</option>
  149. <option value="5">五天</option>
  150. <option value="7">七天</option>
  151. </select>
  152. </td>
  153. </tr>
  154. <tr class="limittimesWrapper">
  155. <th>紧急时限:</th>
  156. <td colspan="">
  157. <input type="text" id="limittimes">
  158. </td>
  159. </tr>
  160. <tr class="limittimesWrapperCB" style="display: none;">
  161. <th>办理时限:</th>
  162. <td colspan="">
  163. <input type="text" id="limittimesCB" autocomplete="off">
  164. </td>
  165. </tr>
  166. <tr>
  167. <td colspan="8" style="text-align: center">
  168. <!-- <div class="btn_box"> -->
  169. <button class="btns BC">保存</button>
  170. <button class="btns JB">审核通过</button>
  171. <button class="btns thBtn">回退</button>
  172. <button class="btns associatWorkOrder">关联工单</button>
  173. <!--<button class="btns SavedSubmit">保存并提交</button>-->
  174. <!-- </div> -->
  175. </td>
  176. </tr>
  177. <tr>
  178. <th class="Importent">事件地址:</th>
  179. <td colspan="7">
  180. <select class="select_" id="sourcearea"></select>
  181. </td>
  182. </tr>
  183. <tr>
  184. <th class="Importent"></th>
  185. <td colspan="7">
  186. <input id="sourceaddress" type="text" placeholder="输入详细地址"
  187. style="width: 50%; padding-left: 15px" />
  188. </td>
  189. </tr>
  190. <tr>
  191. <th class="Importent"></th>
  192. <td colspan="7">
  193. <div style="width: 710px">
  194. <div id="myMap" style="width: 100%; height: 400px"></div>
  195. <input type="hidden" class="store_Lng" value="114.398996" />
  196. <input type="hidden" class="store_Lat" value="36.104678" />
  197. </div>
  198. </td>
  199. </tr>
  200. </table>
  201. </div>
  202. </div>
  203. </div>
  204. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  205. <script src="../css/laydate/laydate.js"></script>
  206. <script src="../js/bootstrap-select.js"></script>
  207. <script src="../js/adjustHeight.js"></script>
  208. <script src="../js/appeal/index.js"></script>
  209. <script src="../js/zTree/jquery.ztree.core.js"></script>
  210. <script src="../js/ztreeSelect.js"></script>
  211. <script>
  212. var wid = helper.request.queryString("wid");
  213. var workType = helper.request.queryString("workType");
  214. var roleCode = $.cookie("code");
  215. var submit;
  216. $(document).ready(function () {
  217. QY($("#sourcearea"));
  218. LY($("#source"));
  219. LB($("#type"));
  220. ZT($("#keys"));
  221. jbSelect($("#jbSelect"));
  222. laydate.skin("blue");
  223. laydate({
  224. elem: "#limittimes",
  225. event: "focus",
  226. istime: true,
  227. format: 'YYYY-MM-DD hh:mm:ss'
  228. });
  229. laydate({
  230. elem: "#limittimesCB",
  231. event: "focus",
  232. // istime: true,
  233. format: 'YYYY-MM-DD'
  234. });
  235. // 管理员、中心话务员可编辑工单内容
  236. if (roleCode === "GLY") {
  237. $("#content").removeAttr("readonly")
  238. } else if (roleCode === "ZXHWY") {
  239. $(".workcontent-wrapper").hide()
  240. $("#content").removeAttr("readonly")
  241. }
  242. //当即办理
  243. $(' input[name="banli"]').change(function () {
  244. var val = $(this).val();
  245. if (val == "1") {
  246. $(".Nows_box").show();
  247. } else {
  248. $(".Nows_box").hide();
  249. }
  250. });
  251. $(".BC").click(function () {
  252. submit = 0;
  253. workType = ""
  254. Add();
  255. });
  256. $(".JB").click(function () {
  257. submit = 0;
  258. Add();
  259. });
  260. //上传附件
  261. $("#scwj").click(function () {
  262. $("#upFile").trigger("click");
  263. });
  264. $("#upFile").change(function () {
  265. upload();
  266. });
  267. $(".SavedSubmit").click(function () {
  268. submit = 1;
  269. Add();
  270. });
  271. $(".thBtn").click(function () {
  272. layer.open({
  273. type: 2,
  274. content: "../CommonHtml/BackDatil.html?wid=" + wid, //iframe的url,no代表不显示滚动条
  275. title: "工单回退",
  276. area: ["60%", "80%"], //宽高
  277. });
  278. });
  279. $(".associatWorkOrder").click(function () {
  280. layer.open({
  281. type: 2,
  282. content: "../CommonHtml/associatWorkOrder.html?wid=" +
  283. wid, //iframe的url,no代表不显示滚动条
  284. title: "关联工单",
  285. area: ["90%", "90%"], //宽高
  286. });
  287. });
  288. if (wid) {
  289. $.ajax({
  290. type: "get",
  291. url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrderNew",
  292. dataType: "json",
  293. async: false,
  294. data: {
  295. workorderid: wid,
  296. type: 0, // 工单信息
  297. token: $.cookie("token"),
  298. },
  299. success: function (data) {
  300. if (data.state.toLowerCase() == "success") {
  301. var Data = data.data.data;
  302. $("#cusname").val(Data[0].F_CusName);
  303. $("#cusphone").val(Data[0].F_CusPhone);
  304. $("#conphone").val(Data[0].F_ConPhone);
  305. $("#title").val(Data[0].F_ComTitle);
  306. $("#content").val(Data[0].F_ComContent);
  307. if (Data[0].F_Content === "" || Data[0].F_Content === null) {
  308. $('#workcontent').val(Data[0].F_ComContent);
  309. } else {
  310. $('#workcontent').val(Data[0].F_Content);
  311. }
  312. $("#email").val(Data[0].F_Email);
  313. $("#zipcode").val(Data[0].F_ZipCode);
  314. $("#result").val(Data[0].F_Result);
  315. $(".inps").val(Data[0].KeyName)
  316. $("#PID").val(Data[0].F_Key)
  317. if (Data[0].F_Longitude) {
  318. $(".store_Lng").val(Data[0].F_Longitude);
  319. $(".store_Lat").val(Data[0].F_Latitude);
  320. }
  321. //x性别
  322. $("#SEX option:selected").val(
  323. Data[0].F_CusSex + ""
  324. );
  325. if (Data[0].F_CusSex == "0") {
  326. $("#SEX option:selected").text("男"); //乡镇
  327. } else {
  328. $("#SEX option:selected").text("女"); //乡镇
  329. }
  330. //来源
  331. $("#source option:selected").val(Data[0].F_InfoSource + "");
  332. $("#source option:selected").text(Data[0].SourceName); //来源
  333. if (Data[0].F_InfoSource + "" === "4") {
  334. $(".leaderCharge-wrapper").show()
  335. $("#leaderCharge").val(Data[0].splituser)
  336. }
  337. //事件地址
  338. $("#sourcearea option:selected").val(
  339. Data[0].F_SourceArea + ""
  340. );
  341. $("#sourcearea option:selected").text(
  342. Data[0].AreaName
  343. ); //事件地址
  344. //主题词
  345. $("#keys option:selected").val(
  346. Data[0].F_Key + ""
  347. );
  348. $("#keys option:selected").text(
  349. Data[0].KeyName
  350. ); //主题词
  351. //类型
  352. $("#type option:selected").val(
  353. Data[0].F_InfoType + ""
  354. );
  355. $("#type option:selected").text(
  356. Data[0].TypeName1
  357. ); //类型
  358. //紧急程度
  359. $("#level").val(Data[0].F_Level + "");
  360. if (workType === "cb") {
  361. $(".limittimeWrapper").hide()
  362. $(".limittimesWrapper").hide()
  363. $(".limittimesWrapperCB").show()
  364. } else {
  365. if (Data[0].F_Level == "2") {
  366. $("#level option:selected").text("紧急"); //乡镇
  367. $(".limittimesWrapper").show()
  368. $(".limittimeWrapper").hide()
  369. } else {
  370. $("#level option:selected").text("普通"); //乡镇
  371. $(".limittimesWrapper").hide()
  372. $(".limittimeWrapper").show()
  373. }
  374. }
  375. if (Data[0].F_IsResult == 1) {
  376. $(".Nows_box").toggle();
  377. }
  378. $(
  379. ' input[name="mj"][value="' +
  380. Data[0].F_IsProtect +
  381. '"]'
  382. ).prop("checked", "checked");
  383. $(
  384. ' input[name="banli"][value="' +
  385. Data[0].F_IsResult +
  386. '"]'
  387. ).prop("checked", "checked");
  388. $("#sourceaddress").val(
  389. Data[0].F_SourceAddress
  390. );
  391. $(".F_FinalOpinion").val(
  392. Data[0].F_FinalOpinion
  393. );
  394. $(Data[0].File).each(function (k, q) {
  395. var strs =
  396. '<span class="files" fiel-num="' +
  397. q.F_FileId +
  398. '">' +
  399. q.F_FileName.substring(19) +
  400. '<i class="fa fa-remove del_file"></i></span>';
  401. $(strs)
  402. .appendTo($(".fileBox"))
  403. .find(".del_file")
  404. .click(function (event) {
  405. event.stopPropagation();
  406. $(this).parent().remove();
  407. file_num();
  408. });
  409. file_num();
  410. });
  411. }
  412. },
  413. });
  414. }
  415. });
  416. ///修改工单
  417. function Add() {
  418. var jbSelect = $("#jbSelect").val();
  419. var startTime = $("#startTime").val();
  420. var limittimes = $("#limittimes").val();
  421. var limittimesCB = $("#limittimesCB").val();
  422. //坐席
  423. // var usercodeID = "";
  424. // var usercode_ = $("#ZX").val(); //坐席
  425. // if (usercode_ != null) {
  426. // $(usercode_).each(function (i, n) {
  427. // var obj1 = "";
  428. // obj1 = n + ",";
  429. // usercodeID += obj1;
  430. // });
  431. // } else {
  432. // usercodeID = "";
  433. // }
  434. var value = $(' input[name="banli"]:checked ').val();
  435. var content = $("#content").val();
  436. // if (!$("#cusname").val()) {
  437. // layer.msg("请输入姓名");
  438. // } else
  439. // if (!$("#cusphone").val()) {
  440. // layer.msg("请输入来电号码");
  441. // } else if (!$("#title").val()) {
  442. // layer.msg("请输入标题");
  443. // } else if (!$("#content").val()) {
  444. // layer.msg("请输入内容");
  445. // } else if (!$("#keys").val()) {
  446. // layer.msg("请选择主题词");
  447. // } else if (!$("#sourcearea").val()) {
  448. // layer.msg("请选择事发区域");
  449. // } else if (value == 1 && !$("#result").val()) {
  450. // layer.msg("请输入直办内容");
  451. // } else {
  452. $.ajax({
  453. type: "post",
  454. url: huayi.config.callcenter_url +
  455. "WorkOrder/EditWorkOrder",
  456. dataType: "json",
  457. async: true,
  458. data: {
  459. workorderid: wid,
  460. cusname: $("#cusname").val(), //=来电人姓名
  461. cussex: $("#SEX").val(),
  462. cusphone: $("#cusphone").val(), //=来电人电话
  463. email: $("#email").val(),
  464. zipcode: $("#zipcode").val(),
  465. conphone: $("#conphone").val(),
  466. title: $("#title").val(),
  467. content: $("#content").val(),
  468. workcontent: $("#workcontent").val(),
  469. files: $("#file").val(), //(多个用英文逗号,隔开)
  470. sourcearea: $("#sourcearea").val(), //=事发地域id
  471. sourceaddress: $("#sourceaddress").val(), //=事发详细地址
  472. source: $("#source").val(), //=来源
  473. splituser: $("#leaderCharge").val(), // 分管领导
  474. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  475. result: $("#result").val(),
  476. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开) keys
  477. type: $("#type").val(), //=类型
  478. bigtype: $("#bigtype").val(), //=大类别
  479. smalltype: $("#smalltype").val(), //=小类别
  480. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  481. level: $("#level").val(), //=(1普通2紧急)
  482. issubmit: submit, //=(0保存1保存并提交)
  483. token: $.cookie("token"),
  484. },
  485. success: function (data) {
  486. if (data.state.toLowerCase() == "success") {
  487. if (workType === "cb") {
  488. layer.open({
  489. type: 2,
  490. content: "../CommonHtml/Cb.html?wid=" + wid + "&jbSelect=" +
  491. jbSelect + "&startTime=" + startTime + "&limittimes=" +
  492. limittimes + "&limittimesCB=" + limittimesCB +
  493. "&level=" + $("#level").val(), //iframe的url,no代表不显示滚动条
  494. title: "重办工单",
  495. area: ["95%", "95%"], //宽高
  496. });
  497. } else if (workType === "jb") {
  498. layer.open({
  499. type: 2,
  500. content: "../CommonHtml/jiaoban.html?wid=" + wid + "&jbSelect=" +
  501. jbSelect + "&startTime=" + startTime + "&limittimes=" +
  502. limittimes +
  503. "&level=" + $("#level").val(), //iframe的url,no代表不显示滚动条
  504. title: "工单交办",
  505. area: ["95%", "95%"], //宽高
  506. });
  507. } else {
  508. var index = parent.layer.getFrameIndex(
  509. window.name
  510. ); //先得到当前iframe层的索引
  511. parent.layer.close(index); //再执行关闭
  512. parent
  513. .$("#orderlist")
  514. .bootstrapTable("refresh");
  515. parent.layer.msg(data.message);
  516. }
  517. $(".fileBox").html("");
  518. }
  519. },
  520. });
  521. // }
  522. }
  523. $("#level").click(function () {
  524. var level = $("#level").val();
  525. if (workType === "cb") {
  526. $(".limittimesWrapperCB").show()
  527. } else {
  528. if (level === "2") {
  529. $(".limittimesWrapper").show()
  530. $(".limittimeWrapper").hide()
  531. } else {
  532. $(".limittimesWrapper").hide()
  533. $(".limittimeWrapper").show()
  534. }
  535. }
  536. })
  537. //上传文件隐藏域值
  538. function file_num() {
  539. var str = "";
  540. var Str;
  541. $(".fileBox .files").each(function (j, m) {
  542. var aa = $(m).attr("fiel-num");
  543. console.log(aa);
  544. str += aa + ",";
  545. Str =
  546. str.substring(str.length - 1) == "," ?
  547. str.substring(0, str.length - 1) :
  548. str;
  549. });
  550. $("#file").val(Str);
  551. }
  552. //来源
  553. function LY(obj) {
  554. obj.empty();
  555. obj.append(
  556. '<option selected="selected" value="">请选择</option>'
  557. );
  558. $.ajax({
  559. type: "get",
  560. url: huayi.config.callcenter_url +
  561. "Dictionary/GetDicValueListById",
  562. dataType: "json",
  563. async: false,
  564. data: {
  565. token: $.cookie("token"),
  566. id: 1,
  567. },
  568. success: function (data) {
  569. if (data.state.toLowerCase() == "success") {
  570. var content = data.data;
  571. $(content).each(function (i, n) {
  572. $(
  573. "<option value='" +
  574. n.F_ValueId +
  575. "'>" +
  576. n.F_Value +
  577. "</option>"
  578. ).appendTo(obj);
  579. });
  580. }
  581. },
  582. });
  583. }
  584. //类别
  585. function LB(obj) {
  586. obj.empty();
  587. obj.append(
  588. '<option selected="selected" value="">请选择</option>'
  589. );
  590. $.ajax({
  591. type: "get",
  592. url: huayi.config.callcenter_url +
  593. "Dictionary/GetDicValueListById",
  594. dataType: "json",
  595. async: false,
  596. data: {
  597. token: $.cookie("token"),
  598. id: 2,
  599. },
  600. success: function (data) {
  601. if (data.state.toLowerCase() == "success") {
  602. var content = data.data;
  603. $(content).each(function (i, n) {
  604. $(
  605. "<option value='" +
  606. n.F_ValueId +
  607. "'>" +
  608. n.F_Value +
  609. "</option>"
  610. ).appendTo(obj);
  611. });
  612. }
  613. },
  614. });
  615. }
  616. // 主题
  617. function ZT(obj) {
  618. obj.empty();
  619. obj.append(
  620. '<option selected="selected" value="">请选择</option>'
  621. );
  622. $.ajax({
  623. type: "get",
  624. url: huayi.config.callcenter_url +
  625. "Dictionary/GetDicValueListById",
  626. dataType: "json",
  627. async: false,
  628. data: {
  629. token: $.cookie("token"),
  630. id: 3,
  631. },
  632. success: function (data) {
  633. if (data.state.toLowerCase() == "success") {
  634. var content = data.data;
  635. $(content).each(function (i, n) {
  636. $(
  637. "<option value='" +
  638. n.F_ValueId +
  639. "'>" +
  640. n.F_Value +
  641. "</option>"
  642. ).appendTo(obj);
  643. });
  644. }
  645. },
  646. });
  647. }
  648. //区域
  649. function QY(obj) {
  650. obj.empty();
  651. obj.append(
  652. '<option selected="selected" value="">请选择</option>'
  653. );
  654. $.ajax({
  655. type: "get",
  656. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  657. dataType: "json",
  658. async: false,
  659. data: {
  660. token: $.cookie("token"),
  661. },
  662. success: function (data) {
  663. if (data.state.toLowerCase() == "success") {
  664. var content = data.data;
  665. $(content).each(function (i, n) {
  666. if (n.F_AreaName != "安阳市") {
  667. $(
  668. "<option value='" +
  669. n.F_AreaId +
  670. "'>" +
  671. n.F_AreaName +
  672. "</option>"
  673. ).appendTo(obj);
  674. }
  675. });
  676. }
  677. },
  678. });
  679. }
  680. $("#source").click(function () {
  681. if ($("#source").val() === "4") {
  682. $(".leaderCharge-wrapper").show()
  683. } else {
  684. $(".leaderCharge-wrapper").hide()
  685. }
  686. })
  687. //上传文件
  688. function upload() {
  689. var Files = document.getElementById("upFile").files;
  690. if (Files.length > 0) {
  691. var formData = new FormData();
  692. for (var i = 0; i < Files.length; i++) {
  693. formData.append("file" + i, Files[i]);
  694. }
  695. formData.append("token", $.cookie("token"));
  696. var typeName = Files[0].name.split(".")[1];
  697. if (
  698. typeName == "png" ||
  699. typeName == "jpg" ||
  700. typeName == "mp4" ||
  701. typeName == "mp3" ||
  702. typeName == "pdf" ||
  703. typeName == "doc" ||
  704. typeName == "docx" ||
  705. typeName == "xls" ||
  706. typeName == "xlsx"
  707. ) {
  708. $.ajax({
  709. url: huayi.config.callcenter_url +
  710. "/WorkOrder/UploadFile",
  711. type: "POST",
  712. data: formData,
  713. /**
  714. *必须false才会自动加上正确的Content-Type
  715. */
  716. contentType: false,
  717. /**
  718. * 必须false才会避开jQuery对 formdata 的默认处理
  719. * XMLHttpRequest会对 formdata 进行正确的处理
  720. */
  721. processData: false,
  722. success: function (result) {
  723. document.getElementById(
  724. "upFile"
  725. ).outerHTML = document.getElementById(
  726. "upFile"
  727. ).outerHTML;
  728. $("#upFile").change(function () {
  729. upload();
  730. });
  731. var r = $.parseJSON(result);
  732. if (r.state.toLowerCase() == "success") {
  733. var a = r.data;
  734. $(a).each(function (i, n) {
  735. var strs =
  736. '<span class="files" fiel-num="' +
  737. n.F_FileId +
  738. '">' +
  739. n.F_FileName.substring(19) +
  740. '<i class="fa fa-remove del_file"></i></span>';
  741. $(strs)
  742. .appendTo($(".fileBox"))
  743. .find(".del_file")
  744. .click(function (event) {
  745. event.stopPropagation();
  746. $(this).parent().remove();
  747. file_num();
  748. });
  749. });
  750. file_num();
  751. }
  752. },
  753. });
  754. } else {
  755. layer.msg("格式不正确");
  756. }
  757. } else {
  758. layer.confirm("请上传文件!", {
  759. btn: ["确定"],
  760. });
  761. }
  762. }
  763. function closePage() {
  764. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  765. parent.layer.close(index); //再执行关闭
  766. parent.$("#orderlist").bootstrapTable("refresh");
  767. parent.layer.msg("操作成功");
  768. }
  769. function jbSelect(obj) {
  770. obj.empty();
  771. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  772. "token": $.cookie("token"),
  773. "iscbdw": 1,
  774. }, function (data) {
  775. if (data.state.toLowerCase() == "success") {
  776. var content = data.data;
  777. $("<option value=''>请选择</option>").appendTo(obj);
  778. $(content).each(function (i, n) {
  779. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  780. obj);
  781. })
  782. obj.selectpicker({
  783. noneSelectedText: '请选择' //默认显示内容
  784. });
  785. obj.selectpicker('refresh');
  786. }
  787. })
  788. }
  789. function xbSelect(obj) {
  790. obj.empty();
  791. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  792. "token": $.cookie("token"),
  793. "iscbdw": 1,
  794. }, function (data) {
  795. if (data.state.toLowerCase() == "success") {
  796. var content = data.data;
  797. $(content).each(function (i, n) {
  798. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  799. obj);
  800. })
  801. obj.selectpicker({
  802. noneSelectedText: '请选择' //默认显示内容
  803. });
  804. obj.selectpicker('refresh');
  805. }
  806. })
  807. }
  808. </script>
  809. </body>
  810. </html>