Nessuna descrizione

AddAppealDCL.html 34KB

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