Нет описания

AddAppeal.html 63KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406
  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. .bootstrap-select .dropdown-menu {
  41. height: 360px !important;
  42. }
  43. .bootstrap-select .dropdown-menu li a span.text {
  44. color: inherit
  45. }
  46. </style>
  47. </head>
  48. <body>
  49. <input type="hidden" id="PID" value="" />
  50. <div class="wrapper wrapper-content animated fadeInRight">
  51. <div style="padding: 10px" class="tj_content clearFix">
  52. <div class="Common">
  53. <table>
  54. <tr>
  55. <th class="Importent">标题:</th>
  56. <td colspan="7">
  57. <input id="title" class="form-control" type="text" />
  58. </td>
  59. </tr>
  60. <tr class="content-wrapper">
  61. <th class="Importent">来电内容:</th>
  62. <td colspan="7">
  63. <textarea data-adaptheight id="content" class="form-control" name="" rows="" cols=""
  64. readonly="readonly"></textarea>
  65. </td>
  66. </tr>
  67. <tr class="workcontent-wrapper">
  68. <th class="Importent">工单内容:</th>
  69. <td colspan="7">
  70. <textarea data-adaptheight id="workcontent" class="form-control" name="" rows="" cols=""
  71. style="width: 100%;"></textarea>
  72. </td>
  73. </tr>
  74. <tr>
  75. <th>附件上传:</th>
  76. <td colspan="7">
  77. <div class="fileBox"></div>
  78. <!--<span class="fjnr"></span>-->
  79. <input class="input" type="file" name="upFile" id="upFile" multiple="multiple"
  80. style="display: none" />
  81. <input class="input" type="button" value="上传" id="scwj" />
  82. <input class="input" type="button" value="删除附件" id="scfj" style="display: none" />
  83. <input type="hidden" id="file" />
  84. <span style="color: #ff0000; border: none">
  85. (文件格式为png,jpg,mp4,mp3,pdf,doc,docx,xls,xlsx)
  86. </span>
  87. </td>
  88. </tr>
  89. <tr>
  90. <th>处理方式:</th>
  91. <td colspan="7">
  92. <input type="radio" value="1" name="banli" class="Nows" />当即办理
  93. <input checked="true" type="radio" value="0" name="banli" class="Nows_" />网络转办
  94. <input id="threeWayCall" type="checkbox" value="1" name="" class="Nows_" />三方通话
  95. </td>
  96. </tr>
  97. <tr class="Nows_box Hidens">
  98. <th>办理附件:</th>
  99. <td colspan="7">
  100. <div class="fileBoxHandle"></div>
  101. <input class="input" type="file" name="upFile" id="upFileHandle" multiple="multiple"
  102. style="display: none;">
  103. <input class="input" type="button" value="上传" id="scwjHandle" />
  104. <input type="hidden" id="fileHandle" />
  105. <span style="color:#FF0000; border: none;">
  106. (文件格式为png,jpg,mp4,avi,wmv,mp3,pdf,doc,docx,xls,xlsx)
  107. </span>
  108. </td>
  109. </tr>
  110. <tr class="Nows_box Hidens">
  111. <th>办理内容:</th>
  112. <td colspan="7">
  113. <textarea id="result" name="" rows="" cols="" class="form-control" style="width: 100%; height: 80px;"></textarea>
  114. </td>
  115. </tr>
  116. <tr>
  117. <th class="Importent">姓名:</th>
  118. <td>
  119. <input type="text" id="cusname" class="form-control" />
  120. </td>
  121. <th>性别:</th>
  122. <td>
  123. <select class="form-control" id="SEX">
  124. <option value="">请选择</option>
  125. <option value="0">男</option>
  126. <option value="1">女</option>
  127. </select>
  128. </td>
  129. <th>来源:</th>
  130. <td>
  131. <select class="form-control" id="source"></select>
  132. </td>
  133. <th class="Importent">来电号码:</th>
  134. <td>
  135. <input type="text" id="cusphone" class="form-control" />
  136. </td>
  137. </tr>
  138. <tr>
  139. <th>类型:</th>
  140. <td>
  141. <select class="form-control" id="type"></select>
  142. </td>
  143. <th class="Importent">反映类别:</th>
  144. <td class="reflectCategory-wrapper">
  145. <input type="text" id="reflectCategory" class="form-control" autocomplete="off" />
  146. <div class="reflectCategoryList-wrapper">
  147. <ul id="reflectCategoryList">
  148. </ul>
  149. </div>
  150. </td>
  151. <!-- <td style="position: relative">
  152. <div class="inpBox">
  153. <input type="text" class="inps" />
  154. <i class="Cleans fa fa-close"></i>
  155. <i class="xl xl_one"></i>
  156. <div class="addTree xlAdd">
  157. <ul id="addTreeDemo" class="ztree"></ul>
  158. </div>
  159. </div>
  160. <div class="selDpart1">
  161. <ul id="sponsor"></ul>
  162. </div>
  163. </td> -->
  164. <th>来电号码密级:</th>
  165. <td>
  166. <input type="radio" name="mj" id="" value="0" />普通
  167. <input type="radio" name="mj" id="" value="1" />保密
  168. </td>
  169. <th>紧急程度:</th>
  170. <td>
  171. <select class="form-control" id="level">
  172. <!--<option value="0">选择</option>-->
  173. <option value="1">普通</option>
  174. <option value="2">紧急</option>
  175. </select>
  176. </td>
  177. </tr>
  178. <!-- <tr class="phonetype-wrapper" style="display: none">
  179. <th class="">电话类别:</th>
  180. <td>
  181. <select class="form-control" id="phonetype">
  182. <option value="">请选择</option>
  183. </select>
  184. </td>
  185. </tr> -->
  186. <tr class="leaderCharge-wrapper" style="display: none;">
  187. <th class="">分管领导:</th>
  188. <td>
  189. <select class="select_ form-control" id="leaderCharge">
  190. <option value="">请选择</option>
  191. <option value="省长">省长</option>
  192. <option value="市长">市长</option>
  193. </select>
  194. </td>
  195. </tr>
  196. <tr>
  197. <th>自动派单:</th>
  198. <td>
  199. <select class="form-control" id="automaticDispatch">
  200. <option value="">请选择</option>
  201. <option value="1">是</option>
  202. <option value="0">否</option>
  203. </select>
  204. </td>
  205. </tr>
  206. <tr class="undertakeUnitWrapper">
  207. <th>承办单位:</th>
  208. <td colspan="7">
  209. <!-- <input type="text" id="jbSelectText" class="form-control" style="width: 100%"/>
  210. <input type="hidden" id="jbSelect"> -->
  211. <select id="jbSelect" name="select" class="selectpicker show-tick form-control" multiple
  212. data-live-search="true">
  213. </select>
  214. </td>
  215. </tr>
  216. <tr class="limittimeWrapper">
  217. <th>办理时限:</th>
  218. <td colspan="3">
  219. <select class="startTime form-control" id="startTime"
  220. style="width: 200px; height: 30px; line-height: 30px;">
  221. <!--<option value="0">选择</option>-->
  222. <option value="1">一天</option>
  223. <option value="3">三天</option>
  224. <option value="5">五天</option>
  225. <option value="7">七天</option>
  226. </select>
  227. </td>
  228. </tr>
  229. <tr class="limittimesWrapper">
  230. <th>紧急时限:</th>
  231. <td colspan="">
  232. <input type="text" id="limittimes" class="form-control">
  233. </td>
  234. </tr>
  235. <tr class="limittimesWrapperCB" style="display: none;">
  236. <th>办理时限:</th>
  237. <td colspan="">
  238. <input type="text" id="limittimesCB" class="form-control" autocomplete="off">
  239. </td>
  240. </tr>
  241. <tr>
  242. <td colspan="8" style="text-align: center">
  243. <!-- <div class="btn_box"> -->
  244. <button class="btns BC">保存</button>
  245. <!-- 营商审核 -->
  246. <button class="btns auditBtnMarketing" style="display: none;">审核</button>
  247. <button class="btns JB">审核通过</button>
  248. <button class="btns thBtn">回退</button>
  249. <button class="btns associatWorkOrder">关联工单</button>
  250. <!--<button class="btns SavedSubmit">保存并提交</button>-->
  251. <!-- </div> -->
  252. </td>
  253. </tr>
  254. <tr>
  255. <th>事发区域:</th>
  256. <td>
  257. <select class="form-control" id="sourcearea">
  258. <option value="">请选择</option>
  259. </select>
  260. </td>
  261. <th>乡镇:</th>
  262. <td>
  263. <select class="form-control" id="township">
  264. <option value="">请选择</option>
  265. </select>
  266. </td>
  267. <th>村:</th>
  268. <td>
  269. <select class="form-control" id="village">
  270. <option value="">请选择</option>
  271. </select>
  272. </td>
  273. </tr>
  274. <tr>
  275. <th>详细地址:</th>
  276. <td colspan="7">
  277. <input id="sourceaddress" class="form-control" type="text" placeholder="输入详细地址"
  278. style="width: 50%; padding-left: 15px" />
  279. </td>
  280. </tr>
  281. <tr>
  282. <th class="Importent"></th>
  283. <td colspan="7">
  284. <div style="width: 710px">
  285. <div id="myMap" style="width: 100%; height: 400px"></div>
  286. <input type="hidden" class="store_Lng" value="114.398996" />
  287. <input type="hidden" class="store_Lat" value="36.104678" />
  288. </div>
  289. </td>
  290. </tr>
  291. </table>
  292. </div>
  293. </div>
  294. </div>
  295. <script src="https://api.map.baidu.com/api?v=2.0&ak=ZG4gLQZUD6Eq1K11cqlYAR4by8CKgLyu&callback=mapinit"></script>
  296. <script src="../js/layui/layui.js"></script>
  297. <script src="../css/laydate/laydate.js"></script>
  298. <script src="../js/bootstrap-select.js"></script>
  299. <script src="../js/adjustHeight.js"></script>
  300. <script src="../js/appeal/mapIndex.js"></script>
  301. <script src="../js/zTree/jquery.ztree.core.js"></script>
  302. <script src="../js/ztreeSelect.js"></script>
  303. <script>
  304. var wid = helper.request.queryString("wid");
  305. var workType = helper.request.queryString("workType");
  306. var IsExamine = helper.request.queryString("IsExamine"); // 营商审核:0待审转办未审核、1待审转办已审核
  307. var isshMultimedia = helper.request.queryString("isshMultimedia"); // 多媒体审核:0待审转办1审核未通过2审核员待审核
  308. var roleCode = $.cookie("code");
  309. var organizerSelectedObj = {}; // 承办单位选中数据
  310. var submit;
  311. $(document).ready(function () {
  312. QY($("#sourcearea"));
  313. LY($("#source"));
  314. LB($("#type"));
  315. ZT($("#keys"));
  316. jbSelect($("#jbSelect"));
  317. getReactionCategory();
  318. // 电话类别
  319. // getPhoneType($("#phonetype"));
  320. laydate.skin("blue");
  321. laydate({
  322. elem: "#limittimes",
  323. event: "focus",
  324. istime: true,
  325. format: 'YYYY-MM-DD hh:mm:ss'
  326. });
  327. laydate({
  328. elem: "#limittimesCB",
  329. event: "focus",
  330. // istime: true,
  331. format: 'YYYY-MM-DD'
  332. });
  333. if (workType) {
  334. $(".auditBtnMarketing").hide(); // 营商审核
  335. $(".JB").show(); // 审核通过
  336. $(".thBtn").show(); // 回退
  337. $(".associatWorkOrder").show(); // 关联工单
  338. } else {
  339. $(".auditBtnMarketing").hide(); // 审核
  340. $(".JB").hide(); // 审核通过
  341. $(".thBtn").hide(); // 回退
  342. $(".associatWorkOrder").hide(); // 关联工单
  343. $(".undertakeUnitWrapper").hide(); // 承办单位
  344. $(".limittimeWrapper").hide(); // 办理时限
  345. $(".limittimesWrapper").hide(); // 紧急办理时限
  346. $(".limittimesWrapperCB").hide(); // 重办办理时限
  347. }
  348. // 营商管理 审核员审核 局营商办审核 0待审转办未审核、1待审转办已审核
  349. if (String(IsExamine) === "0") {
  350. $(".auditBtnMarketing").show(); // 营商审核
  351. $(".JB").hide(); // 审核通过
  352. } else if (String(IsExamine) === "1") {
  353. $(".auditBtnMarketing").hide(); // 营商审核
  354. $(".JB").show(); // 审核通过
  355. }
  356. // 多媒体审核:0待审转办1审核未通过2审核员待审核
  357. if (String(isshMultimedia) === "0" || String(isshMultimedia) === "1") {
  358. $(".JB").hide(); // 审核通过
  359. } else if (String(isshMultimedia) === "2") {
  360. $(".JB").hide(); // 审核通过
  361. $(".undertakeUnitWrapper").hide(); // 承办单位
  362. $(".limittimeWrapper").hide(); // 办理时限
  363. $(".limittimesWrapper").hide(); // 紧急办理时限
  364. }
  365. $("#reflectCategory").bind("input propertychange", function () {
  366. $(".layui-dropdown").hide();
  367. if ($("#reflectCategory").val() == "") {
  368. $(".reflectCategoryList-wrapper").hide();
  369. return;
  370. }
  371. var debounceGetSearchReactionCategory = debounce(getSearchReactionCategory, 500)
  372. $(".reflectCategoryList-wrapper").show();
  373. debounceGetSearchReactionCategory($("#reflectCategory").val())
  374. })
  375. $("#reflectCategoryList").on("click", "li", function () {
  376. $(".reflectCategoryList-wrapper").hide();
  377. $("#reflectCategory").val($(this).attr("indexName"));
  378. $("#PID").val($(this).attr("index"));
  379. });
  380. // 管理员、中心话务员可编辑工单内容
  381. if (roleCode === "GLY") {
  382. $("#content").removeAttr("readonly")
  383. } else if (roleCode === "ZXHWY") {
  384. $(".workcontent-wrapper").hide()
  385. $("#content").removeAttr("readonly")
  386. }
  387. //当即办理
  388. $(' input[name="banli"]').change(function () {
  389. var val = $(this).val();
  390. if (roleCode === "GLY" || roleCode === "ZXLD" || roleCode === "GNZY") {
  391. $(".Nows_box").show();
  392. } else {
  393. if (val == "1") {
  394. $(".Nows_box").show();
  395. } else {
  396. $(".Nows_box").hide();
  397. }
  398. }
  399. });
  400. $(".BC").click(function () {
  401. submit = 0;
  402. workType = ""
  403. Add();
  404. });
  405. $(".JB").click(function () {
  406. submit = 0;
  407. Add();
  408. });
  409. //上传附件
  410. $("#scwj").click(function () {
  411. $("#upFile").trigger("click");
  412. });
  413. $("#upFile").change(function () {
  414. upload();
  415. });
  416. //上传附件
  417. $("#scwjHandle").click(function () {
  418. $("#upFileHandle").trigger("click");
  419. })
  420. $("#upFileHandle").change(function () {
  421. uploadHandle();
  422. })
  423. $(".SavedSubmit").click(function () {
  424. submit = 1;
  425. Add();
  426. });
  427. $(".thBtn").click(function () {
  428. layer.open({
  429. type: 2,
  430. content: "../CommonHtml/BackDatil.html?wid=" + wid, //iframe的url,no代表不显示滚动条
  431. title: "工单回退",
  432. area: ["60%", "80%"], //宽高
  433. });
  434. });
  435. $(".associatWorkOrder").click(function () {
  436. layer.open({
  437. type: 2,
  438. content: "./associatWorkOrder.html?wid=" + wid, //iframe的url,no代表不显示滚动条
  439. title: "关联工单",
  440. area: ["95%", "95%"], //宽高
  441. });
  442. });
  443. // 营商审核
  444. $(".auditBtnMarketing").click(function () {
  445. $.ajax({
  446. type: "post",
  447. url: huayi.config.callcenter_url +
  448. "WorkOrder/BusinessApproved",
  449. dataType: "json",
  450. async: false,
  451. data: {
  452. token: $.cookie("token"),
  453. workorderid: wid,
  454. },
  455. success: function (data) {
  456. if (data.state.toLowerCase() == "success") {
  457. var index = parent.layer.getFrameIndex(window
  458. .name); //先得到当前iframe层的索引
  459. parent.layer.close(index); //再执行关闭
  460. parent.$("#orderlist").bootstrapTable("refresh");
  461. parent.layer.msg("操作成功");
  462. }
  463. },
  464. });
  465. })
  466. if (wid) {
  467. $.ajax({
  468. type: "get",
  469. url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrderNew",
  470. dataType: "json",
  471. async: false,
  472. data: {
  473. workorderid: wid,
  474. type: 0, // 工单信息
  475. token: $.cookie("token"),
  476. },
  477. success: function (data) {
  478. if (data.state.toLowerCase() == "success") {
  479. var Data = data.data.data;
  480. $("#cusname").val(Data[0].F_CusName);
  481. $("#cusphone").val(Data[0].F_CusPhone);
  482. $("#conphone").val(Data[0].F_ConPhone);
  483. $("#title").val(Data[0].F_ComTitle);
  484. $("#content").val(Data[0].F_ComContent);
  485. if (Data[0].F_Content === "" || Data[0].F_Content === null) {
  486. $('#workcontent').val(Data[0].F_ComContent);
  487. } else {
  488. $('#workcontent').val(Data[0].F_Content);
  489. }
  490. $("#zipcode").val(Data[0].F_ZipCode);
  491. $("#result").val(Data[0].F_Result);
  492. $("#reflectCategory").val(Data[0].KeyName)
  493. $("#PID").val(Data[0].F_Key)
  494. if (Data[0].F_Longitude) {
  495. $(".store_Lng").val(Data[0].F_Longitude);
  496. $(".store_Lat").val(Data[0].F_Latitude);
  497. }
  498. //x性别
  499. $("#SEX option:selected").val(
  500. Data[0].F_CusSex + ""
  501. );
  502. if (Data[0].F_CusSex == "0") {
  503. $("#SEX option:selected").text("男"); //乡镇
  504. } else {
  505. $("#SEX option:selected").text("女"); //乡镇
  506. }
  507. //来源
  508. $("#source option:selected").val(Data[0].F_InfoSource + "");
  509. $("#source option:selected").text(Data[0].SourceName); //来源
  510. if (Data[0].F_InfoSource + "" === "4") {
  511. $(".leaderCharge-wrapper").show()
  512. $("#leaderCharge").val(Data[0].F_SplitUser)
  513. } else if (Data[0].F_InfoSource + "" === "1") {
  514. // $(".phonetype-wrapper").show()
  515. // $("#phonetype").val(Data[0].F_PhoneType)
  516. }
  517. //事发区域
  518. $("#sourcearea option:selected").val(
  519. Data[0].F_SourceArea + ""
  520. );
  521. $("#sourcearea option:selected").text(
  522. Data[0].AreaName
  523. );
  524. // 根据事发区域获取乡镇
  525. getTownshipVillage($("#township"), Data[0].F_SourceArea)
  526. // 乡镇
  527. $("#township option:selected").val(
  528. Data[0].F_Township + ""
  529. );
  530. $("#township option:selected").text(
  531. Data[0].Township
  532. );
  533. // 根据事发区域获取乡镇
  534. getTownshipVillage($("#village"), Data[0].F_Township)
  535. // 村
  536. $("#village option:selected").val(
  537. Data[0].F_Village + ""
  538. );
  539. $("#village option:selected").text(
  540. Data[0].Village
  541. );
  542. //主题词
  543. $("#keys option:selected").val(
  544. Data[0].F_Key + ""
  545. );
  546. $("#keys option:selected").text(
  547. Data[0].KeyName
  548. ); //主题词
  549. //类型
  550. $("#type option:selected").val(
  551. Data[0].F_InfoType + ""
  552. );
  553. $("#type option:selected").text(
  554. Data[0].TypeName1
  555. ); //类型
  556. //紧急程度
  557. $("#level").val(Data[0].F_Level + "");
  558. if (workType === "cb") {
  559. $(".limittimeWrapper").hide()
  560. $(".limittimesWrapper").hide()
  561. $(".limittimesWrapperCB").show()
  562. } else if (workType === "jb" || workType === "zzbl" || workType === "jwthsh") {
  563. if (Data[0].F_Level == "2") {
  564. $("#level option:selected").text("紧急"); //乡镇
  565. $(".limittimesWrapper").show()
  566. $(".limittimeWrapper").hide()
  567. } else {
  568. $("#level option:selected").text("普通"); //乡镇
  569. $(".limittimesWrapper").hide()
  570. $(".limittimeWrapper").show()
  571. }
  572. }
  573. // 管理员、审核员、供暖专员 展示直办内容
  574. if (roleCode === "GLY" || roleCode === "ZXLD" || roleCode === "GNZY") {
  575. $(".Nows_box").show();
  576. } else {
  577. if (Data[0].F_IsResult == 1) {
  578. $(".Nows_box").toggle();
  579. }
  580. }
  581. $(
  582. ' input[name="mj"][value="' +
  583. Data[0].F_IsProtect +
  584. '"]'
  585. ).prop("checked", "checked");
  586. $(
  587. ' input[name="banli"][value="' +
  588. Data[0].F_IsResult +
  589. '"]'
  590. ).prop("checked", "checked");
  591. if (String(Data[0].F_Business) === "1") {
  592. $('#threeWayCall').attr("checked", true);
  593. } else {
  594. $('#threeWayCall').attr("checked", false);
  595. }
  596. $("#sourceaddress").val(
  597. Data[0].F_SourceAddress
  598. );
  599. $(".F_FinalOpinion").val(
  600. Data[0].F_FinalOpinion
  601. );
  602. $(Data[0].File).each(function (k, q) {
  603. var strs =
  604. '<span class="files" fiel-num="' +
  605. q.F_FileId +
  606. '">' +
  607. q.F_FileName.substring(19) +
  608. '<i class="fa fa-remove del_file"></i></span>';
  609. $(strs)
  610. .appendTo($(".fileBox"))
  611. .find(".del_file")
  612. .click(function (event) {
  613. event.stopPropagation();
  614. $(this).parent().remove();
  615. file_num();
  616. });
  617. file_num();
  618. });
  619. }
  620. },
  621. });
  622. }
  623. if (wid) {
  624. $.ajax({
  625. type: "get",
  626. url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrderNew",
  627. dataType: "json",
  628. async: false,
  629. data: {
  630. workorderid: wid,
  631. type: 4, // 办理情况
  632. token: $.cookie("token"),
  633. },
  634. success: function (data) {
  635. if (data.state.toLowerCase() == "success") {
  636. var Data = data.data.bldata;
  637. if (Data.length > 0) {
  638. $(Data[0].File).each(function (k, q) {
  639. var strs =
  640. '<span class="filesHandle" fiel-num="' +
  641. q.F_FileId +
  642. '">' +
  643. q.F_FileName.substring(19) +
  644. '<i class="fa fa-remove del_file"></i></span>';
  645. $(strs)
  646. .appendTo($(".fileBoxHandle"))
  647. .find(".del_file")
  648. .click(function (event) {
  649. event.stopPropagation();
  650. $(this).parent().remove();
  651. file_num();
  652. });
  653. file_num();
  654. });
  655. }
  656. }
  657. },
  658. });
  659. }
  660. // if (wid) {
  661. // $.ajax({
  662. // type: "get",
  663. // url: huayi.config.callcenter_url + "WorkOrder/GetWorkOrderNew",
  664. // dataType: "json",
  665. // async: false,
  666. // data: {
  667. // workorderid: wid,
  668. // type: 13, // 多媒体审核
  669. // token: $.cookie("token"),
  670. // },
  671. // success: function (data) {
  672. // if (data.state.toLowerCase() == "success") {
  673. // var Data = data.data.bldata;
  674. // if (Data.length > 0) {
  675. // }
  676. // }
  677. // },
  678. // });
  679. // }
  680. });
  681. ///修改工单
  682. function Add() {
  683. var jbSelect = $("#jbSelect").val() == null ? "" : $("#jbSelect").val().join(",");
  684. var startTime = $("#startTime").val();
  685. var limittimes = $("#limittimes").val();
  686. var ispd = $("#automaticDispatch").val() === "1" ? "1" : "0" // 自动派单
  687. var limittimesCB = $("#limittimesCB").val();
  688. var level = $("#level").val()
  689. var value = $(' input[name="banli"]:checked ').val();
  690. var content = $("#content").val();
  691. var threeWayCall;
  692. if ($('#threeWayCall').is(':checked')) {
  693. threeWayCall = 1;
  694. } else {
  695. threeWayCall = 0;
  696. }
  697. // 多单位,对应工单内容
  698. var manyUnitsDictionary = [];
  699. var manyUnitsData = $("#jbSelect").val()
  700. var manyUnitsDataObject = {}
  701. if (manyUnitsData && manyUnitsData.length > 0) {
  702. for (var i=0; i<manyUnitsData.length; i++) {
  703. manyUnitsDataObject = {
  704. id: manyUnitsData[i],
  705. content: $("#workcontent" + manyUnitsData[i]).val()
  706. }
  707. manyUnitsDictionary.push(manyUnitsDataObject)
  708. }
  709. }
  710. // if (!$("#cusname").val()) {
  711. // layer.msg("请输入姓名");
  712. // } else
  713. // if (!$("#cusphone").val()) {
  714. // layer.msg("请输入来电号码");
  715. // } else if (!$("#title").val()) {
  716. // layer.msg("请输入标题");
  717. // } else if (!$("#content").val()) {
  718. // layer.msg("请输入内容");
  719. // } else if (!$("#keys").val()) {
  720. // layer.msg("请选择主题词");
  721. // } else if (!$("#sourcearea").val()) {
  722. // layer.msg("请选择事发区域");
  723. // } else if (value == 1 && !$("#result").val()) {
  724. // layer.msg("请输入直办内容");
  725. // } else {
  726. $.ajax({
  727. type: "post",
  728. url: huayi.config.callcenter_url +
  729. "WorkOrder/EditWorkOrder",
  730. dataType: "json",
  731. async: true,
  732. data: {
  733. workorderid: wid,
  734. cusname: $("#cusname").val(), //=来电人姓名
  735. cussex: $("#SEX").val(),
  736. cusphone: $("#cusphone").val(), //=来电人电话
  737. zipcode: $("#zipcode").val(),
  738. conphone: $("#conphone").val(),
  739. title: $("#title").val(),
  740. content: $("#content").val(),
  741. workcontent: $("#workcontent").val(),
  742. files: $("#file").val(), // 工单附件(多个用英文逗号,隔开)
  743. file: $("#fileHandle").val(), // 办理附件(多个用英文逗号,隔开)
  744. sourcearea: $("#sourcearea").val(), //=事发地域id
  745. township: $("#township").val(), // 乡镇
  746. village: $("#village").val(), // 村
  747. sourceaddress: $("#sourceaddress").val(), //=事发详细地址
  748. source: $("#source").val(), //=来源
  749. splituser: $("#leaderCharge").val(), // 分管领导
  750. isresult: $(' input[name="banli"]:checked ').val(), //=(0转办1直办)
  751. business: threeWayCall,
  752. result: $("#result").val(),
  753. keys: $("#PID").val(), //=关键词id(多个用英文逗号,隔开) keys
  754. type: $("#type").val(), //=类型
  755. bigtype: $("#bigtype").val(), //=大类别
  756. smalltype: $("#smalltype").val(), //=小类别
  757. isprotect: $(' input[name="mj"]:checked ').val(), //=(0普通1保密)
  758. level: $("#level").val(), //=(1普通2紧急)
  759. visittype: $("#visittype").val(), // 回访方式
  760. maindeptids: jbSelect, // 承办单位
  761. // phonetype: $("#source").val() === "1" ? $("#phonetype").val() : "", // 电话类别
  762. issubmit: submit, //=(0保存1保存并提交)
  763. token: $.cookie("token"),
  764. },
  765. success: function (data) {
  766. if (data.state.toLowerCase() == "success") {
  767. if (workType === "cb") {
  768. layer.open({
  769. type: 2,
  770. content: "../CommonHtml/Cb.html?wid=" + wid + "&jbSelect=" +
  771. jbSelect + "&startTime=" + startTime + "&limittimes=" +
  772. limittimes + "&limittimesCB=" + limittimesCB +
  773. "&level=" + $("#level").val(), //iframe的url,no代表不显示滚动条
  774. title: "重办工单",
  775. area: ["95%", "95%"], //宽高
  776. });
  777. } else if (workType === "jb" || workType === "zzbl" || workType === "jwthsh") {
  778. layer.confirm(
  779. "确定交办?", {
  780. btn: ["是", "否"], //按钮
  781. },
  782. function () {
  783. assign(workType, jbSelect, startTime, limittimes, level, ispd, manyUnitsDictionary)
  784. }
  785. );
  786. } else {
  787. var index = parent.layer.getFrameIndex(
  788. window.name
  789. ); //先得到当前iframe层的索引
  790. parent.layer.close(index); //再执行关闭
  791. parent
  792. .$("#orderlist")
  793. .bootstrapTable("refresh");
  794. parent.layer.msg(data.message);
  795. }
  796. $(".fileBox").html("");
  797. }
  798. },
  799. });
  800. // }
  801. }
  802. $("#level").click(function () {
  803. var level = $("#level").val();
  804. if (workType === "cb") {
  805. $(".limittimesWrapperCB").show()
  806. } else if (workType === "jb" || workType === "zzbl" || workType === "jwthsh") {
  807. if (level === "2") {
  808. $(".limittimesWrapper").show()
  809. $(".limittimeWrapper").hide()
  810. } else {
  811. $(".limittimesWrapper").hide()
  812. $(".limittimeWrapper").show()
  813. }
  814. }
  815. })
  816. //上传文件隐藏域值
  817. function file_num() {
  818. var str = "";
  819. var Str;
  820. $(".fileBox .files").each(function (j, m) {
  821. var aa = $(m).attr("fiel-num");
  822. str += aa + ",";
  823. Str =
  824. str.substring(str.length - 1) == "," ?
  825. str.substring(0, str.length - 1) :
  826. str;
  827. });
  828. $("#file").val(Str);
  829. }
  830. //来源
  831. function LY(obj) {
  832. obj.empty();
  833. obj.append(
  834. '<option selected="selected" value="">请选择</option>'
  835. );
  836. $.ajax({
  837. type: "get",
  838. url: huayi.config.callcenter_url +
  839. "Dictionary/GetDicValueListById",
  840. dataType: "json",
  841. async: false,
  842. data: {
  843. token: $.cookie("token"),
  844. id: 1,
  845. },
  846. success: function (data) {
  847. if (data.state.toLowerCase() == "success") {
  848. var content = data.data;
  849. $(content).each(function (i, n) {
  850. $(
  851. "<option value='" +
  852. n.F_ValueId +
  853. "'>" +
  854. n.F_Value +
  855. "</option>"
  856. ).appendTo(obj);
  857. });
  858. }
  859. },
  860. });
  861. }
  862. //类别
  863. function LB(obj) {
  864. obj.empty();
  865. obj.append(
  866. '<option selected="selected" value="">请选择</option>'
  867. );
  868. $.ajax({
  869. type: "get",
  870. url: huayi.config.callcenter_url +
  871. "Dictionary/GetDicValueListById",
  872. dataType: "json",
  873. async: false,
  874. data: {
  875. token: $.cookie("token"),
  876. id: 2,
  877. },
  878. success: function (data) {
  879. if (data.state.toLowerCase() == "success") {
  880. var content = data.data;
  881. $(content).each(function (i, n) {
  882. $(
  883. "<option value='" +
  884. n.F_ValueId +
  885. "'>" +
  886. n.F_Value +
  887. "</option>"
  888. ).appendTo(obj);
  889. });
  890. }
  891. },
  892. });
  893. }
  894. // 主题
  895. function ZT(obj) {
  896. obj.empty();
  897. obj.append(
  898. '<option selected="selected" value="">请选择</option>'
  899. );
  900. $.ajax({
  901. type: "get",
  902. url: huayi.config.callcenter_url +
  903. "Dictionary/GetDicValueListById",
  904. dataType: "json",
  905. async: false,
  906. data: {
  907. token: $.cookie("token"),
  908. id: 3,
  909. },
  910. success: function (data) {
  911. if (data.state.toLowerCase() == "success") {
  912. var content = data.data;
  913. $(content).each(function (i, n) {
  914. $(
  915. "<option value='" +
  916. n.F_ValueId +
  917. "'>" +
  918. n.F_Value +
  919. "</option>"
  920. ).appendTo(obj);
  921. });
  922. }
  923. },
  924. });
  925. }
  926. //区域
  927. function QY(obj) {
  928. obj.empty();
  929. obj.append(
  930. '<option selected="selected" value="">请选择</option>'
  931. );
  932. $.ajax({
  933. type: "get",
  934. url: huayi.config.callcenter_url + "Area/GetAreaListById",
  935. dataType: "json",
  936. async: false,
  937. data: {
  938. token: $.cookie("token"),
  939. },
  940. success: function (data) {
  941. if (data.state.toLowerCase() == "success") {
  942. var content = data.data;
  943. $(content).each(function (i, n) {
  944. if (n.F_AreaName !== "市区") {
  945. // if (n.F_AreaName === "文峰区") {
  946. // $("<option value='" + n.F_AreaId + "' selected='selected'>" + n
  947. // .F_AreaName + "</option>").appendTo(obj);
  948. // } else {
  949. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName +
  950. "</option>").appendTo(obj);
  951. // }
  952. }
  953. });
  954. }
  955. },
  956. });
  957. }
  958. //获取乡镇、村
  959. function getTownshipVillage(obj, parentid) {
  960. obj.empty();
  961. obj.append('<option selected="selected" value="">请选择</option>');
  962. $.getJSON(
  963. huayi.config.callcenter_url + "Area/GetAreaChildren", {
  964. token: $.cookie("token"),
  965. parentid: parentid
  966. },
  967. function (data) {
  968. if (data.state.toLowerCase() == "success") {
  969. var content = data.data;
  970. $(content).each(function (i, n) {
  971. $("<option value='" + n.F_AreaId + "'>" + n.F_AreaName + "</option>").appendTo(
  972. obj);
  973. });
  974. }
  975. }
  976. );
  977. }
  978. // 获取乡镇
  979. $("#sourcearea").change(function () {
  980. getTownshipVillage($("#township"), $("#sourcearea").val())
  981. })
  982. // 获取村
  983. $("#township").change(function () {
  984. getTownshipVillage($("#village"), $("#township").val())
  985. })
  986. $("#source").change(function () {
  987. if ($("#source").val() === "4") {
  988. $(".leaderCharge-wrapper").show()
  989. // $(".phonetype-wrapper").hide()
  990. } else if ($("#source").val() === "1") {
  991. $(".leaderCharge-wrapper").hide()
  992. // $(".phonetype-wrapper").show()
  993. } else {
  994. $(".leaderCharge-wrapper").hide()
  995. // $(".phonetype-wrapper").hide()
  996. }
  997. })
  998. //上传文件
  999. function upload() {
  1000. var Files = document.getElementById("upFile").files;
  1001. if (Files.length > 0) {
  1002. var formData = new FormData();
  1003. for (var i = 0; i < Files.length; i++) {
  1004. formData.append("file" + i, Files[i]);
  1005. }
  1006. formData.append("token", $.cookie("token"));
  1007. var typeName = Files[0].name.split(".")[1];
  1008. if (
  1009. typeName == "png" ||
  1010. typeName == "jpg" ||
  1011. typeName == "mp4" ||
  1012. typeName == "mp3" ||
  1013. typeName == "pdf" ||
  1014. typeName == "doc" ||
  1015. typeName == "docx" ||
  1016. typeName == "xls" ||
  1017. typeName == "xlsx"
  1018. ) {
  1019. $.ajax({
  1020. url: huayi.config.callcenter_url +
  1021. "/WorkOrder/UploadFile",
  1022. type: "POST",
  1023. data: formData,
  1024. /**
  1025. *必须false才会自动加上正确的Content-Type
  1026. */
  1027. contentType: false,
  1028. /**
  1029. * 必须false才会避开jQuery对 formdata 的默认处理
  1030. * XMLHttpRequest会对 formdata 进行正确的处理
  1031. */
  1032. processData: false,
  1033. success: function (result) {
  1034. document.getElementById(
  1035. "upFile"
  1036. ).outerHTML = document.getElementById(
  1037. "upFile"
  1038. ).outerHTML;
  1039. $("#upFile").change(function () {
  1040. upload();
  1041. });
  1042. var r = $.parseJSON(result);
  1043. if (r.state.toLowerCase() == "success") {
  1044. var a = r.data;
  1045. $(a).each(function (i, n) {
  1046. var strs =
  1047. '<span class="files" fiel-num="' +
  1048. n.F_FileId +
  1049. '">' +
  1050. n.F_FileName.substring(19) +
  1051. '<i class="fa fa-remove del_file"></i></span>';
  1052. $(strs)
  1053. .appendTo($(".fileBox"))
  1054. .find(".del_file")
  1055. .click(function (event) {
  1056. event.stopPropagation();
  1057. $(this).parent().remove();
  1058. file_num();
  1059. });
  1060. });
  1061. file_num();
  1062. }
  1063. },
  1064. });
  1065. } else {
  1066. layer.msg("格式不正确");
  1067. }
  1068. } else {
  1069. layer.confirm("请上传文件!", {
  1070. btn: ["确定"],
  1071. });
  1072. }
  1073. }
  1074. //上传文件
  1075. function uploadHandle() {
  1076. var Files = document.getElementById("upFileHandle").files;
  1077. if (Files.length > 0) {
  1078. var formData = new FormData();
  1079. for (var i = 0; i < Files.length; i++) {
  1080. formData.append('file' + i, Files[i]);
  1081. }
  1082. formData.append("token", $.cookie("token"));
  1083. var typeName = Files[0].name.split('.')[1];
  1084. if (typeName == "png" || typeName == 'jpg' || typeName == 'mp4' || typeName == 'avi' || typeName ==
  1085. 'wmv' || typeName == 'mp3' || typeName == 'pdf' || typeName == 'doc' || typeName == 'docx' ||
  1086. typeName == 'xls' || typeName == 'xlsx') {
  1087. $.ajax({
  1088. url: huayi.config.callcenter_url + "/WorkOrder/UploadFile",
  1089. type: "POST",
  1090. data: formData,
  1091. /**
  1092. *必须false才会自动加上正确的Content-Type
  1093. */
  1094. contentType: false,
  1095. /**
  1096. * 必须false才会避开jQuery对 formdata 的默认处理
  1097. * XMLHttpRequest会对 formdata 进行正确的处理
  1098. */
  1099. processData: false,
  1100. success: function (result) {
  1101. document.getElementById("upFileHandle").outerHTML = document.getElementById("upFileHandle")
  1102. .outerHTML;
  1103. $("#upFileHandle").change(function () {
  1104. uploadHandle();
  1105. });
  1106. var r = $.parseJSON(result);
  1107. if (r.state.toLowerCase() == "success") {
  1108. var a = r.data;
  1109. $(a).each(function (i, n) {
  1110. var strs = '<span class="filesHandle" fiel-num="' + n.F_FileId +
  1111. '">' + n.F_FileName.substring(19) +
  1112. '<i class="fa fa-remove del_file"></i></span>'
  1113. $(strs).appendTo($('.fileBoxHandle')).find('.del_file').click(
  1114. function (event) {
  1115. event.stopPropagation();
  1116. $(this).parent().remove();
  1117. file_numHandle()
  1118. })
  1119. })
  1120. file_numHandle();
  1121. }
  1122. }
  1123. });
  1124. } else {
  1125. layer.msg("格式不正确");
  1126. }
  1127. } else {
  1128. layer.confirm('请上传文件!', {
  1129. btn: ['确定']
  1130. });
  1131. }
  1132. }
  1133. //上传文件隐藏域值
  1134. function file_numHandle() {
  1135. var str = '';
  1136. var Str;
  1137. $('.fileBoxHandle .filesHandle').each(function (j, m) {
  1138. var aa = $(m).attr("fiel-num")
  1139. str += aa + ",";
  1140. Str = (str.substring(str.length - 1) == ',') ? str.substring(0, str.length - 1) : str;
  1141. })
  1142. $("#fileHandle").val(Str);
  1143. }
  1144. function closePage() {
  1145. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  1146. parent.layer.close(index); //再执行关闭
  1147. parent.$("#orderlist").bootstrapTable("refresh");
  1148. parent.layer.msg("操作成功");
  1149. }
  1150. function jbSelect(obj) {
  1151. obj.empty();
  1152. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  1153. "token": $.cookie("token"),
  1154. "iscbdw": 2,
  1155. }, function (data) {
  1156. if (data.state.toLowerCase() == "success") {
  1157. var content = data.data;
  1158. $("<option value=''>请选择</option>").appendTo(obj);
  1159. $(content).each(function (i, n) {
  1160. if (String(n.F_IsDept) === "1") {
  1161. $("<option value='" + n.F_DeptId + "' data-text='" + n.F_DeptName + "' style='color: red !important'>" + n.F_DeptName + "</option>").appendTo(
  1162. obj);
  1163. } else if (String(n.F_IsDept) === "2") {
  1164. $("<option value='" + n.F_DeptId + "' style='color: blue !important'>" + n.F_DeptName + "</option>").appendTo(
  1165. obj);
  1166. }
  1167. // $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  1168. // obj);
  1169. })
  1170. obj.selectpicker({
  1171. noneSelectedText: '请选择' //默认显示内容
  1172. });
  1173. obj.selectpicker('refresh');
  1174. obj.selectpicker('render');
  1175. }
  1176. })
  1177. }
  1178. function xbSelect(obj) {
  1179. obj.empty();
  1180. $.getJSON(huayi.config.callcenter_url + "Department/GetDeptList", {
  1181. "token": $.cookie("token"),
  1182. "iscbdw": 1,
  1183. }, function (data) {
  1184. if (data.state.toLowerCase() == "success") {
  1185. var content = data.data;
  1186. $(content).each(function (i, n) {
  1187. $("<option value='" + n.F_DeptId + "'>" + n.F_DeptName + "</option>").appendTo(
  1188. obj);
  1189. })
  1190. obj.selectpicker({
  1191. noneSelectedText: '请选择' //默认显示内容
  1192. });
  1193. obj.selectpicker('refresh');
  1194. }
  1195. })
  1196. }
  1197. //电话类别
  1198. // function getPhoneType(obj) {
  1199. // obj.empty();
  1200. // $.ajax({
  1201. // type: "get",
  1202. // url: huayi.config.callcenter_url + "Dictionary/GetDicValueListById",
  1203. // dataType: "json",
  1204. // async: true,
  1205. // data: {
  1206. // "token": $.cookie("token"),
  1207. // id: 2498,
  1208. // },
  1209. // success: function (data) {
  1210. // if (data.state.toLowerCase() == "success") {
  1211. // var content = data.data;
  1212. // $(content).each(function (i, n) {
  1213. // $("<option value='" + n.F_Value + "'>" + n.F_Remark + "</option>")
  1214. // .appendTo(obj);
  1215. // })
  1216. // }
  1217. // }
  1218. // });
  1219. // }
  1220. function getReactionCategory(pid = 38) {
  1221. $.get(
  1222. huayi.config.callcenter_url + "Dictionary/GetZTreeNew", {
  1223. token: $.cookie("token"),
  1224. pid: pid,
  1225. },
  1226. function (result) {
  1227. result = $.parseJSON(result);
  1228. var content = JSON.parse(result.data);
  1229. layui.use("dropdown", function () {
  1230. var dropdown = layui.dropdown;
  1231. dropdown.render({
  1232. elem: "#reflectCategory", //可绑定在任意元素中,此处以上述按钮为例
  1233. data: content,
  1234. id: "reflectCategory",
  1235. //菜单被点击的事件
  1236. click: function (obj) {
  1237. $("#reflectCategory").val(obj.title);
  1238. $("#PID").val(obj.id);
  1239. },
  1240. });
  1241. });
  1242. }
  1243. );
  1244. }
  1245. function getSearchReactionCategory(key) {
  1246. $("#reflectCategoryList").empty();
  1247. $.get(
  1248. huayi.config.callcenter_url + "Dictionary/GetKeyListNew", {
  1249. token: $.cookie("token"),
  1250. key: key,
  1251. },
  1252. function (result) {
  1253. result = $.parseJSON(result);
  1254. if (result.state.toLowerCase() === "success") {
  1255. var content = result.data;
  1256. if (content.length > 0) {
  1257. content.forEach(function (e, i) {
  1258. $(
  1259. "<li index='" +
  1260. e.id +
  1261. "' indexName='" +
  1262. e.name +
  1263. "'>" +
  1264. e.names +
  1265. "</li>"
  1266. ).appendTo("#reflectCategoryList");
  1267. });
  1268. } else {
  1269. $("<li index='' indexName=''>没有相关数据</li>").appendTo(
  1270. "#reflectCategoryList"
  1271. );
  1272. }
  1273. }
  1274. }
  1275. );
  1276. }
  1277. function debounce(fun, delay) {
  1278. return function (args) {
  1279. var that = this;
  1280. var _args = args;
  1281. clearTimeout(fun.id);
  1282. fun.id = setTimeout(function () {
  1283. fun.call(that, _args);
  1284. }, delay);
  1285. };
  1286. }
  1287. function assign(workType, jbSelect, startTime, limittimes, level, ispd, manyUnitsDictionary) {
  1288. var assignedopinion = ""; // 交办意见
  1289. if (workType === "zzbl") {
  1290. assignAPI = "WorkOrder/HandleAssign"
  1291. } else {
  1292. assignAPI = "WorkOrder/AssignWorkOrderNew"
  1293. }
  1294. if (String(level) === "1") {
  1295. var assignedopinion = "请于1小时内与来电人取得联系(匿名除外),并于" + startTime +
  1296. "个工作日内内将办理情况反馈来电人,并将办理结果报市长便民公开电话受理中心,同时做好来电人信息保密工作。(若超期将进行通报;若无故不回复,将转交市委市政府督查局。)"
  1297. } else if (String(level) === "2") {
  1298. var assignedopinion = "请于1小时内与来电人取得联系(匿名除外),并于" + limittimes +
  1299. "内将办理情况反馈来电人,并将办理结果报市长便民公开电话受理中心,同时做好来电人信息保密工作。(若超期将进行通报;若无故不回复,将转交市委市政府督查局。)"
  1300. }
  1301. $.ajax({
  1302. type: "post",
  1303. url: huayi.config.callcenter_url + assignAPI,
  1304. dataType: 'json',
  1305. async: true,
  1306. data: {
  1307. workorderid: wid,
  1308. maindeptid: jbSelect, //承办单位
  1309. limittime: startTime, //办理时限
  1310. limittimes: limittimes, // 紧急办理时限
  1311. assignedopinion: assignedopinion, //交办意见
  1312. ispd: ispd, // 自动派单
  1313. state: 1, // 0保存,1保存并提交
  1314. content: manyUnitsDictionary,
  1315. assignid: "",
  1316. token: $.cookie("token"),
  1317. },
  1318. success: function (result) {
  1319. if (result.state.toLowerCase() == "success") {
  1320. if (workType === "jwthsh") {
  1321. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  1322. parent.layer.close(index); //再执行关闭
  1323. parent.layer.msg("操作成功");
  1324. parent.closePage();
  1325. } else {
  1326. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  1327. parent.layer.close(index); //再执行关闭
  1328. parent.$("#orderlist").bootstrapTable("refresh");
  1329. parent.layer.msg("操作成功");
  1330. }
  1331. }
  1332. }
  1333. })
  1334. }
  1335. $("#jbSelect").on("changed.bs.select", function(e, clickedIndex, isSelected, previousValue) {
  1336. organizerSelectedObj[String(e.target[clickedIndex].value)] = e.target[clickedIndex].label
  1337. $(".workcontentManyUnits").remove();
  1338. var data = $("#jbSelect").val().reverse();
  1339. var html = '';
  1340. if (data.length > 0) {
  1341. for (var i=0; i < data.length; i++) {
  1342. html = '<tr class="workcontentManyUnits">' +
  1343. '<th class="Importent">' + organizerSelectedObj[String(data[i])] + ':</th>' +
  1344. '<td colspan="7">' +
  1345. '<textarea data-adaptheight id="workcontent' +
  1346. data[i] +
  1347. '" class="form-control" name="" rows="" cols="" style="width: 100%;">' +
  1348. $("#workcontent").val() +
  1349. '</textarea>' +
  1350. '</td>'+
  1351. '</tr>';
  1352. $(".undertakeUnitWrapper").after(html)
  1353. }
  1354. }
  1355. })
  1356. </script>
  1357. </body>
  1358. </html>