商丘12345 前端

addAppealOrder.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  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: 78%;
  128. }
  129. .remark{
  130. width: 78%;
  131. }
  132. .other_contant{
  133. width: 80%;
  134. position: absolute;
  135. }
  136. </style>
  137. </head>
  138. <body>
  139. <div class="container" style="margin-left: 15px;">
  140. <div class="tab_contents" id="tab_user_contents">
  141. <ul class="project_items form-horizontal showtabs">
  142. <li class="form-group">
  143. <label for="customer_layer" class="col-md-2" >通报部门:</label>
  144. <div class="inpBox">
  145. <input type="text" class="inps" onkeyup="darptSearch()"/>
  146. <i class="Cleans fa fa-close"></i>
  147. <i class="xl xl_one"></i>
  148. <div class="addTree xlAdd">
  149. <ul id="addTreeDemo" class="ztree"></ul>
  150. </div>
  151. </div>
  152. </li>
  153. <li class="form-group">
  154. <label for="customer_layer" class="col-md-2" style="float: left;">通报原因:</label>
  155. <div class="col-md-9" style="width: 80%; float: left; padding-left: 0;">
  156. <select name="" class="form-control orderType">
  157. <option value="0">请选择通报原因</option>
  158. </select>
  159. </div>
  160. </li>
  161. <li class="form-group drop_down reasons">
  162. <label for="customer_layer" class="col-md-2" style="float: left;">其他原因:</label>
  163. <textarea name="" rows="" cols="" class="other_reasons"></textarea>
  164. </li>
  165. <li class="form-group drop_down">
  166. <label class="col-md-2" style="float: left;">申诉详情:</label>
  167. <textarea name="" rows="" cols="" class="remark"></textarea>
  168. </li>
  169. </ul>
  170. <div class="form-group clearfix" style="text-align: center;">
  171. <div class="col-md-offset-5 col-md-10">
  172. <button class="project_save btn btn-primary" id="save_btns" type="submit">保存</button>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. <input type="hidden" id="PID" />
  178. <input type="hidden" id="Dpment" />
  179. <script type="text/javascript">
  180. $(function(){
  181. var id = helper.request.queryString("ids");
  182. tree();
  183. //所属分类下拉
  184. $('.inps').focus(function () {
  185. $('.xlAdd').css('display', 'block')
  186. })
  187. $('.xl').click(function () {
  188. if ($('.xlAdd').css('display') == 'block') {
  189. $('.xlAdd').css('display', 'none')
  190. } else {
  191. $('.xlAdd').css('display', 'block')
  192. }
  193. })
  194. $('.addTree').mouseleave(function () {
  195. $(this).css('display', 'none')
  196. })
  197. //清除
  198. $(".Cleans ").click(function () {
  199. $('.inps').val("");
  200. $("#PID").val("");
  201. $("#Dpment").val("");
  202. })
  203. //获取部门
  204. function tree() {
  205. $.get(huayi.config.callcenter_url + 'Department/GetDeptList', {
  206. "token": $.cookie("token"),
  207. // "pid": pid
  208. }, function (result) {
  209. result = $.parseJSON(result);
  210. $.fn.zTree.init($("#addTreeDemo"), setting1, result.data); //实例化树形图
  211. });
  212. }
  213. var setting1 = {
  214. data: {
  215. key: {
  216. name: "F_DeptName"
  217. },
  218. simpleData: {
  219. enable: true,
  220. idKey: "F_DeptId",
  221. pIdKey: "F_PartentId",
  222. rootPId: 0
  223. }
  224. },
  225. callback: {
  226. onClick: zTreeOnClick
  227. }
  228. };
  229. function zTreeOnClick(event, treeId, treeNode) {
  230. if (treeNode.level >= 2) {
  231. $('.inps').val(treeNode.F_DeptName);
  232. $("#PID").val(treeNode.F_DeptId);
  233. $("#Dpment").val(treeNode.F_DeptId);
  234. $(".Cleans").show();
  235. }
  236. };
  237. //通报原因
  238. getOrderType();
  239. function getOrderType() {
  240. $.get(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByParentId', {
  241. "token": $.cookie("token"),
  242. pid: 69
  243. }, function(result) {
  244. result = $.parseJSON(result);
  245. var Count = result.data;
  246. $(Count).each(function(i, n) {
  247. $('<option value="' + n.F_ValueId + '">' + n.F_Value + '</option>').appendTo($(".orderType"));
  248. })
  249. });
  250. }
  251. $('.orderType').change(function() {
  252. if($('.orderType').val()==77){
  253. $('.reasons').css('display','block')
  254. }else{
  255. $('.reasons').css('display','none')
  256. }
  257. })
  258. $('#save_btns').click(function() {
  259. if($('#PID').val() == '') {
  260. layer.confirm('请选择 部门!', {
  261. btn: ['确定']
  262. });
  263. return;
  264. }
  265. var customertype=$('.orderType').val();
  266. var noticeinfo=$('.orderType option:selected').text();
  267. if(customertype==0){
  268. layer.msg('请填写通报原因');
  269. return
  270. // customertype='';
  271. // noticeinfo=''
  272. }else if(customertype==77 && !$('.other_reasons').val()){
  273. layer.msg('请填写其他原因')
  274. return
  275. }
  276. if(id){
  277. $.post(huayi.config.callcenter_url + 'Appeal/EditAppeal', {
  278. nid:id,
  279. deptids:$('#PID').val(),
  280. noticeid:customertype,
  281. content: $('.other_reasons').val(),//其他原因
  282. noticeinfo: noticeinfo,//通报内容
  283. remark: $(".remark").val(),//申诉详情
  284. "token": $.cookie("token")
  285. }, function(result) {
  286. result = $.parseJSON(result);
  287. if(result.state.toLowerCase() == "success") {
  288. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  289. parent.layer.close(index); //再执行关闭
  290. parent.layer.msg("修改成功!");
  291. parent.$('#table1').bootstrapTable('refresh');
  292. }
  293. })
  294. }else{
  295. $.post(huayi.config.callcenter_url + 'Appeal/AddAppeal', {
  296. deptids:$('#PID').val(),
  297. noticeid:customertype,
  298. content: $('.other_reasons').val(),//其他原因
  299. noticeinfo: noticeinfo,//通报内容
  300. remark: $(".remark").val(),//申诉详情
  301. "token": $.cookie("token")
  302. }, function(result) {
  303. result = $.parseJSON(result);
  304. if(result.state.toLowerCase() == "success") {
  305. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  306. parent.layer.close(index); //再执行关闭
  307. parent.layer.msg("保存成功!");
  308. parent.$('#table1').bootstrapTable('refresh');
  309. }
  310. })
  311. }
  312. })
  313. // 申诉详情
  314. if(id) {
  315. $.get(huayi.config.callcenter_url + 'Appeal/GetAppeal', {
  316. nid: id,
  317. "token": $.cookie("token")
  318. }, function(result) {
  319. result = $.parseJSON(result);
  320. if(result.state.toLowerCase() == "success") {
  321. var con = result.data;
  322. if(con.dModel.F_NoticeID==77){
  323. $('.reasons').css('display','block')
  324. }else{
  325. $('.reasons').css('display','none')
  326. }
  327. $('.inps').val(con.NoticeDeptName);//部门名称
  328. $("#PID").val(con.dModel.F_DeptIds);//部门id
  329. $('.orderType').val(con.dModel.F_NoticeID);//通报原因
  330. $('.other_reasons').val(con.dModel.F_Content);//其他原因
  331. $('.remark').val(con.dModel.F_Remark);//其他原因
  332. }
  333. })
  334. }
  335. })
  336. </script>
  337. <!--<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>-->
  338. <script src="../js/laydate/laydate.js"></script>
  339. <script src="../js/zTree/jquery.ztree.core.js"></script>
  340. </body>
  341. </html>