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

addNotification.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340
  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 href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />-->
  8. <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
  9. <link rel="stylesheet" href="../css/init.css" />
  10. <link rel="stylesheet" href="../css/notification/css/notifucation.css" />
  11. <link rel="stylesheet" href="../css/notification/css/addNotifucation.css">
  12. <title></title>
  13. <style type="text/css">
  14. .xl{
  15. right: -32px;
  16. }
  17. .orderType{
  18. /*width: 196px;*/
  19. height: 35px;
  20. padding: 0;
  21. }
  22. ul li{
  23. list-style: none;
  24. }
  25. .inpBox {
  26. border: 1px solid #cccccc;
  27. height: 31px;
  28. width: 77%;
  29. display: inline-block;
  30. position: relative;
  31. vertical-align: middle;
  32. position: absolute;
  33. /*left: 0px;
  34. top: 0px;*/
  35. z-index: 111;
  36. }
  37. .selDpart1{
  38. position: absolute;
  39. left: 0px;
  40. top: 30px;
  41. z-index: 11111;
  42. width: 220px;
  43. line-height: 30px;
  44. background: #FFFFFF;
  45. display: none;
  46. }
  47. #sponsor{
  48. width: 218px;
  49. border: 1px solid #00a1cb;
  50. margin: 0;
  51. padding: 0;
  52. list-style: none;
  53. max-height: 212px;
  54. overflow-x: hidden;
  55. overflow-y: scroll;
  56. }
  57. #sponsor li{
  58. margin: 0;
  59. padding-left: 10px;
  60. width: 220px;
  61. height: 30px;
  62. line-height: 30px;
  63. list-style: none;
  64. }
  65. #sponsor li:hover{
  66. background: #00a1cb;
  67. }
  68. .addTree {
  69. background: #fff;
  70. position: absolute;
  71. width: 100%;
  72. border: 1px solid darkgrey;
  73. right: 0;
  74. top: 29px;
  75. display: none;
  76. z-index: 222;
  77. }
  78. .xl {
  79. display: inline-block;
  80. background: url(../../img/dropDown.png) no-repeat;
  81. height: 100%;
  82. background-position: center center;
  83. width: 20px;
  84. position: absolute;
  85. right: 0;
  86. top: 0px;
  87. /* background-color: #f7bc8b; */
  88. cursor: pointer;
  89. }
  90. .ztree li span {
  91. border: none;
  92. padding: 0;
  93. }
  94. .inps {
  95. width: 76%;
  96. height: 29px;
  97. outline: none;
  98. border: 0;
  99. border-image-width: 0;
  100. padding: 0;
  101. padding-left: 3px;
  102. }
  103. .xl {
  104. display: inline-block;
  105. background: url(../img/dropDown.png) no-repeat;
  106. height: 100%;
  107. background-position: center center;
  108. width: 20px;
  109. position: absolute;
  110. right: 0;
  111. top: 0px;
  112. /* background-color: #f7bc8b; */
  113. cursor: pointer;
  114. }
  115. .Cleans {
  116. display: inline-block;
  117. width: 20px;
  118. position: absolute;
  119. right: 21px;
  120. top: 8px;
  121. display: none;
  122. }
  123. .reasons{
  124. display: none;
  125. }
  126. .other_reasons{
  127. width: 80%;
  128. position: absolute;
  129. }
  130. .other_contant{
  131. width: 80%;
  132. position: absolute;
  133. }
  134. </style>
  135. </head>
  136. <body>
  137. <div class="container" style="margin-left: 15px;">
  138. <div class="tab_contents" id="tab_user_contents">
  139. <ul class="project_items form-horizontal showtabs">
  140. <li class="form-group">
  141. <label for="customer_layer" class="col-md-2" >通报部门:</label>
  142. <div class="inpBox">
  143. <input type="text" class="inps" />
  144. <i class="Cleans fa fa-close"></i>
  145. <i class="xl xl_one"></i>
  146. <div class="addTree xlAdd">
  147. <ul id="addTreeDemo" class="ztree"></ul>
  148. </div>
  149. </div>
  150. </li>
  151. <li class="form-group">
  152. <label for="customer_layer" class="col-md-2" style="float: left;">通报原因:</label>
  153. <div class="col-md-9" style="width: 80%;position: absolute;left:110px;padding-left: 0;">
  154. <select name="" class="form-control orderType">
  155. <option value="0">请选择通报原因</option>
  156. </select>
  157. </div>
  158. </li>
  159. <li class="form-group drop_down reasons">
  160. <label for="customer_layer" class="col-md-2" style="float: left;">其他原因:</label>
  161. <textarea name="" rows="" cols="" class="other_reasons"></textarea>
  162. </li>
  163. <!--<li class="form-group drop_down">
  164. <label for="customer_layer" class="col-md-2" style="float: left;">通报内容:</label>
  165. <textarea name="" rows="" cols="" class="other_contant"></textarea>
  166. </li>-->
  167. </ul>
  168. <div class="form-group clearfix" style="text-align: center;">
  169. <div class="col-md-offset-5 col-md-10">
  170. <button class="project_save btn btn-primary" id="save_btns" type="submit">保存</button>
  171. </div>
  172. </div>
  173. </div>
  174. </div>
  175. <input type="hidden" id="PID" />
  176. <input type="hidden" id="Dpment" />
  177. <script type="text/javascript">
  178. $(function(){
  179. var id = helper.request.queryString("ids");
  180. tree();
  181. //所属分类下拉
  182. $('.inps').focus(function () {
  183. $('.xlAdd').css('display', 'block')
  184. })
  185. $('.xl').click(function () {
  186. if ($('.xlAdd').css('display') == 'block') {
  187. $('.xlAdd').css('display', 'none')
  188. } else {
  189. $('.xlAdd').css('display', 'block')
  190. }
  191. })
  192. $('.addTree').mouseleave(function () {
  193. $(this).css('display', 'none')
  194. })
  195. //清除
  196. $(".Cleans ").click(function () {
  197. $('.inps').val("");
  198. $("#PID").val("");
  199. $("#Dpment").val("");
  200. })
  201. //获取部门
  202. function tree() {
  203. $.get(huayi.config.callcenter_url + 'Department/GetDeptList', {
  204. "token": $.cookie("token"),
  205. // "pid": pid
  206. }, function (result) {
  207. result = $.parseJSON(result);
  208. $.fn.zTree.init($("#addTreeDemo"), setting1, result.data); //实例化树形图
  209. });
  210. }
  211. var setting1 = {
  212. data: {
  213. key: {
  214. name: "F_DeptName"
  215. },
  216. simpleData: {
  217. enable: true,
  218. idKey: "F_DeptId",
  219. pIdKey: "F_PartentId",
  220. rootPId: 0
  221. }
  222. },
  223. callback: {
  224. onClick: zTreeOnClick
  225. }
  226. };
  227. function zTreeOnClick(event, treeId, treeNode) {
  228. if (treeNode.level >= 2) {
  229. $('.inps').val(treeNode.F_DeptName);
  230. $("#PID").val(treeNode.F_DeptId);
  231. $("#Dpment").val(treeNode.F_DeptId);
  232. $(".Cleans").show();
  233. }
  234. };
  235. //通报原因
  236. getOrderType();
  237. function getOrderType() {
  238. $.get(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByParentId', {
  239. "token": $.cookie("token"),
  240. pid: 69
  241. }, function(result) {
  242. result = $.parseJSON(result);
  243. var Count = result.data;
  244. $(Count).each(function(i, n) {
  245. $('<option value="' + n.F_ValueId + '">' + n.F_Value + '</option>').appendTo($(".orderType"));
  246. })
  247. });
  248. }
  249. $('.orderType').change(function(){
  250. if($('.orderType').val()==77){
  251. $('.reasons').css('display','block')
  252. }else{
  253. $('.reasons').css('display','none')
  254. }
  255. })
  256. $('#save_btns').click(function() {
  257. if($('#PID').val() == '') {
  258. layer.confirm('请选择 部门!', {
  259. btn: ['确定']
  260. });
  261. return;
  262. }
  263. var customertype=$('.orderType').val();
  264. var noticeinfo=$('.orderType option:selected').text();
  265. if(customertype==0){
  266. layer.msg('请填写通报原因');
  267. return
  268. // customertype='';
  269. // noticeinfo=''
  270. }else if(customertype==77 && !$('.other_reasons').val()){
  271. layer.msg('请填写其他原因')
  272. return
  273. }
  274. if(id){
  275. $.post(huayi.config.callcenter_url + 'NoticeCriticism/EditNotice', {
  276. nid:id,
  277. deptids:$('#PID').val(),
  278. noticeid:customertype,
  279. content: $('.other_reasons').val(),//其他原因
  280. noticeinfo: noticeinfo,//通报内容
  281. "token": $.cookie("token")
  282. }, function(result) {
  283. result = $.parseJSON(result);
  284. if(result.state.toLowerCase() == "success") {
  285. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  286. parent.layer.close(index); //再执行关闭
  287. parent.layer.msg("修改成功!");
  288. parent.$('#table1').bootstrapTable('refresh');
  289. }
  290. })
  291. }else{
  292. $.post(huayi.config.callcenter_url + 'NoticeCriticism/AddNotice', {
  293. deptids:$('#PID').val(),
  294. noticeid:customertype,
  295. content: $('.other_reasons').val(),//其他原因
  296. noticeinfo: noticeinfo,//通报内容
  297. "token": $.cookie("token")
  298. }, function(result) {
  299. result = $.parseJSON(result);
  300. if(result.state.toLowerCase() == "success") {
  301. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  302. parent.layer.close(index); //再执行关闭
  303. parent.layer.msg("保存成功!");
  304. parent.$('#table1').bootstrapTable('refresh');
  305. }
  306. })
  307. }
  308. })
  309. if(id) {
  310. $.get(huayi.config.callcenter_url + 'NoticeCriticism/GetNotice', {
  311. nid: id,
  312. "token": $.cookie("token")
  313. }, function(result) {
  314. result = $.parseJSON(result);
  315. if(result.state.toLowerCase() == "success") {
  316. var con = result.data;
  317. if(con.dModel.F_NoticeID==77){
  318. $('.reasons').css('display','block')
  319. }else{
  320. $('.reasons').css('display','none')
  321. }
  322. $('.inps').val(con.NoticeDeptName);//部门名称
  323. $("#PID").val(con.dModel.F_DeptIds);//部门id
  324. $('.orderType').val(con.dModel.F_NoticeID);//通报原因
  325. $('.other_reasons').val(con.dModel.F_Content);//其他原因
  326. }
  327. })
  328. }
  329. })
  330. </script>
  331. <!--<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>-->
  332. <script src="../js/laydate/laydate.js"></script>
  333. <script src="../js/zTree/jquery.ztree.core.js"></script>
  334. </body>
  335. </html>