Няма описание

AddAppealDCL.html 42KB

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