商丘12345 前端

addAppealOrder.html 12KB

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