Nessuna descrizione

AddAppealDCL.html 35KB

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