Нет описания

AddAppealDCL.html 35KB

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