| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <!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="../css/layer/need/layer.css" />
- <link rel="stylesheet" href="../js/zTree/zTreeStyle.css" />
- <link rel="stylesheet" href="../css/init.css" />
- <title>交办</title>
- <style>
- .inpBox {
- border: 1px solid #a9a9a9;
- height: 27px;
- width: 220px;
- display: inline-block;
- position: relative;
- vertical-align: middle;
- }
-
- .addTree {
- background: #fff;
- position: absolute;
- width: 100%;
- border: 1px solid darkgrey;
- right: 0;
- top: 26px;
- display: none;
- }
-
- .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: 217px;
- height: 24px;
- 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;
- }
- </style>
- </head>
- <body>
- <div class="Common" style="height: 100%;">
- <table>
- <tr>
- <th class="Importent">办理时限:</th>
- <td> <input type="text" id="startTime" class="laydate-icon" style="height: 32px;"></td>
- </tr>
- <tr>
- <th class="Importent">交办单位:</th>
- <td>
- <div class="inpBox">
- <input type="text" class="inps" />
- <i class="xl xl_one"></i>
- <div class="addTree xlAdd">
- <ul id="addTreeDemo" class="ztree">
- </ul>
- </div>
- </div>
- </td>
- </tr>
- <tr>
- <th class="Importent">交办意见:</th>
- <td><textarea data-adaptheight id="assignedopinion" name="" rows="4" cols=""></textarea></td>
- <input type="hidden" id="ID" />
- <input type="hidden" id="PID" />
- <input type="hidden" id="Dpment" />
- </tr>
- </table>
- <div class="btn_box">
- <button class="btns BC">保存</button>
- <button class="btns Submit">保存并交办</button>
- </div>
- </div>
- <script src="../css/laydate/laydate.js"></script>
- <script src="../js/zTree/jquery.ztree.core.js"></script>
- <script src="../js/adjustHeight.js"></script>
- <script>
- var wid = helper.request.queryString("wid");
- var State;
- var a = $("#ID").val()
- $(".inps").val($("#Dpment").val());
- Detail();
- $(document).ready(function() {
- $(".inps").val($("#Dpment").val());
- //console.log(a);
- laydate.skin('blue');
- laydate({
- elem: '#startTime',
- event: 'focus'
- });
- $('.BC').click(function() {
- if($("#assignedopinion").val() == "") {
- layer.msg("交办意见不能为空");
- } else {
- State = 0;
- JA();
- }
- })
- $('.Submit').click(function() {
- if($("#assignedopinion").val() == "") {
- layer.msg("交办意见不能为空");
- } else {
- State = 1;
- JA();
- }
- });
- tree();
- 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_DeptName);
- }
- };
- //交办
- function JA() {
- $.post(huayi.config.callcenter_url + 'WorkOrder/AssignWorkOrder', {
- workorderid: wid,
- maindeptid: $("#PID").val(), //单位
- limittime: $("#startTime").val(), //办理时限
- assignedopinion: $('#assignedopinion').val(), //交办意见
- state: State,
- assignid: a,
- token: $.cookie("token")
- }, function(result) {
- result = JSON.parse(result);
- if(result.state.toLowerCase() == "success") {
- var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
- console.log(index);
- parent.layer.close(index); //再执行关闭
- parent.load();
- parent.layer.msg("交办成功");
- }
- })
- }
- //所属分类下拉
- $('.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')
- })
- //清除
- function Clean() {
- $("#startTime").val(''),
- $('#assignedopinion').val('')
- }
- });
- //草稿详情
- function Detail() {
- $.getJSON(huayi.config.callcenter_url + 'WorkOrder/GetDraftInfo', {
- workorderid: wid,
- type: 1,
- token: $.cookie("token")
- }, function(result) {
- if(result.state.toLowerCase() == "success") {
- if(result.data.length > 0) {
- $("#startTime").val(result.data[0].F_LimitTime);
- $('#assignedopinion').val(result.data[0].F_AssignedOpinion);
- a = result.data[0].F_Id;
- }
- }
- })
- }
- </script>
- </body>
- </html>
|