| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <script src="../Script/Common/huayi.load.js"></script>
- <script src="../Script/Common/huayi.config.js"></script>
- <!--<link href="../js/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />-->
- <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <link rel="stylesheet" href="../css/notification/css/notifucation.css" />
- <link rel="stylesheet" href="../css/notification/css/addNotifucation.css">
- <title></title>
- <style type="text/css">
- .xl{
- right: -32px;
- }
- .orderType{
- /*width: 196px;*/
- height: 35px;
- padding: 0;
- }
- ul li{
- list-style: none;
- }
- .inpBox {
- border: 1px solid #cccccc;
- height: 31px;
- width: 77%;
- display: inline-block;
- position: relative;
- vertical-align: middle;
- position: absolute;
- /*left: 0px;
- top: 0px;*/
- z-index: 111;
- }
- .selDpart1{
- position: absolute;
- left: 0px;
- top: 30px;
- z-index: 11111;
- width: 220px;
- line-height: 30px;
- background: #FFFFFF;
- display: none;
- }
- #sponsor{
- width: 218px;
- border: 1px solid #00a1cb;
- margin: 0;
- padding: 0;
- list-style: none;
- max-height: 212px;
- overflow-x: hidden;
- overflow-y: scroll;
- }
- #sponsor li{
- margin: 0;
- padding-left: 10px;
- width: 220px;
- height: 30px;
- line-height: 30px;
- list-style: none;
- }
- #sponsor li:hover{
- background: #00a1cb;
- }
- .addTree {
- background: #fff;
- position: absolute;
- width: 100%;
- border: 1px solid darkgrey;
- right: 0;
- top: 29px;
- display: none;
- z-index: 222;
- }
-
- .xl {
- display: inline-block;
- background: url(../../img/dropDown.png) no-repeat;
- height: 100%;
- background-position: center center;
- width: 20px;
- position: absolute;
- right: 0;
- top: 0px;
- /* background-color: #f7bc8b; */
- cursor: pointer;
- }
-
- .ztree li span {
- border: none;
- padding: 0;
- }
-
- .inps {
- width: 76%;
- height: 29px;
- outline: none;
- border: 0;
- border-image-width: 0;
- padding: 0;
- padding-left: 3px;
- }
-
- .xl {
- display: inline-block;
- background: url(../img/dropDown.png) no-repeat;
- height: 100%;
- background-position: center center;
- width: 20px;
- position: absolute;
- right: 0;
- top: 0px;
- /* background-color: #f7bc8b; */
- cursor: pointer;
- }
-
- .Cleans {
- display: inline-block;
- width: 20px;
- position: absolute;
- right: 21px;
- top: 8px;
- display: none;
- }
- .reasons{
- display: none;
- }
- .other_reasons{
- width: 80%;
- position: absolute;
- }
- .other_contant{
- width: 80%;
- position: absolute;
- }
- </style>
- </head>
- <body>
- <div class="container" style="margin-left: 15px;">
- <div class="tab_contents" id="tab_user_contents">
- <ul class="project_items form-horizontal showtabs">
- <li class="form-group">
- <label for="customer_layer" class="col-md-2" >通报部门:</label>
- <div class="inpBox">
- <input type="text" class="inps" onkeyup="darptSearch()"/>
- <i class="Cleans fa fa-close"></i>
- <i class="xl xl_one"></i>
- <div class="addTree xlAdd">
- <ul id="addTreeDemo" class="ztree"></ul>
- </div>
- </div>
- </li>
- <li class="form-group">
- <label for="customer_layer" class="col-md-2" style="float: left;">通报原因:</label>
- <div class="col-md-9" style="width: 80%;position: absolute;left:110px;padding-left: 0;">
- <select name="" class="form-control orderType">
- <option value="0">请选择通报原因</option>
- </select>
- </div>
- </li>
- <li class="form-group drop_down reasons">
- <label for="customer_layer" class="col-md-2" style="float: left;">其他原因:</label>
- <textarea name="" rows="" cols="" class="other_reasons"></textarea>
- </li>
- <!--<li class="form-group drop_down">
- <label for="customer_layer" class="col-md-2" style="float: left;">通报内容:</label>
- <textarea name="" rows="" cols="" class="other_contant"></textarea>
- </li>-->
- </ul>
- <div class="form-group clearfix" style="text-align: center;">
- <div class="col-md-offset-5 col-md-10">
- <button class="project_save btn btn-primary" id="save_btns" type="submit">保存</button>
- </div>
- </div>
- </div>
- </div>
- <input type="hidden" id="PID" />
- <input type="hidden" id="Dpment" />
- <script type="text/javascript">
- $(function(){
- var id = helper.request.queryString("ids");
- tree();
- //所属分类下拉
- $('.inps').focus(function () {
- $('.xlAdd').css('display', 'block')
- })
- $('.xl').click(function () {
- if ($('.xlAdd').css('display') == 'block') {
- $('.xlAdd').css('display', 'none')
- } else {
- $('.xlAdd').css('display', 'block')
- }
- })
- $('.addTree').mouseleave(function () {
- $(this).css('display', 'none')
- })
- //清除
- $(".Cleans ").click(function () {
- $('.inps').val("");
- $("#PID").val("");
- $("#Dpment").val("");
- })
- //获取部门
- function tree() {
- $.get(huayi.config.callcenter_url + 'Department/GetDeptList', {
- "token": $.cookie("token"),
- // "pid": pid
- }, function (result) {
- result = $.parseJSON(result);
- $.fn.zTree.init($("#addTreeDemo"), setting1, result.data); //实例化树形图
- });
- }
- var setting1 = {
- data: {
- key: {
- name: "F_DeptName"
- },
- simpleData: {
- enable: true,
- idKey: "F_DeptId",
- pIdKey: "F_PartentId",
- rootPId: 0
- }
- },
- callback: {
- onClick: zTreeOnClick
- }
- };
- function zTreeOnClick(event, treeId, treeNode) {
- if (treeNode.level >= 2) {
- $('.inps').val(treeNode.F_DeptName);
- $("#PID").val(treeNode.F_DeptId);
- $("#Dpment").val(treeNode.F_DeptId);
- $(".Cleans").show();
- }
- };
- //通报原因
- getOrderType();
- function getOrderType() {
- $.get(huayi.config.callcenter_url + 'Dictionary/GetDicValueListByParentId', {
- "token": $.cookie("token"),
- pid: 69
- }, function(result) {
- result = $.parseJSON(result);
- var Count = result.data;
- $(Count).each(function(i, n) {
- $('<option value="' + n.F_ValueId + '">' + n.F_Value + '</option>').appendTo($(".orderType"));
- })
- });
- }
- $('.orderType').change(function(){
- if($('.orderType').val()==77){
- $('.reasons').css('display','block')
- }else{
- $('.reasons').css('display','none')
- }
- })
- $('#save_btns').click(function() {
- if($('#PID').val() == '') {
- layer.confirm('请选择 部门!', {
- btn: ['确定']
- });
- return;
- }
- var customertype=$('.orderType').val();
- var noticeinfo=$('.orderType option:selected').text();
- if(customertype==0){
- layer.msg('请填写通报原因');
- return
- // customertype='';
- // noticeinfo=''
- }else if(customertype==77 && !$('.other_reasons').val()){
- layer.msg('请填写其他原因')
- return
- }
- if(id){
- $.post(huayi.config.callcenter_url + 'NoticeCriticism/EditNotice', {
- nid:id,
- deptids:$('#PID').val(),
- noticeid:customertype,
- content: $('.other_reasons').val(),//其他原因
- noticeinfo: noticeinfo,//通报内容
- "token": $.cookie("token")
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.layer.msg("修改成功!");
- parent.$('#table1').bootstrapTable('refresh');
- }
- })
- }else{
- $.post(huayi.config.callcenter_url + 'NoticeCriticism/AddNotice', {
- deptids:$('#PID').val(),
- noticeid:customertype,
- content: $('.other_reasons').val(),//其他原因
- noticeinfo: noticeinfo,//通报内容
- "token": $.cookie("token")
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- parent.layer.close(index); //再执行关闭
- parent.layer.msg("保存成功!");
- parent.$('#table1').bootstrapTable('refresh');
- }
- })
- }
- })
- if(id) {
- $.get(huayi.config.callcenter_url + 'NoticeCriticism/GetNotice', {
- nid: id,
- "token": $.cookie("token")
- }, function(result) {
- result = $.parseJSON(result);
- if(result.state.toLowerCase() == "success") {
- var con = result.data;
- if(con.dModel.F_NoticeID==77){
- $('.reasons').css('display','block')
- }else{
- $('.reasons').css('display','none')
- }
- $('.inps').val(con.NoticeDeptName);//部门名称
- $("#PID").val(con.dModel.F_DeptIds);//部门id
- $('.orderType').val(con.dModel.F_NoticeID);//通报原因
- $('.other_reasons').val(con.dModel.F_Content);//其他原因
- }
- })
- }
- })
- </script>
- <!--<script src="../js/bootstrap-select/js/bootstrap-select.js"></script>-->
- <script src="../js/laydate/laydate.js"></script>
- <script src="../js/zTree/jquery.ztree.core.js"></script>
- </body>
- </html>
|