商丘12345 前端

addAppealOrder.html 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  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. border-color: rgb(169, 169, 169);
  22. }
  23. ul li{
  24. list-style: none;
  25. }
  26. .inpBox {
  27. border: 1px solid #cccccc;
  28. height: 31px;
  29. width: 75%;
  30. display: inline-block;
  31. position: relative;
  32. vertical-align: middle;
  33. position: absolute;
  34. /*left: 0px;
  35. top: 0px;*/
  36. z-index: 111;
  37. }
  38. .selDpart1{
  39. position: absolute;
  40. left: 0px;
  41. top: 30px;
  42. z-index: 11111;
  43. width: 220px;
  44. line-height: 30px;
  45. background: #FFFFFF;
  46. display: none;
  47. }
  48. #sponsor{
  49. width: 218px;
  50. border: 1px solid #00a1cb;
  51. margin: 0;
  52. padding: 0;
  53. list-style: none;
  54. max-height: 212px;
  55. overflow-x: hidden;
  56. overflow-y: scroll;
  57. }
  58. #sponsor li{
  59. margin: 0;
  60. padding-left: 10px;
  61. width: 220px;
  62. height: 30px;
  63. line-height: 30px;
  64. list-style: none;
  65. }
  66. #sponsor li:hover{
  67. background: #00a1cb;
  68. }
  69. .addTree {
  70. background: #fff;
  71. position: absolute;
  72. width: 100%;
  73. border: 1px solid darkgrey;
  74. right: 0;
  75. top: 29px;
  76. display: none;
  77. z-index: 222;
  78. }
  79. .xl {
  80. display: inline-block;
  81. background: url(../../img/dropDown.png) no-repeat;
  82. height: 100%;
  83. background-position: center center;
  84. width: 20px;
  85. position: absolute;
  86. right: 0;
  87. top: 0px;
  88. /* background-color: #f7bc8b; */
  89. cursor: pointer;
  90. }
  91. .ztree li span {
  92. border: none;
  93. padding: 0;
  94. }
  95. .inps {
  96. width: 76%;
  97. height: 29px;
  98. outline: none;
  99. border: 0;
  100. border-image-width: 0;
  101. padding: 0;
  102. padding-left: 3px;
  103. }
  104. .xl {
  105. display: inline-block;
  106. background: url(../img/dropDown.png) no-repeat;
  107. height: 100%;
  108. background-position: center center;
  109. width: 20px;
  110. position: absolute;
  111. right: 0;
  112. top: 0px;
  113. /* background-color: #f7bc8b; */
  114. cursor: pointer;
  115. }
  116. .Cleans {
  117. display: inline-block;
  118. width: 20px;
  119. position: absolute;
  120. right: 21px;
  121. top: 8px;
  122. display: none;
  123. }
  124. .reasons{
  125. display: none;
  126. }
  127. .other_reasons{
  128. width: 75%;
  129. }
  130. .remark{
  131. width: 75%;
  132. }
  133. </style>
  134. </head>
  135. <body>
  136. <div class="container" style="margin-left: 15px;">
  137. <div class="tab_contents" id="tab_user_contents">
  138. <ul class="project_items form-horizontal showtabs">
  139. <li class="form-group">
  140. <label for="customer_layer" class="col-md-2" >通报部门:</label>
  141. <div class="inpBox">
  142. <input type="text" class="inps" onkeyup="darptSearch()"/>
  143. <i class="Cleans fa fa-close"></i>
  144. <i class="xl xl_one"></i>
  145. <div class="addTree xlAdd">
  146. <ul id="addTreeDemo" class="ztree"></ul>
  147. </div>
  148. </div>
  149. </li>
  150. <li class="form-group">
  151. <label for="customer_layer" class="col-md-2" style="float: left;">通报原因:</label>
  152. <div class="col-md-9" style="width: 75%; float: left; padding: 0;">
  153. <select name="" class="form-control orderType">
  154. <option value="0">请选择通报原因</option>
  155. </select>
  156. </div>
  157. </li>
  158. <li class="form-group drop_down reasons">
  159. <label for="customer_layer" class="col-md-2" style="float: left;">其他原因:</label>
  160. <textarea name="" rows="" cols="" class="other_reasons"></textarea>
  161. </li>
  162. <li class="form-group drop_down">
  163. <label class="col-md-2" style="float: left;">申诉详情:</label>
  164. <textarea name="" rows="" cols="" class="remark"></textarea>
  165. </li>
  166. </ul>
  167. <div class="form-group clearfix" style="text-align: center;">
  168. <div class="col-md-offset-5 col-md-10">
  169. <button class="project_save btn btn-primary" id="save_btns" type="submit">保存</button>
  170. </div>
  171. </div>
  172. </div>
  173. </div>
  174. <input type="hidden" id="PID" />
  175. <input type="hidden" id="Dpment" />
  176. <script type="text/javascript">
  177. $(function(){
  178. var id = helper.request.queryString("ids");
  179. var wid = helper.request.queryString("wid")
  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 + 'Appeal/EditAppeal', {
  276. nid:id,
  277. deptids:$('#PID').val(),
  278. noticeid:customertype,
  279. content: $('.other_reasons').val(),//其他原因
  280. noticeinfo: noticeinfo,//通报内容
  281. remark: $(".remark").val(),//申诉详情
  282. "token": $.cookie("token")
  283. }, function(result) {
  284. result = $.parseJSON(result);
  285. if(result.state.toLowerCase() == "success") {
  286. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  287. parent.layer.close(index); //再执行关闭
  288. parent.layer.msg("修改成功!");
  289. parent.$('#table1').bootstrapTable('refresh');
  290. }
  291. })
  292. } else if (wid){
  293. $.post(huayi.config.callcenter_url + 'Appeal/AddAppeal', {
  294. deptids: $('#PID').val(),
  295. noticeid: customertype,
  296. content: $('.other_reasons').val(),//其他原因
  297. noticeinfo: noticeinfo,//通报内容
  298. workorderid: wid, //工单编号
  299. remark: $(".remark").val(),//申诉详情
  300. "token": $.cookie("token")
  301. }, function(result) {
  302. result = $.parseJSON(result);
  303. if(result.state.toLowerCase() == "success") {
  304. var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
  305. parent.layer.close(index); //再执行关闭
  306. parent.layer.msg("保存成功!");
  307. parent.$('#table1').bootstrapTable('refresh');
  308. }
  309. })
  310. }
  311. })
  312. // 申诉详情
  313. if(id) {
  314. $.get(huayi.config.callcenter_url + 'Appeal/GetAppeal', {
  315. nid: id,
  316. "token": $.cookie("token")
  317. }, function(result) {
  318. result = $.parseJSON(result);
  319. if(result.state.toLowerCase() == "success") {
  320. var con = result.data;
  321. if(con.dModel.F_NoticeID==77){
  322. $('.reasons').css('display','block')
  323. }else{
  324. $('.reasons').css('display','none')
  325. }
  326. $('.inps').val(con.NoticeDeptName);//部门名称
  327. $("#PID").val(con.dModel.F_DeptIds);//部门id
  328. $('.orderType').val(con.dModel.F_NoticeID);//通报原因
  329. $('.other_reasons').val(con.dModel.F_Content);//其他原因
  330. $('.remark').val(con.dModel.F_Remark);//其他原因
  331. }
  332. })
  333. }
  334. })
  335. </script>
  336. <!--<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>-->
  337. <script src="../js/laydate/laydate.js"></script>
  338. <script src="../js/zTree/jquery.ztree.core.js"></script>
  339. </body>
  340. </html>